]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/dialog.h
Revert "Make wxMSW stack walking methods work with Unicode identifiers."
[wxWidgets.git] / include / wx / msw / dialog.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/dialog.h
3 // Purpose: wxDialog class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_DIALOG_H_
12 #define _WX_DIALOG_H_
13
14 #include "wx/panel.h"
15
16 // this option is always enabled (there doesn't seem to be any good reason to
17 // disable it) for desktop Windows versions but Windows CE dialogs are usually
18 // not resizable and never show resize gripper anyhow so don't use it there
19 #ifdef __WXWINCE__
20 #define wxUSE_DIALOG_SIZEGRIP 0
21 #else
22 #define wxUSE_DIALOG_SIZEGRIP 1
23 #endif
24
25 extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr[];
26
27 class WXDLLIMPEXP_FWD_CORE wxDialogModalData;
28
29 #if wxUSE_TOOLBAR && (defined(__SMARTPHONE__) || defined(__POCKETPC__))
30 class WXDLLIMPEXP_FWD_CORE wxToolBar;
31 extern WXDLLIMPEXP_DATA_CORE(const char) wxToolBarNameStr[];
32 #endif
33
34 // Dialog boxes
35 class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
36 {
37 public:
38 wxDialog() { Init(); }
39
40 // full ctor
41 wxDialog(wxWindow *parent, wxWindowID id,
42 const wxString& title,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 long style = wxDEFAULT_DIALOG_STYLE,
46 const wxString& name = wxDialogNameStr)
47 {
48 Init();
49
50 (void)Create(parent, id, title, pos, size, style, name);
51 }
52
53 bool Create(wxWindow *parent, wxWindowID id,
54 const wxString& title,
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& size = wxDefaultSize,
57 long style = wxDEFAULT_DIALOG_STYLE,
58 const wxString& name = wxDialogNameStr);
59
60 virtual ~wxDialog();
61
62 // return true if we're showing the dialog modally
63 virtual bool IsModal() const { return m_modalData != NULL; }
64
65 // show the dialog modally and return the value passed to EndModal()
66 virtual int ShowModal();
67
68 // may be called to terminate the dialog with the given return code
69 virtual void EndModal(int retCode);
70
71
72 // we treat dialog toolbars specially under Windows CE
73 #if wxUSE_TOOLBAR && defined(__POCKETPC__)
74 // create main toolbar by calling OnCreateToolBar()
75 virtual wxToolBar* CreateToolBar(long style = -1,
76 wxWindowID winid = wxID_ANY,
77 const wxString& name = wxToolBarNameStr);
78 // return a new toolbar
79 virtual wxToolBar *OnCreateToolBar(long style,
80 wxWindowID winid,
81 const wxString& name );
82
83 // get the main toolbar
84 wxToolBar *GetToolBar() const { return m_dialogToolBar; }
85 #endif // wxUSE_TOOLBAR && __POCKETPC__
86
87
88 // implementation only from now on
89 // -------------------------------
90
91 // override some base class virtuals
92 virtual bool Show(bool show = true);
93
94 #if wxUSE_DIALOG_SIZEGRIP
95 virtual void SetWindowStyleFlag(long style);
96 #endif // wxUSE_DIALOG_SIZEGRIP
97
98 #ifdef __POCKETPC__
99 // Responds to the OK button in a PocketPC titlebar. This
100 // can be overridden, or you can change the id used for
101 // sending the event with SetAffirmativeId. Returns false
102 // if the event was not processed.
103 virtual bool DoOK();
104 #endif
105
106 // Windows callbacks
107 WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
108
109 protected:
110 // common part of all ctors
111 void Init();
112
113 private:
114 #if wxUSE_DIALOG_SIZEGRIP
115 // these functions deal with the gripper window shown in the corner of
116 // resizable dialogs
117 void CreateGripper();
118 void DestroyGripper();
119 void ShowGripper(bool show);
120 void ResizeGripper();
121
122 // this function is used to adjust Z-order of new children relative to the
123 // gripper if we have one
124 void OnWindowCreate(wxWindowCreateEvent& event);
125
126 // gripper window for a resizable dialog, NULL if we're not resizable
127 WXHWND m_hGripper;
128 #endif // wxUSE_DIALOG_SIZEGRIP
129
130 #if wxUSE_TOOLBAR && defined(__POCKETPC__)
131 wxToolBar* m_dialogToolBar;
132 #endif
133
134 // this pointer is non-NULL only while the modal event loop is running
135 wxDialogModalData *m_modalData;
136
137 DECLARE_DYNAMIC_CLASS(wxDialog)
138 wxDECLARE_NO_COPY_CLASS(wxDialog);
139 };
140
141 #endif
142 // _WX_DIALOG_H_