#include <Bracket.h>
Inheritance diagram for mcBracketHelpers:
This is entirely defined & implemented through macros.
Definition at line 58 of file Bracket.h.
mcBracketGUI specific functions. | |
Some utilities + some overrides. | |
void | gui_DoRecalcBaseSize () |
Calculates (in the m_szBase variable) the size of the base only. | |
mcInputRes | gui_OnRemoveLeftBracket (mcElement *) |
mcInputRes | gui_OnRemoveRightBracket (mcElement *) |
static wxFont | gui_RebuildFont (const mcElementHelpers *elem, int h) |
Public Member Functions | |
virtual int | gui_GetSpaceAboveBelow () const |
The additional space added above and below the parentheses. | |
virtual int | gui_GetSpaceLeftRight () const |
mcBracketHelpers () | |
virtual | ~mcBracketHelpers () |
int | data_GetBracketDepth () const |
Returns a code which is used internally by mcBracket to auto-determine the 'bracket depth' of this instance, which is used to choose among normal, square and curly brackets. | |
wxString | data_GetBracketLeftSymbol (int n=-1) const |
wxString | data_GetBracketRightSymbol (int n=-1) const |
int | data_ChooseBracketType () const |
mcExpSimRes | math_RemoveExp () |
mcExpSimRes | math_ExpandContents (long flags, mcElement *newelem) |
mcExpSimRes | math_SimplifyContents (long flags, mcElement *newelem) |
mcBasicOpRes | math_MakeReciprocal (mcElement *) |
Calculates the reciprocal of this element; tipically, this function creates a mcFraction whose numerator is 1 and the denominator contains *this. | |
mcRealValue | math_GetBaseLenght () const |
int | math_GetOrderPos () const |
Returns the order position for this element. | |
bool | io_isBeginChar (const wxString &str) const |
Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise. | |
wxString | io_GetBaseInlinedExpr () const |
bool | io_ImportBaseInlinedExpr (const wxString &str, int *, wxString &) |
mcExpContainer and mcExpElement abstract functions. | |
Functions required by compiler to be present. | |
bool | gui_isBeginKey (const mcKey &ev) const |
Returns a positive value if the given character marks the begin of this element; FALSE otherwise. | |
mcInputRes | gui_BaseInput (const mcKey &key, mcElement *pnew) |
Works as mcExpContainer::gui_BaseInput but it have two other tasks: 1) to change, eventually, the type of brackets drawn by this function to reflect the input. | |
mcInputRes | gui_HandleContentInput (mcInputRes r, mcElement *) |
Handles the input result flag returned by the contained element. | |
int | gui_GetContentOffsetX () const |
int | gui_GetContentOffsetY () const |
bool | gui_isLeftPosEnabled () const |
bool | gui_isRightPosEnabled () const |
void | gui_DrawContainer (wxDC &dc, int x, int y, long flags, const wxPoint &pt) const |
Static Public Member Functions | |
static bool | gui_isLeftParenthesis (const wxChar c) |
Returns TRUE if the given character is a left parenthesis. | |
static bool | gui_isRightParenthesis (const wxChar c) |
Returns TRUE if the given character is a right parenthesis. | |
static bool | io_isBracketBeginChar (const wxString &str) |
Public Attributes | |
bool | mgui_bRemoveLeftBracket |
Is the LEFT or RIGHT bracket being removed ? | |
Static Public Attributes | |
static bool | sgui_bCreateBothSymbols = FALSE |
If TRUE, then, when the user types wxT('('), wxT('[') or '{', also the other symbol wxT(')'), wxT(']') or '}' is automatically created and the content is automatically set as empty. | |
static int | sgui_nSpaceAboveBelow = 0 |
static int | sgui_nSpaceLeftRight = 0 |
static wxString | sgui_strLeftParentheses = wxT("([{") |
static wxString | sgui_strRightParentheses = wxT(")]}") |
Protected Member Functions | |
wxString | io_GetMathMLPresentationTag () const |
Returns the name of the container TAG for this element. | |
Protected Attributes | |
wxFont | mgui_fLastFont |
Font used to draw the parentheses (it's updated each time the content changes its height). | |
wxSize | mgui_szBracket |
Size of the '(' bracket symbol. | |
Private Member Functions | |
mcDEFINE_REFERENCE_DATA (mcBracket, mcET_BRACKET) |
|
Definition at line 111 of file Bracket.h. References mcElementHelpers::data_Init(). |
|
|
|
Definition at line 103 of file Bracket.cpp. References mcElementArray::data_Get(), mcExpContainerHelpers::data_GetContent(), mcElementArray::data_GetCount(), mcElement::data_GetType(), mcBRACKET_SIMPLE_BRACKETS, mcET_BRACKET, and mcET_MONOMIAL. Referenced by data_GetBracketDepth(), data_GetBracketLeftSymbol(), data_GetBracketRightSymbol(), gui_BaseInput(), and io_GetBaseInlinedExpr(). |
|
Returns a code which is used internally by mcBracket to auto-determine the 'bracket depth' of this instance, which is used to choose among normal, square and curly brackets.
Definition at line 133 of file Bracket.h. References data_ChooseBracketType(). |
|
Definition at line 73 of file Bracket.cpp. References data_ChooseBracketType(), mcBRACKET_SIMPLE_BRACKETS, and mcBRACKET_SQUARE_BRACKETS. Referenced by gui_DoRecalcBaseSize(), gui_DrawContainer(), and io_GetBaseInlinedExpr(). |
|
Definition at line 88 of file Bracket.cpp. References data_ChooseBracketType(), mcBRACKET_SIMPLE_BRACKETS, and mcBRACKET_SQUARE_BRACKETS. Referenced by gui_DrawContainer(), and io_GetBaseInlinedExpr(). |
|
Works as mcExpContainer::gui_BaseInput but it have two other tasks: 1) to change, eventually, the type of brackets drawn by this function to reflect the input. 2) if bCreateBothSymbols == FALSE, to intercept the ')' keypresses. Reimplemented from mcExpContainerHelpers. Definition at line 224 of file Bracket.cpp. References data_ChooseBracketType(), mcExpContainerHelpers::gui_BaseInput(), gui_OnRemoveLeftBracket(), gui_OnRemoveRightBracket(), mcEXPCONTAINER_INSIDEEXPR, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, and sgui_bCreateBothSymbols. |
|
Calculates (in the m_szBase variable) the size of the base only. It's very important not to modify the m_sz variable: m_sz is handled by mcExpElement functions: the base must modify ONLY *m_szBase*. Implements mcExpElementHelpers. Definition at line 180 of file Bracket.cpp. References data_GetBracketLeftSymbol(), mcExpContainerHelpers::data_GetContent(), mcElement::gui_GetSize(), mcElementHelpers::gui_GetSizeOf(), gui_GetSpaceAboveBelow(), gui_GetSpaceLeftRight(), gui_RebuildFont(), mcASSERT, mgui_fLastFont, and mgui_szBracket. |
|
Implements mcExpContainerHelpers. Definition at line 203 of file Bracket.cpp. References data_GetBracketLeftSymbol(), data_GetBracketRightSymbol(), mcExpContainerHelpers::data_GetContent(), mcElement::gui_GetWidth(), mcElementHelpers::gui_SelectStyle(), mcUNUSED, mgui_fLastFont, and mgui_szBracket. |
|
Implements mcExpContainerHelpers. Definition at line 150 of file Bracket.cpp. References mgui_szBracket. |
|
Implements mcExpContainerHelpers. Definition at line 144 of file Bracket.cpp. References mcExpContainerHelpers::data_GetContent(), mcElement::gui_GetHeight(), and mgui_szBracket. |
|
The additional space added above and below the parentheses.
Reimplemented from mcExpContainerHelpers. Definition at line 75 of file Bracket.h. References sgui_nSpaceAboveBelow. Referenced by gui_DoRecalcBaseSize(). |
|
Reimplemented from mcExpContainerHelpers. Definition at line 76 of file Bracket.h. References sgui_nSpaceLeftRight. Referenced by gui_DoRecalcBaseSize(). |
|
Handles the input result flag returned by the contained element. The value which is returned by this function is also the value of the gui_BaseInput() function. Reimplemented from mcExpContainerHelpers. Definition at line 266 of file Bracket.cpp. References mcExpContainerHelpers::gui_HandleContentInput(), gui_OnRemoveLeftBracket(), gui_OnRemoveRightBracket(), mcIR_DELETE_NEXT, mcIR_DELETE_PREVIOUS, and sgui_bCreateBothSymbols. |
|
Returns a positive value if the given character marks the begin of this element; FALSE otherwise. The begin character cannot be dependent from any variable; it must be always the same. The character is given both as ASCII code and as virtual key code.
Implements mcElementHelpers. Definition at line 157 of file Bracket.h. References sgui_bCreateBothSymbols. |
|
Returns TRUE if the given character is a left parenthesis.
Definition at line 81 of file Bracket.h. References sgui_strLeftParentheses. |
|
Implements mcExpContainerHelpers. |
|
Returns TRUE if the given character is a right parenthesis.
Definition at line 86 of file Bracket.h. References sgui_strRightParentheses. |
|
Implements mcExpContainerHelpers. |
|
Definition at line 259 of file Bracket.cpp. References mcElementHelpers::mcElement, mcIR_DISTRIBUTE, and mgui_bRemoveLeftBracket. Referenced by gui_BaseInput(), and gui_HandleContentInput(). |
|
Definition at line 252 of file Bracket.cpp. References mcElementHelpers::mcElement, mcIR_DISTRIBUTE, and mgui_bRemoveLeftBracket. Referenced by gui_BaseInput(), and gui_HandleContentInput(). |
|
Definition at line 156 of file Bracket.cpp. References mcET_ADDOP, and sgui_nSpaceAboveBelow. Referenced by gui_DoRecalcBaseSize(), and mcParenthesisHelpers::gui_RebuildFont(). |
|
Implements mcExpElementHelpers. Definition at line 285 of file Bracket.cpp. References data_ChooseBracketType(), data_GetBracketLeftSymbol(), data_GetBracketRightSymbol(), mcExpContainerHelpers::data_GetContent(), and mcElement::io_GetInlinedExpr(). |
|
Returns the name of the container TAG for this element.
Reimplemented from mcExpContainerHelpers. |
|
Implements mcExpElementHelpers. Definition at line 297 of file Bracket.cpp. References mcExpContainerHelpers::data_GetContent(), mcElement::io_ImportInlinedExpr(), and mcASSERT. |
|
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. Implements mcElementHelpers. Definition at line 230 of file Bracket.h. References io_isBracketBeginChar(). |
|
Definition at line 234 of file Bracket.h. Referenced by io_isBeginChar(). |
|
Implements mcExpContainerHelpers. Definition at line 395 of file Bracket.cpp. References math_RemoveExp(), mcElementHelpers::mcElement, mcESR_DISTRIBUTE, mcESR_DONE, mcESR_INVALID_DATA, and mcESR_NOTFINISHED. |
|
Reimplemented from mcExpContainerHelpers. Definition at line 215 of file Bracket.h. References mcExpContainerHelpers::math_GetBaseLenght(). |
|
Returns the order position for this element.
Implements mcElementHelpers. |
|
Calculates the reciprocal of this element; tipically, this function creates a mcFraction whose numerator is 1 and the denominator contains *this. This should be the default behaviour. A simple multiplication of the current exponent by -1 should be avoided when possible.
Reimplemented from mcExpElementHelpers. Definition at line 408 of file Bracket.cpp. References mcExpContainerHelpers::data_GetContent(), mcFraction::data_SetDen(), and mcBOR_REMOVE_OPERAND. |
|
Definition at line 372 of file Bracket.cpp. References mcExpElementHelpers::data_DestroyExpSub(), mcExpContainerHelpers::data_GetContent(), mcExpElementHelpers::math_GetExp(), mcExpElementHelpers::math_hasExp(), mcElement::math_RaiseTo(), mcESR_DONE, mcESR_INVALID_DATA, mcESR_NOTFINISHED, mcMATHLOG, mcTXT, and mcTXTTHIS. Referenced by math_ExpandContents(), and math_SimplifyContents(). |
|
|
|
|
Is the LEFT or RIGHT bracket being removed ?
Definition at line 103 of file Bracket.h. Referenced by gui_OnRemoveLeftBracket(), and gui_OnRemoveRightBracket(). |
|
Font used to draw the parentheses (it's updated each time the content changes its height).
Definition at line 94 of file Bracket.h. Referenced by gui_DoRecalcBaseSize(), and gui_DrawContainer(). |
|
Size of the '(' bracket symbol. It is supposed to be equal to the size of the ')' character. Definition at line 98 of file Bracket.h. Referenced by gui_DoRecalcBaseSize(), gui_DrawContainer(), gui_GetContentOffsetX(), and gui_GetContentOffsetY(). |
|
If TRUE, then, when the user types wxT('('), wxT('[') or '{', also the other symbol wxT(')'), wxT(']') or '}' is automatically created and the content is automatically set as empty. If FALSE, then the contents of the bracket is automatically set as everything which follows the '(' symbol. Definition at line 59 of file Bracket.cpp. Referenced by gui_BaseInput(), gui_HandleContentInput(), and gui_isBeginKey(). |
|
Definition at line 58 of file Bracket.cpp. Referenced by gui_GetSpaceAboveBelow(), and gui_RebuildFont(). |
|
Definition at line 57 of file Bracket.cpp. Referenced by gui_GetSpaceLeftRight(). |
|
Definition at line 60 of file Bracket.cpp. Referenced by gui_isLeftParenthesis(). |
|
Definition at line 61 of file Bracket.cpp. Referenced by gui_isRightParenthesis(). |
[ Top ] |