+bool wxStaticText::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxString& rsLabel,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxString& rsName )
+{
+ SetName(rsName);
+ if (pParent)
+ pParent->AddChild(this);
+
+ SetBackgroundColour(pParent->GetBackgroundColour()) ;
+ SetForegroundColour(pParent->GetForegroundColour()) ;
+
+ if ( vId == wxID_ANY )
+ m_windowId = (int)NewControlId();
+ else
+ m_windowId = vId;
+
+ int nX = rPos.x;
+ int nY = rPos.y;
+ int nWidth = rSize.x;
+ int nHeight = rSize.y;
+
+ m_windowStyle = lStyle;
+
+ long lSstyle = 0L;
+
+ // Used to have DT_VCENTER but that doesn't work correctly with
+ // multiline strings and DT_WORDBREAK. Accept a reasonable
+ // compromise for now
+ lSstyle = WS_VISIBLE | SS_TEXT | DT_WORDBREAK | DT_MNEMONIC;
+ if (m_windowStyle & wxALIGN_CENTRE)
+ lSstyle |= DT_CENTER;
+ else if (m_windowStyle & wxALIGN_RIGHT)
+ lSstyle |= DT_RIGHT;
+ else
+ lSstyle |= DT_LEFT;
+
+ m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
+ ,WC_STATIC // Window class
+ ,NULL // Initial Text
+ ,(ULONG)lSstyle // Style flags
+ ,0L, 0L, 0L, 0L // Origin -- 0 size
+ ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
+ ,HWND_TOP // initial z position
+ ,(ULONG)m_windowId // Window identifier
+ ,NULL // no control data
+ ,NULL // no Presentation parameters
+ );
+
+ wxCHECK_MSG(m_hWnd, false, wxT("Failed to create static ctrl"));
+
+ LONG lColor = (LONG)wxBLACK->GetPixel();
+
+ ::WinSetPresParam( m_hWnd
+ ,PP_FOREGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ );
+ lColor = (LONG)m_backgroundColour.GetPixel();
+
+ ::WinSetPresParam( m_hWnd
+ ,PP_BACKGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ );
+
+ SubclassWin(m_hWnd);
+ SetFont(*wxSMALL_FONT);
+ SetXComp(0);
+ SetYComp(0);
+ SetSize( nX, nY, nWidth, nHeight );
+
+ SetLabel(rsLabel);