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

mgMathWnd Class Reference

#include <MathWnd.h>

List of all members.


Detailed Description

A container window of text and mgMathBoxes.

Definition at line 52 of file MathWnd.h.

Public Member Functions

 mgMathWnd (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxPoint(0, 0))
 Constructor. Builds and initializes a mgMathWnd window.
virtual ~mgMathWnd ()
 Destructor. Destroys everything associated with this window.
void UpdateScrollRange ()
 Recalculates the scrollbars.
void Clean ()
 Deletes all the data from the window: data lines, bitmaps and everything else; then, adds a new empty line and selects it.
wxString GetDebug ()
 Returns a string with debug info about this window.
void SetStyleArray (mcStyleArray *)
 Changes the style used by all the boxes contained in this window.
bool Export (bool bXHTML, const wxString &filename, const wxString &title, bool bUpperTag=FALSE, bool bMathPlayerSupport=FALSE, bool bUseNS=FALSE, const wxString &ns=wxEmptyString, const wxString &href=wxEmptyString, int indentstep=2)
 Just choose a filename and a title for a new page, and this function will magically create a complete file containing all the mathematical data currently displayed in this window.
bool Export (bool bXHTML, wxOutputStream &stream, const wxString &title, bool bPreview, bool bUpperTag=FALSE, bool bMathPlayerSupport=FALSE, bool bUseNS=FALSE, const wxString &ns=wxEmptyString, const wxString &href=wxEmptyString, int indentstep=2)
wxString GetExportPreview (bool bXHTML, const wxString &title, bool bUpperTag=FALSE, bool bMathPlayerSupport=FALSE, bool bUseNS=FALSE, const wxString &ns=wxEmptyString, const wxString &href=wxEmptyString, int indentstep=2)
bool Import (int type, const wxString &filename, wxString *pDesc=NULL)
wxWindow's EVENT HANDLERS
Functions linked with wxWindow's events.

void OnSetFocus (wxFocusEvent &)
void OnFocusLost (wxFocusEvent &)
void OnTimer (wxTimerEvent &)
void OnPaint (wxPaintEvent &)
void OnLDown (wxMouseEvent &)
void OnRDown (wxMouseEvent &)
void OnLUp (wxMouseEvent &)
void OnRUp (wxMouseEvent &)
void OnMouseMove (wxMouseEvent &)
void OnCtxMenuItem (wxCommandEvent &)
void OnChar (wxKeyEvent &)
void OnSize (wxSizeEvent &)
void OnChildWindowChange (wxCommandEvent &)
 Responds to child window notification.
Box management functions
These are the functions used by mgMathWnd to handle the various boxes.

void SelectBox (int n)
 Selects the given line.
void SelectBoxByPoint (wxPoint &pt)
 Selects the line whose bounding box contains the given point.
void AddBox (bool bMath, bool bCopyLast)
 Adds one mgResizeableMathBox or a mgResizeableTextBox to this window.
void DeleteBox (int n)
 Remove the n-th bo linked to this window.
Inline GET functions
Fast functions to retrieve data; possibly use these also in the other mgMathBox functions.

int GetSelBoxId ()
int GetBoxCount ()
mgResizeableBoxGetBox (int n)
mgResizeableBoxGetSelBox ()

Private Attributes

wxMathBoxArray m_arrMathBox
 Array of mgMathBox classes.
wxSize m_szClient
 The virtual size of the client area.
int m_nSelBox
 The selected line inside the array.
int m_nActiveElemID
 The ID of the element currently under cursor.
wxMemoryDC m_hMemDC
 The memory DC used to blit bitmaps; at the end of each mgMathBox call, no bitmaps should be selected in this DC.
wxPoint m_ptOrigin
 The point where the user started the selection.
wxRect m_rcSelection
 The last selection rectangle.


Member Function Documentation

void mgMathWnd::AddBox bool  bMath,
bool  bCopyLast
 

Adds one mgResizeableMathBox or a mgResizeableTextBox to this window.

The function will create, select and, optionally, init the new box with the content of the previously selected box.

Parameters:
bMath If TRUE, a mgResizeableMathBox is added, otherwise a mgResizeableTextBox is added.
bCopyLast If TRUE, the previously selected line's contents will be copied in the new line.

Definition at line 335 of file MathWnd.cpp.

References mgResizeableBox::DeepCopy(), m_arrMathBox, and SelectBox().

Referenced by Clean().

bool mgMathWnd::Export bool  bXHTML,
const wxString &  filename,
const wxString &  title,
bool  bUpperTag = FALSE,
bool  bMathPlayerSupport = FALSE,
bool  bUseNS = FALSE,
const wxString &  ns = wxEmptyString,
const wxString &  href = wxEmptyString,
int  indentstep = 2
 

Just choose a filename and a title for a new page, and this function will magically create a complete file containing all the mathematical data currently displayed in this window.

Because of the lack of a MathML implementation on Internet Explorer, this function will also inform the user, if the program is running on a Win32 system, of the program he will need to view the file with IE. This function can export the data both as XHTML and as XML. The differences between the two files are just on the headers, but the XML file needs some external XSL files (the XML file that is created is linked with the XSL files of MathStudio 'XSL' subfolder with absolute path link).

Parameters:
type The type of the file to export; use EXPORTAS_XHTML or EXPORTAS_XML values.
filename The name of a new XHTML file that will be created.
title The title of the new XHTML file.
Returns:
TRUE if everything went okay. FALSE if something was wrong; if something was wrong, the function will also advise the user with a message box.

Definition at line 776 of file MathWnd.cpp.

void mgMathWnd::SelectBox int  n  ) 
 

Selects the given line.

Selected line is drawn with the MathStudio::m_pSelectionBrush as background; the selected line is the only line the user can modify. Only one line can be selected at each time.

Parameters:
n The line to select

Definition at line 315 of file MathWnd.cpp.

References m_nSelBox.

Referenced by AddBox().

void mgMathWnd::SelectBoxByPoint wxPoint &  pt  ) 
 

Selects the line whose bounding box contains the given point.

Parameters:
&pt The Given point must be expressed in scrolled window coord.


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 ]