]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
e5b50758 | 2 | // Name: wx/msw/msgdlg.h |
2bda0e17 KB |
3 | // Purpose: wxMessageDialog class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
bbcdf8bc | 7 | // Copyright: (c) Julian Smart |
598ddd96 | 8 | // Licence: wxWindows licence |
2bda0e17 KB |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
bbcdf8bc JS |
11 | #ifndef _WX_MSGBOXDLG_H_ |
12 | #define _WX_MSGBOXDLG_H_ | |
2bda0e17 | 13 | |
ede7b017 | 14 | class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase |
2bda0e17 | 15 | { |
2bda0e17 | 16 | public: |
2afb9e16 VZ |
17 | wxMessageDialog(wxWindow *parent, |
18 | const wxString& message, | |
19 | const wxString& caption = wxMessageBoxCaptionStr, | |
20 | long style = wxOK|wxCENTRE, | |
21 | const wxPoint& WXUNUSED(pos) = wxDefaultPosition) | |
ede7b017 | 22 | : wxMessageDialogBase(parent, message, caption, style) |
2afb9e16 | 23 | { |
1d89da8a | 24 | m_hook = NULL; |
2afb9e16 VZ |
25 | } |
26 | ||
2afb9e16 | 27 | virtual int ShowModal(); |
22f3361e | 28 | |
67315c8b VZ |
29 | virtual long GetEffectiveIcon() const; |
30 | ||
4b02d42e VZ |
31 | // implementation-specific |
32 | ||
33 | // return the font used for the text in the message box | |
34 | static wxFont GetMessageFont(); | |
35 | ||
dd53b347 VZ |
36 | protected: |
37 | // Override this as task dialogs are always centered on parent. | |
38 | virtual void DoCentre(int dir); | |
39 | ||
1d89da8a | 40 | private: |
23e00c55 VZ |
41 | // hook procedure used to adjust the message box beyond what the standard |
42 | // MessageBox() function can do for us | |
1d89da8a VZ |
43 | static WXLRESULT wxCALLBACK HookFunction(int code, WXWPARAM, WXLPARAM); |
44 | ||
4b02d42e VZ |
45 | static const struct ButtonAccessors |
46 | { | |
47 | int id; | |
48 | wxString (wxMessageDialog::*getter)() const; | |
49 | } ms_buttons[]; | |
50 | ||
51 | // replace the static text control with a text control in order to show | |
52 | // scrollbar (and also, incidentally, allow text selection) | |
53 | void ReplaceStaticWithEdit(); | |
54 | ||
23e00c55 VZ |
55 | // adjust the button labels |
56 | // | |
57 | // this is called from HookFunction() and our HWND is valid at this moment | |
58 | void AdjustButtonLabels(); | |
59 | ||
4b02d42e VZ |
60 | // offset all buttons starting from the first one given by dx to the right |
61 | void OffsetButtonsStartingFrom(int first, int dx); | |
62 | ||
ede7b017 VZ |
63 | // used by ShowModal() to display a message box when task dialogs |
64 | // aren't available. | |
65 | int ShowMessageBox(); | |
66 | ||
23e00c55 | 67 | |
1d89da8a VZ |
68 | WXHANDLE m_hook; // HHOOK used to position the message box |
69 | ||
ede7b017 | 70 | wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMessageDialog); |
2bda0e17 KB |
71 | }; |
72 | ||
73 | ||
2afb9e16 | 74 | #endif // _WX_MSGBOXDLG_H_ |