<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /home/reggie/tmp/qt-3.1-reggie-23625/qt-x11-free-3.1.1/extensions/motif/src/qmotifdialog.cpp:159 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>QMotifDialog Class</title> <style type="text/css"><!-- h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QMotifDialog Class Reference</h1> <p>The QMotifDialog class provides the QDialog API for Motif dialogs. <a href="#details">More...</a> <p>This class is part of the <b>Qt Motif Extension</b>. <p><tt>#include <<a href="qmotifdialog-h.html">qmotifdialog.h</a>></tt> <p>Inherits <a href="qdialog.html">QDialog</a>. <p><a href="qmotifdialog-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li><div class=fn>enum <a href="#DialogType-enum"><b>DialogType</b></a> { Prompt, Selection, Command, FileSelection, Template, Error, Information, Message, Question, Warning, Working }</div></li> <li><div class=fn><a href="#QMotifDialog"><b>QMotifDialog</b></a> ( DialogType dtype, Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 )</div></li> <li><div class=fn><a href="#QMotifDialog-2"><b>QMotifDialog</b></a> ( Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 )</div></li> <li><div class=fn>virtual <a href="#~QMotifDialog"><b>~QMotifDialog</b></a> ()</div></li> <li><div class=fn>Widget <a href="#shell"><b>shell</b></a> () const</div></li> <li><div class=fn>Widget <a href="#dialog"><b>dialog</b></a> () const</div></li> </ul> <h2>Static Public Members</h2> <ul> <li><div class=fn>void <a href="#acceptCallback"><b>acceptCallback</b></a> ( Widget, XtPointer client_data, XtPointer )</div></li> <li><div class=fn>void <a href="#rejectCallback"><b>rejectCallback</b></a> ( Widget, XtPointer client_data, XtPointer )</div></li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> <p> This class is defined in the <b>Qt <a href="motif-extension.html#Motif">Motif</a> Extension</b>, which can be found in the <tt>qt/extensions</tt> directory. It is not included in the main Qt API. <p> The QMotifDialog class provides the <a href="qdialog.html">QDialog</a> API for Motif dialogs. <p> <p> When migrating Motif applications to Qt, developers will want to rewrite their Motif dialogs using Qt, and switch to using Qt's modality semantics. QMotifDialog ensures that modal Motif dialogs continue to work properly when used in a Qt application. <p> For the purpose of the Motif extension, Motif has two types of dialogs: predefined dialogs and custom dialogs. The predefined Motif dialogs are: <p> <ul> <li> Prompt <li> Selection <li> Command <li> FileSelection <li> Template <li> Error <li> Information <li> Message <li> Question <li> Warning <li> Working </ul> <p> QMotifDialog provides a constructor for the predefined Motif dialog types, which creates a dialog shell and the dialog widget itself. <p> Example usage QMotifDialog to create a predefined Motif dialog: <p> <pre> ... XmString message = XmStringCreateLocalized( "This is a Message dialog.", XmSTRING_DEFAULT_CHARSET ); Arg args[1]; XtSetArg( args[0], XmNmessageString, message ); // parent is an ApplicationShell created earlier in the application QMotifDialog dailog( QMotifDialog::<a href="#DialogType-enum">Message</a>, parent, args, 1, "motif message dialog", TRUE ); XtAddCallback( dialog.dialog(), XmNokCallback, (XtCallbackProc) QMotifDialog::acceptCallback, &dialog ); XtAddCallback( dialog.dialog(), XmNcancelCallback, (XtCallbackProc) QMotifDialog::rejectCallback, &dialog ); dialog.exec(); XmStringFree( message ); ... </pre> <p> QMotifDialog also provides a constructor for custom Motif dialogs, which only creates the dialog shell. The application programmer can create a custom dialog using the QMotifDialog shell as its parent. <p> QMotifDialogs can be used with either an Xt/Motif or a <a href="qwidget.html">QWidget</a> parent. <hr><h2>Member Type Documentation</h2> <h3 class=fn><a name="DialogType-enum"></a>QMotifDialog::DialogType</h3> <p> This enum lists the predefined <a href="motif-extension.html#Motif">Motif</a> dialog types. <ul> <li><tt>QMotifDialog::Prompt</tt> <li><tt>QMotifDialog::Selection</tt> <li><tt>QMotifDialog::Command</tt> <li><tt>QMotifDialog::FileSelection</tt> <li><tt>QMotifDialog::Template</tt> <li><tt>QMotifDialog::Error</tt> <li><tt>QMotifDialog::Information</tt> <li><tt>QMotifDialog::Message</tt> <li><tt>QMotifDialog::Question</tt> <li><tt>QMotifDialog::Warning</tt> <li><tt>QMotifDialog::Working</tt> </ul> <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="QMotifDialog"></a>QMotifDialog::QMotifDialog ( <a href="qmotifdialog.html#DialogType-enum">DialogType</a> dtype, Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 ) </h3> Creates a predefined <a href="motif-extension.html#Motif">Motif</a> dialog of type <em>dtype</em> with a Motif widget <em>parent</em>. <p> The arguments are passed in <em>args</em>, and the number of arguments in <em>argcount</em>. The <em>name</em>, <em>modal</em> and <em>flags</em> arguments are passed on to the <a href="qdialog.html">QDialog</a> constructor. <p> Creates a Shell widget which is a special subclass of XmDialogShell. This allows applications to use the QDialog API with existing Motif dialogs. It also means that applications can properly handle modality with the <a href="qmotif.html">QMotif</a> extension. You can access the Shell widget with the <a href="#shell">shell</a>() member function. <p> Creates a dialog widget with the Shell widget as it's parent. The type of the dialog created is specified by the <em>dtype</em> argument. See the <a href="#DialogType-enum">DialogType</a> enum for a list of available dialog types. You can access the dialog widget with the <a href="#dialog">dialog</a>() member function. <p> <b>Warning:</b> When QMotifDialog is destroyed, the Shell widget and the dialog widget are destroyed. You should not destroy the dialog widget yourself. <h3 class=fn><a name="QMotifDialog-2"></a>QMotifDialog::QMotifDialog ( Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 ) </h3> Creates a QMotifDialog for use in a custom <a href="motif-extension.html#Motif">Motif</a> dialog. <p> The dialog's parent is <em>parent</em>. The arguments are passed in <em>args</em> and the number of arguments in <em>argcount</em>. The <em>name</em>, <em>modal</em> and <em>flags</em> arguments are passed on to the <a href="qdialog.html">QDialog</a> constructor. <p> Creates a Shell widget which is a special subclass of XmDialogShell. This allows applications to use the QDialog API with existing Motif dialogs. It also means that applications can properly handle modality with the <a href="qmotif.html">QMotif</a> extension. You can access the Shell widget with the <a href="#shell">shell</a>() member function. <p> A dialog widget is not created by this constructor. Instead, you should create the dialog widget as a child of this dialog. Once you do this, QMotifDialog will take ownership of your custom dialog, and you can access it with the <a href="#dialog">dialog</a>() member function. <p> <b>Warning:</b> When QMotifDialog is destroyed, the Shell widget and the dialog widget are destroyed. You should not destroy the dialog widget yourself. <h3 class=fn><a name="~QMotifDialog"></a>QMotifDialog::~QMotifDialog ()<tt> [virtual]</tt> </h3> Destroys the <a href="qdialog.html">QDialog</a>, dialog widget and shell widget. <h3 class=fn>void <a name="acceptCallback"></a>QMotifDialog::acceptCallback ( Widget, XtPointer client_data, XtPointer )<tt> [static]</tt> </h3> Convenient Xt/Motif callback to accept the QMotifDialog. <p> The data is passed in <em>client_data</em>. <h3 class=fn>Widget <a name="dialog"></a>QMotifDialog::dialog () const </h3> Returns the <a href="motif-extension.html#Motif">Motif</a> widget embedded in this dialog. <p>Example: <a href="motif-dialog-example.html#x2701">dialog/mainwindow.cpp</a>. <h3 class=fn>void <a name="rejectCallback"></a>QMotifDialog::rejectCallback ( Widget, XtPointer client_data, XtPointer )<tt> [static]</tt> </h3> Convenient Xt/Motif callback to reject the QMotifDialog. <p> The data is passed in <em>client_data</em>. <h3 class=fn>Widget <a name="shell"></a>QMotifDialog::shell () const </h3> Returns the Shell widget embedded in this dialog. <p>Example: <a href="motif-dialog-example.html#x2702">dialog/mainwindow.cpp</a>. <!-- eof --> <hr><p> This file is part of the <a href="index.html">Qt toolkit</a>. Copyright © 1995-2002 <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a> <td align=right><div align=right>Qt version 3.1.1</div> </table></div></address></body> </html>