#include <Parenthesis.h>
Inheritance diagram for mcParenthesisHelpers:
This is entirely defined & implemented through macros.
Definition at line 59 of file Parenthesis.h.
Public Member Functions | |
mcParenthesisHelpers () | |
virtual | ~mcParenthesisHelpers () |
void | data_DeepCopy (const mcElementHelpers *p) |
Deep copies all the info contained in this class. | |
bool | data_isLeftBracket () const |
Returns the #m_bLeftBracket value. | |
wxString | data_GetSymbol () const |
Returns the wxT("(") symbol if m_bLeftBracket == TRUE, ")" otherwise. | |
void | data_SetAsLeftBracket () |
void | data_SetAsRightBracket () |
void | data_OnNeighborChange () |
Called by parent when neighbors change. | |
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. | |
bool | io_isBeginChar (const wxString &str) const |
Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise. | |
bool | io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr) |
Imports presentation MathML reading the contents of the given XML node (without modifying it). | |
bool | io_ImportInlinedExpr (const wxString &str, int *count, wxString &pErr) |
Imports an inlined expression. | |
wxString | io_GetInlinedExpr () |
mcElementGUI abstract functions. | |
Some of the functions which are provided by mcDecorationGUI must be overloaded... | |
bool | gui_isBeginKey (const mcKey &ev) const |
Always returns FALSE: decorations generally are created by the program itself... | |
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). | |
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. | |
Public Attributes | |
mcPolynomial | mdata_pTmpExp |
The exponent is temporary stored in a mcParenthesis if it is required to keep it somewhere before creating a mcBracket. | |
Protected Member Functions | |
bool | gui_SearchInMonomial (mcMonomial &m, int *h, bool left, int idx) |
int | gui_GetMaxHeightToNextBracket (bool left) |
void | gui_RebuildFont () |
Protected Attributes | |
bool | mdata_bLeftBracket |
If TRUE, this class represents a left parenthesis; otherwise it is a right one. | |
wxFont | mgui_fLastFont |
Font used to draw the parentheses (it's updated each time the content changes its height). | |
Private Member Functions | |
mcDEFINE_REFERENCE_DATA (mcParenthesis, mcET_PARENTHESIS) |
|
Definition at line 83 of file Parenthesis.h. References mcEP_NOTIFY_NEIGHBOR_CHANGE. |
|
Definition at line 89 of file Parenthesis.h. |
|
Deep copies all the info contained in this class. The mcElement implementation should be enough because all the element's data should be contained inside the associated mcElementData derived class. In fact, mcElementData does not provide a standard implementation of the DeepCopy() function. mcElement-derived classes, instead, should not contain any other variable, so this function should be enough.... Reimplemented from mcDecorationHelpers. Definition at line 105 of file Parenthesis.h. References mcDecorationHelpers::data_DeepCopy(), mcElement::data_DeepCopy(), mdata_bLeftBracket, and mdata_pTmpExp. |
|
Returns the wxT("(") symbol if m_bLeftBracket == TRUE, ")" otherwise. This function differs from mcParenthesis::gui_GetSymbol() because the latter can return also wxT("["), wxT("{") or wxT("]"), "}".... Definition at line 120 of file Parenthesis.h. Referenced by gui_DoRecalcSize(), and gui_Draw(). |
|
Returns the #m_bLeftBracket value.
Definition at line 113 of file Parenthesis.h. Referenced by gui_RebuildFont(), and gui_SearchInMonomial(). |
|
Called by parent when neighbors change. Override this function if you need to do something when neighbor elements change (remember to set up the flag mcEP_NOTIFY_NEIGHBOR_CHANGE in the constructor). Reimplemented from mcElementHelpers. Definition at line 65 of file Parenthesis.cpp. References gui_RebuildFont(). |
|
Definition at line 124 of file Parenthesis.h. |
|
Definition at line 125 of file Parenthesis.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 76 of file Parenthesis.cpp. References data_GetSymbol(), mcElementHelpers::gui_GetSizeOf(), and mgui_fLastFont. |
|
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 113 of file Parenthesis.cpp. References mcElementHelpers::data_GetID(), data_GetSymbol(), mcElement::data_GetType(), mcElementHelpers::gui_GetHeight(), mcElementHelpers::gui_GetWidth(), mcElementHelpers::gui_SelectStyle(), mcET_MONOMIAL, and mgui_fLastFont. |
|
Definition at line 209 of file Parenthesis.cpp. Referenced by gui_RebuildFont(). |
|
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 140 of file Parenthesis.cpp. References mcElementHelpers::data_AddProperty(), mcElementHelpers::data_hasProperty(), mcDecorationHelpers::gui_Input(), mcElementHelpers::gui_RecalcSize(), mcASSERT, mcEP_INITIALIZED, and mdata_bLeftBracket. |
|
Always returns FALSE: decorations generally are created by the program itself...
Reimplemented from mcDecorationHelpers. Definition at line 155 of file Parenthesis.h. |
|
Definition at line 89 of file Parenthesis.cpp. References data_isLeftBracket(), mcElementHelpers::gui_GetHeightOfChar(), gui_GetMaxHeightToNextBracket(), mcBracketHelpers::gui_RebuildFont(), mcElementHelpers::gui_RecalcSize(), mcMAX, and mgui_fLastFont. Referenced by data_OnNeighborChange(). |
|
Definition at line 256 of file Parenthesis.cpp. References data_isLeftBracket(), END_ARRAY_SCAN, mcET_PARENTHESIS, mcMAX, and START_ARRAY_SCAN. |
|
Definition at line 185 of file Parenthesis.h. |
|
Imports an inlined expression.
"Inlined expression" means a string containing an encoded representation of math data: 234^2*ax+6y/2=0 is an inlined expression. This is the form which is used to input and output math data by a lot of math programs. Compability with these programs is crucial. However, because of the nature of this representation, the algorithm which recognizes (through io_isBeginChar functions) the elements to create, needs to know the lenght of the token which encodes this element; this is accomplished with the
Reimplemented from mcDecorationHelpers. Definition at line 305 of file Parenthesis.cpp. References mcElementArray::data_DeleteAll(), mcExpElementHelpers::io_GetExpSubInlinedToken(), mcElement::io_ImportInlinedExpr(), mcASSERT, mdata_bLeftBracket, and mdata_pTmpExp. |
|
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 182 of file Parenthesis.h. |
|
Returns a positive value if the given inlined expression 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 291 of file Parenthesis.cpp. |
|
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 179 of file Parenthesis.h. |
|
|
|
If TRUE, this class represents a left parenthesis; otherwise it is a right one.
Definition at line 68 of file Parenthesis.h. Referenced by data_DeepCopy(), gui_Input(), and io_ImportInlinedExpr(). |
|
The exponent is temporary stored in a mcParenthesis if it is required to keep it somewhere before creating a mcBracket.
Definition at line 75 of file Parenthesis.h. Referenced by data_DeepCopy(), and io_ImportInlinedExpr(). |
|
Font used to draw the parentheses (it's updated each time the content changes its height).
Definition at line 140 of file Parenthesis.h. Referenced by gui_DoRecalcSize(), gui_Draw(), and gui_RebuildFont(). |
[ Top ] |