]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/checkbox.cpp
added some utils (tex2rtf, helpgen, makegen) to make system
[wxWidgets.git] / src / msw / checkbox.cpp
index 8b7ba211b9daee599683972d6f9f217045999adc..3e8f8041858fd1817ff6b6cf725c94adcad211c5 100644 (file)
 // macros
 // ----------------------------------------------------------------------------
 
-#if !USE_SHARED_LIBRARY
-    IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
-    IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
-#endif
+IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
 
 // ============================================================================
 // implementation
@@ -62,14 +60,18 @@ bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
 }
 
 // Single check box item
-bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
-           const wxPoint& pos,
-           const wxSize& size, long style,
-           const wxValidator& validator,
-           const wxString& name)
+bool wxCheckBox::Create(wxWindow *parent,
+                        wxWindowID id,
+                        const wxString& label,
+                        const wxPoint& pos,
+                        const wxSize& size, long style,
+                        const wxValidator& validator,
+                        const wxString& name)
 {
     SetName(name);
+#if wxUSE_VALIDATORS
     SetValidator(validator);
+#endif // wxUSE_VALIDATORS
     if (parent) parent->AddChild(this);
 
     SetBackgroundColour(parent->GetBackgroundColour()) ;
@@ -179,34 +181,6 @@ bool wxCheckBox::GetValue() const
 #endif
 }
 
-WXHBRUSH wxCheckBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
-                                WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
-{
-#if wxUSE_CTL3D
-  if ( m_useCtl3D )
-  {
-    HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
-
-      return (WXHBRUSH) hbrush;
-  }
-#endif
-
-  if (GetParent()->GetTransparentBackground())
-    SetBkMode((HDC) pDC, TRANSPARENT);
-  else
-    SetBkMode((HDC) pDC, OPAQUE);
-
-  ::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
-  ::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
-
-  wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
-
-  // Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush
-  // has a zero usage count.
-//  backgroundBrush->RealizeResource();
-  return (WXHBRUSH) backgroundBrush->GetResourceHandle();
-}
-
 void wxCheckBox::Command (wxCommandEvent & event)
 {
   SetValue ((event.GetInt() != 0));
@@ -224,7 +198,9 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l
            const wxString& name)
 {
   SetName(name);
+#if wxUSE_VALIDATORS
   SetValidator(validator);
+#endif // wxUSE_VALIDATORS
   if (parent) parent->AddChild(this);
 
   SetBackgroundColour(parent->GetBackgroundColour()) ;