Changeset 3072
- Timestamp:
- Jun 29, 2012, 3:09:38 PM (12 years ago)
- Location:
- trunk/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/drawingentry.tcl
r3042 r3072 28 28 private variable _drawingWidth 0 29 29 private variable _owner 30 private variable _parser "" 30 private variable _parser ""; # Slave interpreter where all 31 # substituted variables are stored. 31 32 private variable _path 32 33 private variable _showing "" … … 41 42 private variable _cursor "" 42 43 43 constructor {owner path args} { # defined below } 44 44 constructor {owner path args} { 45 # defined below 46 } 47 destructor {} { 48 # defined below 49 } 45 50 public method value { args } 46 51 public method label {} … … 102 107 pack $itk_component(drawing) -expand yes -fill both 103 108 bind $itk_component(drawing) <Configure> [itcl::code $this Redraw] 109 set _parser [interp create -safe] 104 110 Redraw 105 111 eval itk_initialize $args 106 112 } 107 113 114 itcl::body Rappture::DrawingEntry::destructor {} { 115 if { $_parser != "" } { 116 $_parser delete 117 } 118 } 108 119 # ---------------------------------------------------------------------- 109 120 # USAGE: label … … 645 656 set id [eval $c create hotspot $coords] 646 657 set _cname2id($cname) $id 658 set options(-interp) $_parser 647 659 eval $c itemconfigure $id [array get options] 648 660 if { $hotspot == "inline" } { … … 964 976 itcl::body Rappture::DrawingEntry::InitSubstitutions {} { 965 977 # Load a new parser with the variables representing the substitution 966 set _parser [interp create -safe]967 978 foreach name [array names _name2path] { 968 979 set path $_name2path($name) … … 974 985 } 975 986 $_parser eval [list set $name $value] 976 set ::$name $value977 987 } 978 988 } -
trunk/gui/scripts/vtkviewer.tcl
r3067 r3072 1172 1172 foreach dataset [CurrentDatasets -visible $_first] { 1173 1173 SendCmd "polydata opacity $sval $dataset" 1174 if { $_haveGlyphs } { 1175 SendCmd "glyphs opacity $sval $dataset" 1176 } 1174 1177 } 1175 1178 } … … 1178 1181 foreach dataset [CurrentDatasets -visible $_first] { 1179 1182 SendCmd "polydata wireframe $bool $dataset" 1183 if { $_haveGlyphs } { 1184 SendCmd "glyphs wireframe $bool $dataset" 1185 } 1180 1186 } 1181 1187 } … … 1183 1189 set bool $_volume(visible) 1184 1190 foreach dataset [CurrentDatasets -visible $_first] { 1191 if { $_haveGlyphs } { 1192 SendCmd "glyphs visible $bool $dataset" 1193 } 1185 1194 SendCmd "polydata visible $bool $dataset" 1186 1195 } … … 1189 1198 set bool $_volume(lighting) 1190 1199 foreach dataset [CurrentDatasets -visible $_first] { 1200 if { $_haveGlyphs } { 1201 SendCmd "glyphs lighting $bool $dataset" 1202 } 1191 1203 SendCmd "polydata lighting $bool $dataset" 1192 1204 } … … 1195 1207 set bool $_volume(edges) 1196 1208 foreach dataset [CurrentDatasets -visible $_first] { 1209 if { $_haveGlyphs } { 1210 SendCmd "glyphs edges $bool $dataset" 1211 } 1197 1212 SendCmd "polydata edges $bool $dataset" 1198 1213 } -
trunk/gui/src/RpCanvHotspot.c
r3052 r3072 156 156 }; 157 157 158 static Tk_OptionParseProc ValueInterpParseProc; 159 static Tk_OptionPrintProc ValueInterpPrintProc; 160 static Tk_CustomOption interpOption = { 161 (Tk_OptionParseProc *)ValueInterpParseProc, ValueInterpPrintProc, 162 (ClientData) NULL 163 }; 164 158 165 static Tk_ConfigSpec configSpecs[] = { 159 166 {TK_CONFIG_BORDER, "-activebackground", (char *)NULL, (char*)NULL, … … 177 184 {TK_CONFIG_COLOR, "-foreground", "foreground", (char*)NULL, 178 185 "black", Tk_Offset(HotspotItem, textColor), 0}, 186 {TK_CONFIG_CUSTOM, "-interp", (char*)NULL, (char*)NULL, (char*)NULL, 187 Tk_Offset(HotspotItem, valueInterp), TK_CONFIG_NULL_OK, &interpOption}, 179 188 {TK_CONFIG_FONT, "-valuefont", (char*)NULL, (char*)NULL, 180 189 "helvetica -12 bold", Tk_Offset(HotspotItem, valueFont), 0}, … … 466 475 467 476 477 /* 478 *---------------------------------------------------------------------- 479 * 480 * ValueInterpParseProc -- 481 * 482 * Converts the name of an axis to a pointer to its axis structure. 483 * 484 * Results: 485 * The return value is a standard Tcl result. The axis flags are 486 * written into the widget record. 487 * 488 *---------------------------------------------------------------------- 489 */ 490 /*ARGSUSED*/ 491 static int 492 ValueInterpParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, 493 CONST84 char *string, char *widgRec, int offset) 494 { 495 HotspotItem *itemPtr = (HotspotItem *)widgRec; 496 497 if (string[0] == '\0') { 498 itemPtr->valueInterp = NULL; 499 return TCL_OK; 500 } 501 itemPtr->valueInterp = Tcl_GetSlave(interp, string); 502 if (itemPtr->valueInterp == NULL) { 503 return TCL_ERROR; 504 } 505 return TCL_OK; 506 } 507 508 /* 509 *---------------------------------------------------------------------- 510 * 511 * ValueInterpParseProc -- 512 * 513 * Convert the window coordinates into a string. 514 * 515 * Results: 516 * The string representing the coordinate position is returned. 517 * 518 *---------------------------------------------------------------------- 519 */ 520 /*ARGSUSED*/ 521 static char * 522 ValueInterpPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, 523 int offset, Tcl_FreeProc **freeProcPtr) 524 { 525 HotspotItem *itemPtr = (HotspotItem *)widgRec; 526 527 if (itemPtr->valueInterp != NULL) { 528 Tcl_Obj *objPtr; 529 530 Tcl_GetInterpPath(itemPtr->interp, itemPtr->valueInterp); 531 objPtr = Tcl_GetObjResult(itemPtr->interp); 532 *freeProcPtr = TCL_VOLATILE; 533 return Tcl_GetString(objPtr); 534 } 535 return ""; 536 } 468 537 469 538 /*
Note: See TracChangeset
for help on using the changeset viewer.