+void wxStaticText::SetLabel(
+ const wxString& rsLabel
+)
+{
+ ::WinSetWindowText(GetHwnd(), rsLabel.c_str());
+
+ //
+ // Adjust the size of the window to fit to the label unless autoresizing is
+ // disabled
+ //
+ if (!(GetWindowStyle() & wxST_NO_AUTORESIZE))
+ {
+ 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
+