<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxDialog</title>
</header>
<module>wxDialog</module>
<modulesummary>Functions for wxDialog class</modulesummary>
<description><p>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.
      </p><p>Dialogs can be made scrollable, automatically, for computers with low resolution screens: please see overview_dialog_autoscrolling for further details.
      </p><p>Dialogs usually contain either a single button allowing to close the dialog or two buttons, one accepting the changes and the other one discarding them (such button, if present, is automatically activated if the user presses the "Esc" key). By default, buttons with the standard wxID_OK and wxID_CANCEL identifiers behave as expected. Starting with wxWidgets 2.7 it is also possible to use a button with a different identifier instead, see <seemfa marker="#setAffirmativeId/2"><c>setAffirmativeId/2</c></seemfa> and <c>SetEscapeId()</c> (not implemented in wx).
      </p><p>Also notice that the <seemfa marker="#createButtonSizer/2"><c>createButtonSizer/2</c></seemfa> should be used to create the buttons appropriate for the current platform and positioned correctly (including their order which is platform-dependent).
      </p><p>Modal and Modeless</p> <p>There are two kinds of dialog, modal and modeless. A modal dialog blocks program flow and user input on other windows until it is dismissed, whereas a modeless dialog behaves more like a frame in that program flow continues, and input in other windows is still possible. To show a modal dialog you should use the <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa> method while to show a dialog modelessly you simply use <seemfa marker="#show/2"><c>show/2</c></seemfa>, just as with frames.
      </p> <p>Note that the modal dialog is one of the very few examples of wxWindow-derived objects which may be created on the stack and not on the heap. In other words, while most windows would be created like this:
      </p>  <p>You can achieve the same result with dialogs by using simpler code:
      </p>  <p>An application can define a <seeerl marker="wxCloseEvent"><c>wxCloseEvent</c></seeerl> handler for the dialog to respond to system close events.
      </p> <p>Styles</p><p>This class supports the following styles:
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/overview_dialog.html#overview_dialog">Overview dialog</url>, <seeerl marker="wxFrame"><c>wxFrame</c></seeerl>, <url href="https://docs.wxwidgets.org/3.1/overview_validator.html#overview_validator">Overview validator</url>
      </p>
  <p>This class is derived (and can use functions) from: 
    <seeerl marker="wxTopLevelWindow"><c>wxTopLevelWindow</c></seeerl> <seeerl marker="wxWindow"><c>wxWindow</c></seeerl> <seeerl marker="wxEvtHandler"><c>wxEvtHandler</c></seeerl></p>
  
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_dialog.html">wxDialog</url></p>
  </description><section><title>Events</title><p>Event types emitted from this class: <seeerl marker="wxCloseEvent"><c>close_window</c></seeerl>, <seeerl marker="wxInitDialogEvent"><c>init_dialog</c></seeerl></p></section>
