+
+//---------------------------------------------------------------------------
+// wxWrapSizer - A box sizer that can wrap items on several lines when
+// widths exceed available width.
+//---------------------------------------------------------------------------
+
+// Borrow unused flag value
+#define wxEXTEND_LAST_ON_EACH_LINE wxFULL_REPAINT_ON_RESIZE
+
+class WXDLLEXPORT wxWrapSizer: public wxBoxSizer
+{
+public:
+ wxWrapSizer( int orient=wxHORIZONTAL, int flags=wxEXTEND_LAST_ON_EACH_LINE );
+ virtual ~wxWrapSizer();
+
+ virtual void RecalcSizes();
+ virtual wxSize CalcMin();
+
+ virtual bool InformFirstDirection( int direction, int size, int availableOtherDir );
+
+protected:
+ int m_prim_size_last; // Size in primary direction last time
+ int m_n_line; // Number of lines
+ wxBoxSizer m_rows; // Rows of items
+ int m_flags;
+
+ void AdjustPropLastItem(wxSizer *psz, wxSizerItem *itemLast);
+
+ DECLARE_DYNAMIC_CLASS(wxWrapSizer)
+};
+
+//---------------------------------------------------------------------------
+// wxStaticBoxSizer
+//---------------------------------------------------------------------------
+
+#if wxUSE_STATBOX
+
+class WXDLLIMPEXP_FWD_CORE wxStaticBox;
+
+class WXDLLEXPORT wxStaticBoxSizer: public wxBoxSizer
+{
+public:
+ wxStaticBoxSizer(wxStaticBox *box, int orient);
+ wxStaticBoxSizer(int orient, wxWindow *win, const wxString& label = wxEmptyString);
+ virtual ~wxStaticBoxSizer();
+
+ void RecalcSizes();
+ wxSize CalcMin();
+
+ wxStaticBox *GetStaticBox() const
+ { return m_staticBox; }
+
+ // override to hide/show the static box as well
+ virtual void ShowItems (bool show);
+
+ virtual bool Detach( wxWindow *window );
+ virtual bool Detach( wxSizer *sizer ) { return wxBoxSizer::Detach(sizer); }
+ virtual bool Detach( int index ) { return wxBoxSizer::Detach(index); }
+
+protected:
+ wxStaticBox *m_staticBox;
+
+private:
+ DECLARE_CLASS(wxStaticBoxSizer)
+ DECLARE_NO_COPY_CLASS(wxStaticBoxSizer)
+};
+
+#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 Realize();
+
+ 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; // wxID_APPLY
+ wxButton *m_buttonNegative; // wxID_NO
+ wxButton *m_buttonCancel; // wxID_CANCEL, wxID_CLOSE
+ wxButton *m_buttonHelp; // wxID_HELP, wxID_CONTEXT_HELP
+
+private:
+ DECLARE_CLASS(wxStdDialogButtonSizer)
+ DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer)
+};
+
+#endif // wxUSE_BUTTON
+
+
+// ----------------------------------------------------------------------------
+// inline functions implementation
+// ----------------------------------------------------------------------------
+
+#if WXWIN_COMPATIBILITY_2_8
+
+inline void wxSizerItem::SetWindow(wxWindow *window)
+{
+ DoSetWindow(window);
+}
+
+inline void wxSizerItem::SetSizer(wxSizer *sizer)
+{
+ DoSetSizer(sizer);
+}
+
+inline void wxSizerItem::SetSpacer(const wxSize& size)
+{
+ DoSetSpacer(size);
+}
+
+inline void wxSizerItem::SetSpacer(int width, int height)
+{
+ DoSetSpacer(wxSize(width, height));
+}
+
+#endif // WXWIN_COMPATIBILITY_2_8
+
+
+inline wxSizerItem*
+wxSizer::Add( wxSizerItem *item )
+{
+ return Insert( m_children.GetCount(), item );
+}
+
+inline wxSizerItem*
+wxSizer::Add( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
+{
+ return Add( new wxSizerItem( window, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Add( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
+{
+ return Add( new wxSizerItem( sizer, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Add( int width, int height, int proportion, int flag, int border, wxObject* userData )
+{
+ return Add( new wxSizerItem( width, height, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Add( wxWindow *window, const wxSizerFlags& flags )
+{
+ return Add( new wxSizerItem(window, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::Add( wxSizer *sizer, const wxSizerFlags& flags )
+{
+ return Add( new wxSizerItem(sizer, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::Add( int width, int height, const wxSizerFlags& flags )
+{
+ return Add( new wxSizerItem(width, height, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::AddSpacer(int size)
+{
+ return Add(size, size);
+}
+
+inline wxSizerItem*
+wxSizer::AddStretchSpacer(int prop)
+{
+ return Add(0, 0, prop);
+}
+
+inline wxSizerItem*
+wxSizer::Prepend( wxSizerItem *item )
+{
+ return Insert( 0, item );
+}
+
+inline wxSizerItem*
+wxSizer::Prepend( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
+{
+ return Prepend( new wxSizerItem( window, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Prepend( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
+{
+ return Prepend( new wxSizerItem( sizer, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Prepend( int width, int height, int proportion, int flag, int border, wxObject* userData )
+{
+ return Prepend( new wxSizerItem( width, height, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::PrependSpacer(int size)
+{
+ return Prepend(size, size);
+}
+
+inline wxSizerItem*
+wxSizer::PrependStretchSpacer(int prop)
+{
+ return Prepend(0, 0, prop);
+}
+
+inline wxSizerItem*
+wxSizer::Prepend( wxWindow *window, const wxSizerFlags& flags )
+{
+ return Prepend( new wxSizerItem(window, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::Prepend( wxSizer *sizer, const wxSizerFlags& flags )
+{
+ return Prepend( new wxSizerItem(sizer, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::Prepend( int width, int height, const wxSizerFlags& flags )
+{
+ return Prepend( new wxSizerItem(width, height, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::Insert( size_t index,
+ wxWindow *window,
+ int proportion,
+ int flag,
+ int border,
+ wxObject* userData )
+{
+ return Insert( index, new wxSizerItem( window, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Insert( size_t index,
+ wxSizer *sizer,
+ int proportion,
+ int flag,
+ int border,
+ wxObject* userData )
+{
+ return Insert( index, new wxSizerItem( sizer, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Insert( size_t index,
+ int width,
+ int height,
+ int proportion,
+ int flag,
+ int border,
+ wxObject* userData )
+{
+ return Insert( index, new wxSizerItem( width, height, proportion, flag, border, userData ) );
+}
+
+inline wxSizerItem*
+wxSizer::Insert( size_t index, wxWindow *window, const wxSizerFlags& flags )
+{
+ return Insert( index, new wxSizerItem(window, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::Insert( size_t index, wxSizer *sizer, const wxSizerFlags& flags )
+{
+ return Insert( index, new wxSizerItem(sizer, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::Insert( size_t index, int width, int height, const wxSizerFlags& flags )
+{
+ return Insert( index, new wxSizerItem(width, height, flags) );
+}
+
+inline wxSizerItem*
+wxSizer::InsertSpacer(size_t index, int size)
+{
+ return Insert(index, size, size);
+}
+
+inline wxSizerItem*
+wxSizer::InsertStretchSpacer(size_t index, int prop)
+{
+ return Insert(index, 0, 0, prop);
+}
+
+#endif // __WXSIZER_H__