Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

GUIUtils.h File Reference


Detailed Description

Defines some useful functions and defines.

Main groups of functions defined here are: error-handler functions, global windows access (status bar...), global configuration file access.

Definition in file GUIUtils.h.

#include <wx/wx.h>
#include "mg/Setup.h"

Go to the source code of this file.

Defines

#define mgSAFE_DELETE(x)   { if (x) delete x; x = NULL; }
 Deletes the given pointer and reset it.
#define mgSAFE_DELETE_ARRAY(x)   { if (x) delete [] x; x = NULL; }
 Like mcSAFE_DELETE() but uses the wxT("delete [] x") istruction.
#define mgSTILL_TO_IMPLEMENT()
#define mgEXPDLG_BASEID   11000
#define mgIMPDLG_BASEID   12000
#define mgGREEKDLG_BASEID   13000
#define mgSYMBOLDLG_BASEID   14000
#define mgSPECIALSYMDLG_BASEID   15000
#define mgSOLVEDLG_BASEID   16000
#define mgOPTIONSDLG_BASEID   17000
#define mgMATHMENU_BASEID   18000
#define mgMATHBOX_BASEID   19000
 Used to create some new IDs at run-time for the context menu; this value is used as the first ID of a sequence; in this way we're sure our IDs do not create conflicts with wxWidgets IDs.
#define mgMATHGUI_HIGHEST_ID   20000
 Applications using MathGUI, to avoid conflicts with MathGUI ids, should use the following, instead of wxID_HIGHEST...
#define mgMATHBOX_EVENTS_BASEID   wxEVT_USER_FIRST+100
#define mgOPTIONSDLG_EVENTS_BASEID   wxEVT_USER_FIRST+200
#define mgMATHGUI_GENERAL_EVENTS_BASEID   wxEVT_USER_FIRST+300
#define mgMATHGUI_HIGHEST_EVENTS_ID   wxEVT_USER_FIRST+1000
#define mgMATHGUI_GLOBAL_MSGWAIT   1000
 The time each message will remain printed on the status bar (in ms).
#define mgMATHGUI_GLOBAL_ERRORTMRID   256
 The ID of the global timer used by error.
#define mgLogDebug
#define mgLogEvent
#define mgLogBoxEvent

Enumerations

enum  MathCoreConfigPath { MATHCORE_BASE_CONFIGPATH = -1, MATHCORE_APPEARANCE_CONFIGPATH, MATHCORE_KEYBINDINGS_CONFIGPATH }

Functions

bool wxViewHTMLFile (const wxString &url)
 Opens the default browser with the given url.
wxString GetConfigPath (MathCoreConfigPath id=MATHCORE_BASE_CONFIGPATH, const wxString &toadd=wxEmptyString)
 Returns the path which MathCore functions should use to store all the customizable settings in the wxConfig object supplied to the wxCustomizeSystem::LoadCustom & SaveCustom function.


Define Documentation

#define mgSAFE_DELETE  )     { if (x) delete x; x = NULL; }
 

Deletes the given pointer and reset it.

This macro is wxT('safe') because it checks the argument before deleting it: if it's already NULL, nothing is done.

Parameters:
x The pointer to the object which must be deleted.

Definition at line 57 of file GUIUtils.h.

Referenced by mgOptKeyBindingsPanel::Cleanup(), mgMathGUI::Cleanup(), and mgOptKeyBindingsPanel::SetBinder().

 
#define mgSTILL_TO_IMPLEMENT  ) 
 

Value:

wxMessageBox(wxT("This feature still doesn't work... sorry."),    \
               wxT("Ops"), wxICON_INFORMATION | wxOK);

Definition at line 62 of file GUIUtils.h.


Function Documentation

wxString GetConfigPath MathCoreConfigPath  id = MATHCORE_BASE_CONFIGPATH,
const wxString &  toadd = wxEmptyString
 

Returns the path which MathCore functions should use to store all the customizable settings in the wxConfig object supplied to the wxCustomizeSystem::LoadCustom & SaveCustom function.

This function is not implemented in the MathCore library: it must be implemented by the client application. This function also works as an utility functions because it should check the two given arguments and, if not NULL, they should concatenate them with the constant string (it must NOT change during program execution) representing the group where MathCore will store all its subgroups & entries. The constant string MUST always end with a wxT('/'). It should also begin with a wxT('/'); that is, it should be an absolute path...

bool wxViewHTMLFile const wxString &  url  ) 
 

Opens the default browser with the given url.

Thanks to Julian Smart who put this code in the developer mailing list on the web.

Definition at line 59 of file GUIUtils.cpp.



Documentation generated with Doxygen on Sun Feb 6 17:19:27 2005
Visit MathStudio home page for more info

[ Top ]