]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/dialog.h
f5609682f5a95838a1b395d7a45e97134fc2026f
[wxWidgets.git] / include / wx / os2 / dialog.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dialog.h
3 // Purpose: wxDialog class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DIALOG_H_
13 #define _WX_DIALOG_H_
14
15 #ifdef __GNUG__
16 #pragma interface "dialog.h"
17 #endif
18
19 #include "wx/panel.h"
20
21 WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
22
23 // Dialog boxes
24 class WXDLLEXPORT wxDialog: public wxDialogBase
25 {
26 DECLARE_DYNAMIC_CLASS(wxDialog)
27 public:
28
29 wxDialog();
30
31 // Constructor with a modal flag, but no window id - the old convention
32 inline wxDialog( wxWindow* parent
33 ,const wxString& title
34 ,bool modal
35 ,int x = -1
36 ,int y = -1
37 ,int width = 500
38 ,int height = 500
39 ,long style = wxDEFAULT_DIALOG_STYLE
40 ,const wxString& name = wxDialogNameStr
41 )
42 {
43 long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
44 Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
45 }
46
47 // Constructor with no modal flag - the new convention.
48 inline wxDialog( wxWindow* parent
49 ,wxWindowID id
50 ,const wxString& title
51 ,const wxPoint& pos = wxDefaultPosition
52 ,const wxSize& size = wxDefaultSize
53 ,long style = wxDEFAULT_DIALOG_STYLE
54 ,const wxString& name = wxDialogNameStr
55 )
56 {
57 Create(parent, id, title, pos, size, style, name);
58 }
59
60 bool Create( wxWindow* parent
61 ,wxWindowID id
62 ,const wxString& title
63 , // bool modal = FALSE, // TODO make this a window style?
64 const wxPoint& pos = wxDefaultPosition
65 ,const wxSize& size = wxDefaultSize
66 ,long style = wxDEFAULT_DIALOG_STYLE
67 ,const wxString& name = wxDialogNameStr
68 );
69
70 ~wxDialog();
71
72 // ---------------------------------------------------------------------------
73 // Virtuals
74 // ---------------------------------------------------------------------------
75
76 virtual bool Destroy();
77 virtual bool IsIconized() const;
78 virtual void Centre(int direction = wxBOTH);
79 virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
80
81 virtual int ShowModal();
82 virtual void EndModal(int retCode);
83
84 void SetClientSize(int width, int height);
85 void GetPosition(int *x, int *y) const;
86 bool Show(bool show);
87 void Iconize(bool iconize);
88
89 void Fit();
90
91 void SetTitle(const wxString& title);
92 wxString GetTitle() const ;
93
94 void OnCharHook(wxKeyEvent& event);
95 void OnCloseWindow(wxCloseEvent& event);
96
97 void SetModal(bool flag);
98
99 // Standard buttons
100 void OnOK(wxCommandEvent& event);
101 void OnApply(wxCommandEvent& event);
102 void OnCancel(wxCommandEvent& event);
103
104 // Responds to colour changes
105 void OnSysColourChanged(wxSysColourChangedEvent& event);
106
107 DECLARE_EVENT_TABLE()
108 };
109
110 #endif
111 // _WX_DIALOG_H_