GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
IProgressBarColor.cpp
Go to the documentation of this file.
1#include "IProgressBarColor.h"
2
3using namespace std;
4
5namespace gui_framework
6{
7 namespace interfaces
8 {
9 IProgressBarColor::IProgressBarColor(HWND progressBarHandle) :
10 progressBarHandle(progressBarHandle),
11 progressBarBackgroundColor(RGB(0, 255, 0)),
12 progressBarColor(RGB(0, 255, 0))
13 {
14
15 }
16
17 void IProgressBarColor::setProgressBarBackgroundColor(uint8_t red, uint8_t green, uint8_t blue)
18 {
19 progressBarBackgroundColor = RGB(red, green, blue);
20
21 SetWindowTheme(progressBarHandle, L"", L"");
22
23 SendMessageW(progressBarHandle, PBM_SETBKCOLOR, NULL, static_cast<LPARAM>(progressBarBackgroundColor));
24
25 InvalidateRect(progressBarHandle, nullptr, true);
26 }
27
28 void IProgressBarColor::setProgressBarColor(uint8_t red, uint8_t green, uint8_t blue)
29 {
30 progressBarColor = RGB(red, green, blue);
31
32 SetWindowTheme(progressBarHandle, L"", L"");
33
34 SendMessageW(progressBarHandle, PBM_SETBARCOLOR, NULL, static_cast<LPARAM>(progressBarColor));
35
36 InvalidateRect(progressBarHandle, nullptr, true);
37 }
38
40 {
41 return progressBarBackgroundColor;
42 }
43
45 {
46 return progressBarColor;
47 }
48 }
49}
virtual COLORREF getProgressBarColor() const final
virtual COLORREF getProgressBarBackgroundColor() const final
virtual void setProgressBarColor(uint8_t red, uint8_t green, uint8_t blue)
virtual void setProgressBarBackgroundColor(uint8_t red, uint8_t green, uint8_t blue)