]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/button.cpp
Had missed one LPSTR.
[wxWidgets.git] / src / msw / button.cpp
index 661ddad461bcee6f7bb5a73dfd37c9493319b678..aff5ee1b475011af57e69da22ae53fd8456c7ea5 100644 (file)
@@ -72,26 +72,25 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
   else
     m_windowId = id;
 
-  DWORD exStyle = MakeExtendedStyle(m_windowStyle);
-  HWND wx_button =
-    CreateWindowEx(exStyle, "BUTTON", label, BS_PUSHBUTTON | WS_TABSTOP | WS_CHILD,
-                    0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
-                    wxGetInstance(), NULL);
-
-#if wxUSE_CTL3D
-//  if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS))
-//    Ctl3dSubclassCtl(wx_button);
-#endif
-
-  m_hWnd = (WXHWND)wx_button;
+  m_hWnd = (WXHWND)CreateWindowEx
+                   (
+                    MakeExtendedStyle(m_windowStyle),
+                    _T("BUTTON"),
+                    label,
+                    WS_VISIBLE | WS_TABSTOP | WS_CHILD,
+                    0, 0, 0, 0, 
+                    GetWinHwnd(parent),
+                    (HMENU)m_windowId,
+                    wxGetInstance(),
+                    NULL
+                   );
 
   // Subclass again for purposes of dialog editing mode
-  SubclassWin((WXHWND)wx_button);
+  SubclassWin(m_hWnd);
 
   SetFont(parent->GetFont());
 
   SetSize(x, y, width, height);
-  ShowWindow(wx_button, SW_SHOW);
 
   return TRUE;
 }
@@ -116,7 +115,7 @@ void wxButton::DoSetSize(int x, int y, int width, int height, int sizeFlags)
 
   int current_width;
   int cyf;
-  char buf[300];
+  wxChar buf[300];
   GetWindowText((HWND) GetHWND(), buf, 300);
   GetTextExtent(buf, &current_width, &cyf,NULL,NULL,
     & this->GetFont());
@@ -165,7 +164,7 @@ wxString wxButton::GetLabel(void) const
 
 void wxButton::SetLabel(const wxString& label)
 {
-  SetWindowText((HWND) GetHWND(), (const char *) label);
+  SetWindowText((HWND) GetHWND(), (const wxChar *) label);
 }
 
 WXHBRUSH wxButton::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,