| 1 |
namespace phoenix { |
| 2 |
|
| 3 |
Size pProgressBar::minimumSize() { |
| 4 |
return {0, 23}; |
| 5 |
} |
| 6 |
|
| 7 |
void pProgressBar::setPosition(unsigned position) { |
| 8 |
SendMessage(hwnd, PBM_SETPOS, (WPARAM)position, 0); |
| 9 |
} |
| 10 |
|
| 11 |
void pProgressBar::constructor() { |
| 12 |
hwnd = CreateWindow(PROGRESS_CLASS, L"", |
| 13 |
WS_CHILD | PBS_SMOOTH, |
| 14 |
0, 0, 0, 0, parentHwnd, (HMENU)id, GetModuleHandle(0), 0); |
| 15 |
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&progressBar); |
| 16 |
SendMessage(hwnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); |
| 17 |
SendMessage(hwnd, PBM_SETSTEP, MAKEWPARAM(1, 0), 0); |
| 18 |
setPosition(progressBar.state.position); |
| 19 |
synchronize(); |
| 20 |
} |
| 21 |
|
| 22 |
void pProgressBar::destructor() { |
| 23 |
DestroyWindow(hwnd); |
| 24 |
} |
| 25 |
|
| 26 |
void pProgressBar::orphan() { |
| 27 |
destructor(); |
| 28 |
constructor(); |
| 29 |
} |
| 30 |
|
| 31 |
} |