#include <DrawPalette.h>

Maintains the list of drawing primatives, saving and loading lists and setting of parameters.
Definition at line 44 of file DrawPalette.h.
Public Types | |
| enum | { ID_DRAW_NEWLINE = FXDialogBox::ID_LAST, ID_DRAW_NEWTEXT, ID_DRAW_NEWRECT, ID_DRAW_NEWELLIPSE, ID_DRAW_NEWIMAGE, ID_DRAW_NEWFUNCTION, ID_DRAW_IMAGEBROWSE, ID_DRAW_ITEMUP, ID_DRAW_ITEMDN, ID_DRAW_CHANGED, ID_DRAW_ITEMSEL, ID_DRAW_NEW, ID_DRAW_LOAD, ID_DRAW_APPEND, ID_DRAW_SAVE, ID_DRAW_SAVEAS } |
Public Member Functions | |
| void | setImageCoords (int tw, int th, int xp, int yp, int bl, int bb) |
| Set image sizes. | |
| void | drawPrimative (FXDCWindow *dcw, double x, double y, int mx, int my, int xpx, int ypx) |
| Draw outline of current primative. | |
| void | startDraw (double x, double y, int mx, int my, int xpx, int ypx) |
| Start drawing a new primative. | |
| void | endDraw (FXDCWindow *dcw, double x, double y, int mx, int my, int xpx, int ypx) |
| End drawing a new primative. | |
| long | cmdUpdateData (FXObject *, FXSelector, void *) |
| Updates the data in the primative list table. | |
| long | cmdUpdatePositionData (FXObject *, FXSelector, void *) |
| Update primative position data from the text boxes. | |
| long | cmdUpdateAllData (FXObject *, FXSelector, void *) |
| Update all primative data from the GUI widgets. | |
| long | cmdItemDelete (FXObject *, FXSelector, void *) |
| Delete the selected primative and update. | |
| long | cmdItemSelect (FXObject *, FXSelector, void *) |
| Copy selected primative's data to the GUI widgets. | |
| long | cmdNewLine (FXObject *, FXSelector, void *) |
| New line button handler. | |
| long | cmdNewText (FXObject *, FXSelector, void *) |
| New text button handler. | |
| long | cmdNewRect (FXObject *, FXSelector, void *) |
| New rectangle button handler. | |
| long | cmdNewEllipse (FXObject *, FXSelector, void *) |
| New ellipse button handler. | |
| long | cmdNewImage (FXObject *, FXSelector, void *) |
| New image button handler. | |
| long | cmdNewFunction (FXObject *, FXSelector, void *) |
| New function button handler. | |
| long | cmdItemUp (FXObject *, FXSelector, void *) |
| Move current item up the draw order list. | |
| long | cmdItemDown (FXObject *, FXSelector, void *) |
| Move current item down the draw order list. | |
| long | cmdImageBrowse (FXObject *, FXSelector, void *) |
| Browse for an image to draw. | |
| long | cmdNew (FXObject *, FXSelector, void *) |
| Start a new list of primatives. | |
| long | cmdLoad (FXObject *, FXSelector, void *) |
| Load a list of primatives. | |
| long | cmdAppend (FXObject *, FXSelector, void *) |
| Append a file of primatives to the current set. | |
| long | cmdSave (FXObject *, FXSelector, void *) |
| Save the list of primatives to a file. | |
| long | cmdSaveAs (FXObject *, FXSelector, void *) |
| Save the list of primatives to a new file. | |
| DrawPaletteDialog (FXWindow *owner, int target) | |
| Palette window class constructor. | |
| void | hide (void) |
| Hide palette. | |
Public Attributes | |
| FXString | drawdirectory |
| Directory of the file dialog box. | |
| struct DrawPaletteDialog::primative * | primatives |
| Drawing primative. | |
| int | nPrimatives |
| Number of primatives. | |
Private Member Functions | |
| DrawPaletteDialog () | |
| void | coordSort (int &xmin, int &xmax, int &ymin, int &ymax, int spx, int epx, int spy, int epy) |
| Sort coordinate into order. | |
| void | constructItemLine (int idx) |
| Construct primative list summary line. | |
| void | ImageLoad (void) |
| Loads an image to draw. | |
| void | createPrimative (primative::typemode p) |
| Create new primative. | |
| void | newPrimative (primative::typemode p) |
| Creates new primative and updates the display. | |
| void | deletePrimative (int idx) |
| Delete a primative. | |
Private Attributes | |
| FXColorWell * | drawfgColourwell |
| FXColorWell * | drawbgColourwell |
| FXTextField * | drawstrokeTextfield |
| FXTextField * | drawxposTextfield |
| FXTextField * | drawyposTextfield |
| FXPopup * | drawbasisPopup |
| FXOption * | drawaxisOption |
| FXOption * | drawfractionalOption |
| FXOption * | drawabsoluteOption |
| FXOption * | drawaxisfractionalOption |
| FXOption * | drawborderOption |
| FXOptionMenu * | drawbasisOptionmenu |
| FXSwitcher * | drawobjectSwitcher |
| FXTextField * | drawxsizeTextfield |
| FXTextField * | drawysizeTextfield |
| FXPopup * | drawsizebasisPopup |
| FXOption * | drawsizeaxisOption |
| FXOption * | drawsizefractionalOption |
| FXOption * | drawsizeabsoluteOption |
| FXOption * | drawsizeaxisfractionalOption |
| FXOption * | drawsizeborderOption |
| FXOptionMenu * | drawsizebasisOptionmenu |
| FXTextField * | drawtextTextfield |
| FXPopup * | drawjustifyPopup |
| FXOption * | drawtljustifyOption |
| FXOption * | drawtrjustifyOption |
| FXOption * | drawbljustifyOption |
| FXOption * | drawbrjustifyOption |
| FXOption * | drawcjustifyOption |
| FXOptionMenu * | drawjustifyOptionmenu |
| FXTextField * | drawimageTextfield |
| FXTextField * | drawfunctionTextfield |
| FXCheckButton * | draw2dCheckbutton |
| FXCheckButton * | drawstartarrowCheckbutton |
| FXCheckButton * | drawendarrowCheckbutton |
| FXTextField * | drawarrowlengthTextfield |
| FXTextField * | drawarrowwidthTextfield |
| FXCheckButton * | drawstartlCheckbutton |
| FXCheckButton * | drawendlCheckbutton |
| FXCheckButton * | drawgradlCheckbutton |
| FXCheckButton * | drawdistlCheckbutton |
| FXColorList * | drawitemsColourlist |
| int | startpx |
| int | startpy |
| Start positions. | |
| int | currentpx |
| int | currentpy |
| Current positons. | |
| double | startax |
| double | startay |
| Start axis space values. | |
| int | totalwidth |
| int | totalheight |
| Total image sizes. | |
| int | xpixels |
| int | ypixels |
| Data image sizes. | |
| int | borderleft |
| int | borderbottom |
| int | bordertop |
| int | borderright |
| Border sizes. | |
| bool | drawing |
| Drawing mode is on? | |
| FXString | drawfile |
| File containing the list of primatives. | |
| int | updatetarget |
| Graph the primative list is attached to. | |
Classes | |
| struct | primative |
| Drawing primative. More... | |
| anonymous enum |
Definition at line 153 of file DrawPalette.h.
| DrawPaletteDialog::DrawPaletteDialog | ( | FXWindow * | owner, | |
| int | target | |||
| ) |
Palette window class constructor.
| owner | Parent window object. | |
| target | Graph to draw primatives onto. |
Definition at line 81 of file DrawPalette.cpp.
References currentpx, currentpy, draw2dCheckbutton, drawabsoluteOption, drawarrowlengthTextfield, drawarrowwidthTextfield, drawaxisfractionalOption, drawaxisOption, drawbasisOptionmenu, drawbasisPopup, drawbgColourwell, drawbljustifyOption, drawborderOption, drawbrjustifyOption, drawcjustifyOption, drawdistlCheckbutton, drawendarrowCheckbutton, drawendlCheckbutton, drawfgColourwell, drawfractionalOption, drawfunctionTextfield, drawgradlCheckbutton, drawimageTextfield, drawing, drawitemsColourlist, drawjustifyOptionmenu, drawjustifyPopup, drawobjectSwitcher, drawsizeabsoluteOption, drawsizeaxisfractionalOption, drawsizeaxisOption, drawsizebasisOptionmenu, drawsizebasisPopup, drawsizeborderOption, drawsizefractionalOption, drawstartarrowCheckbutton, drawstartlCheckbutton, drawstrokeTextfield, drawtextTextfield, drawtljustifyOption, drawtrjustifyOption, drawxposTextfield, drawxsizeTextfield, drawyposTextfield, drawysizeTextfield, ID_DRAW_APPEND, ID_DRAW_CHANGED, ID_DRAW_IMAGEBROWSE, ID_DRAW_ITEMDN, ID_DRAW_ITEMSEL, ID_DRAW_ITEMUP, ID_DRAW_LOAD, ID_DRAW_NEW, ID_DRAW_NEWELLIPSE, ID_DRAW_NEWFUNCTION, ID_DRAW_NEWIMAGE, ID_DRAW_NEWLINE, ID_DRAW_NEWRECT, ID_DRAW_NEWTEXT, ID_DRAW_SAVE, ID_DRAW_SAVEAS, nPrimatives, primatives, startax, startay, startpx, startpy, and updatetarget.
| void DrawPaletteDialog::coordSort | ( | int & | xmin, | |
| int & | xmax, | |||
| int & | ymin, | |||
| int & | ymax, | |||
| int | spx, | |||
| int | epx, | |||
| int | spy, | |||
| int | epy | |||
| ) | [private] |
Sort coordinate into order.
| [out] | xmin | Smallest x. |
| [out] | xmax | Largest x. |
| [out] | ymin | Smallest y. |
| [out] | ymax | Largest y. |
| spx | X1. | |
| epx | X2. | |
| spy | Y1. | |
| epy | Y2. |
Definition at line 398 of file DrawPalette.cpp.
Referenced by drawPrimative(), and endDraw().

