X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c299c3ab663257429983c24e6fb71450f3cf9f1..dfe8399aa013a1fa6487d008bf1176078f218c6d:/src/os2/gauge.cpp diff --git a/src/os2/gauge.cpp b/src/os2/gauge.cpp index b227ebf692..e12f172304 100644 --- a/src/os2/gauge.cpp +++ b/src/os2/gauge.cpp @@ -14,6 +14,7 @@ #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/utils.h" +#include "wx/scrolwin.h" #endif #include "wx/os2/private.h" @@ -122,6 +123,7 @@ bool wxGauge::Create( int nWidth = rSize.x; int nHeight = rSize.y; long lMsStyle = 0L; + SWP vSwp; SetName(rsName); #if wxUSE_VALIDATORS @@ -154,8 +156,6 @@ bool wxGauge::Create( if (m_windowStyle & wxCLIP_SIBLINGS) lMsStyle |= WS_CLIPSIBLINGS; - - m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle ,WC_ENTRYFIELD // Window class ,(PSZ)NULL // Initial Text @@ -173,7 +173,15 @@ bool wxGauge::Create( ); ::WinSetWindowULong(GetHwnd(), QWL_USER, (LONG)this); fnWndProcGauge = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxGaugeWndProc); - SetFont(pParent->GetFont()); + ::WinQueryWindowPos(m_hWnd, &vSwp); + SetXComp(vSwp.x); + SetYComp(vSwp.y); + wxFont* pTextFont = new wxFont( 10 + ,wxMODERN + ,wxNORMAL + ,wxNORMAL + ); + SetFont(*pTextFont); if (nWidth == -1L) nWidth = 50L; if (nHeight == -1L) @@ -184,6 +192,7 @@ bool wxGauge::Create( ,nHeight ); ::WinShowWindow((HWND)GetHWND(), TRUE); + delete pTextFont; return TRUE; } // end of wxGauge::Create