projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Applied patch for wxComboBox and wxListBox to
[wxWidgets.git]
/
src
/
msw
/
checkbox.cpp
diff --git
a/src/msw/checkbox.cpp
b/src/msw/checkbox.cpp
index a92fc1b2d6238baea46d66002a6cace8cc727731..86211b4fcd15873ab3b1e5f39ddd4a6248a6fa5a 100644
(file)
--- a/
src/msw/checkbox.cpp
+++ b/
src/msw/checkbox.cpp
@@
-28,9
+28,13
@@
#pragma hdrstop
#endif
#pragma hdrstop
#endif
+#if wxUSE_CHECKBOX
+
#ifndef WX_PRECOMP
#include "wx/checkbox.h"
#include "wx/brush.h"
#ifndef WX_PRECOMP
#include "wx/checkbox.h"
#include "wx/brush.h"
+ #include "wx/dcscreen.h"
+ #include "wx/settings.h"
#endif
#include "wx/msw/private.h"
#endif
#include "wx/msw/private.h"
@@
-102,6
+106,9
@@
bool wxCheckBox::Create(wxWindow *parent,
if ( style & wxALIGN_RIGHT )
msStyle |= BS_LEFTTEXT;
if ( style & wxALIGN_RIGHT )
msStyle |= BS_LEFTTEXT;
+ if ( style & wxCLIP_SIBLINGS )
+ msStyle |= WS_CLIPSIBLINGS;
+
// We perhaps have different concepts of 3D here - a 3D border,
// versus a 3D button.
// So we only wish to give a border if this is specified
// We perhaps have different concepts of 3D here - a 3D border,
// versus a 3D button.
// So we only wish to give a border if this is specified
@@
-142,29
+149,36
@@
bool wxCheckBox::Create(wxWindow *parent,
void wxCheckBox::SetLabel(const wxString& label)
{
void wxCheckBox::SetLabel(const wxString& label)
{
- SetWindowText(GetHwnd(), label);
+
SetWindowText(GetHwnd(), label);
}
}
-#define CHECK_SIZE 13
-
wxSize wxCheckBox::DoGetBestSize() const
{
wxSize wxCheckBox::DoGetBestSize() const
{
- int wCheckbox, hCheckbox;
+ static int s_checkSize = 0;
+
+ if ( !s_checkSize )
+ {
+ wxScreenDC dc;
+ dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+
+ s_checkSize = (3*dc.GetCharHeight())/2;
+ }
- wxString str = wxGetWindowText(GetHWND())
+ " "
;
+ wxString str = wxGetWindowText(GetHWND());
+ int wCheckbox, hCheckbox;
if ( !str.IsEmpty() )
{
GetTextExtent(str, &wCheckbox, &hCheckbox);
if ( !str.IsEmpty() )
{
GetTextExtent(str, &wCheckbox, &hCheckbox);
- wCheckbox +=
CHECK_SIZE
;
+ wCheckbox +=
s_checkSize + GetCharWidth()
;
- if ( hCheckbox <
CHECK_SIZE
)
- hCheckbox =
CHECK_SIZE
;
+ if ( hCheckbox <
s_checkSize
)
+ hCheckbox =
s_checkSize
;
}
else
{
}
else
{
- wCheckbox =
CHECK_SIZE
;
- hCheckbox =
CHECK_SIZE
;
+ wCheckbox =
s_checkSize
;
+ hCheckbox =
s_checkSize
;
}
return wxSize(wCheckbox, hCheckbox);
}
return wxSize(wCheckbox, hCheckbox);
@@
-184,7
+198,7
@@
bool wxCheckBox::GetValue() const
#ifdef __WIN32__
return (SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED);
#else
#ifdef __WIN32__
return (SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED);
#else
- return ((0x00
3 & SendMessage(GetHwnd(), BM_GETCHECK, 0, 0)) == 0x003
);
+ return ((0x00
1 & SendMessage(GetHwnd(), BM_GETCHECK, 0, 0)) == 0x001
);
#endif
}
#endif
}
@@
-198,7
+212,7
@@
void wxCheckBox::Command (wxCommandEvent & event)
// wxBitmapCheckBox
// ----------------------------------------------------------------------------
// wxBitmapCheckBox
// ----------------------------------------------------------------------------
-bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *
label
,
+bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *
WXUNUSED(label)
,
const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator,
const wxPoint& pos,
const wxSize& size, long style,
const wxValidator& validator,
@@
-253,7
+267,9
@@
bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l
return TRUE;
}
return TRUE;
}
-void wxBitmapCheckBox::SetLabel(const wxBitmap&
bitmap
)
+void wxBitmapCheckBox::SetLabel(const wxBitmap&
WXUNUSED(bitmap)
)
{
wxFAIL_MSG(wxT("not implemented"));
}
{
wxFAIL_MSG(wxT("not implemented"));
}
+
+#endif // wxUSE_CHECKBOX