diff --git a/bin/assets/layouts/test.css b/bin/assets/layouts/test.css index fc8758929..b537684f9 100644 --- a/bin/assets/layouts/test.css +++ b/bin/assets/layouts/test.css @@ -35,11 +35,11 @@ ProgressBar { padding: 2dp; } -WinMenu { +MenuBar { padding-left: 1dp; } -WinMenu::button { +MenuBar::button { padding-left: -3dp; padding-right: -3dp; } diff --git a/bin/assets/ui/breeze.css b/bin/assets/ui/breeze.css index 1135dbf51..9b8fecece 100644 --- a/bin/assets/ui/breeze.css +++ b/bin/assets/ui/breeze.css @@ -533,7 +533,7 @@ SpinBox::btnup:hover { foreground-image: poly(line, var(--primary), "1dp 7dp, 5dp 4dp"), poly(line, var(--primary), "5dp 4dp, 9dp 7dp"); } -WinMenu { +MenuBar { height: 24dp; } @@ -547,13 +547,13 @@ PopUpMenu { border-color: var(--menu-border); } -WinMenu::Button { +MenuBar::Button { padding-left: 4dp; padding-right: 4dp; min-height: 24dp; } -WinMenu::Button:hover { +MenuBar::Button:hover { background-color: var(--primary); } diff --git a/bin/assets/ui/uitheme.css b/bin/assets/ui/uitheme.css index 52b22b4a6..4eb3e6ba8 100644 --- a/bin/assets/ui/uitheme.css +++ b/bin/assets/ui/uitheme.css @@ -23,11 +23,11 @@ ProgressBar { padding: 2dp; } -WinMenu { +MenuBar { padding-left: 1dp; } -WinMenu::button { +MenuBar::button { padding-left: -3dp; padding-right: -3dp; } diff --git a/bin/assets/ui/uitheme.eta b/bin/assets/ui/uitheme.eta index 87b98e8bc..a304dc837 100644 Binary files a/bin/assets/ui/uitheme.eta and b/bin/assets/ui/uitheme.eta differ diff --git a/bin/assets/ui/uitheme/uitheme_winmenu_normal.png b/bin/assets/ui/uitheme/uitheme_menubar_normal.png similarity index 100% rename from bin/assets/ui/uitheme/uitheme_winmenu_normal.png rename to bin/assets/ui/uitheme/uitheme_menubar_normal.png diff --git a/bin/assets/ui/uitheme/uitheme_winmenubutton_selected.2_0_2_0.9.png b/bin/assets/ui/uitheme/uitheme_menubarbutton_selected.2_0_2_0.9.png similarity index 100% rename from bin/assets/ui/uitheme/uitheme_winmenubutton_selected.2_0_2_0.9.png rename to bin/assets/ui/uitheme/uitheme_menubarbutton_selected.2_0_2_0.9.png diff --git a/bin/assets/ui/uitheme1.5x.eta b/bin/assets/ui/uitheme1.5x.eta index 10656422c..07bc7f827 100644 Binary files a/bin/assets/ui/uitheme1.5x.eta and b/bin/assets/ui/uitheme1.5x.eta differ diff --git a/bin/assets/ui/uitheme1.5x/uitheme1.5x_winmenu_normal.png b/bin/assets/ui/uitheme1.5x/uitheme1.5x_menubar_normal.png similarity index 100% rename from bin/assets/ui/uitheme1.5x/uitheme1.5x_winmenu_normal.png rename to bin/assets/ui/uitheme1.5x/uitheme1.5x_menubar_normal.png diff --git a/bin/assets/ui/uitheme1.5x/uitheme1.5x_winmenubutton_selected.3_0_3_0.9.png b/bin/assets/ui/uitheme1.5x/uitheme1.5x_menubarbutton_selected.3_0_3_0.9.png similarity index 100% rename from bin/assets/ui/uitheme1.5x/uitheme1.5x_winmenubutton_selected.3_0_3_0.9.png rename to bin/assets/ui/uitheme1.5x/uitheme1.5x_menubarbutton_selected.3_0_3_0.9.png diff --git a/bin/assets/ui/uitheme2x.eta b/bin/assets/ui/uitheme2x.eta index e54533059..f2a802fff 100644 Binary files a/bin/assets/ui/uitheme2x.eta and b/bin/assets/ui/uitheme2x.eta differ diff --git a/bin/assets/ui/uitheme2x/uitheme2x_winmenu_normal.png b/bin/assets/ui/uitheme2x/uitheme2x_menubar_normal.png similarity index 100% rename from bin/assets/ui/uitheme2x/uitheme2x_winmenu_normal.png rename to bin/assets/ui/uitheme2x/uitheme2x_menubar_normal.png diff --git a/bin/assets/ui/uitheme2x/uitheme2x_winmenubutton_selected.4_0_4_0.9.png b/bin/assets/ui/uitheme2x/uitheme2x_menubarbutton_selected.4_0_4_0.9.png similarity index 100% rename from bin/assets/ui/uitheme2x/uitheme2x_winmenubutton_selected.4_0_4_0.9.png rename to bin/assets/ui/uitheme2x/uitheme2x_menubarbutton_selected.4_0_4_0.9.png diff --git a/include/eepp/maps/mapeditor/mapeditor.hpp b/include/eepp/maps/mapeditor/mapeditor.hpp index 24903b7fe..cc2c68bda 100644 --- a/include/eepp/maps/mapeditor/mapeditor.hpp +++ b/include/eepp/maps/mapeditor/mapeditor.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include namespace EE { namespace UI { class UIMessageBox; @@ -121,7 +121,7 @@ class EE_API MapEditor { void createME(); - void createWinMenu(); + void createMenuBar(); void createETGMenu(); diff --git a/include/eepp/ui.hpp b/include/eepp/ui.hpp index c21ba522a..89143fe08 100644 --- a/include/eepp/ui.hpp +++ b/include/eepp/ui.hpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include diff --git a/include/eepp/ui/tools/textureatlaseditor.hpp b/include/eepp/ui/tools/textureatlaseditor.hpp index c2e6fdd5e..b34376a8b 100644 --- a/include/eepp/ui/tools/textureatlaseditor.hpp +++ b/include/eepp/ui/tools/textureatlaseditor.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace EE { namespace UI { namespace Tools { @@ -49,7 +49,7 @@ class EE_API TextureAtlasEditor { UISpinBox* mSpinDestH; UIListBox* mTextureRegionList; UIGridLayout* mTextureRegionGrid; - UIWinMenu* mWinMenu; + UIMenuBar* mMenuBar; UIDropDownList* mTextureFilterList; TextureAtlasTextureRegionEditor* mTextureRegionEditor; bool mEdited; diff --git a/include/eepp/ui/uihelper.hpp b/include/eepp/ui/uihelper.hpp index 5ed9b6835..a84a370db 100644 --- a/include/eepp/ui/uihelper.hpp +++ b/include/eepp/ui/uihelper.hpp @@ -69,7 +69,7 @@ enum UINodeType { UI_TYPE_TOOLTIP, UI_TYPE_TABLE, UI_TYPE_WINDOW, - UI_TYPE_WINMENU, + UI_TYPE_MENUBAR, UI_TYPE_SELECTBUTTON, UI_TYPE_POPUPMENU, UI_TYPE_COMMONDIALOG, diff --git a/include/eepp/ui/uiwinmenu.hpp b/include/eepp/ui/uimenubar.hpp similarity index 83% rename from include/eepp/ui/uiwinmenu.hpp rename to include/eepp/ui/uimenubar.hpp index 4e366a385..6a5b66247 100644 --- a/include/eepp/ui/uiwinmenu.hpp +++ b/include/eepp/ui/uimenubar.hpp @@ -1,5 +1,5 @@ -#ifndef EE_UICUIWINMENU_HPP -#define EE_UICUIWINMENU_HPP +#ifndef EE_UI_UIMENUBAR_HPP +#define EE_UI_UIMENUBAR_HPP #include #include @@ -8,13 +8,13 @@ namespace EE { namespace UI { -class EE_API UIWinMenu : public UIWidget { +class EE_API UIMenuBar : public UIWidget { public: - static UIWinMenu* New(); + static UIMenuBar* New(); - UIWinMenu(); + UIMenuBar(); - virtual ~UIWinMenu(); + virtual ~UIMenuBar(); virtual Uint32 getType() const; @@ -39,11 +39,11 @@ class EE_API UIWinMenu : public UIWidget { virtual void loadFromXmlNode( const pugi::xml_node& node ); protected: - typedef std::list> WinMenuList; + typedef std::list> MenuBarList; Uint32 mMenuHeight; UIPopUpMenu* mCurrentMenu; - WinMenuList mButtons; + MenuBarList mButtons; void refreshButtons(); diff --git a/projects/linux/ee.files b/projects/linux/ee.files index 516074c7e..cc11148f7 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -349,6 +349,7 @@ ../../include/eepp/ui/uilistboxitem.hpp ../../include/eepp/ui/uiloader.hpp ../../include/eepp/ui/uimanager.hpp +../../include/eepp/ui/uimenubar.hpp ../../include/eepp/ui/uimenucheckbox.hpp ../../include/eepp/ui/uimenu.hpp ../../include/eepp/ui/uimenuitem.hpp @@ -390,7 +391,6 @@ ../../include/eepp/ui/uiwidgetcreator.hpp ../../include/eepp/ui/uiwidget.hpp ../../include/eepp/ui/uiwindow.hpp -../../include/eepp/ui/uiwinmenu.hpp ../../include/eepp/version.hpp ../../include/eepp/window/base.hpp ../../include/eepp/window/clipboard.hpp @@ -797,6 +797,7 @@ ../../src/eepp/ui/uilistboxitem.cpp ../../src/eepp/ui/uiloader.cpp ../../src/eepp/ui/uimanager.cpp +../../src/eepp/ui/uimenubar.cpp ../../src/eepp/ui/uimenucheckbox.cpp ../../src/eepp/ui/uimenu.cpp ../../src/eepp/ui/uimenuitem.cpp @@ -838,7 +839,6 @@ ../../src/eepp/ui/uiwidget.cpp ../../src/eepp/ui/uiwidgetcreator.cpp ../../src/eepp/ui/uiwindow.cpp -../../src/eepp/ui/uiwinmenu.cpp ../../src/eepp/window/backend/allegro5/cbackendal.hpp ../../src/eepp/window/backend/allegro5/cclipboardal.cpp ../../src/eepp/window/backend/allegro5/cclipboardal.hpp diff --git a/src/eepp/maps/mapeditor/mapeditor.cpp b/src/eepp/maps/mapeditor/mapeditor.cpp index e09e351d7..32defe1cd 100644 --- a/src/eepp/maps/mapeditor/mapeditor.cpp +++ b/src/eepp/maps/mapeditor/mapeditor.cpp @@ -86,7 +86,7 @@ MapEditor::MapEditor( UIWindow* AttatchTo, const MapEditorCloseCb& callback ) : MapEditor::~MapEditor() {} void MapEditor::createME() { - createWinMenu(); + createMenuBar(); createETGMenu(); @@ -101,16 +101,16 @@ bool MapEditor::addShortcut( const Keycode& KeyCode, const Uint32& Mod, UIWidget } } -void MapEditor::createWinMenu() { - UIWinMenu* WinMenu = UIWinMenu::New(); - WinMenu->setParent( mUIContainer ); - WinMenu->getUISceneNode()->updateDirtyStyleStates(); +void MapEditor::createMenuBar() { + UIMenuBar* MenuBar = UIMenuBar::New(); + MenuBar->setParent( mUIContainer ); + MenuBar->getUISceneNode()->updateDirtyStyleStates(); mTileBox = createTextBox( "", mUIContainer, Sizef(), Vector2f(), UI_HALIGN_RIGHT | UI_VALIGN_CENTER | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT ); mTileBox->setLayoutSizePolicy( SizePolicy::Fixed, SizePolicy::Fixed ); - mTileBox->setSize( 100, WinMenu->getSize().getHeight() ); + mTileBox->setSize( 100, MenuBar->getSize().getHeight() ); mTileBox->setPosition( Vector2f( mUIContainer->getSize().getWidth() - mTileBox->getSize().getWidth(), 0 ) ); mTileBox->setVisible( true ); @@ -129,7 +129,7 @@ void MapEditor::createWinMenu() { PU1->add( "Quit", mTheme->getIconByName( "quit" ) ); PU1->addEventListener( Event::OnItemClicked, cb::Make1( this, &MapEditor::fileMenuClick ) ); - WinMenu->addMenuButton( "File", PU1 ); + MenuBar->addMenuButton( "File", PU1 ); UIPopUpMenu* PU3 = UIPopUpMenu::New(); PU3->setParent( mUIContainer ); @@ -156,7 +156,7 @@ void MapEditor::createWinMenu() { PU3->addSeparator(); PU3->addEventListener( Event::OnItemClicked, cb::Make1( this, &MapEditor::viewMenuClick ) ); - WinMenu->addMenuButton( "View", PU3 ); + MenuBar->addMenuButton( "View", PU3 ); UIPopUpMenu* PU4 = UIPopUpMenu::New(); PU4->setParent( mUIContainer ); @@ -164,7 +164,7 @@ void MapEditor::createWinMenu() { PU4->add( "Resize..." ); PU4->addEventListener( Event::OnItemClicked, cb::Make1( this, &MapEditor::mapMenuClick ) ); - WinMenu->addMenuButton( "Map", PU4 ); + MenuBar->addMenuButton( "Map", PU4 ); UIPopUpMenu* PU5 = UIPopUpMenu::New(); PU5->setParent( mUIContainer ); @@ -188,21 +188,21 @@ void MapEditor::createWinMenu() { mLayerChkVisible = PU5->getItem( LayerChkBoxIndex )->asType(); PU5->addEventListener( Event::OnItemClicked, cb::Make1( this, &MapEditor::layerMenuClick ) ); - WinMenu->addMenuButton( "Layer", PU5 ); + MenuBar->addMenuButton( "Layer", PU5 ); UIPopUpMenu* PU6 = UIPopUpMenu::New(); PU6->setParent( mUIContainer ); PU6->add( "New Texture Atlas..." ); PU6->add( "Add External Texture Atlas..." ); - WinMenu->addMenuButton( "Atlases", PU6 ); + MenuBar->addMenuButton( "Atlases", PU6 ); PU6->addEventListener( Event::OnItemClicked, cb::Make1( this, &MapEditor::mapMenuClick ) ); mWinContainer = UIWidget::New(); mWinContainer->enableReportSizeChangeToChilds(); mWinContainer->setParent( mUIContainer ); - mWinContainer->setPosition( 0, WinMenu->getSize().getHeight() ); + mWinContainer->setPosition( 0, MenuBar->getSize().getHeight() ); mWinContainer->setSize( mUIContainer->getSize().getWidth(), - mUIContainer->getSize().getHeight() - WinMenu->getSize().getHeight() ); + mUIContainer->getSize().getHeight() - MenuBar->getSize().getHeight() ); mWinContainer->setAnchors( UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT ); mWinContainer->setThemeSkin( mTheme, "winback" ); diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index 2f3ca7364..09fddb885 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -53,7 +53,7 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow* attachTo, const TGEditorCloseC std::string layout = R"xml( - + @@ -64,7 +64,7 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow* attachTo, const TGEditorCloseC - + diff --git a/src/eepp/ui/uiwinmenu.cpp b/src/eepp/ui/uimenubar.cpp similarity index 71% rename from src/eepp/ui/uiwinmenu.cpp rename to src/eepp/ui/uimenubar.cpp index e43445822..5972d43b8 100644 --- a/src/eepp/ui/uiwinmenu.cpp +++ b/src/eepp/ui/uimenubar.cpp @@ -3,16 +3,16 @@ #include #include #include -#include +#include #include namespace EE { namespace UI { -UIWinMenu* UIWinMenu::New() { - return eeNew( UIWinMenu, () ); +UIMenuBar* UIMenuBar::New() { + return eeNew( UIMenuBar, () ); } -UIWinMenu::UIWinMenu() : UIWidget( "winmenu" ), mMenuHeight( 0 ), mCurrentMenu( NULL ) { +UIMenuBar::UIMenuBar() : UIWidget( "menubar" ), mMenuHeight( 0 ), mCurrentMenu( NULL ) { if ( !( mFlags & UI_ANCHOR_RIGHT ) ) mFlags |= UI_ANCHOR_RIGHT; @@ -21,15 +21,15 @@ UIWinMenu::UIWinMenu() : UIWidget( "winmenu" ), mMenuHeight( 0 ), mCurrentMenu( applyDefaultTheme(); } -UIWinMenu::~UIWinMenu() { +UIMenuBar::~UIMenuBar() { destroyMenues(); } -void UIWinMenu::destroyMenues() { +void UIMenuBar::destroyMenues() { if ( !SceneManager::instance()->isShootingDown() ) { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { if ( it->second->getParent() != this ) { - // Changing the parent ensures that the menu will be destroyed when the win menu is + // Changing the parent ensures that the menu will be destroyed when the menubar is // destroyed it->second->setParent( this ); } @@ -37,18 +37,18 @@ void UIWinMenu::destroyMenues() { } } -Uint32 UIWinMenu::getType() const { - return UI_TYPE_WINMENU; +Uint32 UIMenuBar::getType() const { + return UI_TYPE_MENUBAR; } -bool UIWinMenu::isType( const Uint32& type ) const { - return UIWinMenu::getType() == type ? true : UIWidget::isType( type ); +bool UIMenuBar::isType( const Uint32& type ) const { + return UIMenuBar::getType() == type ? true : UIWidget::isType( type ); } -void UIWinMenu::addMenuButton( const String& ButtonText, UIPopUpMenu* Menu ) { +void UIMenuBar::addMenuButton( const String& ButtonText, UIPopUpMenu* Menu ) { eeASSERT( NULL != Menu ); - UISelectButton* Button = UISelectButton::NewWithTag( "winmenu::button" ); + UISelectButton* Button = UISelectButton::NewWithTag( "menubar::button" ); Button->setParent( this ); Button->setText( ButtonText ); Button->setVisible( true ); @@ -60,32 +60,32 @@ void UIWinMenu::addMenuButton( const String& ButtonText, UIPopUpMenu* Menu ) { // This will force to change the parent when shown, and force the CSS style reload. Menu->setParent( this ); Menu->addEventListener( Event::OnWidgetFocusLoss, - cb::Make1( this, &UIWinMenu::onMenuFocusLoss ) ); - Menu->addEventListener( Event::OnHideByClick, cb::Make1( this, &UIWinMenu::onHideByClick ) ); + cb::Make1( this, &UIMenuBar::onMenuFocusLoss ) ); + Menu->addEventListener( Event::OnHideByClick, cb::Make1( this, &UIMenuBar::onHideByClick ) ); mButtons.push_back( std::make_pair( Button, Menu ) ); if ( NULL != mTheme ) - Button->setThemeSkin( mTheme, "winmenubutton" ); + Button->setThemeSkin( mTheme, "menubarbutton" ); refreshButtons(); } -void UIWinMenu::setTheme( UITheme* Theme ) { +void UIMenuBar::setTheme( UITheme* Theme ) { UIWidget::setTheme( Theme ); - setThemeSkin( Theme, "winmenu" ); + setThemeSkin( Theme, "menubar" ); - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { - it->first->setThemeSkin( Theme, "winmenubutton" ); + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { + it->first->setThemeSkin( Theme, "menubarbutton" ); } autoHeight(); onThemeLoaded(); } -void UIWinMenu::removeMenuButton( const String& ButtonText ) { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { +void UIMenuBar::removeMenuButton( const String& ButtonText ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { if ( it->first->getText() == ButtonText ) { it->first->close(); it->second->close(); @@ -99,8 +99,8 @@ void UIWinMenu::removeMenuButton( const String& ButtonText ) { } } -UISelectButton* UIWinMenu::getButton( const String& ButtonText ) { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { +UISelectButton* UIMenuBar::getButton( const String& ButtonText ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { if ( it->first->getText() == ButtonText ) { return it->first; } @@ -109,8 +109,8 @@ UISelectButton* UIWinMenu::getButton( const String& ButtonText ) { return NULL; } -UIPopUpMenu* UIWinMenu::getPopUpMenu( const String& ButtonText ) { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { +UIPopUpMenu* UIMenuBar::getPopUpMenu( const String& ButtonText ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { if ( it->first->getText() == ButtonText ) { return it->second; } @@ -119,11 +119,11 @@ UIPopUpMenu* UIWinMenu::getPopUpMenu( const String& ButtonText ) { return NULL; } -Uint32 UIWinMenu::getMenuHeight() const { +Uint32 UIMenuBar::getMenuHeight() const { return mMenuHeight; } -void UIWinMenu::setMenuHeight( const Uint32& menuHeight ) { +void UIMenuBar::setMenuHeight( const Uint32& menuHeight ) { mMenuHeight = menuHeight; if ( 0 != mMenuHeight ) { @@ -135,7 +135,7 @@ void UIWinMenu::setMenuHeight( const Uint32& menuHeight ) { refreshButtons(); } -void UIWinMenu::refreshButtons() { +void UIMenuBar::refreshButtons() { Int32 ycenter = 0; if ( !mButtons.empty() ) { @@ -157,14 +157,14 @@ void UIWinMenu::refreshButtons() { Uint32 xpos = getPadding().Left; - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { UISelectButton* pbut = it->first; pbut->setPosition( xpos, ycenter ); xpos += pbut->getSize().getWidth() + pbut->getLayoutMargin().Left; } } -bool UIWinMenu::applyProperty( const StyleSheetProperty& attribute ) { +bool UIMenuBar::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; @@ -179,7 +179,7 @@ bool UIWinMenu::applyProperty( const StyleSheetProperty& attribute ) { return true; } -Uint32 UIWinMenu::onMessage( const NodeMessage* Msg ) { +Uint32 UIMenuBar::onMessage( const NodeMessage* Msg ) { switch ( Msg->getMsg() ) { case NodeMessage::MouseUp: case NodeMessage::MouseOver: { @@ -222,7 +222,7 @@ Uint32 UIWinMenu::onMessage( const NodeMessage* Msg ) { break; } case NodeMessage::Selected: { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { if ( it->first != Msg->getSender() ) { it->first->unselect(); } @@ -246,7 +246,7 @@ Uint32 UIWinMenu::onMessage( const NodeMessage* Msg ) { return 0; } -void UIWinMenu::onParentChange() { +void UIMenuBar::onParentChange() { setSize( getParent()->getSize().getWidth(), mMenuHeight ); updateAnchorsDistances(); @@ -254,18 +254,18 @@ void UIWinMenu::onParentChange() { UIWidget::onParentChange(); } -void UIWinMenu::onPaddingChange() { +void UIMenuBar::onPaddingChange() { refreshButtons(); } -void UIWinMenu::unselectButtons() { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { +void UIMenuBar::unselectButtons() { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { it->first->unselect(); } } -UIPopUpMenu* UIWinMenu::getMenuFromButton( UISelectButton* Button ) { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { +UIPopUpMenu* UIMenuBar::getMenuFromButton( UISelectButton* Button ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { if ( it->first == Button ) { return it->second; } @@ -274,8 +274,8 @@ UIPopUpMenu* UIWinMenu::getMenuFromButton( UISelectButton* Button ) { return NULL; } -bool UIWinMenu::isPopUpMenuChild( Node* Ctrl ) { - for ( WinMenuList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { +bool UIMenuBar::isPopUpMenuChild( Node* Ctrl ) { + for ( MenuBarList::iterator it = mButtons.begin(); it != mButtons.end(); ++it ) { if ( it->second == Ctrl || it->second->isParentOf( Ctrl ) ) { return true; } @@ -284,7 +284,7 @@ bool UIWinMenu::isPopUpMenuChild( Node* Ctrl ) { return false; } -void UIWinMenu::onMenuFocusLoss( const Event* ) { +void UIMenuBar::onMenuFocusLoss( const Event* ) { Node* FocusCtrl = getEventDispatcher()->getFocusNode(); if ( !isParentOf( FocusCtrl ) && !isPopUpMenuChild( FocusCtrl ) ) { @@ -292,11 +292,11 @@ void UIWinMenu::onMenuFocusLoss( const Event* ) { } } -void UIWinMenu::onHideByClick( const Event* ) { +void UIMenuBar::onHideByClick( const Event* ) { onWidgetFocusLoss(); } -void UIWinMenu::onWidgetFocusLoss() { +void UIMenuBar::onWidgetFocusLoss() { UIWidget::onWidgetFocusLoss(); if ( NULL != mCurrentMenu ) { @@ -308,7 +308,7 @@ void UIWinMenu::onWidgetFocusLoss() { unselectButtons(); } -void UIWinMenu::autoHeight() { +void UIMenuBar::autoHeight() { if ( 0 == mMenuHeight && NULL != getSkin() ) { mMenuHeight = getSkinSize().getHeight(); @@ -318,7 +318,7 @@ void UIWinMenu::autoHeight() { } } -void UIWinMenu::loadFromXmlNode( const pugi::xml_node& node ) { +void UIMenuBar::loadFromXmlNode( const pugi::xml_node& node ) { beginAttributesTransaction(); UIWidget::loadFromXmlNode( node ); diff --git a/src/eepp/ui/uiselectbutton.cpp b/src/eepp/ui/uiselectbutton.cpp index 9e9986503..37bbda397 100644 --- a/src/eepp/ui/uiselectbutton.cpp +++ b/src/eepp/ui/uiselectbutton.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace UI { diff --git a/src/eepp/ui/uiwidgetcreator.cpp b/src/eepp/ui/uiwidgetcreator.cpp index 30f1372f1..5c3521e09 100644 --- a/src/eepp/ui/uiwidgetcreator.cpp +++ b/src/eepp/ui/uiwidgetcreator.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include namespace EE { namespace UI { @@ -55,7 +55,7 @@ void UIWidgetCreator::createBaseWidgetList() { registeredWidget["dropdownlist"] = UIDropDownList::New; registeredWidget["image"] = UIImage::New; registeredWidget["listbox"] = UIListBox::New; - registeredWidget["winmenu"] = UIWinMenu::New; + registeredWidget["menubar"] = UIMenuBar::New; registeredWidget["progressbar"] = UIProgressBar::New; registeredWidget["scrollbar"] = UIScrollBar::New; registeredWidget["slider"] = UISlider::New; diff --git a/src/tests/test_all/test.cpp b/src/tests/test_all/test.cpp index 4f1bd6543..3aaac2b07 100644 --- a/src/tests/test_all/test.cpp +++ b/src/tests/test_all/test.cpp @@ -815,8 +815,8 @@ void EETest::createNewUI() { UIWindow* MenuCont = UIWindow::New(); MenuCont->setPosition( 350, 390 )->setSize( 200, 115 ); - UIWinMenu* WinMenu = UIWinMenu::New(); - WinMenu->setParent( MenuCont->getContainer() ); + UIMenuBar* MenuBar = UIMenuBar::New(); + MenuBar->setParent( MenuCont->getContainer() ); UIPopUpMenu* PopMenu = UIPopUpMenu::New(); PopMenu->add( "File" ); @@ -830,8 +830,8 @@ void EETest::createNewUI() { PopMenu2->add( "Bla 3" ); PopMenu2->add( "Bla 4" ); - WinMenu->addMenuButton( "File", PopMenu ); - WinMenu->addMenuButton( "Edit", PopMenu2 ); + MenuBar->addMenuButton( "File", PopMenu ); + MenuBar->addMenuButton( "Edit", PopMenu2 ); UIWindow* win = UIWindow::New(); win->setSize( 500, 500 ); @@ -1079,8 +1079,8 @@ void EETest::createDecoratedWindow() { lay->setLayoutSizePolicy( SizePolicy::MatchParent, SizePolicy::MatchParent ); lay->setParent( mUIWindow->getContainer() ); - UIWinMenu* WinMenu = UIWinMenu::New(); - WinMenu->setLayoutSizePolicy( SizePolicy::MatchParent, SizePolicy::WrapContent ) + UIMenuBar* MenuBar = UIMenuBar::New(); + MenuBar->setLayoutSizePolicy( SizePolicy::MatchParent, SizePolicy::WrapContent ) ->setParent( lay ); UIPopUpMenu* PopMenu = UIPopUpMenu::New(); @@ -1124,8 +1124,8 @@ void EETest::createDecoratedWindow() { PopMenu2->add( "Bla 3" ); PopMenu2->add( "Bla 4" ); - WinMenu->addMenuButton( "File", PopMenu ); - WinMenu->addMenuButton( "Edit", PopMenu2 ); + MenuBar->addMenuButton( "File", PopMenu ); + MenuBar->addMenuButton( "Edit", PopMenu2 ); UIPushButton* Button = UIPushButton::New(); Button->setLayoutMargin( Rect( 5, 5, 5, 5 ) ); diff --git a/src/tools/uieditor/uieditor.cpp b/src/tools/uieditor/uieditor.cpp index 0818ada73..c42030b87 100644 --- a/src/tools/uieditor/uieditor.cpp +++ b/src/tools/uieditor/uieditor.cpp @@ -45,7 +45,7 @@ UIMessageBox* MsgBox = NULL; efsw::FileWatcher* fileWatcher = NULL; UITheme* theme = NULL; UIWindow* uiContainer = NULL; -UIWinMenu* uiWinMenu = NULL; +UIMenuBar* uiMenuBar = NULL; UISceneNode* uiSceneNode = NULL; UISceneNode* appUiSceneNode = NULL; std::string currentLayout; @@ -321,10 +321,10 @@ void onRecentFilesClick( const Event* event ) { void updateRecentFiles() { SceneManager::instance()->setCurrentUISceneNode( appUiSceneNode ); - if ( NULL == uiWinMenu ) + if ( NULL == uiMenuBar ) return; - UIPopUpMenu* fileMenu = uiWinMenu->getPopUpMenu( "File" ); + UIPopUpMenu* fileMenu = uiMenuBar->getPopUpMenu( "File" ); UINode* node = NULL; @@ -352,10 +352,10 @@ void updateRecentFiles() { void updateRecentProjects() { SceneManager::instance()->setCurrentUISceneNode( appUiSceneNode ); - if ( NULL == uiWinMenu ) + if ( NULL == uiMenuBar ) return; - UIPopUpMenu* fileMenu = uiWinMenu->getPopUpMenu( "File" ); + UIPopUpMenu* fileMenu = uiMenuBar->getPopUpMenu( "File" ); UINode* node = NULL; @@ -456,7 +456,7 @@ void onLayoutSelected( const Event* event ) { UIPopUpMenu* uiLayoutsMenu; - if ( ( uiLayoutsMenu = uiWinMenu->getPopUpMenu( "Layouts" ) ) && + if ( ( uiLayoutsMenu = uiMenuBar->getPopUpMenu( "Layouts" ) ) && uiLayoutsMenu->getCount() > 0 ) { for ( size_t i = 0; i < uiLayoutsMenu->getCount(); i++ ) { UIMenuCheckBox* menuItem = static_cast( uiLayoutsMenu->getItem( i ) ); @@ -475,7 +475,7 @@ void onLayoutSelected( const Event* event ) { } void refreshLayoutList() { - if ( NULL == uiWinMenu ) + if ( NULL == uiMenuBar ) return; SceneManager::instance()->setCurrentUISceneNode( appUiSceneNode ); @@ -483,14 +483,14 @@ void refreshLayoutList() { if ( layouts.size() > 0 ) { UIPopUpMenu* uiLayoutsMenu = NULL; - if ( uiWinMenu->getButton( "Layouts" ) == NULL ) { + if ( uiMenuBar->getButton( "Layouts" ) == NULL ) { uiLayoutsMenu = UIPopUpMenu::New(); - uiWinMenu->addMenuButton( "Layouts", uiLayoutsMenu ); + uiMenuBar->addMenuButton( "Layouts", uiLayoutsMenu ); uiLayoutsMenu->addEventListener( Event::OnItemClicked, cb::Make1( &onLayoutSelected ) ); } else { - uiLayoutsMenu = uiWinMenu->getPopUpMenu( "Layouts" ); + uiLayoutsMenu = uiMenuBar->getPopUpMenu( "Layouts" ); } uiLayoutsMenu->removeAll(); @@ -501,8 +501,8 @@ void refreshLayoutList() { chk->setActive( currentLayout == it->second ); } - } else if ( uiWinMenu->getButton( "Layouts" ) != NULL ) { - uiWinMenu->removeMenuButton( "Layouts" ); + } else if ( uiMenuBar->getButton( "Layouts" ) != NULL ) { + uiMenuBar->removeMenuButton( "Layouts" ); } SceneManager::instance()->setCurrentUISceneNode( uiSceneNode ); @@ -778,13 +778,13 @@ void mainLoop() { mousePos = window->getInput()->getMousePos(); mouseClock.restart(); - if ( uiWinMenu->getAlpha() != 255 && uiWinMenu->getActionManager()->isEmpty() ) { - uiWinMenu->runAction( - Actions::Fade::New( uiWinMenu->getAlpha(), 255, Milliseconds( 250 ) ) ); + if ( uiMenuBar->getAlpha() != 255 && uiMenuBar->getActionManager()->isEmpty() ) { + uiMenuBar->runAction( + Actions::Fade::New( uiMenuBar->getAlpha(), 255, Milliseconds( 250 ) ) ); } } else if ( mouseClock.getElapsedTime() > Seconds( 1 ) ) { - if ( uiWinMenu->getAlpha() == 255 && uiWinMenu->getActionManager()->isEmpty() ) { - uiWinMenu->runAction( Actions::Fade::New( 255, 0, Milliseconds( 250 ) ) ); + if ( uiMenuBar->getAlpha() == 255 && uiMenuBar->getActionManager()->isEmpty() ) { + uiMenuBar->runAction( Actions::Fade::New( 255, 0, Milliseconds( 250 ) ) ); } } @@ -894,7 +894,7 @@ void fileMenuClick( const Event* event ) { void createAppMenu() { SceneManager::instance()->setCurrentUISceneNode( appUiSceneNode ); - uiWinMenu = UIWinMenu::New(); + uiMenuBar = UIMenuBar::New(); UIPopUpMenu* uiPopMenu = UIPopUpMenu::New(); uiPopMenu->add( "Open project...", theme->getIconByName( "document-open" ) ); @@ -907,7 +907,7 @@ void createAppMenu() { uiPopMenu->add( "Close", theme->getIconByName( "document-close" ) ); uiPopMenu->addSeparator(); uiPopMenu->add( "Quit", theme->getIconByName( "quit" ) ); - uiWinMenu->addMenuButton( "File", uiPopMenu ); + uiMenuBar->addMenuButton( "File", uiPopMenu ); uiPopMenu->addEventListener( Event::OnItemClicked, cb::Make1( fileMenuClick ) ); UIPopUpMenu* uiResourceMenu = UIPopUpMenu::New(); @@ -916,7 +916,7 @@ void createAppMenu() { uiResourceMenu->add( "Load fonts from path...", theme->getIconByName( "document-open" ) ); uiResourceMenu->addSeparator(); uiResourceMenu->add( "Load style sheet from path...", theme->getIconByName( "document-open" ) ); - uiWinMenu->addMenuButton( "Resources", uiResourceMenu ); + uiMenuBar->addMenuButton( "Resources", uiResourceMenu ); uiResourceMenu->addEventListener( Event::OnItemClicked, cb::Make1( fileMenuClick ) ); SceneManager::instance()->setCurrentUISceneNode( uiSceneNode );