]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/dialog.h
Use wxGetTranslation() instead of _() in the public headers.
[wxWidgets.git] / include / wx / os2 / dialog.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
40ff126a 2// Name: wx/os2/dialog.h
0e320a79 3// Purpose: wxDialog class
fb46a9a6 4// Author: David Webster
0e320a79 5// Modified by:
fb46a9a6 6// Created: 10/14/99
fb46a9a6 7// Copyright: (c) David Webster
65571936 8// Licence: wxWindows licence
0e320a79
DW
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_DIALOG_H_
12#define _WX_DIALOG_H_
13
0e320a79
DW
14#include "wx/panel.h"
15
53a2db12 16WXDLLIMPEXP_DATA_CORE(extern const char) wxDialogNameStr[];
0e320a79 17
b5dbe15d 18class WXDLLIMPEXP_FWD_CORE wxDialogModalData;
598dc9b7 19
d608dde1 20//
0e320a79 21// Dialog boxes
d608dde1 22//
53a2db12 23class WXDLLIMPEXP_CORE wxDialog: public wxDialogBase
0e320a79 24{
0e320a79 25public:
54da4255 26
d608dde1 27 inline wxDialog() { Init(); }
54da4255 28
86dc2301
SN
29 // full ctor
30 wxDialog(wxWindow *parent, wxWindowID id,
31 const wxString& title,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = wxDEFAULT_DIALOG_STYLE,
35 const wxString& name = wxDialogNameStr)
0e320a79 36 {
86dc2301 37 Init();
0e320a79 38
86dc2301 39 (void)Create(parent, id, title, pos, size, style, name);
0e320a79
DW
40 }
41
d608dde1
DW
42 bool Create( wxWindow* pParent
43 ,wxWindowID vId
44 ,const wxString& rsTitle
45 ,const wxPoint& rPos = wxDefaultPosition
46 ,const wxSize& rSize = wxDefaultSize
47 ,long lStyle = wxDEFAULT_DIALOG_STYLE
48 ,const wxString& rsName = wxDialogNameStr
54da4255 49 );
86dc2301 50 virtual ~wxDialog();
0e320a79 51
86dc2301
SN
52 // return true if we're showing the dialog modally
53 virtual bool IsModal() const { return m_modalData != NULL; }
fb46a9a6 54
86dc2301 55 // show the dialog modally and return the value passed to EndModal()
3011bf2b
DW
56 virtual int ShowModal();
57
58 // may be called to terminate the dialog with the given return code
59 virtual void EndModal(int retCode);
0e320a79 60
86dc2301 61 // implementation only from now on
d608dde1 62 // -------------------------------
0e320a79 63
86dc2301
SN
64 // override some base class virtuals
65 virtual bool Show(bool show = true);
3011bf2b 66
d608dde1
DW
67 //
68 // Callbacks
69 //
70 virtual MRESULT OS2WindowProc( WXUINT uMessage
71 ,WXWPARAM wParam
72 ,WXLPARAM lParam
73 );
40ff126a 74#if WXWIN_COMPATIBILITY_2_6
86dc2301
SN
75
76 // Constructor with a modal flag, but no window id - the old convention
77 wxDEPRECATED( wxDialog( wxWindow* pParent
78 ,const wxString& rsTitle
79 ,bool bModal
80 ,int nX = -1
81 ,int nY = -1
82 ,int nWidth = 500
83 ,int nHeight = 500
84 ,long lStyle = wxDEFAULT_DIALOG_STYLE
85 ,const wxString& rsName = wxDialogNameStr
86 ) );
87
88 // just call Show() or ShowModal()
89 wxDEPRECATED( void SetModal(bool bFlag) );
90
91 // use IsModal()
92 wxDEPRECATED( bool IsModalShowing() const );
3011bf2b 93
40ff126a
WS
94#endif // WXWIN_COMPATIBILITY_2_6
95
27476f73 96protected:
d608dde1
DW
97 //
98 // Common part of all ctors
99 //
3011bf2b 100 void Init(void);
27476f73
DW
101
102private:
d608dde1 103 wxWindow* m_pOldFocus;
86dc2301 104 bool m_endModalCalled; // allow for closing within InitDialog
27476f73 105
598dc9b7
SN
106 // this pointer is non-NULL only while the modal event loop is running
107 wxDialogModalData *m_modalData;
108
d608dde1
DW
109 //
110 // While we are showing a modal dialog we disable the other windows using
111 // this object
112 //
113 class wxWindowDisabler* m_pWindowDisabler;
27476f73 114
d608dde1 115 DECLARE_DYNAMIC_CLASS(wxDialog)
c0c133e1 116 wxDECLARE_NO_COPY_CLASS(wxDialog);
d608dde1
DW
117}; // end of CLASS wxDialog
118
119#endif // _WX_DIALOG_H_