From ceaa7ae515670db5572d5729337d75aaf915e1a1 Mon Sep 17 00:00:00 2001 From: joye Date: Tue, 8 Apr 2014 21:45:36 +0000 Subject: *** empty log message *** --- src/bltGrLegd.C | 38 +++++++++++++++----------------------- src/bltGrLegd.h | 15 +++++---------- src/bltGrLegdOp.C | 28 ++++++++++++++-------------- 3 files changed, 34 insertions(+), 47 deletions(-) diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index f343e99..e04f5d0 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -270,16 +270,11 @@ Legend::Legend(Graph* graphPtr) cursorY_ =0; cursorWidth_ =0; cursorHeight_ =0; - focusPtr =NULL; - selAnchorPtr =NULL; - selMarkPtr =NULL; - selFirstPtr =NULL; - selLastPtr =NULL; - active =0; - cursorOn =0; - onTime = 600; - offTime = 300; - timerToken =NULL; + focusPtr_ =NULL; + selAnchorPtr_ =NULL; + selMarkPtr_ =NULL; + selFirstPtr_ =NULL; + selLastPtr_ =NULL; selected = Blt_Chain_Create(); titleWidth =0; titleHeight =0; @@ -314,10 +309,7 @@ Legend::~Legend() if (focusGC_) Blt_FreePrivateGC(graphPtr_->display, focusGC_); - if (timerToken) - Tcl_DeleteTimerHandler(timerToken); - - if (graphPtr_->tkwin) + if (graphPtr_->tkwin) Tk_DeleteSelHandler(graphPtr_->tkwin, XA_PRIMARY, XA_STRING); Blt_Chain_Destroy(selected); @@ -857,7 +849,7 @@ void Blt_DrawLegend(Graph* graphPtr, Drawable drawable) x + xLabel, y + ops->entryBW + ops->iyPad); count++; - if (legendPtr->focusPtr == elemPtr) { /* Focus outline */ + if (legendPtr->focusPtr_ == elemPtr) { /* Focus outline */ if (isSelected) { XColor* color; @@ -1098,29 +1090,29 @@ int GetElementFromObj(Graph* graphPtr, Tcl_Obj *objPtr, Element **elemPtrPtr) // int last = Blt_Chain_GetLength(graphPtr->elements.displayList) - 1; if ((c == 'a') && (strcmp(string, "anchor") == 0)) - elemPtr = legendPtr->selAnchorPtr; + elemPtr = legendPtr->selAnchorPtr_; else if ((c == 'c') && (strcmp(string, "current") == 0)) elemPtr = (Element *)Blt_GetCurrentItem(legendPtr->bindTable_); else if ((c == 'f') && (strcmp(string, "first") == 0)) elemPtr = GetFirstElement(graphPtr); else if ((c == 'f') && (strcmp(string, "focus") == 0)) - elemPtr = legendPtr->focusPtr; + elemPtr = legendPtr->focusPtr_; else if ((c == 'l') && (strcmp(string, "last") == 0)) elemPtr = GetLastElement(graphPtr); else if ((c == 'e') && (strcmp(string, "end") == 0)) elemPtr = GetLastElement(graphPtr); else if ((c == 'n') && (strcmp(string, "next.row") == 0)) - elemPtr = GetNextRow(graphPtr, legendPtr->focusPtr); + elemPtr = GetNextRow(graphPtr, legendPtr->focusPtr_); else if ((c == 'n') && (strcmp(string, "next.column") == 0)) - elemPtr = GetNextColumn(graphPtr, legendPtr->focusPtr); + elemPtr = GetNextColumn(graphPtr, legendPtr->focusPtr_); else if ((c == 'p') && (strcmp(string, "previous.row") == 0)) - elemPtr = GetPreviousRow(graphPtr, legendPtr->focusPtr); + elemPtr = GetPreviousRow(graphPtr, legendPtr->focusPtr_); else if ((c == 'p') && (strcmp(string, "previous.column") == 0)) - elemPtr = GetPreviousColumn(graphPtr, legendPtr->focusPtr); + elemPtr = GetPreviousColumn(graphPtr, legendPtr->focusPtr_); else if ((c == 's') && (strcmp(string, "sel.first") == 0)) - elemPtr = legendPtr->selFirstPtr; + elemPtr = legendPtr->selFirstPtr_; else if ((c == 's') && (strcmp(string, "sel.last") == 0)) - elemPtr = legendPtr->selLastPtr; + elemPtr = legendPtr->selLastPtr_; else if (c == '@') { int x, y; diff --git a/src/bltGrLegd.h b/src/bltGrLegd.h index 5511a94..5951027 100644 --- a/src/bltGrLegd.h +++ b/src/bltGrLegd.h @@ -137,16 +137,11 @@ class Legend { int cursorY_; short int cursorWidth_; short int cursorHeight_; - Element *focusPtr; - Element *selAnchorPtr; - Element *selMarkPtr; - Element *selFirstPtr; - Element *selLastPtr; - int active; - int cursorOn; - int onTime; - int offTime; - Tcl_TimerToken timerToken; + Element *focusPtr_; + Element *selAnchorPtr_; + Element *selMarkPtr_; + Element *selFirstPtr_; + Element *selLastPtr_; Tcl_HashTable selectTable; Blt_Chain selected; unsigned int titleWidth; diff --git a/src/bltGrLegdOp.C b/src/bltGrLegdOp.C index 5ac9b58..bd8f8e0 100644 --- a/src/bltGrLegdOp.C +++ b/src/bltGrLegdOp.C @@ -278,18 +278,18 @@ static int FocusOp(Graph* graphPtr, Tcl_Interp* interp, if (GetElementFromObj(graphPtr, objv[3], &elemPtr) != TCL_OK) { return TCL_ERROR; } - if ((elemPtr != NULL) && (elemPtr != legendPtr->focusPtr)) { + if ((elemPtr != NULL) && (elemPtr != legendPtr->focusPtr_)) { /* Changing focus can only affect the visible entries. The entry * layout stays the same. */ - legendPtr->focusPtr = elemPtr; + legendPtr->focusPtr_ = elemPtr; } - Blt_SetFocusItem(legendPtr->bindTable_, legendPtr->focusPtr, + Blt_SetFocusItem(legendPtr->bindTable_, legendPtr->focusPtr_, CID_LEGEND_ENTRY); Blt_Legend_EventuallyRedraw(graphPtr); } - if (legendPtr->focusPtr) { + if (legendPtr->focusPtr_) { Tcl_SetStringObj(Tcl_GetObjResult(interp), - legendPtr->focusPtr->name(), -1); + legendPtr->focusPtr_->name(), -1); } return TCL_OK; } @@ -349,8 +349,8 @@ static int SelectionAnchorOp(Graph* graphPtr, Tcl_Interp* interp, } /* Set both the anchor and the mark. Indicates that a single entry * is selected. */ - legendPtr->selAnchorPtr = elemPtr; - legendPtr->selMarkPtr = NULL; + legendPtr->selAnchorPtr_ = elemPtr; + legendPtr->selMarkPtr_ = NULL; if (elemPtr) { Tcl_SetStringObj(Tcl_GetObjResult(interp), elemPtr->name(), -1); } @@ -391,12 +391,12 @@ static int SelectionMarkOp(Graph* graphPtr, Tcl_Interp* interp, if (GetElementFromObj(graphPtr, objv[4], &elemPtr) != TCL_OK) { return TCL_ERROR; } - if (legendPtr->selAnchorPtr == NULL) { + if (legendPtr->selAnchorPtr_ == NULL) { Tcl_AppendResult(interp, "selection anchor must be set first", (char *)NULL); return TCL_ERROR; } - if (legendPtr->selMarkPtr != elemPtr) { + if (legendPtr->selMarkPtr_ != elemPtr) { Blt_ChainLink link, next; /* Deselect entry from the list all the way back to the anchor. */ @@ -404,16 +404,16 @@ static int SelectionMarkOp(Graph* graphPtr, Tcl_Interp* interp, link = next) { next = Blt_Chain_PrevLink(link); Element *selectPtr = (Element*)Blt_Chain_GetValue(link); - if (selectPtr == legendPtr->selAnchorPtr) { + if (selectPtr == legendPtr->selAnchorPtr_) { break; } DeselectElement(legendPtr, selectPtr); } legendPtr->flags &= ~SELECT_TOGGLE; legendPtr->flags |= SELECT_SET; - SelectRange(legendPtr, legendPtr->selAnchorPtr, elemPtr); + SelectRange(legendPtr, legendPtr->selAnchorPtr_, elemPtr); Tcl_SetStringObj(Tcl_GetObjResult(interp), elemPtr->name(), -1); - legendPtr->selMarkPtr = elemPtr; + legendPtr->selMarkPtr_ = elemPtr; Blt_Legend_EventuallyRedraw(graphPtr); if (ops->selectCmd) @@ -478,8 +478,8 @@ static int SelectionSetOp(Graph* graphPtr, Tcl_Interp* interp, } /* Set both the anchor and the mark. Indicates that a single entry is * selected. */ - if (legendPtr->selAnchorPtr == NULL) { - legendPtr->selAnchorPtr = firstPtr; + if (legendPtr->selAnchorPtr_ == NULL) { + legendPtr->selAnchorPtr_ = firstPtr; } if (ops->exportSelection) { Tk_OwnSelection(graphPtr->tkwin, XA_PRIMARY, LostSelectionProc, -- cgit v0.12