From 98ef5624407e2139f25e6f77170804a3779a3289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 26 Jul 2020 23:17:52 -0300 Subject: [PATCH] Renamed UITable to UIWidgetTable and UITableCell to UIWidgetTableRow. Minor improvements to UIFileDialog. Added "Open Folder" and "Recent Folders" to ecode. --- bin/assets/ui/uitheme.eta | Bin 18996 -> 18996 bytes bin/assets/ui/uitheme.png | Bin 20998 -> 21013 bytes ...l_hover.png => uitheme_tablerow_hover.png} | Bin ...cted.png => uitheme_tablerow_selected.png} | Bin bin/assets/ui/uitheme1.5x.eta | Bin 18996 -> 18996 bytes bin/assets/ui/uitheme1.5x.png | Bin 89505 -> 89540 bytes ...ver.png => uitheme1.5x_tablerow_hover.png} | Bin ....png => uitheme1.5x_tablerow_selected.png} | Bin bin/assets/ui/uitheme2x.eta | Bin 18996 -> 18996 bytes bin/assets/ui/uitheme2x.png | Bin 152432 -> 152468 bytes ...hover.png => uitheme2x_tablerow_hover.png} | Bin ...ed.png => uitheme2x_tablerow_selected.png} | Bin docs/articles/cssspecification.md | 12 +- include/eepp/scene/eventdispatcher.hpp | 2 + include/eepp/ui.hpp | 4 +- .../eepp/ui/abstract/uiabstracttableview.hpp | 1 + .../eepp/ui/css/stylesheetspecification.hpp | 4 +- include/eepp/ui/uifiledialog.hpp | 14 +- include/eepp/ui/uihelper.hpp | 4 +- include/eepp/ui/uitablecell.hpp | 57 ++---- include/eepp/ui/uitablerow.hpp | 4 + .../ui/{uitable.hpp => uiwidgettable.hpp} | 52 ++--- include/eepp/ui/uiwidgettablerow.hpp | 60 ++++++ projects/linux/ee.files | 7 +- .../maps/mapeditor/maplayerproperties.cpp | 36 ++-- .../maps/mapeditor/maplayerproperties.hpp | 6 +- .../maps/mapeditor/mapobjectproperties.cpp | 36 ++-- .../maps/mapeditor/mapobjectproperties.hpp | 6 +- src/eepp/maps/mapeditor/tilemapproperties.cpp | 36 ++-- src/eepp/maps/mapeditor/tilemapproperties.hpp | 6 +- src/eepp/scene/eventdispatcher.cpp | 4 + src/eepp/scene/node.cpp | 4 + src/eepp/ui/abstract/uiabstracttableview.cpp | 20 +- src/eepp/ui/css/stylesheetspecification.cpp | 30 +-- src/eepp/ui/uifiledialog.cpp | 37 ++-- src/eepp/ui/uipushbutton.cpp | 16 +- src/eepp/ui/uitreeview.cpp | 27 +-- src/eepp/ui/uiwidgetcreator.cpp | 8 +- .../ui/{uitable.cpp => uiwidgettable.cpp} | 183 +++++++++--------- .../{uitablecell.cpp => uiwidgettablerow.cpp} | 78 ++++---- src/tests/test_all/test.cpp | 20 +- src/tools/codeeditor/codeeditor.cpp | 102 +++++++++- src/tools/codeeditor/codeeditor.hpp | 7 + 43 files changed, 533 insertions(+), 350 deletions(-) rename bin/assets/ui/uitheme/{uitheme_gridcell_hover.png => uitheme_tablerow_hover.png} (100%) rename bin/assets/ui/uitheme/{uitheme_gridcell_selected.png => uitheme_tablerow_selected.png} (100%) rename bin/assets/ui/uitheme1.5x/{uitheme1.5x_gridcell_hover.png => uitheme1.5x_tablerow_hover.png} (100%) rename bin/assets/ui/uitheme1.5x/{uitheme1.5x_gridcell_selected.png => uitheme1.5x_tablerow_selected.png} (100%) rename bin/assets/ui/uitheme2x/{uitheme2x_gridcell_hover.png => uitheme2x_tablerow_hover.png} (100%) rename bin/assets/ui/uitheme2x/{uitheme2x_gridcell_selected.png => uitheme2x_tablerow_selected.png} (100%) rename include/eepp/ui/{uitable.hpp => uiwidgettable.hpp} (64%) create mode 100644 include/eepp/ui/uiwidgettablerow.hpp rename src/eepp/ui/{uitable.cpp => uiwidgettable.cpp} (76%) rename src/eepp/ui/{uitablecell.cpp => uiwidgettablerow.cpp} (56%) diff --git a/bin/assets/ui/uitheme.eta b/bin/assets/ui/uitheme.eta index fde209ad99fd6ceb40181c5221af8b920c013689..362d007d1a38e7246bcac80c35969db29de722ae 100644 GIT binary patch delta 147 zcmdlog>lOiMjlt!5XT+d3=A)1a*h+vp-`IS|If4xUXdE)O delta 111 zcmdlog>lOiMjlt!5XT+d3=HbVU*ab6Y+z*DxHsIMBfTgyB{?-GXR^FQ?&MAfeU^Wo zO_G!MI4B@wY@9nL=QxV6I6vz60hH01tl-cx*~Cd?@(zbBj0Tf)9gj~w;w&=R!%1cH IA7=|T0ODgR9RL6T diff --git a/bin/assets/ui/uitheme.png b/bin/assets/ui/uitheme.png index a3de374ce64d7da3c7da98957cb51bb66881fcb0..5b2d00aa317ca779cb2a35c02f2e7d8839cdbf06 100644 GIT binary patch delta 1667 zcmd^8i&GOv7~i`DI7mW*21pnn0Re>(4G?WABOIau#URxV6)R1&*11A_1XD^8a~G%q zGzdzyNPVOr5!zZotW_8!7EGmuffQ8Azz{3N_$qA$L?K)+Y5$Av%%pycr}OS&+1X@!{#3+63=U*zEgVw-ytI?#jnEG z=sx4Bioh|iDH4mFKyySlk9e1&ac~*$}u2_1kxBQhExdPjg5D+4aQYS zQ8c$cqwMBatj|=(qr%gFNcSwIFMT`}e-dWp+z}*bfdl3`SZ&qyEStCZUC*U5O{tmSrX^E06^Z>A-b>Ubd*p zpo&9X_gRC4xVGozDE`(2#G?wVBr$|}0wzvG zfwW8PuU|EN2j&S6Ae_gGE&^Tvjo0H*8-&_9rXd%@^ip68_S))d&i#E*U=233qs*G) zZ6#+OtGq#HJzplN4HEgmgNcMK0o?#|?7O$Co999AG;M@2^Qaf|RfxYlrUR@0)%&l* zI2BbjQwRi zZI=(2QZCqF22wVSFPo)6O6azGF!8}|Wiw!(Z>P0#r5$Hv-4X4UlSFM-ftY@W4Ygba zNG?>eb$nLvWBMpr>sF{Yk`|6ImTvn6&Lihn4{PrztE`qov5j~>P$TXeVRZ;!Z-3C? zc0GT4mbAaq$>9eaVG9s`eAC{2I!2G``$HRPXj3>5fOwoJqL!VsUhb!Y>C%)QY^>ag z-V>_1+!e4Vt32$Yg~QVXnbxwFdmT7u!hYjBz8$Y12vtMGWd>+rSReJCSBz@0yI67J9z&=|HVy0c{xR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bcz1UmL vu2f)ej_{2bVQ&||^5a*0>;F2EBsK(M8;=SLwhW#G)S5TcW2jG?vok diff --git a/bin/assets/ui/uitheme/uitheme_gridcell_hover.png b/bin/assets/ui/uitheme/uitheme_tablerow_hover.png similarity index 100% rename from bin/assets/ui/uitheme/uitheme_gridcell_hover.png rename to bin/assets/ui/uitheme/uitheme_tablerow_hover.png diff --git a/bin/assets/ui/uitheme/uitheme_gridcell_selected.png b/bin/assets/ui/uitheme/uitheme_tablerow_selected.png similarity index 100% rename from bin/assets/ui/uitheme/uitheme_gridcell_selected.png rename to bin/assets/ui/uitheme/uitheme_tablerow_selected.png diff --git a/bin/assets/ui/uitheme1.5x.eta b/bin/assets/ui/uitheme1.5x.eta index 91b954f4e29df3578d3f6628f89b550a8532a7c8..671f5ab6f424c686ba1de9ffc2c1c8f97cce3c15 100644 GIT binary patch delta 136 zcmdlog>lOiMjlt!5XT+d3=9`!6nS8@} z3#0nvUKeZDlEkE()X8xod6R=3B_|(o7GZHo|Gj>)kCO@qSgI($eDVgz771Mj28Inl g%m~EtK+FQfCmr)GKq@C+kmQ*>$2DWKjq48<0IolOiMjlt!5XT+d3=GD`U*ab6Y+zitaj&uiM|x3aN^)vW&g4Xq?8&R0B`4=N zim-68-j$f_2w2d%oz2M4WyAFO!Q+Rw|VFTiP+w=ioKq6G#1D;G_6rf#PA?Nm!T+ZRjR z8zQP|rJCXB+MOIBwu_x$8|1 z9LQX|uD*%I;nXGcTsO}iVVdlCfE#Rm8@_LUY+1F}21O_FFiC}oJ6ZLH**W5)SV2ro z;Ic96KI_Oei}Fj_f|B-gCNM=upkJC4P?<3IgK6#a6yt|B89-{;Q{ z4tvcsd&P`cB?}uL>8IO8_)nYXH+ z7eLLJgd=J8&)ChK%MgJMYUGzt?TAX|T=IphjPgVEyHi)tg4>wF7}PK&3gcDW((?KS z*FKstr+cue2z1gR)#BYHZ8N{T!i5;g+VL>z;%f$@EDzU^dpq$g+tIw5THCbqT(fQ$ z#Pbh)!Nne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t!5XT+d3=D5&?X{I>{3gSSE)!N=!cDEW)DxHu~`9JI)bo0C(>(xBvhE delta 111 zcmdlog>lOiMjlt!5XT+d3=DS0U*ab6Y+x+dxHrAoB43yEEtmM!%*~Cd?@(zbBi~*B#9gj~w;w&=R!%1!P IKW8&G0O40D(*OVf diff --git a/bin/assets/ui/uitheme2x.png b/bin/assets/ui/uitheme2x.png index c7a5f0963494424bb193e9370be9cf11da493ad4..57e335f82e26cd1c78b10ca9dd489c52e8252a96 100644 GIT binary patch delta 7184 zcmeHM`CAiL+deZ1NsuH2Tu9ggq%Kv2u($(B026ApQnwu1#b&3X&27@FZA5M#YM@0^@QTiid}19A$;LU09DAX^PDO9+2H9$!zboda zV;8}a?qPC3uPWDYP-!`3!a&}OL!uA!`22>4l90rD8l58kvXE`TO{$vHqKQ^g7jmwc zP3s=4{z+kSkt{RVgm%6rM@2bL)5Udb8MyYMqko{*x-KN`z(x<8apfnc5nf$0v9Kex z9p?~?n>Fs1IPN_{n_4g4Vu#<1;99uV=$$`nWuZThTV=fNobfjfC+AhDUcXHJH^l-r7L&)q^t0oLYM@6+| zPF>b0nWFjPJ4KA>FUhuOk6FxI%CfV$h8G0;ZcMZ+Ajj*-r?V;ML&UX()daW5)C0$k ziIWX432LAM-|}Itf!j&FjVoOoWdfm?cW4f4{3~zHs*oySWp26D{e!HeQ@jr|3Hrz^ zP0kYYmao~zTfI72d?HW;UEA?jUG3ei@B7_Tj{UR+MgFiPY|?4oPsJ_RI#qlyhpnOq z@(HsERo^CL6j+k&JmbmedJ5gc$;Nz&y?uV79eYRXUi*Iqp^sq#MHIR;*VCb2{J~12 z)#3JDPfALzi0+Y{+U$!14eJH2Kqvm8ANS~$7F_^&CneDnbl&cqRfxA=Qmd8fgJ=im z#iiHVpcALXiHh!{Q?^cV~=qm3_W?XH$#yH8@SqZLRq@7u`il4&c zYc1p_j?H0k??G}ms4S5r^nO;LFX_(OY$Y3ZMhYz}209Z9 z|6^b^3oz~x-{a;GxHoqzj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heme2x/uitheme2x_tablerow_hover.png similarity index 100% rename from bin/assets/ui/uitheme2x/uitheme2x_gridcell_hover.png rename to bin/assets/ui/uitheme2x/uitheme2x_tablerow_hover.png diff --git a/bin/assets/ui/uitheme2x/uitheme2x_gridcell_selected.png b/bin/assets/ui/uitheme2x/uitheme2x_tablerow_selected.png similarity index 100% rename from bin/assets/ui/uitheme2x/uitheme2x_gridcell_selected.png rename to bin/assets/ui/uitheme2x/uitheme2x_tablerow_selected.png diff --git a/docs/articles/cssspecification.md b/docs/articles/cssspecification.md index f4fd18eda..1aab38424 100644 --- a/docs/articles/cssspecification.md +++ b/docs/articles/cssspecification.md @@ -745,7 +745,7 @@ Sets the horizontal scroll mode to any scrollable element. The mode defines the visibility of the horizontal scroll. * Applicable to: EE::UI::DropDownList (DropDownList), EE::UI::UIListBox (ListBox), - EE::UI::UIScrollView (ScrollView), EE::UI::UITable (Table), EE::UI::UITextEdit (TextEdit). + EE::UI::UIScrollView (ScrollView), EE::UI::UIWidgetTable (WidgetTable), EE::UI::UITextEdit (TextEdit). * Data Type: [string-list](#string-list-data-type) * Value List: * `auto`: The horizontal scrollbar will be visible only when needed. @@ -1282,7 +1282,7 @@ rotation-origin-point-y: 100%; Sets the row height in any element that contains fixed size rows. -* Applicable to: EE::UI::UIListBox (ListBox), EE::UI::UIDropDownList (DropDownList), EE::UI::UITable (Table), EE::UI::UIGridLayout (GridLayout) +* Applicable to: EE::UI::UIListBox (ListBox), EE::UI::UIDropDownList (DropDownList), EE::UI::UIWidgetTable (WidgetTable), EE::UI::UIGridLayout (GridLayout) * Data Type: [length](#length-data-type) * Default value: Varies on each case. ListBox and DropDownList will guess the value based on the [font-size](#font-size). Table requires this value to be manually set in order to work. GridLayout will require the value only if [row-mode](#row-mode) is `size`. @@ -1403,7 +1403,7 @@ Defines how the scrollbar should fit inside an scrollable element. Sets the scrollbar style (for the moment defines if it contains buttons at its edge or it's simply a bar). * Applicable to: EE::UI::UIScrollBar (ScrollBar), EE::UI::UIListBox (ListBox), EE::UI::UIDropDownList - (DropDownList), EE::UI::UITable (Table), EE::UI::UIScrollView (ScrollView) + (DropDownList), EE::UI::UIWidgetTable (WidgetTable), EE::UI::UIScrollView (ScrollView) * Data Type: [string-list](#string-list-data-type) * Value List: * `no-buttons`: It's just a scroll bar. @@ -1760,7 +1760,7 @@ Sets the total steps required to complete a progress bar (the maximum value a pr Enables/disables the element as draggable. When enabled the element will be able to be dragged. * Applicable to: EE::UI::UITouchDraggable (TouchDraggable), (EE::UI::UIListBox (ListBox), - EE::UI::UIScrollView (ScrollView), EE::UI::UITable (Table) + EE::UI::UIScrollView (ScrollView), EE::UI::UIWidgetTable (WidgetTable) * Data Type: [boolean](#boolean-data-type) * Default value: `false` @@ -1771,7 +1771,7 @@ Enables/disables the element as draggable. When enabled the element will be able Sets a acceleration value that defines how much will accelerate the drag when the mouse or touch is released. * Applicable to: EE::UI::UITouchDraggable (TouchDraggable), (EE::UI::UIListBox (ListBox), - EE::UI::UIScrollView (ScrollView), EE::UI::UITable (Table) + EE::UI::UIScrollView (ScrollView), EE::UI::UIWidgetTable (WidgetTable) * Data Type: [vector2-number](#vector2-number-data-type) * Default value: `5 5` @@ -1843,7 +1843,7 @@ Sets the vertical scroll mode to any scrollable element. The mode defines the visibility of the vertical scroll. * Applicable to: EE::UI::DropDownList (DropDownList), EE::UI::UIListBox (ListBox), - EE::UI::UIScrollView (ScrollView), EE::UI::UITable (Table), EE::UI::UITextEdit (TextEdit). + EE::UI::UIScrollView (ScrollView), EE::UI::UIWidgetTable (WidgetTable), EE::UI::UITextEdit (TextEdit). * Data Type: [string-list](#string-list-data-type) * Value List: * `auto`: The vertical scrollbar will be visible only when needed. diff --git a/include/eepp/scene/eventdispatcher.hpp b/include/eepp/scene/eventdispatcher.hpp index 18ad5afc7..3ea9e1ca6 100644 --- a/include/eepp/scene/eventdispatcher.hpp +++ b/include/eepp/scene/eventdispatcher.hpp @@ -44,6 +44,8 @@ class EE_API EventDispatcher { Node* getMouseDownNode() const; + void resetMouseDownNode(); + Node* getLossFocusNode() const; void sendMsg( Node* node, const Uint32& Msg, const Uint32& Flags = 0 ); diff --git a/include/eepp/ui.hpp b/include/eepp/ui.hpp index fa8dd947e..98ceed37c 100644 --- a/include/eepp/ui.hpp +++ b/include/eepp/ui.hpp @@ -37,8 +37,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/include/eepp/ui/abstract/uiabstracttableview.hpp b/include/eepp/ui/abstract/uiabstracttableview.hpp index ef3696fd5..3b9f8724a 100644 --- a/include/eepp/ui/abstract/uiabstracttableview.hpp +++ b/include/eepp/ui/abstract/uiabstracttableview.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include diff --git a/include/eepp/ui/css/stylesheetspecification.hpp b/include/eepp/ui/css/stylesheetspecification.hpp index c1e55ceac..4f263e33f 100644 --- a/include/eepp/ui/css/stylesheetspecification.hpp +++ b/include/eepp/ui/css/stylesheetspecification.hpp @@ -16,12 +16,12 @@ namespace EE { namespace UI { namespace CSS { class PropertySpecification; -typedef std::function +typedef std::function StyleSheetNodeSelector; struct StructuralSelector { StructuralSelector( StyleSheetNodeSelector selector, int a = 0, int b = 0, - FunctionString data = FunctionString::parse( "" ) ) : + const FunctionString& data = FunctionString::parse( "" ) ) : selector( selector ), a( a ), b( b ), data( data ) {} StyleSheetNodeSelector selector; int a; diff --git a/include/eepp/ui/uifiledialog.hpp b/include/eepp/ui/uifiledialog.hpp index fbad249a2..3c82276c0 100644 --- a/include/eepp/ui/uifiledialog.hpp +++ b/include/eepp/ui/uifiledialog.hpp @@ -18,10 +18,12 @@ class EE_API UIFileDialog : public UIWindow { SaveDialog = ( 1 << 0 ), FoldersFirst = ( 1 << 1 ), SortAlphabetically = ( 1 << 2 ), - AllowFolderSelect = ( 1 << 3 ) + AllowFolderSelect = ( 1 << 3 ), + ShowOnlyFolders = ( 1 << 4 ), + ShowHidden = ( 1 << 5 ) }; - static const Uint32 DefaultFlags = FoldersFirst | SortAlphabetically; + static const Uint32 DefaultFlags = FoldersFirst | SortAlphabetically | UIFileDialog::ShowHidden; static UIFileDialog* New( Uint32 dialogFlags = DefaultFlags, const std::string& defaultFilePattern = "*", @@ -74,6 +76,10 @@ class EE_API UIFileDialog : public UIWindow { bool getFoldersFirst(); + bool getShowOnlyFolders(); + + bool getShowHidden(); + bool getAllowFolderSelect(); void setSortAlphabetically( const bool& sortAlphabetically ); @@ -82,6 +88,10 @@ class EE_API UIFileDialog : public UIWindow { void setAllowFolderSelect( const bool& allowFolderSelect ); + void setShowOnlyFolders( const bool& showOnlyFolders ); + + void setShowHidden( const bool& showHidden ); + const KeyBindings::Shortcut& getCloseShortcut() const; void setFileName( const std::string& name ); diff --git a/include/eepp/ui/uihelper.hpp b/include/eepp/ui/uihelper.hpp index 0a502eb3c..ea4bc080f 100644 --- a/include/eepp/ui/uihelper.hpp +++ b/include/eepp/ui/uihelper.hpp @@ -71,7 +71,8 @@ enum UINodeType { UI_TYPE_MENUSUBMENU, UI_TYPE_TEXTEDIT, UI_TYPE_TOOLTIP, - UI_TYPE_TABLE, + UI_TYPE_WIDGETTABLE, + UI_TYPE_WIDGETTABLEROW, UI_TYPE_WINDOW, UI_TYPE_MENUBAR, UI_TYPE_SELECTBUTTON, @@ -95,6 +96,7 @@ enum UINodeType { UI_TYPE_SCROLLABLEWIDGET, UI_TYPE_TREEVIEW_CELL, UI_TYPE_TABLEVIEW, + UI_TYPE_TABLECELL, UI_TYPE_USER = 10000 }; diff --git a/include/eepp/ui/uitablecell.hpp b/include/eepp/ui/uitablecell.hpp index 4ae55b267..33450d524 100644 --- a/include/eepp/ui/uitablecell.hpp +++ b/include/eepp/ui/uitablecell.hpp @@ -1,56 +1,37 @@ -#ifndef EE_UICUIGRIDCELL_HPP -#define EE_UICUIGRIDCELL_HPP +#ifndef EE_UI_UITABLECELL_HPP +#define EE_UI_UITABLECELL_HPP -#include -#include +#include +#include + +using namespace EE::UI::Models; namespace EE { namespace UI { -class UITable; - -class EE_API UITableCell : public UIWidget { +class EE_API UITableCell : public UIPushButton { public: - static UITableCell* New(); + static UITableCell* New() { return eeNew( UITableCell, () ); } - UITableCell(); + static UITableCell* New( const std::string& tag ) { return eeNew( UITableCell, ( tag ) ); } - virtual ~UITableCell(); + Uint32 getType() const { return UI_TYPE_TABLECELL; } - virtual void setTheme( UITheme* Theme ); + bool isType( const Uint32& type ) const { + return UITableCell::getType() == type ? true : UIPushButton::isType( type ); + } - void setCell( const Uint32& ColumnIndex, UINode* node ); + ModelIndex getCurIndex() const { return mCurIndex; } - UINode* getCell( const Uint32& ColumnIndex ) const; - - bool isSelected() const; - - void unselect(); - - void select(); - - virtual Uint32 onMessage( const NodeMessage* Msg ); + void setCurIndex( const ModelIndex& curIndex ) { mCurIndex = curIndex; } protected: - friend class UIItemContainer; - friend class UITable; + ModelIndex mCurIndex; - std::vector mCells; + UITableCell() : UIPushButton( "table::cell" ) {} - UITable* gridParent() const; - - void fixCell(); - - virtual Uint32 onMouseLeave( const Vector2i& position, const Uint32& flags ); - - virtual void onStateChange(); - - virtual void onParentChange(); - - virtual void onAlphaChange(); - - virtual void onAutoSize(); + UITableCell( const std::string& tag ) : UIPushButton( tag ) {} }; }} // namespace EE::UI -#endif +#endif // EE_UI_UITABLECELL_HPP diff --git a/include/eepp/ui/uitablerow.hpp b/include/eepp/ui/uitablerow.hpp index 37b15c630..63c7897fd 100644 --- a/include/eepp/ui/uitablerow.hpp +++ b/include/eepp/ui/uitablerow.hpp @@ -12,6 +12,8 @@ class EE_API UITableRow : public UIWidget { public: static UITableRow* New( const std::string& tag ) { return eeNew( UITableRow, ( tag ) ); } + static UITableRow* New() { return eeNew( UITableRow, () ); } + ModelIndex getCurIndex() const { return mCurIndex; } void setCurIndex( const ModelIndex& curIndex ) { mCurIndex = curIndex; } @@ -19,6 +21,8 @@ class EE_API UITableRow : public UIWidget { protected: UITableRow( const std::string& tag ) : UIWidget( tag ) {} + UITableRow() : UIWidget( "table::row" ) {} + virtual Uint32 onMessage( const NodeMessage* msg ) { if ( msg->getMsg() == NodeMessage::MouseDown && ( msg->getFlags() & EE_BUTTON_LMASK ) && ( !getEventDispatcher()->getMouseDownNode() || diff --git a/include/eepp/ui/uitable.hpp b/include/eepp/ui/uiwidgettable.hpp similarity index 64% rename from include/eepp/ui/uitable.hpp rename to include/eepp/ui/uiwidgettable.hpp index 1a48a124b..817fca5b5 100644 --- a/include/eepp/ui/uitable.hpp +++ b/include/eepp/ui/uiwidgettable.hpp @@ -4,18 +4,16 @@ #include #include #include -#include #include +#include namespace EE { namespace UI { -class EE_API UITable : public UITouchDraggableWidget { +class EE_API UIWidgetTable : public UITouchDraggableWidget { public: - static UITable* New(); + static UIWidgetTable* New(); - UITable(); - - ~UITable(); + ~UIWidgetTable(); virtual Uint32 getType() const; @@ -23,57 +21,57 @@ class EE_API UITable : public UITouchDraggableWidget { virtual void setTheme( UITheme* Theme ); - void add( UITableCell* Cell ); + void add( UIWidgetTableRow* row ); - void remove( UITableCell* Cell ); + void remove( UIWidgetTableRow* row ); - void remove( std::vector ItemsIndex ); + void remove( std::vector itemsIndex ); - void remove( Uint32 ItemIndex ); + void remove( Uint32 itemIndex ); - UITable* setColumnWidth( const Uint32& ColumnIndex, const Uint32& columnWidth ); + UIWidgetTable* setColumnWidth( const Uint32& columnIndex, const Uint32& columnWidth ); - const Uint32& getColumnWidth( const Uint32& ColumnIndex ) const; + const Uint32& getColumnWidth( const Uint32& columnIndex ) const; Uint32 getCount() const; - UITable* setColumnsCount( const Uint32& columnsCount ); + UIWidgetTable* setColumnsCount( const Uint32& columnsCount ); const Uint32& getColumnsCount() const; - UITable* setRowHeight( const Uint32& height ); + UIWidgetTable* setRowHeight( const Uint32& height ); const Uint32& getRowHeight() const; - UITableCell* getCell( const Uint32& CellIndex ) const; + UIWidgetTableRow* getRow( const Uint32& rowIndex ) const; - void setVerticalScrollMode( const ScrollBarMode& Mode ); + void setVerticalScrollMode( const ScrollBarMode& mode ); const ScrollBarMode& getVerticalScrollMode(); - void setHorizontalScrollMode( const ScrollBarMode& Mode ); + void setHorizontalScrollMode( const ScrollBarMode& mode ); const ScrollBarMode& getHorizontalScrollMode(); - Uint32 getCellPosition( const Uint32& ColumnIndex ); + Uint32 getColumnPosition( const Uint32& columnIndex ); UIScrollBar* getVerticalScrollBar() const; UIScrollBar* getHorizontalScrollBar() const; - Uint32 getItemIndex( UITableCell* Item ); + Uint32 getItemIndex( UIWidgetTableRow* item ); - UITableCell* getItemSelected(); + UIWidgetTableRow* getItemSelected(); Uint32 getItemSelectedIndex() const; Uint32 onMessage( const NodeMessage* Msg ); - UIItemContainer* getContainer() const; + UIItemContainer* getContainer() const; bool getSmoothScroll() const; - UITable* setSmoothScroll( bool smoothScroll ); + UIWidgetTable* setSmoothScroll( bool smoothScroll ); Rectf getContainerPadding() const; @@ -83,16 +81,16 @@ class EE_API UITable : public UITouchDraggableWidget { const Uint32& propertyIndex = 0 ); protected: - friend class UIItemContainer; - friend class UITableCell; + friend class UIItemContainer; + friend class UIWidgetTableRow; Rectf mContainerPadding; - UIItemContainer* mContainer; + UIItemContainer* mContainer; UIScrollBar* mVScrollBar; UIScrollBar* mHScrollBar; ScrollBarMode mVScrollMode; ScrollBarMode mHScrollMode; - std::vector mItems; + std::vector mItems; Uint32 mColumnsCount; Uint32 mRowHeight; std::vector mColumnsWidth; @@ -108,6 +106,8 @@ class EE_API UITable : public UITouchDraggableWidget { bool mSmoothScroll; bool mCollWidthAssigned; + UIWidgetTable(); + void updateCells(); void updateColumnsPos(); diff --git a/include/eepp/ui/uiwidgettablerow.hpp b/include/eepp/ui/uiwidgettablerow.hpp new file mode 100644 index 000000000..d8bb58633 --- /dev/null +++ b/include/eepp/ui/uiwidgettablerow.hpp @@ -0,0 +1,60 @@ +#ifndef EE_UI_UIWIDGETTABLEROW_HPP +#define EE_UI_UIWIDGETTABLEROW_HPP + +#include +#include + +namespace EE { namespace UI { + +class UIWidgetTable; + +class EE_API UIWidgetTableRow : public UIWidget { + public: + static UIWidgetTableRow* New(); + + Uint32 getType() const; + + bool isType( const Uint32& type ) const; + + virtual ~UIWidgetTableRow(); + + virtual void setTheme( UITheme* Theme ); + + void setColumn( const Uint32& columnIndex, UINode* node ); + + UINode* getColumn( const Uint32& columnIndex ) const; + + bool isSelected() const; + + void unselect(); + + void select(); + + virtual Uint32 onMessage( const NodeMessage* Msg ); + + protected: + friend class UIItemContainer; + friend class UIWidgetTable; + + std::vector mCells; + + UIWidgetTableRow(); + + UIWidgetTable* gridParent() const; + + void updateRow(); + + virtual Uint32 onMouseLeave( const Vector2i& position, const Uint32& flags ); + + virtual void onStateChange(); + + virtual void onParentChange(); + + virtual void onAlphaChange(); + + virtual void onAutoSize(); +}; + +}} // namespace EE::UI + +#endif diff --git a/projects/linux/ee.files b/projects/linux/ee.files index abb79976f..68ab3e6cb 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -398,7 +398,6 @@ ../../include/eepp/ui/uistyle.hpp ../../include/eepp/ui/uitab.hpp ../../include/eepp/ui/uitablecell.hpp -../../include/eepp/ui/uitable.hpp ../../include/eepp/ui/uitableheadercolumn.hpp ../../include/eepp/ui/uitablerow.hpp ../../include/eepp/ui/uitableview.hpp @@ -416,6 +415,8 @@ ../../include/eepp/ui/uiviewpager.hpp ../../include/eepp/ui/uiwidgetcreator.hpp ../../include/eepp/ui/uiwidget.hpp +../../include/eepp/ui/uiwidgettable.hpp +../../include/eepp/ui/uiwidgettablerow.hpp ../../include/eepp/ui/uiwindow.hpp ../../include/eepp/version.hpp ../../include/eepp/window/base.hpp @@ -866,8 +867,6 @@ ../../src/eepp/ui/uistate.cpp ../../src/eepp/ui/uistyle.cpp ../../src/eepp/ui/uitab.cpp -../../src/eepp/ui/uitablecell.cpp -../../src/eepp/ui/uitable.cpp ../../src/eepp/ui/uitableheadercolumn.cpp ../../src/eepp/ui/uitableview.cpp ../../src/eepp/ui/uitabwidget.cpp @@ -884,6 +883,8 @@ ../../src/eepp/ui/uiviewpager.cpp ../../src/eepp/ui/uiwidget.cpp ../../src/eepp/ui/uiwidgetcreator.cpp +../../src/eepp/ui/uiwidgettable.cpp +../../src/eepp/ui/uiwidgettablerow.cpp ../../src/eepp/ui/uiwindow.cpp ../../src/eepp/window/backend/allegro5/cbackendal.hpp ../../src/eepp/window/backend/allegro5/cclipboardal.cpp diff --git a/src/eepp/maps/mapeditor/maplayerproperties.cpp b/src/eepp/maps/mapeditor/maplayerproperties.cpp index 618a49ddb..67a2b5441 100644 --- a/src/eepp/maps/mapeditor/maplayerproperties.cpp +++ b/src/eepp/maps/mapeditor/maplayerproperties.cpp @@ -87,7 +87,7 @@ MapLayerProperties::MapLayerProperties( MapLayer* Map, RefreshLayerListCb Cb ) : CancelButton->setText( "Cancel" ); CancelButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ); - mGenGrid = UITable::New(); + mGenGrid = UIWidgetTable::New(); mGenGrid->setParent( mUIWindow->getContainer() ); mGenGrid->setSize( 400, 340 ) ->setPosition( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() ); @@ -136,10 +136,10 @@ void MapLayerProperties::saveProperties() { mLayer->clearProperties(); for ( Uint32 i = 0; i < mGenGrid->getCount(); i++ ) { - UITableCell* Cell = mGenGrid->getCell( i ); + UIWidgetTableRow* Cell = mGenGrid->getRow( i ); - UITextInput* Input = Cell->getCell( 1 )->asType(); - UITextInput* Input2 = Cell->getCell( 3 )->asType(); + UITextInput* Input = Cell->getColumn( 1 )->asType(); + UITextInput* Input2 = Cell->getColumn( 3 )->asType(); if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) { mLayer->addProperty( Input->getText(), Input2->getText() ); @@ -151,10 +151,10 @@ void MapLayerProperties::loadProperties() { MapLayer::PropertiesMap& Proper = mLayer->getProperties(); for ( MapLayer::PropertiesMap::iterator it = Proper.begin(); it != Proper.end(); ++it ) { - UITableCell* Cell = createCell(); + UIWidgetTableRow* Cell = createCell(); - UITextInput* Input = Cell->getCell( 1 )->asType(); - UITextInput* Input2 = Cell->getCell( 3 )->asType(); + UITextInput* Input = Cell->getColumn( 1 )->asType(); + UITextInput* Input2 = Cell->getColumn( 3 )->asType(); Input->setText( it->first ); Input2->setText( it->second ); @@ -189,7 +189,7 @@ void MapLayerProperties::onAddCellClick( const Event* ) { Uint32 Index = mGenGrid->getItemSelectedIndex(); if ( eeINDEX_NOT_FOUND == Index ) { - mGenGrid->getCell( 0 )->select(); + mGenGrid->getRow( 0 )->select(); } } @@ -200,11 +200,11 @@ void MapLayerProperties::onRemoveCellClick( const Event* ) { mGenGrid->remove( Index ); if ( Index < mGenGrid->getCount() ) { - mGenGrid->getCell( Index )->select(); + mGenGrid->getRow( Index )->select(); } else { if ( mGenGrid->getCount() ) { if ( Index > 0 ) - mGenGrid->getCell( Index - 1 )->select(); + mGenGrid->getRow( Index - 1 )->select(); } } } @@ -216,12 +216,12 @@ void MapLayerProperties::createGridElems() { if ( 0 == mGenGrid->getCount() ) { onAddCellClick( NULL ); } else { - mGenGrid->getCell( 0 )->select(); + mGenGrid->getRow( 0 )->select(); } } -UITableCell* MapLayerProperties::createCell() { - UITableCell* Cell = UITableCell::New(); +UIWidgetTableRow* MapLayerProperties::createCell() { + UIWidgetTableRow* Cell = UIWidgetTableRow::New(); UITextInput* TxtInput = UITextInput::New(); UITextInput* TxtInput2 = UITextInput::New(); @@ -229,11 +229,11 @@ UITableCell* MapLayerProperties::createCell() { TxtInput->setMaxLength( LAYER_NAME_SIZE ); TxtInput2->setMaxLength( LAYER_NAME_SIZE ); - Cell->setCell( 0, UIWidget::New() ); - Cell->setCell( 1, TxtInput ); - Cell->setCell( 2, UIWidget::New() ); - Cell->setCell( 3, TxtInput2 ); - Cell->setCell( 4, UIWidget::New() ); + Cell->setColumn( 0, UIWidget::New() ); + Cell->setColumn( 1, TxtInput ); + Cell->setColumn( 2, UIWidget::New() ); + Cell->setColumn( 3, TxtInput2 ); + Cell->setColumn( 4, UIWidget::New() ); return Cell; } diff --git a/src/eepp/maps/mapeditor/maplayerproperties.hpp b/src/eepp/maps/mapeditor/maplayerproperties.hpp index 539360c32..77a773954 100644 --- a/src/eepp/maps/mapeditor/maplayerproperties.hpp +++ b/src/eepp/maps/mapeditor/maplayerproperties.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -25,7 +25,7 @@ class EE_API MapLayerProperties { protected: UITheme* mUITheme; UIWindow* mUIWindow; - UITable* mGenGrid; + UIWidgetTable* mGenGrid; MapLayer* mLayer; UITextInput* mUIInput; RefreshLayerListCb mRefreshCb; @@ -46,7 +46,7 @@ class EE_API MapLayerProperties { void loadProperties(); - UITableCell* createCell(); + UIWidgetTableRow* createCell(); }; }}} // namespace EE::Maps::Private diff --git a/src/eepp/maps/mapeditor/mapobjectproperties.cpp b/src/eepp/maps/mapeditor/mapobjectproperties.cpp index a936e7835..b12983b47 100644 --- a/src/eepp/maps/mapeditor/mapobjectproperties.cpp +++ b/src/eepp/maps/mapeditor/mapobjectproperties.cpp @@ -105,7 +105,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject* Obj ) : CancelButton->setText( "Cancel" ); CancelButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ); - mGenGrid = UITable::New(); + mGenGrid = UIWidgetTable::New(); mGenGrid->setParent( mUIWindow->getContainer() ); mGenGrid->setSize( 400, 340 ) ->setPosition( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() ); @@ -154,10 +154,10 @@ void MapObjectProperties::saveProperties() { mObj->clearProperties(); for ( Uint32 i = 0; i < mGenGrid->getCount(); i++ ) { - UITableCell* Cell = mGenGrid->getCell( i ); + UIWidgetTableRow* Cell = mGenGrid->getRow( i ); - UITextInput* Input = Cell->getCell( 1 )->asType(); - UITextInput* Input2 = Cell->getCell( 3 )->asType(); + UITextInput* Input = Cell->getColumn( 1 )->asType(); + UITextInput* Input2 = Cell->getColumn( 3 )->asType(); if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) { mObj->addProperty( Input->getText(), Input2->getText() ); @@ -170,10 +170,10 @@ void MapObjectProperties::loadProperties() { for ( GameObjectObject::PropertiesMap::iterator it = Proper.begin(); it != Proper.end(); ++it ) { - UITableCell* Cell = createCell(); + UIWidgetTableRow* Cell = createCell(); - UITextInput* Input = Cell->getCell( 1 )->asType(); - UITextInput* Input2 = Cell->getCell( 3 )->asType(); + UITextInput* Input = Cell->getColumn( 1 )->asType(); + UITextInput* Input2 = Cell->getColumn( 3 )->asType(); Input->setText( it->first ); Input2->setText( it->second ); @@ -205,7 +205,7 @@ void MapObjectProperties::onAddCellClick( const Event* Event ) { Uint32 Index = mGenGrid->getItemSelectedIndex(); if ( eeINDEX_NOT_FOUND == Index ) { - mGenGrid->getCell( 0 )->select(); + mGenGrid->getRow( 0 )->select(); } } @@ -216,11 +216,11 @@ void MapObjectProperties::onRemoveCellClick( const Event* Event ) { mGenGrid->remove( Index ); if ( Index < mGenGrid->getCount() ) { - mGenGrid->getCell( Index )->select(); + mGenGrid->getRow( Index )->select(); } else { if ( mGenGrid->getCount() ) { if ( Index > 0 ) - mGenGrid->getCell( Index - 1 )->select(); + mGenGrid->getRow( Index - 1 )->select(); } } } @@ -232,12 +232,12 @@ void MapObjectProperties::createGridElems() { if ( 0 == mGenGrid->getCount() ) { onAddCellClick( NULL ); } else { - mGenGrid->getCell( 0 )->select(); + mGenGrid->getRow( 0 )->select(); } } -UITableCell* MapObjectProperties::createCell() { - UITableCell* Cell = UITableCell::New(); +UIWidgetTableRow* MapObjectProperties::createCell() { + UIWidgetTableRow* Cell = UIWidgetTableRow::New(); UITextInput* TxtInput = UITextInput::New(); UITextInput* TxtInput2 = UITextInput::New(); @@ -245,11 +245,11 @@ UITableCell* MapObjectProperties::createCell() { TxtInput->setMaxLength( LAYER_NAME_SIZE ); TxtInput2->setMaxLength( LAYER_NAME_SIZE ); - Cell->setCell( 0, UIWidget::New() ); - Cell->setCell( 1, TxtInput ); - Cell->setCell( 2, UIWidget::New() ); - Cell->setCell( 3, TxtInput2 ); - Cell->setCell( 4, UIWidget::New() ); + Cell->setColumn( 0, UIWidget::New() ); + Cell->setColumn( 1, TxtInput ); + Cell->setColumn( 2, UIWidget::New() ); + Cell->setColumn( 3, TxtInput2 ); + Cell->setColumn( 4, UIWidget::New() ); return Cell; } diff --git a/src/eepp/maps/mapeditor/mapobjectproperties.hpp b/src/eepp/maps/mapeditor/mapobjectproperties.hpp index f267045f5..cc5441d89 100644 --- a/src/eepp/maps/mapeditor/mapobjectproperties.hpp +++ b/src/eepp/maps/mapeditor/mapobjectproperties.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ class MapObjectProperties { protected: UITheme* mUITheme; UIWindow* mUIWindow; - UITable* mGenGrid; + UIWidgetTable* mGenGrid; GameObjectObject* mObj; UITextInput* mUIInput; UITextInput* mUIInput2; @@ -44,7 +44,7 @@ class MapObjectProperties { void loadProperties(); - UITableCell* createCell(); + UIWidgetTableRow* createCell(); }; }}} // namespace EE::Maps::Private diff --git a/src/eepp/maps/mapeditor/tilemapproperties.cpp b/src/eepp/maps/mapeditor/tilemapproperties.cpp index c8a5c1611..a83fb3d91 100644 --- a/src/eepp/maps/mapeditor/tilemapproperties.cpp +++ b/src/eepp/maps/mapeditor/tilemapproperties.cpp @@ -156,7 +156,7 @@ TileMapProperties::TileMapProperties( TileMap* Map ) : CancelButton->setText( "Cancel" ); CancelButton->setAnchors( UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM ); - mGenGrid = UITable::New(); + mGenGrid = UIWidgetTable::New(); mGenGrid->setParent( mUIWindow->getContainer() ); mGenGrid->setSize( 400, 310 ) ->setPosition( 50, TxtBox->getPosition().y + TxtBox->getSize().getHeight() ); @@ -238,10 +238,10 @@ void TileMapProperties::saveProperties() { mMap->clearProperties(); for ( Uint32 i = 0; i < mGenGrid->getCount(); i++ ) { - UITableCell* Cell = mGenGrid->getCell( i ); + UIWidgetTableRow* Cell = mGenGrid->getRow( i ); - UITextInput* Input = Cell->getCell( 1 )->asType(); - UITextInput* Input2 = Cell->getCell( 3 )->asType(); + UITextInput* Input = Cell->getColumn( 1 )->asType(); + UITextInput* Input2 = Cell->getColumn( 3 )->asType(); if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) { mMap->addProperty( Input->getText(), Input2->getText() ); @@ -253,10 +253,10 @@ void TileMapProperties::loadProperties() { TileMap::PropertiesMap& Proper = mMap->getProperties(); for ( TileMap::PropertiesMap::iterator it = Proper.begin(); it != Proper.end(); ++it ) { - UITableCell* Cell = createCell(); + UIWidgetTableRow* Cell = createCell(); - UITextInput* Input = Cell->getCell( 1 )->asType(); - UITextInput* Input2 = Cell->getCell( 3 )->asType(); + UITextInput* Input = Cell->getColumn( 1 )->asType(); + UITextInput* Input2 = Cell->getColumn( 3 )->asType(); Input->setText( it->first ); Input2->setText( it->second ); @@ -285,7 +285,7 @@ void TileMapProperties::onAddCellClick( const Event* ) { Uint32 Index = mGenGrid->getItemSelectedIndex(); if ( eeINDEX_NOT_FOUND == Index ) { - mGenGrid->getCell( 0 )->select(); + mGenGrid->getRow( 0 )->select(); } } @@ -296,11 +296,11 @@ void TileMapProperties::onRemoveCellClick( const Event* ) { mGenGrid->remove( Index ); if ( Index < mGenGrid->getCount() ) { - mGenGrid->getCell( Index )->select(); + mGenGrid->getRow( Index )->select(); } else { if ( mGenGrid->getCount() ) { if ( Index > 0 ) - mGenGrid->getCell( Index - 1 )->select(); + mGenGrid->getRow( Index - 1 )->select(); } } } @@ -312,12 +312,12 @@ void TileMapProperties::createGridElems() { if ( 0 == mGenGrid->getCount() ) { onAddCellClick( NULL ); } else { - mGenGrid->getCell( 0 )->select(); + mGenGrid->getRow( 0 )->select(); } } -UITableCell* TileMapProperties::createCell() { - UITableCell* Cell = UITableCell::New(); +UIWidgetTableRow* TileMapProperties::createCell() { + UIWidgetTableRow* Cell = UIWidgetTableRow::New(); UITextInput* TxtInput = UITextInput::New(); UITextInput* TxtInput2 = UITextInput::New(); @@ -325,11 +325,11 @@ UITableCell* TileMapProperties::createCell() { TxtInput->setMaxLength( LAYER_NAME_SIZE ); TxtInput2->setMaxLength( LAYER_NAME_SIZE ); - Cell->setCell( 0, UIWidget::New() ); - Cell->setCell( 1, TxtInput ); - Cell->setCell( 2, UIWidget::New() ); - Cell->setCell( 3, TxtInput2 ); - Cell->setCell( 4, UIWidget::New() ); + Cell->setColumn( 0, UIWidget::New() ); + Cell->setColumn( 1, TxtInput ); + Cell->setColumn( 2, UIWidget::New() ); + Cell->setColumn( 3, TxtInput2 ); + Cell->setColumn( 4, UIWidget::New() ); return Cell; } diff --git a/src/eepp/maps/mapeditor/tilemapproperties.hpp b/src/eepp/maps/mapeditor/tilemapproperties.hpp index 3175da25c..6682e31f8 100644 --- a/src/eepp/maps/mapeditor/tilemapproperties.hpp +++ b/src/eepp/maps/mapeditor/tilemapproperties.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -21,7 +21,7 @@ class EE_API TileMapProperties { protected: UITheme* mUITheme; UIWindow* mUIWindow; - UITable* mGenGrid; + UIWidgetTable* mGenGrid; TileMap* mMap; UIWidget* mUIBaseColor; UISlider* mUIRedSlider; @@ -53,7 +53,7 @@ class EE_API TileMapProperties { void loadProperties(); - UITableCell* createCell(); + UIWidgetTableRow* createCell(); }; }}} // namespace EE::Maps::Private diff --git a/src/eepp/scene/eventdispatcher.cpp b/src/eepp/scene/eventdispatcher.cpp index 0e59b56c7..b81ce319a 100644 --- a/src/eepp/scene/eventdispatcher.cpp +++ b/src/eepp/scene/eventdispatcher.cpp @@ -230,6 +230,10 @@ Node* EventDispatcher::getMouseDownNode() const { return mDownNode; } +void EventDispatcher::resetMouseDownNode() { + mDownNode = mSceneNode; +} + Node* EventDispatcher::getMouseOverNode() const { return mOverNode; } diff --git a/src/eepp/scene/node.cpp b/src/eepp/scene/node.cpp index 20937c368..6a37d3607 100644 --- a/src/eepp/scene/node.cpp +++ b/src/eepp/scene/node.cpp @@ -58,6 +58,10 @@ Node::~Node() { if ( eventDispatcher->getMouseOverNode() == this && mSceneNode != this ) { eventDispatcher->setMouseOverNode( mSceneNode ); } + + if ( eventDispatcher->getMouseDownNode() == this ) { + eventDispatcher->resetMouseDownNode(); + } } } diff --git a/src/eepp/ui/abstract/uiabstracttableview.cpp b/src/eepp/ui/abstract/uiabstracttableview.cpp index 6de41efa9..853e8504c 100644 --- a/src/eepp/ui/abstract/uiabstracttableview.cpp +++ b/src/eepp/ui/abstract/uiabstracttableview.cpp @@ -264,7 +264,7 @@ void UIAbstractTableView::setColumnsHidden( const std::vector columns, b UITableRow* UIAbstractTableView::createRow() { mUISceneNode->invalidateStyle( this ); mUISceneNode->invalidateStyleState( this, true ); - UITableRow* rowWidget = UITableRow::New( "table::row" ); + UITableRow* rowWidget = UITableRow::New(); rowWidget->setParent( this ); rowWidget->setLayoutSizePolicy( SizePolicy::Fixed, SizePolicy::Fixed ); rowWidget->reloadStyle( true, true, true ); @@ -305,13 +305,14 @@ void UIAbstractTableView::onScrollChange() { mHeader->setPixelsPosition( -mScrollOffset.x, 0 ); } -UIWidget* UIAbstractTableView::createCell( UIWidget* rowWidget, const ModelIndex& ) { - UIPushButton* widget = UIPushButton::NewWithTag( "table::cell" ); +UIWidget* UIAbstractTableView::createCell( UIWidget* rowWidget, const ModelIndex& index ) { + UITableCell* widget = UITableCell::New(); widget->setParent( rowWidget ); widget->unsetFlags( UI_AUTO_SIZE ); widget->clipEnable(); widget->setLayoutSizePolicy( SizePolicy::Fixed, SizePolicy::Fixed ); widget->setTextAlign( UI_HALIGN_LEFT ); + widget->setCurIndex( index ); widget->addEventListener( Event::MouseDoubleClick, [&]( const Event* event ) { auto mouseEvent = static_cast( event ); auto idx = mouseEvent->getNode()->getParent()->asType()->getCurIndex(); @@ -335,24 +336,25 @@ UIWidget* UIAbstractTableView::updateCell( const int& rowIndex, const ModelIndex } widget->setPixelsSize( columnData( index.column() ).width, getRowHeight() ); widget->setPixelsPosition( {getColumnPosition( index.column() ).x, 0} ); - if ( widget->isType( UI_TYPE_PUSHBUTTON ) ) { - UIPushButton* pushButton = widget->asType(); + if ( widget->isType( UI_TYPE_TABLECELL ) ) { + UITableCell* cell = widget->asType(); + cell->setCurIndex( index ); Variant txt( getModel()->data( index, Model::Role::Display ) ); if ( txt.isValid() ) { if ( txt.is( Variant::Type::String ) ) - pushButton->setText( txt.asString() ); + cell->setText( txt.asString() ); else if ( txt.is( Variant::Type::cstr ) ) - pushButton->setText( txt.asCStr() ); + cell->setText( txt.asCStr() ); } bool isVisible = false; Variant icon( getModel()->data( index, Model::Role::Icon ) ); if ( icon.is( Variant::Type::Drawable ) && icon.asDrawable() ) { isVisible = true; - pushButton->setIcon( icon.asDrawable() ); + cell->setIcon( icon.asDrawable() ); } - pushButton->getIcon()->setVisible( isVisible ); + cell->getIcon()->setVisible( isVisible ); } return widget; diff --git a/src/eepp/ui/css/stylesheetspecification.cpp b/src/eepp/ui/css/stylesheetspecification.cpp index 8f33fc251..252629278 100644 --- a/src/eepp/ui/css/stylesheetspecification.cpp +++ b/src/eepp/ui/css/stylesheetspecification.cpp @@ -424,19 +424,19 @@ static bool isNth( int a, int b, int count ) { void StyleSheetSpecification::registerDefaultNodeSelectors() { mNodeSelectors["empty"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return node->getFirstChild() == NULL; }; mNodeSelectors["first-child"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return NULL != node->getParent() && node->getParent()->getFirstChild() == node; }; mNodeSelectors["enabled"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { return node->isEnabled(); }; + const FunctionString& data ) -> bool { return node->isEnabled(); }; mNodeSelectors["disabled"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { return !node->isEnabled(); }; + const FunctionString& data ) -> bool { return !node->isEnabled(); }; mNodeSelectors["first-of-type"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { Node* child = NULL != node->getParent() ? node->getParent()->getFirstChild() : NULL; Uint32 type = node->getType(); while ( NULL != child ) { @@ -448,11 +448,11 @@ void StyleSheetSpecification::registerDefaultNodeSelectors() { return false; }; mNodeSelectors["last-child"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return NULL != node->getParent() && node->getParent()->getLastChild() == node; }; mNodeSelectors["last-of-type"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { Node* child = NULL != node->getParent() ? node->getParent()->getLastChild() : NULL; Uint32 type = node->getType(); while ( NULL != child ) { @@ -464,11 +464,11 @@ void StyleSheetSpecification::registerDefaultNodeSelectors() { return false; }; mNodeSelectors["only-child"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return NULL != node->getParent() && node->getParent()->getChildCount() == 1; }; mNodeSelectors["only-of-type"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { Node* child = NULL != node->getParent() ? node->getParent()->getFirstChild() : NULL; Uint32 type = node->getType(); Uint32 typeCount = 0; @@ -483,19 +483,19 @@ void StyleSheetSpecification::registerDefaultNodeSelectors() { return typeCount == 1; }; mNodeSelectors["nth-child"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return isNth( a, b, node->getNodeIndex() + 1 ); }; mNodeSelectors["nth-last-child"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return isNth( a, b, node->getChildCount() - node->getNodeIndex() ); }; mNodeSelectors["nth-of-type"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return isNth( a, b, node->getNodeOfTypeIndex() + 1 ); }; mNodeSelectors["nth-last-of-type"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return node->getParent() != NULL ? isNth( a, b, node->getParent()->getChildOfTypeCount( node->getType() ) - @@ -503,10 +503,10 @@ void StyleSheetSpecification::registerDefaultNodeSelectors() { : false; }; mNodeSelectors["checked"] = []( const UIWidget* node, int a, int b, - FunctionString data ) -> bool { + const FunctionString& data ) -> bool { return 0 != ( node->getFlags() & UI_CHECKED ); }; - mNodeSelectors["not"] = []( const UIWidget* node, int a, int b, FunctionString data ) -> bool { + mNodeSelectors["not"] = []( const UIWidget* node, int a, int b, const FunctionString& data ) -> bool { if ( !data.isEmpty() && !data.getParameters().empty() && data.getName() == "not" ) { for ( const auto& param : data.getParameters() ) { if ( !param.empty() ) { diff --git a/src/eepp/ui/uifiledialog.cpp b/src/eepp/ui/uifiledialog.cpp index d6bcf7109..bdec6eb7c 100644 --- a/src/eepp/ui/uifiledialog.cpp +++ b/src/eepp/ui/uifiledialog.cpp @@ -199,9 +199,9 @@ void UIFileDialog::setTheme( UITheme* Theme ) { void UIFileDialog::refreshFolder() { FileSystem::dirAddSlashAtEnd( mCurPath ); - std::vector flist = FileSystem::filesGetInPath( String( mCurPath ) ); + std::vector flist = FileSystem::filesGetInPath( + String( mCurPath ), getSortAlphabetically(), getFoldersFirst(), !getShowHidden() ); std::vector files; - std::vector folders; std::vector patterns; bool accepted; Uint32 i, z; @@ -214,9 +214,9 @@ void UIFileDialog::refreshFolder() { } for ( i = 0; i < flist.size(); i++ ) { - if ( getFoldersFirst() && FileSystem::isDirectory( mCurPath + flist[i] ) ) { - folders.push_back( flist[i] ); - } else { + if ( FileSystem::isDirectory( mCurPath + flist[i] ) ) { + files.push_back( flist[i] ); + } else if ( !getShowOnlyFolders() ) { accepted = false; if ( patterns.size() ) { @@ -235,17 +235,8 @@ void UIFileDialog::refreshFolder() { } } - if ( getSortAlphabetically() ) { - std::sort( folders.begin(), folders.end() ); - std::sort( files.begin(), files.end() ); - } - mList->clear(); - if ( getFoldersFirst() ) { - mList->addListBoxItems( folders ); - } - mList->addListBoxItems( files ); updateClickStep(); @@ -420,6 +411,14 @@ bool UIFileDialog::getAllowFolderSelect() { return 0 != ( mDialogFlags & AllowFolderSelect ); } +bool UIFileDialog::getShowOnlyFolders() { + return 0 != ( mDialogFlags & ShowOnlyFolders ); +} + +bool UIFileDialog::getShowHidden() { + return 0 != ( mDialogFlags & ShowHidden ); +} + void UIFileDialog::setSortAlphabetically( const bool& sortAlphabetically ) { BitOp::setBitFlagValue( &mDialogFlags, SortAlphabetically, sortAlphabetically ? 1 : 0 ); refreshFolder(); @@ -434,6 +433,16 @@ void UIFileDialog::setAllowFolderSelect( const bool& allowFolderSelect ) { BitOp::setBitFlagValue( &mDialogFlags, AllowFolderSelect, allowFolderSelect ? 1 : 0 ); } +void UIFileDialog::setShowOnlyFolders( const bool& showOnlyFolders ) { + BitOp::setBitFlagValue( &mDialogFlags, ShowOnlyFolders, showOnlyFolders ? 1 : 0 ); + refreshFolder(); +} + +void UIFileDialog::setShowHidden( const bool& showHidden ) { + BitOp::setBitFlagValue( &mDialogFlags, ShowHidden, showHidden ? 1 : 0 ); + refreshFolder(); +} + std::string UIFileDialog::getFullPath() { std::string tPath = mCurPath; diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index 4e5afca13..60930479d 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -110,12 +110,14 @@ Vector2f UIPushButton::packLayout( const std::vector& widgets, const break; } if ( 0 == i ) - pos[i].x += PixelDensity::dpToPxI( widget->getLayoutMargin().Left ); - totSize.x += widget->getPixelsSize().getWidth() > 0 - ? PixelDensity::dpToPxI( widget->getLayoutMargin().Left + - widget->getLayoutMargin().Right ) + - widget->getPixelsSize().getWidth() - : 0; + pos[i].x += widget->getLayoutPixelsMargin().Left; + if ( widget->getPixelsSize().getWidth() > 0 ) { + totSize.x += widget->getLayoutPixelsMargin().Left + widget->getPixelsSize().getWidth(); + if ( ( i + 1 < widgets.size() && widgets[i + 1] && widgets[i + 1]->isVisible() ) || + ( i + 2 < widgets.size() && widgets[i + 2] && widgets[i + 2]->isVisible() ) ) { + totSize.x += widget->getLayoutPixelsMargin().Right; + } + } totSize.y = eemax( totSize.y, padding.Top + padding.Bottom + widget->getPixelsSize().getHeight() ); } @@ -223,6 +225,7 @@ UIPushButton* UIPushButton::setIcon( Drawable* icon ) { if ( mIcon->getDrawable() != icon ) { mIcon->setPixelsSize( icon->getPixelsSize() ); mIcon->setDrawable( icon ); + mTextBox->setVisible( !getText().empty() ); updateLayout(); } return this; @@ -234,6 +237,7 @@ UIImage* UIPushButton::getIcon() const { UIPushButton* UIPushButton::setText( const String& text ) { if ( text != mTextBox->getText() ) { + mTextBox->setVisible( !text.empty() ); mTextBox->setText( text ); updateLayout(); } diff --git a/src/eepp/ui/uitreeview.cpp b/src/eepp/ui/uitreeview.cpp index 7167e5364..75691c9e4 100644 --- a/src/eepp/ui/uitreeview.cpp +++ b/src/eepp/ui/uitreeview.cpp @@ -106,14 +106,14 @@ void UITreeView::updateContentSize() { onContentSizeChange(); } -class UITreeViewCell : public UIPushButton { +class UITreeViewCell : public UITableCell { public: static UITreeViewCell* New() { return eeNew( UITreeViewCell, () ); } Uint32 getType() const { return UI_TYPE_TREEVIEW_CELL; } bool isType( const Uint32& type ) const { - return UITreeViewCell::getType() == type ? true : UIPushButton::isType( type ); + return UITreeViewCell::getType() == type ? true : UITableCell::isType( type ); } UIImage* getImage() const { return mImage; } @@ -160,7 +160,7 @@ class UITreeViewCell : public UIPushButton { mutable UIImage* mImage{nullptr}; Float mIndent{0}; - UITreeViewCell() : UIPushButton( "treeview::cell" ) { + UITreeViewCell() : UITableCell( "treeview::cell" ) { mTextBox->setElementTag( mTag + "::text" ); mIcon->setElementTag( mTag + "::icon" ); mInnerWidgetOrientation = InnerWidgetOrientation::Left; @@ -182,14 +182,14 @@ class UITreeViewCell : public UIPushButton { }; UIWidget* UITreeView::createCell( UIWidget* rowWidget, const ModelIndex& index ) { - UIPushButton* widget = index.column() == (Int64)getModel()->treeColumn() - ? UITreeViewCell::New() - : UIPushButton::NewWithTag( "table::cell" ); + UITableCell* widget = index.column() == (Int64)getModel()->treeColumn() ? UITreeViewCell::New() + : UITableCell::New(); widget->setParent( rowWidget ); widget->unsetFlags( UI_AUTO_SIZE ); widget->clipEnable(); widget->setLayoutSizePolicy( SizePolicy::Fixed, SizePolicy::Fixed ); widget->setTextAlign( UI_HALIGN_LEFT ); + widget->setCurIndex( index ); if ( index.column() == (Int64)getModel()->treeColumn() ) { widget->addEventListener( Event::MouseDoubleClick, [&]( const Event* event ) { auto mouseEvent = static_cast( event ); @@ -240,15 +240,16 @@ UIWidget* UITreeView::updateCell( const int& rowIndex, const ModelIndex& index, widget->setPixelsSize( columnData( index.column() ).width, getRowHeight() ); widget->setPixelsPosition( {getColumnPosition( index.column() ).x, 0} ); - if ( widget->isType( UI_TYPE_PUSHBUTTON ) ) { - UIPushButton* pushButton = widget->asType(); + if ( widget->isType( UI_TYPE_TABLECELL ) ) { + UITableCell* cell = widget->asType(); + cell->setCurIndex( index ); Variant txt( getModel()->data( index, Model::Role::Display ) ); if ( txt.isValid() ) { if ( txt.is( Variant::Type::String ) ) - pushButton->setText( txt.asString() ); + cell->setText( txt.asString() ); else if ( txt.is( Variant::Type::cstr ) ) - pushButton->setText( txt.asCStr() ); + cell->setText( txt.asCStr() ); } bool hasChilds = false; @@ -285,7 +286,7 @@ UIWidget* UITreeView::updateCell( const int& rowIndex, const ModelIndex& index, } if ( hasChilds && mExpandersAsIcons ) { - pushButton->getIcon()->setVisible( false ); + cell->getIcon()->setVisible( false ); return widget; } @@ -293,9 +294,9 @@ UIWidget* UITreeView::updateCell( const int& rowIndex, const ModelIndex& index, Variant icon( getModel()->data( index, Model::Role::Icon ) ); if ( icon.is( Variant::Type::Drawable ) && icon.asDrawable() ) { isVisible = true; - pushButton->setIcon( icon.asDrawable() ); + cell->setIcon( icon.asDrawable() ); } - pushButton->getIcon()->setVisible( isVisible ); + cell->getIcon()->setVisible( isVisible ); } return widget; diff --git a/src/eepp/ui/uiwidgetcreator.cpp b/src/eepp/ui/uiwidgetcreator.cpp index b75f56118..a9929179c 100644 --- a/src/eepp/ui/uiwidgetcreator.cpp +++ b/src/eepp/ui/uiwidgetcreator.cpp @@ -20,8 +20,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -65,8 +65,8 @@ void UIWidgetCreator::createBaseWidgetList() { registeredWidget["spinbox"] = UISpinBox::New; registeredWidget["sprite"] = UISprite::New; registeredWidget["tab"] = UITab::New; - registeredWidget["table"] = UITable::New; - registeredWidget["tablecell"] = UITableCell::New; + registeredWidget["widgettable"] = UIWidgetTable::New; + registeredWidget["widgettablerow"] = UIWidgetTableRow::New; registeredWidget["tabwidget"] = UITabWidget::New; registeredWidget["textedit"] = UITextEdit::New; registeredWidget["textinput"] = UITextInput::New; diff --git a/src/eepp/ui/uitable.cpp b/src/eepp/ui/uiwidgettable.cpp similarity index 76% rename from src/eepp/ui/uitable.cpp rename to src/eepp/ui/uiwidgettable.cpp index fe5ff34fe..ebbf0842e 100644 --- a/src/eepp/ui/uitable.cpp +++ b/src/eepp/ui/uiwidgettable.cpp @@ -1,15 +1,15 @@ #include -#include +#include #include namespace EE { namespace UI { -UITable* UITable::New() { - return eeNew( UITable, () ); +UIWidgetTable* UIWidgetTable::New() { + return eeNew( UIWidgetTable, () ); } -UITable::UITable() : - UITouchDraggableWidget( "table" ), +UIWidgetTable::UIWidgetTable() : + UITouchDraggableWidget( "widgettable" ), mContainerPadding(), mContainer( NULL ), mVScrollBar( NULL ), @@ -31,7 +31,7 @@ UITable::UITable() : auto cb = [&]( const Event* ) { containerResize(); }; - mContainer = eeNew( UIItemContainer, () ); + mContainer = eeNew( UIItemContainer, () ); mContainer->setVisible( true ); mContainer->setEnabled( true ); mContainer->setParent( this ); @@ -57,9 +57,9 @@ UITable::UITable() : mVScrollBar->setEnabled( ScrollBarMode::AlwaysOn == mVScrollMode ); mVScrollBar->addEventListener( Event::OnValueChange, - cb::Make1( this, &UITable::onScrollValueChange ) ); + cb::Make1( this, &UIWidgetTable::onScrollValueChange ) ); mHScrollBar->addEventListener( Event::OnValueChange, - cb::Make1( this, &UITable::onScrollValueChange ) ); + cb::Make1( this, &UIWidgetTable::onScrollValueChange ) ); mVScrollBar->addEventListener( Event::OnSizeChange, cb ); mHScrollBar->addEventListener( Event::OnSizeChange, cb ); @@ -67,17 +67,17 @@ UITable::UITable() : applyDefaultTheme(); } -UITable::~UITable() {} +UIWidgetTable::~UIWidgetTable() {} -Uint32 UITable::getType() const { - return UI_TYPE_TABLE; +Uint32 UIWidgetTable::getType() const { + return UI_TYPE_WIDGETTABLE; } -bool UITable::isType( const Uint32& type ) const { - return UITable::getType() == type ? true : UITouchDraggableWidget::isType( type ); +bool UIWidgetTable::isType( const Uint32& type ) const { + return UIWidgetTable::getType() == type ? true : UITouchDraggableWidget::isType( type ); } -void UITable::setDefaultColumnsWidth() { +void UIWidgetTable::setDefaultColumnsWidth() { if ( mCollWidthAssigned || 0 == mColumnsCount || 0 == mRowHeight ) return; @@ -105,11 +105,11 @@ void UITable::setDefaultColumnsWidth() { updateCells(); } -void UITable::onScrollValueChange( const Event* ) { +void UIWidgetTable::onScrollValueChange( const Event* ) { updateScroll( true ); } -void UITable::setTheme( UITheme* Theme ) { +void UIWidgetTable::setTheme( UITheme* Theme ) { UIWidget::setTheme( Theme ); setThemeSkin( Theme, "genericgrid" ); @@ -121,20 +121,20 @@ void UITable::setTheme( UITheme* Theme ) { onThemeLoaded(); } -void UITable::autoPadding() { +void UIWidgetTable::autoPadding() { if ( mFlags & UI_AUTO_PADDING ) { mContainerPadding = PixelDensity::dpToPx( makePadding() ); } } -void UITable::onSizeChange() { +void UIWidgetTable::onSizeChange() { containerResize(); setDefaultColumnsWidth(); updateScroll(); updatePageStep(); } -void UITable::containerResize() { +void UIWidgetTable::containerResize() { Rectf padding = mContainerPadding + mPaddingPx; mContainer->setPosition( padding.Left, padding.Top ); @@ -158,7 +158,7 @@ void UITable::containerResize() { updateScrollBar(); } -void UITable::updateVScroll() { +void UIWidgetTable::updateVScroll() { if ( mItemsNotVisible <= 0 ) { if ( ScrollBarMode::AlwaysOn == mVScrollMode ) { mVScrollBar->setVisible( true ); @@ -180,7 +180,7 @@ void UITable::updateVScroll() { containerResize(); } -void UITable::updateHScroll() { +void UIWidgetTable::updateHScroll() { if ( mContainer->isClipped() && ( ScrollBarMode::Auto == mHScrollMode || ScrollBarMode::AlwaysOn == mHScrollMode ) ) { if ( mContainer->getSize().getWidth() < (Int32)mTotalWidth ) { @@ -207,7 +207,7 @@ void UITable::updateHScroll() { } } -void UITable::setHScrollStep() { +void UIWidgetTable::setHScrollStep() { Float width = (Float)mContainer->getPixelsSize().getWidth(); if ( ( mItemsNotVisible > 0 && ScrollBarMode::Auto == mVScrollMode ) || @@ -229,7 +229,7 @@ void UITable::setHScrollStep() { mHScrollBar->setClickStep( stepVal ); } -void UITable::updateScrollBar() { +void UIWidgetTable::updateScrollBar() { mVScrollBar->setPosition( getSize().getWidth() - mVScrollBar->getSize().getWidth(), 0 ); mVScrollBar->setSize( mVScrollBar->getSize().getWidth(), getSize().getHeight() ); @@ -246,11 +246,11 @@ void UITable::updateScrollBar() { } } -void UITable::updateScroll( bool FromScrollChange ) { +void UIWidgetTable::updateScroll( bool FromScrollChange ) { if ( !mItems.size() ) return; - UITableCell* Item; + UIWidgetTableRow* Item; Uint32 i, RelPos = 0, RelPosMax; Int32 ItemPos, ItemPosMax; Int32 tHLastScroll = mHScrollInit; @@ -356,23 +356,23 @@ void UITable::updateScroll( bool FromScrollChange ) { setHScrollStep(); } -void UITable::updateSize() { +void UIWidgetTable::updateSize() { updateColumnsPos(); mTotalHeight = mItems.size() * mRowHeight; } -void UITable::add( UITableCell* Cell ) { - Cell->setParent( getContainer() ); +void UIWidgetTable::add( UIWidgetTableRow* row ) { + row->setParent( getContainer() ); - mItems.push_back( Cell ); + mItems.push_back( row ); - if ( mContainer != Cell->getParent() ) - Cell->setParent( mContainer ); + if ( mContainer != row->getParent() ) + row->setParent( mContainer ); setDefaultColumnsWidth(); - Cell->onAutoSize(); + row->onAutoSize(); updateSize(); @@ -381,24 +381,24 @@ void UITable::add( UITableCell* Cell ) { updatePageStep(); } -void UITable::remove( UITableCell* Cell ) { - return remove( getItemIndex( Cell ) ); +void UIWidgetTable::remove( UIWidgetTableRow* row ) { + return remove( getItemIndex( row ) ); } -void UITable::remove( std::vector ItemsIndex ) { - if ( ItemsIndex.size() && eeINDEX_NOT_FOUND != ItemsIndex[0] ) { - std::vector ItemsCpy; +void UIWidgetTable::remove( std::vector itemsIndex ) { + if ( itemsIndex.size() && eeINDEX_NOT_FOUND != itemsIndex[0] ) { + std::vector ItemsCpy; bool erase; for ( Uint32 i = 0; i < mItems.size(); i++ ) { erase = false; - for ( Uint32 z = 0; z < ItemsIndex.size(); z++ ) { - if ( ItemsIndex[z] == i ) { - if ( (Int32)ItemsIndex[z] == mSelected ) + for ( Uint32 z = 0; z < itemsIndex.size(); z++ ) { + if ( itemsIndex[z] == i ) { + if ( (Int32)itemsIndex[z] == mSelected ) mSelected = -1; - ItemsIndex.erase( ItemsIndex.begin() + z ); + itemsIndex.erase( itemsIndex.begin() + z ); erase = true; @@ -424,16 +424,17 @@ void UITable::remove( std::vector ItemsIndex ) { } } -void UITable::remove( Uint32 ItemIndex ) { - remove( std::vector( 1, ItemIndex ) ); +void UIWidgetTable::remove( Uint32 itemIndex ) { + remove( std::vector( 1, itemIndex ) ); } -UITable* UITable::setColumnWidth( const Uint32& ColumnIndex, const Uint32& ColumnWidth ) { - eeASSERT( ColumnIndex < mColumnsCount ); +UIWidgetTable* UIWidgetTable::setColumnWidth( const Uint32& columnIndex, + const Uint32& ColumnWidth ) { + eeASSERT( columnIndex < mColumnsCount ); mCollWidthAssigned = true; - mColumnsWidth[ColumnIndex] = ColumnWidth; + mColumnsWidth[columnIndex] = ColumnWidth; updateColumnsPos(); updateCells(); @@ -442,11 +443,11 @@ UITable* UITable::setColumnWidth( const Uint32& ColumnIndex, const Uint32& Colum return this; } -Uint32 UITable::getCount() const { +Uint32 UIWidgetTable::getCount() const { return mItems.size(); } -UITable* UITable::setColumnsCount( const Uint32& columnsCount ) { +UIWidgetTable* UIWidgetTable::setColumnsCount( const Uint32& columnsCount ) { mColumnsCount = columnsCount; mColumnsWidth.resize( mColumnsCount, 0 ); @@ -457,17 +458,17 @@ UITable* UITable::setColumnsCount( const Uint32& columnsCount ) { return this; } -const Uint32& UITable::getColumnsCount() const { +const Uint32& UIWidgetTable::getColumnsCount() const { return mColumnsCount; } -const Uint32& UITable::getColumnWidth( const Uint32& ColumnIndex ) const { - eeASSERT( ColumnIndex < mColumnsCount ); +const Uint32& UIWidgetTable::getColumnWidth( const Uint32& columnIndex ) const { + eeASSERT( columnIndex < mColumnsCount ); - return mColumnsWidth[ColumnIndex]; + return mColumnsWidth[columnIndex]; } -UITable* UITable::setRowHeight( const Uint32& height ) { +UIWidgetTable* UIWidgetTable::setRowHeight( const Uint32& height ) { if ( mRowHeight != height ) { mRowHeight = height; @@ -479,29 +480,29 @@ UITable* UITable::setRowHeight( const Uint32& height ) { return this; } -const Uint32& UITable::getRowHeight() const { +const Uint32& UIWidgetTable::getRowHeight() const { return mRowHeight; } -UITableCell* UITable::getCell( const Uint32& CellIndex ) const { - eeASSERT( CellIndex < mItems.size() ); +UIWidgetTableRow* UIWidgetTable::getRow( const Uint32& rowIndex ) const { + eeASSERT( rowIndex < mItems.size() ); - return mItems[CellIndex]; + return mItems[rowIndex]; } -Uint32 UITable::getCellPosition( const Uint32& ColumnIndex ) { - eeASSERT( ColumnIndex < mColumnsCount ); +Uint32 UIWidgetTable::getColumnPosition( const Uint32& columnIndex ) { + eeASSERT( columnIndex < mColumnsCount ); - return mColumnsPos[ColumnIndex]; + return mColumnsPos[columnIndex]; } -void UITable::updateCells() { +void UIWidgetTable::updateCells() { for ( Uint32 i = 0; i < mItems.size(); i++ ) { - mItems[i]->fixCell(); + mItems[i]->updateRow(); } } -void UITable::updateColumnsPos() { +void UIWidgetTable::updateColumnsPos() { Uint32 Pos = 0; for ( Uint32 i = 0; i < mColumnsCount; i++ ) { @@ -513,28 +514,28 @@ void UITable::updateColumnsPos() { mTotalWidth = Pos; } -void UITable::onAlphaChange() { +void UIWidgetTable::onAlphaChange() { UINode::onAlphaChange(); mVScrollBar->setAlpha( mAlpha ); mHScrollBar->setAlpha( mAlpha ); } -void UITable::setVerticalScrollMode( const ScrollBarMode& Mode ) { - if ( Mode != mVScrollMode ) { - mVScrollMode = Mode; +void UIWidgetTable::setVerticalScrollMode( const ScrollBarMode& mode ) { + if ( mode != mVScrollMode ) { + mVScrollMode = mode; updateScroll(); } } -const ScrollBarMode& UITable::getVerticalScrollMode() { +const ScrollBarMode& UIWidgetTable::getVerticalScrollMode() { return mVScrollMode; } -void UITable::setHorizontalScrollMode( const ScrollBarMode& Mode ) { - if ( Mode != mHScrollMode ) { - mHScrollMode = Mode; +void UIWidgetTable::setHorizontalScrollMode( const ScrollBarMode& mode ) { + if ( mode != mHScrollMode ) { + mHScrollMode = mode; if ( ScrollBarMode::AlwaysOn == mHScrollMode ) { mHScrollBar->setVisible( true ); @@ -550,45 +551,45 @@ void UITable::setHorizontalScrollMode( const ScrollBarMode& Mode ) { } } -const ScrollBarMode& UITable::getHorizontalScrollMode() { +const ScrollBarMode& UIWidgetTable::getHorizontalScrollMode() { return mHScrollMode; } -UIScrollBar* UITable::getVerticalScrollBar() const { +UIScrollBar* UIWidgetTable::getVerticalScrollBar() const { return mVScrollBar; } -UIScrollBar* UITable::getHorizontalScrollBar() const { +UIScrollBar* UIWidgetTable::getHorizontalScrollBar() const { return mHScrollBar; } -Uint32 UITable::getItemIndex( UITableCell* Item ) { +Uint32 UIWidgetTable::getItemIndex( UIWidgetTableRow* item ) { for ( Uint32 i = 0; i < mItems.size(); i++ ) { - if ( Item == mItems[i] ) + if ( item == mItems[i] ) return i; } return eeINDEX_NOT_FOUND; } -Uint32 UITable::onSelected() { +Uint32 UIWidgetTable::onSelected() { sendCommonEvent( Event::OnItemSelected ); return 1; } -UITableCell* UITable::getItemSelected() { +UIWidgetTableRow* UIWidgetTable::getItemSelected() { if ( -1 != mSelected ) return mItems[mSelected]; return NULL; } -Uint32 UITable::getItemSelectedIndex() const { +Uint32 UIWidgetTable::getItemSelectedIndex() const { return mSelected; } -Uint32 UITable::onMessage( const NodeMessage* Msg ) { +Uint32 UIWidgetTable::onMessage( const NodeMessage* Msg ) { switch ( Msg->getMsg() ) { case NodeMessage::FocusLoss: { if ( NULL != getEventDispatcher() ) { @@ -606,15 +607,15 @@ Uint32 UITable::onMessage( const NodeMessage* Msg ) { return 0; } -UIItemContainer* UITable::getContainer() const { +UIItemContainer* UIWidgetTable::getContainer() const { return mContainer; } -bool UITable::getSmoothScroll() const { +bool UIWidgetTable::getSmoothScroll() const { return mSmoothScroll; } -UITable* UITable::setSmoothScroll( bool smoothScroll ) { +UIWidgetTable* UIWidgetTable::setSmoothScroll( bool smoothScroll ) { mSmoothScroll = smoothScroll; if ( mSmoothScroll ) { @@ -626,15 +627,15 @@ UITable* UITable::setSmoothScroll( bool smoothScroll ) { return this; } -Rectf UITable::getContainerPadding() const { +Rectf UIWidgetTable::getContainerPadding() const { return PixelDensity::pxToDp( mContainerPadding + mPaddingPx ); } -void UITable::onPaddingChange() { +void UIWidgetTable::onPaddingChange() { containerResize(); } -void UITable::onTouchDragValueChange( Vector2f diff ) { +void UIWidgetTable::onTouchDragValueChange( Vector2f diff ) { if ( mVScrollBar->isEnabled() ) mVScrollBar->setValue( mVScrollBar->getValue() + ( -diff.y / ( Float )( ( mItems.size() - 1 ) * mRowHeight ) ) ); @@ -643,18 +644,18 @@ void UITable::onTouchDragValueChange( Vector2f diff ) { mHScrollBar->setValue( mHScrollBar->getValue() + ( -diff.x / mTotalWidth ) ); } -bool UITable::isTouchOverAllowedChilds() { +bool UIWidgetTable::isTouchOverAllowedChilds() { return isMouseOverMeOrChilds() && !mVScrollBar->isMouseOverMeOrChilds() && !mHScrollBar->isMouseOverMeOrChilds(); } -void UITable::updatePageStep() { +void UIWidgetTable::updatePageStep() { mVScrollBar->setPageStep( ( (Float)mContainer->getSize().getHeight() / (Float)mRowHeight ) / (Float)mItems.size() ); } -std::string UITable::getPropertyString( const PropertyDefinition* propertyDef, - const Uint32& propertyIndex ) { +std::string UIWidgetTable::getPropertyString( const PropertyDefinition* propertyDef, + const Uint32& propertyIndex ) { if ( NULL == propertyDef ) return ""; @@ -677,7 +678,7 @@ std::string UITable::getPropertyString( const PropertyDefinition* propertyDef, } } -bool UITable::applyProperty( const StyleSheetProperty& attribute ) { +bool UIWidgetTable::applyProperty( const StyleSheetProperty& attribute ) { if ( !checkPropertyDefinition( attribute ) ) return false; diff --git a/src/eepp/ui/uitablecell.cpp b/src/eepp/ui/uiwidgettablerow.cpp similarity index 56% rename from src/eepp/ui/uitablecell.cpp rename to src/eepp/ui/uiwidgettablerow.cpp index 14f042e7d..4e633b3a5 100644 --- a/src/eepp/ui/uitablecell.cpp +++ b/src/eepp/ui/uiwidgettablerow.cpp @@ -1,17 +1,17 @@ -#include -#include +#include +#include namespace EE { namespace UI { -UITableCell* UITableCell::New() { - return eeNew( UITableCell, () ); +UIWidgetTableRow* UIWidgetTableRow::New() { + return eeNew( UIWidgetTableRow, () ); } -UITableCell::UITableCell() : UIWidget( "tablecell" ) { +UIWidgetTableRow::UIWidgetTableRow() : UIWidget( "widgettablerow" ) { applyDefaultTheme(); } -UITableCell::~UITableCell() { +UIWidgetTableRow::~UIWidgetTableRow() { if ( NULL != getEventDispatcher() ) { if ( getEventDispatcher()->getFocusNode() == this ) mParentNode->setFocus(); @@ -21,24 +21,32 @@ UITableCell::~UITableCell() { } } -void UITableCell::setTheme( UITheme* Theme ) { +Uint32 UIWidgetTableRow::getType() const { + return UI_TYPE_WIDGETTABLEROW; +} + +bool UIWidgetTableRow::isType( const Uint32& type ) const { + return UIWidgetTableRow::getType() == type ? true : UIWidget::isType( type ); +} + +void UIWidgetTableRow::setTheme( UITheme* Theme ) { UIWidget::setTheme( Theme ); - setThemeSkin( Theme, "gridcell" ); + setThemeSkin( Theme, "tablerow" ); onThemeLoaded(); } -UITable* UITableCell::gridParent() const { - return mParentNode->getParent()->asType(); +UIWidgetTable* UIWidgetTableRow::gridParent() const { + return mParentNode->getParent()->asType(); } -void UITableCell::setCell( const Uint32& ColumnIndex, UINode* node ) { - eeASSERT( ColumnIndex < gridParent()->getColumnsCount() ); +void UIWidgetTableRow::setColumn( const Uint32& columnIndex, UINode* node ) { + eeASSERT( columnIndex < gridParent()->getColumnsCount() ); - UITable* P = gridParent(); + UIWidgetTable* P = gridParent(); - mCells[ColumnIndex] = node; + mCells[columnIndex] = node; if ( node->getParent() != this ) node->setParent( this ); @@ -46,32 +54,32 @@ void UITableCell::setCell( const Uint32& ColumnIndex, UINode* node ) { if ( node->isWidget() ) static_cast( node )->setLayoutSizePolicy( SizePolicy::Fixed, SizePolicy::Fixed ); - node->setPosition( P->getCellPosition( ColumnIndex ), 0 ); - node->setSize( P->getColumnWidth( ColumnIndex ), P->getRowHeight() ); + node->setPosition( P->getColumnPosition( columnIndex ), 0 ); + node->setSize( P->getColumnWidth( columnIndex ), P->getRowHeight() ); node->setVisible( true ); node->setEnabled( true ); } -UINode* UITableCell::getCell( const Uint32& ColumnIndex ) const { - eeASSERT( ColumnIndex < gridParent()->getColumnsCount() ); +UINode* UIWidgetTableRow::getColumn( const Uint32& columnIndex ) const { + eeASSERT( columnIndex < gridParent()->getColumnsCount() ); - return mCells[ColumnIndex]; + return mCells[columnIndex]; } -void UITableCell::fixCell() { +void UIWidgetTableRow::updateRow() { onAutoSize(); - UITable* P = gridParent(); + UIWidgetTable* P = gridParent(); for ( Uint32 i = 0; i < mCells.size(); i++ ) { - mCells[i]->setPosition( P->getCellPosition( i ), 0 ); + mCells[i]->setPosition( P->getColumnPosition( i ), 0 ); mCells[i]->setSize( P->getColumnWidth( i ), P->getRowHeight() ); } } -void UITableCell::select() { - UITable* MyParent = getParent()->getParent()->asType(); +void UIWidgetTableRow::select() { + UIWidgetTable* MyParent = getParent()->getParent()->asType(); if ( MyParent->getItemSelected() != this ) { if ( NULL != MyParent->getItemSelected() ) @@ -91,18 +99,18 @@ void UITableCell::select() { } } -void UITableCell::unselect() { +void UIWidgetTableRow::unselect() { if ( mNodeFlags & NODE_FLAG_SELECTED ) mNodeFlags &= ~NODE_FLAG_SELECTED; popState( UIState::StateSelected ); } -bool UITableCell::isSelected() const { +bool UIWidgetTableRow::isSelected() const { return 0 != ( mNodeFlags & NODE_FLAG_SELECTED ); } -Uint32 UITableCell::onMouseLeave( const Vector2i& Pos, const Uint32& Flags ) { +Uint32 UIWidgetTableRow::onMouseLeave( const Vector2i& Pos, const Uint32& Flags ) { UIWidget::onMouseLeave( Pos, Flags ); if ( mNodeFlags & NODE_FLAG_SELECTED ) @@ -111,7 +119,7 @@ Uint32 UITableCell::onMouseLeave( const Vector2i& Pos, const Uint32& Flags ) { return 1; } -Uint32 UITableCell::onMessage( const NodeMessage* Msg ) { +Uint32 UIWidgetTableRow::onMessage( const NodeMessage* Msg ) { switch ( Msg->getMsg() ) { case NodeMessage::MouseClick: { if ( Msg->getFlags() & EE_BUTTONS_LRM ) { @@ -127,7 +135,7 @@ Uint32 UITableCell::onMessage( const NodeMessage* Msg ) { break; } case NodeMessage::MouseUp: { - UITable* MyParent = getParent()->getParent()->asType(); + UIWidgetTable* MyParent = getParent()->getParent()->asType(); if ( ( Msg->getFlags() & EE_BUTTONS_WUWD ) && MyParent->getVerticalScrollBar()->isVisible() ) { @@ -141,13 +149,13 @@ Uint32 UITableCell::onMessage( const NodeMessage* Msg ) { return 0; } -void UITableCell::onAutoSize() { - UITable* MyParent = getParent()->getParent()->asType(); +void UIWidgetTableRow::onAutoSize() { + UIWidgetTable* MyParent = getParent()->getParent()->asType(); setInternalSize( Sizef( MyParent->mTotalWidth, MyParent->mRowHeight ) ); } -void UITableCell::onStateChange() { +void UIWidgetTableRow::onStateChange() { UIWidget::onStateChange(); if ( isSelected() && NULL != mSkinState && @@ -156,14 +164,14 @@ void UITableCell::onStateChange() { } } -void UITableCell::onParentChange() { +void UIWidgetTableRow::onParentChange() { if ( NULL != getParent() && NULL != gridParent() ) mCells.resize( gridParent()->getColumnsCount(), NULL ); } -void UITableCell::onAlphaChange() { +void UIWidgetTableRow::onAlphaChange() { if ( mEnabled && mVisible ) { - UITable* MyParent = getParent()->getParent()->asType(); + UIWidgetTable* MyParent = getParent()->getParent()->asType(); if ( NULL != MyParent && MyParent->getAlpha() != mAlpha ) { setAlpha( MyParent->getAlpha() ); diff --git a/src/tests/test_all/test.cpp b/src/tests/test_all/test.cpp index 565be1f48..391697af2 100644 --- a/src/tests/test_all/test.cpp +++ b/src/tests/test_all/test.cpp @@ -476,13 +476,13 @@ void EETest::createBaseUI() { TextEdit->setParent( C )->setPosition( 5, 245 )->setSize( 315, 130 ); TextEdit->setText( mBuda ); - UITable* genGrid = UITable::New(); + UIWidgetTable* genGrid = UIWidgetTable::New(); genGrid->setSmoothScroll( true )->setFlags( UI_TOUCH_DRAG_ENABLED ); genGrid->setParent( C )->setPosition( 325, 245 )->setSize( 200, 130 ); genGrid->setColumnsCount( 3 )->setRowHeight( 24 ); for ( Uint32 i = 0; i < 15; i++ ) { - UITableCell* Cell = UITableCell::New(); + UIWidgetTableRow* Cell = UIWidgetTableRow::New(); UITextView* TxtBox = UITextView::New(); UITextInput* TxtInput = UITextInput::New(); UIImage* TxtGfx = UIImage::New(); @@ -493,9 +493,9 @@ void EETest::createBaseUI() { TxtGfx->setDrawable( mSceneNode->findIcon( "ok" ) ); TxtBox->setText( "Test " + String::toString( i + 1 ) ); - Cell->setCell( 0, TxtBox ); - Cell->setCell( 1, TxtGfx ); - Cell->setCell( 2, TxtInput ); + Cell->setColumn( 0, TxtBox ); + Cell->setColumn( 1, TxtGfx ); + Cell->setColumn( 2, TxtInput ); genGrid->add( Cell ); } @@ -777,7 +777,7 @@ void EETest::createNewUI() { UISpinBox* spinBox = UISpinBox::New(); spinBox->setPosition( 350, 210 )->setSize( 200, 0 )->setParent( container ); - UITable* genGrid = UITable::New(); + UIWidgetTable* genGrid = UIWidgetTable::New(); genGrid->setSmoothScroll( true ); genGrid->setPosition( 350, 250 )->setSize( 200, 130 )->setParent( container ); genGrid->setColumnsCount( 3 )->setRowHeight( 24 ); @@ -786,7 +786,7 @@ void EETest::createNewUI() { genGrid->setColumnWidth( 2, 100 ); for ( Uint32 i = 0; i < 15; i++ ) { - UITableCell* Cell = UITableCell::New(); + UIWidgetTableRow* Cell = UIWidgetTableRow::New(); UITextView* TxtBox = UITextView::New(); UITextInput* TxtInput = UITextInput::New(); UIImage* TxtGfx = UIImage::New(); @@ -794,9 +794,9 @@ void EETest::createNewUI() { Cell->setParent( genGrid->getContainer() ); - Cell->setCell( 0, TxtBox ); - Cell->setCell( 1, TxtGfx ); - Cell->setCell( 2, TxtInput ); + Cell->setColumn( 0, TxtBox ); + Cell->setColumn( 1, TxtGfx ); + Cell->setColumn( 2, TxtInput ); TxtGfx->setDrawable( mSceneNode->findIcon( "ok" ) ); TxtBox->setText( "Test " + String::toString( i + 1 ) ); diff --git a/src/tools/codeeditor/codeeditor.cpp b/src/tools/codeeditor/codeeditor.cpp index 1ee4a488d..eea8d0238 100644 --- a/src/tools/codeeditor/codeeditor.cpp +++ b/src/tools/codeeditor/codeeditor.cpp @@ -87,6 +87,28 @@ void App::openFileDialog() { dialog->show(); } +void App::openFolderDialog() { + UIFileDialog* dialog = + UIFileDialog::New( UIFileDialog::DefaultFlags | UIFileDialog::AllowFolderSelect | + UIFileDialog::ShowOnlyFolders, + "*", "." ); + dialog->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL ); + dialog->setTitle( "Open Folder" ); + dialog->setCloseShortcut( KEY_ESCAPE ); + dialog->addEventListener( Event::OpenFile, [&]( const Event* event ) { + String path( event->getNode()->asType()->getFullPath() ); + if ( FileSystem::isDirectory( path ) ) + loadFolder( path ); + } ); + dialog->addEventListener( Event::OnWindowClose, [&]( const Event* ) { + if ( mEditorSplitter && mEditorSplitter->getCurEditor() && + !SceneManager::instance()->isShootingDown() ) + mEditorSplitter->getCurEditor()->setFocus(); + } ); + dialog->center(); + dialog->show(); +} + void App::saveFileDialog() { UIFileDialog* dialog = UIFileDialog::New( UIFileDialog::DefaultFlags | UIFileDialog::SaveDialog, "." ); @@ -257,6 +279,8 @@ void App::loadConfig() { mIniState.loadFromFile( mConfigPath + "state.cfg" ); std::string recent = mIniState.getValue( "files", "recentfiles", "" ); mRecentFiles = String::split( recent, ';' ); + std::string recentFolders = mIniState.getValue( "folders", "recentfolders", "" ); + mRecentFolders = String::split( recentFolders, ';' ); mInitColorScheme = mConfig.editor.colorScheme = mIni.getValue( "editor", "colorscheme", "eepp" ); mConfig.editor.fontSize = mIni.getValue( "editor", "font_size", "11dp" ); @@ -312,6 +336,7 @@ void App::saveConfig() { mProjectSplitter ? mProjectSplitter->getSplitPartition().toString() : "15%" ); mIniState.setValue( "files", "recentfiles", String::join( mRecentFiles, ';' ) ); + mIniState.setValue( "folders", "recentfolders", String::join( mRecentFolders, ';' ) ); mIni.setValueB( "editor", "show_line_numbers", mConfig.editor.showLineNumbers ); mIni.setValueB( "editor", "show_white_spaces", mConfig.editor.showWhiteSpaces ); mIni.setValueB( "editor", "highlight_matching_brackets", @@ -374,6 +399,7 @@ void App::initLocateBar() { } ); }; mLocateTable = UITableView::New(); + mLocateTable->setId( "locate_bar_table" ); mLocateTable->setParent( mUISceneNode->getRoot() ); mLocateTable->setHeadersVisible( false ); mLocateTable->setVisible( false ); @@ -657,6 +683,34 @@ void App::updateRecentFiles() { } } +void App::updateRecentFolders() { + UINode* node = nullptr; + if ( mSettingsMenu && ( node = mSettingsMenu->getItem( "Recent Folders" ) ) ) { + UIMenuSubMenu* uiMenuSubMenu = static_cast( node ); + UIMenu* menu = uiMenuSubMenu->getSubMenu(); + uiMenuSubMenu->setEnabled( !mRecentFolders.empty() ); + menu->removeAll(); + menu->removeEventsOfType( Event::OnItemClicked ); + if ( mRecentFolders.empty() ) + return; + for ( auto file : mRecentFolders ) + menu->add( file ); + menu->addSeparator(); + menu->add( "Clear Menu" ); + menu->addEventListener( Event::OnItemClicked, [&]( const Event* event ) { + if ( !event->getNode()->isType( UI_TYPE_MENUITEM ) ) + return; + const String& txt = event->getNode()->asType()->getText(); + if ( txt != "Clear Menu" ) { + loadFolder( txt ); + } else { + mRecentFolders.clear(); + updateRecentFolders(); + } + } ); + } +} + void App::showSidePanel( bool show ) { if ( show == mSidePanel->isVisible() ) return; @@ -1252,8 +1306,8 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) { doc.setBOM( config.writeUnicodeBOM ); editor->addKeyBinds( getLocalKeybindings() ); - editor->addUnlockedCommands( - {"fullscreen-toggle", "open-file", "console-toggle", "close-app", "open-locatebar"} ); + editor->addUnlockedCommands( {"fullscreen-toggle", "open-file", "open-folder", "console-toggle", + "close-app", "open-locatebar"} ); doc.setCommand( "save-doc", [&] { saveDoc(); } ); doc.setCommand( "save-as-doc", [&] { saveFileDialog(); } ); doc.setCommand( "find-replace", [&] { showFindView(); } ); @@ -1267,6 +1321,7 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) { ->setActive( !mWindow->isWindowed() ); } ); doc.setCommand( "open-file", [&] { openFileDialog(); } ); + doc.setCommand( "open-folder", [&] { openFolderDialog(); } ); doc.setCommand( "console-toggle", [&] { mConsole->toggle(); bool lock = mConsole->isActive(); @@ -1344,8 +1399,12 @@ bool App::setAutoComplete( bool enable ) { void App::createSettingsMenu() { mSettingsMenu = UIPopUpMenu::New(); mSettingsMenu->add( "New", findIcon( "document-new" ), getKeybind( "create-new" ) ); - mSettingsMenu->add( "Open...", findIcon( "document-open" ), getKeybind( "open-file" ) ); + mSettingsMenu->add( "Open File...", findIcon( "document-open" ), getKeybind( "open-file" ) ); + mSettingsMenu->add( "Open Folder...", findIcon( "document-open" ), + getKeybind( "open-folder" ) ); mSettingsMenu->addSubMenu( "Recent Files", findIcon( "document-recent" ), UIPopUpMenu::New() ); + mSettingsMenu->addSubMenu( "Recent Folders", findIcon( "document-recent" ), + UIPopUpMenu::New() ); mSettingsMenu->addSeparator(); mSettingsMenu->add( "Save", findIcon( "document-save" ), getKeybind( "save-doc" ) ); mSettingsMenu->add( "Save as...", findIcon( "document-save-as" ), getKeybind( "save-as-doc" ) ); @@ -1379,8 +1438,10 @@ void App::createSettingsMenu() { const String& name = event->getNode()->asType()->getText(); if ( name == "New" ) { runCommand( "create-new" ); - } else if ( name == "Open..." ) { + } else if ( name == "Open File..." ) { runCommand( "open-file" ); + } else if ( name == "Open Folder..." ) { + runCommand( "open-folder" ); } else if ( name == "Save" ) { runCommand( "save-doc" ); } else if ( name == "Save as..." ) { @@ -1511,25 +1572,40 @@ void App::initProjectTreeView( const std::string& path ) { if ( !path.empty() && FileSystem::fileExists( path ) ) { if ( FileSystem::isDirectory( path ) ) { - loadDirTree( FileSystem::getRealPath( path ) ); - mProjectTreeView->setModel( FileSystemModel::New( - path, FileSystemModel::Mode::FilesAndDirectories, {true, true, true} ) ); + loadFolder( path ); } else { std::string rpath( FileSystem::getRealPath( path ) ); + mProjectTreeView->setModel( FileSystemModel::New( FileSystem::fileRemoveFileName( rpath ), FileSystemModel::Mode::FilesAndDirectories, {true, true, true} ) ); + mEditorSplitter->loadFileFromPath( rpath ); } } else { - loadDirTree( FileSystem::getRealPath( "." ) ); - mProjectTreeView->setModel( FileSystemModel::New( - ".", FileSystemModel::Mode::FilesAndDirectories, {true, true, true} ) ); + loadFolder( "." ); } mProjectTreeView->setAutoExpandOnSingleColumn( true ); } +void App::loadFolder( const std::string& path ) { + std::string rpath( FileSystem::getRealPath( path ) ); + loadDirTree( rpath ); + + mProjectTreeView->setModel( FileSystemModel::New( + rpath, FileSystemModel::Mode::FilesAndDirectories, {true, true, true} ) ); + + auto found = std::find( mRecentFolders.begin(), mRecentFolders.end(), rpath ); + if ( found != mRecentFolders.end() ) + mRecentFolders.erase( found ); + mRecentFolders.insert( mRecentFolders.begin(), rpath ); + if ( mRecentFolders.size() > 10 ) + mRecentFolders.resize( 10 ); + + updateRecentFolders(); +} + void App::init( const std::string& file, const Float& pidelDensity ) { DisplayManager* displayManager = Engine::instance()->getDisplayManager(); Display* currentDisplay = displayManager->getDisplayIndex( 0 ); @@ -1661,6 +1737,12 @@ void App::init( const std::string& file, const Float& pidelDensity ) { #search_replace.error { border-color: #ff4040; } + TableView#locate_bar_table > table::row > table::cell:nth-child(2) { + color: var(--font-hint); + } + TableView#locate_bar_table > table::row:selected > table::cell:nth-child(2) { + color: var(--font); + } diff --git a/src/tools/codeeditor/codeeditor.hpp b/src/tools/codeeditor/codeeditor.hpp index cee72c307..f6e003281 100644 --- a/src/tools/codeeditor/codeeditor.hpp +++ b/src/tools/codeeditor/codeeditor.hpp @@ -137,6 +137,8 @@ class App : public UICodeEditorSplitter::Client { void openFileDialog(); + void openFolderDialog(); + void saveFileDialog(); bool findPrevText( SearchState& search ); @@ -184,6 +186,7 @@ class App : public UICodeEditorSplitter::Client { IniFile mIni; IniFile mIniState; std::vector mRecentFiles; + std::vector mRecentFolders; AppConfig mConfig; UIPopUpMenu* mDocMenu{nullptr}; UIPopUpMenu* mViewMenu{nullptr}; @@ -247,6 +250,10 @@ class App : public UICodeEditorSplitter::Client { void updateRecentFiles(); + void updateRecentFolders(); + + void loadFolder( const std::string& path ); + UIMenu* createViewMenu(); UIMenu* createEditMenu();