]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tglbtn.cpp
fix for DMC missing mouse defines - linking of minimal failed
[wxWidgets.git] / src / msw / tglbtn.cpp
index 353ac6526b48d417692791dc1108e992ce8359b4..b73b9aa4ebd4bfe5877bc3ff668c5e9ad7376d99 100644 (file)
@@ -73,6 +73,12 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
                             const wxValidator& validator,
                             const wxString& name)
 {
+    // default border for this control is none
+    if ( (style & wxBORDER_MASK) == wxBORDER_DEFAULT )
+    {
+        style |= wxBORDER_NONE;
+    }
+    
    if (!CreateBase(parent, id, pos, size, style, validator, name))
       return FALSE;
 
@@ -81,7 +87,15 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
    m_backgroundColour = parent->GetBackgroundColour();
    m_foregroundColour = parent->GetForegroundColour();
 
-   long msStyle = BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP | WS_CHILD | WS_VISIBLE;
+#ifndef BS_PUSHLIKE
+#define BS_PUSHLIKE 0x00001000L
+#endif
+
+   WXDWORD exStyle = 0;
+   long msStyle = MSWGetStyle(style, & exStyle) ;
+
+   msStyle |= BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP ;
+
 #ifdef __WIN32__
    if(m_windowStyle & wxBU_LEFT)
       msStyle |= BS_LEFT;
@@ -93,7 +107,7 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
       msStyle |= BS_BOTTOM;
 #endif
 
-   m_hWnd = (WXHWND)CreateWindowEx(MakeExtendedStyle(m_windowStyle),
+   m_hWnd = (WXHWND)CreateWindowEx(exStyle,
                                    wxT("BUTTON"), label,
                                    msStyle, 0, 0, 0, 0,
                                    (HWND)parent->GetHWND(),