]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/dialog.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialogBase class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DIALOG_H_BASE_
13 #define _WX_DIALOG_H_BASE_
18 class WXDLLEXPORT wxDialogBase
: public wxPanel
21 // the modal dialogs have a return code - usually the id of the last
23 void SetReturnCode(int returnCode
) { m_returnCode
= returnCode
; }
24 int GetReturnCode() const { return m_returnCode
; }
27 // functions to help with dialog layout
28 // ------------------------------------
30 // constants used in dialog layout
31 static const long LAYOUT_X_MARGIN
;
32 static const long LAYOUT_Y_MARGIN
;
33 static const long MARGIN_BETWEEN_BUTTONS
;
35 // Split the message in lines putting them into the array and calculating
36 // the maximum line width/height which is returned as wxSize.
37 wxSize
SplitTextMessage(const wxString
& message
, wxArrayString
*lines
);
39 // Creates the (possibly multiline) message, assuming each line has the
40 // size sizeText (which can be retrieved from SplitTextMessage). Returns
41 // the bottom border of the multiline text zone.
42 long CreateTextMessage(const wxArrayString
& lines
,
43 const wxPoint
& posText
,
44 const wxSize
& sizeText
);
46 // Returns the preferred size for the buttons in the dialog
47 wxSize
GetStandardButtonSize(bool hasCancel
= TRUE
);
49 // Create the standard [Ok] and [Cancel] (if hasCancel) buttons centering
50 // them with respect to the dialog width wDialog at vertical position y.
51 // wButton and hButton is the size of the button (which can be retrieved
52 // from GetStandardButtonSize)
53 void CreateStandardButtons(long wDialog
,
57 bool hasCancel
= TRUE
);
59 // Returns the standard height of single line text ctrl (it's not the same
60 // as the height of just text which may be retrieved from
62 long GetStandardTextHeight();
64 // the return code from modal dialog
68 #if defined(__WXMSW__)
69 #include "wx/msw/dialog.h"
70 #elif defined(__WXMOTIF__)
71 #include "wx/motif/dialog.h"
72 #elif defined(__WXGTK__)
73 #include "wx/gtk/dialog.h"
74 #elif defined(__WXQT__)
75 #include "wx/qt/dialog.h"
76 #elif defined(__WXMAC__)
77 #include "wx/mac/dialog.h"
78 #elif defined(__WXSTUBS__)
79 #include "wx/stubs/dialog.h"