SavvyUI C++ UI Library
Loading...
Searching...
No Matches
PickList.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4#include "CheckList.h"
5#include "Button.h"
6
11class PickList : public Component,
12 public ActionListener
13{
14 CheckList _selectableItemsList, _selectedItemsList;
15 Button _buttonAdd, _buttonAddAll;
16 Button _buttonDelete, _buttonDeleteAll;
17
18 vector<KeyValue> _selectableItems;
19 vector<KeyValue> _selectedItems;
20
25 void createChildren(WinHandle hParent);
26
27protected:
36 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
37
42
43public:
45 virtual ~PickList();
46
47 void setSelectableItems(const vector<KeyValue> & items);
48 void setSelectedItems(const vector<KeyValue>& items);
49 void getSelectedItems(vector<KeyValue>& items);
50
55
60 void onPaint(Graphics *g);
61
66 void onAction(const ActionEvent& ev);
67};
HWND WinHandle
Definition Common.h:16
Definition EventListeners.h:38
Definition EventListeners.h:46
A clickable UI component representing a button with customizable text and type.
Definition Button.h:13
A UI component that displays a list of checkable items.
Definition CheckList.h:23
Component()
Constructs a new Component instance.
Definition Graphics.h:161
void getSelectedItems(vector< KeyValue > &items)
void windowCreated()
Called after the native window is created; initializes child components.
virtual ~PickList()
void setSelectableItems(const vector< KeyValue > &items)
void onWindowResized()
Called when the window is resized; adjusts layouts.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Provides window creation options specific to this component.
void setSelectedItems(const vector< KeyValue > &items)
void onPaint(Graphics *g)
Called to paint the PickList component.
void onAction(const ActionEvent &ev)
Handles actions triggered by buttons or other components.