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.
Commands
text
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).
card
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).
background
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).
Properties
editableThis 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.
text
selChunk
dontWrap
textAlign
Example script for textAlignon 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
margin
wholeLineIf 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.
scrollbarYou can set the scrollbar width to any number, or to the constant default which will set it to the standard width.
clickMessageThe clickMessage property allows you to set the message that is sent.
closeOnHideIf the property is false, clicking on the close box will simply hide the window.
properties
rect
globalRect
gotGrow
selText
selLineBy setting the property, you can use it to select a line.
foregroundThe 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.
Example script for foregroundon 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
background
Example script for backgroundon 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
executable
Example script for executableon 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
font
Example script for fonton 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
size
Example script for sizeon 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
style
hideMessage
moveMessage
hiddenText
returnMessage
idleMessage
lines
gotClose
chars
autoView
gotFocus
locked
dragable
#ÍL
#Í@
pß
Messages
import
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.
Example script for importon mouseUp if there is a window test then send "import test,true" to window "Test" end if end mouseUp
exportThe 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.
insertThe 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.
getFocus