| void DrawPaletteDialog::constructItemLine | ( | int | idx | ) | [private] |
Construct primative list summary line.
| idx | Primative to update. |
Definition at line 929 of file DrawPalette.cpp.
References drawitemsColourlist, DrawPaletteDialog::primative::ELLIPSE, DrawPaletteDialog::primative::FUNCTION, DrawPaletteDialog::primative::IMAGE, DrawPaletteDialog::primative::LINE, primatives, DrawPaletteDialog::primative::RECT, DrawPaletteDialog::primative::text, and DrawPaletteDialog::primative::TEXT.
Referenced by cmdAppend(), cmdLoad(), cmdUpdateAllData(), cmdUpdateData(), and cmdUpdatePositionData().

| void DrawPaletteDialog::setImageCoords | ( | int | tw, | |
| int | th, | |||
| int | xp, | |||
| int | yp, | |||
| int | bl, | |||
| int | bb | |||
| ) |
Set image sizes.
Initialises the size of the image so the palette knows where to draw objects.
| tw | Image width. | |
| th | Image height. | |
| xp | Data width. | |
| yp | Data height. | |
| bl | Left border width. | |
| bb | Bottom border height. |
Definition at line 434 of file DrawPalette.cpp.
References borderbottom, borderleft, borderright, bordertop, totalheight, totalwidth, xpixels, and ypixels.
Referenced by GreyLabWindow::cmdLSSelectReq(), and GreyLabWindow::cmdLSZoom().

