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