- SetName(name);
-#if wxUSE_VALIDATORS
- SetValidator(validator);
-#endif
- if (parent) parent->AddChild(this);
-
- SetBackgroundColour(parent->GetBackgroundColour()) ;
- SetForegroundColour(parent->GetForegroundColour()) ;
-
- m_windowStyle = style;
-
- wxString Label = label;
- if (Label == wxT(""))
- Label = wxT(" "); // Apparently needed or checkbox won't show
-
- if ( id == -1 )
- m_windowId = NewControlId();
- else
- m_windowId = id;
-
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
- // TODO: create checkbox
-
- // Subclass again for purposes of dialog editing mode
- SubclassWin(m_hWnd);
-
- SetFont(parent->GetFont());
-
- SetSize(x, y, width, height);
-
- return FALSE;
-}
-
-void wxCheckBox::SetLabel(const wxString& label)
+ LONG lColor;
+ bool bOk;
+
+ if (!CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
+ ,rValidator
+ ,rsName
+ ))
+ return FALSE;
+
+
+ long osStyle = BS_AUTOCHECKBOX |
+ WS_TABSTOP |
+ WS_VISIBLE;
+
+ bOk = OS2CreateControl( wxT("BUTTON")
+ ,osStyle
+ ,rPos
+ ,rSize
+ ,rsLabel
+ ,0
+ );
+ m_backgroundColour = pParent->GetBackgroundColour();
+ lColor = (LONG)m_backgroundColour.GetPixel();
+ ::WinSetPresParam( m_hWnd
+ ,PP_BACKGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ );
+ wxAssociateWinWithHandle(m_hWnd, this);
+ return bOk;
+} // end of wxCheckBox::Create
+
+void wxCheckBox::SetLabel(
+ const wxString& rsLabel
+)