Fix bugs related to two phase creation of wxRibbon classes.
Add missing wxRibbonControl::Create() method. Ensure that member variables are always initialized by the ctor. Check that we're fully initialized in EVT_SIZE handler. Closes #12018. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,13 +24,24 @@ class wxRibbonArtProvider;
|
||||
class WXDLLIMPEXP_RIBBON wxRibbonControl : public wxControl
|
||||
{
|
||||
public:
|
||||
wxRibbonControl() { m_art = NULL; }
|
||||
wxRibbonControl() { Init(); }
|
||||
|
||||
wxRibbonControl(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxControlNameStr);
|
||||
const wxString& name = wxControlNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxControlNameStr);
|
||||
|
||||
virtual void SetArtProvider(wxRibbonArtProvider* art);
|
||||
wxRibbonArtProvider* GetArtProvider() const {return m_art;}
|
||||
@@ -52,6 +63,9 @@ protected:
|
||||
virtual wxSize DoGetNextLargerSize(wxOrientation direction,
|
||||
wxSize relative_to) const;
|
||||
|
||||
private:
|
||||
void Init() { m_art = NULL; }
|
||||
|
||||
#ifndef SWIG
|
||||
DECLARE_CLASS(wxRibbonControl)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user