]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/dialog.h
calling insert("") would provoke an assert - now it's just ignored
[wxWidgets.git] / include / wx / gtk / dialog.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dialog.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // Id:
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11
12 #ifndef __GTKDIALOGH__
13 #define __GTKDIALOGH__
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/object.h"
21 #include "wx/string.h"
22 #include "wx/event.h"
23 #include "wx/window.h"
24 #include "wx/icon.h"
25
26 //-----------------------------------------------------------------------------
27 // forward decls
28 //-----------------------------------------------------------------------------
29
30 class wxRadioBox;
31
32 //-----------------------------------------------------------------------------
33 // classes
34 //-----------------------------------------------------------------------------
35
36 class wxDialog;
37
38 //-----------------------------------------------------------------------------
39 // global data
40 //-----------------------------------------------------------------------------
41
42 extern const char *wxDialogNameStr;
43
44 //-----------------------------------------------------------------------------
45 // wxDialog
46 //-----------------------------------------------------------------------------
47
48 class wxDialog: public wxWindow
49 {
50 DECLARE_DYNAMIC_CLASS(wxDialog)
51
52 public:
53
54 wxDialog(void);
55 wxDialog( wxWindow *parent, wxWindowID id, const wxString &title,
56 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
57 long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
58 bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
59 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
60 long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
61 ~wxDialog(void);
62 void SetTitle(const wxString& title);
63 wxString GetTitle(void) const;
64 bool OnClose(void);
65 void OnApply( wxCommandEvent &event );
66 void OnCancel( wxCommandEvent &event );
67 void OnOK( wxCommandEvent &event );
68 void OnPaint(wxPaintEvent& event);
69 bool Destroy(void);
70 void OnCloseWindow(wxCloseEvent& event);
71 /*
72 void OnCharHook(wxKeyEvent& event);
73 */
74 virtual bool Show( bool show );
75 virtual int ShowModal(void);
76 virtual void EndModal(int retCode);
77 virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
78 void SetModal( bool modal );
79 virtual void InitDialog(void);
80 virtual void Centre( int direction = wxHORIZONTAL );
81
82 virtual void SetSizeHints( int minW, int minH, int maxW, int maxH, int incW = -1 );
83
84 virtual void SetIcon( const wxIcon &icon );
85 virtual void Iconize( bool WXUNUSED(iconize)) { }
86 virtual bool IsIconized(void) const { return FALSE; }
87 bool Iconized(void) const { return IsIconized(); }
88 virtual void Maximize(void) { }
89 virtual void Restore(void) { }
90
91 private:
92
93 friend wxWindow;
94 friend wxDC;
95 friend wxRadioBox;
96
97 bool m_modalShowing;
98 wxString m_title;
99 wxIcon m_icon;
100
101 virtual void ImplementSetPosition();
102
103 DECLARE_EVENT_TABLE()
104
105 };
106
107 #endif // __GTKDIALOGH__