An interface only base class for various types of data. More...
#include <mi32/migrid.h>
Public Member Functions | |
| MIGRIDCELLTYPE () | |
| virtual | ~MIGRIDCELLTYPE () |
| bool | GetDeleteWithGrid () const |
| void | SetDeleteWithGrid (bool state) |
| virtual void | v_Draw (int row, int col, MIGRIDCUSTOMDRAW &dd) |
| virtual void | v_OnDClicked (int col, int row, const LRECT2D &rect, const LPOINT2D &point, bool *pbProcessed, MIGRIDCTRL *pCtrl, UINT32 state) |
| virtual void | v_OnLClicked (int col, int row, bool bIsDown, const LRECT2D &rect, const LPOINT2D &point, bool *pbProcessed, MIGRIDCTRL *pCtrl, UINT32 state) |
| virtual void | v_OnRClicked (int col, int row, bool bIsDown, const LRECT2D &rect, const LPOINT2D &point, bool *pbProcessed, MIGRIDCTRL *pCtrl, UINT32 state) |
| virtual MIGRIDEDITHANDLE * | v_StartEdit (MIGRIDCTRL *pCtrl, int col, int row, const LRECT2D &rect, const LPOINT2D *point, const MIGRIDCELL &cell, int key=0) |
Static Public Member Functions | |
| static void | SetDefaultColors (MGD::PIXEL ShadowPixelLight, MGD::PIXEL ShadowPixelDark, MGD::PIXEL FocusRectPixel, MGD::PIXEL BackgroundPixel) |
Protected Member Functions | |
| void | DrawBorder (const MIGRIDCUSTOMDRAW &drawdata, MIGRIDCELL::BORDER border) |
| void | TrackButton (MIGRIDCTRL *pCtrl, int col, int row, const MIGRIDCELL &cell, const LRECT2D &rect, const LPOINT2D &point, bool bInitialState) |
| virtual void | v_DrawBackground (const MIGRIDCUSTOMDRAW &drawdata) |
| virtual void | v_DrawBorder (const MIGRIDCUSTOMDRAW &drawdata) |
| virtual void | v_DrawButton (const MIGRIDCUSTOMDRAW &drawdata, bool bPressed, bool bTracking=false) |
| virtual void | v_DrawText (const MIGRIDCUSTOMDRAW &drawdata, const MIUNICODE *str=0) |
| virtual void | v_OnButtonPress (MIGRIDCTRL *pCtrl, int col, int row, const MIGRIDCELL &cell, const LRECT2D &rect) |
Static Protected Attributes | |
| static MGD::PIXEL | s_BackgroundPixel |
| static MGD::PIXEL | s_FocusRectPixel |
| static MGD::PIXEL | s_ShadowPixelDark |
| static MGD::PIXEL | s_ShadowPixelLight |
An interface only base class for various types of data.
This could go into an migridp.h
| MIGRIDCELLTYPE::MIGRIDCELLTYPE | ( | ) | [inline] |
Constructor.
| virtual MIGRIDCELLTYPE::~MIGRIDCELLTYPE | ( | ) | [inline, virtual] |
Destructor.
| void MIGRIDCELLTYPE::DrawBorder | ( | const MIGRIDCUSTOMDRAW & | drawdata, | |
| MIGRIDCELL::BORDER | border | |||
| ) | [protected] |
It just draws whatever type of border you tell it to with the given rect.
This version is not overridable.
| bool MIGRIDCELLTYPE::GetDeleteWithGrid | ( | ) | const [inline] |
Get whether delete with grid value.
| static void MIGRIDCELLTYPE::SetDefaultColors | ( | MGD::PIXEL | ShadowPixelLight, | |
| MGD::PIXEL | ShadowPixelDark, | |||
| MGD::PIXEL | FocusRectPixel, | |||
| MGD::PIXEL | BackgroundPixel | |||
| ) | [inline, static] |
Called from MIGRIDCTRL::Create() giving us the default pixel values used by Motif.
| void MIGRIDCELLTYPE::SetDeleteWithGrid | ( | bool | state | ) | [inline] |
Set the delete with grid value.
| void MIGRIDCELLTYPE::TrackButton | ( | MIGRIDCTRL * | pCtrl, | |
| int | col, | |||
| int | row, | |||
| const MIGRIDCELL & | cell, | |||
| const LRECT2D & | rect, | |||
| const LPOINT2D & | point, | |||
| bool | bInitialState | |||
| ) | [protected] |
Track the button.
| virtual void MIGRIDCELLTYPE::v_Draw | ( | int | row, | |
| int | col, | |||
| MIGRIDCUSTOMDRAW & | dd | |||
| ) | [virtual] |
Default method just draws an empty cell with background and borders.
| virtual void MIGRIDCELLTYPE::v_DrawBackground | ( | const MIGRIDCUSTOMDRAW & | drawdata | ) | [protected, virtual] |
Default method just draws background normally derived class could override this necessary.
| virtual void MIGRIDCELLTYPE::v_DrawBorder | ( | const MIGRIDCUSTOMDRAW & | drawdata | ) | [protected, virtual] |
Default method just draws border normally derived class could override this necessary.
| virtual void MIGRIDCELLTYPE::v_DrawButton | ( | const MIGRIDCUSTOMDRAW & | drawdata, | |
| bool | bPressed, | |||
| bool | bTracking = false | |||
| ) | [protected, virtual] |
Draws an empty button which can be tracked via TrackButton.
Default method just draws button border with nothing in it.
| bTracking | True only between mouse down and mouse up |
| virtual void MIGRIDCELLTYPE::v_DrawText | ( | const MIGRIDCUSTOMDRAW & | drawdata, | |
| const MIUNICODE * | str = 0 | |||
| ) | [protected, virtual] |
Default method just draws text normally.
derived class could override this if necessary. If the str parameter is left NULL (the default), it will get the text from the cell in the drawdata. If not null, it overrides the cell text
| virtual void MIGRIDCELLTYPE::v_OnButtonPress | ( | MIGRIDCTRL * | pCtrl, | |
| int | col, | |||
| int | row, | |||
| const MIGRIDCELL & | cell, | |||
| const LRECT2D & | rect | |||
| ) | [protected, virtual] |
Called by TrackButton when the button is actually pressed.
Default method calls pCtrl->StartEdit(col, row, 0).
| virtual void MIGRIDCELLTYPE::v_OnDClicked | ( | int | col, | |
| int | row, | |||
| const LRECT2D & | rect, | |||
| const LPOINT2D & | point, | |||
| bool * | pbProcessed, | |||
| MIGRIDCTRL * | pCtrl, | |||
| UINT32 | state | |||
| ) | [virtual] |
Method called when a cell is double clicked on.
It's important to set *pbProcessed = true if you actually handle the double click. If you don't it will be treated as just another left click (and call OnLClicked()) Default method does nothing.
| state | ShiftMask, CtrlMask, etc from the XEvent |
| virtual void MIGRIDCELLTYPE::v_OnLClicked | ( | int | col, | |
| int | row, | |||
| bool | bIsDown, | |||
| const LRECT2D & | rect, | |||
| const LPOINT2D & | point, | |||
| bool * | pbProcessed, | |||
| MIGRIDCTRL * | pCtrl, | |||
| UINT32 | state | |||
| ) | [virtual] |
Default method does nothing.
| point | Point relative to rect | |
| state | ShiftMask, CtrlMask, etc from the XEvent |
| virtual void MIGRIDCELLTYPE::v_OnRClicked | ( | int | col, | |
| int | row, | |||
| bool | bIsDown, | |||
| const LRECT2D & | rect, | |||
| const LPOINT2D & | point, | |||
| bool * | pbProcessed, | |||
| MIGRIDCTRL * | pCtrl, | |||
| UINT32 | state | |||
| ) | [virtual] |
Default method does nothing.
| state | ShiftMask, CtrlMask, etc from the XEvent |
| virtual MIGRIDEDITHANDLE* MIGRIDCELLTYPE::v_StartEdit | ( | MIGRIDCTRL * | pCtrl, | |
| int | col, | |||
| int | row, | |||
| const LRECT2D & | rect, | |||
| const LPOINT2D * | point, | |||
| const MIGRIDCELL & | cell, | |||
| int | key = 0 | |||
| ) | [virtual] |
Function to call to start editing.
To cancel the edit, delete the handle. Default method just returns NULL and doesn't allow editing.
| point | Click point within cell (NULL if not starting via click) |
MGD::PIXEL MIGRIDCELLTYPE::s_BackgroundPixel [static, protected] |
MGD::PIXEL MIGRIDCELLTYPE::s_FocusRectPixel [static, protected] |
MGD::PIXEL MIGRIDCELLTYPE::s_ShadowPixelDark [static, protected] |
MGD::PIXEL MIGRIDCELLTYPE::s_ShadowPixelLight [static, protected] |
Default pixel values to be used if cell being drawn has no color specified These are set via a static method called from MIGRIDCTRL::Create(), which gives us default values from X.
1.6.1