2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dialog.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxDialog
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxDialog
|
|
|
|
@wxheader{dialog.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
A dialog box is a window with a title bar and sometimes a system menu, which
|
|
|
|
can be moved around the screen. It can contain controls and other windows and
|
|
|
|
is often used to allow the user to make some choice or to answer a question.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Dialogs can be made scrollable, automatically: please see @ref
|
|
|
|
overview_autoscrollingdialogs "Automatic scrolling dialogs" for further details.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
|
|
|
@style{wxCAPTION}:
|
|
|
|
Puts a caption on the dialog box.
|
|
|
|
@style{wxDEFAULT_DIALOG_STYLE}:
|
|
|
|
Equivalent to a combination of wxCAPTION, wxCLOSE_BOX and
|
|
|
|
wxSYSTEM_MENU (the last one is not used under Unix)
|
|
|
|
@style{wxRESIZE_BORDER}:
|
|
|
|
Display a resizeable frame around the window.
|
|
|
|
@style{wxSYSTEM_MENU}:
|
|
|
|
Display a system menu.
|
|
|
|
@style{wxCLOSE_BOX}:
|
|
|
|
Displays a close box on the frame.
|
|
|
|
@style{wxMAXIMIZE_BOX}:
|
|
|
|
Displays a maximize box on the dialog.
|
|
|
|
@style{wxMINIMIZE_BOX}:
|
|
|
|
Displays a minimize box on the dialog.
|
|
|
|
@style{wxTHICK_FRAME}:
|
|
|
|
Display a thick frame around the window.
|
|
|
|
@style{wxSTAY_ON_TOP}:
|
|
|
|
The dialog stays on top of all other windows.
|
|
|
|
@style{wxNO_3D}:
|
|
|
|
Under Windows, specifies that the child controls should not have 3D
|
|
|
|
borders unless specified in the control.
|
|
|
|
@style{wxDIALOG_NO_PARENT}:
|
|
|
|
By default, a dialog created with a @NULL parent window will be
|
|
|
|
given the application's top level window as parent. Use this style
|
|
|
|
to prevent this from happening and create an orphan dialog. This is
|
|
|
|
not recommended for modal dialogs.
|
|
|
|
@style{wxDIALOG_EX_CONTEXTHELP}:
|
|
|
|
Under Windows, puts a query button on the caption. When pressed,
|
|
|
|
Windows will go into a context-sensitive help mode and wxWidgets
|
|
|
|
will send a wxEVT_HELP event if the user clicked on an application
|
|
|
|
window. Note that this is an extended style and must be set by
|
|
|
|
calling SetExtraStyle before Create is called (two-step
|
|
|
|
construction).
|
|
|
|
@style{wxDIALOG_EX_METAL}:
|
|
|
|
On Mac OS X, frames with this style will be shown with a metallic
|
|
|
|
look. This is an extra style.
|
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{cmndlg}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see @ref overview_wxdialogoverview, wxFrame, @ref overview_validatoroverview
|
2008-03-09 08:33:59 -04:00
|
|
|
"Validator overview"
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxDialog : public wxTopLevelWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Can be @NULL, a frame or another dialog box.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
An identifier for the dialog. A value of -1 is taken to mean a default.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param title
|
2008-03-09 08:33:59 -04:00
|
|
|
The title of the dialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
The dialog position. The value wxDefaultPosition indicates a default position,
|
|
|
|
chosen by
|
|
|
|
either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
The dialog size. The value wxDefaultSize indicates a default size, chosen by
|
|
|
|
either the windowing system or wxWidgets, depending on platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
The window style. See wxDialog.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Used to associate a name with the window,
|
|
|
|
allowing the application user to set Motif resource values for
|
|
|
|
individual dialog boxes.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see Create()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxDialog();
|
2008-03-08 09:43:31 -05:00
|
|
|
wxDialog(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_DIALOG_STYLE,
|
|
|
|
const wxString& name = "dialogBox");
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor. Deletes any child windows before deleting the physical window.
|
|
|
|
*/
|
|
|
|
~wxDialog();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Adds an identifier to be regarded as a main button for the non-scrolling area
|
|
|
|
of a dialog.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
void AddMainButtonId(wxWindowID id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if this dialog can and should perform layout adaptation using
|
|
|
|
DoLayoutAdaptation(), usually if
|
|
|
|
the dialog is too large to fit on the display.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
bool CanDoLayoutAdapation();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Centres the dialog box on the display.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param direction
|
2008-03-09 08:33:59 -04:00
|
|
|
May be wxHORIZONTAL, wxVERTICAL or wxBOTH.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void Centre(int direction = wxBOTH);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Used for two-step dialog box construction. See wxDialog()
|
|
|
|
for details.
|
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_DIALOG_STYLE,
|
|
|
|
const wxString& name = "dialogBox");
|
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Creates a sizer with standard buttons. @a flags is a bit list
|
2008-03-08 09:43:31 -05:00
|
|
|
of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE,
|
2008-03-08 08:52:38 -05:00
|
|
|
wxHELP, wxNO_DEFAULT.
|
|
|
|
The sizer lays out the buttons in a manner appropriate to the platform.
|
2008-03-08 09:43:31 -05:00
|
|
|
This function uses CreateStdDialogButtonSizer()
|
2008-03-08 08:52:38 -05:00
|
|
|
internally for most platforms but doesn't create the sizer at all for the
|
|
|
|
platforms with hardware buttons (such as smartphones) for which it sets up the
|
|
|
|
hardware buttons appropriately and returns @NULL, so don't forget to test that
|
|
|
|
the return value is valid before using it.
|
|
|
|
*/
|
|
|
|
wxSizer* CreateButtonSizer(long flags);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Creates a sizer with standard buttons using
|
2008-03-08 08:52:38 -05:00
|
|
|
CreateButtonSizer() separated from the rest
|
|
|
|
of the dialog contents by a horizontal wxStaticLine.
|
|
|
|
Please notice that just like CreateButtonSizer() this function may return @c
|
2008-03-08 09:43:31 -05:00
|
|
|
@NULL
|
2008-03-08 08:52:38 -05:00
|
|
|
if no buttons were created.
|
|
|
|
*/
|
|
|
|
wxSizer* CreateSeparatedButtonSizer(long flags);
|
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Creates a wxStdDialogButtonSizer with standard buttons. @a flags is a bit list
|
2008-03-08 08:52:38 -05:00
|
|
|
of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE,
|
|
|
|
wxHELP, wxNO_DEFAULT.
|
|
|
|
The sizer lays out the buttons in a manner appropriate to the platform.
|
|
|
|
*/
|
|
|
|
wxStdDialogButtonSizer* CreateStdDialogButtonSizer(long flags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Performs layout adaptation, usually if the dialog is too large to fit on the
|
|
|
|
display.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
bool DoLayoutAdapation();
|
|
|
|
|
|
|
|
/**
|
|
|
|
This function is called when the titlebar OK button is pressed (PocketPC only).
|
|
|
|
A command event for the identifier returned by GetAffirmativeId is sent by
|
|
|
|
default. You can override this function. If the function returns @false,
|
|
|
|
wxWidgets
|
|
|
|
will call Close() for the dialog.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
virtual bool DoOK();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
A static function enabling or disabling layout adaptation for all dialogs.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
static void EnableLayoutAdaptation(bool enable);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Ends a modal dialog, passing a value to be returned from the ShowModal()
|
|
|
|
invocation.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param retCode
|
2008-03-09 08:33:59 -04:00
|
|
|
The value that should be returned by ShowModal.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see ShowModal(), GetReturnCode(), SetReturnCode()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void EndModal(int retCode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the identifier of the button which works like standard OK button in this
|
|
|
|
dialog.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetAffirmativeId()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetAffirmativeId() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Override this to return a window containing the main content of the dialog.
|
|
|
|
This is
|
|
|
|
particularly useful when the dialog implements pages, such as
|
|
|
|
wxPropertySheetDialog,
|
|
|
|
and allows the @ref overview_wxdialogoverview "layout adaptation code" to know
|
|
|
|
that only the pages need to be made scrollable.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxWindow* GetContentWindow() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the identifier of the button to map presses of @c ESC
|
|
|
|
button to.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetEscapeId()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetEscapeId() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the dialog has been adapted, usually by making it scrollable
|
|
|
|
to work with a small display.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool GetLayoutAdaptationDone() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets a value representing the aggressiveness of search for buttons and sizers
|
|
|
|
to be in the non-scrolling part of a layout-adapted dialog.
|
|
|
|
Zero switches off adaptation, and 3 allows search for standard buttons anywhere
|
|
|
|
in the dialog.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
int GetLayoutAdaptationLevel();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the adaptation mode, overriding the global adaptation flag.
|
|
|
|
See also SetLayoutAdaptationMode() and @ref overview_autoscrollingdialogs
|
|
|
|
"Automatic scrolling dialogs".
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxDialogLayoutAdaptationMode GetLayoutAdaptationMode() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
A static function getting the current layout adapter object.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
static wxDialogLayoutAdapter* GetLayoutAdapter();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns an array of identifiers to be regarded as the main buttons for the
|
|
|
|
non-scrolling area of a dialog.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
wxArrayInt GetMainButtonIds();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the return code for this window.
|
|
|
|
|
|
|
|
@remarks A return code is normally associated with a modal dialog, where
|
2008-03-09 08:33:59 -04:00
|
|
|
ShowModal() returns a code to the application.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see SetReturnCode(), ShowModal(), EndModal()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
int GetReturnCode();
|
|
|
|
|
|
|
|
/**
|
|
|
|
On PocketPC, a dialog is automatically provided with an empty toolbar.
|
|
|
|
GetToolBar
|
|
|
|
allows you to access the toolbar and add tools to it. Removing tools and adding
|
|
|
|
arbitrary controls are not currently supported.
|
|
|
|
This function is not available on any other platform.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxToolBar* GetToolBar() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Iconizes or restores the dialog. Windows only.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param iconize
|
2008-03-09 08:33:59 -04:00
|
|
|
If @true, iconizes the dialog box; if @false, shows and restores it.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
@remarks Note that in Windows, iconization has no effect since dialog
|
2008-03-09 08:33:59 -04:00
|
|
|
boxes cannot be iconized. However, applications may
|
|
|
|
need to explicitly restore dialog boxes under Motif
|
|
|
|
which have user-iconizable frames, and under Windows
|
|
|
|
calling Iconize(@false) will bring the window to the
|
|
|
|
front, as does Show(@true).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void Iconize(bool iconize);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the dialog box is iconized. Windows only.
|
|
|
|
|
|
|
|
@remarks Always returns @false under Windows since dialogs cannot be
|
2008-03-09 08:33:59 -04:00
|
|
|
iconized.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsIconized() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
A static function returning @true if layout adaptation is enabled for all
|
|
|
|
dialogs.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
static bool IsLayoutAdaptationEnabled();
|
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Returns @true if @a id is in the array of identifiers to be regarded as the
|
2008-03-08 08:52:38 -05:00
|
|
|
main buttons for the non-scrolling area of a dialog.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsMainButton(wxWindowID& id) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the dialog box is modal, @false otherwise.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
bool IsModal() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
The default handler for wxEVT_SYS_COLOUR_CHANGED.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param event
|
2008-03-09 08:33:59 -04:00
|
|
|
The colour change event.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
@remarks Changes the dialog's colour to conform to the current settings
|
2008-03-09 08:33:59 -04:00
|
|
|
(Windows only). Add an event table entry for your
|
|
|
|
dialog class if you wish the behaviour to be different
|
|
|
|
(such as keeping a user-defined background colour). If
|
|
|
|
you do override this function, call wxEvent::Skip to
|
|
|
|
propagate the notification to child windows and
|
|
|
|
controls.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see wxSysColourChangedEvent
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the identifier to be used as OK button. When the button with this
|
2008-03-08 09:43:31 -05:00
|
|
|
identifier is pressed, the dialog calls wxWindow::Validate
|
|
|
|
and wxWindow::TransferDataFromWindow
|
2008-03-08 08:52:38 -05:00
|
|
|
and, if they both return @true, closes the dialog with @c wxID_OK return
|
|
|
|
code.
|
|
|
|
Also, when the user presses a hardware OK button on the devices having one or
|
|
|
|
the special OK button in the PocketPC title bar, an event with this id is
|
|
|
|
generated.
|
|
|
|
By default, the affirmative id is wxID_OK.
|
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetAffirmativeId(), SetEscapeId()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetAffirmativeId(int id);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Sets the identifier of the button which should work like the standard
|
2008-03-08 08:52:38 -05:00
|
|
|
@c CANCEL button in this dialog. When the button with this id is
|
2008-03-08 09:43:31 -05:00
|
|
|
clicked, the dialog is closed. Also, when the user presses @c ESC
|
2008-03-08 08:52:38 -05:00
|
|
|
key in the dialog or closes the dialog using the close button in the title bar,
|
|
|
|
this is mapped to the click of the button with the specified id.
|
2008-03-08 09:43:31 -05:00
|
|
|
By default, the escape id is the special value @c wxID_ANY meaning that
|
2008-03-08 08:52:38 -05:00
|
|
|
@c wxID_CANCEL button is used if it's present in the dialog and
|
2008-03-08 09:43:31 -05:00
|
|
|
otherwise the button with GetAffirmativeId()
|
2008-03-09 08:33:59 -04:00
|
|
|
is used. Another special value for @a id is @c wxID_NONE meaning that
|
2008-03-08 08:52:38 -05:00
|
|
|
@c ESC presses should be ignored. If any other value is given, it
|
|
|
|
is interpreted as the id of the button to map the escape key to.
|
|
|
|
*/
|
|
|
|
void SetEscapeId(int id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the icon for this dialog.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param icon
|
2008-03-09 08:33:59 -04:00
|
|
|
The icon to associate with this dialog.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetIcon(const wxIcon& icon);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the icons for this dialog.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param icons
|
2008-03-09 08:33:59 -04:00
|
|
|
The icons to associate with this dialog.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetIcons(const wxIconBundle& icons);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Marks the dialog as having been adapted, usually by making it scrollable to
|
|
|
|
work with a small display.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
void SetLayoutAdaptationDone(bool done);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the aggressiveness of search for buttons and sizers to be in the
|
|
|
|
non-scrolling part of a layout-adapted dialog.
|
|
|
|
Zero switches off adaptation, and 3 allows search for standard buttons anywhere
|
|
|
|
in the dialog.
|
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
void SetLayoutAdaptationLevel(int level);
|
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Sets the adaptation mode, overriding the global adaptation flag. @a mode may be
|
2008-03-08 08:52:38 -05:00
|
|
|
one of the following values:
|
2008-03-09 08:33:59 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
See also @ref overview_autoscrollingdialogs "Automatic scrolling dialogs" for
|
|
|
|
more on layout adaptation.
|
|
|
|
*/
|
|
|
|
void SetLayoutAdaptationMode(wxDialogLayoutAdaptationMode mode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
A static function for setting the current layout adapter object, returning the
|
|
|
|
old adapter. If you call this, you should
|
|
|
|
delete the old adapter object.
|
|
|
|
See also wxDialogLayoutAdapter and @ref overview_autoscrollingdialogs
|
|
|
|
"Automatic scrolling dialogs".
|
|
|
|
*/
|
|
|
|
static wxDialogLayoutAdapter* SetLayoutAdapter(wxDialogLayoutAdapter* adapter);
|
|
|
|
|
|
|
|
/**
|
|
|
|
@b NB: This function is deprecated and doesn't work for all ports, just use
|
|
|
|
ShowModal() to show a modal dialog instead.
|
|
|
|
Allows the programmer to specify whether the dialog box is modal (Show() blocks
|
|
|
|
control
|
|
|
|
until the dialog is hidden) or modeless (control returns immediately).
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param flag
|
2008-03-09 08:33:59 -04:00
|
|
|
If @true, the dialog will be modal, otherwise it will be modeless.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetModal(bool flag);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the return code for this window.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param retCode
|
2008-03-09 08:33:59 -04:00
|
|
|
The integer return code, usually a control identifier.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
@remarks A return code is normally associated with a modal dialog, where
|
2008-03-09 08:33:59 -04:00
|
|
|
ShowModal() returns a code to the application.
|
|
|
|
The function EndModal() calls SetReturnCode.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see GetReturnCode(), ShowModal(), EndModal()
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetReturnCode(int retCode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Hides or shows the dialog.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param show
|
2008-03-09 08:33:59 -04:00
|
|
|
If @true, the dialog box is shown and brought to the front;
|
|
|
|
otherwise the box is hidden. If @false and the dialog is
|
|
|
|
modal, control is returned to the calling program.
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
@remarks The preferred way of dismissing a modal dialog is to use
|
2008-03-09 08:33:59 -04:00
|
|
|
EndModal().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
bool Show(bool show);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Shows a modal dialog. Program flow does not return until the dialog has been
|
|
|
|
dismissed with
|
|
|
|
EndModal().
|
|
|
|
|
|
|
|
@returns The return value is the value set with SetReturnCode().
|
|
|
|
*/
|
|
|
|
int ShowModal();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxDialogLayoutAdapter
|
|
|
|
@wxheader{dialog.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This abstract class is the base for classes that help wxWidgets peform run-time
|
2008-03-08 09:43:31 -05:00
|
|
|
layout adaptation of dialogs. Principally,
|
2008-03-08 08:52:38 -05:00
|
|
|
this is to cater for small displays by making part of the dialog scroll, but
|
2008-03-08 09:43:31 -05:00
|
|
|
the application developer may find other
|
|
|
|
uses for layout adaption.
|
|
|
|
|
|
|
|
By default, there is one instance of wxStandardDialogLayoutAdapter
|
2008-03-08 08:52:38 -05:00
|
|
|
which can perform adaptation for most custom dialogs and dialogs with book
|
2008-03-08 09:43:31 -05:00
|
|
|
controls
|
|
|
|
such as wxPropertySheetDialog.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{FIXME}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see @ref overview_autoscrollingdialogs "Automatic scrolling dialogs"
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxDialogLayoutAdapter
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Default constructor.
|
|
|
|
*/
|
|
|
|
wxDialogLayoutAdapter();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Override this to returns @true if adaptation can and should be done.
|
|
|
|
*/
|
|
|
|
bool CanDoLayoutAdaptation(wxDialog* dialog);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Override this to perform layout adaptation, such as making parts of the dialog
|
2008-03-08 09:43:31 -05:00
|
|
|
scroll and resizing the dialog to fit the display.
|
2008-03-08 08:52:38 -05:00
|
|
|
Normally this function will be called just before the dialog is shown.
|
|
|
|
*/
|
|
|
|
bool DoLayoutAdaptation(wxDialog* dialog);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|