]> git.saurik.com Git - wxWidgets.git/commitdiff
added public wxInfoMessageBox() (slightly modified patch 1828235)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Nov 2007 19:56:03 +0000 (19:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Nov 2007 19:56:03 +0000 (19:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/function.tex
include/wx/utils.h
samples/dialogs/dialogs.cpp
samples/dialogs/dialogs.h
src/common/utilscmn.cpp
src/common/wincmn.cpp

index f3e5b28410e9dcf27e455ece8907600274023675..f8c78e68aafd42c8662b3a14f7c0d92cf0aa7822 100644 (file)
@@ -169,6 +169,7 @@ the corresponding topic.
 \helpref{wxGetenv}{wxgetenvmacro}\\
 \helpref{wxHandleFatalExceptions}{wxhandlefatalexceptions}\\
 \helpref{wxICON}{wxiconmacro}\\
+\helpref{wxInfoMessageBox}{wxinfomessagebox}\\
 \helpref{wxINTXX\_SWAP\_ALWAYS}{intswapalways}\\
 \helpref{wxINTXX\_SWAP\_ON\_BE}{intswaponbe}\\
 \helpref{wxINTXX\_SWAP\_ON\_LE}{intswaponle}\\
@@ -2355,6 +2356,23 @@ and {\tt choices}, and the client data array must have the
 same length as the choices array.}
 
 
+\membersection{::wxInfoMessageBox}\label{wxinfomessagebox}
+
+\func{void}{wxInfoMessageBox}{\param{wxWindow (}{parent = \NULL}}
+
+Shows a message box with the information about the wxWidgets build used,
+including its version, most important build parameters and the version of the
+underlying GUI toolkit. This is mainly used for diagnostic purposes and can be
+invoked by Ctrl-Alt-middle clicking on any wxWindow which doesn't otherwise
+handle this event.
+
+\newsince{2.9.0}
+
+\wxheading{Include files}
+
+<wx/utils.h>
+
+
 \membersection{::wxIsBusy}\label{wxisbusy}
 
 \func{bool}{wxIsBusy}{\void}
index 6fe085107570640e3c0a652a80bc7e3b21615dde..7a7ec0d892186002f7a1f83d98f23eb965392524 100644 (file)
@@ -87,6 +87,11 @@ WXDLLIMPEXP_CORE void wxBell();
 WXDLLIMPEXP_BASE void wxBell();
 #endif
 
+#if wxUSE_MSGDLG
+// Show wxWidgets information
+WXDLLIMPEXP_CORE void wxInfoMessageBox(wxWindow* parent);
+#endif // wxUSE_MSGDLG
+
 // Get OS description as a user-readable string
 WXDLLIMPEXP_BASE wxString wxGetOsDescription();
 
index 6b837a6dfe6ac6a517a6ffa48f31f05bf63cb0e6..ad0fff1d4495ec7720d2ab84e15438acf3e55c47 100644 (file)
@@ -115,8 +115,10 @@ END_EVENT_TABLE()
 
 
 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+#if wxUSE_MSGDLG
     EVT_MENU(DIALOGS_MESSAGE_BOX,                   MyFrame::MessageBox)
-
+    EVT_MENU(DIALOGS_MESSAGE_BOX_WXINFO,            MyFrame::MessageBoxInfo)
+#endif // wxUSE_MSGDLG
 #if wxUSE_COLOURDLG
     EVT_MENU(DIALOGS_CHOOSE_COLOUR,                 MyFrame::ChooseColour)
     EVT_MENU(DIALOGS_GET_COLOUR,                    MyFrame::GetColour)
@@ -353,7 +355,11 @@ bool MyApp::OnInit()
 #endif // wxUSE_DIRDLG
 
 
-#if wxUSE_STARTUP_TIPS || wxUSE_PROGRESSDLG || wxUSE_BUSYINFO || wxUSE_LOG_DIALOG
+#if wxUSE_STARTUP_TIPS || \
+    wxUSE_PROGRESSDLG || \
+    wxUSE_BUSYINFO || \
+    wxUSE_LOG_DIALOG || \
+    wxUSE_MSGDLG
 
     wxMenu *info_menu = new wxMenu;
 
@@ -373,6 +379,11 @@ bool MyApp::OnInit()
        info_menu->Append(DIALOGS_LOG_DIALOG, _T("&Log dialog\tCtrl-L"));
     #endif // wxUSE_LOG_DIALOG
 
+    #if wxUSE_MSGDLG
+        info_menu->Append(DIALOGS_MESSAGE_BOX_WXINFO,
+                             _T("&wxWidgets information\tCtrl-I"));
+    #endif // wxUSE_MSGDLG
+
     menuDlg->Append(wxID_ANY,_T("&Informative dialogs"),info_menu);
 
 #endif // wxUSE_STARTUP_TIPS || wxUSE_PROGRESSDLG || wxUSE_BUSYINFO || wxUSE_LOG_DIALOG
@@ -611,6 +622,7 @@ void MyFrame::LogDialog(wxCommandEvent& WXUNUSED(event))
 }
 #endif // wxUSE_LOG_DIALOG
 
+#if wxUSE_MSGDLG
 void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
 {
     wxMessageDialog dialog(NULL,
@@ -646,8 +658,14 @@ void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
     }
 }
 
+void MyFrame::MessageBoxInfo(wxCommandEvent& WXUNUSED(event))
+{
+    ::wxInfoMessageBox(this);
+}
+#endif // wxUSE_MSGDLG
+
 #if wxUSE_NUMBERDLG
-void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event) )
+void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event))
 {
     long res = wxGetNumberFromUser( _T("This is some text, actually a lot of text.\n")
                                     _T("Even two rows of text."),
index b371fbd106c6d727fc04ae126f6d57b847567d07..9e46371a4e329b5bc34b874e5c468f185c23e4f7 100644 (file)
@@ -207,7 +207,10 @@ class MyFrame: public wxFrame
 public:
     MyFrame(wxWindow *parent, const wxString& title);
 
+#if wxUSE_MSGDLG
     void MessageBox(wxCommandEvent& event);
+    void MessageBoxInfo(wxCommandEvent& event);
+#endif // wxUSE_MSGDLG
 
 #if wxUSE_COLOURDLG
     void ChooseColour(wxCommandEvent& event);
@@ -347,6 +350,7 @@ enum
     DIALOGS_CHOOSE_FONT,
     DIALOGS_CHOOSE_FONT_GENERIC,
     DIALOGS_MESSAGE_BOX,
+    DIALOGS_MESSAGE_BOX_WXINFO,
     DIALOGS_SINGLE_CHOICE,
     DIALOGS_MULTI_CHOICE,
     DIALOGS_TEXT_ENTRY,
index 4ba9c856e1142eb39a8e8872c1689d6b8b8334a4..c65b29d48a7acc9566f23b3a097286e2aee46a20 100644 (file)
@@ -1365,6 +1365,43 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style,
     return wxCANCEL;
 }
 
+void wxInfoMessageBox(wxWindow* parent)
+{
+    // don't translate these strings, they're for diagnostics purposes only
+    wxString msg;
+    msg.Printf(_T("wxWidgets Library (%s port)\n")
+               _T("Version %d.%d.%d%s%s, compiled at %s %s\n")
+               _T("Runtime version of toolkit used is %d.%d.%s\n")
+               _T("Copyright (c) 1995-2007 wxWidgets team"),
+               wxPlatformInfo::Get().GetPortIdName().c_str(),
+               wxMAJOR_VERSION,
+               wxMINOR_VERSION,
+               wxRELEASE_NUMBER,
+#if wxUSE_UNICODE
+               L" (Unicode)",
+#else
+               wxEmptyString,
+#endif
+#ifdef __WXDEBUG__
+               _T(" Debug build"),
+#else
+               wxEmptyString,
+#endif
+               __TDATE__,
+               __TTIME__,
+               wxPlatformInfo::Get().GetToolkitMajorVersion(),
+               wxPlatformInfo::Get().GetToolkitMinorVersion(),
+#ifdef __WXGTK__
+               wxString::Format(_T("\nThe compile-time GTK+ version is %d.%d.%d."), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION).c_str()
+#else
+               wxEmptyString
+#endif
+               );
+    wxMessageBox(msg, _T("wxWidgets information"),
+                 wxICON_INFORMATION | wxOK,
+                 parent);
+}
+
 #endif // wxUSE_MSGDLG
 
 #if wxUSE_TEXTDLG
index 52ab77657c87ff6fba5162ad51a514235a746f70..c26cfb27c308973f0c35276b5b7caaec2d95aa15 100644 (file)
@@ -2357,43 +2357,7 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
             return;
         }
 #endif // __WXDEBUG__
