tagging release
[dasher.git] / trunk / Src / Win32 / ModuleControl.cpp
blobd02ed35cbf8ede5122e86257d7f6eac822c18993
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) {
14 m_hParent = 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);
21 HGDIOBJ hGuiFont;
22 hGuiFont = GetStockObject(DEFAULT_GUI_FONT);
24 SendMessage(m_hWndCaption, WM_SETFONT, (WPARAM)hGuiFont, (LPARAM)true);
26 CreateChild(m_hWnd);
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);
34 RECT sRect;
35 sRect.left = (pRect->right - pRect->left) / 2;
36 sRect.right = pRect->right;
37 sRect.top = 0;
38 sRect.bottom = pRect->bottom - pRect->top;
40 LayoutChild(sRect);