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
57 void clear();
58
64 void addItem(const wstring selection);
65 BOOL getItem(int index, wstring& text);
67
73 void setSelectedItem(const wstring& text);
74
80 wstring getSelectedItem();
81
91 void onSelectionChanged(WinHandle hWndCB, int itemIndex, const wstring& itemText, BOOL itemChecked, const ProcParams& procParams);
92
99};
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.
long getItemCount()
void addSelectionChangedListener(SelectionChangeListener *l)
Registers a listener to be notified when the selected item changes.
void clear()
wstring getSelectedItem()
Gets the currently selected item in the combo box.
void setSelectedItem(const wstring &text)
Sets the selected item in the combo box.
void addItem(const wstring selection)
Sets the selectable options 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.
BOOL getItem(int index, wstring &text)
Component()
Constructs a new Component instance.
Definition Component.h:9
Definition EventListeners.h:31