2015-06-12 13:14:38 +00:00
|
|
|
#if defined(Hiro_ProgressBar)
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
namespace hiro {
|
2011-02-24 09:25:20 +00:00
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto pProgressBar::construct() -> void {
|
2013-11-28 10:29:01 +00:00
|
|
|
hwnd = CreateWindow(PROGRESS_CLASS, L"",
|
|
|
|
WS_CHILD | PBS_SMOOTH,
|
2015-06-12 13:14:38 +00:00
|
|
|
0, 0, 0, 0, _parentHandle(), nullptr, GetModuleHandle(0), 0);
|
|
|
|
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&reference);
|
|
|
|
pWidget::_setState();
|
2011-02-24 09:25:20 +00:00
|
|
|
SendMessage(hwnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
|
|
|
|
SendMessage(hwnd, PBM_SETSTEP, MAKEWPARAM(1, 0), 0);
|
2015-06-12 13:14:38 +00:00
|
|
|
setPosition(state().position);
|
2011-09-05 03:48:23 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto pProgressBar::destruct() -> void {
|
2011-09-05 03:48:23 +00:00
|
|
|
DestroyWindow(hwnd);
|
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto pProgressBar::minimumSize() const -> Size {
|
|
|
|
return {0, 23};
|
2011-02-24 09:25:20 +00:00
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto pProgressBar::setPosition(unsigned position) -> void {
|
|
|
|
SendMessage(hwnd, PBM_SETPOS, (WPARAM)position, 0);
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
2015-06-12 13:14:38 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|