<datatypes><datatype><name name="wxDialog"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="0" clause_i="1" since=""/>
    <fsummary>Default constructor. </fsummary>
    <desc><p>Default constructor. 
      </p></desc>
  </func>
  
  <func>
    <name name="new" arity="3" clause_i="1" since=""/>
    <fsummary>See: <c>new/4</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="4" clause_i="1" since=""/>
    <fsummary>Constructor. </fsummary>
    <desc><p>Constructor. 
      </p><p>See: <seemfa marker="#create/5"><c>create/5</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor. </fsummary>
    <desc><p>Destructor. 
      </p><p>Deletes any child windows before deleting the physical window.
      </p><p>See overview_windowdeletion for more info. 
      </p></desc>
  </func>
  
  <func>
    <name name="create" arity="4" clause_i="1" since=""/>
    <fsummary>See: <c>create/5</c></fsummary>
  </func>
  
  <func>
    <name name="create" arity="5" clause_i="1" since=""/>
    <fsummary>Used for two-step dialog box construction. </fsummary>
    <desc><p>Used for two-step dialog box construction. 
      </p><p>See: <seemfa marker="#new/4"><c>new/4</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="createButtonSizer" arity="2" clause_i="1" since=""/>
    <fsummary>Creates a sizer with standard buttons. </fsummary>
    <desc><p>Creates a sizer with standard buttons. 
      </p><p><c>flags</c> is a bit list of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE, wxHELP, wxNO_DEFAULT.
      </p><p>The sizer lays out the buttons in a manner appropriate to the platform.
      </p><p>This function uses <seemfa marker="#createStdDialogButtonSizer/2"><c>createStdDialogButtonSizer/2</c></seemfa> 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. 
      </p></desc>
  </func>
  
  <func>
    <name name="createStdDialogButtonSizer" arity="2" clause_i="1" since=""/>
    <fsummary>Creates a <c>wxStdDialogButtonSizer</c> with standard buttons. </fsummary>
    <desc><p>Creates a <seeerl marker="wxStdDialogButtonSizer"><c>wxStdDialogButtonSizer</c></seeerl> with standard buttons. 
      </p><p><c>flags</c> is a bit list of the following flags: wxOK, wxCANCEL, wxYES, wxNO, wxAPPLY, wxCLOSE, wxHELP, wxNO_DEFAULT.
      </p><p>The sizer lays out the buttons in a manner appropriate to the platform. 
      </p></desc>
  </func>
  
  <func>
    <name name="endModal" arity="2" clause_i="1" since=""/>
    <fsummary>Ends a modal dialog, passing a value to be returned from the <c>showModal/1</c> invocation. </fsummary>
    <desc><p>Ends a modal dialog, passing a value to be returned from the <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa> invocation. 
      </p><p>See: <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa>, <seemfa marker="#getReturnCode/1"><c>getReturnCode/1</c></seemfa>, <seemfa marker="#setReturnCode/2"><c>setReturnCode/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getAffirmativeId" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the identifier of the button which works like standard OK button in this dialog. </fsummary>
    <desc><p>Gets the identifier of the button which works like standard OK button in this dialog. 
      </p><p>See: <seemfa marker="#setAffirmativeId/2"><c>setAffirmativeId/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getReturnCode" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the return code for this window. </fsummary>
    <desc><p>Gets the return code for this window. 
      </p><p>Remark: A return code is normally associated with a modal dialog, where <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa> returns a code to the application.
      </p><p>See: <seemfa marker="#setReturnCode/2"><c>setReturnCode/2</c></seemfa>, <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa>, <seemfa marker="#endModal/2"><c>endModal/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="isModal" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the dialog box is modal, false otherwise. </fsummary>
    <desc><p>Returns true if the dialog box is modal, false otherwise. 
      </p></desc>
  </func>
  
  <func>
    <name name="setAffirmativeId" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the identifier to be used as OK button. </fsummary>
    <desc><p>Sets the identifier to be used as OK button. 
      </p><p>When the button with this identifier is pressed, the dialog calls <seemfa marker="wxWindow#validate/1"><c>wxWindow:validate/1</c></seemfa> and <seemfa marker="wxWindow#transferDataFromWindow/1"><c>wxWindow:transferDataFromWindow/1</c></seemfa> and, if they both return true, closes the dialog with the affirmative id return code.
      </p><p>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.
      </p><p>By default, the affirmative id is wxID_OK.
      </p><p>See: <seemfa marker="#getAffirmativeId/1"><c>getAffirmativeId/1</c></seemfa>, <c>SetEscapeId()</c> (not implemented in wx)
      </p></desc>
  </func>
  
  <func>
    <name name="setReturnCode" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the return code for this window. </fsummary>
    <desc><p>Sets the return code for this window. 
      </p><p>A return code is normally associated with a modal dialog, where <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa> returns a code to the application. The function <seemfa marker="#endModal/2"><c>endModal/2</c></seemfa> calls <seemfa marker="#setReturnCode/2"><c>setReturnCode/2</c></seemfa>.
      </p><p>See: <seemfa marker="#getReturnCode/1"><c>getReturnCode/1</c></seemfa>, <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa>, <seemfa marker="#endModal/2"><c>endModal/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="show" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>show/2</c></fsummary>
  </func>
  
  <func>
    <name name="show" arity="2" clause_i="1" since=""/>
    <fsummary>Hides or shows the dialog. </fsummary>
    <desc><p>Hides or shows the dialog. 
      </p><p>The preferred way of dismissing a modal dialog is to use <seemfa marker="#endModal/2"><c>endModal/2</c></seemfa>.
      </p></desc>
  </func>
  
  <func>
    <name name="showModal" arity="1" clause_i="1" since=""/>
    <fsummary>Shows an application-modal dialog. </fsummary>
    <desc><p>Shows an application-modal dialog. 
      </p><p>Program flow does not return until the dialog has been dismissed with <seemfa marker="#endModal/2"><c>endModal/2</c></seemfa>.
      </p><p>Notice that it is possible to call <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa> for a dialog which had been previously shown with <seemfa marker="#show/2"><c>show/2</c></seemfa>, this allows making an existing modeless dialog modal. However <seemfa marker="#showModal/1"><c>showModal/1</c></seemfa> can't be called twice without intervening <seemfa marker="#endModal/2"><c>endModal/2</c></seemfa> calls.
      </p><p>Note that this function creates a temporary event loop which takes precedence over the application's main event loop (see <c>wxEventLoopBase</c> (not implemented in wx)) and which is destroyed when the dialog is dismissed. This also results in a call to <c>wxApp::ProcessPendingEvents()</c> (not implemented in wx).
      </p><p>Return: The value set with <seemfa marker="#setReturnCode/2"><c>setReturnCode/2</c></seemfa>.
      </p><p>See: <c>ShowWindowModal()</c> (not implemented in wx), <c>ShowWindowModalThenDo()</c> (not implemented in wx), <seemfa marker="#endModal/2"><c>endModal/2</c></seemfa>, <seemfa marker="#getReturnCode/1"><c>getReturnCode/1</c></seemfa>, <seemfa marker="#setReturnCode/2"><c>setReturnCode/2</c></seemfa>
      </p></desc>
  </func>
  </funcs>
</erlref>
