home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume17 / tcleditr / part11 < prev    next >
Encoding:
Text File  |  1992-03-17  |  31.9 KB  |  798 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!msi!dcmartin
  3. From: crowley@chaco.cs.unm.edu (Charlie Crowley)
  4. Subject: v17i012: point text editor (TCL and TK), Part11/16
  5. Message-ID: <1992Mar18.141721.27373@msi.com>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-17i002-tcl-editor@uunet.UU.NET>
  10. Date: Wed, 18 Mar 1992 14:17:21 GMT
  11. Approved: dcmartin@msi.com
  12.  
  13. Submitted-by: crowley@chaco.cs.unm.edu (Charlie Crowley)
  14. Posting-number: Volume 17, Issue 12
  15. Archive-name: tcl-editor/part11
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 10 (of 15)."
  24. # Contents:  doc/cmds.tex
  25. # Wrapped by crowley@chaco.cs.unm.edu on Tue Mar 10 15:05:47 1992
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'doc/cmds.tex' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'doc/cmds.tex'\"
  29. else
  30. echo shar: Extracting \"'doc/cmds.tex'\" \(30230 characters\)
  31. sed "s/^X//" >'doc/cmds.tex' <<'END_OF_FILE'
  32. X\section{Point Commands} \label{sect:commands}
  33. X
  34. In this section I will describe each of the commands that Point understands.
  35. XEach command entry begins with the command name and then gives a description
  36. of the effect of the command.
  37. Some commands have arguments which are given after the command name.
  38. All arguments are strings.
  39. X
  40. Commands that insert text insert it at the insertion point.
  41. Commands that operate on the selection operate on the selection window.
  42. Other commands operate in the active window (the last window the
  43. mouse entered) unless the optional ``tkPathName'' argument is present.
  44. If it is present then it is the Tk path name for the window
  45. which will be affected by the command.
  46. X
  47. X
  48. X\subsection{Editing Commands}
  49. X
  50. X\subsubsection{InsertAscii numericChar}
  51. This command allows you to insert any eight bit character into the file.
  52. The argument `numericChar' can specify the character as a decimal integer.
  53. X
  54. X\subsubsection{ChangeCaseOfSel \{toupper$\mid$tolower$\mid$toggle\}}
  55. This command changes the case
  56. of each letter in the selection.
  57. Non-letter characters are unaffected.
  58. The argument determines how the case is changed:
  59. to upper case, to lower case or change case
  60. X(lower goes to upper and upper goes to lower).
  61. If the argument is missing or empty it defaults to ``toggle''.
  62. X
  63. X\subsubsection{CopyToScrap}
  64. Copies the selection to the scrap buffer.
  65. The selection is unaffected.
  66. The previous contents of the scrap buffer are lost.
  67. X
  68. X{\bf Usage hint:} {\it to copy the selected text somewhere:
  69. invoke CopySelToScrap, move to the insertion location and
  70. select it and then invoke InsertFromScrap.}
  71. X
  72. X\subsubsection{DeleteToScrap}
  73. The selected text is deleted and placed in the scrap buffer.
  74. The previous contents of the scrap buffer are lost.
  75. X
  76. X\subsubsection{ExchangeWithScrap}
  77. The contents of the scrap buffer and the selection are exchanged.
  78. X
  79. X{\bf Usage hint:} {\it to exchange two pieces of text: select on piece of text
  80. and invoke CopySelToScrap, then select the other piece of text and
  81. invoke ExchangeWithScrap, finally select the first piece of text
  82. and invoke ExchangeWithScrap again.}
  83. X
  84. X\subsubsection{InsertFromScrap}
  85. The text in the scrap buffer is inserted at the insertion point.
  86. The contents of the scrap buffer are unchanged and can be inserted again
  87. in the same or a different place.
  88. The other commands that change the scrap buffer are:
  89. DeleteToScrap, ExchangeWithScrap and CopySelToScrap.
  90. X
  91. X{\bf Usage hint:} {\it  to duplicate a line (or other section of text)
  92. a number of times: select and delete the lines and then
  93. insert them as many times as required.}
  94. X
  95. X\subsubsection{InsertXSel}
  96. This command inserts the X primary selection at the insertion point.
  97. Point claims the X primary selection whenever you select text in Point
  98. so if the most recent selection was in Point then this will effectively
  99. duplicate the selected text.
  100. But if you make an X selection outside of Point and invoke this
  101. command then the selection will be copied into the text.
  102. X
  103. X\subsubsection{JustifySel}
  104. This command acts on whole lines.
  105. It acts on all lines in which one or more characters
  106. in the line are selected.
  107. All of the lines are justified between column 1 and the column
  108. specified by the {\bf rightMargin} option variable.
  109. X
  110. X{\bf Usage hint:} {\it To indent and justify, first justify to column 1 and
  111. then shift all the lines to the right.}
  112. X
  113. X\subsubsection{CopySelToMouse}
  114. The selection is copied to the location of the mouse pointer
  115. when the command was executed.
  116. The copy is by characters, words or lines depending on the mode
  117. of the selection.
  118. If the selection mode is by words or lines the insert is at the
  119. beginning of the word or line that contains the location
  120. of the mouse pointer.
  121. X
  122. X{\bf Usage hint:} {\it to copy a line (or lines) of text:
  123. select the lines in line mode (with a triple click)
  124. and invoke the CopySelToMouse command anywhere on the line {\bf after}
  125. you want the lines copied to.}
  126. X
  127. X{\bf Note:} This command is only suitable to attach to a mouse
  128. button or a mouse menu.
  129. X
  130. X\subsubsection{MoveSelToMouse}
  131. The selection is moved to the current location of the mouse pointer.
  132. The move is by characters, words or lines depending on the mode
  133. of the selection.
  134. If the selection mode is by words or lines the insert is at the
  135. beginning of the word or line that contains the location
  136. of the mouse pointer.
  137. X
  138. X{\bf Usage hint:} {\it to move a line (or lines) of text:
  139. select the lines in line mode (with a triple click)
  140. and invoke the MoveSelToMouse command anywhere on the line {\bf after}
  141. you want the lines moved to.}
  142. X
  143. X{\bf Note:} This command is only suitable to attach to a mouse
  144. button or a mouse menu.
  145. X
  146. X\subsubsection{CopyToHereMode}
  147. This command must be invoked twice to complete a copy.
  148. The first time you invoke the {\tt CopyFromHereMode} command you set the
  149. location to which the text will be copied.
  150. You are then in {\em duplicate} mode and the mouse sprite becomes
  151. a hand with a right pointing hand (this can be changed
  152. to any cursor font cursor with the {\tt copySpriteName} option).
  153. You can then continue using Point and execute any commands you like.
  154. When you invoke the {\tt CopyFromHereMode} command while in duplicate mode
  155. the current selection will be copied to the location remembered
  156. from the first invocation of {\tt CopyFromHereMode}.
  157. X
  158. X{\bf Usage hint:} {\it the advantage of this command is that you can copy
  159. text into your typing stream without losing your insertion point.
  160. Suppose you are typing a line in C and want to type a variable
  161. name that appears on a nearby line.
  162. XFirst invoke the {\tt CopyFromHereMode} command, then select the nearby word
  163. X(with a double click of the left mouse button) and then invoke
  164. X{\tt CopyFromHereMode} again.
  165. The word is copied into the line and the insertion point is at the
  166. end of the copied word so you can continue typing the line without
  167. readjusting the insertion point.
  168. You can create a line by grabbing pieces of nearby lines one after
  169. the other.
  170. A new line of code in an existing routine can usually be created without
  171. the keyboard at all.}
  172. X
  173. My rule about copying nearby words is that the break-even point for
  174. effort is around five or six characters, that is, if the variable name
  175. you are about to type is longer than that it is probably easier to
  176. copy it than to retype it.
  177. Another advantage of copying is that there is no chance you will mistype
  178. the word.
  179. X
  180. If the word you want to copy is not visible on the screen it is usually
  181. not worth the effort to copy it because that would require window
  182. rearranging.
  183. It may be worth it if it a global variable with a long name
  184. X(and global variables should have long descriptive names)
  185. that would be hard to type correctly.
  186. And since you will have to type in an external reference to the
  187. variable anyway you might as well find a copy of the external reference,
  188. copy it in as a complete line and then copy the global variable name
  189. from the copied in line.
  190. X
  191. X\subsubsection{MoveFromHereMode}
  192. This is identical to the {\tt CopyFromHereMode} command except that the text
  193. is moved (that is, deleted from its original location) when the
  194. second {\tt MoveFromHereMode} is invoked.
  195. X
  196. X
  197. X
  198. X\subsection{Again and Undo Commands}
  199. X
  200. X\subsubsection{Again [tkPathName$\mid$mostrecent$\mid$thisfile]}
  201. The last command (not counting deletes) is repeated in the current context.
  202. If the last command copied text into the insertion point then that same
  203. text is copied into the current insertion point.
  204. If the last two commands where to delete the current selection and replace
  205. it with new text (either typed in or copied in from somewhere else) then
  206. this command will replace the current selection with that same text.
  207. X
  208. The optional argument determined which command is repeated.
  209. The default is {\tt mostrecent} which means that the most
  210. recent edit is repeated.
  211. If the argument is {\tt thisfile} then the most recent edit
  212. in the file containing the selection is repeated.
  213. XFinally if a window name is given the most recent edit in the
  214. file in that window is repeated.
  215. X
  216. X{\bf Usage hint:} {\it to perform a selective replace, that is, to replace
  217. some but not all instances of one text string with another text string:
  218. Search for the string using a SearchForString selection box until you
  219. find the first instance you want to replace.
  220. Then search for the following instances of the string
  221. X(either with the dialogue box or with the RepeatSearch command).
  222. XFor all the ones you want to replace just invoke Again.}
  223. X
  224. X\subsubsection{Undo [nToUndo] [tkPathName]}
  225. The last undone command is undone:
  226. deleted text is reinserted, copied text is deleted,
  227. moved text is put back where it was moved from.
  228. If this command is repeated the undo itself is undone
  229. so only one previous command can be undone with UndoOne.
  230. If this command is repeated the command before the last command
  231. is undone and so on.
  232. The argument {\tt nToUndo} (which defaults to 1) determines how
  233. many edits will be undone.
  234. X
  235. X\subsubsection{Redo [nToRedo] [tkPathName]}
  236. The last undone command that has not been redone is redone.
  237. This command can be used only to redo commands that have been undone.
  238. The argument {\tt nToRedo} (which defaults to 1) determines how
  239. many edits will be redone.
  240. X
  241. X
  242. X
  243. X\subsection{Search Commands}
  244. X
  245. X\subsubsection{Search stringToSearchFor
  246. X        [\{forward$\mid$backward\}] [tkPathName]}
  247. The search is performed in the active window
  248. X(not the selection window), that is, the
  249. last window the mouse sprite was in unless the third
  250. argument is given, in which case it names the window to search in.
  251. If the selection is in that window then
  252. the search begins at the selection, otherwise the search begins
  253. at the first character of the file.
  254. The search direction is either forward or backward.
  255. There are several options that affect how the search is done:
  256. the {\tt ignoreCase} option determines whether case is significant
  257. in the search, the {\tt findWholeWords} option determines whether
  258. the string can be a substring of a larger string or not.
  259. The {\tt linesOverFind} option affects the positioning of the found string
  260. in the window if the window has to be jumped in order to show the
  261. found string.
  262. If the second argument is missing or empty then ``forward''
  263. is assumed.
  264. If the third argument is given the second argument must appear also
  265. X(although it can be the empty string).
  266. X
  267. X\subsubsection{RepeatSearch \{forward$\mid$backward\} [tkPathName]}
  268. The last string searched for is used as the search string
  269. for a new search.
  270. The search direction is either forward or backward.
  271. If the first argument is missing or empty then ``forward''
  272. is assumed.
  273. If the second argument is given the first argument must appear also
  274. X(although it can be the empty string).
  275. X
  276. X\subsubsection{CTag ctag}
  277. The {\tt ctag} is looked up in the file {\tt tags}
  278. X(created by the Unix command {\tt ctags}) in the current directory.
  279. the file containing the flag is loaded into a new window
  280. or, if the file is already in a window, that window is raised
  281. to the top.
  282. The window is jumped to show the {\tt ctag}string and the {\tt ctag} string
  283. is selected.
  284. X
  285. X\subsubsection{SearchCharacter char [tkPathName]}
  286. If the `char' is an ASCII character then it is appended
  287. to the search string maintained by this command and the
  288. string is searched for (forwards in the file).
  289. Thus the command implements incremental search.
  290. If `char' is a non-ASCII character (e.g., a function key)
  291. then the search string is cleared.
  292. This search string is different from the search string for the
  293. search command.
  294. X
  295. X{\bf Usage hint:} {\it I bind this the menu bar item
  296. for string search.
  297. Then I can type characters into that menu item and get incremental
  298. search.
  299. It never throws away characters unless you clear the search string
  300. so get in the habit of pressing a function key before starting
  301. your search string.}
  302. X
  303. X\subsubsection{Replace searchString replaceString [inselection] [tkPathName]}
  304. This command replaces each occurrence of the ``searchString'' with the
  305. X``replaceString'' either in the entire file (if the third argument is
  306. missing or empty) or within the selection (if the third argument is
  307. X``inselection'').
  308. The search is affected by the normal search options
  309. X({\tt ignoreCase} and {\tt findWholeWords}).
  310. The replace is done in the active window unless the fourth
  311. argument names a valid text window.
  312. X
  313. X\subsubsection{FindMatchingBracket}
  314. The following brackets are matched in pairs:
  315. X( and ), \{ and \}, [ and ].
  316. If one of these characters is the first character of the selection,
  317. Point will search (forward for (, \{ and [; backward for ), \} and ])
  318. for the matching bracket.
  319. By matching, we mean that it keeps a count of left and right brackets
  320. and finds the matching bracket when count is zero.
  321. X
  322. X
  323. X\subsection{File Movement Commands}
  324. X
  325. X\subsubsection{MoveToEndFile [tkPathName]}
  326. The window is repositioned so that it shows the end of the file.
  327. The file will be positioned so that the end of file marker is
  328. on the last line of the window (unless the entire file will
  329. fit in fewer lines).
  330. X
  331. X\subsubsection{ShowSel}
  332. The window containing the selection is brought to the front and
  333. repositioned so that the beginning of the selection is visible
  334. in the window.
  335. The {\tt linesOverFind} option determines the placement of the first
  336. line of the selection in the window.
  337. X
  338. X\subsubsection{MoveToLastPlace [tkPathName]}
  339. This repositions the window to the last place you have jumped from.
  340. Point remembers a separate last place for each window.
  341. X
  342. X{\bf Usage hint:} {\it this command is useful for switching between
  343. two different places in the file.}
  344. X
  345. X\subsubsection{GotoLine lineNumber \{lof$\mid$top\} [tkPathName]}
  346. The window is repositioned so that the line number specified
  347. is show in the window.
  348. If `lof' is specified then the {\tt linesOverFind} option
  349. determines where the line is positioned in the window.
  350. If `top' is specified then the line number is positioned 
  351. at the top of the window.
  352. See the description of that option for details.
  353. If the second argument is missing or empty then ``lof''
  354. is assumed.
  355. X
  356. X\subsubsection{GotoDigit digit [tkPathName]}
  357. The `digit' is added to a line number that is collected.
  358. If `digit' is not a digit, then the line number collected
  359. so far is jumped to.
  360. The {\tt linesOverFind} option determines the placement
  361. of the line gone to in the window.
  362. X
  363. X\subsubsection{ScrollWindow \{up$\mid$down\} \{numberOfLines$\mid$page\}
  364. X        [tkPathName]}
  365. The window is scrolled by `numberOfLines'.
  366. If the second argument is ``page'' or missing or empty,
  367. then the window is scrolled down the number of lines in
  368. the window minus two (for context).
  369. The first argument determines the scroll direction.
  370. If it is missing or empty then ``down'' is assumed.
  371. X
  372. X
  373. X\subsection{Cursor Positioning Command}
  374. X
  375. X\subsubsection{MoveSel \{char$\mid$word$\mid$line\}
  376. X        \{up$\mid$down$\mid$right$\mid$left$\mid$left0\}}
  377. This command moves the selection.
  378. The movement can be by character, by word or to the limits of the line.
  379. The second argument determines the direction of movement.
  380. You can only use ``up'' and ``down'' with ``char''.
  381. XFor ``line'', ``right'' moves the selection to the last character
  382. of the line (which will always be the newline character
  383. that ends the line), ``left'' moves to the first non-white space
  384. character of the line and ``left0'' moves to the first
  385. character of the line.
  386. These commands are usually attached to keys
  387. or used in macros (like indent selected lines).
  388. X
  389. X
  390. X
  391. X\subsection{Window Management Commands}
  392. X
  393. X\subsubsection{OpenWindow fileName geometry}
  394. A new window is created and 'fileName' is loaded into the new window.
  395. The `geometry' argument specifies the geometry of the new window.
  396. If `geometry' is missing or empty then the default
  397. X{\tt textGeometry} is used.
  398. This command returns a string that is the Tk path name
  399. of this window.
  400. It will always be of the form ``.twDDDDD'' where each D
  401. is a decimal digit.
  402. Point assigns window names with a counter so the first window
  403. will be ``00001'', the second window ``00002'' and so on.
  404. Text windows, browser windows, and some popup dialogue boxes
  405. all share the same counter so the numbers of the text windows
  406. will not necessarily be sequential.
  407. X
  408. X\subsubsection{SaveFile [tkPathName]}
  409. The file in the active window (or the window named by {\tt tkPathName})
  410. is saved on disk.
  411. X
  412. X\subsubsection{SaveAs [tkPathName]}
  413. The file in the active window (or the window named by {\tt tkPathName})
  414. is written to disk.
  415. The name to use for the file is provided by the user through a dialogue box.
  416. X
  417. X\subsubsection{SaveAllFiles}
  418. All files that have been changed but not yet saved are saved.
  419. X
  420. X\subsubsection{CloseWindow \{save$\mid$nosave$\mid$ask\} [tkPathName]}
  421. The window is closed and removed from the screen.
  422. If the file in the window has been edited and this is the last window
  423. open on the file then the argument determines whether the
  424. file will be saved or not.
  425. If `save' is specified it will be saved, if 'nosave' is specified
  426. it will not be saved and if 'ask' is specified a dialogue box
  427. will pop up asking the user whether to save the file or not.
  428. If the first argument is missing or empty then ``ask'' is assumed.
  429. X
  430. X\subsubsection{Browser geometry \{big$\mid$small\} [tkPathName]}
  431. This command creates another file browser.
  432. The `geometry' argument determines the geometry of the new browser.
  433. If it is missing or empty then the default {\tt browserGeometry} will be used.
  434. If the second argument is missing or empty then ``big'' is assumed.
  435. X
  436. X{\bf Usage hint:} Use this command to get a file from another directory
  437. while keeping a file browser showing the current directory.
  438. X
  439. X\subsubsection{Zoom [\{vertical$\mid$full\}] [tkPathName]}
  440. The window is enlarged to be the full height of the screen
  441. X(if the first argument is {\tt vertical}
  442. or the full size of the screen (if the first argument is {\tt full}.
  443. If the first argument is missing {\tt vertical} is assumed.
  444. X
  445. X\subsubsection{RaiseWindow [tkPathName]}
  446. Bring the active window (or the window named by {\tt tkPathName})
  447. to the front of all other windows in the display
  448. X(both Point windows and the windows of other X applications).
  449. X
  450. X\subsubsection{LowerWindow [tkPathName]}
  451. Move the active window (or the window named by {\tt tkPathName})
  452. behind of all other windows in the display
  453. X(both Point windows and the windows of other X applications).
  454. X
  455. X
  456. X\subsubsection{QuitPoint \{save$\mid$discard$\mid$ask\}}
  457. Quit Point after checking each file to see if it has been changed
  458. but not yet saved.
  459. The argument determines whether these files will be saved.
  460. If the argument is missing then ``ask'' is assumed.
  461. X
  462. X
  463. X\subsection{Miscellaneous Commands}
  464. X
  465. X\subsubsection{Redraw}
  466. This command redraws the entire window so that it corresponds to
  467. the true state of the file.
  468. X
  469. X\subsubsection{CD directoryName [tkPathname]}
  470. The Unix current directory of the specified browser
  471. X(the default is the active browser) is changed to `directoryName'.
  472. If the first argument is missing or empty then the user's home directory
  473. is assumed.
  474. X
  475. X\subsubsection{TextFont fontName [tkPathname]}
  476. This command changes the font
  477. X(in the specified window where the active window is the default)
  478. to `fontName'.
  479. If the font change fails the font in the active window
  480. is changed to the default font {\tt textFont}.
  481. X
  482. X\subsubsection{SetLineNumbers how}
  483. This command determines whether line numbers are displayed
  484. with the text in the window.
  485. XEach window has a line number flag and this command changes it.
  486. If {\tt how} is "1" then line numbers are displayed.
  487. If {\tt how} is "0" then line numbers are not displayed.
  488. If {\tt how} is anything else then the line numbering flag is toggled.
  489. X
  490. X\subsubsection{BrowserFont fontName [tkPathname]}
  491. This command changes the font
  492. X(in the specified browser where the active browser is the default)
  493. to `fontName'.
  494. If the font change fails the font in the active browser
  495. is changed to the default font {\tt browserFont}.
  496. X
  497. X\subsubsection{ToggleReadOnly [tkPathname]}
  498. A file can be specified ''read-only'', in which case,
  499. Point will not allow you to modify it.
  500. This command toggles the read-only status of the file
  501. in the active window (or the window named by {\tt tkPathname}).
  502. X
  503. X\subsubsection{CancelModes}
  504. This command cancels duplicate or extract mode
  505. if either in in effect.
  506. Otherwise the command has no effect.
  507. This command is used when you inadvertently enter
  508. duplicate and extract mode with a erroneous button
  509. click or keypress.
  510. The mouse sprite will change back to normal
  511. X(from the right pointing hand that marks duplicate mode).
  512. X
  513. X\subsubsection{PrintStats}
  514. Information about the effectiveness of Point's caches is
  515. printed out to the {\tt xterm} window in which Point was started.
  516. X
  517. X\subsubsection{RaiseListWindow numInList [geometry]}
  518. This command affects the window which is the `numInList'th
  519. item on the open window list.
  520. That window is raised and resized according to `geometry'
  521. X(which defaults to {\tt textGeometry}).
  522. X
  523. X\subsubsection{CloseBrowser [tkPathName]}
  524. The specified browser (the active browser is the default) is closed.
  525. X
  526. X
  527. X
  528. X\subsubsection{Option get optionName}
  529. A string is returned that is the value of the specified
  530. Point option.
  531. Integers are returned as decimal strings.
  532. Booleans are returned as 0 (False) or 1 (True).
  533. X
  534. X\subsubsection{Option set optionName optionValue}
  535. The specified Point option is set to ``optionValue''.
  536. Integer arguments can be in octal, decimal or hex.
  537. Boolean options can be 0, 1, true or false.
  538. Case is not considered in the strings ``true'' and ``false''.
  539. X
  540. X\subsubsection{SendOnClose tkPathName interpName command}
  541. This command is intended to be used by a process that
  542. is sending commands to Point via the Tcl ``send'' command.
  543. The ``tkPathName'' is the Tk window name that Point
  544. assigns to the window (and that is returned by the
  545. OpenWindow command).
  546. The ``interpName'' is the name of the Tcl interpreter to send
  547. X``command tkPathName'' to when that window is closed.
  548. That is, when window ``tkPathName'' is closed,
  549. Point will execute the Tcl command:
  550. X\begin{verbatim}
  551. X     send interpName command tkPathName
  552. X\end{verbatim}
  553. X
  554. X\subsubsection{DoNothing}
  555. This command does nothing.
  556. It is a placeholder command if you have to specify
  557. a command but do not want it to actually do anything.
  558. X
  559. X\subsubsection{ShowUndoStack}
  560. This command pops up a dialogue box that shows the command
  561. history.
  562. XFor each command it gives information about the command
  563. including whether it has been undone (and not redone) or not.
  564. X
  565. X\subsubsection{SetTextColor colorName \{normal$\mid$selected\}
  566. X     \{foreground$\mid$background\} }
  567. This command sets the text color in the active window.
  568. You can use it to set either the foreground or the background
  569. of either normal text or selected text.
  570. If the second argument is missing or empty then ``normal''
  571. is assumed.
  572. If the third argument is missing or empty then ``foreground''
  573. is assumed.
  574. X
  575. X
  576. X
  577. X\subsection{ Commands for use in macros}
  578. X
  579. X\subsubsection{Sel \{set$\mid$get$\mid$return\} selBegin selEnd [tkPathName]
  580. X            [\{char$\mid$word$\mid$line\}]}
  581. If the first argument is ``get'' then there are no other arguments
  582. and the command returns a Tcl list of four strings.
  583. The first two strings are decimal numbers and are the character positions
  584. of the first and last character in the selection.
  585. The third string is the Tk path name of the window containing
  586. the selection.
  587. The fourth string is the selection mode and is one of the
  588. string {\tt char}, {\tt word} or {\tt line}.
  589. If the first argument is ``set'' then the selection is changed
  590. so that it begins at character position ``selBegin'' and ends
  591. at character position ``selEnd''.
  592. If the third argument is present the selection window is changed to
  593. the window specified by the Tk path name.
  594. If the fourth argument is present is changes the
  595. selection mode.
  596. If the first argument is ``return'' then the contents of the
  597. selection are returned.
  598. X
  599. X\subsubsection{GetRowCol offset [tkPathName]}
  600. This command returns a Tcl list of two integers.
  601. These are the row and column in the window of the
  602. character in character position ``offset''.
  603. X
  604. X\subsubsection{ActiveWindow \{set$\mid$get\} tkPathName }
  605. If the first argument is ``get'' then the Tk path name of the active
  606. window is returned.
  607. If the first argument is ``set'' then the active window is changed
  608. to the window whose Tk path name is specified in the second argument.
  609. X
  610. X\subsubsection{GetWindowInfo [tkPathName]}
  611. This command returns a Tcl list of information about the
  612. window whose Tk path name is given by ``tkPathName''
  613. X(the default is the active window).
  614. If the argument is omitted then the active window is assumed.
  615. This list consists of (in order):
  616. the character position of the first character displayed in the window,
  617. the character position after the last character displayed in the window,
  618. the line number of the first line displayed in the window,
  619. the line number of the last line displayed in the window plus one,
  620. the number of columns the window is scrolled horizontally,
  621. the number of lines displayed in the window,
  622. the number of columns displayed in the window,
  623. the X window id of the window,
  624. the Tk window id of the toplevel window,
  625. the Tk window id of the text window.
  626. X
  627. X\subsubsection{GetFileInfo [tkPathName]}
  628. This command returns a Tcl list of information about the
  629. file displayed in the window whose Tk path name is given by ``tkPathName''.
  630. If the argument is omitted then the active window is assumed.
  631. This list consists of (in order):
  632. the name of the file displayed in the window,
  633. the current size of the file in bytes,
  634. the original size of the file when it was loaded
  635. X(before any editing was done),
  636. a flags field which is the {\it or}ing together
  637. of the flags:
  638. X0x1 if a backup file has been made,
  639. X0x2 if the file is read only,
  640. X0x4 if the file has been changed (and not yet saved),
  641. and 0x8 if the file cannot be changed to read/write.
  642. X
  643. X\subsubsection{InsertString string}
  644. The specified string is inserted at the insertion point.
  645. X
  646. X\subsubsection{WaitForReturnString}
  647. This command runs a local Tk event loop and does not return
  648. until the Point option {\tt returnString} is non-empty.
  649. This is used to create a modal dialogue box.
  650. You set up the dialogue box so that it sets returnString to
  651. a non-empty string when it has its input.
  652. Then you pop up the dialogue box and execute this command.
  653. When it returns the input will be available.
  654. As an example look at {\tt proc MakeVerifyBox} and
  655. X{\tt proc DoReplace} in {\tt ptsetup.tcl}
  656. X
  657. X
  658. X
  659. X
  660. X\subsection{ Commands Implemented as Tcl procedures }
  661. These procedures are all contained in {\tt ptsetup.tcl}.
  662. X
  663. X
  664. X\subsubsection{winfo children .}
  665. This is really a straight Tk command.
  666. It returns the path names of all the children of the root window.
  667. XFor Point this will be all the toplevel windows.
  668. All the text windows will have names of the form ``.twDDDDD''.
  669. All browser windows will have names of the form ``.bwDDDDD''.
  670. Here each ``D'' is a decimal digit.
  671. Popup dialogues will have various other names
  672. but none of these names will start with ``.bw'' or ``.tw''.
  673. This command will provide you with a list of all of Point's
  674. text windows.
  675. You can use other commands to get information about each
  676. text window (and the file it displays).
  677. X
  678. X
  679. X\subsubsection{MoveWindow geometry [tkPathName]}
  680. The window is moved and resized according to `geometry'.
  681. X
  682. X\subsubsection{MakeAsciiBox}
  683. This command allows you to insert any eight bit character into the file.
  684. A dialogue box comes up and you can enter the character as a decimal
  685. X(starting with [1-9]) integer, an octal (starting with 0) integer or
  686. a hexadecimal (starting with 0x) integer.
  687. X
  688. X\subsubsection{MakeAboutBox}
  689. This command brings up a box that gives information
  690. about Point.
  691. Clicking on the dialogue box closes it.
  692. X
  693. X\subsubsection{MakeMsgBox msg}
  694. Pops up a message box displaying the message in ``msg''.
  695. X
  696. X\subsubsection{MakemmBox}
  697. Pops up a dialogue box that allows you to set the parameters
  698. of the mouse menus, that is, the text and command for each
  699. direction of the two mouse menus.
  700. X
  701. X\subsubsection{MakeColorBox}
  702. Pops up a dialogue box that allows you to select the color
  703. or the foreground and background of normal and selected text.
  704. You select the colors from a scrolling list of of color names from
  705. the X color database.
  706. X
  707. X\subsubsection{MakeCtagBox}
  708. Pops up a dialogue box that allows you to search for a C tag.
  709. X
  710. X\subsubsection{MakeKeywordBox}
  711. Pops up a dialogue box that allows you to search for a keyword.
  712. X
  713. X\subsubsection{FillKeywordBox}
  714. Starts a search for a keyword based on the keyword in
  715. the keyword box and fills the list with the file names
  716. containing that keyword.
  717. X
  718. X\subsubsection{MakeGotoBox}
  719. Pops up a dialogue box that allows you to jump to a line number.
  720. X
  721. X\subsubsection{MakeDebugBox}
  722. Pops up a dialogue box that allows you to change the value
  723. of the debug variable.
  724. X
  725. X\subsubsection{MakeQuitBox}
  726. Pops up a dialogue box that allows you to choose quit options.
  727. X
  728. X\subsubsection{MakeReplaceBox}
  729. The {\tt MakeReplaceBox} command brings up a dialogue box
  730. that allows you to specify
  731. the string to search for and the string to replace it with.
  732. There are three checkbox options you can set.
  733. The first is to verify each replacement.
  734. If this is turned on then each time the search string is found
  735. the window is made to show the string found, the string is
  736. selected and you
  737. are presented with a dialogue box asking whether you want
  738. to replace the string or not.
  739. If you do not choose the verify option you might want to use the
  740. internal (C) version of search and replace rather than the external
  741. X(Tcl) version which is considerably slower.
  742. The final checkbox option is to restrict the replace to the selection
  743. only.
  744. This is useful, for example, for changing one identifier to another
  745. over a few lines of code.
  746. The search uses the standard search options (ignore case, find
  747. whole words, etc.)
  748. X
  749. X\subsubsection{MakeSearchBox}
  750. Pops up a dialogue box that allows you to enter a search
  751. string, change the {\tt findWholeWords}
  752. and {\tt ignoreCase} search options
  753. and set the search direction as backward or forward.
  754. X
  755. X\subsubsection{OpenFileOrCD name geometry}
  756. If ``name'' is a directory the active browser
  757. is changed to that directory.
  758. If ``name'' is an ordinary file then a window is opened
  759. up with geometry ``geometry'' that displays file ``name''.
  760. X
  761. X\subsubsection{MakeSearchOptionsBox}
  762. Pops up a dialogue box that allows the user to change
  763. all the search related options.
  764. X
  765. X\subsubsection{MakeOtherOptionsBox}
  766. Pops up a dialogue box that allows the user to change
  767. several string valued options.
  768. X
  769. X
  770. END_OF_FILE
  771. if test 30230 -ne `wc -c <'doc/cmds.tex'`; then
  772.     echo shar: \"'doc/cmds.tex'\" unpacked with wrong size!
  773. fi
  774. # end of 'doc/cmds.tex'
  775. fi
  776. echo shar: End of archive 10 \(of 15\).
  777. cp /dev/null ark10isdone
  778. MISSING=""
  779. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  780.     if test ! -f ark${I}isdone ; then
  781.     MISSING="${MISSING} ${I}"
  782.     fi
  783. done
  784. if test "${MISSING}" = "" ; then
  785.     echo You have unpacked all 15 archives.
  786.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  787. else
  788.     echo You still need to unpack the following archives:
  789.     echo "        " ${MISSING}
  790. fi
  791. ##  End of shell archive.
  792. exit 0
  793. -- 
  794. --
  795. Molecular Simulations, Inc.            mail: dcmartin@msi.com
  796. 796 N. Pastoria Avenue                uucp: uunet!dcmartin
  797. Sunnyvale, California 94086            at&t: 408/522-9236
  798.