X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d4864e971beb14110e16450729bf16e733d79fff..b67e8d38b6dd7652ba4c73c7df7571d5148c087a:/include/wx/ctrlsub.h diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index 4108164ea1..70270f8220 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -154,6 +154,16 @@ public: // colour virtual bool ShouldInheritColours() const { return false; } +protected: + // we can't compute our best size before the items are added to the control + // which is done after calling SetInitialBestSize() (it is called from the + // base class ctor and the items are added in the derived class ctor), so + // don't do anything at all here as our size will be changed later anyhow + // + // of course, all derived classes *must* call SetBestSize() from their + // ctors for this to work! + virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { } + private: DECLARE_NO_COPY_CLASS(wxControlWithItems) };