11#ifndef _WX_SCROLLINGDIALOG_H_
12#define _WX_SCROLLINGDIALOG_H_
15#include "wx/propdlg.h"
62 wxSizer* sizer,
int& retBorder,
63 int accumlatedBorder = 0);
75 wxStdDialogButtonSizer* buttonSizer,
76 wxSizer* sizer,
int& count);
80 wxSizer* buttonSizer = NULL);
86 wxScrolledWindow* scrolledWindow);
91 virtual int MustScroll(wxDialog* dialog, wxSize& windowSize,
111 void SetDialog(wxDialog* dialog) { m_dialog = dialog; }
112 wxDialog* GetDialog()
const {
return m_dialog; }
126 std::vector<int>& GetButtonIds() {
return m_buttonIds; }
130 return (m_buttonIds.Index((
int)
id) != wxNOT_FOUND);
146 m_layoutLayoutAdaptationDone = adaptationDone;
148 bool GetLayoutAdaptationDone()
const {
return m_layoutLayoutAdaptationDone; }
157 static void SetLayoutAdaptation(
bool enable) { sm_layoutAdaptation = enable; }
161 bool m_layoutLayoutAdaptationDone;
162 std::vector<int> m_buttonIds;
163 int m_layoutAdaptationLevel;
165 static bool sm_layoutAdaptation;
177 const wxString& title = wxEmptyString,
178 const wxPoint& pos = wxDefaultPosition,
179 const wxSize& size = wxDefaultSize,
180 long style = wxDEFAULT_DIALOG_STYLE) {
182 Create(parent,
id, title, pos, size, style);
184 bool Create(wxWindow* parent,
int id = wxID_ANY,
185 const wxString& title = wxEmptyString,
186 const wxPoint& pos = wxDefaultPosition,
187 const wxSize& size = wxDefaultSize,
188 long style = wxDEFAULT_DIALOG_STYLE);
193 virtual bool Show(
bool show =
true);
209 const wxString& title,
210 const wxPoint& pos = wxDefaultPosition,
211 const wxSize& sz = wxDefaultSize,
212 long style = wxDEFAULT_DIALOG_STYLE,
213 const wxString& name = wxDialogNameStr) {
215 Create(parent,
id, title, pos, sz, style, name);
226 virtual bool Show(
bool show =
true);
int GetLayoutAdaptationLevel() const
Get level of adaptation.
virtual wxWindow * GetContentWindow() const
Returns a content window if there is one.
void AddButtonId(wxWindowID id)
Add an id to the list of custom button identifiers that should be in the button sizer.
void SetLayoutAdaptationDone(bool adaptationDone)
Returns true if the adaptation has been done.
static bool GetLayoutAdaptation()
Global switch for layout adaptation.
static wxDialogLayoutAdapter * sm_layoutAdapter
static wxDialogLayoutAdapter * SetLayoutAdapter(wxDialogLayoutAdapter *adapter)
Set layout adapter class, returning old adapter.
bool IsUserButtonId(wxWindowID id)
Is this id in the custom button id array?
virtual bool DoLayoutAdaptation()
Do the adaptation.
void SetLayoutAdaptationLevel(int level)
Level of adaptation, from none (Level 0) to full (Level 3).
virtual bool CanDoLayoutAdaptation()
Can we do the adaptation?
virtual bool DoLayoutAdaptation(wxDialogHelper *dialog)=0
Override this function to do the adaptation.
virtual bool CanDoLayoutAdaptation(wxDialogHelper *dialog)=0
Override this function to indicate that adaptation should be done.
virtual bool FitWithScrolling(wxDialog *dialog, wxScrolledWindow *scrolledWindow)
A function to fit the dialog around its contents, and then adjust for screen size.
virtual bool IsOrdinaryButtonSizer(wxDialogHelper *dialog, wxBoxSizer *sizer)
Check if this sizer contains standard buttons, and so can be repositioned in the dialog.
virtual bool FindLooseButtons(wxDialogHelper *dialog, wxStdDialogButtonSizer *buttonSizer, wxSizer *sizer, int &count)
Find 'loose' main buttons in the existing layout and add them to the standard dialog sizer.
virtual bool DoLayoutAdaptation(wxDialogHelper *dialog)
Do layout adaptation.
virtual void ReparentControls(wxWindow *parent, wxWindow *reparentTo, wxSizer *buttonSizer=NULL)
Reparent the controls to the scrolled window, except those in buttonSizer.
virtual bool IsStandardButton(wxDialogHelper *dialog, wxButton *button)
Check if this is a standard button.
virtual bool CanDoLayoutAdaptation(wxDialogHelper *dialog)
Indicate that adaptation should be done.
virtual int MustScroll(wxDialog *dialog, wxSize &windowSize, wxSize &displaySize)
Find whether scrolling will be necessary for the dialog, returning wxVERTICAL, wxHORIZONTAL or both.
virtual wxSizer * FindButtonSizer(bool stdButtonSizer, wxDialogHelper *dialog, wxSizer *sizer, int &retBorder, int accumlatedBorder=0)
Find a standard or horizontal box sizer.