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

mgMathMenu Class Reference

#include <MathMenu.h>

Inheritance diagram for mgMathMenu:

mgMathBoxWndUser List of all members.

Detailed Description

Implements the menu and the menu handlers for default menus.

This class contains some functions used to add the default MathGUI menu items to a mathematical application. The class, derived from wxEvtHandler, implements also the default event handlers for the menu items. You are not required to use this class at all but, if you do not use it, you have to define menu items and menu event handlers yourself.

To use this class, you simply have to construct in your frame costructor a wxMenu object and then use the functions to add items in the menu. You can also add other menu items in the popup menu.

         wxMenuBar *menuBar = new wxMenuBar();
         mgMathMenu *standardMenu = new mgMathMenu( childWnd, this );
         wxMenu *edit = new wxMenu();
         standardMenu->AppendEditCommands( edit );
         menuBar->Append( edit, "Edit" );

You do not have to worry about handling events for the menu items appended by the mgMathMenu class because it is mgMathMenu's responsability to handle them.

In the constructor of mgMathMenu you have to pass two parameters:

If you want to handle yourself all command menu events simply pass a NULL pointer as the second parameter of the mgMathMenu constructor:

       mgMathMenu *standardMenu = new mgMathMenu( childWnd, NULL );

This prevents mgMathMenu to be set as the event handlers for the frame which pointer is passed as parameter to the ctor.

If you want to let mgMathMenu handle most of the standard menu command events but not all of them, derive a custom class from mgMathMenu and implement a EVENT_TABLE in which you declare only those events in which you are interested:

       class MyMathMenu : public mgMathMenu
       {
       public:
            MyMathMenu( mgMathBox* box, wxFrame* frame )
               : mgMathMenu( box, frame ) { ... }
      
            DECLARE_EVENT_TABLE()
       };

In the .cpp file define the events in which you are interested using the usual wxWindow's macros.

Definition at line 188 of file MathMenu.h.

Public Member Functions

 mgMathMenu (mgMathWnd *pwnd, mgMathBox *pbox=NULL, wxFrame *pframe=NULL, wxApp *app=NULL, wxLog *plogger=NULL)
 The constructor.
void SetPalettes (mgGreekPalette *p1=NULL, mgSpecialSymPalette *p2=NULL, mgSymbolPalette *p3=NULL)
void Attach (wxFrame *p)
void Detach ()
void SetHelpMainFile (const wxString &str)
 Sets the m_strHelpPath variable.
Event handlers
These functions handle the EVT_MENU generated by the menu items added through mgMathMenu::Append****Commands() functions for the frame given to the #Attach() function.

void OnFileExportAsXHTML (wxCommandEvent &event)
void OnFileExportAsImage (wxCommandEvent &event)
void OnFileImport (wxCommandEvent &event)
void OnEditCut (wxCommandEvent &event)
void OnEditCopy (wxCommandEvent &event)
void OnEditPaste (wxCommandEvent &event)
void OnEditNewBox (wxCommandEvent &event)
void OnEditNewTextBox (wxCommandEvent &event)
void OnEditNewBoxLikeLast (wxCommandEvent &event)
void OnEditDeleteBox (wxCommandEvent &event)
void OnEditNewMathLine (wxCommandEvent &event)
void OnEditNewMathLineLikeLast (wxCommandEvent &event)
void OnEditDeleteMathLine (wxCommandEvent &event)
void OnEditInsertSpecial (wxCommandEvent &event)
void OnEditInsertRadical (wxCommandEvent &event)
void OnEditInsertFraction (wxCommandEvent &event)
void OnEditInsertFunction (wxCommandEvent &event)
void OnEditEditExp (wxCommandEvent &event)
void OnEditEditSubscript (wxCommandEvent &event)
void OnEditOptions (wxCommandEvent &event)
void OnMathEvaluate (wxCommandEvent &event)
void OnMathMove (wxCommandEvent &event)
void OnMathExpand (wxCommandEvent &event)
void OnMathSimplify (wxCommandEvent &event)
void OnMathDivideBy (wxCommandEvent &event)
void OnMathMultiplyBy (wxCommandEvent &event)
void OnMathSolve (wxCommandEvent &event)
void OnViewPaletteGreekAlphabet (wxCommandEvent &event)
void OnViewPaletteSpecialSym (wxCommandEvent &event)
void OnViewPaletteSym (wxCommandEvent &event)
void OnHelpWishList (wxCommandEvent &event)
void OnHelpBugList (wxCommandEvent &event)
void OnHelpAbout (wxCommandEvent &event)
void OnHelpProjectPage (wxCommandEvent &event)
void OnHelpHomePage (wxCommandEvent &event)
void OnHelpMain (wxCommandEvent &event)

Static Public Member Functions

static void AppendFileCommands (wxMenu *file)
static void AppendEditCommands (wxMenu *edit, bool bUsingMathWnd=FALSE)
static void AppendMathCommands (wxMenu *math)
static void AppendViewCommands (wxMenu *view)
static void AppendHelpCommands (wxMenu *help)

Private Attributes

wxFrame * m_pFrame
 Optional frame.
wxApp * m_pTheApp
 Optional application object which will receive OptionsDlg notification events.
wxLog * m_pLogger
 Optional logger window.
wxPaletteFrame * m_pGreekAlphabet
 The wxPaletteFrames to show/hide.
wxPaletteFrame * m_pSpecialSym
 The wxPaletteFrames to show/hide.
wxPaletteFrame * m_pSym
 The wxPaletteFrames to show/hide.
wxString m_strHelpPath
 The HTML file which will be opened when the user choose the "MathStudio help" menu command.


Constructor & Destructor Documentation

mgMathMenu::mgMathMenu mgMathWnd pwnd,
mgMathBox pbox = NULL,
wxFrame *  pframe = NULL,
wxApp *  app = NULL,
wxLog *  plogger = NULL
 

The constructor.

Parameters:
pwnd The client mgMathWnd (choose this _or_ pbox)
pbox The client mgMathBox
pframe The frame window where the menu events are sent
app The application object
plogger The log window

Definition at line 122 of file MathMenu.cpp.


Member Function Documentation

void mgMathMenu::SetHelpMainFile const wxString &  str  ) 
 

Sets the m_strHelpPath variable.

Call this function only for a valid document which can be launched using the default system browser.

Definition at line 164 of file MathMenu.cpp.

References m_strHelpPath.


Member Data Documentation

wxApp* mgMathMenu::m_pTheApp [private]
 

Optional application object which will receive OptionsDlg notification events.

If NULL, event notification by the dialog is disabled.

Definition at line 197 of file MathMenu.h.


The documentation for this class was generated from the following files:

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

[ Top ]