// 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
}
// 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()) ;
m_windowStyle = style;
wxString Label = label;
- if (Label == _T(""))
- Label = _T(" "); // Apparently needed or checkbox won't show
+ if (Label == wxT(""))
+ Label = wxT(" "); // Apparently needed or checkbox won't show
if ( id == -1 )
m_windowId = NewControlId();
msStyle |= WS_BORDER;
*/
- m_hWnd = (WXHWND)CreateWindowEx(exStyle, _T("BUTTON"), Label,
+ m_hWnd = (WXHWND)CreateWindowEx(exStyle, wxT("BUTTON"), Label,
msStyle,
0, 0, 0, 0,
(HWND)parent->GetHWND(), (HMENU)m_windowId,
SetWindowText(GetHwnd(), label);
}
-wxSize wxCheckBox::DoGetBestSize()
+wxSize wxCheckBox::DoGetBestSize() const
{
int wCheckbox, hCheckbox;
#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));
const wxString& name)
{
SetName(name);
+#if wxUSE_VALIDATORS
SetValidator(validator);
+#endif // wxUSE_VALIDATORS
if (parent) parent->AddChild(this);
SetBackgroundColour(parent->GetBackgroundColour()) ;
checkHeight = -1 ;
long msStyle = CHECK_FLAGS;
- HWND wx_button = CreateWindowEx(MakeExtendedStyle(m_windowStyle), CHECK_CLASS, _T("toggle"),
+ HWND wx_button = CreateWindowEx(MakeExtendedStyle(m_windowStyle), CHECK_CLASS, wxT("toggle"),
msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap)
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(wxT("not implemented"));
}