- // TODO:
-/*
- if (GetParent()->GetTransparentBackground())
- SetBkMode((HDC) pDC, TRANSPARENT);
- else
- SetBkMode((HDC) pDC, OPAQUE);
-
- ::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
- ::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
-
- wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
- // Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush
- // has a zero usage count.
-// backgroundBrush->RealizeResource();
- return (WXHBRUSH) backgroundBrush->GetResourceHandle();
-*/
- return (WXHBRUSH)0;
+ m_labelOrig = rsLabel; // save original label
+
+ // OS/2 does not support ellipsized labels in static text:
+ DoSetLabel(GetEllipsizedLabel());
+
+ //
+ // Adjust the size of the window to fit to the label unless autoresizing is
+ // disabled
+ //
+ if (!(GetWindowStyle() & wxST_NO_AUTORESIZE) &&
+ !IsEllipsized())
+ {
+ wxCoord vX;
+ wxCoord vY;
+ wxCoord vWidth;
+ wxCoord vHeight;
+
+ GetPosition(&vX, &vY);
+ GetSize(&vWidth, &vHeight);
+ if (!(vX == -1 && vY == -1 && vWidth == -1 && vHeight == -1))
+ DoSetSize(vX, vY, vWidth, vHeight, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
+ else
+ DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
+ }
+} // end of wxStaticText::SetLabel
+
+MRESULT wxStaticText::OS2WindowProc(
+ WXUINT uMsg
+, WXWPARAM wParam
+, WXLPARAM lParam
+)
+{
+ return wxWindow::OS2WindowProc( uMsg
+ ,wParam
+ ,lParam
+ );
+} // end of wxStaticText::OS2WindowProc
+
+
+// for wxST_ELLIPSIZE_* support:
+
+void wxStaticText::DoSetLabel(const wxString& str)
+{
+ wxString sLabel = ::wxPMTextToLabel(str);
+ ::WinSetWindowText(GetHwnd(), sLabel.c_str());