news |
info |
people |
software |
stuff |
TextView XCMD. Version 3.1d17, by Sam Deane. Copyright ©1994 ULTRALAB. Compiled 15:44:20, 12/12/94. Debugging code included.
The text can be taken from a text field, a TEXT/styl resource pair or passed directly to the XCMD as a parameter.
The window can be of any style, floating or not, with or without scrollbars. The justification can be left,center or right, with or without line wrapping. The text can be editable, or locked. If locked, clicking on it can cause a word, or line to be hilighted, and a message can be sent to hypercard to be acted on.
TextView "text",<text>,<window> {,<floating> {,<wdef> }}
The <text> parameter specifies the initial contents of the window.
The <window> parameter indicates the name of the window to create.The optional <floating> and <wdef> parameters indicate what kind of window the text is to be displayed in.
The <floating> parameter is boolean. If true the window will always float above the card(this is the default), if false the window will behave just like another card windw.
The <wdef> parameter can be used to specify the name or id of a custom WDEF function to use for the window. It can be in one of the following forms:
"<name>"
"<id>"
"<name>,<variation>"
"<id>,<variation>"
In the two-item form, the <options> item is the WDEF variation code, which should be anumber between 0 and 15 (see the Window Manager chapters of Inside Macintosh for further explanation of WDEFs and variation codes).
TextView "card",<name>,<window> {,<floating> {,<wdef> }}
The <name> parameter indicates the name of the card field to look in for the contents of the window.
The <window> parameter indicates the name of the window to create.The optional <floating> and <wdef> parameters indicate what kind of window the text is to be displayed in.
The <floating> parameter is boolean. If true the window will always float above the card(this is the default), if false the window will behave just like another card windw.
The <wdef> parameter can be used to specify the name or id of a custom WDEF function to use for the window. It can be in one of the following forms:
"<name>"
"<id>"
"<name>,<variation>"
"<id>,<variation>"
In the two-item form, the <options> item is the WDEF variation code, which should be anumber between 0 and 15 (see the Window Manager chapters of Inside Macintosh for further explanation of WDEFs and variation codes).
TextView "background",<name>,<window> {,<floating> {,<wdef> }}
The <name> parameter indicates the name of the background field to look in for the contents of the window.
The <window> parameter indicates the name of the window to create.The optional <floating> and <wdef> parameters indicate what kind of window the text is to be displayed in.
The <floating> parameter is boolean. If true the window will always float above the card(this is the default), if false the window will behave just like another card windw.
The <wdef> parameter can be used to specify the name or id of a custom WDEF function to use for the window. It can be in one of the following forms:
"<name>"
"<id>"
"<name>,<variation>"
"<id>,<variation>"
In the two-item form, the <options> item is the WDEF variation code, which should be anumber between 0 and 15 (see the Window Manager chapters of Inside Macintosh for further explanation of WDEFs and variation codes).
This means that you can type, cut, copy paste etc in the window.
You can also use the font and style menus to change the appearance of text in the window.
on mouseUp if GotTest() then ask "Align?" with the textAlign of window "test" if it is not empty then set the textAlign of window "test" to it end if end if end mouseUp
If the wholeLine property is true, clicking on some text will hilight the whole line.
If the wholeLine property is false, clicking will just hilight the word that was clicked.
You can set the scrollbar width to any number, or to the constant default which will set it to the standard width.
The clickMessage property allows you to set the message that is sent.
If the property is false, clicking on the close box will simply hide the window.
By setting the property, you can use it to select a line.
The colour is specified as three numbers: <red>,<green>,<blue>.
The larger the number, the higher the amount of that colour - so "0,0,0" represents black, and "65535,65535,65535" white.
on mouseUp if GotTest() then ask "Foreground?" with the foreground of window "Test" if it is not empty then set the foreground of window "Test" to it end if end if end mouseUp
on mouseUp if GotTest() then ask "Background?" with the background of window "Test" if it is not empty then set the background of window "Test" to it end if end if end mouseUp
on mouseUp if GotTest() then set the editable of window test to true set the executable of window test to true show window test end if end mouseUp
on mouseUp if GotTest() then show window test ask "Font?" set the editable of window test to true set the selChunk of window test to "0,32000" set the font of window test to it end if end mouseUp
on mouseUp if GotTest() then show window test ask "Size?" set the editable of window test to true set the selChunk of window test to "0,32000" set the size of window test to it end if end mouseUp
send "import <field>,<card>" to window <name>
The <field> parameter should contain the name of the field which the text is to be import from. The <card> parameter should be true if the field is a card field, false otherwise.
The text in the field will completely replace any old text in the window.
on mouseUp if there is a window test then send "import test,true" to window "Test" end if end mouseUp
The syntax is:
send "export <field>,<card>" to window <name>
The <field> parameter should contain the name of the field to which the text is to be exported. The <card> parameter should be true if the field is a card field, false otherwise.
The syntax is:
send "insert <field>,<card>" to window <name>
The <field> parameter should contain the name of the field which the text is to be import from. The <card> parameter should be true if the field is a card field, false otherwise.
The text in the field will be inserted into the text window at the current selection point.