SCI Kernel Documentation/Window and Text Functions

From SCI Wiki
Jump to navigationJump to search

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Index


Window and Text Functions

Author: Jeff Stephenson

Revision by: David Slayback

 


Window and Text Functions

These functions deal with the main picture window, dialog windows, and writing text to those windows.


(GetPort)

Returns the current grafPort.


(SetPort grafPort)

Sets the current grafPort to grafPort. If grafPort=0, then the port is set to the window manager port, which is the full screen picture with (0,0) right below the menu bar.


(NewWindow top left bottom right title type priority color back)

Opens a window with the given coordinates, and returns a handle to the new window.


(DisposeWindow window)

Close the given window.


(Display text [at: x y] [font: f] [color: c] [back: b] [style: s] [width: w])

Writes text to the current grafPort. The optional parameters are:

p_at: x y Position the upper left corner of the first character of text at coordinates x, y in the grafPort.
p_font: f Write the text in font f.
p_color: c Set the foreground color of the characters to c. The characters will be ORed into the picture unless "back:" (see below) is specified.
p_back: b Set the background color of the characters to b. Additionally makes the characters OPAQUE.
p_style: s Set the style of the characters to s. s may be TPLAIN (plain text), TDIMMED (dimmed text) or TBOLD (bold text).
p_width: w Sets the width of the displayed line. The text will wrap at the width that you specify. If this parameter is not passed, the text will NOT wrap, and long lines will go off the edge of the screen.
p_mode: j Set justification of text. Left aligned is default. (teJustLeft, teJustCenter, or teJustRight)
p_save: Saves the background under the window and returns a value that relates to the saved area. Use (= var (Display "Lots o text" save:)
p_restore: var Restores the background that was saved. Use (Display "" p_restore: var)


(TextSize rectPtr text font width)

Fills in the rectangle (an array of four elements) which is pointed to by rectPtr with the bounding coordinates of the box which will hold text printed in the font font. If width is non-zero, it is the maximum width of the rectangle.


(DrawControl item)

Draw a control object within the given port item can be dSelector, dButton, dText, dIcon, or dEdit


(HiLiteControl item)

Hilight the control item if not selected, or unhilight the item if selected.


(EditControl item event)

Bring up an edit box for a the item object that has type=dEdit, and store the message passed through to event.

 

Notes


 

Table of Contents

 

< Previous: Menu Functions Next: Sound Functions >