SavvyUI C++ UI Library
Loading...
Searching...
No Matches
ComboBox.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
12class ComboBox : public Component
13{
17 vector<wstring> _selections;
18
22 wstring _selection;
23
24protected:
34 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
35
40
41public:
46
50 virtual ~ComboBox();
51
56
62 void setOptions(const vector<wstring>& selections);
63
69 void setSelectedItem(const wstring& text);
70
76 wstring getSelectedItem();
77
87 void onSelectionChanged(WinHandle hWndCB, int itemIndex, const wstring& itemText, BOOL itemChecked, const ProcParams& procParams);
88
95};
HWND WinHandle
Definition Common.h:16
int getPreferredHeight()
Returns the preferred height.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Retrieves options used for creating the ComboBox window.
void onSelectionChanged(WinHandle hWndCB, int itemIndex, const wstring &itemText, BOOL itemChecked, const ProcParams &procParams)
Handles selection change notifications.
void addSelectionChangedListener(SelectionChangeListener *l)
Registers a listener to be notified when the selected item changes.
wstring getSelectedItem()
Gets the currently selected item in the combo box.
void setSelectedItem(const wstring &text)
Sets the selected item in the combo box.
ComboBox()
Constructs a new ComboBox instance.
void windowCreated()
Called after the ComboBox window is successfully created.
virtual ~ComboBox()
Destroys the ComboBox instance.
void setOptions(const vector< wstring > &selections)
Sets the selectable options in the combo box.
Component()
Constructs a new Component instance.
Definition Component.h:9
Definition EventListeners.h:31