SavvyUI C++ UI Library
Loading...
Searching...
No Matches
Radio.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
6{
7public:
8 RadioItem(const wstring& actionName, const wstring& text)
9 {
10 _action = actionName;
11 _text = text;
12 }
13
14 wstring _action;
15 wstring _text;
17};
18
22class Radio : public Component
23{
24 vector<RadioItem> _items;
25 long _selectedIndex;
26
27 wstring _orientation;
28
29 long _maxVisibleItems;
30 long _firstVisibleItem;
31 long _lastVisibleItem;
32
33protected:
37 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
38
43
44public:
49
53 virtual ~Radio();
54
58 void clear();
59
65 void setOrientation(const wstring& orientation = L"VERT");
66
72 wstring getOrientation();
73
80 void addOption(const wstring& actionName, const wstring& text);
81
87 void setSelectedtem(const wstring& action);
88
94 wstring getSelectedtem();
95
96public: // Overridables
97
102
107
111 void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed);
112
116 void onArrowDown(BOOL shiftPressed, BOOL ctrlPressed);
117
121 void onPageUp(BOOL shiftPressed, BOOL ctrlPressed);
122
126 void onPageDown(BOOL shiftPressed, BOOL ctrlPressed);
127
131 void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed);
132
136 void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed);
137
141 void onMousePressed(WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed);
142
148 BOOL onMouseWheel(WinHandle hWnd, int x, int y, int delta);
149
159 BOOL getScrollingInfo(__int64& scrollMin, __int64& scrollMax, __int64& pageSize);
160
166 void setScrollbarTopOffset(__int64 firstVisibleRow);
167
174};
HWND WinHandle
Definition Common.h:16
Definition Common.h:20
Component()
Constructs a new Component instance.
Definition Graphics.h:161
void onArrowUp(BOOL shiftPressed, BOOL ctrlPressed)
Handles Up arrow key press.
void onPageDown(BOOL shiftPressed, BOOL ctrlPressed)
Handles Page Down key press.
void onKeyEnd(BOOL shiftPressed, BOOL ctrlPressed)
Handles End key press.
virtual ~Radio()
Destroys the Radio component.
void addOption(const wstring &actionName, const wstring &text)
Adds a radio option.
BOOL getScrollingInfo(__int64 &scrollMin, __int64 &scrollMax, __int64 &pageSize)
Gets scroll bar information.
void onArrowDown(BOOL shiftPressed, BOOL ctrlPressed)
Handles Down arrow key press.
void setSelectedtem(const wstring &action)
Sets the selected radio option by its action name.
void clear()
Removes all radio options.
wstring getOrientation()
Gets the current orientation.
void setOrientation(const wstring &orientation=L"VERT")
Sets the orientation of the radio group.
void onPaint(Graphics *g)
Paints the control.
void onPageUp(BOOL shiftPressed, BOOL ctrlPressed)
Handles Page Up key press.
void onKeyHome(BOOL shiftPressed, BOOL ctrlPressed)
Handles Home key press.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Gets window creation options.
Radio()
Constructs a new Radio component.
wstring getSelectedtem()
Gets the action name of the currently selected option.
void onMousePressed(WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed)
Handles mouse press events.
void addSelectionChangedListener(SelectionChangeListener *l)
Adds a listener for selection change events.
BOOL onMouseWheel(WinHandle hWnd, int x, int y, int delta)
Handles mouse wheel scrolling.
void setScrollbarTopOffset(__int64 firstVisibleRow)
Sets the scrollbar's top offset.
void windowCreated()
Called when the window is created.
void onWindowResized()
Handles window resize event.
Bounds _rect
Definition Radio.h:16
RadioItem(const wstring &actionName, const wstring &text)
Definition Radio.h:8
wstring _action
Definition Radio.h:14
wstring _text
Definition Radio.h:15
Definition EventListeners.h:31