1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/msgdlg.h
3 // Purpose: wxMessageDialog class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSGBOXDLG_H_
12 #define _WX_MSGBOXDLG_H_
14 class WXDLLIMPEXP_CORE wxMessageDialog
: public wxMessageDialogBase
17 wxMessageDialog(wxWindow
*parent
,
18 const wxString
& message
,
19 const wxString
& caption
= wxMessageBoxCaptionStr
,
20 long style
= wxOK
|wxCENTRE
,
21 const wxPoint
& WXUNUSED(pos
) = wxDefaultPosition
)
22 : wxMessageDialogBase(parent
, message
, caption
, style
)
27 virtual int ShowModal();
29 virtual long GetEffectiveIcon() const;
31 // implementation-specific
33 // return the font used for the text in the message box
34 static wxFont
GetMessageFont();
37 // Override this as task dialogs are always centered on parent.
38 virtual void DoCentre(int dir
);
41 // hook procedure used to adjust the message box beyond what the standard
42 // MessageBox() function can do for us
43 static WXLRESULT wxCALLBACK
HookFunction(int code
, WXWPARAM
, WXLPARAM
);
45 static const struct ButtonAccessors
48 wxString (wxMessageDialog::*getter
)() const;
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();
55 // adjust the button labels
57 // this is called from HookFunction() and our HWND is valid at this moment
58 void AdjustButtonLabels();
60 // offset all buttons starting from the first one given by dx to the right
61 void OffsetButtonsStartingFrom(int first
, int dx
);
63 // used by ShowModal() to display a message box when task dialogs
68 WXHANDLE m_hook
; // HHOOK used to position the message box
70 wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMessageDialog
);
74 #endif // _WX_MSGBOXDLG_H_