wxCHECK_MSG( m_hWnd, FALSE, "Failed to create static ctrl" );
-#if CTL3D
+#if wxUSE_CTL3D
/*
if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS))
Ctl3dSubclassCtl(static_item);
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);
int actualWidth = width;
int actualHeight = height;
- char buf[300];
int current_width;
int cyf;
- ::GetWindowText((HWND) GetHWND(), buf, 300);
- GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL, & this->GetFont());
+ wxString text(wxGetWindowText(GetHWND()));
+ GetTextExtent(text, ¤t_width, &cyf, NULL, NULL, & GetFont());
int ww, hh;
GetSize(&ww, &hh);
{
int cx;
int cy;
- wxGetCharSize(GetHWND(), &cx, &cy, & this->GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
actualWidth = (int)(current_width + cx) ;
}
void wxStaticText::SetLabel(const wxString& label)
{
- int w, h;
- RECT rect;
-
wxWindow *parent = GetParent();
+
+ RECT rect;
GetWindowRect((HWND) GetHWND(), &rect);
- // Since we now have the absolute screen coords,
- // if there's a parent we must subtract its top left corner
+ // Since we now have the absolute screen coords, if there's a parent we must
+ // subtract its top left corner
POINT point;
point.x = rect.left;
point.y = rect.top;
::ScreenToClient((HWND) parent->GetHWND(), &point);
}
- GetTextExtent(label, &w, &h, NULL, NULL, & this->GetFont());
- MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h,
- TRUE);
+ int w, h;
+ GetTextExtent(label, &w, &h, NULL, NULL, & GetFont());
+ MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h, TRUE);
SetWindowText((HWND) GetHWND(), (const char *)label);
}
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
/*
-#if CTL3D
+#if wxUSE_CTL3D
if ( m_useCtl3D )
{
HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);