| void DrawPaletteDialog::drawPrimative | ( | FXDCWindow * | dcw, | |
| double | x, | |||
| double | y, | |||
| int | mx, | |||
| int | my, | |||
| int | xpx, | |||
| int | ypx | |||
| ) |
Draw outline of current primative.
Draws the current primative as it is dragged out with the mouse.
| dcw | Window to draw to. | |
| x | Axis space x coordinate. | |
| y | Axis space y coordinate. | |
| mx | Mouse x. | |
| my | Mouse y. | |
| xpx | Image space x coordinate. | |
| ypx | Image space y coordinate. |
Definition at line 458 of file DrawPalette.cpp.
References borderbottom, borderleft, borderright, bordertop, coordSort(), currentpx, currentpy, drawing, drawitemsColourlist, drawsizebasisOptionmenu, drawxsizeTextfield, drawysizeTextfield, DrawPaletteDialog::primative::ELLIPSE, DrawPaletteDialog::primative::FUNCTION, DrawPaletteDialog::primative::IMAGE, DrawPaletteDialog::primative::LINE, primatives, DrawPaletteDialog::primative::RECT, startpx, startpy, totalheight, totalwidth, xpixels, and ypixels.
Referenced by GreyLabWindow::cmdLSSelectReq(), and GreyLabWindow::cmdLSZoom().


