Finished review/fixes of Math and Miscellaneous categories of functions and macros.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2008-03-23 18:24:32 +00:00
parent bddd07670f
commit 7fa7088e4c
17 changed files with 665 additions and 494 deletions

View File

@@ -206,16 +206,229 @@ bool wxUnsetEnv(const wxString& var);
/** @ingroup group_funcmacro_misc */
//@{
/**
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
Returns battery state as one of @c wxBATTERY_NORMAL_STATE,
@c wxBATTERY_LOW_STATE, @c wxBATTERY_CRITICAL_STATE,
@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();
/**
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();
/**
Under X only, returns the current display name.
@see wxSetDisplayName()
@header{wx/utils.h}
*/
wxString wxGetDisplayName();
/**
For normal keys, returns @true if the specified key is currently down.
For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns @true if
the key is toggled such that its LED indicator is lit. There is 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);
/**
Returns the mouse position in screen coordinates.
@header{wx/utils.h}
*/
wxPoint wxGetMousePosition();
/**
Returns the current state of the mouse. Returns a wxMouseState 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.
@header{wx/utils.h}
*/
wxMouseState wxGetMouseState();
/**
This function enables or disables all top level windows. It is used by
wxSafeYield().
@header{wx/utils.h}
*/
void wxEnableTopLevelWindows(bool enable = true);
/**
Find the deepest window at the given mouse position in screen coordinates,
returning the window if found, or @NULL if not.
@header{wx/utils.h}
*/
wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
/**
@deprecated Replaced by wxWindow::FindWindowByLabel().
Find a window by its label. Depending on the type of window, the label may
be a window title or panel item label. If @a parent is @NULL, the search
will start from all top-level 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);
/**
@deprecated Replaced by wxWindow::FindWindowByName().
Find a window by its name (as given in a window constructor or @e Create
function call). If @a parent is @NULL, the search will start from all
top-level frames and dialog boxes; if non-@NULL, the search will be limited
to the given window hierarchy. The search is recursive in both cases.
If no such named window is found, wxFindWindowByLabel() is called.
@header{wx/utils.h}
*/
wxWindow* wxFindWindowByName(const wxString& name, 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);
/**
@deprecated Ids generated by it can conflict with the Ids defined by the
user code, use @c wxID_ANY to assign ids which are guaranteed
to not conflict with the user-defined ids for the controls and
menu 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 wxNewId() do not clash with the
given @a id.
@header{wx/utils.h}
*/
void wxRegisterId(long id);
/**
Opens the @a url in user's default browser. If the @a flags parameter
contains @c wxBROWSER_NEW_WINDOW flag, a new window is opened for the URL
(currently this is only supported under Windows). The @a url may also be a
local file path (with or without the "file://" prefix), if it doesn't
correspond to an existing file and the URL has no scheme "http://" is
prepended to it by default.
Returns @true if the application was successfully launched.
@note For some configurations of the running user, the application which 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);
/**
Loads a user-defined Windows resource as a string. If the resource is
found, the function creates a new character array and copies the data into
it. A pointer to this data is returned. If unsuccessful, @NULL is returned.
The resource must be defined in the @c .rc file using the following syntax:
@code
myResource TEXT file.ext
@endcode
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");
/**
@deprecated Replaced by wxWindow::Close(). See the
@ref overview_windowdeletion "window deletion overview".
Tells the system to delete the specified object when all other events have
been processed. In some environments, it is 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.
@header{wx/utils.h}
*/
void wxPostDelete(wxObject* object);
/**
Under X only, sets the current display name. This is the X host and display
name such as "colonsay:0.0", and the function indicates which display
should be used for creating windows from this point on. Setting the display
within an application allows multiple displays to be used.
@see wxGetDisplayName()
@header{wx/utils.h}
*/
void wxSetDisplayName(const wxString& displayName);
/**
Strips any menu codes from @a str and returns the result.
By default, the functions strips both the mnemonics character (@c '&')
which is used to indicate a keyboard shortkey, and the accelerators, which
are used only in the menu items and are separated from the main text by the
@c \t (TAB) character. By using @a flags of @c wxStrip_Mnemonics or
@c wxStrip_Accel to strip only the former or the latter part, respectively.
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);
//@}
/**
This function returns the "user id" also known as "login name" under Unix
i.e. something like "jsmith". It uniquely identifies the current user (on
@@ -242,63 +455,6 @@ wxString wxGetUserId();
*/
bool wxGetUserId(char* buf, int sz);
/**
Returns battery state as one of @c wxBATTERY_NORMAL_STATE,
@c wxBATTERY_LOW_STATE, @c wxBATTERY_CRITICAL_STATE,
@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();
/**
@deprecated
This function is obsolete, please use wxWindow::FindWindowByName() instead.
Find a window by its name (as given in a window constructor or Create()
function call). If @a parent is @NULL, the search will start from all
top-level frames and dialog boxes; if non-@NULL, the search will be limited
to the given window hierarchy. The search is recursive in both cases. If
no such named window is found, wxFindWindowByLabel() is called.
@header{wx/utils.h}
*/
wxWindow* wxFindWindowByName(const wxString& name, wxWindow* parent = NULL);
/**
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
guaranteed to not conflict with the user-defined ids for the controls and menu
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);
/**
For normal keys, returns @true if the specified key is currently down.
For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns
@true if the key is toggled such that its LED indicator is lit. There is
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);
/**
Returns the string containing the description of the current platform in a
user-readable form. For example, this function may return strings like
@@ -338,57 +494,6 @@ void wxMilliSleep(unsigned long milliseconds);
*/
void wxMicroSleep(unsigned long microseconds);
/**
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);
/**
This function enables or disables all top level windows. It is used by
::wxSafeYield.
@header{wx/utils.h}
*/
void wxEnableTopLevelWindows(bool enable = true);
/**
Strips any menu codes from @a str and returns the result.
By default, the functions strips both the mnemonics character (@c '')
which is used to indicate a keyboard shortkey, and the accelerators, which are
used only in the menu items and are separated from the main text by the
@c \t (TAB) character. By using @a flags of
@c wxStrip_Mnemonics or @c wxStrip_Accel to strip only the former
or the latter part, respectively.
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);
/**
Open the @a url in user's default browser. If @a flags parameter contains
@c wxBROWSER_NEW_WINDOW flag, a new window is opened for the URL
(currently this is only supported under Windows). The @a url may also be a
local file path (with or without @c file:// prefix), if it doesn't
correspond to an existing file and the URL has no scheme @c http:// is
prepended to it by default.
Returns @true if the application was successfully launched.
Note that for some configurations of the running user, the application which
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);
/**
Executes a command in an interactive shell window. If no command is
specified, then just the shell is spawned.
@@ -419,60 +524,6 @@ wxOperatingSystemId wxGetOsVersion(int* major = NULL,
*/
wxString wxGetFullHostName();
/**
Tells the system to delete the specified object when
all other events have been processed. In some environments, it is
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);
/**
@b NB: This function is obsolete, please use
wxWindow::FindWindowByLabel instead.
Find a window by its label. Depending on the type of window, the label may be a
window title
or panel item label. If @a parent is @NULL, the search will start from all
top-level
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);
/**
Returns the mouse position in screen coordinates.
@header{wx/utils.h}
*/
wxPoint wxGetMousePosition();
/**
Loads a user-defined Windows resource as a string. If the resource is found,
the function creates
a new character array and copies the data into it. A pointer to this data is
returned. If unsuccessful, @NULL is returned.
The resource must be defined in the @c .rc file using the following syntax:
@code
myResource TEXT file.ext
@endcode
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");
/**
Returns the amount of free memory in bytes under environments which
support it, and -1 if not supported or failed to perform measurement.
@@ -499,13 +550,6 @@ wxString wxGetHostName();
bool wxGetHostName(char* buf, int sz);
//@}
/**
Under X only, returns the current display name. See also wxSetDisplayName().
@header{wx/utils.h}
*/
wxString wxGetDisplayName();
/**
Returns the home directory for the given user. If the @a user is empty
(default value), this function behaves like
@@ -702,16 +746,6 @@ unsigned long wxGetProcessId();
int wxKill(long pid, int sig = wxSIGTERM, wxKillError rc = NULL,
int flags = 0);
/**
Returns the current state of the mouse. Returns a wxMouseState
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.
@header{wx/utils.h}
*/
wxMouseState wxGetMouseState();
//@{
/**
Copies the user's email address into the supplied buffer, by
@@ -743,17 +777,3 @@ void wxSleep(int secs);
*/
bool wxIsPlatformLittleEndian();
/**
Under X only, sets the current display name. This is the X host and display
name such
as "colonsay:0.0", and the function indicates which display should be used for
creating
windows from this point on. Setting the display within an application allows
multiple
displays to be used.
See also wxGetDisplayName().
@header{wx/utils.h}
*/
void wxSetDisplayName(const wxString& displayName);