-
-#if wxUSE_MSGDLG
-        // don't translate these strings, they're for diagnostics purposes only
-        wxString msg;
-        msg.Printf(_T("wxWidgets Library (%s port)\n")
-                   _T("Version %d.%d.%d%s%s, compiled at %s %s\n")
-                   _T("Runtime version of toolkit used is %d.%d.%s\n")
-                   _T("Copyright (c) 1995-2007 wxWidgets team"),
-                   wxPlatformInfo::Get().GetPortIdName().c_str(),
-                   wxMAJOR_VERSION,
-                   wxMINOR_VERSION,
-                   wxRELEASE_NUMBER,
-#if wxUSE_UNICODE
-                   L" (Unicode)",
-#else
-                   wxEmptyString,
-#endif
-#ifdef __WXDEBUG__
-                   _T(" Debug build"),
-#else
-                   wxEmptyString,
-#endif
-                   __TDATE__,
-                   __TTIME__,
-                   wxPlatformInfo::Get().GetToolkitMajorVersion(),
-                   wxPlatformInfo::Get().GetToolkitMinorVersion(),
-#ifdef __WXGTK__
-                   wxString::Format(_T("\nThe compile-time GTK+ version is %d.%d.%d."), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION).c_str()
-#else
-                   wxEmptyString
-#endif
-                   );
-
-        wxMessageBox(msg, _T("wxWidgets information"),
-                     wxICON_INFORMATION | wxOK,
-                     (wxWindow *)this);
-#endif // wxUSE_MSGDLG
+        ::wxInfoMessageBox((wxWindow*)this);
     }
     else
     {