GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
BaseTrackbarControl.cpp
Go to the documentation of this file.
2
5
6using namespace std;
7
8namespace gui_framework
9{
10 BaseTrackbarControl::BaseTrackbarControl(const wstring& trackbarName, const utility::ComponentSettings& settings, const styles::TrackbarControlStyles& styles, BaseComposite* parent) :
12 (
13 standard_classes::trackbarControl,
14 trackbarName,
15 settings,
16 styles,
17 parent
18 )
19 {
20
21 }
22
24 {
25 SendMessageW(handle, TBM_CLEARSEL, true, NULL);
26 }
27
29 {
30 return SendMessageW(handle, TBM_GETLINESIZE, NULL, NULL);
31 }
32
34 {
35 SendMessageW(handle, TBM_SETRANGEMIN, true, min);
36 }
37
39 {
40 SendMessageW(handle, TBM_SETRANGEMAX, true, max);
41 }
42
44 {
45 SendMessageW(handle, TBM_SETSELSTART, true, startPosition);
46 }
47
49 {
50 SendMessageW(handle, TBM_SETSELEND, true, endPosition);
51 }
52
54 {
55 return SendMessageW(handle, TBM_GETPOS, NULL, NULL);
56 }
57
59 {
60 return SendMessageW(handle, TBM_GETRANGEMIN, NULL, NULL);
61 }
62
64 {
65 return SendMessageW(handle, TBM_GETRANGEMAX, NULL, NULL);
66 }
67
69 {
70 return SendMessageW(handle, TBM_GETSELSTART, NULL, NULL);
71 }
72
74 {
75 return SendMessageW(handle, TBM_GETSELEND, NULL, NULL);
76 }
77
78 void BaseTrackbarControl::setTextColor(uint8_t red, uint8_t green, uint8_t blue)
79 {
80 __utility::throwNotImplementedException(__FUNCTION__, "BaseTrackbarControl"sv);
81 }
82
83 json::JSONBuilder BaseTrackbarControl::getStructure() const
84 {
85 using json::utility::jsonObject;
86
87 json::JSONBuilder builder = BaseComponent::getStructure();
88
89 jsonObject& current = get<jsonObject>(builder[utility::to_string(windowName, ISerializable::getCodepage())]);
90
91 current.data.push_back({ "minRange"s, static_cast<int64_t>(this->getMinRange()) });
92 current.data.push_back({ "maxRange"s, static_cast<int64_t>(this->getMaxRange()) });
93
94 current.data.push_back({ "selectionStart"s, static_cast<int64_t>(this->getSelectionStart()) });
95 current.data.push_back({ "selectionEnd"s, static_cast<int64_t>(this->getSelectionEnd()) });
96
97 return builder;
98 }
99}
Base class for all windows, controls, etc.
virtual json::JSONBuilder getStructure() const override
const std::wstring windowName
Base class for all windows that has children windows.
virtual LRESULT getMaxRange() const final
virtual LRESULT getMinRange() const final
virtual void setTextColor(uint8_t red, uint8_t green, uint8_t blue) final override
Not implemented.
virtual void setMinRange(int min) final
virtual LRESULT getPosition() const final
virtual void setMaxRange(int max) final
virtual LRESULT getSelectionStart() const final
virtual void setSelectionStart(int startPosition) final
virtual LRESULT getSelectionEnd() const final
BaseTrackbarControl(const std::wstring &trackbarName, const utility::ComponentSettings &settings, const styles::TrackbarControlStyles &styles, BaseComposite *parent)
virtual json::JSONBuilder getStructure() const override
virtual void setSelectionEnd(int endPosition) final
virtual LRESULT size() const final
void throwNotImplementedException(string_view methodName, string_view className)
Definition Utility.cpp:186
string to_string(wstring_view stringToConvert, uint32_t codepage)
Definition Utility.cpp:41