Exemplo n.º 1
0
void AbstractWindow::changed(ConstFieldMaskArg whichField, 
                            UInt32            origin,
                            BitVector         details)
{
    Inherited::changed(whichField, origin, details);

    //Do not respond to changes that have a Sync origin
    if(origin & ChangedOrigin::Sync)
    {
        return;
    }

    if( whichField & (AlignmentInDrawingSurfaceFieldMask |
                      ScalingInDrawingSurfaceFieldMask))
    {
        updateContainerLayout();
    }
}
void GenericFieldContainerEditor::changed(ConstFieldMaskArg whichField, 
                            UInt32            origin,
                            BitVector         details)
{
    Inherited::changed(whichField, origin, details);

    //Do not respond to changes that have a Sync origin
    if(origin & ChangedOrigin::Sync)
    {
        return;
    }

    if( whichField & ChildrenFieldMask)
    {
        //Layout needs to be recalculated for my parent ComponentContainer
        updateContainerLayout();
    }

    if( (whichField & ShowFieldsFieldMask) ||
        (whichField & ShowEventsFieldMask))
    {
        updateShownPanels();
    }
}
Exemplo n.º 3
0
void Component::changed(ConstFieldMaskArg whichField, 
                        UInt32            origin,
                        BitVector         details)
{
    Inherited::changed(whichField, origin, details);

    //Do not respond to changes that have a Sync origin
    if(origin & ChangedOrigin::Sync)
    {
        return;
    }

    if( (whichField & MinSizeFieldMask) ||
        (whichField & MaxSizeFieldMask) ||
        (whichField & PreferredSizeFieldMask) ||
        (whichField & ConstraintsFieldMask))
    {
        //Layout needs to be recalculated for my parent ComponentContainer
        updateContainerLayout();
    }

    if( (whichField & SizeFieldMask) ||
        (whichField & PositionFieldMask) )
    {
        updateClipBounds();
    }

    if( (whichField & SizeFieldMask) )
    {
        produceComponentResized();
    }
    if( (whichField & PositionFieldMask) )
    {
        produceComponentMoved();
    }
    if( (whichField & StateFieldMask) )
    {
        if(getEnabled())
        {
            produceComponentEnabled();    
        }
        else
        {
            produceComponentDisabled();    
        }

        if(getVisible())
        {
            produceComponentVisible();    
        }
        else
        {
            produceComponentHidden();    
        }
    }

    if(whichField & ToolTipFieldMask)
    {
        _ToolTipActivateMouseEnterConnection.disconnect();
        _ToolTipActivateMouseExitConnection.disconnect();

        if(getToolTip() != NULL)
        {
            getToolTip()->setVisible(true);
            getToolTip()->setEnabled(true);
            getToolTip()->updateClipBounds();

            getToolTip()->setPosition(Pnt2f(0.0f,0.0f));

            _ToolTipActivateMouseEnterConnection = connectMouseEntered(boost::bind(&Component::handleToolTipActivateMouseEntered, this, _1));
            _ToolTipActivateMouseExitConnection = connectMouseExited(boost::bind(&Component::handleToolTipActivateMouseExited, this, _1));
        }
    }

    if((whichField & CursorFieldMask) &&
       getMouseOver() &&
       getParentWindow() != NULL &&
       getParentWindow()->getParentDrawingSurface() != NULL &&
       getParentWindow()->getParentDrawingSurface()->getEventProducer() != NULL)
    {
        getParentWindow()->getParentDrawingSurface()->getEventProducer()->setCursorType(getCursor());
    }
}