diff options
author | joye <joye> | 2014-04-08 17:45:59 (GMT) |
---|---|---|
committer | joye <joye> | 2014-04-08 17:45:59 (GMT) |
commit | 75114fdca0a8c1ec5f10c102c62aca9631cb9d75 (patch) | |
tree | 1d57ef118a255b9aa56eb29c64af0a3e85b23a5f /src | |
parent | a000d08cecb5b599fc318503ae2e7a407b322635 (diff) | |
download | blt-75114fdca0a8c1ec5f10c102c62aca9631cb9d75.zip blt-75114fdca0a8c1ec5f10c102c62aca9631cb9d75.tar.gz blt-75114fdca0a8c1ec5f10c102c62aca9631cb9d75.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGrAxis.C | 8 | ||||
-rw-r--r-- | src/bltGrElemOp.C | 1 | ||||
-rw-r--r-- | src/bltGrLegd.C | 119 | ||||
-rw-r--r-- | src/bltGrLegd.h | 131 | ||||
-rw-r--r-- | src/bltGraph.C | 1 | ||||
-rw-r--r-- | src/bltGraph.h | 1 |
6 files changed, 133 insertions, 128 deletions
diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index b085768..328d92f 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -27,25 +27,19 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <X11/Xlib.h> -#include <X11/Xutil.h> - -#include "bltC.h" #include "bltMath.h" extern "C" { -#include "bltInt.h" #include "bltGraph.h" #include "bltOp.h" } -class Marker; - #include "bltConfig.h" #include "bltGrElem.h" #include "bltGrElemBar.h" #include "bltGrElemLine.h" #include "bltGrAxis.h" +#include "bltGrLegd.h" #define AXIS_PAD_TITLE 2 #define NUMDIGITS 15 /* Specifies the number of digits of diff --git a/src/bltGrElemOp.C b/src/bltGrElemOp.C index d4520f7..263d40e 100644 --- a/src/bltGrElemOp.C +++ b/src/bltGrElemOp.C @@ -36,6 +36,7 @@ extern "C" { #include "bltGrElemBar.h" #include "bltGrElemLine.h" #include "bltGrElemOp.h" +#include "bltGrLegd.h" // Defs diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index 2e4e0bf..0e040e6 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -39,6 +39,7 @@ extern "C" { #include "bltOp.h" }; +#include "bltGrLegd.h" #include "bltConfig.h" #include "bltGrElem.h" #include "bltGrElemOp.h" @@ -69,124 +70,6 @@ extern "C" { #define LABEL_PAD 2 -typedef enum { - SELECT_MODE_SINGLE, SELECT_MODE_MULTIPLE -} SelectMode; - -struct _Legend { - Tk_OptionTable optionTable; - unsigned int flags; - ClassId classId; /* Type: Element or Marker. */ - - int nEntries; /* Number of element entries in - * table. */ - short int nColumns, nRows; /* Number of columns and rows in - * legend */ - short int width, height; /* Dimensions of the legend */ - short int entryWidth, entryHeight; - - int site; - short int xReq, yReq; /* User-requested site of legend, not - * the final actual position. Used in - * conjunction with the anchor below - * to determine location of the - * legend. */ - - Tk_Anchor anchor; /* Anchor of legend. Used to interpret - * the positioning point of the legend - * in the graph*/ - - int x, y; /* Computed origin of legend. */ - - Graph* graphPtr; - Tcl_Command cmdToken; /* Token for graph's widget command. */ - int reqColumns, reqRows; - - int ixPad, iyPad; /* # of pixels interior padding around - * legend entries */ - int xPad, yPad; /* # of pixels padding to exterior of - * legend */ - Tk_Window tkwin; /* If non-NULL, external window to draw - * legend. */ - TextStyle style; - - int maxSymSize; /* Size of largest symbol to be - * displayed. Used to calculate size - * of legend */ - XColor* fgColor; - Tk_3DBorder activeBg; /* Active legend entry background - * color. */ - XColor* activeFgColor; - int activeRelief; /* 3-D effect on active entry. */ - int entryBW; /* Border width around each entry in - * legend. */ - Tk_3DBorder normalBg; /* 3-D effect of legend. */ - int borderWidth; /* Width of legend 3-D border */ - int relief; /* 3-d effect of border around the - * legend: TK_RELIEF_RAISED etc. */ - - Blt_BindTable bindTable; - - int selRelief; - int selBW; - - XColor* selInFocusFgColor; /* Text color of a selected entry. */ - XColor* selOutFocusFgColor; - - Tk_3DBorder selInFocusBg; - Tk_3DBorder selOutFocusBg; - - XColor* focusColor; - Blt_Dashes focusDashes; /* Dash on-off value. */ - GC focusGC; /* Graphics context for the active - * label. */ - - const char *takeFocus; - int focus; /* Position of the focus entry. */ - - int cursorX, cursorY; /* Position of the insertion cursor in - * the textbox window. */ - short int cursorWidth; /* Size of the insertion cursor - * symbol. */ - short int cursorHeight; - Element *focusPtr; /* Element that currently has the - * focus. If NULL, no legend entry has - * the focus. */ - Element *selAnchorPtr; /* Fixed end of selection. Used to - * extend the selection while - * maintaining the other end of the - * selection. */ - Element *selMarkPtr; - Element *selFirstPtr; /* First element selected in current - * pick. */ - Element *selLastPtr; /* Last element selected in current - * pick. */ - int hide; - int raised; - int exportSelection; - int active; - int cursorOn; /* Indicates if the cursor is - * displayed. */ - int onTime, offTime; /* Time in milliseconds to wait before - * changing the cursor from off-to-on - * and on-to-off. Setting offTime to 0 - * makes the * cursor steady. */ - Tcl_TimerToken timerToken; /* Handle for a timer event called - * periodically to blink the cursor. */ - const char *selectCmd; /* TCL script that's invoked whenever - * the selection changes. */ - SelectMode selectMode; /* Mode of selection: single or - * multiple. */ - Tcl_HashTable selectTable; /* Table of selected elements. Used to - * quickly determine whether an element - * is selected. */ - Blt_Chain selected; /* List of selected elements. */ - - const char *title; - unsigned int titleWidth, titleHeight; - TextStyle titleStyle; /* Legend title attributes */ -}; - // Defs extern "C" { diff --git a/src/bltGrLegd.h b/src/bltGrLegd.h index 130934d..03b5e61 100644 --- a/src/bltGrLegd.h +++ b/src/bltGrLegd.h @@ -30,8 +30,17 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef _BLT_GR_LEGEND_H -#define _BLT_GR_LEGEND_H +#ifndef __BltGrLegend_h__ +#define __BltGrLegend_h__ + +#include <iostream> +#include <sstream> +#include <iomanip> +using namespace std; + +extern "C" { +#include "bltGraph.h" +}; #define LEGEND_RIGHT (1<<0) /* Right margin */ #define LEGEND_LEFT (1<<1) /* Left margin */ @@ -45,6 +54,124 @@ (LEGEND_RIGHT | LEGEND_LEFT | LEGEND_BOTTOM | LEGEND_TOP) #define LEGEND_PLOTAREA_MASK (LEGEND_PLOT | LEGEND_XY) +typedef enum { + SELECT_MODE_SINGLE, SELECT_MODE_MULTIPLE +} SelectMode; + +struct _Legend { + Tk_OptionTable optionTable; + unsigned int flags; + ClassId classId; /* Type: Element or Marker. */ + + int nEntries; /* Number of element entries in + * table. */ + short int nColumns, nRows; /* Number of columns and rows in + * legend */ + short int width, height; /* Dimensions of the legend */ + short int entryWidth, entryHeight; + + int site; + short int xReq, yReq; /* User-requested site of legend, not + * the final actual position. Used in + * conjunction with the anchor below + * to determine location of the + * legend. */ + + Tk_Anchor anchor; /* Anchor of legend. Used to interpret + * the positioning point of the legend + * in the graph*/ + + int x, y; /* Computed origin of legend. */ + + Graph* graphPtr; + Tcl_Command cmdToken; /* Token for graph's widget command. */ + int reqColumns, reqRows; + + int ixPad, iyPad; /* # of pixels interior padding around + * legend entries */ + int xPad, yPad; /* # of pixels padding to exterior of + * legend */ + Tk_Window tkwin; /* If non-NULL, external window to draw + * legend. */ + TextStyle style; + + int maxSymSize; /* Size of largest symbol to be + * displayed. Used to calculate size + * of legend */ + XColor* fgColor; + Tk_3DBorder activeBg; /* Active legend entry background + * color. */ + XColor* activeFgColor; + int activeRelief; /* 3-D effect on active entry. */ + int entryBW; /* Border width around each entry in + * legend. */ + Tk_3DBorder normalBg; /* 3-D effect of legend. */ + int borderWidth; /* Width of legend 3-D border */ + int relief; /* 3-d effect of border around the + * legend: TK_RELIEF_RAISED etc. */ + + Blt_BindTable bindTable; + + int selRelief; + int selBW; + + XColor* selInFocusFgColor; /* Text color of a selected entry. */ + XColor* selOutFocusFgColor; + + Tk_3DBorder selInFocusBg; + Tk_3DBorder selOutFocusBg; + + XColor* focusColor; + Blt_Dashes focusDashes; /* Dash on-off value. */ + GC focusGC; /* Graphics context for the active + * label. */ + + const char *takeFocus; + int focus; /* Position of the focus entry. */ + + int cursorX, cursorY; /* Position of the insertion cursor in + * the textbox window. */ + short int cursorWidth; /* Size of the insertion cursor + * symbol. */ + short int cursorHeight; + Element *focusPtr; /* Element that currently has the + * focus. If NULL, no legend entry has + * the focus. */ + Element *selAnchorPtr; /* Fixed end of selection. Used to + * extend the selection while + * maintaining the other end of the + * selection. */ + Element *selMarkPtr; + Element *selFirstPtr; /* First element selected in current + * pick. */ + Element *selLastPtr; /* Last element selected in current + * pick. */ + int hide; + int raised; + int exportSelection; + int active; + int cursorOn; /* Indicates if the cursor is + * displayed. */ + int onTime, offTime; /* Time in milliseconds to wait before + * changing the cursor from off-to-on + * and on-to-off. Setting offTime to 0 + * makes the * cursor steady. */ + Tcl_TimerToken timerToken; /* Handle for a timer event called + * periodically to blink the cursor. */ + const char *selectCmd; /* TCL script that's invoked whenever + * the selection changes. */ + SelectMode selectMode; /* Mode of selection: single or + * multiple. */ + Tcl_HashTable selectTable; /* Table of selected elements. Used to + * quickly determine whether an element + * is selected. */ + Blt_Chain selected; /* List of selected elements. */ + + const char *title; + unsigned int titleWidth, titleHeight; + TextStyle titleStyle; /* Legend title attributes */ +}; + extern int Blt_CreateLegend(Graph *graphPtr); extern void Blt_DestroyLegend(Graph *graphPtr); diff --git a/src/bltGraph.C b/src/bltGraph.C index bf3410c..e685ba2 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -43,6 +43,7 @@ extern "C" { #include "bltGrElemOp.h" #include "bltGrMarker.h" #include "bltGrMarkerOp.h" +#include "bltGrLegd.h" using namespace Blt; diff --git a/src/bltGraph.h b/src/bltGraph.h index c19a8d3..733bcdf 100644 --- a/src/bltGraph.h +++ b/src/bltGraph.h @@ -95,7 +95,6 @@ typedef struct { } GraphObj; #include "bltGrAxis.h" -#include "bltGrLegd.h" typedef struct { Segment2d *segments; |