GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
BaseInfiniteProgressBar.cpp
Go to the documentation of this file.
2
5
6using namespace std;
7
8namespace gui_framework
9{
10 BaseInfiniteProgressBar::BaseInfiniteProgressBar(const wstring& progressBarName, const utility::ComponentSettings& settings, BaseComposite* parent, int animationPeriod) :
12 (
13 standard_classes::progressBar,
14 progressBarName,
15 settings,
16 styles::InfiniteProgressBarStyles(),
17 parent
18 ),
19 IProgressBarColor
20 (
21 handle
22 ),
23 animationPeriod(animationPeriod)
24 {
25 this->playAnimation();
26 }
27
29 {
30 SendMessageW(handle, PBM_SETMARQUEE, true, animationPeriod);
31 }
32
34 {
35 SendMessageW(handle, PBM_SETMARQUEE, false, NULL);
36 }
37
39 {
40 this->animationPeriod = animationPeriod;
41 }
42
47
48 void BaseInfiniteProgressBar::setBackgroundColor(uint8_t red, uint8_t green, uint8_t blue)
49 {
50 BaseComponent::setBackgroundColor(red, green, blue);
51
52 IProgressBarColor::setProgressBarBackgroundColor(red, green, blue);
53 }
54
55 void BaseInfiniteProgressBar::setProgressBarBackgroundColor(uint8_t red, uint8_t green, uint8_t blue)
56 {
57 BaseComponent::setBackgroundColor(red, green, blue);
58
59 IProgressBarColor::setProgressBarBackgroundColor(red, green, blue);
60 }
61
62 void BaseInfiniteProgressBar::setTextColor(uint8_t red, uint8_t green, uint8_t blue)
63 {
64 __utility::throwNotImplementedException(__FUNCTION__, "BaseInfiniteProgressBar"sv);
65 }
66
67 json::JSONBuilder BaseInfiniteProgressBar::getStructure() const
68 {
69 using json::utility::jsonObject;
70
71 json::JSONBuilder builder = BaseComponent::getStructure();
72 get<jsonObject>(builder[utility::to_string(windowName, ISerializable::getCodepage())]).data.push_back({ "animationPeriod"s, static_cast<int64_t>(animationPeriod) });
73
74 return builder;
75 }
76}
Base class for all windows, controls, etc.
virtual json::JSONBuilder getStructure() const override
const std::wstring windowName
virtual void setBackgroundColor(uint8_t red, uint8_t green, uint8_t blue)
Base class for all windows that has children windows.
virtual void setAnimationPeriod(int animationPeriod) final
virtual void setTextColor(uint8_t red, uint8_t green, uint8_t blue) final override
Not implemented.
BaseInfiniteProgressBar(const std::wstring &progressBarName, const utility::ComponentSettings &settings, BaseComposite *parent, int animationPeriod=NULL)
virtual void setProgressBarBackgroundColor(uint8_t red, uint8_t green, uint8_t blue) final override
Inherited from IProgressBarColor.
virtual void setBackgroundColor(uint8_t red, uint8_t green, uint8_t blue) final override
Same as setProgressBarBackgroundColor.
virtual json::JSONBuilder getStructure() const override
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