#include <EmptyBox.h>
Inheritance diagram for mcEmptyBoxHelpers:
This is entirely defined & implemented through macros.
Definition at line 53 of file EmptyBox.h.
Public Member Functions | |
mcDEFINE_REFERENCE_DATA (mcEmptyBox, mcET_EMPTYBOX) | |
mcEmptyBoxHelpers () | |
virtual | ~mcEmptyBoxHelpers () |
bool | io_isBeginTag (const wxXml2Node &tag) const |
Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise. | |
wxXml2Node | io_GetMathML (bool bGetPresentation) const |
Returns the MathML code for this element as presentation markup (http://www.w3.org/TR/MathML2/chapter3.html) or as content markup (http://www.w3.org/TR/MathML2/chapter4.html). | |
wxString | io_GetInlinedExpr () const |
Returns the inlined expression for this element as a wxString. | |
bool | io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr) |
Imports presentation MathML reading the contents of the given XML node (without modifying it). | |
mcDecoration overloaded functions | |
Implements the empty boxes' behaviours.
Even if the mcDecorationGUI class implements almost all mcElementGUI abstract functions, here we need to override some of them because they suppose two cursor positions for a decoration, while mcEmptyBox has one cursor position only... | |
bool | gui_isBeginKey (const mcKey &key) const |
Always returns FALSE: empty boxes should be created by mcPolynomials only. | |
bool | gui_isEndKey (const mcKey &key) const |
Always returns FALSE: mcEmptyBox::gui_Input function handles all the keypresses returning mcIR_DELETE_this-> Empty boxes infact, should always be replaced by a new class. | |
int | gui_Draw (wxDC &dc, int x, int y, long flags, const wxPoint &pt) const |
element must be drawn with mcElementHelpers::sgui_m_pActivationBrush background brush; if this pointer is equal to mcDRW_NONACTIVE, the function must simply draw everything with default transparent mode; if the pointer is not one of the previous values, the function must use the pointer to find the subelement where it lies. | |
mcInputRes | gui_Input (const mcKey &key, mcElement *pnew) |
This function is called when the cursor is inside the element and the user presses a key (which is not the element's end tag). | |
mcInsertRes | gui_Insert (const mcElement &, mcElement *) |
Inserts the given element at the right of the cursor position. | |
mcMoveCursorRes | gui_MoveCursor (mcMoveCursorFlag flag, long modifiers) |
This function is called to move the cursor which is inside the element, one 'step' left, right, up or down (when flag=mcMCF_LEFT/mcMCF_RIGHT/mcMCF_UP/mcMCF_DOWN). | |
int | gui_MoveCursorUsingPoint (wxDC &dc, const wxPoint &p) |
Moves the cursor inside this element in the closest available position to the given point. | |
int | gui_GetRelCursorPos (wxDC &dc, wxPoint *pt) const |
Returns the height of the cursor and the (x;y) position of the cursor (in the given pointer) relative to the top-left point of this element. | |
void | gui_DoRecalcSize () |
This function is called by mcElement and non-mcElement functions when the internal size variable must be updated due to a change in the structure of the element. | |
void | gui_SetCursorPos (const mcCursorPos &code) |
Sets the cursor position inside the element using Cursor Position flags. | |
void | gui_GetCursorPos (mcCursorPos &p) const |
Returns the cursor position as Cursor Position flag. | |
Static Public Member Functions | |
static wxString | io_GetInlinedExprTag () |
Returns the string used to export mcEmptyBoxes in inlined expressions. | |
Static Public Attributes | |
static float | sgui_fEmptyBoxCharWidth |
The width of an empty box in "character units". | |
static float | sgui_fEmptyBoxCharHeight = 0.8f |
See mcEmptyBox::gui_m_fEmptyBoxCharWidth. | |
static wxBrush * | sgui_pEmptyBoxBrush = NULL |
The brush used to draw the empty boxes. | |
static mcKey * | sgui_pNewEmptyBox = NULL |
The key to use to create this element. |
|
Definition at line 59 of file EmptyBox.h. |
|
Definition at line 60 of file EmptyBox.h. |
|
This function is called by mcElement and non-mcElement functions when the internal size variable must be updated due to a change in the structure of the element. This function should be as fast and accurate as possible and it must store the new size in the mgui_sz variable.
Implements mcElementHelpers. Definition at line 103 of file EmptyBox.cpp. References mcElementHelpers::gui_GetHeightOfChar(), mcElementHelpers::gui_GetWidthOfChar(), sgui_fEmptyBoxCharHeight, and sgui_fEmptyBoxCharWidth. |
|
element must be drawn with mcElementHelpers::sgui_m_pActivationBrush background brush; if this pointer is equal to mcDRW_NONACTIVE, the function must simply draw everything with default transparent mode; if the pointer is not one of the previous values, the function must use the pointer to find the subelement where it lies. Then, only the subelement's gui_Draw() function must be called with the initial pointer. The subelements must be called with mcDRW_ALLACTIVE flag only for special reasons.
Implements mcElementHelpers. Definition at line 194 of file EmptyBox.cpp. References mcElementHelpers::data_GetID(), mcElementHelpers::gui_GetHeight(), mcElementHelpers::gui_GetWidth(), mcDRW_ALLACTIVE, mcDRW_NOACTIVEELEM, mcDRW_USEPOINT, and sgui_pEmptyBoxBrush. |
|
Returns the cursor position as Cursor Position flag. It must return mcCP_BEGIN if cursor is at the leftmost point of the element, mcCP_END if the cursor is at the rightmost point of the element, mcCP_INSIDE otherwise. When this function is called the cursor is always inside the element. Reimplemented from mcDecorationHelpers. Definition at line 127 of file EmptyBox.h. References mcCP_BEGINEND. |
|
Returns the height of the cursor and the (x;y) position of the cursor (in the given pointer) relative to the top-left point of this element. The function must fill the wxPoint pointer using coordinates relative to the top-left point of its bounding rectangle. When this function is called, the cursor is always inside the element.
Reimplemented from mcDecorationHelpers. Definition at line 182 of file EmptyBox.cpp. References mcElementHelpers::gui_GetHeight(), and mcElementHelpers::gui_GetWidth(). |
|
This function is called when the cursor is inside the element and the user presses a key (which is not the element's end tag). The way the element should process the given character is dependent to the element type: a mcNumber will insert vk next to the cursor position if vk is a digit. If vk is not acceptable, the function should call the MathCore error-handler function, mcMathCore::Get()->SyntaxError. This function should return one of the values defined for mcInputRes: mcIR_OKAY, mcIR_DELETE_THIS, mcIR_DIRECT_DELETE, mcIR_DELETE_NEXT.
Reimplemented from mcDecorationHelpers. Definition at line 115 of file EmptyBox.cpp. References mcElementHelpers::data_AddProperty(), mcElementHelpers::data_hasProperty(), mcElementHelpers::data_NewElem(), mcMathCore::Get(), mcElement::gui_Input(), mcElementHelpers::gui_RecalcSize(), mcMathCore::m_pCancelKey, mcKey::MatchKey(), mcEP_INITIALIZED, mcET_INVALID, mcIR_DIRECT_DELETE, mcIR_OKAY, mcIR_REPLACE_THIS, and mcMathCore::SyntaxError(). |
|
Inserts the given element at the right of the cursor position.
Reimplemented from mcDecorationHelpers. Definition at line 155 of file EmptyBox.cpp. References mcINSR_REPLACE_THIS. |
|
Always returns FALSE: empty boxes should be created by mcPolynomials only.
Reimplemented from mcDecorationHelpers. Definition at line 107 of file EmptyBox.h. |
|
Always returns FALSE: mcEmptyBox::gui_Input function handles all the keypresses returning mcIR_DELETE_this-> Empty boxes infact, should always be replaced by a new class.
Reimplemented from mcDecorationHelpers. Definition at line 83 of file EmptyBox.cpp. References mcKey::GetKeyCode(), mcElementHelpers::gui_isKeyBeginKey(), mcET_ADDOP, mcET_PARENTHESIS, and mcET_SUBOP. |
|
This function is called to move the cursor which is inside the element, one 'step' left, right, up or down (when flag=mcMCF_LEFT/mcMCF_RIGHT/mcMCF_UP/mcMCF_DOWN). Elements which cannot move the cursor in the given direction, should call mcMathCore::Get()->SyntaxError() function. If the cursor must 'exit' the element (because its at the end, for example) the function must return mcMCR_SETFOCUS_PREVIOUS or mcMCR_SETFOCUS_NEXT. This function must always return the code mcMCR_SETFOCUS_* or mcMCR_OKAY. When this function is called, cursor is always inside the element.
Reimplemented from mcDecorationHelpers. Definition at line 162 of file EmptyBox.cpp. References mcMCF_DOWN, mcMCF_LEFT, mcMCF_RIGHT, mcMCF_UP, mcMCR_OKAY, mcMCR_SETFOCUS_ABOVE, mcMCR_SETFOCUS_BELOW, mcMCR_SETFOCUS_NEXT, and mcMCR_SETFOCUS_PREVIOUS. |
|
Moves the cursor inside this element in the closest available position to the given point. The function must use the given point to set its internal cursor-position variables (when this function is called, the given point is always inside the bounding rectangle of the element, but maybe the cursor is not).
Reimplemented from mcDecorationHelpers. Definition at line 174 of file EmptyBox.cpp. References mcMCR_OKAY. |
|
Sets the cursor position inside the element using Cursor Position flags. When it's called to set the cursor at the end of the base, code==mcCP_END and data_hasProperty(mcEP_HASEXPONENT) == FALSE, when it's called to set the cursor at the beginning of the base, code==mcCP_BEGIN. The function doesnt need to care for the third Cursor Position flag: mcCP_INSIDE, actually this function will never be called with this code. Reimplemented from mcDecorationHelpers. Definition at line 126 of file EmptyBox.h. |
|
Returns the inlined expression for this element as a wxString. "Inlined expression" means a math representation of the data in a single line: to allow such a restriction (everything must be on one text line), some standard conventions (and many brackets !!!) are used:
Reimplemented from mcDecorationHelpers. Definition at line 224 of file EmptyBox.cpp. References io_GetInlinedExprTag(). |
|
Returns the string used to export mcEmptyBoxes in inlined expressions. The string is always the same because empty boxes do not store any info inside them... so this function can be static. Definition at line 148 of file EmptyBox.h. Referenced by io_GetInlinedExpr(). |
|
Returns the MathML code for this element as presentation markup (http://www.w3.org/TR/MathML2/chapter3.html) or as content markup (http://www.w3.org/TR/MathML2/chapter4.html).
Reimplemented from mcDecorationHelpers. Definition at line 215 of file EmptyBox.cpp. References mcUNUSED. |
|
Imports presentation MathML reading the contents of the given XML node (without modifying it).
This function is called only if io_isBeginTag function returns a positive value for the name of parent tag of
Reimplemented from mcDecorationHelpers. Definition at line 230 of file EmptyBox.cpp. References mcASSERT. |
|
Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise. The begin tag cannot be dependent from any variable; it must be always the same.
Reimplemented from mcDecorationHelpers. Definition at line 139 of file EmptyBox.h. |
|
|
|
See mcEmptyBox::gui_m_fEmptyBoxCharWidth.
Definition at line 64 of file EmptyBox.cpp. Referenced by gui_DoRecalcSize(). |
|
Initial value: 2.0f To make this value work for all the styles, mcEmptyBoxGUI uses this value which is multiplied by GetCharWidth() to get the pixel width of an empty box; in this way empty boxes have the right size in each style. Definition at line 58 of file EmptyBox.cpp. Referenced by gui_DoRecalcSize(). |
|
The brush used to draw the empty boxes.
Definition at line 65 of file EmptyBox.cpp. Referenced by gui_Draw(). |
|
The key to use to create this element.
Definition at line 73 of file EmptyBox.cpp. |
[ Top ] |