tagging release
[dasher.git] / Src / Win32 / ModuleControlBool.cpp
blob3babcfaa40efbefaaabb500255df2f970f34016e
1 #include "ModuleControlBool.h"
3 int CModuleControlBool::GetHeightRequest() {
4 return 10;
7 void CModuleControlBool::Initialise(CDasherInterfaceBase *pInterface) {
8 if(pInterface->GetBoolParameter(m_iId))
9 SendMessage(m_hCheckbox, BM_SETCHECK, BST_CHECKED, 0);
10 else
11 SendMessage(m_hCheckbox, BM_SETCHECK, BST_UNCHECKED, 0);
14 void CModuleControlBool::Apply(CDasherInterfaceBase *pInterface) {
15 pInterface->SetBoolParameter(m_iId, SendMessage(m_hCheckbox, BM_GETCHECK, 0, 0) == BST_CHECKED);
18 void CModuleControlBool::CreateChild(HWND hParent) {
19 m_hCheckbox = CreateWindowEx(WS_EX_CONTROLPARENT, TEXT("BUTTON"), NULL,
20 BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, 0, 0, hParent, NULL, WinHelper::hInstApp, NULL);
22 HGDIOBJ hGuiFont;
23 hGuiFont = GetStockObject(DEFAULT_GUI_FONT);
25 SendMessage(m_hCheckbox, WM_SETFONT, (WPARAM)hGuiFont, (LPARAM)true);
28 void CModuleControlBool::LayoutChild(RECT &sRect) {
29 ::MoveWindow(m_hCheckbox, sRect.left, sRect.top, sRect.right - sRect.left, sRect.bottom - sRect.top, TRUE);