25 std::vector<ListBoxItem> _selections;
28 __int64 _firstVisibleRow;
29 __int64 _lastVisibleRow;
38 BOOL _hidePopupOnFocusLoss;
117 void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed)
override;
119 void onPageUp(BOOL shiftPressed, BOOL ctrlPressed)
override;
120 void onPageDown(BOOL shiftPressed, BOOL ctrlPressed)
override;
121 void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed)
override;
122 void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed)
override;
HWND WinHandle
Definition Common.h:16
Component()
Constructs a new Component instance.
Definition Graphics.h:171
void addItem(const wstring &text, COLORREF color=Theme::BackgroundColor)
Adds to the list of selectable options.
int getPreferredHeight()
Returns the preferred height of the component.
void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed) override
void onFocusGained() override
Called when the component gains keyboard focus.
virtual ~ListBox()
Destructor.
ListBox()
Constructs an empty ListBox component.
void onPageDown(BOOL shiftPressed, BOOL ctrlPressed) override
BOOL getItem(int index, wstring &text)
void onFocusLost() override
Called when the component loses keyboard focus.
void windowCreated()
Called once the native window has been created.
void onMousePressed(WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed) override
Called when the mouse is pressed within the component.
void setAsPopup(BOOL isPopup, BOOL hidePopupOnFocusLoss=TRUE)
Sets whether the listbox is used in a popup context.
void onArrowDown(BOOL shiftPressed, BOOL ctrlPressed) override
void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed) override
BOOL isPopup()
Return TRUE if this component is displayed as a popup (e.g. dropdown from CheckComboBox).
BOOL onMouseWheel(WinHandle hWnd, int x, int y, int delta) override
Called when the mouse wheel is used over the component.
void onPageUp(BOOL shiftPressed, BOOL ctrlPressed) override
void setSelectedItem(const wstring &text)
Sets the currently selected item by text.
wstring getSelectedItem()
Retrieves the currently selected item text.
void onPaint(Graphics *g) override
Called to paint the component's client area.
void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed) override
void scrollBarActivity(__int64 firstVisibleItem)
void addItemDoubleClickedListener(RowDoubleClickListener *l)
void onMouseReleased(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse button is released within the component.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Provides native window creation options for the ListBox control.
void onMouseMoved(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse is moved within the component.
void addSelectionChangedListener(SelectionChangeListener *l)
void onWindowResized() override
Called when the component's window is resized.
wstring _text
Definition ListBox.h:9
COLORREF _color
Definition ListBox.h:10
Bounds _rect
Definition ListBox.h:11
Definition EventListeners.h:60
Definition EventListeners.h:31
static COLORREF BackgroundColor
Definition Theme.h:126