home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / tcl / xf2.3-p / xf2 / xf2.3 / additionals / XYGraph < prev   
Encoding:
Text File  |  1993-11-20  |  51.7 KB  |  1,274 lines

  1. # Program: xf
  2. # Description: handle xygraph widgets
  3. #
  4. # $Header: XYGraph[2.3] Wed Mar 10 11:57:38 1993 garfield@garfield frozen $
  5.  
  6. global xfDefaultConf
  7. set xfDefaultConf(xygraph) 5
  8.  
  9. ##########
  10. # Procedure: XFAdd.XYGraph
  11. # Description: add a xygraph
  12. # Arguments: xfW - the widget
  13. #            xfName - a optional name
  14. #            xfType - add or config
  15. # Returns: none
  16. # Sideeffects: none
  17. ##########
  18. proc XFAdd.XYGraph {xfW xfName xfType} {
  19.   global xfConf
  20.   global xfStatus
  21.  
  22.   XFEditSetStatus "Inserting XYGraph..."
  23.   set xfName [XFMiscGetUniqueName $xfName xygraph]
  24.   if {"$xfStatus(path)" == "."} {
  25.     if {"$xfType" == "add"} {
  26.       if {[catch "xygraph .$xfName" xfResult]} {
  27.         XFProcError "$xfResult"
  28.         XFEditSetStatus "Inserting XYGraph...aborted"
  29.         return
  30.       }
  31.     } {
  32.       if {[catch "xygraph .$xfName" xfResult]} {
  33.         XFProcError "$xfResult"
  34.         XFEditSetStatus "Inserting XYGraph...aborted"
  35.         return
  36.       }
  37.     }
  38.  
  39.     XFMiscPositionWidget .$xfName
  40.     XFMiscBindWidgetTree .$xfName
  41.   } {
  42.     if {"$xfType" == "add"} {
  43.       if {[catch "xygraph $xfStatus(path).$xfName" xfResult]} {
  44.         XFProcError "$xfResult"
  45.         XFEditSetStatus "Inserting XYGraph...aborted"
  46.         return
  47.       }
  48.     } {
  49.       if {[catch "xygraph $xfStatus(path).$xfName" xfResult]} {
  50.         XFProcError "$xfResult"
  51.         XFEditSetStatus "Inserting XYGraph...aborted"
  52.         return
  53.       }
  54.     }
  55.  
  56.     XFMiscPositionWidget $xfStatus(path).$xfName
  57.     XFMiscBindWidgetTree $xfStatus(path).$xfName
  58.   }
  59.  
  60.   incr xfStatus(elementCounter)
  61.   XFEditSetPath $xfStatus(path)
  62.   XFEditSetStatus "Inserting XYGraph...done"
  63. }
  64.  
  65. ##########
  66. # Procedure: XFConfig.XYGraph4
  67. # Description: configure a xygraph
  68. # Arguments: xfW - the widget
  69. #            xfType - config type (add config)
  70. #            xfClass - the class we configure
  71. #            xfLeader - the leading window
  72. # Returns: none
  73. # Sideeffects: none
  74. ##########
  75. proc XFConfig.XYGraph4 {xfW xfType xfClass {xfLeader ""}} {
  76.   global xfMisc
  77.   global xfStatus
  78.  
  79.   if {"$xfType" == "add"} {
  80.     set xfName xygraph$xfStatus(elementCounter)
  81.   } {
  82.     set xfName [XFMiscPathName $xfW]
  83.   }
  84.   XFEditSetStatus "Calling parameter setting for XYGraph..."
  85.  
  86.   # build widget structure
  87.   XFTmpltToplevel .xf${xfClass}Config4 400x720 \
  88.     "XYGraph parameters:[XFMiscPathTail $xfW]" $xfLeader
  89.  
  90.   XFElementInit $xfW .xf${xfClass}Config4 $xfType $xfClass \
  91.     XFXYGraphSetXYGraph4 parameters $xfName 4
  92.   XFElementColor $xfW .xf${xfClass}Config4 $xfType $xfClass bg \
  93.     background Background "Background" XFXYGraphSetXYGraph4
  94.   XFElementScale $xfW .xf${xfClass}Config4 $xfType $xfClass borderwidth \
  95.     borderWidth BorderWidth "Border width" "pixels" 40 \
  96.     XFXYGraphSetXYGraph4
  97.   XFElementFont $xfW .xf${xfClass}Config4 $xfType $xfClass \
  98.     font font Font "Font" XFXYGraphSetXYGraph4
  99.   XFElementColor $xfW .xf${xfClass}Config4 $xfType $xfClass fg \
  100.     foreground Foreground "Foreground" XFXYGraphSetXYGraph4
  101.   XFElementGeometry $xfW .xf${xfClass}Config4 $xfType $xfClass \
  102.     XFXYGraphSetXYGraph4
  103.   XFElementScaleDouble $xfW .xf${xfClass}Config4 $xfType \
  104.     $xfClass lpos "Legend position" "X" "Y" \
  105.       [winfo screenwidth .] [winfo screenheight .]
  106.   XFElementBoolean $xfW .xf${xfClass}Config4 $xfType $xfClass retrace \
  107.     "Draw retrace lines" XFXYGraphSetXYGraph4
  108.   XFElementBoolean $xfW .xf${xfClass}Config4 $xfType $xfClass showlegend \
  109.     "Show legend" XFXYGraphSetXYGraph4
  110.   XFElementText $xfW .xf${xfClass}Config4 $xfType $xfClass title \
  111.     title Title "Title" XFXYGraphSetXYGraph4
  112.   XFElementText $xfW .xf${xfClass}Config4 $xfType $xfClass xlabel \
  113.     xlabel Label "X label" XFXYGraphSetXYGraph4
  114.   XFElementBoolean $xfW .xf${xfClass}Config4 $xfType $xfClass xlogscale \
  115.     "X log scale" XFXYGraphSetXYGraph4
  116.   XFElementScale $xfW .xf${xfClass}Config4 $xfType $xfClass xsubticks \
  117.     xsubticks SubTicks "X sub ticks" "" 50 XFXYGraphSetXYGraph4
  118.   XFElementScale $xfW .xf${xfClass}Config4 $xfType $xfClass xstepsize \
  119.     xstepsize StepSize "X step size" "" 100 XFXYGraphSetXYGraph4
  120.   XFElementText $xfW .xf${xfClass}Config4 $xfType $xfClass ylabel \
  121.     ylabel Label "Y label" XFXYGraphSetXYGraph4
  122.   XFElementBoolean $xfW .xf${xfClass}Config4 $xfType $xfClass ylogscale \
  123.     "Y log scale" XFXYGraphSetXYGraph4
  124.   XFElementScale $xfW .xf${xfClass}Config4 $xfType $xfClass ysubticks \
  125.     ysubticks SubTicks "Y sub ticks" "" 50 XFXYGraphSetXYGraph4
  126.   XFElementScale $xfW .xf${xfClass}Config4 $xfType $xfClass ystepsize \
  127.     ystepsize StepSize "Y step size" "" 100 XFXYGraphSetXYGraph4
  128.  
  129.   if {"$xfType" != "add"} {
  130.     set xfTmpVal [string trim [lindex [$xfW configure -legendposition] 4] @]
  131.     if {[string first , $xfTmpVal] >= 0} {
  132.       .xf${xfClass}Config4.params1.params2.lpos.lpos1.lpos1 set \
  133.         [string range $xfTmpVal 0 [expr [string first , $xfTmpVal]-1]]
  134.       .xf${xfClass}Config4.params1.params2.lpos.lpos2.lpos2 set \
  135.         [string range $xfTmpVal [expr [string first , $xfTmpVal]+1] end]
  136.     }
  137.   }
  138.  
  139.   XFMiscSetResource .xf${xfClass}Config4.params1.params2.lpos.lpos1.lpos1 \
  140.     command "XFXYGraphSetXYGraph4 $xfW 0 $xfClass"
  141.   XFMiscSetResource .xf${xfClass}Config4.params1.params2.lpos.lpos2.lpos2 \
  142.     command "XFXYGraphSetXYGraph4 $xfW 0 $xfClass"
  143.  
  144.   # save current parameter
  145.   XFElementSave $xfW $xfClass {background borderwidth font foreground geometry legendpos retrace showlegend title xlabel xlogscale xsubticks xstepsize ylabel ylogscale ysubticks ystepsize}
  146.  
  147.   # packing
  148.   pack append .xf${xfClass}Config4.params1 \
  149.               .xf${xfClass}Config4.params1.params2 {left fill expand}
  150.   pack append .xf${xfClass}Config4 \
  151.               .xf${xfClass}Config4.pathname {top fill frame center} \
  152.               .xf${xfClass}Config4.leave {bottom fill} \
  153.               .xf${xfClass}Config4.additional {bottom fill} \
  154.               .xf${xfClass}Config4.params1 {top fill expand}
  155.  
  156.   XFBindFormConnect .xf${xfClass}Config4.params1.params2 \
  157.     "XFXYGraphSetXYGraph4 $xfW 0 $xfClass"
  158.  
  159.   XFEditSetStatus "Calling parameter setting for XYGraph...done"
  160. }
  161.  
  162. ##########
  163. # Procedure: XFConfig.XYGraph5
  164. # Description: configure a xygraph
  165. # Arguments: xfW - the widget
  166. #            xfType - config type (add config)
  167. #            xfClass - the class we configure
  168. #            xfLeader - the leading window
  169. # Returns: none
  170. # Sideeffects: none
  171. ##########
  172. proc XFConfig.XYGraph5 {xfW xfType xfClass {xfLeader ""}} {
  173.   global tkVersion
  174.   global xfBind
  175.   global xfMisc
  176.   global xfStatus
  177.  
  178.   set xfMisc(XYGraphCurrentType) "<line>"
  179.   set xfMisc(XYGraphAnchor) "n"
  180.   set xfMisc(XYGraphSymbol) "solid"
  181.  
  182.   set xfName [XFMiscPathName $xfW]
  183.   XFEditSetStatus "Calling parameter setting for XYGraph..."
  184.  
  185.   # build widget structure
  186.   XFTmpltToplevel .xf${xfClass}Config5 400x600 \
  187.     "XYGraph parameters:[XFMiscPathTail $xfW]" $xfLeader
  188.  
  189.   XFElementInit $xfW .xf${xfClass}Config5 $xfType $xfClass \
  190.     XFXYGraphSetXYGraph5 parameters $xfName 5
  191.  
  192.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1 0
  193.  
  194.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1.elements 0
  195.  
  196.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1.elements.elem1 0
  197.  
  198.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 0
  199.  
  200.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1.children 0
  201.  
  202.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.commands 0
  203.  
  204.   menubutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries \
  205.     -text {XYGraph entry:} \
  206.     -underline 0 \
  207.     -menu ".xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m"
  208.  
  209.   menu .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m
  210.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m \
  211.     add radiobutton \
  212.       -label {Line} \
  213.       -variable xfMisc(XYGraphCurrentType) \
  214.       -value "<line>" \
  215.       -underline 0 \
  216.       -command "XFXYGraphSetItems line $xfClass"
  217.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m \
  218.     add radiobutton \
  219.       -label {Tag} \
  220.       -variable xfMisc(XYGraphCurrentType) \
  221.       -value "<tag>" \
  222.       -underline 0 \
  223.       -command "XFXYGraphSetItems tag $xfClass"
  224.  
  225.   label \
  226.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.message1 \
  227.       -anchor w \
  228.       -text {Line}
  229.   
  230.   button .xf${xfClass}Config5.params1.params2.commands.insert \
  231.     -text {Insert item} \
  232.     -command "XFXYGraphInsertItem $xfW $xfClass"
  233.  
  234.   button .xf${xfClass}Config5.params1.params2.commands.modify \
  235.     -text {Modify item} \
  236.     -command "XFXYGraphModifyItem $xfW $xfClass"
  237.  
  238.   button .xf${xfClass}Config5.params1.params2.commands.delete \
  239.     -text {Delete item} \
  240.     -command "XFXYGraphDeleteItem $xfW $xfClass"
  241.  
  242.   XFTmpltLabledEntry \
  243.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  244.       tag "Item name:"
  245.  
  246.   XFTmpltFrame \
  247.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor 0
  248.  
  249.   label .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.message1 \
  250.     -relief raised \
  251.     -text {Anchor:}
  252.  
  253.   XFTmpltFrame \
  254.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor 0
  255.  
  256.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1 0
  257.  
  258.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2 0
  259.  
  260.   XFTmpltFrame .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3 0
  261.  
  262.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.nw \
  263.     -anchor w \
  264.     -text {NW} \
  265.     -variable xfMisc(XYGraphAnchor) \
  266.     -command ""
  267.  
  268.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.w \
  269.     -anchor w \
  270.     -text {W} \
  271.     -variable xfMisc(XYGraphAnchor) \
  272.     -command ""
  273.  
  274.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.sw \
  275.     -anchor w \
  276.     -text {SW} \
  277.     -variable xfMisc(XYGraphAnchor) \
  278.     -command ""
  279.  
  280.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.n \
  281.     -anchor w \
  282.     -text {N} \
  283.     -variable xfMisc(XYGraphAnchor) \
  284.     -command ""
  285.  
  286.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.c \
  287.     -anchor w \
  288.     -text {C} \
  289.     -variable xfMisc(XYGraphAnchor) \
  290.     -command ""
  291.  
  292.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.s \
  293.     -anchor w \
  294.     -text {S} \
  295.     -variable xfMisc(XYGraphAnchor) \
  296.     -command ""
  297.  
  298.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.ne \
  299.     -anchor w \
  300.     -text {NE} \
  301.     -variable xfMisc(XYGraphAnchor) \
  302.     -command ""
  303.  
  304.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.e \
  305.     -anchor w \
  306.     -text {E} \
  307.     -variable xfMisc(XYGraphAnchor) \
  308.     -command ""
  309.  
  310.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.se \
  311.     -anchor w \
  312.     -text {SE} \
  313.     -variable xfMisc(XYGraphAnchor) \
  314.     -command ""
  315.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.c select
  316.  
  317.   XFTmpltLabledEntry \
  318.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  319.       bg "Background:"
  320.  
  321.   XFTmpltLabledEntry \
  322.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  323.       bitmap "Bitmap:"
  324.  
  325.   XFTmpltLabledEntry \
  326.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  327.       color "Color:"
  328.  
  329.   XFTmpltLabledEntry \
  330.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  331.       font "Font:"
  332.  
  333.   XFTmpltLabledEntry \
  334.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  335.       fg "Foreground:"
  336.  
  337.   XFTmpltLabledEntry \
  338.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  339.       label "Label:"
  340.  
  341.   XFTmpltLabledEntry \
  342.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  343.       name "Line name:"
  344.  
  345.   XFTmpltScale \
  346.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  347.       linewidth "Line width:" "" 50
  348.  
  349.   XFTmpltLabledEntry \
  350.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  351.       posx "X position:"
  352.  
  353.   XFTmpltLabledEntry \
  354.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  355.       posy "Y position:"
  356.  
  357.   XFTmpltScale \
  358.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  359.       rotate "Rotation:" "" 360
  360.  
  361.   XFTmpltFrame \
  362.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym 0
  363.  
  364.   XFTmpltFrame \
  365.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1 0
  366.  
  367.   XFTmpltFrame \
  368.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1 0
  369.  
  370.   XFTmpltFrame \
  371.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2 0
  372.  
  373.   XFTmpltFrame \
  374.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3 0
  375.  
  376.   XFTmpltFrame \
  377.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4 0
  378.  
  379.   XFTmpltFrame \
  380.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym5 0
  381.  
  382.   label .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.message1 \
  383.     -relief raised \
  384.     -text {Symbol:}
  385.  
  386.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1.circle \
  387.     -text {circle} \
  388.     -variable xfMisc(XYGraphSymbol) \
  389.     -anchor w \
  390.     -command ""
  391.  
  392.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1.cross \
  393.     -text {cross} \
  394.     -variable xfMisc(XYGraphSymbol) \
  395.     -anchor w \
  396.     -command ""
  397.  
  398.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2.dashed \
  399.     -text {dashed} \
  400.     -variable xfMisc(XYGraphSymbol) \
  401.     -anchor w \
  402.     -command ""
  403.  
  404.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2.diamond \
  405.     -text {diamond} \
  406.     -variable xfMisc(XYGraphSymbol) \
  407.     -anchor w \
  408.     -command ""
  409.  
  410.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3.dotted \
  411.     -text {dotted} \
  412.     -variable xfMisc(XYGraphSymbol) \
  413.     -anchor w \
  414.     -command ""
  415.  
  416.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3.plus \
  417.     -text {plus} \
  418.     -variable xfMisc(XYGraphSymbol) \
  419.     -anchor w \
  420.     -command ""
  421.  
  422.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.point \
  423.     -text {point} \
  424.     -variable xfMisc(XYGraphSymbol) \
  425.     -anchor w \
  426.     -command ""
  427.  
  428.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.solid \
  429.     -text {solid} \
  430.     -variable xfMisc(XYGraphSymbol) \
  431.     -anchor w \
  432.     -command ""
  433.  
  434.   radiobutton .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym5.square \
  435.     -text {square} \
  436.     -variable xfMisc(XYGraphSymbol) \
  437.     -anchor w \
  438.     -command ""
  439.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.solid select
  440.  
  441.   XFTmpltScale .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  442.     symbolsize "Symbol size:" "" 100
  443.  
  444.   label \
  445.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message6 \
  446.       -relief raised \
  447.       -text {Text:}
  448.  
  449.   XFTmpltText .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 text
  450.   XFMiscSetTextHeight \
  451.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.text.text 5
  452.  
  453.   label \
  454.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message3 \
  455.       -relief raised \
  456.       -text {X data:}
  457.  
  458.   XFTmpltText .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 xdata
  459.   XFMiscSetTextHeight \
  460.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.xdata.xdata 5
  461.  
  462.   label \
  463.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message4 \
  464.       -relief raised \
  465.       -text {Y data:}
  466.  
  467.   XFTmpltText .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 ydata
  468.   XFMiscSetTextHeight \
  469.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.ydata.ydata 5
  470.  
  471.   label .xf${xfClass}Config5.params1.params2.frame1.children.message1 \
  472.     -text {Items:}
  473.  
  474.   XFTmpltListbox .xf${xfClass}Config5.params1.params2.frame1.children items
  475.  
  476.   XFXYGraphReadXYGraph $xfW $xfClass
  477.  
  478.   case [lindex [.xf${xfClass}Config5.params1.params2.frame1.elements.elem1.message1 config -text] 4] in {
  479.     {Tag} {
  480.       .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m invoke 1
  481.     }
  482.     {default} {
  483.       .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m invoke 0
  484.     }
  485.   }
  486.  
  487.   .xf${xfClass}Config5.leave.ok configure \
  488.     -command "
  489.       XFMiscSetSymbolicName $xfW \
  490.         \[.xf${xfClass}Config5.params1.params2.symname.symname get\]
  491.       destroy .xf${xfClass}Config5"
  492.  
  493.   .xf${xfClass}Config5.leave.apply configure \
  494.     -command ""
  495.  
  496.   .xf${xfClass}Config5.leave.applyperm configure \
  497.     -command ""
  498.  
  499.   .xf${xfClass}Config5.leave.cancel configure \
  500.     -command "destroy .xf${xfClass}Config5"
  501.  
  502.   XFXYGraphSetItem $xfW $xfClass
  503.  
  504.   if {$tkVersion >= 3.0} {
  505.     tk_menuBar .xf${xfClass}Config5.params1.params2.frame1.elements.elem1 \
  506.                .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries
  507.   } {
  508.     tk_menus .xf${xfClass}Config5 \
  509.              .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries
  510.   }
  511.  
  512.   # bindings
  513.   bind .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg.bg $xfBind(configure) \
  514.     "XFProcColorBox background .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg.bg"
  515.  
  516.   bind .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap $xfBind(configure) \
  517.     "XFProcFSBoxPixmap .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap"
  518.  
  519.   bind .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color.color $xfBind(configure) \
  520.     "XFProcColorBox color .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color.color"
  521.  
  522.   bind .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font.font $xfBind(configure) \
  523.     "XFProcFontBox font .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font.font"
  524.  
  525.   bind .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg.fg $xfBind(configure) \
  526.     "XFProcColorBox foreground .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg.fg"
  527.  
  528.   bind .xf${xfClass}Config5.params1.params2.frame1.children.items.items $xfBind(select1) "
  529.     XFBindSelectOne %W %y
  530.     XFXYGraphSetItem $xfW $xfClass"
  531.   bind .xf${xfClass}Config5.params1.params2.frame1.children.items.items <ButtonPress-1> "
  532.     XFBindSelectOne %W %y
  533.     XFXYGraphSetItem $xfW $xfClass"
  534.   bind .xf${xfClass}Config5.params1.params2.frame1.children.items.items <Button1-Motion> "
  535.     XFBindSelectOne %W %y
  536.     XFXYGraphSetItem $xfW $xfClass"
  537.   bind .xf${xfClass}Config5.params1.params2.frame1.children.items.items <Shift-ButtonPress-1> "
  538.     XFBindSelectOne %W %y
  539.     XFXYGraphSetItem $xfW $xfClass"
  540.   bind .xf${xfClass}Config5.params1.params2.frame1.children.items.items <Shift-Button1-Motion> "
  541.     XFBindSelectOne %W %y
  542.     XFXYGraphSetItem $xfW $xfClass"
  543.  
  544.   # packing
  545.   pack append .xf${xfClass}Config5.params1.params2.commands \
  546.               .xf${xfClass}Config5.params1.params2.commands.insert {left fill expand} \
  547.               .xf${xfClass}Config5.params1.params2.commands.modify {left fill expand} \
  548.               .xf${xfClass}Config5.params1.params2.commands.delete {left fill expand}
  549.  
  550.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem1 \
  551.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries {left fillx} \
  552.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.message1 {left fillx expand}
  553.  
  554.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1 \
  555.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.nw {top fillx} \
  556.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.w {top fillx} \
  557.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.sw {top fillx}
  558.  
  559.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2 \
  560.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.n {top fillx} \
  561.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.c {top fillx} \
  562.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.s {top fillx}
  563.  
  564.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3 \
  565.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.ne {top fillx} \
  566.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.e {top fillx} \
  567.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.se {top fillx}
  568.  
  569.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor \
  570.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1 {left frame center} \
  571.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2 {left frame center} \
  572.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3 {left frame center}
  573.  
  574.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor \
  575.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.message1 {left frame center} \
  576.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor {left frame center}
  577.  
  578.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1 \
  579.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1.circle {left fillx expand} \
  580.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1.cross {left fillx expand}
  581.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2 \
  582.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2.dashed {left fillx expand} \
  583.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2.diamond {left fillx expand}
  584.  
  585.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3 \
  586.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3.dotted {left fillx expand} \
  587.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3.plus {left fillx expand} \
  588.  
  589.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4 \
  590.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.point {left fillx expand} \
  591.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.solid {left fillx expand} \
  592.  
  593.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym5 \
  594.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym5.square {left fillx expand}
  595.  
  596.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1 \
  597.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1 {top fillx} \
  598.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2 {top fillx expand} \
  599.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3 {top fillx expand} \
  600.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4 {top fillx expand} \
  601.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym5 {top fillx expand}
  602.  
  603.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym \
  604.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.message1 {left} \
  605.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1 {left fill expand}
  606.  
  607.   pack append .xf${xfClass}Config5.params1.params2.frame1.elements \
  608.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem1 {top fill} \
  609.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 {top fill expand}
  610.  
  611.   pack append .xf${xfClass}Config5.params1.params2.frame1.children \
  612.               .xf${xfClass}Config5.params1.params2.frame1.children.message1 {top frame center} \
  613.               .xf${xfClass}Config5.params1.params2.frame1.children.items {left fill expand}
  614.  
  615.   place .xf${xfClass}Config5.params1.params2.frame1.elements \
  616.     -in .xf${xfClass}Config5.params1.params2.frame1 \
  617.     -relx 0 \
  618.     -rely 0 \
  619.     -relheight 1.0 \
  620.     -relwidth 0.5
  621.  
  622.   place .xf${xfClass}Config5.params1.params2.frame1.children \
  623.     -in .xf${xfClass}Config5.params1.params2.frame1 \
  624.     -relx 0.5 \
  625.     -rely 0 \
  626.     -relheight 1.0 \
  627.     -relwidth 0.5
  628.  
  629.   pack append .xf${xfClass}Config5.params1.params2 \
  630.               .xf${xfClass}Config5.params1.params2.frame1 {top fill expand} \
  631.               .xf${xfClass}Config5.params1.params2.commands {top fill}
  632.  
  633.   pack append .xf${xfClass}Config5.params1 \
  634.               .xf${xfClass}Config5.params1.params2 {left fill expand}
  635.   pack append .xf${xfClass}Config5 \
  636.               .xf${xfClass}Config5.pathname {top fill frame center} \
  637.               .xf${xfClass}Config5.leave {bottom fill} \
  638.               .xf${xfClass}Config5.additional {bottom fill} \
  639.               .xf${xfClass}Config5.params1 {top fill expand}
  640.  
  641.   XFBindFormConnect .xf${xfClass}Config5.params1.params2.frame1.elements.elem2
  642.  
  643.   XFEditSetStatus "Calling parameter setting for XYGraph...done"
  644. }
  645.  
  646. ##########
  647. # Procedure: XFSaveSpecial.XYGraph
  648. # Description: save xygraph
  649. # Arguments: xfW - the widget
  650. # Returns: none
  651. # Sideeffects: none
  652. ##########
  653. proc XFSaveSpecial.XYGraph {xfW} {
  654.  
  655.   set xfResult "\n  # build xygraph items $xfW\n"
  656.   foreach xfCounter [$xfW names] {
  657. #FIX
  658. #    case [$xfW type $xfCounter] in {
  659. #      {line} {
  660.         append xfResult "  $xfW insert \{$xfCounter\}"
  661.         foreach xfOptions [$xfW lineconfigure $xfCounter] {
  662.           # only handle options with 5 items per option entry
  663.           if {[llength $xfOptions] == 5} {
  664.             if {"[lindex $xfOptions 3]" != "[lindex $xfOptions 4]"} {
  665.               append xfResult " \\\n    [lindex $xfOptions 0] {[lindex $xfOptions 4]}"
  666.             }
  667.           }
  668.         }
  669. #      }
  670. #    }
  671.     append xfResult "\n"
  672.   }
  673. }
  674.  
  675. ##########
  676. # Procedure: XFXYGraphDeleteItem
  677. # Description: delete item from xygraph
  678. # Arguments: xfW - the widget
  679. #            xfClass - the class we configure
  680. # Returns: none
  681. # Sideeffects: none
  682. ##########
  683. proc XFXYGraphDeleteItem {xfW xfClass} {
  684.  
  685.   set xfCurSelected \
  686.     [.xf${xfClass}Config5.params1.params2.frame1.children.items.items curselection]
  687.   if {$xfCurSelected >= 0} {
  688.     set xfTag \
  689.       "[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]"
  690.     if {[lindex [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 0] == "<tag>"} {
  691.       catch "$xfW untag \{$xfTag\}"
  692.     } {
  693.       catch "$xfW delete \{$xfTag\}"
  694.     }
  695.  
  696.     set xfCounter 0
  697.     set xfLast \
  698.       [.xf${xfClass}Config5.params1.params2.frame1.children.items.items size]
  699.     if {"$xfLast" == "none"} {
  700.       set xfLast -1
  701.     }
  702.     while {$xfCounter < $xfLast} {
  703.       if {"$xfTag" == "[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCounter] 1 end]"} {
  704.         .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  705.           delete $xfCounter
  706.       }
  707.       incr xfCounter 1
  708.     }
  709.   }
  710. }
  711.  
  712. ##########
  713. # Procedure: XFXYGraphInsertItem
  714. # Description: insert item into xygraph
  715. # Arguments: xfW - the widget
  716. #            xfClass - the class we configure
  717. #            xfIndex - the target location in the graph
  718. # Returns: none
  719. # Sideeffects: none
  720. ##########
  721. proc XFXYGraphInsertItem {xfW xfClass {xfIndex ""}} {
  722.   global xfMisc
  723.  
  724.   if {"$xfIndex" == ""} {
  725.     set xfIndex end
  726.   }
  727.   set xfTag ""
  728.   set xfTagName \
  729.     [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.tag.tag get]
  730.   set xfCounter 0
  731.   if {[lsearch [$xfW names] "$xfTagName"] >= 0} {
  732.     XFProcError "There already exists an item named:\n$xfTagName"
  733.   } {
  734.     if {"$xfTagName" != ""} {
  735.       case $xfMisc(XYGraphCurrentType) in {
  736.         {<tag*} {
  737.           if {[catch "$xfW newtag \{$xfTagName\} \
  738.                 [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posx.posx get] \
  739.                 [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posy.posy get]" xfResult]} {
  740.             XFProcError "$xfResult"
  741.             return
  742.           } {
  743.             XFXYGraphSetXYGraph5 $xfW "$xfTagName" <tag> 1 $xfClass
  744.           }
  745.         }
  746.         {default} {
  747.           $xfW insert "$xfTagName"
  748.           XFXYGraphSetXYGraph5 $xfW "$xfTagName" <line> 1 $xfClass
  749.         }
  750.       }
  751.       .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  752.         insert end "$xfMisc(XYGraphCurrentType) $xfTagName"
  753.       .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  754.         select from $xfIndex 
  755.       .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  756.         select to $xfIndex 
  757.     }
  758.   }
  759. }
  760.  
  761. ##########
  762. # Procedure: XFXYGraphModifyItem
  763. # Description: modify item in graph
  764. # Arguments: xfW - the widget
  765. #            xfClass - the class we configure
  766. # Returns: none
  767. # Sideeffects: none
  768. ##########
  769. proc XFXYGraphModifyItem {xfW xfClass} {
  770.  
  771.   set xfCurSelected \
  772.     [.xf${xfClass}Config5.params1.params2.frame1.children.items.items curselection]
  773.   if {$xfCurSelected >= 0} {
  774.     XFXYGraphSetXYGraph5 $xfW \
  775.       "[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]" \
  776.       [lindex [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 0] 1 $xfClass
  777.     .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  778.       select from $xfCurSelected
  779.     .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  780.       select to $xfCurSelected
  781.   }
  782. }
  783.  
  784. ##########
  785. # Procedure: XFXYGraphReadXYGraph
  786. # Description: read current xygraph, and insert it into the lists
  787. # Arguments: xfW - the widget we configure 
  788. #            xfClass - the class we configure
  789. # Returns: none
  790. # Sideeffects: none
  791. ##########
  792. proc XFXYGraphReadXYGraph {xfW xfClass} {
  793.  
  794.   foreach xfCounter [$xfW names] {
  795.     .xf${xfClass}Config5.params1.params2.frame1.children.items.items insert end "<line> $xfCounter"
  796.   }
  797.   if {[.xf${xfClass}Config5.params1.params2.frame1.children.items.items size] > 0} {
  798.     .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  799.       select from 0
  800.     .xf${xfClass}Config5.params1.params2.frame1.children.items.items \
  801.       select to 0
  802.     XFXYGraphSetItem $xfW $xfClass
  803.   }
  804. }
  805.  
  806. ##########
  807. # Procedure: XFXYGraphSetItem
  808. # Description: set item fields to values from currently selected item
  809. # Arguments: xfW - the widget
  810. #            xfClass - the class we configure
  811. # Returns: none
  812. # Sideeffects: none
  813. ##########
  814. proc XFXYGraphSetItem {xfW xfClass} {
  815.   global xfMisc
  816.  
  817.   set xfCurSelected \
  818.     [.xf${xfClass}Config5.params1.params2.frame1.children.items.items curselection]
  819.   if {$xfCurSelected >= 0} {
  820.     case [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] in {
  821.       {<tag*} {
  822.         set xfMisc(XYGraphCurrentType) "<tag>"
  823.         .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m \
  824.           entryconfigure 1 -state active
  825.         XFXYGraphSetItems tag $xfClass
  826.         .xf${xfClass}Config5.leave.apply configure \
  827.           -command "
  828.             XFXYGraphSetXYGraph5 $xfW \{[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]\} <tag> 1 $xfClass"
  829.         .xf${xfClass}Config5.leave.applyperm configure \
  830.           -command "
  831.             XFXYGraphSetXYGraph5 $xfW \{[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]\} <tag> 0 $xfClass"
  832.       }
  833.       {default} {
  834.         set xfMisc(XYGraphCurrentType) "<line>"
  835.         .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.entries.m \
  836.           entryconfigure 0 -state active
  837.         XFXYGraphSetItems line $xfClass
  838.         .xf${xfClass}Config5.leave.apply configure \
  839.           -command "
  840.             XFXYGraphSetXYGraph5 $xfW \{[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]\} <line> 1 $xfClass"
  841.         .xf${xfClass}Config5.leave.applyperm configure \
  842.           -command "
  843.             XFXYGraphSetXYGraph5 $xfW \{[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]\} <line> 0 $xfClass"
  844.       }
  845.     }
  846.  
  847.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.tag.tag \
  848.       insert 0 \
  849.         "[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]"
  850.     if {[catch "$xfW lineconfigure \{[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]\}" xfResources]} {
  851.       catch "$xfW tagconfigure \{[lrange [.xf${xfClass}Config5.params1.params2.frame1.children.items.items get $xfCurSelected] 1 end]\}" xfResources
  852.     }
  853.     foreach xfCounter $xfResources {
  854.       # only handle options with 5 items per option entry
  855.       if {[llength $xfCounter] == 5} {
  856.         case [lindex $xfCounter 0] in {
  857.           {-anchor} {
  858.             case [lindex $xfCounter 4] in {
  859.               {nw} {
  860.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.nw select
  861.               }
  862.               {w} {
  863.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.w select
  864.               }
  865.               {sw} {
  866.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f1.sw select
  867.               }
  868.               {n} {
  869.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.n select
  870.               }
  871.               {c} {
  872.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.c select
  873.               }
  874.               {s} {
  875.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.s select
  876.               }
  877.               {ne} {
  878.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.ne select
  879.               }
  880.               {e} {
  881.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.e select
  882.               }
  883.               {se} {
  884.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f3.se select
  885.               }
  886.             }
  887.           }
  888.           {-background} {
  889.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg.bg \
  890.               delete 0 end
  891.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg.bg \
  892.               insert 0 [lindex $xfCounter 4]
  893.           }
  894.           {-bitmap} {
  895.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap \
  896.               delete 0 end
  897.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap \
  898.               insert 0 [lindex $xfCounter 4]
  899.           }
  900.           {-color} {
  901.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color.color \
  902.               delete 0 end
  903.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color.color \
  904.               insert 0 [lindex $xfCounter 4]
  905.           }
  906.           {-font} {
  907.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font.font \
  908.               delete 0 end
  909.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font.font \
  910.               insert 0 [lindex $xfCounter 4]
  911.           }
  912.           {-foreground} {
  913.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg.fg \
  914.               delete 0 end
  915.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg.fg \
  916.               insert 0 [lindex $xfCounter 4]
  917.           }
  918.           {-label} {
  919.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.label.label \
  920.               delete 0 end
  921.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.label.label \
  922.               insert 0 [lindex $xfCounter 4]
  923.           }
  924.           {-line} {
  925.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.name.name \
  926.               delete 0 end
  927.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.name.name \
  928.               insert 0 [lindex $xfCounter 4]
  929.           }
  930.           {-linewidth} {
  931.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.linewidth.linewidth \
  932.               set [lindex $xfCounter 4]
  933.           }
  934.           {-rotation} {
  935.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.rotate.rotate \
  936.               set [lindex $xfCounter 4]
  937.           }
  938.           {-symbolsize} {
  939.             .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.symbolsize.symbolsize \
  940.               set [lindex $xfCounter 4]
  941.           }
  942.           {-symbol} {
  943.             case [lindex $xfCounter 4] in {
  944.               {circle} {
  945.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1.circle select
  946.               }
  947.               {cross} {
  948.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym1.cross select
  949.               }
  950.               {dashed} {
  951.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2.dashed select
  952.               }
  953.               {diamond} {
  954.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym2.diamond select
  955.               }
  956.               {dotted} {
  957.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3.dotted select
  958.               }
  959.               {plus} {
  960.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym3.plus select
  961.               }
  962.               {point} {
  963.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.point select
  964.               }
  965.               {solid} {
  966.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.solid select
  967.               }
  968.               {square} {
  969.                 .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym5.square select
  970.               }
  971.             }
  972.           }
  973.           {-text} {
  974.             XFMiscSetText \
  975.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.text.text \
  976.                 [lindex $xfCounter 4]
  977.           }
  978.           {-xdata} {
  979.             XFMiscSetText \
  980.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.xdata.xdata \
  981.                 [lindex $xfCounter 4]
  982.           }
  983.           {-ydata} {
  984.             XFMiscSetText \
  985.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.ydata.ydata \
  986.                 [lindex $xfCounter 4]
  987.           }
  988.           {-xydata} {
  989.             set type 0
  990.             set xfXData ""
  991.             set xfYData ""
  992.             foreach element [lindex $xfCounter 4] {
  993.               if {$type == 0} {
  994.                 lappend xfXData $element
  995.                 set type 1
  996.               } {
  997.                 lappend xfYData $element
  998.                 set type 0
  999.               }
  1000.             }
  1001.             XFMiscSetText \
  1002.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.xdata.xdata $xfXData
  1003.             XFMiscSetText \
  1004.               .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.ydata.ydata $xfYData
  1005.           }
  1006.         }
  1007.       }
  1008.     }
  1009.   }
  1010. }
  1011.  
  1012. ##########
  1013. # Procedure: XFXYGraphSetItems
  1014. # Description: set item fields for currently selected widget
  1015. # Arguments: xfType - the type we want to edit
  1016. #            xfClass - the class we configure
  1017. # Returns: none
  1018. # Sideeffects: none
  1019. ##########
  1020. proc XFXYGraphSetItems {xfType xfClass} {
  1021.  
  1022.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.tag
  1023.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor
  1024.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg
  1025.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap
  1026.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color
  1027.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font
  1028.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg
  1029.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.label
  1030.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.name
  1031.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posx
  1032.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posy
  1033.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.linewidth
  1034.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.rotate
  1035.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym
  1036.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.symbolsize
  1037.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message6
  1038.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.text
  1039.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message3
  1040.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.xdata
  1041.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message4
  1042.   pack unpack .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.ydata
  1043.  
  1044.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.tag.tag \
  1045.     delete 0 end
  1046.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor.anchor.f2.c \
  1047.     select
  1048.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg.bg \
  1049.     delete 0 end
  1050.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap \
  1051.     delete 0 end
  1052.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color.color \
  1053.     delete 0 end
  1054.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font.font \
  1055.     delete 0 end
  1056.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg.fg \
  1057.     delete 0 end
  1058.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.label.label \
  1059.     delete 0 end
  1060.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.name.name \
  1061.     delete 0 end
  1062.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.linewidth.linewidth \
  1063.     set 0
  1064.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posx.posx \
  1065.     delete 0 end
  1066.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posy.posy \
  1067.     delete 0 end
  1068.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.rotate.rotate \
  1069.     set 0
  1070.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym.sym1.sym4.solid \
  1071.     select
  1072.   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.symbolsize.symbolsize \
  1073.     set 0
  1074.   XFMiscSetText \
  1075.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.text.text
  1076.   XFMiscSetText \
  1077.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.xdata.xdata
  1078.   XFMiscSetText \
  1079.     .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.ydata.ydata
  1080.  
  1081.   case $xfType in {
  1082.     {tag} {
  1083.       .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.message1 \
  1084.         configure -text "Tag"
  1085.  
  1086.       pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  1087.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.tag {top fillx} \
  1088.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.anchor {top fillx} \
  1089.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg {top fillx} \
  1090.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap {top fillx} \
  1091.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font {top fillx} \
  1092.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg {top fillx} \
  1093.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.name {top fillx} \
  1094.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posx {top fillx} \
  1095.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.posy {top fillx} \
  1096.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.rotate {top fillx} \
  1097.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message6 {top fillx} \
  1098.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.text {top fillx}
  1099.     }
  1100.     {default} {
  1101.       .xf${xfClass}Config5.params1.params2.frame1.elements.elem1.message1 \
  1102.         configure -text "Line"
  1103.  
  1104.       pack append .xf${xfClass}Config5.params1.params2.frame1.elements.elem2 \
  1105.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.tag {top fillx} \
  1106.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color {top fillx} \
  1107.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.label {top fillx} \
  1108.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.linewidth {top fillx} \
  1109.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.sym {top fillx} \
  1110.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.symbolsize {top fillx} \
  1111.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message3 {top fillx} \
  1112.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.xdata {top fillx} \
  1113.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.message4 {top fillx} \
  1114.                   .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.ydata {top fillx}
  1115.     }
  1116.   }
  1117.   XFBindFormConnect .xf${xfClass}Config5.params1.params2.frame1.elements.elem2
  1118. }
  1119.  
  1120. ##########
  1121. # Procedure: XFXYGraphSetXYGraph4
  1122. # Description: set xygraph parameters
  1123. # Arguments: xfW - the widget
  1124. #            xfType - the type of setting (1 = set always, 0 = set
  1125. #                     only if permanent apply is on)
  1126. #            xfClass - the class we configure
  1127. #            xfParam1 - ignored parameter
  1128. # Returns: none
  1129. # Sideeffects: none
  1130. ##########
  1131. proc XFXYGraphSetXYGraph4 {xfW xfType xfClass {xfParam1 ""}} {
  1132.   global xfConf
  1133.   global xfMisc
  1134.  
  1135.   if {$xfType == 0 && !$xfConf(applyParameters)} {
  1136.     return
  1137.   }
  1138.   if {"[info commands $xfW]" == ""} {
  1139.     return
  1140.   }
  1141.   XFMiscSetSymbolicName $xfW \
  1142.     [.xf${xfClass}Config4.params1.params2.symname.symname get]
  1143.  
  1144.   XFMiscSetResource $xfW background \
  1145.     [.xf${xfClass}Config4.params1.params2.bg.bg get]
  1146.   XFMiscSetResource $xfW borderwidth \
  1147.     [.xf${xfClass}Config4.params1.params2.borderwidth.borderwidth get]
  1148.   XFMiscSetResource $xfW font \
  1149.     [.xf${xfClass}Config4.params1.params2.font.font get]
  1150.   XFMiscSetResource $xfW foreground \
  1151.     [.xf${xfClass}Config4.params1.params2.fg.fg get]
  1152.   if {[.xf${xfClass}Config4.params1.params2.geo.geo1.geo1 get] > 0 &&
  1153.       [.xf${xfClass}Config4.params1.params2.geo.geo2.geo2 get] > 0} {
  1154.     XFMiscSetResource $xfW geometry \
  1155.       "[.xf${xfClass}Config4.params1.params2.geo.geo1.geo1 get]x[.xf${xfClass}Config4.params1.params2.geo.geo2.geo2 get]"
  1156.   }
  1157.   if {[.xf${xfClass}Config4.params1.params2.lpos.lpos1.lpos1 get] > 0 &&
  1158.       [.xf${xfClass}Config4.params1.params2.lpos.lpos2.lpos2 get] > 0} {
  1159.     XFMiscSetResource $xfW legendposition \
  1160.       "@[.xf${xfClass}Config4.params1.params2.lpos.lpos1.lpos1 get],[.xf${xfClass}Config4.params1.params2.lpos.lpos2.lpos2 get]"
  1161.   }
  1162.   XFMiscSetResource $xfW retrace $xfMisc(retrace)
  1163.   XFMiscSetResource $xfW showlegend $xfMisc(showlegend)
  1164.   XFMiscSetResource $xfW title \
  1165.     [.xf${xfClass}Config4.params1.params2.title.title get]
  1166.   XFMiscSetResource $xfW xlabel \
  1167.     [.xf${xfClass}Config4.params1.params2.xlabel.xlabel get]
  1168.   XFMiscSetResource $xfW xlog $xfMisc(xlogscale)
  1169.   XFMiscSetResource $xfW xstepsize \
  1170.     [.xf${xfClass}Config4.params1.params2.xstepsize.xstepsize get]
  1171.   XFMiscSetResource $xfW xsubticks \
  1172.     [.xf${xfClass}Config4.params1.params2.xsubticks.xsubticks get]
  1173.   XFMiscSetResource $xfW ylabel \
  1174.     [.xf${xfClass}Config4.params1.params2.ylabel.ylabel get]
  1175.   XFMiscSetResource $xfW ylog $xfMisc(ylogscale)
  1176.   XFMiscSetResource $xfW ystepsize \
  1177.     [.xf${xfClass}Config4.params1.params2.ystepsize.ystepsize get]
  1178.   XFMiscSetResource $xfW ysubticks \
  1179.     [.xf${xfClass}Config4.params1.params2.ysubticks.ysubticks get]
  1180. }
  1181.  
  1182. ##########
  1183. # Procedure: XFXYGraphSetXYGraph5
  1184. # Description: set xygraph parameters
  1185. # Arguments: xfW - the widget
  1186. #            xfTag - the tag we modify
  1187. #            xfTagType - the type of the tag we modify
  1188. #            xfType - the type of setting (1 = set always, 0 = set
  1189. #                     only if permanent apply is on)
  1190. #            xfClass - the class we configure
  1191. #            xfParam1 - ignored parameter
  1192. # Returns: none
  1193. # Sideeffects: none
  1194. ##########
  1195. proc XFXYGraphSetXYGraph5 {xfW xfTag xfTagType xfType xfClass {xfParam1 ""}} {
  1196.   global xfConf
  1197.   global xfMisc
  1198.  
  1199.   if {$xfType == 0 && !$xfConf(applyParameters)} {
  1200.     return
  1201.   }
  1202.   if {"[info commands $xfW]" == ""} {
  1203.     return
  1204.   }
  1205.   XFMiscSetSymbolicName $xfW \
  1206.     [.xf${xfClass}Config5.params1.params2.symname.symname get]
  1207.  
  1208.   case $xfTagType in {
  1209.     {<tag>} {
  1210.       catch "$xfW tagconfigure \{$xfTag\} -anchor $xfMisc(XYGraphAnchor)"
  1211.       if {"[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg.bg get]" != ""} {
  1212.         catch "$xfW tagconfigure \{$xfTag\} \
  1213.           -background \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bg.bg get]\}"
  1214.       }
  1215.       if {"[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap get]" != ""} {
  1216.         if {"[string index [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap get] 0]" == "@"} {
  1217.           catch "$xfW tagconfigure \{$xfTag\} -bitmap \
  1218.             \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap get]\}"
  1219.         } {
  1220.           if {[file exists [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap get]]} {
  1221.             catch "$xfW tagconfigure \{$xfTag\} -bitmap \
  1222.               \{@[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap get]\}"
  1223.           } {
  1224.             catch "$xfW tagconfigure \{$xfTag\} -bitmap \
  1225.               \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.bitmap.bitmap get]\}"
  1226.           }
  1227.         }
  1228.       } {
  1229.         catch "$xfW tagconfigure \{$xfTag\} -bitmap {}"
  1230.       }
  1231.       if {"[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font.font get]" != ""} {
  1232.         catch "$xfW tagconfigure \{$xfTag\} \
  1233.           -font \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.font.font get]\}"
  1234.       }
  1235.       if {"[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg.fg get]" != ""} {
  1236.         catch "$xfW tagconfigure \{$xfTag\} \
  1237.           -foreground \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.fg.fg get]\}"
  1238.       }
  1239.       catch "$xfW tagconfigure \{$xfTag\} \
  1240.         -line \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.name.name get]\}"
  1241.       catch "$xfW tagconfigure \{$xfTag\} \
  1242.         -rotation [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.rotate.rotate get]"
  1243.       if {[XFMiscGetText .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.text.text] != ""} {
  1244.         catch "$xfW tagconfigure \{$xfTag\} \
  1245.           -text \{[XFMiscGetText .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.text.text]\}"
  1246.       }
  1247.     }
  1248.     {default} {
  1249.       if {"[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color.color get]" != ""} {
  1250.         catch "$xfW lineconfigure \{$xfTag\} \
  1251.           -color \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.color.color get]\}"
  1252.       }
  1253.       catch "$xfW lineconfigure \{$xfTag\} \
  1254.         -linewidth [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.linewidth.linewidth get] \
  1255.         -symbolsize [.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.symbolsize.symbolsize get] \
  1256.         -label \{[.xf${xfClass}Config5.params1.params2.frame1.elements.elem2.label.label get]\} \
  1257.         -symbol $xfMisc(XYGraphSymbol)"
  1258.       set xfXData [string trim [XFMiscGetText .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.xdata.xdata]]
  1259.       set xfYData [string trim [XFMiscGetText .xf${xfClass}Config5.params1.params2.frame1.elements.elem2.ydata.ydata]]
  1260.       if {"$xfXData" != "" && "$xfYData" != "" &&
  1261.           [expr [expr [llength $xfXData]+[llength $xfYData]]%2] == 0 &&
  1262.           [llength $xfXData] == [llength $xfYData]} {
  1263.         if {[catch "$xfW lineconfigure \{$xfTag\} \
  1264.                -xdata \{$xfXData\} -ydata \{$xfYData\}" xfResult]} {
  1265.           XFProcError "$xfResult"
  1266.         }
  1267.       }
  1268.     }
  1269.   }
  1270. }
  1271.  
  1272. # eof
  1273.  
  1274.