| void DrawPaletteDialog::startDraw | ( | double | x, | |
| double | y, | |||
| int | mx, | |||
| int | my, | |||
| int | xpx, | |||
| int | ypx | |||
| ) |
Start drawing a new primative.
Sets initial coordinate of the primative.
| dcw | Window to draw to. | |
| x | Axis space x coordinate. | |
| y | Axis space y coordinate. | |
| mx | Mouse x. | |
| my | Mouse y. | |
| xpx | Image space x coordinate. | |
| ypx | Image space y coordinate. |
Definition at line 585 of file DrawPalette.cpp.
References borderbottom, borderleft, borderright, bordertop, currentpx, currentpy, drawbasisOptionmenu, drawing, drawxposTextfield, drawyposTextfield, startax, startay, startpx, startpy, totalheight, totalwidth, xpixels, and ypixels.
Referenced by GreyLabWindow::cmdLSSelectReq(), and GreyLabWindow::cmdLSZoom().

| void DrawPaletteDialog::endDraw | ( | FXDCWindow * | dcw, | |
| double | x, | |||
| double | y, | |||
| int | mx, | |||
| int | my, | |||
| int | xpx, | |||
| int | ypx | |||
| ) |
End drawing a new primative.
Sets final position/dimension coordinate of the primative.
| dcw | Window to draw to. | |
| x | Axis space x coordinate. | |
| y | Axis space y coordinate. | |
| mx | Mouse x. | |
| my | Mouse y. | |
| xpx | Image space x coordinate. | |
| ypx | Image space y coordinate. |
Definition at line 655 of file DrawPalette.cpp.
References borderbottom, borderleft, borderright, bordertop, cmdUpdatePositionData(), coordSort(), currentpx, currentpy, drawing, drawitemsColourlist, drawsizebasisOptionmenu, drawxsizeTextfield, drawysizeTextfield, DrawPaletteDialog::primative::ELLIPSE, DrawPaletteDialog::primative::FUNCTION, DrawPaletteDialog::primative::IMAGE, DrawPaletteDialog::primative::LINE, primatives, DrawPaletteDialog::primative::RECT, startax, startay, startpx, startpy, totalheight, totalwidth, xpixels, and ypixels.
Referenced by GreyLabWindow::cmdLSSelectReq(), and GreyLabWindow::cmdLSZoom().


