diff options
author | joye <joye> | 2014-05-29 19:53:45 (GMT) |
---|---|---|
committer | joye <joye> | 2014-05-29 19:53:45 (GMT) |
commit | 366e1b4db56b4d7ba37e4c0c58bc7da33de179ed (patch) | |
tree | fa733a3ad3626ca6d9ad7e03fcd83f83972b8522 | |
parent | 615e5da45310fee9eed7dd02e801b726690f911c (diff) | |
download | blt-366e1b4db56b4d7ba37e4c0c58bc7da33de179ed.zip blt-366e1b4db56b4d7ba37e4c0c58bc7da33de179ed.tar.gz blt-366e1b4db56b4d7ba37e4c0c58bc7da33de179ed.tar.bz2 |
*** empty log message ***
-rw-r--r-- | src/bltGrBind.C | 24 | ||||
-rw-r--r-- | src/bltGrBind.h | 14 | ||||
-rw-r--r-- | src/bltGrLegd.C | 8 | ||||
-rw-r--r-- | src/bltGrLegdOp.C | 2 | ||||
-rw-r--r-- | src/bltGraph.C | 16 |
5 files changed, 33 insertions, 31 deletions
diff --git a/src/bltGrBind.C b/src/bltGrBind.C index cff52d9..51e73c2 100644 --- a/src/bltGrBind.C +++ b/src/bltGrBind.C @@ -39,17 +39,17 @@ using namespace std; static Tk_EventProc BindProc; -BindTable::BindTable(Graph* graphPtr, Blt_BindPickProc* pickProc) +BindTable::BindTable(Graph* graphPtr, BltBindPickProc* pickProc) { graphPtr_ = graphPtr; flags_ =0; table_ = Tk_CreateBindingTable(graphPtr->interp_); currentItem_ =NULL; - currentContext_ =NULL; + currentContext_ =CID_NONE; newItem_ =NULL; - newContext_ =NULL; + newContext_ =CID_NONE; focusItem_ =NULL; - focusContext_ =NULL; + focusContext_ =CID_NONE; // pickEvent =NULL; state_ =0; pickProc_ = pickProc; @@ -127,34 +127,34 @@ void BindTable::deleteBindings(ClientData object) // If this is the object currently picked, we need to repick one. if (currentItem_ == object) { currentItem_ =NULL; - currentContext_ =NULL; + currentContext_ =CID_NONE; } if (newItem_ == object) { newItem_ =NULL; - newContext_ =NULL; + newContext_ =CID_NONE; } if (focusItem_ == object) { focusItem_ =NULL; - focusContext_ =NULL; + focusContext_ =CID_NONE; } } -void BindTable::doEvent(XEvent* eventPtr, ClientData item, ClientData context) +// ClassId classId = (ClassId)(long(context)); +void BindTable::doEvent(XEvent* eventPtr, ClientData item, ClassId classId) { if (!graphPtr_->tkwin_ || !table_) return; if ((eventPtr->type == KeyPress) || (eventPtr->type == KeyRelease)) { item = focusItem_; - context = focusContext_; + classId = focusContext_; } if (!item) return; int nTags; - ClassId classId = (ClassId)(long(context)); const char** tagArray = graphPtr_->getTags(item, classId, &nTags); Tk_BindEvent(table_, eventPtr, graphPtr_->tkwin_, nTags, (void**)tagArray); if (tagArray) @@ -217,8 +217,8 @@ void BindTable::pickItem(XEvent* eventPtr) // A LeaveNotify event automatically means that there's no current item, // so the check for closest item can be skipped. - ClientData newContext =NULL; ClientData newItem =NULL; + ClassId newContext =CID_NONE; if (pickEvent_.type != LeaveNotify) { int x = pickEvent_.xcrossing.x; int y = pickEvent_.xcrossing.y; @@ -261,7 +261,7 @@ void BindTable::pickItem(XEvent* eventPtr) // provide balloon help on the individual entries of the Hierbox // widget. ClientData savedItem = currentItem_; - ClientData savedContext = currentContext_; + ClassId savedContext = currentContext_; if (newItem_ != NULL) { event.type = LeaveNotify; event.xcrossing.detail = NotifyVirtual; // Ancestor diff --git a/src/bltGrBind.h b/src/bltGrBind.h index 7beb694..04cdd6a 100644 --- a/src/bltGrBind.h +++ b/src/bltGrBind.h @@ -40,19 +40,21 @@ class Graph; typedef ClientData (BltBindPickProc)(ClientData, int, int, ClassId*); class BindTable { + protected: + Tk_BindingTable table_; + unsigned int flags_; + ClientData newItem_; + ClassId newContext_; + BltBindPickProc* pickProc_; + public: Graph* graphPtr_; - unsigned int flags_; - Tk_BindingTable table_; ClientData currentItem_; ClassId currentContext_; - ClientData newItem_; - ClassId newContext_; ClientData focusItem_; ClassId focusContext_; - XEvent pickEvent_; int state_; - BltBindPickProc* pickProc_; + XEvent pickEvent_; public: BindTable(Graph*, BltBindPickProc* pickProc); diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index 9b513a9..fab18c2 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -47,7 +47,7 @@ using namespace Blt; static void SelectCmdProc(ClientData); static Tk_SelectionProc SelectionProc; -static Blt_BindPickProc LegendPickEntry; +static BltBindPickProc LegendPickEntry; // OptionSpecs @@ -873,7 +873,7 @@ int Legend::getElementFromObj(Tcl_Obj* objPtr, Element** elemPtrPtr) if (Blt_GetXY(graphPtr_->interp_, graphPtr_->tkwin_, string, &x, &y) != TCL_OK) return TCL_ERROR; - ClientData classId; + ClassId classId; elemPtr = (Element*)LegendPickEntry(graphPtr_, x, y, &classId); } else { @@ -1043,7 +1043,7 @@ static void SelectCmdProc(ClientData clientData) } static ClientData LegendPickEntry(ClientData clientData, int x, int y, - ClientData *contextPtr) + ClassId* contextPtr) { Graph* graphPtr = (Graph*)clientData; Legend* legendPtr = graphPtr->legend_; @@ -1077,7 +1077,7 @@ static ClientData LegendPickEntry(ClientData clientData, int x, int y, ElementOptions* elemOps = (ElementOptions*)elemPtr->ops(); if (elemOps->label) { if (count == n) { - *contextPtr = (ClientData)elemPtr->classId(); + *contextPtr = elemPtr->classId(); return elemPtr; } count++; diff --git a/src/bltGrLegdOp.C b/src/bltGrLegdOp.C index f350d0a8..96125ba 100644 --- a/src/bltGrLegdOp.C +++ b/src/bltGrLegdOp.C @@ -245,7 +245,7 @@ static int FocusOp(ClientData clientData, Tcl_Interp* interp, legendPtr->focusPtr_ = elemPtr; legendPtr->bindTable_->focusItem_ = (ClientData)elemPtr; - legendPtr->bindTable_->focusContext_ = (ClientData)elemPtr->classId(); + legendPtr->bindTable_->focusContext_ = elemPtr->classId(); } } diff --git a/src/bltGraph.C b/src/bltGraph.C index 588f606..ef5030f 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -56,7 +56,7 @@ using namespace Blt; extern int PostScriptPreamble(Graph* graphPtr, const char *fileName, Blt_Ps ps); -static Blt_BindPickProc GraphPickEntry; +static BltBindPickProc GraphPickEntry; // OptionSpecs @@ -1343,13 +1343,13 @@ const char** Graph::getTags(ClientData object, ClassId classId, int* num) // two different elements overlay each other exactly, the one that's on // top (visible) is picked. static ClientData GraphPickEntry(ClientData clientData, int x, int y, - ClientData* contextPtr) + ClassId* contextPtr) { Graph* graphPtr = (Graph*)clientData; GraphOptions* ops = (GraphOptions*)graphPtr->ops_; if (graphPtr->flags & (LAYOUT | MAP_MARKERS)) { - *contextPtr = (ClientData)NULL; + *contextPtr = CID_NONE; return NULL; } @@ -1360,7 +1360,7 @@ static ClientData GraphPickEntry(ClientData clientData, int x, int y, (y >= exts.bottom) || (y < exts.top)) { Axis* axisPtr = graphPtr->nearestAxis(x, y); if (axisPtr) { - *contextPtr = (ClientData)axisPtr->classId(); + *contextPtr = axisPtr->classId(); return axisPtr; } } @@ -1371,7 +1371,7 @@ static ClientData GraphPickEntry(ClientData clientData, int x, int y, // 3. markers drawn under element (-under true). Marker* markerPtr = graphPtr->nearestMarker(x, y, 0); if (markerPtr) { - *contextPtr = (ClientData)markerPtr->classId(); + *contextPtr = markerPtr->classId(); return markerPtr; } @@ -1392,17 +1392,17 @@ static ClientData GraphPickEntry(ClientData clientData, int x, int y, // Found an element within the minimum halo distance. if (searchPtr->dist <= (double)searchPtr->halo) { - *contextPtr = (ClientData)searchPtr->elemPtr->classId(); + *contextPtr = searchPtr->elemPtr->classId(); return searchPtr->elemPtr; } markerPtr = graphPtr->nearestMarker(x, y, 1); if (markerPtr) { - *contextPtr = (ClientData)markerPtr->classId(); + *contextPtr = markerPtr->classId(); return markerPtr; } - *contextPtr = (ClientData)NULL; + *contextPtr = CID_NONE; return NULL; } |