X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd71308fc89eac2dd212b715eba68a993fa78f53..b80ec6db893bc3663dd6d6802ccb8c2d85c1ef97:/src/msw/stattext.cpp?ds=sidebyside diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index b45ca5e0cb..c9f7ca1bca 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -21,7 +21,9 @@ #endif #ifndef WX_PRECOMP +#include "wx/event.h" #include "wx/app.h" +#include "wx/brush.h" #endif #include "wx/stattext.h" @@ -46,9 +48,9 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, SetForegroundColour(parent->GetForegroundColour()) ; if ( id == -1 ) - m_windowId = (int)NewControlId(); + m_windowId = (int)NewControlId(); else - m_windowId = id; + m_windowId = id; int x = pos.x; int y = pos.y; @@ -67,32 +69,32 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, // Even with extended styles, need to combine with WS_BORDER // for them to look right. - if ((m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER) || - (m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER)) + if ( wxStyleHasBorder(m_windowStyle) ) msStyle |= WS_BORDER; - HWND static_item = CreateWindowEx(MakeExtendedStyle(m_windowStyle), "STATIC", (const char *)label, + m_hWnd = (WXHWND)::CreateWindowEx(MakeExtendedStyle(m_windowStyle), "STATIC", (const char *)label, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); -#if CTL3D + wxCHECK_MSG( m_hWnd, FALSE, "Failed to create static ctrl" ); + +#if wxUSE_CTL3D /* if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS)) Ctl3dSubclassCtl(static_item); */ #endif - m_hWnd = (WXHWND)static_item; - - SubclassWin((WXHWND)static_item); + SubclassWin(m_hWnd); - SetFont(* parent->GetFont()); + SetFont(parent->GetFont()); SetSize(x, y, width, height); + return TRUE; } -void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxStaticText::DoSetSize(int x, int y, int width, int height, int sizeFlags) { int currentX, currentY; GetPosition(¤tX, ¤tY); @@ -114,7 +116,7 @@ void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags) int cyf; ::GetWindowText((HWND) GetHWND(), buf, 300); - GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL,GetFont()); + GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL, & this->GetFont()); int ww, hh; GetSize(&ww, &hh); @@ -126,7 +128,7 @@ void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags) { int cx; int cy; - wxGetCharSize(GetHWND(), &cx, &cy,GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, & this->GetFont()); actualWidth = (int)(current_width + cx) ; } @@ -159,21 +161,21 @@ void wxStaticText::SetLabel(const wxString& label) ::ScreenToClient((HWND) parent->GetHWND(), &point); } - GetTextExtent(label, &w, &h, NULL, NULL, GetFont()); + GetTextExtent(label, &w, &h, NULL, NULL, & this->GetFont()); MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h, TRUE); SetWindowText((HWND) GetHWND(), (const char *)label); } WXHBRUSH wxStaticText::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam) + WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { /* -#if CTL3D +#if wxUSE_CTL3D if ( m_useCtl3D ) { HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam); - + if (hbrush != (HBRUSH) 0) return hbrush; else