示例#1
0
void PopupMenu::changed(ConstFieldMaskArg whichField, 
                            UInt32            origin,
                            BitVector         details)
{
    Inherited::changed(whichField, origin, details);

    if(whichField & VisibleFieldMask)
    {
        if(getVisible())
        {
            producePopupMenuWillBecomeVisible(PopupMenuEvent::create(PopupMenuRefPtr(this), getSystemTime()));
        }
        else
        {
            producePopupMenuWillBecomeInvisible(PopupMenuEvent::create(PopupMenuRefPtr(this), getSystemTime()));
            if(getSelectionModel() != NULL)
            {
                getSelectionModel()->clearSelection();
            }
            removeMousePresenceOnComponents();
        }
    }

    if(whichField & SizeFieldMask)
    {
        updateSeparatorSizes();
    }

    if(whichField & SelectionModelFieldMask && getSelectionModel() != NULL)
    {
        getSelectionModel()->addSelectionListener(&_MenuSelectionListener);
    }
}
示例#2
0
void Toolbar::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 & SizeFieldMask)
    {
        updateSeparatorSizes();
    }
}
示例#3
0
void Toolbar::setOrientation(BoxLayout::Orientation TheOrientation)
{
    dynamic_cast<BoxLayout*>(getLayout())->setOrientation(TheOrientation);

    Separator::Orientation Or;
    if(TheOrientation == BoxLayout::VERTICAL_ORIENTATION)
    {
        Or = Separator::HORIZONTAL_ORIENTATION;
    }
    else
    {
        Or = Separator::VERTICAL_ORIENTATION;
    }

    for(UInt32 i(0) ; i<getMFChildren()->size() ; ++i)
    {
        if(getChildren(i)->getType() == Separator::getClassType())
        {
            dynamic_cast<Separator*>(getChildren(i))->setOrientation(Or);
        }
    }

    updateSeparatorSizes();
}