SavvyUI C++ UI Library
Loading...
Searching...
No Matches
ToggleButton.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Component.h
"
4
10
class
ToggleButton
:
public
Component
11
{
12
vector<Bounds> _optionsRect;
13
vector<wstring> _options;
14
wstring _selectedButtonText;
15
16
protected
:
26
BOOL
getCreateWindowOptions
(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
27
31
void
windowCreated
();
32
33
public
:
37
ToggleButton
();
38
42
virtual
~ToggleButton
();
43
47
int
getPreferredHeight
();
48
54
void
setOptions
(
const
vector<wstring>& options);
55
61
void
setSelectedItem
(
const
wstring& optionText);
62
68
void
onPaint
(
Graphics
*g);
69
80
void
onMousePressed
(
WinHandle
hWnd,
int
x,
int
y,
int
clickCount, BOOL shiftPressed, BOOL ctrlPressed);
81
87
void
addSelectionChangedListener
(
SelectionChangeListener
* l);
88
};
WinHandle
HWND WinHandle
Definition
Common.h:16
Component.h
Component::Component
Component()
Constructs a new Component instance.
Graphics
Definition
Graphics.h:161
SelectionChangeListener
Definition
EventListeners.h:31
ToggleButton::setOptions
void setOptions(const vector< wstring > &options)
Sets the toggle options.
ToggleButton::onPaint
void onPaint(Graphics *g)
Paints the toggle button and its options.
ToggleButton::onMousePressed
void onMousePressed(WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed)
Handles mouse press events.
ToggleButton::windowCreated
void windowCreated()
Called when the window has been created.
ToggleButton::addSelectionChangedListener
void addSelectionChangedListener(SelectionChangeListener *l)
Adds a listener to be notified when the selection changes.
ToggleButton::~ToggleButton
virtual ~ToggleButton()
Destructor.
ToggleButton::setSelectedItem
void setSelectedItem(const wstring &optionText)
Sets the currently selected option by its text.
ToggleButton::getPreferredHeight
int getPreferredHeight()
Returns the preferred height.
ToggleButton::ToggleButton
ToggleButton()
Constructs a new ToggleButton object.
ToggleButton::getCreateWindowOptions
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Prepares window creation options.
ToggleButton.h
Generated by
1.14.0