11#ifndef EE_UICUIDROPDOWNLIST_HPP
22#define EE_UICUIDROPDOWNLIST_HPP
33
4+ #include < eepp/ui/uidropdown.hpp>
45#include < eepp/ui/uilistbox.hpp>
5- #include < eepp/ui/uitextinput.hpp>
66
77namespace EE { namespace UI {
88
9- class EE_API UIDropDownList : public UITextInput {
9+ class EE_API UIDropDownList : public UIDropDown {
1010 public:
11- enum class MenuWidthMode {
12- DropDown,
13- Contents,
14- ContentsCentered,
15- ExpandIfNeeded,
16- ExpandIfNeededCentered
17- };
18-
19- static MenuWidthMode menuWidthModeFromString ( std::string_view str );
20-
21- static std::string menuWidthModeToString ( MenuWidthMode rule );
22-
23- struct StyleConfig {
24- Uint32 MaxNumVisibleItems = 10 ;
25- bool PopUpToRoot = false ;
26- MenuWidthMode menuWidthRule{ MenuWidthMode::DropDown };
27- };
11+ using MenuWidthMode = UIDropDown::MenuWidthMode;
12+ using StyleConfig = UIDropDown::StyleConfig;
2813
2914 static UIDropDownList* NewWithTag ( const std::string& tag );
3015
@@ -33,84 +18,39 @@ class EE_API UIDropDownList : public UITextInput {
3318 virtual ~UIDropDownList ();
3419
3520 virtual Uint32 getType () const ;
36-
3721 virtual bool isType ( const Uint32& type ) const ;
3822
39- virtual void setTheme ( UITheme* Theme );
40-
4123 UIListBox* getListBox () const ;
4224
4325 UIDropDownList* showList ();
4426
45- bool getPopUpToRoot () const ;
46-
47- UIDropDownList* setPopUpToRoot ( bool popUpToRoot );
48-
49- Uint32 getMaxNumVisibleItems () const ;
50-
51- UIDropDownList* setMaxNumVisibleItems ( const Uint32& maxNumVisibleItems );
52-
53- const StyleConfig& getStyleConfig () const ;
54-
55- UIDropDownList* setStyleConfig ( const StyleConfig& styleConfig );
27+ virtual UIDropDownList* setMaxNumVisibleItems ( const Uint32& maxNumVisibleItems );
5628
5729 virtual bool applyProperty ( const StyleSheetProperty& attribute );
58-
5930 virtual std::string getPropertyString ( const PropertyDefinition* propertyDef,
6031 const Uint32& propertyIndex = 0 ) const ;
61-
6232 virtual std::vector<PropertyId> getPropertiesImplemented () const ;
6333
6434 virtual void loadFromXmlNode ( const pugi::xml_node& node );
6535
66- UIDropDownList* setMenuWidthMode ( MenuWidthMode rule );
67-
68- MenuWidthMode getMenuWidthMode () const ;
69-
7036 protected:
7137 friend class UIComboBox ;
7238
73- StyleConfig mStyleConfig ;
7439 UIListBox* mListBox ;
75- UINode* mFriendNode ;
7640 Uint32 mListBoxCloseCb { 0 };
7741
7842 UIDropDownList ( const std::string& tag = " dropdownlist" );
7943
80- void onListBoxFocusLoss ( const Event* Event ) ;
44+ virtual UIWidget* getPopUpWidget () const ;
8145
8246 virtual void onItemSelected ( const Event* Event );
8347
84- virtual void show ();
85-
86- virtual void hide ();
87-
88- virtual Uint32 onMouseOver ( const Vector2i& position, const Uint32& flags );
89-
90- virtual Uint32 onMouseLeave ( const Vector2i& position, const Uint32& flags );
91-
9248 virtual Uint32 onMouseUp ( const Vector2i& position, const Uint32& flags );
9349
94- virtual Uint32 onMouseClick ( const Vector2i& position, const Uint32& flags );
95-
96- virtual void onItemClicked ( const Event* Event );
97-
98- virtual void onItemKeyDown ( const Event* Event );
99-
100- virtual void onWidgetClear ( const Event* Event );
101-
10250 virtual Uint32 onKeyDown ( const KeyEvent& Event );
10351
10452 virtual void onClassChange ();
10553
106- virtual void onSizeChange ();
107-
108- virtual void onAutoSize ();
109-
110- virtual void onThemeLoaded ();
111-
112- void setFriendNode ( UINode* friendNode );
113-
11454 void destroyListBox ();
11555};
11656
0 commit comments