From: Bryan Petty Date: Tue, 18 Mar 2008 19:30:01 +0000 (+0000) Subject: Finished review of Dialogs category of functions and macros as well as choicdlg.h... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ba2874ff3038f096bcdc0db1b93b4e67a71c8d89 Finished review of Dialogs category of functions and macros as well as choicdlg.h (assigned to myself). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/interface/aboutdlg.h b/interface/aboutdlg.h index 5420dc3fc2..30d9777449 100644 --- a/interface/aboutdlg.h +++ b/interface/aboutdlg.h @@ -190,7 +190,7 @@ public: info.SetName(_("My Program")); info.SetVersion(_("1.2.3 Beta")); info.SetDescription(_("This program does something great.")); - info.SetCopyright(_T("(C) 2007 Me my@email.addre.ss")); + info.SetCopyright(_T("(C) 2007 Me ")); wxAboutBox(info); } @@ -199,6 +199,8 @@ public: Please see the @ref page_utils_samples_dialogs for more examples of using this function and wxAboutDialogInfo for the description of the information which can be shown in the about dialog. + + @header{wx/aboutdlg.h} */ void wxAboutBox(const wxAboutDialogInfo& info); @@ -214,6 +216,8 @@ void wxAboutBox(const wxAboutDialogInfo& info); customization. @see wxAboutDialogInfo + + @header{wx/aboutdlg.h} */ void wxGenericAboutBox(const wxAboutDialogInfo& info); diff --git a/interface/choicdlg.h b/interface/choicdlg.h index 969b77c2d8..9fdc3d1a15 100644 --- a/interface/choicdlg.h +++ b/interface/choicdlg.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: choicdlg.h -// Purpose: interface of wxMultiChoiceDialog +// Purpose: interface of wx[Multi|Single]ChoiceDialog // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -16,8 +16,7 @@ @library{wxbase} @category{cmndlg} - @see @ref overview_wxmultichoicedialogoverview "wxMultiChoiceDialog overview", - wxSingleChoiceDialog + @see @ref overview_cmndlg_multichoice, wxSingleChoiceDialog */ class wxMultiChoiceDialog : public wxDialog { @@ -25,7 +24,7 @@ public: //@{ /** Constructor taking an array of wxString choices. - + @param parent Parent window. @param message @@ -38,52 +37,21 @@ public: An array of strings, or a string list, containing the choices. @param style A dialog style (bitlist) containing flags chosen from standard - dialog styles and the following: - - - - - - - - wxOK - - - - + dialog style and the ones listed below. The default value is + equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | + wxCANCEL | wxCENTRE. + @param pos + Dialog position. Not Windows. + + @beginStyleTable + @style{wxOK}: Show an OK button. - - - - - - wxCANCEL - - - - + @style{wxCANCEL}: Show a Cancel button. - - - - - - wxCENTRE - - - - + @style{wxCENTRE}: Centre the message. Not Windows. - - - - - - The default value is equivalent to wxDEFAULT_DIALOG_STYLE | - wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE. - @param pos - Dialog position. Not Windows. - + @endStyleTable + @remarks Use ShowModal() to show the dialog. */ wxMultiChoiceDialog(wxWindow* parent, const wxString& message, @@ -122,23 +90,23 @@ public: @class wxSingleChoiceDialog @wxheader{choicdlg.h} - This class represents a dialog that shows a list of strings, and allows the - user to select one. Double-clicking on a list item is equivalent to + This class represents a dialog that shows a list of strings, and allows + the user to select one. Double-clicking on a list item is equivalent to single-clicking and then pressing OK. @library{wxbase} @category{cmndlg} - @see @ref overview_wxsinglechoicedialogoverview "wxSingleChoiceDialog - overview", wxMultiChoiceDialog + @see @ref overview_cmndlg_singlechoice, wxMultiChoiceDialog */ class wxSingleChoiceDialog : public wxDialog { public: //@{ /** - Constructor, taking an array of wxString choices and optional client data. - + Constructor, taking an array of wxString choices and optional client + data. + @param parent Parent window. @param message @@ -154,52 +122,21 @@ public: See GetSelectionClientData. @param style A dialog style (bitlist) containing flags chosen from standard - dialog styles and the following: - - - - - - - - wxOK - - - - + dialog styles and the ones listed below. The default value is + equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | + wxCANCEL | wxCENTRE. + @param pos + Dialog position. Not Windows. + + @beginStyleTable + @style{wxOK}: Show an OK button. - - - - - - wxCANCEL - - - - + @style{wxCANCEL}: Show a Cancel button. - - - - - - wxCENTRE - - - - + @style{wxCENTRE}: Centre the message. Not Windows. - - - - - - The default value is equivalent to wxDEFAULT_DIALOG_STYLE | - wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE. - @param pos - Dialog position. Not Windows. - + @endStyleTable + @remarks Use ShowModal() to show the dialog. */ wxSingleChoiceDialog(wxWindow* parent, const wxString& message, @@ -250,10 +187,14 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ //@{ + /** - As @b wxGetSingleChoice but returns the index representing the selected - string. If the user pressed cancel, -1 is returned. + Same as wxGetSingleChoice() but returns the index representing the + selected string. If the user pressed cancel, -1 is returned. + + @header{wx/choicdlg.h} */ int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, @@ -274,20 +215,27 @@ int wxGetSingleChoiceIndex(const wxString& message, bool centre = true, int width = 150, int height = 200); + //@} +/** @ingroup group_funcmacro_dialog */ //@{ + /** Pops up a dialog box containing a message, OK/Cancel buttons and a - single-selection listbox. The user may choose an item and press OK to return a - string or Cancel to return the empty string. Use - wxGetSingleChoiceIndex() if empty string is a - valid choice and if you want to be able to detect pressing Cancel reliably. - You may pass the list of strings to choose from either using @e choices + single-selection listbox. The user may choose an item and press OK to + return a string or Cancel to return the empty string. Use + wxGetSingleChoiceIndex() if empty string is a valid choice and if you want + to be able to detect pressing Cancel reliably. + + You may pass the list of strings to choose from either using @c choices which is an array of @a n strings for the listbox or by using a single - @a aChoices parameter of type wxArrayString. - If @a centre is @true, the message text (which may include new line + @c aChoices parameter of type wxArrayString. + + If @c centre is @true, the message text (which may include new line characters) is centred; if @false, the message is left-justified. + + @header{wx/choicdlg.h} */ wxString wxGetSingleChoice(const wxString& message, const wxString& caption, @@ -308,14 +256,19 @@ wxString wxGetSingleChoice(const wxString& message, bool centre = true, int width = 150, int height = 200); + //@} +/** @ingroup group_funcmacro_dialog */ //@{ + /** - As @b wxGetSingleChoice but takes an array of client data pointers - corresponding to the strings, and returns one of these pointers or @NULL if - Cancel was pressed. The @e client_data array must have the same number of - elements as @e choices or @e aChoices! + Same as wxGetSingleChoice but takes an array of client data pointers + corresponding to the strings, and returns one of these pointers or @NULL + if Cancel was pressed. The @c client_data array must have the same number + of elements as @c choices or @c aChoices! + + @header{wx/choicdlg.h} */ wxString wxGetSingleChoiceData(const wxString& message, const wxString& caption, @@ -338,20 +291,27 @@ wxString wxGetSingleChoiceData(const wxString& message, bool centre = true, int width = 150, int height = 200); + //@} +/** @ingroup group_funcmacro_dialog */ //@{ + /** Pops up a dialog box containing a message, OK/Cancel buttons and a multiple-selection listbox. The user may choose an arbitrary (including 0) number of items in the listbox whose indices will be returned in - @e selection array. The initial contents of this array will be used to + @c selections array. The initial contents of this array will be used to select the items when the dialog is shown. - You may pass the list of strings to choose from either using @e choices + + You may pass the list of strings to choose from either using @c choices which is an array of @a n strings for the listbox or by using a single - @a aChoices parameter of type wxArrayString. - If @a centre is @true, the message text (which may include new line + @c aChoices parameter of type wxArrayString. + + If @c centre is @true, the message text (which may include new line characters) is centred; if @false, the message is left-justified. + + @header{wx/choicdlg.h} */ size_t wxGetMultipleChoices(wxArrayInt& selections, const wxString& message, @@ -374,5 +334,6 @@ size_t wxGetMultipleChoices(wxArrayInt& selections, bool centre = true, int width = 150, int height = 200); + //@} diff --git a/interface/colordlg.h b/interface/colordlg.h index d4ee56f3d1..a679de0a8d 100644 --- a/interface/colordlg.h +++ b/interface/colordlg.h @@ -62,25 +62,31 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ +//@{ + /** - Shows the colour selection dialog and returns the colour selected by user or - invalid colour (use @ref wxColour::isok wxColour:IsOk to test whether a colour - is valid) if the dialog was cancelled. + Shows the colour selection dialog and returns the colour selected by user + or invalid colour (use wxColour::IsOk() to test whether a colour is valid) + if the dialog was cancelled. @param parent - The parent window for the colour selection dialog + The parent window for the colour selection dialog. @param colInit If given, this will be the colour initially selected in the dialog. @param caption If given, this will be used for the dialog caption. @param data - Optional object storing additional colour dialog settings, such - as custom colours. If none is provided the same settings as the last time - are - used. + Optional object storing additional colour dialog settings, such as + custom colours. If none is provided the same settings as the last time + are used. + + @header{wx/colordlg.h} */ wxColour wxGetColourFromUser(wxWindow* parent, const wxColour& colInit, const wxString& caption = wxEmptyString, wxColourData* data = NULL); +//@} + diff --git a/interface/dirdlg.h b/interface/dirdlg.h index c5e55a3a12..737c6ecc92 100644 --- a/interface/dirdlg.h +++ b/interface/dirdlg.h @@ -99,10 +99,14 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ +//@{ + /** - Pops up a directory selector dialog. The arguments have the same meaning as - those of wxDirDialog::wxDirDialog(). The message is displayed at the top, - and the default_path, if specified, is set as the initial selection. + Pops up a directory selector dialog. The arguments have the same meaning + as those of wxDirDialog::wxDirDialog(). The message is displayed at the + top, and the default_path, if specified, is set as the initial selection. + The application must check for an empty return value (if the user pressed Cancel). For example: @@ -110,9 +114,11 @@ public: const wxString& dir = wxDirSelector("Choose a folder"); if ( !dir.empty() ) { - ... + ... } @endcode + + @header{wx/dirdlg.h} */ wxString wxDirSelector(const wxString& message = wxDirSelectorPromptStr, const wxString& default_path = "", @@ -120,3 +126,5 @@ wxString wxDirSelector(const wxString& message = wxDirSelectorPromptStr, const wxPoint& pos = wxDefaultPosition, wxWindow* parent = NULL); +//@} + diff --git a/interface/filedlg.h b/interface/filedlg.h index 3432e5ff55..3c9fa30d9c 100644 --- a/interface/filedlg.h +++ b/interface/filedlg.h @@ -205,24 +205,29 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ +//@{ + /** Pops up a file selector box. In Windows, this is the common file selector - dialog. In X, this is a file selector box with the same functionality. - The path and filename are distinct elements of a full file pathname. - If path is empty, the current directory will be used. If filename is empty, - no default filename will be supplied. The wildcard determines what files - are displayed in the file selector, and file extension supplies a type - extension for the required filename. Flags may be a combination of wxFD_OPEN, - wxFD_SAVE, wxFD_OVERWRITE_PROMPT or wxFD_FILE_MUST_EXIST. Note that - wxFD_MULTIPLE - can only be used with wxFileDialog and not here as this - function only returns a single file name. + dialog. In X, this is a file selector box with the same functionality. The + path and filename are distinct elements of a full file pathname. If path + is empty, the current directory will be used. If filename is empty, no + default filename will be supplied. The wildcard determines what files are + displayed in the file selector, and file extension supplies a type + extension for the required filename. Flags may be a combination of + wxFD_OPEN, wxFD_SAVE, wxFD_OVERWRITE_PROMPT or wxFD_FILE_MUST_EXIST. + + @note wxFD_MULTIPLE can only be used with wxFileDialog and not here since + this function only returns a single file name. + Both the Unix and Windows versions implement a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed. - The wildcard may be a specification for multiple types of file - with a description for each, such as: + + The wildcard may be a specification for multiple types of file with a + description for each, such as: @code "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" @@ -240,6 +245,8 @@ public: } //else: cancelled by user @endcode + + @header{wx/filedlg.h} */ wxString wxFileSelector(const wxString& message, const wxString& default_path = "", @@ -251,3 +258,5 @@ wxString wxFileSelector(const wxString& message, int x = -1, int y = -1); +//@} + diff --git a/interface/fontdlg.h b/interface/fontdlg.h index ae936116cf..4a5ea24021 100644 --- a/interface/fontdlg.h +++ b/interface/fontdlg.h @@ -68,19 +68,26 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ +//@{ + /** Shows the font selection dialog and returns the font selected by user or - invalid font (use @ref wxFont::isok wxFont:IsOk to test whether a font - is valid) if the dialog was cancelled. + invalid font (use wxFont::IsOk() to test whether a font is valid) if the + dialog was cancelled. @param parent - The parent window for the font selection dialog + The parent window for the font selection dialog. @param fontInit If given, this will be the font initially selected in the dialog. @param caption If given, this will be used for the dialog caption. + + @header{wx/fontdlg.h} */ wxFont wxGetFontFromUser(wxWindow* parent, const wxFont& fontInit, const wxString& caption = wxEmptyString); +//@} + diff --git a/interface/msgdlg.h b/interface/msgdlg.h index 0e434b7a6c..038601ac14 100644 --- a/interface/msgdlg.h +++ b/interface/msgdlg.h @@ -33,128 +33,49 @@ public: @param style A dialog style (bitlist) containing flags chosen from the following: - - - - - - wxOK - - - Show an OK button. - - - - wxCANCEL - - - Show a Cancel button. - - - - wxYES_NO - - - Show Yes and No buttons. - - - - wxYES_DEFAULT - - - Used with wxYES_NO, makes Yes button the default - which is the default behaviour. - - - - wxNO_DEFAULT - - - Used with wxYES_NO, makes No button the default. - - - - wxICON_EXCLAMATION - - - Shows an exclamation mark icon. - - - - wxICON_HAND - - - Shows an error icon. - - - - wxICON_ERROR - - - Shows an error icon - the same as wxICON_HAND. - - - - wxICON_QUESTION - - - Shows a question mark icon. - - - - wxICON_INFORMATION - - - Shows an information (i) icon. - - - - wxSTAY_ON_TOP - - - The message box stays on top of all other window, even those of the other applications (Windows only). @param pos @@ -229,58 +150,46 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ +//@{ + /** - General purpose message dialog. @a style may be a bit list of the + General purpose message dialog. @c style may be a bit list of the following identifiers: - wxYES_NO - - Puts Yes and No buttons on the message box. May be combined with - wxCANCEL. - - wxCANCEL - - Puts a Cancel button on the message box. May only be combined with - wxYES_NO or wxOK. - - wxOK - - Puts an Ok button on the message box. May be combined with wxCANCEL. - - wxICON_EXCLAMATION - - Displays an exclamation mark symbol. - - wxICON_HAND - - Displays an error symbol. - - wxICON_ERROR - - Displays an error symbol - the same as wxICON_HAND. - - wxICON_QUESTION - - Displays a question mark symbol. - - wxICON_INFORMATION - - Displays an information symbol. - - The return value is one of: wxYES, wxNO, wxCANCEL, wxOK. - For example: + @beginStyleTable + @style{wxYES_NO}: + Puts Yes and No buttons on the message box. May be combined with + wxCANCEL. + @style{wxCANCEL}: + Puts a Cancel button on the message box. May only be combined with + wxYES_NO or wxOK. + @style{wxOK}: + Puts an Ok button on the message box. May be combined with wxCANCEL. + @style{wxICON_EXCLAMATION}: + Displays an exclamation mark symbol. + @style{wxICON_HAND}: + Displays an error symbol. + @style{wxICON_ERROR}: + Displays an error symbol - the same as wxICON_HAND. + @style{wxICON_QUESTION}: + Displays a question mark symbol. + @style{wxICON_INFORMATION}: + Displays an information symbol. + + The return value is one of: wxYES, wxNO, wxCANCEL, wxOK. For example: @code - ... - int answer = wxMessageBox("Quit program?", "Confirm", - wxYES_NO | wxCANCEL, main_frame); - if (answer == wxYES) - main_frame-Close(); - ... + int answer = wxMessageBox("Quit program?", "Confirm", + wxYES_NO | wxCANCEL, main_frame); + if (answer == wxYES) + main_frame->Close(); @endcode - @a message may contain newline characters, in which case the - message will be split into separate lines, to cater for large messages. + @a message may contain newline characters, in which case the message will + be split into separate lines, to cater for large messages. + + @header{wx/msgdlg.h} */ int wxMessageBox(const wxString& message, const wxString& caption = "Message", @@ -288,3 +197,5 @@ int wxMessageBox(const wxString& message, wxWindow* parent = NULL, int x = -1, int y = -1); +//@} + diff --git a/interface/numdlg.h b/interface/numdlg.h index 4729b7a7f1..904f67e2e8 100644 --- a/interface/numdlg.h +++ b/interface/numdlg.h @@ -6,15 +6,23 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +/** @ingroup group_funcmacro_dialog */ +//@{ + /** -Shows a dialog asking the user for numeric input. The dialogs title is set to -@e caption, it contains a (possibly) multiline @a message above the -single line @a prompt and the zone for entering the number. -The number entered must be in the range @e min..@a max (both of which -should be positive) and @a value is the initial value of it. If the user -enters an invalid value or cancels the dialog, the function will return -1. -Dialog is centered on its @a parent unless an explicit position is given in -@e pos. + Shows a dialog asking the user for numeric input. The dialogs title is set + to @c caption, it contains a (possibly) multiline @c message above the + single line @c prompt and the zone for entering the number. + + The number entered must be in the range @c min to @c max (both of which + should be positive) and @c value is the initial value of it. If the user + enters an invalid value or cancels the dialog, the function will return + -1. + + Dialog is centered on its @c parent unless an explicit position is given + in @c pos. + + @header{wx/numdlg.h} */ long wxGetNumberFromUser(const wxString& message, const wxString& prompt, @@ -25,4 +33,5 @@ long wxGetNumberFromUser(const wxString& message, wxWindow* parent = NULL, const wxPoint& pos = wxDefaultPosition); +//@} diff --git a/interface/textdlg.h b/interface/textdlg.h index ca65daaa8d..a3e620862b 100644 --- a/interface/textdlg.h +++ b/interface/textdlg.h @@ -96,12 +96,18 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ +//@{ + /** - Pop up a dialog box with title set to @e caption, @e message, and a - @e default_value. The user may type in text and press OK to return this text, - or press Cancel to return the empty string. - If @a centre is @true, the message text (which may include new line characters) - is centred; if @false, the message is left-justified. + Pop up a dialog box with title set to @e caption, @c message, and a + @c default_value. The user may type in text and press OK to return this + text, or press Cancel to return the empty string. + + If @c centre is @true, the message text (which may include new line + characters) is centred; if @false, the message is left-justified. + + @header{wx/textdlg.h} */ wxString wxGetTextFromUser(const wxString& message, const wxString& caption = "Input text", @@ -112,9 +118,11 @@ wxString wxGetTextFromUser(const wxString& message, bool centre = true); /** - Similar to wxGetTextFromUser() but the text entered - in the dialog is not shown on screen but replaced with stars. This is intended - to be used for entering passwords as the function name implies. + Similar to wxGetTextFromUser() but the text entered in the dialog is not + shown on screen but replaced with stars. This is intended to be used for + entering passwords as the function name implies. + + @header{wx/textdlg.h} */ wxString wxGetPasswordFromUser(const wxString& message, const wxString& caption = "Input text", @@ -124,3 +132,5 @@ wxString wxGetPasswordFromUser(const wxString& message, int y = wxDefaultCoord, bool centre = true); +//@} + diff --git a/interface/tipdlg.h b/interface/tipdlg.h index 6ac380066c..9e5ebd946c 100644 --- a/interface/tipdlg.h +++ b/interface/tipdlg.h @@ -69,18 +69,46 @@ public: // Global functions/macros // ============================================================================ +/** @ingroup group_funcmacro_dialog */ +//@{ + /** - This function creates a wxTipProvider which may be - used with wxShowTip(). + This function creates a wxTipProvider which may be used with wxShowTip(). @param filename - The name of the file containing the tips, one per line + The name of the file containing the tips, one per line. @param currentTip - The index of the first tip to show - normally this index - is remembered between the 2 program runs. + The index of the first tip to show. Normally this index is remembered + between the 2 program runs. + + @see @ref overview_tips - @see @ref overview_tipsoverview "Tips overview" + @header{wx/tipdlg.h} */ wxTipProvider* wxCreateFileTipProvider(const wxString& filename, size_t currentTip); +/** + This function shows a "startup tip" to the user. The return value is the + state of the "Show tips at startup" checkbox. + + @param parent + The parent window for the modal dialog. + @param tipProvider + An object which is used to get the text of the tips. It may be created + with the wxCreateFileTipProvider() function. + @param showAtStartup + Should be true if startup tips are shown, false otherwise. This is + used as the initial value for "Show tips at startup" checkbox which is + shown in the tips dialog. + + @see @ref overview_tips + + @header{wx/tipdlg.h} +*/ +bool wxShowTip(wxWindow *parent, + wxTipProvider *tipProvider, + bool showAtStartup = true); + +//@} + diff --git a/interface/utils.h b/interface/utils.h index 8a7f02988b..1baa42d72a 100644 --- a/interface/utils.h +++ b/interface/utils.h @@ -82,11 +82,75 @@ public: // Global functions/macros // ============================================================================ + +/** @ingroup group_funcmacro_dialog */ +//@{ + +/** + Changes the cursor to the given cursor for all windows in the application. + Use wxEndBusyCursor() to revert the cursor back to its previous state. + These two calls can be nested, and a counter ensures that only the outer + calls take effect. + + @see wxIsBusy(), wxBusyCursor + + @header{wx/utils.h} +*/ +void wxBeginBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR); + +/** + Changes the cursor back to the original cursor, for all windows in the + application. Use with wxBeginBusyCursor(). + + @see wxIsBusy(), wxBusyCursor + + @header{wx/utils.h} +*/ +void wxEndBusyCursor(); + +/** + Returns @true if between two wxBeginBusyCursor() and wxEndBusyCursor() + calls. + + @see wxBusyCursor. + + @header{wx/utils.h} +*/ +bool wxIsBusy(); + +/** + Ring the system bell. + + @note This function is categorized as a GUI one and so is not thread-safe. + + @header{wx/utils.h} +*/ +void wxBell(); + +/** + 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. + + @wxsince{2.9.0} + + @header{wx/utils.h} +*/ +void wxInfoMessageBox(wxWindow parent = NULL); + +//@} + + + /** Returns the type of power source as one of @c wxPOWER_SOCKET, @c wxPOWER_BATTERY or @c wxPOWER_UNKNOWN. @c wxPOWER_UNKNOWN is also the default on platforms where this feature is not implemented (currently everywhere but MS Windows). + + @header{wx/utils.h} */ wxPowerType wxGetPowerType(); @@ -103,6 +167,8 @@ wxPowerType wxGetPowerType(); if successful, @false otherwise. @see wxGetUserName() + + @header{wx/utils.h} */ wxString wxGetUserId(); bool wxGetUserId(char* buf, int sz); @@ -114,6 +180,8 @@ bool wxGetUserId(char* buf, int sz); Displays @a msg and exits. This writes to standard error under Unix, and pops up a message box under Windows. Used for fatal internal wxWidgets errors. See also wxError(). + + @header{wx/utils.h} */ void wxFatalError(const wxString& msg, const wxString& title = "wxWidgets Fatal Error"); @@ -124,6 +192,8 @@ void wxFatalError(const wxString& msg, @c wxBATTERY_SHUTDOWN_STATE or @c wxBATTERY_UNKNOWN_STATE. @c wxBATTERY_UNKNOWN_STATE is also the default on platforms where this feature is not implemented (currently everywhere but MS Windows). + + @header{wx/utils.h} */ wxBatteryState wxGetBatteryState(); @@ -137,18 +207,12 @@ wxBatteryState wxGetBatteryState(); window hierarchy. The search is recursive in both cases. If no such named window is found, @b wxFindWindowByLabel is called. + + @header{wx/utils.h} */ wxWindow* wxFindWindowByName(const wxString& name, wxWindow* parent = NULL); -/** - Changes the cursor back to the original cursor, for all windows in the - application. - Use with wxBeginBusyCursor(). - See also wxIsBusy(), wxBusyCursor. -*/ -void wxEndBusyCursor(); - /** This function is deprecated as the ids generated by it can conflict with the ids defined by the user code, use @c wxID_ANY to assign ids which are @@ -156,12 +220,16 @@ void wxEndBusyCursor(); items you create instead of using this function. Generates an integer identifier unique to this run of the program. + + @header{wx/utils.h} */ long wxNewId(); /** Ensures that ids subsequently generated by @b NewId do not clash with the given @b id. + + @header{wx/utils.h} */ void wxRegisterId(long id); @@ -178,6 +246,8 @@ void wxRegisterId(long id); each wxDebugMsg call. wxDebugMsg seems to be broken under WIN32s (at least for Watcom C++): preformat your messages and use OutputDebugString instead. + + @header{wx/utils.h} */ void wxDebugMsg(const wxString& fmt, ... ); @@ -188,6 +258,8 @@ void wxDebugMsg(const wxString& fmt, ... ); currently no way to test whether togglable keys are up or down. Even though there are virtual key codes defined for mouse buttons, they cannot be used with this function currently. + + @header{wx/utils.h} */ bool wxGetKeyState(wxKeyCode key); @@ -197,6 +269,8 @@ bool wxGetKeyState(wxKeyCode key); @c Windows NT Version 4.0 or @c Linux 2.2.2 i386. @see ::wxGetOsVersion + + @header{wx/utils.h} */ wxString wxGetOsDescription(); @@ -204,6 +278,8 @@ wxString wxGetOsDescription(); Return the (current) user's home directory. @see wxGetUserHome(), wxStandardPaths + + @header{wx/utils.h} */ wxString wxGetHomeDir(); @@ -211,6 +287,8 @@ wxString wxGetHomeDir(); Sleeps for the specified number of milliseconds. Notice that usage of this function is encouraged instead of calling usleep(3) directly because the standard usleep() function is not MT safe. + + @header{wx/utils.h} */ void wxMilliSleep(unsigned long milliseconds); @@ -219,22 +297,16 @@ void wxMilliSleep(unsigned long milliseconds); not, in fact, be available on all platforms (currently only Unix platforms with nanosleep(2) may provide it) in which case this is the same as wxMilliSleep()(@e microseconds/1000). + + @header{wx/utils.h} */ void wxMicroSleep(unsigned long microseconds); -/** - 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. - - @wxsince{2.9.0} -*/ -void wxInfoMessageBox(wxWindow ( parent = NULL); /** Find a menu item identifier associated with the given frame's menu bar. + + @header{wx/utils.h} */ int wxFindMenuItemId(wxFrame* frame, const wxString& menuString, const wxString& itemString); @@ -242,6 +314,8 @@ int wxFindMenuItemId(wxFrame* frame, const wxString& menuString, /** This function enables or disables all top level windows. It is used by ::wxSafeYield. + + @header{wx/utils.h} */ void wxEnableTopLevelWindows(bool enable = true); @@ -256,6 +330,8 @@ void wxEnableTopLevelWindows(bool enable = true); Notice that in most cases wxMenuItem::GetLabelFromText or wxControl::GetLabelText can be used instead. + + @header{wx/utils.h} */ wxString wxStripMenuCodes(const wxString& str, int flags = wxStrip_All); @@ -266,6 +342,8 @@ wxString wxStripMenuCodes(const wxString& str, Displays @a msg and continues. This writes to standard error under Unix, and pops up a message box under Windows. Used for internal wxWidgets errors. See also wxFatalError(). + + @header{wx/utils.h} */ void wxError(const wxString& msg, const wxString& title = "wxWidgets Internal Error"); @@ -282,6 +360,8 @@ void wxError(const wxString& msg, is launched to open the given URL may be URL-dependent (e.g. a browser may be used for local URLs while another one may be used for remote URLs). + + @header{wx/utils.h} */ bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0); @@ -289,6 +369,8 @@ bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0); Executes a command in an interactive shell window. If no command is specified, then just the shell is spawned. See also wxExecute(), @ref overview_sampleexec "Exec sample". + + @header{wx/utils.h} */ bool wxShell(const wxString& command = NULL); @@ -297,6 +379,8 @@ bool wxShell(const wxString& command = NULL); See wxPlatformInfo for more details about wxOperatingSystemId. @see ::wxGetOsDescription, wxPlatformInfo + + @header{wx/utils.h} */ wxOperatingSystemId wxGetOsVersion(int* major = NULL, int* minor = NULL); @@ -306,17 +390,10 @@ wxOperatingSystemId wxGetOsVersion(int* major = NULL, error. @see wxGetHostName() -*/ -wxString wxGetFullHostName(); -/** - Changes the cursor to the given cursor for all windows in the application. - Use wxEndBusyCursor() to revert the cursor back - to its previous state. These two calls can be nested, and a counter - ensures that only the outer calls take effect. - See also wxIsBusy(), wxBusyCursor. + @header{wx/utils.h} */ -void wxBeginBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR); +wxString wxGetFullHostName(); /** Tells the system to delete the specified object when @@ -324,6 +401,8 @@ void wxBeginBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR); necessary to use this instead of deleting a frame directly with the delete operator, because some GUIs will still send events to a deleted window. Now obsolete: use wxWindow::Close instead. + + @header{wx/utils.h} */ void wxPostDelete(wxObject* object); @@ -337,6 +416,8 @@ void wxPostDelete(wxObject* object); frames and dialog boxes; if non-@NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases. + + @header{wx/utils.h} */ wxWindow* wxFindWindowByLabel(const wxString& label, wxWindow* parent = NULL); @@ -344,6 +425,8 @@ wxWindow* wxFindWindowByLabel(const wxString& label, /** Returns the mouse position in screen coordinates. + + @header{wx/utils.h} */ wxPoint wxGetMousePosition(); @@ -360,6 +443,8 @@ wxPoint wxGetMousePosition(); where @c file.ext is a file that the resource compiler can find. This function is available under Windows only. + + @header{wx/utils.h} */ wxString wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = "TEXT"); @@ -376,6 +461,8 @@ wxMemorySize wxGetFreeMemory(); Note that under Win32 it may not return correct value for the variables set with wxSetEnv(), use wxGetEnv() function instead. + + @header{wx/utils.h} */ wxChar* wxGetEnv(const wxString& var); @@ -392,6 +479,8 @@ wxChar* wxGetEnv(const wxString& var); if successful, @false otherwise. @see wxGetFullHostName() + + @header{wx/utils.h} */ wxString wxGetHostName(); bool wxGetHostName(char* buf, int sz); @@ -402,19 +491,17 @@ bool wxGetHostName(char* buf, int sz); @a value may be @NULL if you just want to know if the variable exists and are not interested in its value. Returns @true if the variable exists, @false otherwise. + + @header{wx/utils.h} */ bool wxGetEnv(const wxString& var, wxString* value); /** Under X only, returns the current display name. See also wxSetDisplayName(). -*/ -wxString wxGetDisplayName(); -/** - Ring the system bell. - Note that this function is categorized as a GUI one and so is not thread-safe. + @header{wx/utils.h} */ -void wxBell(); +wxString wxGetDisplayName(); /** Returns the home directory for the given user. If the @a user is empty @@ -422,6 +509,8 @@ void wxBell(); wxGetHomeDir() i.e. returns the current user home directory. If the home directory couldn't be determined, an empty string is returned. + + @header{wx/utils.h} */ wxString wxGetUserHome(const wxString& user = ""); @@ -500,6 +589,8 @@ wxString wxGetUserHome(const wxString& user = ""); An optional pointer to wxProcess @see wxShell(), wxProcess, @ref overview_sampleexec "Exec sample". + + @header{wx/utils.h} */ long wxExecute(const wxString& command, int sync = wxEXEC_ASYNC, wxProcess* callback = NULL); @@ -517,6 +608,8 @@ wxPerl note: long wxExecute(const wxString& command, /** Returns a string representing the current date and time. + + @header{wx/utils.h} */ wxString wxNow(); @@ -531,12 +624,16 @@ wxString wxNow(); fact that there isn't always a standard way to do a reliable check on the OS architecture. + + @header{wx/utils.h} */ bool wxIsPlatform64Bit(); /** Returns the number uniquely identifying the current process in the system. If an error occurs, 0 is returned. + + @header{wx/utils.h} */ unsigned long wxGetProcessId(); @@ -590,6 +687,8 @@ unsigned long wxGetProcessId(); to wxExecute. @see wxProcess::Kill, wxProcess::Exists, @ref overview_sampleexec "Exec sample" + + @header{wx/utils.h} */ int wxKill(long pid, int sig = wxSIGTERM, wxKillError rc = NULL, int flags = 0); @@ -599,15 +698,10 @@ int wxKill(long pid, int sig = wxSIGTERM, wxKillError rc = NULL, instance that contains the current position of the mouse pointer in screen coordinates, as well as boolean values indicating the up/down status of the mouse buttons and the modifier keys. -*/ -wxMouseState wxGetMouseState(); -/** - Returns @true if between two wxBeginBusyCursor() and - wxEndBusyCursor() calls. - See also wxBusyCursor. + @header{wx/utils.h} */ -bool wxIsBusy(); +wxMouseState wxGetMouseState(); //@{ /** @@ -615,6 +709,8 @@ bool wxIsBusy(); concatenating the values returned by wxGetFullHostName() and wxGetUserId(). Returns @true if successful, @false otherwise. + + @header{wx/utils.h} */ wxString wxGetEmailAddress(); bool wxGetEmailAddress(char* buf, int sz); @@ -622,6 +718,8 @@ bool wxGetEmailAddress(char* buf, int sz); /** Sleeps for the specified number of seconds. + + @header{wx/utils.h} */ void wxSleep(int secs); @@ -631,6 +729,8 @@ void wxSleep(int secs); Returns @true on success. @see wxUnsetEnv() + + @header{wx/utils.h} */ bool wxSetEnv(const wxString& var, const wxString& value); @@ -640,6 +740,8 @@ bool wxSetEnv(const wxString& var, const wxString& value); The check is performed at run-time. @see @ref overview_byteordermacros "Byte order macros" + + @header{wx/utils.h} */ bool wxIsPlatformLittleEndian(); @@ -652,6 +754,8 @@ bool wxIsPlatformLittleEndian(); multiple displays to be used. See also wxGetDisplayName(). + + @header{wx/utils.h} */ void wxSetDisplayName(const wxString& displayName);