1 #-----------------------------------------------------------------
2 # Procedures to generate and display a help window in xcircuit
3 #-----------------------------------------------------------------
5 proc xcircuit
::printhelp {} {
6 set csel
[.help.listwin.func curselection
]
7 if {$csel == ""} {return}
8 set key
[.help.listwin.func get
$csel]
10 {Page
} {.help.listwin.win configure
-text \
11 "Switch to the indicated page."}
12 {Justify
} {.help.listwin.win configure
-text \
13 "Change justification of the currently selected or\
15 {Text Delete
} {.help.listwin.win configure
-text \
16 "When editing a label, delete one character."}
17 {Text Return
} {.help.listwin.win configure
-text \
18 "When editing a label, accept edits and return to normal drawing mode."}
19 {Text Left
} {.help.listwin.win configure
-text \
20 "When editing a label, move cursor left one character or procedure."}
21 {Text Right
} {.help.listwin.win configure
-text \
22 "When editing a label, move cursor right one character or procedure."}
23 {Text Up
} {.help.listwin.win configure
-text \
24 "When editing a multi-line label, move cursor up one line of text."}
25 {Text Down
} {.help.listwin.win configure
-text \
26 "When editing a multi-line label, move cursor down one line of text."}
27 {Text Split
} {.help.listwin.win configure
-text \
28 "When editing a label, split the label into two separate labels at\
29 the cursor position."}
30 {Text Home
} {.help.listwin.win configure
-text \
31 "When editing a label, move cursor to the beginning of the label."}
32 {Text End
} {.help.listwin.win configure
-text \
33 "When editing a label, move cursor to the end of the label."}
34 {Tab Forward
} {.help.listwin.win configure
-text \
35 "When editing a label, move forward to the next defined tab stop."}
36 {Tab Backward
} {.help.listwin.win configure
-text \
37 "When editing a label, move backward to the previously defined tab stop."}
38 {Tab Stop
} {.help.listwin.win configure
-text \
39 "When editing a label, declare a tab stop at the current horizontal cursor\
40 position. This may be used to align text in multiple lines to certain\
42 {Superscript
} {.help.listwin.win configure
-text \
43 "When editing a label, make text superscripted (about 2/3 size, and\
44 raised about half a line)."}
45 {Subscript
} {.help.listwin.win configure
-text \
46 "When editing a label, make text subscripted (about 2/3 size, and\
47 lowered about 3/4 of a line)."}
48 {Normalscript
} {.help.listwin.win configure
-text \
49 "When editing a label, return from a subscript or superscript alignment\
50 to a normal text alignment."}
51 {Nextfont
} {.help.listwin.win configure
-text \
52 "When editing a label, change the font at the cursor position to the\
53 next font family in the list. This will cycle through all of the\
54 defined fonts if executed repeatedly."}
55 {Boldfont
} {.help.listwin.win configure
-text \
56 "When editing a label, change the current font family to a boldface\
58 {Italicfont
} {.help.listwin.win configure
-text \
59 "When editing a label, change the current font family to an italic\
60 or slanted type, if available."}
61 {Normalfont
} {.help.listwin.win configure
-text \
62 "When editing a label, change the current font family to a regular\
63 type (non-italic, non-bold)."}
64 {Underline
} {.help.listwin.win configure
-text \
65 "When editing a label, begin underlining the text."}
66 {Overline
} {.help.listwin.win configure
-text \
67 "When editing a label, begin overlining the text."}
68 {ISO Encoding
} {.help.listwin.win configure
-text \
69 "When editing a label, change the font encoding from normal to ISO."}
70 {Linebreak
} {.help.listwin.win configure
-text \
71 "When editing a label, append a linebreak to the label. This generates\
73 {Halfspace
} {.help.listwin.win configure
-text \
74 "When editing a label, insert a half-space."}
75 {Quarterspace
} {.help.listwin.win configure
-text \
76 "When editing a label, insert a quarter-space."}
77 {Special
} {.help.listwin.win configure
-text \
78 "When editing a label, insert a special character. This is a command\
79 that brings up the font encoding array, allowing the user to select\
80 any character from the current font in the current encoding type."}
81 {Parameter
} {.help.listwin.win configure
-text \
82 "When editing a label, insert a parameter. The parameter must first\
83 exist in the current object. If only one parameter is defined, it\
84 will be inserted. If more than one parameter is defined, a selection\
85 box will appear, allowing the user to select which parameter to\
86 insert into the text."}
87 {Parameterize Point
} {.help.listwin.win configure
-text \
88 "When editing a polygon, parameterize the X and Y position of the\
89 currently edited point. The point may then be at a different\
90 position in different instances of the current object."}
91 {Break at Point
} {.help.listwin.win configure
-text \
92 "When editing a polygon, break the polygon into two pieces at\
93 the currently edited point."}
94 {Delete Point
} {.help.listwin.win configure
-text \
95 "When editing a polygon, remove the currently edited point, and\
96 move to the next point."}
97 {Insert Point
} {.help.listwin.win configure
-text \
98 "When editing a polygon, insert a point at the same position as\
99 the currently edited point."}
100 {Append Point
} {.help.listwin.win configure
-text \
101 "When editing a polygon, append a point at the same position as\
102 the currently edited point, and move the currently edited point\
104 {Next Point
} {.help.listwin.win configure
-text \
105 "When editing a polygon, move to the next point."}
106 {Attach
} {.help.listwin.win configure
-text \
107 "When editing a polygon, select the nearest element that is not\
108 the polygon, and force the currently edited point to terminate\
109 on that element. The element to attach to may be a polygon, an\
110 arc, a spline, or a path. The edit point will continue to follow\
111 the cursor within the constraint that it must remain connected to\
113 {Virtual Copy
} {.help.listwin.win configure
-text \
114 "Create a virtual library instance of the currently selected\
115 object instance. This will duplicate the existing library entry\
116 but will have the scale and rotation of the selected instance,\
117 as well as any non-default parameters given to that instance."}
118 {Next Library
} {.help.listwin.win configure
-text \
119 "When on a library page, go to the next defined library. The\
120 User Library is always last, and then the function cycles back\
121 to the first defined library."}
122 {Library Directory
} {.help.listwin.win configure
-text \
123 "Go to the master list of libraries."}
124 {Library Copy
} {.help.listwin.win configure
-text \
125 "When on a library page, select the object under the cursor and\
126 any selected objects, and return to the originating page in\
128 {Library Edit
} {.help.listwin.win configure
-text \
129 "When on a library page, edit the name of an object by editing\
130 the text label underneath the picture of the object."}
131 {Library Delete
} {.help.listwin.win configure
-text \
132 "When on a library page, remove the selected object from the\
133 library. An object can be removed only if there are no instances\
134 of that object on any page or in the hierarchy of another object.\
135 A removed object is destroyed and cannot be recovered."}
136 {Library Duplicate
} {.help.listwin.win configure
-text \
137 "When on a library page, create a duplicate object of the selected\
138 object, placing it in the User Library."}
139 {Library Hide
} {.help.listwin.win configure
-text \
140 "When on a library page, remove the selected object from view but\
141 do not destroy it. An object can be hidden from view only if\
142 it exists in the hierarchy of another object (such as the arrow
143 object inside the current source object)."}
144 {Library Virtual Copy
} {.help.listwin.win configure
-text \
145 "When on a library page, create a duplicate instance of the\
146 selected object. The duplicate instance may have different\
147 (instanced) parameters. Default parameters are defined by\
148 the master object. The name of the master object is printed\
149 in black, while the names of virtual instances are in gray.\
150 To define a virtual copy with different scale or rotation,\
151 use the (non-Library) Virtual Copy function."}
152 {Library Move
} {.help.listwin.win configure
-text \
153 "When on a library page, move the position of an object relative\
154 to other objects. If one object is selected, it will be moved\
155 to the position nearest the cursor. If two objects are selected,\
156 their positions will be swapped. If in the Page Directory, the\
157 relative positions of pages may be changed with the same function."}
158 {Library Pop
} {.help.listwin.win configure
-text \
159 "When on a library page, return to the originating page."}
160 {Page Directory
} {.help.listwin.win configure
-text \
161 "Go to the master list of pages."}
162 {Help
} {.help.listwin.win configure
-text \
163 "Display the window of help information and key bindings."}
164 {Redraw
} {.help.listwin.win configure
-text \
165 "Redraw everything in the window."}
166 {View
} {.help.listwin.win configure
-text \
167 "Scale and position the view of the current page so that elements\
168 on the page fill the window to the maximum extent possible (minus\
169 small margins on all sides)."}
170 {Zoom In
} {.help.listwin.win configure
-text \
171 "Increase the magnification of the view of the current page in\
172 the window. The location of the page at the center point of the\
173 window remains at the center."}
174 {Zoom Out
} {.help.listwin.win configure
-text \
175 "Decrease the magnification of the view of the current page in\
176 the window. The location of the page at the center point of the\
177 window remains at the center."}
178 {Pan
} {.help.listwin.win configure
-text \
179 "Change the view of the current page. There are various modes,\
180 including here, center, left, right, up, down, and follow. Pan\
181 center changes the view such that the point nearest\
182 the cursor becomes the center point of the window. Pan up, down,\
183 right, and left change the view by one-half page in the indicated\
185 {Double Snap
} {.help.listwin.win configure
-text \
186 "Increase the spacing between snap points by a factor of two."}
187 {Halve Snap
} {.help.listwin.win configure
-text \
188 "Decrease the spacing between snap points by half."}
189 {Write
} {.help.listwin.win configure
-text \
190 "Display the Output Properties and File Write window. If output\
191 properties are changed but user does not want to write the file\
192 (such as when attaching multiple pages or schematics), use the\
193 Cancel button to accept all applied changes and pop down the\
194 window without writing."}
195 {Rotate
} {.help.listwin.win configure
-text \
196 "Rotate the selected elements, or element nearest the cursor, by\
197 the number of degrees in the argument. A positive number indicates\
198 a clockwise rotation, a negative number, a counterclockwise\
200 {Flip X
} {.help.listwin.win configure
-text \
201 "Flip the selected elements, or element nearest the cursor, in the\
202 horizontal (X) direction (that is, across the Y axis). The axis\
203 defining the flip is the vertical line passing through the cursor X\
205 {Flip Y
} {.help.listwin.win configure
-text \
206 "Flip the selected elements, or element nearest the cursor, in the\
207 vertical (Y) direction (that is, across the X axis). The axis\
208 defining the flip is the horizontal line passing through the cursor\
210 {Snap
} {.help.listwin.win configure
-text \
211 "Snap the selected elements, or element nearest the cursor, to the\
212 nearest point on the snap grid. Each point of a polygon is snapped.\
213 Spline control points and arc centers are snapped. Label and object\
214 instance reference positions are snapped."}
215 {Pop
} {.help.listwin.win configure
-text \
216 "Return from editing an object (return from the last push)."}
217 {Push
} {.help.listwin.win configure
-text \
218 "Edit the object represented by the selected object instance, or the\
219 object instance closest to the cursor. The current page is pushed\
220 onto a stack, and the object becomes the current page."}
221 {Delete
} {.help.listwin.win configure
-text \
222 "Delete the selected elements or element closest to the cursor."}
223 {Select
} {.help.listwin.win configure
-text \
224 "Select the element or elements near the cursor. If multiple\
225 elements match the selection criteria, an interactive method is\
226 initiated in which individual elements may be selected or rejected\
227 by pressing the mouse buttons 2 or 3, respectively."}
228 {Box
} {.help.listwin.win configure
-text \
229 "Begin drawing a box in the current default style. One corner of\
230 the box is anchored at the cursor position, and the other corner\
231 dragged with the cursor. The box is completed by pressing buttons\
232 1 or 2 or canceled with button 3."}
233 {Arc
} {.help.listwin.win configure
-text \
234 "Begin drawing a circle in the current default style. The center\
235 of the circle is anchored at the cursor position, and the radius\
236 is defined by dragging the cursor to the desired position. Button\
237 2 completes the arc, and button 3 cancels it. Button 1 switches\
238 from defining the arc radius to (in sequence) defining the arc\
239 start and stop angles, and defining the ellipse minor axis."}
240 {Text
} {.help.listwin.win configure
-text \
241 "Begin a normal text label. In text edit mode, all keystrokes are\
242 interpreted as input to the label, except for the key that is bound\
243 to action Text Return. Mouse buttons 1 and 2 complete the text\
244 label, while button 3 cancels (deletes) the label."}
245 {Exchange
} {.help.listwin.win configure
-text \
246 "If two elements are selected, their relative positions (drawing\
247 order) are swapped (drawing order determines what objects obscure\
248 other objects when overlapping). If one element is selected, it\
249 is brought to the front of the drawing, unless it is already at\
250 the front, in which case it is sent to the back."}
251 {Copy
} {.help.listwin.win configure
-text \
252 "Make a copy of the selected elements or element closest to the\
253 cursor. Elements are dragged as a group with the cursor. Mouse\
254 button 1 places the copies, creates a new set of copies, and\
255 continues the copy operation. Mouse button 2 places the copies\
256 and ends the copy operation. Mouse button 3 removes the current\
257 selection being dragged and completes the copy operation."}
258 {Move
} {.help.listwin.win configure
-text \
259 "Move the selected elements or element nearest the cursor. This\
260 function is normally handled by the mouse button press, not the\
262 {Join
} {.help.listwin.win configure
-text \
263 "Join selected elements into a single element. If all of the selected\
264 elements are polygons, the new element will be a single polygon. If\
265 the selected elements include a mixture of one or more types\
266 (polygons, arcs, splines, and paths), the resulting type will be a\
268 {Unjoin
} {.help.listwin.win configure
-text \
269 "Break the selected path or path nearest the cursor into its\
270 constituent elements. This operation applies only to paths."}
271 {Spline
} {.help.listwin.win configure
-text \
272 "Begin a bezier curve (inconsistently and, technically, incorrectly\
273 referred to in XCircuit documentation as a spline). The curve is\
274 anchored at the cursor position, and the other endpoint of the\
275 curve is dragged with the cursor. Mouse button 2 completes the\
276 curve. Mouse button 3 cancels (deletes) the curve. Mouse button\
277 1 switches between the two endpoints and two control points."}
278 {Edit
} {.help.listwin.win configure
-text \
279 "Edit the selected element or element nearest the cursor. The\
280 edit function applies to polygons, arcs, splines, paths, and\
281 labels, but not to object instances (editing the instance implies\
282 editing the object itself, which requires the Push function).\
283 Editing a label, arc, or spline is the same as creating it.\
284 Editing a polygon (including boxes and wires) allows individual\
285 points to be selected and moved. In all cases except labels,\
286 mouse button 1 moves to the next point, mouse button 2 completes\
287 the edit, and mouse button 3 cancels the last edit maneuver."}
288 {Undo
} {.help.listwin.win configure
-text \
289 "Undo the last action. Note that not all actions are undoable."}
290 {Redo
} {.help.listwin.win configure
-text \
291 "Perform again the last action which was undone with the Undo\
293 {Select Save
} {.help.listwin.win configure
-text \
294 "Take all of the selected elements and turn them into a new\
295 object. The individual elements will be removed from the page\
296 and replaced with an instance of the newly defined object, and\
297 the object itself will be placed in the User Library. The\
298 user will be prompted for a name of the new library object."}
299 {Unselect
} {.help.listwin.win configure
-text \
300 "Remove the element closest to the cursor from the list of\
301 currently selected objects."}
302 {Dashed
} {.help.listwin.win configure
-text \
303 "Set the border style of the selected elements or element\
304 closest to the cursor to a dashed line."}
305 {Dotted
} {.help.listwin.win configure
-text \
306 "Set the border style of the selected elements or element\
307 closest to the cursor to a dotted line."}
308 {Solid
} {.help.listwin.win configure
-text \
309 "Set the border style of the selected elements or element\
310 closest to the cursor to a solid line."}
311 {Prompt
} {.help.listwin.win configure
-text \
312 "Generate the TCL command prompt."}
313 {Dot
} {.help.listwin.win configure
-text \
314 "Create a solder dot, connecting wires passing through it. The\
315 dot is placed at the current cursor position. If a library\
316 object named dot exists, it is used."}
317 {Wire
} {.help.listwin.win configure
-text \
318 "Begin drawing a wire (or unclosed polygon). The wire is anchored\
319 at the cursor position, and the other end is dragged with the\
320 cursor. Mouse button 1 anchors the endpoint and starts a new\
321 wire segment. Mouse button 2 anchors the endpoint and completes\
322 the wire. Mouse button 3 deletes the last anchored point."}
323 {Nothing
} {.help.listwin.win configure
-text \
324 "Null function. Does nothing."}
325 {Exit
} {.help.listwin.win configure
-text \
326 "Exit the program immediately without prompting for action on\
327 pages which have been changed but not saved."}
328 {Start
} {.help.listwin.win configure
-text \
329 "General-purpose start function, normally associated with mouse\
331 {Finish
} {.help.listwin.win configure
-text \
332 "General-purpose completion function, normally associated with mouse\
334 {Cancel
} {.help.listwin.win configure
-text \
335 "General-purpose cancelation function, normally associated with mouse\
337 {Snap To
} {.help.listwin.win configure
-text \
338 "Toggle the state of the snapping function. If on, points and element\
339 positions are always snapped to the snap grid. If off, points and\
340 element position are unconstrained."}
341 {Netlist
} {.help.listwin.win configure
-text \
342 "Generate a netlist of the default type."}
343 {Swap
} {.help.listwin.win configure
-text \
344 "Switch between editing a schematic and its symbol. If the schematic\
345 covers multiple pages, will switch between the secondary page, primary\
347 {Pin Label
} {.help.listwin.win configure
-text \
348 "Create a local pin, a label that is interpreted as\
349 the primary name of the network to which it is attached."}
350 {Pin Global
} {.help.listwin.win configure
-text \
351 "Create a global pin, a label that is interpreted as\
352 belonging to the same network whereever it occurs on\
354 {Info Label
} {.help.listwin.win configure
-text \
355 "Create an info label, a label that is not displayed\
356 except when editing the object, and which is parsed\
357 to extract information on how to output the device in\
359 {Connectivity
} {.help.listwin.win configure
-text \
360 "Highlight the connectivity of the electrical network\
361 that includes the selected item or that is closest\
362 to the cursor. Item must be a valid network element."}
363 {Sim
} {.help.listwin.win configure
-text \
364 "Generate a .sim (flat) netlist from the current page schematic,\
365 especially for use with the IRSIM simulator and the netgen and\
366 gemini LVS netlist comparators."}
367 {SPICE
} {.help.listwin.win configure
-text \
368 "Generate a .spc (hierarchical) netlist from the current page\
369 schematic. The format is compatible with Berkeley spice3 and\
371 {PCB
} {.help.listwin.win configure
-text \
372 "Generate a .pcbnet netlist from the current page schematic.\
373 This format is compatible with the pcb layout program."}
374 {SPICE Flat
} {.help.listwin.win configure
-text \
375 "Generate a .fspc (flattened) SPICE netlist from the current\
377 {default} {.help.listwin.win configure
-text ""}
381 #-----------------------------------------------------------------
382 # Procedure to generate the help window
383 #-----------------------------------------------------------------
385 proc xcircuit
::makehelpwindow {} {
386 toplevel .help
-bg beige
389 frame .help.title
-bg beige
392 pack .help.title
-side top
-fill x
393 pack .help.listwin
-side top
-fill both
-expand true
395 label .help.title.field
-text "XCircuit Help" -bg beige
396 button .help.title.dbut
-text "Dismiss" -bg beige
-command {wm withdraw .help
}
397 pack .help.title.field
-side left
-padx 10
398 pack .help.title.dbut
-side right
-ipadx 10
400 listbox .help.listwin.func
-yscrollcommand ".help.listwin.sb set" \
401 -setgrid 1 -height 20
402 listbox .help.listwin.keys
-yscrollcommand ".help.listwin.sb set" \
403 -setgrid 1 -height 20
404 scrollbar .help.listwin.sb
-orient vertical
-command \
405 [list scrollboth
[list .help.listwin.func .help.listwin.keys
]]
406 message .help.listwin.win
-width 200 -justify left
-anchor n
\
407 -relief groove
-text "Click on a function for help text"
409 grid .help.listwin.func
-row 0 -column 0 -sticky news
-padx 1 -pady 1
410 grid .help.listwin.keys
-row 0 -column 1 -sticky news
-padx 1 -pady 1
411 grid .help.listwin.sb
-row 0 -column 2 -sticky ns
-padx 1 -pady 1
412 grid .help.listwin.win
-row 0 -column 3 -sticky news
-padx 1 -pady 1
414 grid columnconfigure .help.listwin
1 -weight 1 -minsize 100
415 grid rowconfigure .help.listwin
0 -weight 1 -minsize 100
417 bind .help.listwin.func
<ButtonRelease-1
> "xcircuit::printhelp"
420 #-----------------------------------------------------------------
421 # Procedure to update and display the help window
422 #-----------------------------------------------------------------
424 proc xcircuit
::helpwindow {} {
426 # Create the help window if it doesn't exist
427 if {[catch {wm state .help
}]} {
428 xcircuit
::makehelpwindow
431 .help.listwin.func delete
0 end
432 .help.listwin.keys delete
0 end
434 set k
[lsort -dictionary [xcircuit
::bindkey]]
436 .help.listwin.func insert end
"Function"
437 .help.listwin.keys insert end
"Keys"
438 .help.listwin.func insert end
""
439 .help.listwin.keys insert end
""
442 set pkeys
[xcircuit
::bindkey -func $i]
443 .help.listwin.func insert end
"$i"
444 .help.listwin.keys insert end
"$pkeys"
450 #-----------------------------------------------------------------