1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxDialog documentation
4 %% Author: wxWidgets Team
8 %% Copyright: (c) wxWidgets Team
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxDialog
}}\label{wxdialog
}
14 A dialog box is a window with a title bar and sometimes a system menu, which
15 can be moved around the screen. It can contain controls and other windows and
16 is often used to allow the user to make some choice or to answer a question.
18 Dialogs can be made scrollable, automatically: please see
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for further details.
20 \wxheading{Dialog Buttons
}
22 The dialog usually contains either a single button allowing to close the
23 dialog or two buttons, one accepting the changes and the other one discarding
24 them (such button, if present, is automatically activated if the user presses
25 the
\texttt{"Esc"
} key). By default, buttons with the standard
\texttt{wxID
\_OK}
26 and
\texttt{wxID
\_CANCEL} identifiers behave as expected. Starting with
27 wxWidgets
2.7 it is also possible to use a button with a different identifier
28 instead, see
\helpref{SetAffirmativeId
}{wxdialogsetaffirmativeid
} and
29 \helpref{SetEscapeId
}{wxdialogsetescapeid
}.
31 Also notice that the
\helpref{CreateButtonSizer()
}{wxdialogcreatebuttonsizer
}
32 should be used to create the buttons appropriate for the current platform and
33 positioned correctly (including their order which is platform-dependent).
35 \wxheading{Derived from
}
37 \helpref{wxTopLevelWindow
}{wxtoplevelwindow
}\\
38 \helpref{wxWindow
}{wxwindow
}\\
39 \helpref{wxEvtHandler
}{wxevthandler
}\\
40 \helpref{wxObject
}{wxobject
}
42 \wxheading{Include files
}
48 \helpref{wxCore
}{librarieslist
}
50 \wxheading{Modal and modeless dialogs
}
52 There are two kinds of dialog --
{\it modal
}\ and
{\it modeless
}. A modal dialog
53 blocks program flow and user input on other windows until it is dismissed,
54 whereas a modeless dialog behaves more like a frame in that program flow
55 continues, and input in other windows is still possible. To show a modal dialog
56 you should use the
\helpref{ShowModal
}{wxdialogshowmodal
} method while to show
57 a dialog modelessly you simply use
\helpref{Show
}{wxdialogshow
}, just as with
60 Note that the modal dialog is one of the very few examples of
61 wxWindow-derived objects which may be created on the stack and not on the heap.
62 In other words, although this code snippet:
67 MyAskDialog *dlg = new MyAskDialog(...);
68 if ( dlg->ShowModal() == wxID_OK )
70 //else: dialog was cancelled or some another button pressed
76 works, you can also achieve the same result by using a simpler code fragment
83 if ( dlg.ShowModal() == wxID_OK )
86 // no need to call Destroy() here
90 An application can define a
\helpref{wxCloseEvent
}{wxcloseevent
} handler for
91 the dialog to respond to system close events.
93 \wxheading{Window styles
}
96 \begin{twocollist
}\itemsep=
0pt
97 \twocolitem{\windowstyle{wxCAPTION
}}{Puts a caption on the dialog box.
}
98 \twocolitem{\windowstyle{wxDEFAULT
\_DIALOG\_STYLE}}{Equivalent to a combination of wxCAPTION, wxCLOSE
\_BOX and wxSYSTEM
\_MENU (the last one is not used under Unix)
}
99 \twocolitem{\windowstyle{wxRESIZE
\_BORDER}}{Display a resizeable frame around the window.
}
100 \twocolitem{\windowstyle{wxSYSTEM
\_MENU}}{Display a system menu.
}
101 \twocolitem{\windowstyle{wxCLOSE
\_BOX}}{Displays a close box on the frame.
}
102 \twocolitem{\windowstyle{wxMAXIMIZE
\_BOX}}{Displays a maximize box on the dialog.
}
103 \twocolitem{\windowstyle{wxMINIMIZE
\_BOX}}{Displays a minimize box on the dialog.
}
104 \twocolitem{\windowstyle{wxTHICK
\_FRAME}}{Display a thick frame around the window.
}
105 \twocolitem{\windowstyle{wxSTAY
\_ON\_TOP}}{The dialog stays on top of all other windows.
}
106 \twocolitem{\windowstyle{wxNO
\_3D}}{Under Windows, specifies that the child controls
107 should not have
3D borders unless specified in the control.
}
108 \twocolitem{\windowstyle{wxDIALOG
\_NO\_PARENT}}{By default, a dialog created
109 with a
{\tt NULL
} parent window will be given the
110 \helpref{application's top level window
}{wxappgettopwindow
} as parent. Use this
111 style to prevent this from happening and create an orphan dialog. This is not recommended for modal dialogs.
}
112 \twocolitem{\windowstyle{wxDIALOG
\_EX\_CONTEXTHELP}}{Under Windows, puts a query button on the
113 caption. When pressed, Windows will go into a context-sensitive help mode and wxWidgets will send
114 a wxEVT
\_HELP event if the user clicked on an application window.
{\it Note
}\ that this is an extended
115 style and must be set by calling
\helpref{SetExtraStyle
}{wxwindowsetextrastyle
} before Create is called (two-step construction).
}
116 \twocolitem{\windowstyle{wxDIALOG
\_EX\_METAL}}{On Mac OS X, frames with this style will be shown with a metallic look. This is an
{\it extra
} style.
}
119 Under Unix or Linux, MWM (the Motif Window Manager) or other window managers
120 recognizing the MHM hints should be running for any of these styles to have an
123 See also
\helpref{Generic window styles
}{windowstyles
}.
127 \helpref{wxDialog overview
}{wxdialogoverview
},
\helpref{wxFrame
}{wxframe
},
\rtfsp
128 \helpref{Validator overview
}{validatoroverview
}
130 \latexignore{\rtfignore{\wxheading{Members
}}}
133 \membersection{wxDialog::wxDialog
}\label{wxdialogctor
}
135 \func{}{wxDialog
}{\void}
139 \func{}{wxDialog
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
140 \param{const wxString\&
}{title
},
\rtfsp
141 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
142 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
143 \param{long
}{ style = wxDEFAULT
\_DIALOG\_STYLE},
\rtfsp
144 \param{const wxString\&
}{name = ``dialogBox"
}}
148 \wxheading{Parameters
}
150 \docparam{parent
}{Can be NULL, a frame or another dialog box.
}
152 \docparam{id
}{An identifier for the dialog. A value of -
1 is taken to mean a default.
}
154 \docparam{title
}{The title of the dialog.
}
156 \docparam{pos
}{The dialog position. A value of (-
1, -
1) indicates a default position, chosen by
157 either the windowing system or wxWidgets, depending on platform.
}
159 \docparam{size
}{The dialog size. A value of (-
1, -
1) indicates a default size, chosen by
160 either the windowing system or wxWidgets, depending on platform.
}
162 \docparam{style
}{The window style. See
\helpref{wxDialog
}{wxdialog
}.
}
164 \docparam{name
}{Used to associate a name with the window,
165 allowing the application user to set Motif resource values for
166 individual dialog boxes.
}
170 \helpref{wxDialog::Create
}{wxdialogcreate
}
173 \membersection{wxDialog::
\destruct{wxDialog
}}\label{wxdialogdtor
}
175 \func{}{\destruct{wxDialog
}}{\void}
177 Destructor. Deletes any child windows before deleting the physical window.
179 \membersection{wxDialog::AddMainButtonId
}\label{wxdialogaddmainbuttonid
}
181 \func{void
}{AddMainButtonId
}{\param{wxWindowID
}{ id
}}
183 Adds an identifier to be regarded as a main button for the non-scrolling area of a dialog.
185 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
187 \membersection{wxDialog::CanDoLayoutAdaptation
}\label{wxdialogcandolayoutadaptation
}
189 \func{bool
}{CanDoLayoutAdapation
}{\void}
191 Returns
\true if this dialog can and should perform layout adaptation using
\helpref{DoLayoutAdaptation
}{wxdialogdolayoutadaptation
}, usually if
192 the dialog is too large to fit on the display.
194 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
196 \membersection{wxDialog::Centre
}\label{wxdialogcentre
}
198 \func{void
}{Centre
}{\param{int
}{ direction = wxBOTH
}}
200 Centres the dialog box on the display.
202 \wxheading{Parameters
}
204 \docparam{direction
}{May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
} or
{\tt wxBOTH
}.
}
207 \membersection{wxDialog::Create
}\label{wxdialogcreate
}
209 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
210 \param{const wxString\&
}{title
},
\rtfsp
211 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
212 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
213 \param{long
}{ style = wxDEFAULT
\_DIALOG\_STYLE},
\rtfsp
214 \param{const wxString\&
}{name = ``dialogBox"
}}
216 Used for two-step dialog box construction. See
\helpref{wxDialog::wxDialog
}{wxdialogctor
}\rtfsp
220 \membersection{wxDialog::CreateButtonSizer
}\label{wxdialogcreatebuttonsizer
}
222 \func{wxSizer*
}{CreateButtonSizer
}{\param{long
}{ flags
}}
224 Creates a sizer with standard buttons.
{\it flags
} is a bit list
225 of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE,
226 wxHELP, wxNO
\_DEFAULT.
228 The sizer lays out the buttons in a manner appropriate to the platform.
230 This function uses
\helpref{CreateStdDialogButtonSizer
}{wxdialogcreatestddialogbuttonsizer
}
231 internally for most platforms but doesn't create the sizer at all for the
232 platforms with hardware buttons (such as smartphones) for which it sets up the
233 hardware buttons appropriately and returns
\NULL, so don't forget to test that
234 the return value is valid before using it.
237 \membersection{wxDialog::CreateSeparatedButtonSizer
}\label{wxdialogcreateseparatedbuttonsizer
}
239 \func{wxSizer*
}{CreateSeparatedButtonSizer
}{\param{long
}{ flags
}}
241 Creates a sizer with standard buttons using
242 \helpref{CreateButtonSizer
}{wxdialogcreatebuttonsizer
} separated from the rest
243 of the dialog contents by a horizontal
\helpref{wxStaticLine
}{wxstaticline
}.
245 Please notice that just like CreateButtonSizer() this function may return
\NULL
246 if no buttons were created.
249 \membersection{wxDialog::CreateStdDialogButtonSizer
}\label{wxdialogcreatestddialogbuttonsizer
}
251 \func{wxStdDialogButtonSizer*
}{CreateStdDialogButtonSizer
}{\param{long
}{ flags
}}
253 Creates a
\helpref{wxStdDialogButtonSizer
}{wxstddialogbuttonsizer
} with standard buttons.
{\it flags
} is a bit list
254 of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE,
255 wxHELP, wxNO
\_DEFAULT.
257 The sizer lays out the buttons in a manner appropriate to the platform.
259 \membersection{wxDialog::DoLayoutAdaptation
}\label{wxdialogdolayoutadaptation
}
261 \func{bool
}{DoLayoutAdapation
}{\void}
263 Performs layout adaptation, usually if the dialog is too large to fit on the display.
265 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
267 \membersection{wxDialog::DoOK
}\label{wxdialogdook
}
269 \func{virtual bool
}{DoOK
}{\void}
271 This function is called when the titlebar OK button is pressed (PocketPC only).
272 A command event for the identifier returned by GetAffirmativeId is sent by
273 default. You can override this function. If the function returns false, wxWidgets
274 will call Close() for the dialog.
276 \membersection{wxDialog::EnableLayoutAdaptation
}\label{wxdialogenablelayoutadaptation
}
278 \func{static void
}{EnableLayoutAdaptation
}{\param{bool
}{ enable
}}
280 A static function enabling or disabling layout adaptation for all dialogs.
282 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
285 \membersection{wxDialog::EndModal
}\label{wxdialogendmodal
}
287 \func{void
}{EndModal
}{\param{int
}{retCode
}}
289 Ends a modal dialog, passing a value to be returned from the
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
}\rtfsp
292 \wxheading{Parameters
}
294 \docparam{retCode
}{The value that should be returned by
{\bf ShowModal
}.
}
298 \helpref{wxDialog::ShowModal
}{wxdialogshowmodal
},
\rtfsp
299 \helpref{wxDialog::GetReturnCode
}{wxdialoggetreturncode
},
\rtfsp
300 \helpref{wxDialog::SetReturnCode
}{wxdialogsetreturncode
}
303 \membersection{wxDialog::GetAffirmativeId
}\label{wxdialoggetaffirmativeid
}
305 \constfunc{int
}{GetAffirmativeId
}{\void}
307 Gets the identifier of the button which works like standard OK button in this
312 \helpref{wxDialog::SetAffirmativeId
}{wxdialogsetaffirmativeid
}
314 \membersection{wxDialog::GetContentWindow
}\label{wxdialoggetcontentwindow
}
316 \constfunc{wxWindow*
}{GetContentWindow
}{\void}
318 Override this to return a window containing the main content of the dialog. This is
319 particularly useful when the dialog implements pages, such as wxPropertySheetDialog,
320 and allows the
\helpref{layout adaptation code
}{wxdialogoverview
} to know that only the pages need to be made scrollable.
322 \membersection{wxDialog::GetEscapeId
}\label{wxdialoggetescapeid
}
324 \constfunc{int
}{GetEscapeId
}{\void}
326 Gets the identifier of the button to map presses of
\texttt{\textsc{ESC
}}
331 \helpref{wxDialog::SetEscapeId
}{wxdialogsetescapeid
}
334 \membersection{wxDialog::GetLayoutAdaptationDone
}\label{wxdialoggetlayoutadaptationdone
}
336 \constfunc{bool
}{GetLayoutAdaptationDone
}{\void}
338 Returns
\true if the dialog has been adapted, usually by making it scrollable to work with a small display.
340 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
343 \membersection{wxDialog::GetLayoutAdaptationLevel
}\label{wxdialoggetlayoutadaptationlevel
}
345 \func{int
}{GetLayoutAdaptationLevel
}{\void}
347 Gets a value representing the aggressiveness of search for buttons and sizers to be in the non-scrolling part of a layout-adapted dialog.
348 Zero switches off adaptation, and
3 allows search for standard buttons anywhere in the dialog.
350 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
353 \membersection{wxDialog::GetLayoutAdaptationMode
}\label{wxdialoggetlayoutadaptationmode
}
355 \constfunc{wxDialogLayoutAdaptationMode
}{GetLayoutAdaptationMode
}{\void}
357 Gets the adaptation mode, overriding the global adaptation flag.
359 See also
\helpref{SetLayoutAdaptationMode
}{wxdialogsetlayoutadaptationmode
} and
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
}.
361 \membersection{wxDialog::GetLayoutAdapter
}\label{wxdialoggetlayoutadapter
}
363 \func{static wxDialogLayoutAdapter*
}{GetLayoutAdapter
}{\void}
365 A static function getting the current layout adapter object.
367 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
370 \membersection{wxDialog::GetMainButtonIds
}\label{wxdialoggetmainbuttonids
}
372 \func{wxArrayInt\&
}{GetMainButtonIds
}{\void}
374 Returns an array of identifiers to be regarded as the main buttons for the non-scrolling area of a dialog.
376 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
378 \membersection{wxDialog::GetReturnCode
}\label{wxdialoggetreturncode
}
380 \func{int
}{GetReturnCode
}{\void}
382 Gets the return code for this window.
386 A return code is normally associated with a modal dialog, where
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
} returns
387 a code to the application.
391 \helpref{wxDialog::SetReturnCode
}{wxdialogsetreturncode
},
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
},
\rtfsp
392 \helpref{wxDialog::EndModal
}{wxdialogendmodal
}
395 \membersection{wxDialog::GetToolBar
}\label{wxdialoggettoolbar
}
397 \constfunc{wxToolBar*
}{GetToolBar
}{\void}
399 On PocketPC, a dialog is automatically provided with an empty toolbar. GetToolBar
400 allows you to access the toolbar and add tools to it. Removing tools and adding
401 arbitrary controls are not currently supported.
403 This function is not available on any other platform.
406 \membersection{wxDialog::Iconize
}\label{wxdialogiconized
}
408 \func{void
}{Iconize
}{\param{bool
}{ iconize
}}
410 Iconizes or restores the dialog. Windows only.
412 \wxheading{Parameters
}
414 \docparam{iconize
}{If true, iconizes the dialog box; if false, shows and restores it.
}
418 Note that in Windows, iconization has no effect since dialog boxes cannot be
419 iconized. However, applications may need to explicitly restore dialog
420 boxes under Motif which have user-iconizable frames, and under Windows
421 calling
{\tt Iconize(false)
} will bring the window to the front, as does
422 \rtfsp{\tt Show(true)
}.
425 \membersection{wxDialog::IsIconized
}\label{wxdialogisiconized
}
427 \constfunc{bool
}{IsIconized
}{\void}
429 Returns true if the dialog box is iconized. Windows only.
433 Always returns false under Windows since dialogs cannot be iconized.
436 \membersection{wxDialog::IsLayoutAdaptationEnabled
}\label{wxdialogislayoutadaptationenabled
}
438 \func{static bool
}{IsLayoutAdaptationEnabled
}{\void}
440 A static function returning
\true if layout adaptation is enabled for all dialogs.
442 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
445 \membersection{wxDialog::IsMainButton
}\label{wxdialogismainbutton
}
447 \constfunc{bool
}{IsMainButton
}{\param{wxWindowID\&
}{id
}}
449 Returns
\true if
{\it id
} is in the array of identifiers to be regarded as the main buttons for the non-scrolling area of a dialog.
451 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
454 \membersection{wxDialog::IsModal
}\label{wxdialogismodal
}
456 \constfunc{bool
}{IsModal
}{\void}
458 Returns true if the dialog box is modal, false otherwise.
462 \membersection{wxDialog::OnSysColourChanged
}\label{wxdialogonsyscolourchanged
}
464 \func{void
}{OnSysColourChanged
}{\param{wxSysColourChangedEvent\&
}{event
}}
466 The default handler for wxEVT
\_SYS\_COLOUR\_CHANGED.
468 \wxheading{Parameters
}
470 \docparam{event
}{The colour change event.
}
474 Changes the dialog's colour to conform to the current settings (Windows only).
475 Add an event table entry for your dialog class if you wish the behaviour
476 to be different (such as keeping a user-defined
477 background colour). If you do override this function, call wxEvent::Skip to
478 propagate the notification to child windows and controls.
482 \helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
}
485 \membersection{wxDialog::SetAffirmativeId
}\label{wxdialogsetaffirmativeid
}
487 \func{void
}{SetAffirmativeId
}{\param{int
}{id
}}
489 Sets the identifier to be used as OK button. When the button with this
490 identifier is pressed, the dialog calls
\helpref{Validate
}{wxwindowvalidate
}
491 and
\helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
}
492 and, if they both return
\true, closes the dialog with
\texttt{wxID
\_OK} return
495 Also, when the user presses a hardware OK button on the devices having one or
496 the special OK button in the PocketPC title bar, an event with this id is
499 By default, the affirmative id is wxID
\_OK.
503 \helpref{wxDialog::GetAffirmativeId
}{wxdialoggetaffirmativeid
},
\helpref{wxDialog::SetEscapeId
}{wxdialogsetescapeid
}
506 \membersection{wxDialog::SetEscapeId
}\label{wxdialogsetescapeid
}
508 \func{void
}{SetEscapeId
}{\param{int
}{id
}}
510 Sets the identifier of the button which should work like the standard
511 \texttt{\textsc{Cancel
}} button in this dialog. When the button with this id is
512 clicked, the dialog is closed. Also, when the user presses
\texttt{\textsc{ESC
}}
513 key in the dialog or closes the dialog using the close button in the title bar,
514 this is mapped to the click of the button with the specified id.
516 By default, the escape id is the special value
\texttt{wxID
\_ANY} meaning that
517 \texttt{wxID
\_CANCEL} button is used if it's present in the dialog and
518 otherwise the button with
\helpref{GetAffirmativeId()
}{wxdialoggetaffirmativeid
}
519 is used. Another special value for
\arg{id
} is
\texttt{wxID
\_NONE} meaning that
520 \texttt{\textsc{ESC
}} presses should be ignored. If any other value is given, it
521 is interpreted as the id of the button to map the escape key to.
524 \membersection{wxDialog::SetIcon
}\label{wxdialogseticon
}
526 \func{void
}{SetIcon
}{\param{const wxIcon\&
}{icon
}}
528 Sets the icon for this dialog.
530 \wxheading{Parameters
}
532 \docparam{icon
}{The icon to associate with this dialog.
}
534 See also
\helpref{wxIcon
}{wxicon
}.
537 \membersection{wxDialog::SetIcons
}\label{wxdialogseticons
}
539 \func{void
}{SetIcons
}{\param{const wxIconBundle\&
}{icons
}}
541 Sets the icons for this dialog.
543 \wxheading{Parameters
}
545 \docparam{icons
}{The icons to associate with this dialog.
}
547 See also
\helpref{wxIconBundle
}{wxiconbundle
}.
550 \membersection{wxDialog::SetLayoutAdaptationDone
}\label{wxdialogsetlayoutadaptationdone
}
552 \func{void
}{SetLayoutAdaptationDone
}{\param{bool
}{done
}}
554 Marks the dialog as having been adapted, usually by making it scrollable to work with a small display.
556 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
559 \membersection{wxDialog::SetLayoutAdaptationLevel
}\label{wxdialogsetlayoutadaptationlevel
}
561 \func{void
}{SetLayoutAdaptationLevel
}{\param{int
}{level
}}
563 Sets the aggressiveness of search for buttons and sizers to be in the non-scrolling part of a layout-adapted dialog.
564 Zero switches off adaptation, and
3 allows search for standard buttons anywhere in the dialog.
566 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
569 \membersection{wxDialog::SetLayoutAdaptationMode
}\label{wxdialogsetlayoutadaptationmode
}
571 \func{void
}{SetLayoutAdaptationMode
}{\param{wxDialogLayoutAdaptationMode
}{mode
}}
573 Sets the adaptation mode, overriding the global adaptation flag.
{\it mode
} may be one of the following values:
576 enum wxDialogLayoutAdaptationMode
578 wxDIALOG_ADAPTATION_MODE_DEFAULT =
0, // use global adaptation enabled status
579 wxDIALOG_ADAPTATION_MODE_ENABLED =
1, // enable this dialog overriding global status
580 wxDIALOG_ADAPTATION_MODE_DISABLED =
2 // disable this dialog overriding global status
584 See also
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
} for more on layout adaptation.
587 \membersection{wxDialog::SetLayoutAdapter
}\label{wxdialogsetlayoutadapter
}
589 \func{static wxDialogLayoutAdapter*
}{SetLayoutAdapter
}{\param{wxDialogLayoutAdapter*
}{ adapter
}}
591 A static function for setting the current layout adapter object, returning the old adapter. If you call this, you should
592 delete the old adapter object.
594 See also
\helpref{wxDialogLayoutAdapter
}{wxdialoglayoutadapter
} and
\helpref{Automatic scrolling dialogs
}{autoscrollingdialogs
}.
597 \membersection{wxDialog::SetModal
}\label{wxdialogsetmodal
}
599 \func{void
}{SetModal
}{\param{bool
}{ flag
}}
601 {\bf NB:
} This function is deprecated and doesn't work for all ports, just use
602 \helpref{ShowModal
}{wxdialogshowmodal
} to show a modal dialog instead.
604 Allows the programmer to specify whether the dialog box is modal (wxDialog::Show blocks control
605 until the dialog is hidden) or modeless (control returns immediately).
607 \wxheading{Parameters
}
609 \docparam{flag
}{If true, the dialog will be modal, otherwise it will be modeless.
}
612 \membersection{wxDialog::SetReturnCode
}\label{wxdialogsetreturncode
}
614 \func{void
}{SetReturnCode
}{\param{int
}{retCode
}}
616 Sets the return code for this window.
618 \wxheading{Parameters
}
620 \docparam{retCode
}{The integer return code, usually a control identifier.
}
624 A return code is normally associated with a modal dialog, where
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
} returns
625 a code to the application. The function
\helpref{wxDialog::EndModal
}{wxdialogendmodal
} calls
{\bf SetReturnCode
}.
629 \helpref{wxDialog::GetReturnCode
}{wxdialoggetreturncode
},
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
},
\rtfsp
630 \helpref{wxDialog::EndModal
}{wxdialogendmodal
}
633 \membersection{wxDialog::Show
}\label{wxdialogshow
}
635 \func{bool
}{Show
}{\param{bool
}{ show
}}
637 Hides or shows the dialog.
639 \wxheading{Parameters
}
641 \docparam{show
}{If true, the dialog box is shown and brought to the front;
642 otherwise the box is hidden. If false and the dialog is
643 modal, control is returned to the calling program.
}
647 The preferred way of dismissing a modal dialog is to use
\helpref{wxDialog::EndModal
}{wxdialogendmodal
}.
650 \membersection{wxDialog::ShowModal
}\label{wxdialogshowmodal
}
652 \func{int
}{ShowModal
}{\void}
654 Shows a modal dialog. Program flow does not return until the dialog has been dismissed with
\rtfsp
655 \helpref{wxDialog::EndModal
}{wxdialogendmodal
}.
657 \wxheading{Return value
}
659 The return value is the value set with
\helpref{wxDialog::SetReturnCode
}{wxdialogsetreturncode
}.
663 \helpref{wxDialog::EndModal
}{wxdialogendmodal
},
\rtfsp
664 \helpref{wxDialog:GetReturnCode
}{wxdialoggetreturncode
},
\rtfsp
665 \helpref{wxDialog::SetReturnCode
}{wxdialogsetreturncode
}