From e45c813e5327c6ec873689a66caa27d8975a037e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sat, 30 May 2020 21:03:25 -0300 Subject: [PATCH] Renamed UIWinMenu to UIMenuBar. --- bin/assets/layouts/test.css | 4 +- bin/assets/ui/breeze.css | 6 +- bin/assets/ui/uitheme.css | 4 +- bin/assets/ui/uitheme.eta | Bin 18596 -> 18596 bytes ..._normal.png => uitheme_menubar_normal.png} | Bin ...heme_menubarbutton_selected.2_0_2_0.9.png} | Bin bin/assets/ui/uitheme1.5x.eta | Bin 18596 -> 18596 bytes ...mal.png => uitheme1.5x_menubar_normal.png} | Bin ...1.5x_menubarbutton_selected.3_0_3_0.9.png} | Bin bin/assets/ui/uitheme2x.eta | Bin 18596 -> 18596 bytes ...ormal.png => uitheme2x_menubar_normal.png} | Bin ...me2x_menubarbutton_selected.4_0_4_0.9.png} | Bin include/eepp/maps/mapeditor/mapeditor.hpp | 4 +- include/eepp/ui.hpp | 2 +- include/eepp/ui/tools/textureatlaseditor.hpp | 4 +- include/eepp/ui/uihelper.hpp | 2 +- .../eepp/ui/{uiwinmenu.hpp => uimenubar.hpp} | 16 +-- projects/linux/ee.files | 4 +- src/eepp/maps/mapeditor/mapeditor.cpp | 26 ++--- src/eepp/ui/tools/textureatlaseditor.cpp | 4 +- src/eepp/ui/{uiwinmenu.cpp => uimenubar.cpp} | 94 +++++++++--------- src/eepp/ui/uiselectbutton.cpp | 2 +- src/eepp/ui/uiwidgetcreator.cpp | 4 +- src/tests/test_all/test.cpp | 16 +-- src/tools/uieditor/uieditor.cpp | 40 ++++---- 25 files changed, 116 insertions(+), 116 deletions(-) rename bin/assets/ui/uitheme/{uitheme_winmenu_normal.png => uitheme_menubar_normal.png} (100%) rename bin/assets/ui/uitheme/{uitheme_winmenubutton_selected.2_0_2_0.9.png => uitheme_menubarbutton_selected.2_0_2_0.9.png} (100%) rename bin/assets/ui/uitheme1.5x/{uitheme1.5x_winmenu_normal.png => uitheme1.5x_menubar_normal.png} (100%) rename bin/assets/ui/uitheme1.5x/{uitheme1.5x_winmenubutton_selected.3_0_3_0.9.png => uitheme1.5x_menubarbutton_selected.3_0_3_0.9.png} (100%) rename bin/assets/ui/uitheme2x/{uitheme2x_winmenu_normal.png => uitheme2x_menubar_normal.png} (100%) rename bin/assets/ui/uitheme2x/{uitheme2x_winmenubutton_selected.4_0_4_0.9.png => uitheme2x_menubarbutton_selected.4_0_4_0.9.png} (100%) rename include/eepp/ui/{uiwinmenu.hpp => uimenubar.hpp} (83%) rename src/eepp/ui/{uiwinmenu.cpp => uimenubar.cpp} (71%) 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 87b98e8bccd24fea544171c59da6f7a2272b07ed..a304dc8376d8513b350f10f512050ffe2b3530a4 100644 GIT binary patch delta 1083 zcmXYwdrZ}37{`J09FBC3+(9l!{2`ZvaNInutnv@r!O%7&_9(dc;N`{FWR@hwy?S87NWRP%6WuuJS zc}_5`5;S(HO99PGk*Ie&Lt#?I8Wur*u~lK{QpdtY-9h&@-OOYW^lS4r)r+)E(?JJ< z>K{YDTF|#;6VD+Lk?w7@&E4=Aqwa!~=HN>Oxoqz1#QYZ7lglqtf>@r498DvIx4o)|`q~|70xs z9VZV_RLdgB7}fiX*Oed#_~7F;7FzMYS`BT0pxUX~ar6Zyz%LMFP?o7#_$;g=A8}bi zd9V-81zG5g6GsLi2McPdNlC<{HUTMGP4shFJIV6k;v;Cn z1ogbxx)WXD67*qiaD;Wzuyneg13?R3>KW)Gqj|Al z#Hdb?;#JenDBd7pTBpI+Q70)#(OANPptE;k-okWrEOMedsO8hMIV^&{IU1VEAVI{~ z=)0+kWf=5=KDiQAfaI42&D=XQk0pj@UoCG%Yn%jatTz^7+o-o?_8

jyfXD&?ZRe zi}OZvd>cLd?aXx!1QmtMUBaIXj*E_5^d(BGchxoSsjh0O-eWYr*NDvt4aiH<)ApaN zGK@)r;IuYxIEhr1iQslGaGnnh4tTlQ|AB%wCLMnzK}xI-gzb7jd{=-LztNA4;( zweq+0)e5{h$pP}PxP_~!EK`Rn{FrWuYuyn7wCJVE=+o(dT9xhwP+F@!@Z hRHCAwlV(P`C$Ur@s5Hm^1H%T)6?T$NR*ta*{0BCqzfS-F delta 1083 zcmXYwYfuza7={Ht?h7clR@mgoA`7@I_Z4&vSZ+>kIgDCF3*DebL9{~o!J1lzO;O3d z%O#gf;*N?ELE>cws8P=3j4;!T#iRocG~zTPm&m3K5~jYK{yoq8opa`V=i+E^aWuI2 z=H>0mzUI4X)!12cpKrMfHJ3)zq1r{#b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u_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 e54533059ca6494a4560696752be829cfc6f5849..f2a802fffa8e998fdccb21f063fa90cd69a9e4ef 100644 GIT binary patch delta 1083 zcmXYwe@xV69LFI(a1aN`uLI-&{hl1ZzQFM#pg2xI4rhTgNB&{V0RfG1h!$!yq^6E? zJK>J^d2|D5;%V|DSNs#j>2y5>7K_wyEeIKfkeGL&e@;-{FV3|L67GAgL5^1!$-1ux zG3g~}@lyO8gM>EkAbdlhiAF^mD!m1jk1v)nNC;E};WZzS>S4+`Ecgg|{op5K3=(cA z`pI_uVIEq21?>r4azgohB20e0bo~1478XJ8ZM#*EUVk0P-$q-;-03WWE}Z&j@mXq9 z+UQJ|w+?cEpwlxA+ZeKu7-*rx?Ft=Sfr8Ta7$&(@0)~Q4QuSQH3d+_9x@R$#JWKO~ zPtx>8O%vR~d}pbGIJ)XhD?|KHD*=&O)x*O10fPYFGp{)N9AM%=3;_;6h9fEnGSF z8!BT3?d=%6%aDZfxE?YXjjN#&b`lT|9ekAG)oRD zIaK9_QX}Zf_t6K@yFo&l#t*9+2US^CsyPsJ%Q~13S(^!ad>7Sy_T(aqpiE!AfkA>Q zp`XrbJFml)An32*^7|-Dl5jIYiIGG*9er6I z3=+Og>8CEQ@60gCg1%CX6d^lRP~bv`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qPn>=ETR7bwL`Yx 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 );