home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 5-7 / Prograph Reference 5-7.rsrc / TEXT_172.txt < prev    next >
Encoding:
Text File  |  1995-10-25  |  13.1 KB  |  324 lines

  1.  
  2. System Class
  3.  
  4. These primitives are used by the System Classes to aid in event handling. They are described here for advanced users who need to change the default behavior of System Classes or require more direct control over event handling.
  5.  
  6.  
  7. _________________________________________________
  8.  
  9.                                            sc-activate-wind    *346*
  10.  
  11.  
  12. Input types:     Window; Boolean
  13.  
  14. Description:    Performs activate functions necessary for text editors and scrolling lists. sc-activate-wind is called when a window is activated or deactivated. 
  15.  If the selected item is an Edit Text or a Scroll Text, sc-activate-wind calls TEActivate or TEDeactivate, depending on the value of Activate 
  16.  
  17.  If the selected item is a Scroll List, its selection border is invalidated. When Activate is FALSE the border is erased before being invalidated.
  18.  
  19.  If the Window has a grow box, sc-activate-wind makes sure the grow box is redrawn by invalidating the grow box region.
  20.  
  21.  
  22. _________________________________________________
  23.  
  24.                                                              sc-aevent-begin    *346*
  25.  
  26.  
  27.  
  28. Input types:  EventRecord
  29.  
  30. Output types:  AppleEvent; AppleEvent; Integer; Integer; Integer
  31.  
  32. Description: Accepts an Apple Event from the Event Manager, and extracts its Message, Reply, Class and Id. 
  33.  
  34.  Message contains all of the information associated with the Apple event. Reply is a default reply which is automatically returned to the sender of the  Apple event when sc-aevent-end is called. Error is zero if the primitive succeeds, otherwise error is an Apple event Manager error code.
  35.  
  36.  sc-aevent-begin should always be matched by a call to sc-aevent-end. This ensures that the memory associated with the Message and Reply is properly released.
  37.  
  38.  sc-aevent-begin calls AEProcessAppleEvent, to accept the event; AESuspendTheCurrentEvent, to prevent the reply from being sent; and then AESetTheCurrentEvent to make the event the current Apple event.
  39.  
  40.  
  41. _________________________________________________
  42.  
  43.                                                     sc-aevent-dispatch    *347*
  44.  
  45.  
  46.  
  47. Input types:     Integer; Integer
  48.  
  49. Output types:  String
  50.  
  51. Description:    Searches the current Application‚Äôs aevent methods attribute and returns the MethodName which matches the Class and Id (or NULL if no match is found).
  52.  
  53.  sc-aevent-dispatch does not call the method; it provides a convenient way to search the Application‚Äôs aevent methods. 
  54.  
  55.  
  56. _________________________________________________
  57.  
  58.                                                 sc-aevent-end    *347*
  59.  
  60.  
  61. Input names:    Message; Reply; ReplyError
  62.  
  63. Input types:     AppleEvent; AppleEvent; Integer
  64.  
  65. Output names:     Error
  66.  
  67. Output types:     Integer
  68.  
  69. Description:    Finishes the processing of an Apple event. The Reply is sent, if necessary, and the memory occupied by Message and Reply is released. Error is zero if the primitive succeeds.
  70.  
  71.  sc-aevent-end adds ReplyError to Reply and then calls AEResumeTheCurrentEvent to send Reply to the sender of the Apple event. If you have successfully handled the Apple event, ReplyError should be zero.
  72.  
  73.  
  74. _________________________________________________
  75. ¬†                                          sc-background?    *348*
  76.  
  77.  
  78. Output names:  [TheResult]
  79.  
  80. Output types:  [boolean]
  81.  
  82. Description:    Determines if your application is running in the background under MultiFinder or System 7. With output TheResult is TRUE or FALSE. Without output the primitive succeeds or fails. 
  83.  
  84.  
  85. _________________________________________________
  86.  
  87.                                                    sc-begin-drawing    *348*
  88.  
  89.  
  90. Input types:  Canvas
  91.  
  92. Output types:  ABlock
  93.  
  94. Description: Prepares a Canvas for drawing and saves its graphical state. Used in conjunction with sc-end-drawing. 
  95.  
  96.  You should call sc-begin-drawing before drawing in a Canvas. However,  the System Class methods do this for you before calling the draw method of a Canvas.
  97.  sc-begin-drawing sets the port to the port of the Canvas‚Äôs owning window; sets the origin of the window so that {0 0} is at the top left corner of the Canvas; and sets the clip region to the Canvas‚Äôs rectangle. All of the window‚Äôs port information is saved in CanvasState.
  98.  
  99.  
  100. _________________________________________________
  101.  
  102.                                               sc-begin-update    *348*
  103.  
  104.  
  105. Input types:  Window
  106.  
  107. Output types:  ABlock
  108.  
  109. Description: Prepares a window for updating and saves its graphical state. Used in conjunction with sc-end-update. 
  110.  
  111.  sc-begin-update is called in response to an update event for a window. Update events are created automatically when a part of a window is exposed (by closing a window which overlaps another window, for example ). Update events can also be generated by the programmer using the Macintosh Toolbox calls InvalRect and InvalRgn.
  112.  
  113.  sc-begin-update sets the visible region of a window so that drawing only occurs in the area that needs updating. sc-end-update restores the visible region, so every call to sc-begin-update should be matched by a call to sc-end-update.
  114.  
  115.  sc-begin-update sets the port to the window‚Äôs GrafPort, sets the origin to {0 0}, resets the port‚Äôs pen, text and color information, sets the clip region to an ‚Äúinfinite‚Äù rectangle, and then calls BeginUpdate. All of the window‚Äôs port information is saved in WindowState.
  116.  
  117.  
  118. _________________________________________________
  119.  
  120.                                              sc-click-witem    *349*
  121.  
  122.  
  123.  
  124. Input types:     Window Item; EventRecord
  125.  
  126. Output types:     boolean; Any
  127.  
  128. Description:    This primitive is called when a mouse down event occurs in a window item to process the click. If CallMethod is TRUE, the click method of WindowItem should be called. If MethodInput is not NULL, pass it into the click method. 
  129.  
  130.  sc-click-witem performs an action appropriate to the type of window item. For example, a Button item is hilited while the user holds the mouse pointer over the Button. The primitive finishes when the user releases the mouse button. 
  131.  
  132. CallMethod is TRUE if the mouse button is released over the Button. MethodInput will be NULL for those window items whose click method requires three inputs (<Window>, <Window Item> <EventRecord>). However, the click methods of Canvas, Check Box, Radio Set, Scroll List, and Pop-up Menu all require four inputs: MethodInput is passed in as the third input to the click methods of these window items (<EventRecord> being the fourth input). 
  133.  
  134.  
  135. _________________________________________________
  136.  
  137.                                               sc-delete-item    *349*
  138.  
  139.  
  140. Input names:     WindowItem | MenuItem
  141.  
  142. Input types:     Window Item | Menu Item
  143.  
  144. Description:    Deletes a window item from an active window, or deletes a menu item from an active menu.
  145.  
  146.  
  147. _________________________________________________
  148.  
  149.                                              sc-draw-witem    *350*
  150.  
  151.  
  152. Input types:  Window Item
  153.  
  154. Description:    Draws the window item. sc-draw-witem assumes the port has been set. 
  155.  
  156.  
  157. _________________________________________________
  158.  
  159.                                         sc-end-drawing    *350*
  160.  
  161.  
  162. Input types:     Canvas; ABlock
  163.  
  164. Description:    Restores the graphical state of a canvas, and its owning window, after drawing. Used in conjunction with sc-begin-drawing. 
  165.  
  166.  
  167. _________________________________________________
  168.  
  169.                                           sc-end-update    *350*
  170.  
  171.  
  172. Input types:     Window; ABlock
  173.  
  174. Description:    Restores the graphical state of a window after an update event. Used in conjunction with sc-begin-update. 
  175.  
  176.  sc-end-update calls the Mac Method EndUpdate.
  177.  
  178.  
  179. _________________________________________________
  180.  
  181.                                              sc-find-witem    *351*
  182.  
  183.  
  184. Input types:     Window; Point; Boolean; Boolean
  185.  
  186. Output types:     Window Item 
  187.  
  188. Description:    Finds the WindowItem which contains the Point. If Inactive is TRUE, inactive window items are included in the search. If Invisible is TRUE, invisible window items are included in the search. Note that sc-find-witem is different from the primitive find-item which searches for window items by name. 
  189.  
  190.  
  191. _________________________________________________
  192.  
  193.                                      sc-get-wind     *351*
  194.  
  195.  
  196. Input types:  NULL | Integer | WindowRecord@
  197.  
  198. Output types:  NULL | Window
  199.  
  200. Description: Returns the instance of class Window associated with a window record, or NULL if  NULL was input or if the window record does not belong to any of your application‚Äôs windows.
  201.  
  202.  sc-get-wind is used to determine which window is the target of activate and update events. 
  203.  
  204.  
  205. _________________________________________________
  206.  
  207.                                          sc-hilite-witem    *351*
  208.  
  209.  
  210. Input types:     Window Item; Boolean
  211.  
  212. Description:    If Hilite is TRUE, hilite the WindowItem. Otherwise, unhilite the WindowItem. 
  213.  
  214.  The effect of sc-hilite-witem is similar to that of setting WindowItem‚Äôs active? attribute. The difference is that sc-hilite-witem changes the window item temporarily. This primitive is used to dim window items when a window is deactivated, and re-hilite them when a window is activated.
  215.  
  216.  
  217. _________________________________________________
  218.  
  219.                                       sc-idle-edit     *352*
  220.  
  221.  
  222. Input types:  EventRecord
  223.  
  224. Description: Performs idle functions necessary for Edit Text and Scroll Text window items. 
  225.  
  226.  If the selected item of the front window is not an Edit Text or Scroll Text item, sc-idle-edit does nothing. Otherwise, sc-idle-edit flashes the insertion point and changes the cursor to the I-beam while it‚Äôs over the selected item. 
  227.  
  228.  
  229. _________________________________________________
  230.  
  231.                                              sc-insert-item    *352*
  232.  
  233.  
  234. Input names:     Window | Menu; WindowItem | MenuItem; Position
  235.  
  236. Input types:     Window| Menu; Window Item | Menu Item; Integer
  237.  
  238. Description:    Inserts a window item into an active window, or a menu item into an active menu. Position will be index (1-based) into the item list of Window or Menu of the newly inserted item.
  239.  
  240.  
  241. _________________________________________________
  242.  
  243.                                       sc-key-button    *352*
  244.  
  245.  
  246. Input types:     Window; EventRecord
  247.  
  248. Output types:     Button
  249.  
  250. Description:    If KeyEvent is Enter or Return, then sc-key-button hilites the window‚Äôs default button briefly and outputs the default button. If KeyEvent is not Enter or Return or the window has no default button, then Button will be NULL.
  251.  
  252.  
  253. _________________________________________________
  254.  
  255.                                     sc-key-edit     *353*
  256.  
  257.  
  258. Input names:     EditItem, KeyEvent; [ KeyRepeat ]
  259.  
  260. Input types:     Edit Text | Scroll Text; EventRecord; [ Integer ]
  261.  
  262. Description:    When the selected item is an Edit Text or Scroll Text, the typed character is inserted into the item‚Äôs text. 
  263.  
  264.  The third input, KeyRepeat, is used to speed up text editing when running your program in the Interpreter. If KeyRepeat is greater than zero, sc-key-edit will intercept subsequent key events and handle them automatically. (A value of 200 gives good performance on the Macintosh Classic, probably the only machine on which it‚Äôs really necessary.) If KeyRepeat is omitted, every key event will pass through your application‚Äôs Notify method.
  265.  
  266.  
  267. _________________________________________________
  268.  
  269.                                    sc-key-list     *353*
  270.  
  271.  
  272.  
  273. Input types:     Scroll List; EventRecord
  274.  
  275. Output types:     Boolean
  276.  
  277. Description:    When the window‚Äôs selected item is a Scroll List, and the typed character is an up arrow or a down arrow, the list‚Äôs selection is moved up or down, respectively, and Processed is TRUE. Otherwise, Processed is FALSE.
  278.  
  279.  
  280. _________________________________________________
  281.  
  282.                                    sc-key-menu    *354*
  283.  
  284.  
  285. Input types:     EventRecord
  286.  
  287. Output types:  Integer; Integer
  288.  
  289. Description: Finds the menu and item associated with a Command key. If CommandKey is not a valid command key, MenuID will be zero. The MenuID corresponds to the Menu‚Äôs position in the Application‚Äôs menu list. The MenuItem ID corresponds to the Menu Item‚Äôs position in the Menu‚Äôs item list. For example, if MenuID is 3 and MenuItem ID is 5, the Command key belongs to the fifth item of the third menu.
  290.  
  291.  
  292. _________________________________________________
  293.  
  294.                                                      sc-show-balloon    *354*
  295.  
  296.  
  297. Input types:     Window; Point
  298.  
  299. Description:    Shows a window item‚Äôs Balloon Help message if balloon help is on. This primitive is called when a null event is received.
  300.  
  301.  
  302. _________________________________________________
  303.  
  304.                                                          sc-tab-witem    *354*
  305.  
  306.  
  307. Input names:     WindowItem; KeyEvent | TabDirection
  308.  
  309. Input types:     Window Item; EventRecord | Integer
  310.  
  311. Output types:     Window Item
  312.  
  313. Description:    Returns the next selectable window item in the window. If KeyEvent is not a Tab key, NextItem will be NULL. TabDirection can be 1 for forward or -1 for backward. 
  314.  
  315.  
  316. _________________________________________________
  317.  
  318.                                                 sc-zoom-wind    *355*
  319.  
  320.  
  321. Input types:     Window; Integer
  322.  
  323. Description:    Zooms a window. ZoomDirection can be the Mac Constants inZoomIn or inZoomOut. inZoomOut enlarges the window to fill the whole screen,while inZoomIn restores the window to its size before being zoomed out. This primitive would normally be called after the user has clicked in the zoom box of a window.
  324.