diff options
author | joye <joye> | 2014-05-28 21:22:16 (GMT) |
---|---|---|
committer | joye <joye> | 2014-05-28 21:22:16 (GMT) |
commit | 4aecea1bd90e9eac38749328284a640a8d3ade25 (patch) | |
tree | 515fb06e6c1f3c34d89268685e0b264ba888f392 /src | |
parent | 1ed6288ad70ad1b1ff402c94bc36b7153dc18131 (diff) | |
download | blt-4aecea1bd90e9eac38749328284a640a8d3ade25.zip blt-4aecea1bd90e9eac38749328284a640a8d3ade25.tar.gz blt-4aecea1bd90e9eac38749328284a640a8d3ade25.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r-- | src/bltGrBind.C | 17 | ||||
-rw-r--r-- | src/bltGrBind.h | 6 | ||||
-rw-r--r-- | src/bltGrLegd.C | 2 | ||||
-rw-r--r-- | src/bltGraph.C | 5 | ||||
-rw-r--r-- | src/bltGraph.h | 2 |
5 files changed, 11 insertions, 21 deletions
diff --git a/src/bltGrBind.C b/src/bltGrBind.C index e329c17..2d282a8 100644 --- a/src/bltGrBind.C +++ b/src/bltGrBind.C @@ -40,7 +40,7 @@ static Tk_EventProc BindProc; BindTable::BindTable(Tcl_Interp* interp, Tk_Window tkwinn, ClientData clientDataa, - Blt_BindPickProc* pickProcc, Blt_BindTagProc* tagProcc) + Blt_BindPickProc* pickProcc) { flags =0; bindingTable = Tk_CreateBindingTable(interp); @@ -51,12 +51,10 @@ BindTable::BindTable(Tcl_Interp* interp, Tk_Window tkwinn, focusItem =NULL; focusContext =NULL; // pickEvent =NULL; - activePick =0; state =0; clientData = clientDataa; tkwin = tkwinn; pickProc = pickProcc; - tagProc = tagProcc; unsigned int mask = (KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask); @@ -145,6 +143,8 @@ void BindTable::deleteBindings(ClientData object) #define REPICK_IN_PROGRESS (1<<0) #define LEFT_GRABBED_ITEM (1<<1) +const char** Blt_GraphTags(BindTable* table, ClientData object, ClientData context, int* num); + static void BltDoEvent(BindTable* bindPtr, XEvent* eventPtr, ClientData item, ClientData context) { @@ -159,7 +159,7 @@ static void BltDoEvent(BindTable* bindPtr, XEvent* eventPtr, return; int nTags; - const char** tagArray = (*bindPtr->tagProc)(bindPtr, item, context, &nTags); + const char** tagArray = Blt_GraphTags(bindPtr, item, context, &nTags); Tk_BindEvent(bindPtr->bindingTable, eventPtr, bindPtr->tkwin, nTags, (void**)tagArray); @@ -167,7 +167,7 @@ static void BltDoEvent(BindTable* bindPtr, XEvent* eventPtr, delete [] tagArray; } -static void PickCurrentItem(BindTable* bindPtr, XEvent *eventPtr) +static void PickCurrentItem(BindTable* bindPtr, XEvent* eventPtr) { // Check whether or not a button is down. If so, we'll log entry and exit // into and out of the current item, but not entry into any other item. @@ -209,9 +209,7 @@ static void PickCurrentItem(BindTable* bindPtr, XEvent *eventPtr) } else bindPtr->pickEvent = *eventPtr; - } - bindPtr->activePick = 1; // If this is a recursive call (there's already a partially completed call // pending on the stack; it's in the middle of processing a Leave event @@ -298,8 +296,7 @@ static void PickCurrentItem(BindTable* bindPtr, XEvent *eventPtr) bindPtr->currentItem = bindPtr->newItem = newItem; bindPtr->currentContext = bindPtr->newContext = newContext; if (bindPtr->currentItem != NULL) { - XEvent event; - event = bindPtr->pickEvent; + XEvent event = bindPtr->pickEvent; event.type = EnterNotify; event.xcrossing.detail = NotifyAncestor; BltDoEvent(bindPtr, &event, newItem, newContext); @@ -352,7 +349,6 @@ static void BindProc(ClientData clientData, XEvent *eventPtr) // up before we change the current item). if (eventPtr->type == ButtonPress) { - // On a button press, first repick the current item using the // button state before the event, the process the event. bindPtr->state = eventPtr->xbutton.state; @@ -362,7 +358,6 @@ static void BindProc(ClientData clientData, XEvent *eventPtr) bindPtr->currentContext); } else { - // Button release: first process the event, with the button still // considered to be down. Then repick the current item under the // assumption that the button is no longer down. diff --git a/src/bltGrBind.h b/src/bltGrBind.h index 09b8af6..e1f83e5 100644 --- a/src/bltGrBind.h +++ b/src/bltGrBind.h @@ -36,8 +36,6 @@ class BindTable; typedef ClientData (Blt_BindPickProc)(ClientData clientData, int x, int y, ClientData *contextPtr); -typedef const char** (Blt_BindTagProc)(BindTable* bindTable, ClientData object, ClientData context, int*); - class BindTable { public: unsigned int flags; @@ -49,16 +47,14 @@ class BindTable { ClientData focusItem; ClientData focusContext; XEvent pickEvent; - int activePick; int state; ClientData clientData; Tk_Window tkwin; Blt_BindPickProc* pickProc; - Blt_BindTagProc* tagProc; public: BindTable(Tcl_Interp* interp, Tk_Window tkwin, ClientData clientData, - Blt_BindPickProc* pickProc, Blt_BindTagProc* tagProc); + Blt_BindPickProc* pickProc); virtual ~BindTable(); int configure(Tcl_Interp* interp, ClientData item, int objc, diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index 1ac796f..6d20be9 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -195,7 +195,7 @@ Legend::Legend(Graph* graphPtr) ops->titleStyle.justify =TK_JUSTIFY_LEFT; bindTable_ = new BindTable(graphPtr->interp_, graphPtr->tkwin_, - graphPtr, PickEntryProc, Blt_GraphTags); + graphPtr, PickEntryProc); Tcl_InitHashTable(&selectTable_, TCL_ONE_WORD_KEYS); diff --git a/src/bltGraph.C b/src/bltGraph.C index ea4c176..f18f0bb 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -119,7 +119,7 @@ Graph::Graph(ClientData clientData, Tcl_Interp* interp, axes_.displayList = Blt_Chain_Create(); elements_.displayList = Blt_Chain_Create(); markers_.displayList = Blt_Chain_Create(); - bindTable_ = new BindTable(interp_, tkwin_, this, PickEntry, Blt_GraphTags); + bindTable_ = new BindTable(interp_, tkwin_, this, PickEntry); if (createAxes() != TCL_OK) { valid_ =0; @@ -1260,7 +1260,8 @@ Axis* Graph::nearestAxis(int x, int y) return NULL; } -const char** Blt_GraphTags(BindTable* table, ClientData object, ClientData context, int* num) +const char** Blt_GraphTags(BindTable* table, ClientData object, + ClientData context, int* num) { Graph* graphPtr = (Graph*)table->clientData; ClassId classId = (ClassId)(long(context)); diff --git a/src/bltGraph.h b/src/bltGraph.h index ef44849..a79e0b1 100644 --- a/src/bltGraph.h +++ b/src/bltGraph.h @@ -247,6 +247,4 @@ class Graph { Point2d anchorPoint(double, double, double, double, Tk_Anchor); }; -extern Blt_BindTagProc Blt_GraphTags; - #endif |