{ SetBackgroundColour(bg); }
protected:
+ // we can't compute our best size before the items are added to the control
+ virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { }
+
// subclass one radio button
void SubclassRadioButton(WXHWND hWndBtn);
(HMENU)NewControlId(), wxGetInstance(), NULL);
SetSelection(0);
-
SetSize(pos.x, pos.y, size.x, size.y);
+ // Now that we have items determine what is the best size and set it.
+ SetBestSize(size);
+
return TRUE;
}
m_windowStyle = style;
m_tickFreq = 0;
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
long msStyle = 0;
long wstyle = 0;
}
}
- SetSize(x, y, width, height);
+ SetSize(pos.x, pos.y, size.x, size.y);
SetValue(value);
+ // SetInitialBestSize is not called since we don't call MSWCreateControl
+ // for this control, so call SetBestSize here instead.
+ SetBestSize(size);
+
return TRUE;
}
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
{
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
+ SetSizeHints(GetSize());
}
}
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
{
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
+ SetSizeHints(GetSize());
}
return ret;