Add support for arbitrary window labels in wxStaticBox to wxMSW
Just reparent the label window and position it accordingly and, also, avoid painting over it in MSW-specific code.
This commit is contained in:
@@ -27,6 +27,16 @@ public:
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
wxStaticBox(wxWindow* parent, wxWindowID id,
|
||||
wxWindow* label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxStaticBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -34,6 +44,13 @@ public:
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr);
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
wxWindow* label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr);
|
||||
|
||||
/// Implementation only
|
||||
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const wxOVERRIDE;
|
||||
|
||||
@@ -66,5 +83,8 @@ protected:
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox);
|
||||
};
|
||||
|
||||
// Indicate that we have the ctor overload taking wxWindow as label.
|
||||
#define wxHAS_WINDOW_LABEL_IN_STATIC_BOX
|
||||
|
||||
#endif // _WX_MSW_STATBOX_H_
|
||||
|
||||
|
Reference in New Issue
Block a user