#include "wx/defs.h"
+#include "wx/button.h"
#include "wx/window.h"
#include "wx/frame.h"
#include "wx/dialog.h"
#endif // wxUSE_STATBOX
+#if wxUSE_BUTTON
+
+class WXDLLEXPORT wxStdDialogButtonSizer: public wxBoxSizer
+{
+public:
+ // Constructor just creates a new wxBoxSizer, not much else.
+ // Box sizer orientation is automatically determined here:
+ // vertical for PDAs, horizontal for everything else?
+ wxStdDialogButtonSizer();
+
+ // Checks button ID against system IDs and sets one of the pointers below
+ // to this button. Does not do any sizer-related things here.
+ void AddButton(wxButton *button);
+
+ // Use these if no standard ID can/should be used
+ void SetAffirmativeButton( wxButton *button );
+ void SetNegativeButton( wxButton *button );
+ void SetCancelButton( wxButton *button );
+
+ // All platform-specific code here, checks which buttons exist and add
+ // them to the sizer accordingly.
+ // Note - one potential hack on Mac we could use here,
+ // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
+ // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
+ // I wouldn't add any other hacks like that into here,
+ // but this one I can see being useful.
+ void Finalise();
+
+ wxButton *GetAffirmativeButton() const { return m_buttonAffirmative; }
+ wxButton *GetApplyButton() const { return m_buttonApply; }
+ wxButton *GetNegativeButton() const { return m_buttonNegative; }
+ wxButton *GetCancelButton() const { return m_buttonCancel; }
+ wxButton *GetHelpButton() const { return m_buttonHelp; }
+
+protected:
+ wxButton *m_buttonAffirmative; // wxID_OK, wxID_YES, wxID_SAVE go here
+ wxButton *m_buttonApply;
+ wxButton *m_buttonNegative; // wxID_NO
+ wxButton *m_buttonCancel;
+ wxButton *m_buttonHelp;
+
+private:
+ DECLARE_CLASS(wxStdDialogButtonSizer)
+ DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer)
+};
+
+#endif // wxUSE_BUTTON
#if WXWIN_COMPATIBILITY_2_4
// NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
-// don't do anything. wxBookCtrl::DoGetBestSize does the job now.
+// don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
// ----------------------------------------------------------------------------
// wxBookCtrlSizer
// this sizer works with wxNotebook/wxListbook/... and sizes the control to
// fit its pages
-class WXDLLEXPORT wxBookCtrl;
+class WXDLLEXPORT wxBookCtrlBase;
class WXDLLEXPORT wxBookCtrlSizer : public wxSizer
{
public:
- wxDEPRECATED( wxBookCtrlSizer(wxBookCtrl *bookctrl) );
+ wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase *bookctrl) );
- wxBookCtrl *GetControl() const { return m_bookctrl; }
+ wxBookCtrlBase *GetControl() const { return m_bookctrl; }
virtual void RecalcSizes();
virtual wxSize CalcMin();
// and still have warning-free build of the library itself:
wxBookCtrlSizer() {}
- wxBookCtrl *m_bookctrl;
+ wxBookCtrlBase *m_bookctrl;
private:
DECLARE_CLASS(wxBookCtrlSizer)
#if wxUSE_NOTEBOOK
-// before wxBookCtrl we only had wxNotebookSizer, keep it for backwards
+// before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
// compatibility
class WXDLLEXPORT wxNotebook;