| long DrawPaletteDialog::cmdUpdateData | ( | FXObject * | o, | |
| FXSelector | s, | |||
| void * | ||||
| ) |
Updates the data in the primative list table.
| o | Calling object. | |
| s | Calling message type and ID. |
Definition at line 766 of file DrawPalette.cpp.
References DrawPaletteDialog::primative::arrow, DrawPaletteDialog::primative::arrowsize, DrawPaletteDialog::primative::AXISABS, DrawPaletteDialog::primative::AXISFRAC, DrawPaletteDialog::primative::bg, DrawPaletteDialog::primative::BL, DrawPaletteDialog::primative::BORDERFRAC, DrawPaletteDialog::primative::BR, DrawPaletteDialog::primative::C, constructItemLine(), DrawPaletteDialog::primative::dimensions, DrawPaletteDialog::primative::dimmode, draw2dCheckbutton, drawabsoluteOption, drawarrowlengthTextfield, drawarrowwidthTextfield, drawaxisfractionalOption, drawaxisOption, drawbgColourwell, drawbljustifyOption, drawborderOption, drawbrjustifyOption, drawcjustifyOption, drawdistlCheckbutton, drawendarrowCheckbutton, drawendlCheckbutton, drawfgColourwell, drawfractionalOption, drawfunctionTextfield, drawgradlCheckbutton, drawimageTextfield, drawitemsColourlist, drawsizeabsoluteOption, drawsizeaxisfractionalOption, drawsizeaxisOption, drawsizeborderOption, drawsizefractionalOption, drawstartarrowCheckbutton, drawstartlCheckbutton, drawstrokeTextfield, drawtextTextfield, drawtljustifyOption, drawtrjustifyOption, drawxposTextfield, drawxsizeTextfield, drawyposTextfield, drawysizeTextfield, DrawPaletteDialog::primative::fg, DrawPaletteDialog::primative::file, DrawPaletteDialog::primative::func, DrawPaletteDialog::primative::FUNCTION, DrawPaletteDialog::primative::IMAGEABS, DrawPaletteDialog::primative::IMAGEFRAC, ImageLoad(), DrawPaletteDialog::primative::justify, DrawPaletteDialog::primative::position, DrawPaletteDialog::primative::posmode, primatives, DrawPaletteDialog::primative::startendgrad, DrawPaletteDialog::primative::stroke, DrawPaletteDialog::primative::text, DrawPaletteDialog::primative::TL, DrawPaletteDialog::primative::TR, DrawPaletteDialog::primative::twod, and updatetarget.

| void DrawPaletteDialog::createPrimative | ( | primative::typemode | p | ) | [private] |
Create new primative.
Creates a new primative and initialises it.
| p | New primative type. |
Definition at line 206 of file DrawPalette.cpp.
References DrawPaletteDialog::primative::datafunc, DrawPaletteDialog::primative::file, DrawPaletteDialog::primative::func, DrawPaletteDialog::primative::FUNCTION, DrawPaletteDialog::primative::IMAGE, nPrimatives, primatives, DrawPaletteDialog::primative::text, DrawPaletteDialog::primative::type, and DrawPaletteDialog::primative::validimage.
Referenced by cmdAppend(), cmdLoad(), and newPrimative().

| void DrawPaletteDialog::newPrimative | ( | primative::typemode | p | ) | [private] |
Creates new primative and updates the display.
| p | New primative type. |
Definition at line 241 of file DrawPalette.cpp.
References cmdUpdateAllData(), createPrimative(), drawitemsColourlist, drawobjectSwitcher, and nPrimatives.
Referenced by cmdNewEllipse(), cmdNewFunction(), cmdNewImage(), cmdNewLine(), cmdNewRect(), and cmdNewText().


| void DrawPaletteDialog::deletePrimative | ( | int | idx | ) | [private] |
Delete a primative.
| idx | Primative to delete. |
Definition at line 970 of file DrawPalette.cpp.
References cmdItemSelect(), DrawPaletteDialog::primative::datafunc, drawitemsColourlist, drawobjectSwitcher, DrawPaletteDialog::primative::FUNCTION, nPrimatives, and primatives.
Referenced by cmdItemDelete(), and cmdLoad().


Drawing primative.
List of primatives
Referenced by cmdAppend(), cmdImageBrowse(), cmdItemDown(), cmdItemSelect(), cmdItemUp(), cmdLoad(), cmdSave(), cmdUpdateAllData(), cmdUpdateData(), cmdUpdatePositionData(), constructItemLine(), createPrimative(), deletePrimative(), DrawPaletteDialog(), drawPrimative(), endDraw(), ImageLoad(), and GreyLabWindow::renderObjects().
1.5.3