#include <MathLine.h>
Inheritance diagram for mcMathLineHelpers:
Definition at line 148 of file MathLine.h.
Public Member Functions | |
mcMathLineHelpers () | |
Constructor of the structure. | |
virtual | ~mcMathLineHelpers () |
void | gui_Init () |
Inits the GUI variables of this class. | |
void | data_DeepCopy (const mcElementHelpers *mbl) |
Deep copy this object in the given pointer. | |
Double buffering functions | |
The functions which handle double buffering system for better GUI performances. | |
int | gui_UpdateBmp (int x, int y, long flags, const wxPoint &p) |
Updates the bitmap in the mcMathLineHelpers structure, calling the mcMathMng::gui_Draw function. | |
int | gui_DrawBmp (wxDC &dc, int x, int y) const |
Draws this line on the given DC using the bitmap. | |
void | gui_SetMask (const wxColour &) |
Sets the given colour as the mask which will be used when blitting the bitmap in the given DC in a gui_DrawBmp call. | |
int | gui_ForceBmpUpdate (int x, int y, long flags, const wxPoint &p) |
Forces the update of the internal bitmap used for double buffering. | |
bool | gui_NeedsRefresh () const |
Returns TRUE if with the last call to gui_UpdateBmp or gui_ForceBmpUpdate, a redraw is required to keep the output up to date. | |
void | gui_SetBmpBackgroundBrush (const wxBrush &br) |
Changes the brush used to clear the bitmap. | |
void | gui_ExpandBmp () |
Expands line's bitmap if it's too small. | |
bool | gui_isIDChanged () const |
Returns TRUE if the ID of the active element has changed between the last two calls to the gui_Draw() function of the math object. | |
int | gui_GetActiveElemID () const |
Returns the ID of the currently active element. | |
mcElement GUI overloaded functions | |
mcMathLine needs to modify some mcMathMng GUI behaviour to adjust coordinates and to keep bitmap's size right for this element. | |
mcElement | gui_GetSelection () const |
Returns the selected portion of this math data. | |
int | gui_GetRelCursorPos (wxDC &dc, wxPoint *) 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. | |
int | gui_MoveCursorUsingPoint (wxDC &, const wxPoint &) |
Moves the cursor inside this element in the closest available position to the given point. | |
void | gui_OnSelect (wxDC &dc, wxRect &) |
This function is called when the bounding box of this element intersects with the selection rectangle created by the user with the mouse cursor. | |
void | gui_DoRecalcSize () |
This is the most important overload of mcMathLine. | |
Static Public Attributes | |
static int | sgui_nCursorWidth = 2 |
The width of the cursor. | |
Protected Attributes | |
wxBitmap | mgui_bmpMath |
Last rendering of this line (without cursor, activation state, selection state). | |
wxBrush | mgui_brushBmpBg |
The brush used to clear the bitmap before each update. | |
bool | mgui_bUsingMask |
TRUE if we are using a mask when blitting the bitmap. | |
int | mgui_nLastID |
The ID of the active element before last redraw. | |
int | mgui_nCurrentID |
The ID of the current active element. |
|
Constructor of the structure. Automatically calls the mcMathMng::Init() function and automatically creates the bitmap used to hold the last rendering of the math obj. Definition at line 188 of file MathLine.h. References mcMathMngHelpers::data_Init(). |
|
Definition at line 189 of file MathLine.h. |
|
Deep copy this object in the given pointer.
Reimplemented from mcMathMngHelpers. Definition at line 101 of file MathLine.cpp. References mcMathMngHelpers::data_DeepCopy(), gui_ExpandBmp(), mgui_brushBmpBg, mgui_bUsingMask, mgui_nCurrentID, and mgui_nLastID. |
|
This is the most important overload of mcMathLine. This is the function infact, which calls gui_ExpandBmp() which is a very important thing to do to keep the double buffering system active. Reimplemented from mcMathMngHelpers. Definition at line 278 of file MathLine.cpp. References mcMathMngHelpers::gui_DoRecalcSize(), gui_ExpandBmp(), mcBMP_SPACELEFT, and mcBMP_SPACERIGHT. |
|
Draws this line on the given DC using the bitmap.
Implements mcDoubleBufferedElement. Definition at line 176 of file MathLine.cpp. References mcMathMngHelpers::gui_Draw(), mcElementHelpers::gui_GetHeight(), mcElementHelpers::gui_GetWidth(), mgui_bmpMath, mgui_bUsingMask, and mgui_nCurrentID. Referenced by mcMathLine::gui_DrawBmp(). |
|
Expands line's bitmap if it's too small. Use this function to expand the bitmap size at least to the math object size; if the given size is smaller than bmp size, nothing is done; if the bitmap size is updated, previous contents of the bitmap are lost. This function is automatically called when size changes. Definition at line 224 of file MathLine.cpp. References mcElementHelpers::gui_GetHeight(), mcElementHelpers::gui_GetWidth(), mcASSERT, mcBMP_ADDEDHEIGHT, mcBMP_ADDEDWIDTH, and mgui_bmpMath. Referenced by data_DeepCopy(), gui_DoRecalcSize(), and gui_Init(). |
|
Forces the update of the internal bitmap used for double buffering. All the parameters are the same of the gui_UpdateBmp function. Implements mcDoubleBufferedElement. Definition at line 226 of file MathLine.h. References gui_UpdateBmp(). Referenced by mcMathLine::gui_ForceBmpUpdate(). |
|
Returns the ID of the currently active element.
Definition at line 253 of file MathLine.h. References mgui_nCurrentID. Referenced by mcMathLine::gui_GetActiveElemID(). |
|
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 mcMathMngHelpers. Definition at line 212 of file MathLine.cpp. References mcElementHelpers::gui_GetHeight(), mcMathMngHelpers::gui_GetRelCursorPos(), and mcBMP_SPACELEFT. |
|
Returns the selected portion of this math data. The returned object maybe mcEmptyElement if nothing is selected in none of the two members. Reimplemented from mcMathMngHelpers. Definition at line 270 of file MathLine.cpp. |
|
Inits the GUI variables of this class.
Reimplemented from mcMathMngHelpers. Definition at line 124 of file MathLine.cpp. References gui_ExpandBmp(), mcMathMngHelpers::gui_Init(), mcBMP_SPACELEFT, mcBMP_SPACERIGHT, mcBMP_STDHEIGHT, mcBMP_STDWIDTH, mgui_bmpMath, mgui_brushBmpBg, mgui_bUsingMask, mgui_nCurrentID, and mgui_nLastID. |
|
Returns TRUE if the ID of the active element has changed between the last two calls to the gui_Draw() function of the math object.
Definition at line 248 of file MathLine.h. References mgui_nCurrentID, and mgui_nLastID. Referenced by mcMathLine::gui_isIDChanged(), and gui_NeedsRefresh(). |
|
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 mcMathMngHelpers. Definition at line 254 of file MathLine.cpp. References mcMathMngHelpers::gui_MoveCursorUsingPoint(), and mcBMP_SPACELEFT. |
|
Returns TRUE if with the last call to gui_UpdateBmp or gui_ForceBmpUpdate, a redraw is required to keep the output up to date.
Implements mcDoubleBufferedElement. Definition at line 229 of file MathLine.h. References gui_isIDChanged(). |
|
This function is called when the bounding box of this element intersects with the selection rectangle created by the user with the mouse cursor. The standard implementation just selects this element. If you are implementing a container element, you must override this function and check contained elements' bounding boxes and then call the gui_OnSelect() function of the contained elements whose bounding boxes intersect the given selection rectangle. Reimplemented from mcMathMngHelpers. Definition at line 262 of file MathLine.cpp. References mcMathMngHelpers::gui_OnSelect(), and mcBMP_SPACELEFT. |
|
Changes the brush used to clear the bitmap. No updates are done after the change since this could clear out the current active element. It's caller's duty to call the gui_ForceBmpUpdate function with the right parameters. Implements mcDoubleBufferedElement. Definition at line 236 of file MathLine.h. References mgui_brushBmpBg. |
|
Sets the given colour as the mask which will be used when blitting the bitmap in the given DC in a gui_DrawBmp call.
Implements mcDoubleBufferedElement. Definition at line 203 of file MathLine.cpp. References mgui_bmpMath, and mgui_bUsingMask. |
|
Updates the bitmap in the mcMathLineHelpers structure, calling the mcMathMng::gui_Draw function.
Implements mcDoubleBufferedElement. Definition at line 142 of file MathLine.cpp. References mcMathMngHelpers::gui_Draw(), mcBMP_SPACELEFT, mcDRW_ALLACTIVE, mcDRW_NONACTIVE, mcDRW_USEPOINT, mgui_bmpMath, mgui_brushBmpBg, mgui_nCurrentID, and mgui_nLastID. Referenced by gui_ForceBmpUpdate(), and mcMathLine::gui_UpdateBmp(). |
|
Last rendering of this line (without cursor, activation state, selection state). Cannot use wxImage because of the high number of conversions between wxImage and wxBitmap that would be necessary. Definition at line 163 of file MathLine.h. Referenced by gui_DrawBmp(), gui_ExpandBmp(), gui_Init(), gui_SetMask(), and gui_UpdateBmp(). |
|
The brush used to clear the bitmap before each update.
Definition at line 166 of file MathLine.h. Referenced by data_DeepCopy(), gui_Init(), gui_SetBmpBackgroundBrush(), and gui_UpdateBmp(). |
|
TRUE if we are using a mask when blitting the bitmap.
Definition at line 169 of file MathLine.h. Referenced by data_DeepCopy(), gui_DrawBmp(), gui_Init(), and gui_SetMask(). |
|
The ID of the current active element.
Definition at line 175 of file MathLine.h. Referenced by data_DeepCopy(), gui_DrawBmp(), gui_GetActiveElemID(), gui_Init(), gui_isIDChanged(), and gui_UpdateBmp(). |
|
The ID of the active element before last redraw.
Definition at line 172 of file MathLine.h. Referenced by data_DeepCopy(), gui_Init(), gui_isIDChanged(), and gui_UpdateBmp(). |
|
The width of the cursor. This variable is used only to set the width of the rectangle returned by the gui_GetCursorPos() function. Definition at line 53 of file MathLine.cpp. |
[ Top ] |