1 #include "ModuleControl.h"
3 CModuleControl::CModuleControl(SModuleSettings
*pSetting
) {
4 WinUTF8::UTF8string_to_wstring(pSetting
->szDescription
, m_strCaption
);
6 m_iId
= pSetting
->iParameter
;
7 m_iMin
= pSetting
->iMin
;
8 m_iMax
= pSetting
->iMax
;
9 m_iDivisor
= pSetting
->iDivisor
;
10 m_iStep
= pSetting
->iStep
;
13 void CModuleControl::Create(HWND hParent
) {
16 CWindowImpl
<CModuleControl
>::Create(m_hParent
);
18 m_hWndCaption
= CreateWindowEx(WS_EX_CONTROLPARENT
, TEXT("STATIC"), m_strCaption
.c_str(),
19 WS_CHILD
| WS_VISIBLE
| WS_TABSTOP
, 0, 0, 0, 0, m_hWnd
, NULL
, WinHelper::hInstApp
, NULL
);
22 hGuiFont
= GetStockObject(DEFAULT_GUI_FONT
);
24 SendMessage(m_hWndCaption
, WM_SETFONT
, (WPARAM
)hGuiFont
, (LPARAM
)true);
29 void CModuleControl::Layout(RECT
*pRect
) {
30 MoveWindow(pRect
->left
, pRect
->top
, pRect
->right
- pRect
->left
, pRect
->bottom
- pRect
->top
);
32 ::MoveWindow(m_hWndCaption
, 0, 0, (pRect
->right
- pRect
->left
) / 2, pRect
->bottom
- pRect
->top
, TRUE
);
35 sRect
.left
= (pRect
->right
- pRect
->left
) / 2;
36 sRect
.right
= pRect
->right
;
38 sRect
.bottom
= pRect
->bottom
- pRect
->top
;