Changes between Initial Version and Version 1 of EasyGuiBasicViews


Ignore:
Timestamp:
08/30/08 06:20:41 (6 years ago)
Author:
zzkt
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • EasyGuiBasicViews

    v1 v1  
     1= Views = 
     2 
     3== Basic Views == 
     4 
     5The basic framework object is a ''view''.  Views (windows, menus, controls) 
     6are represented by CLOS objects, and are created using ''make-instance''. 
     7 
     8{{{view ()[class]}}} 
     9 
     10An abstract superclass of all views (windows, menus, controls). All views support the following initargs: 
     11 
     12'':view-nick-name'' -- initializes the view nick-name, see set-view-nick-name 
     13 
     14'':view-subviews'' -- initializes the view subviews, see add-container 
     15 
     16'':view-size'' -- initializes the view size, see set-view-size 
     17 
     18'':view-width'' -- initializes the view width (overrides :view-size) 
     19 
     20'':view-height'' -- initializes the view height (overrides :view-size) 
     21 
     22'':view-tooltip'' -- initializes the view tooltip, see set-view-tooltip 
     23 
     24'':view-font'' -- initializes the view font, see set-view-font. 
     25 
     26'':view-enabled-p'' -- (default true), initializes the enabled/disabled state, see enable-view/disable-view 
     27 
     28'':view-ref'' --specifies an existing native window system object to base the view on. 
     29 
     30'':view-command-id'' -- initializes the view command id, see set-view-command-id. 
     31 
     32{{{(view-p object) [function]}}} 
     33 
     34True if //object// is a view. 
     35 
     36{{{(set-view-nick-name view name) [method]}}} 
     37 
     38Give the view a nick-name //name//, which can be any object. 
     39 
     40{{{(view-nick-name view) [method]}}} 
     41 
     42Returns the view's nick-name. 
     43 
     44{{{(view-named name view) [method]}}} 
     45 
     46Finds a subview of //view// whose nick-name is ''eql'' to //name//. 
     47 
     48{{{(view-subviews view &key type) [method]}}} 
     49 
     50Returns all subviews of //view//, i.e. all views whose view-container is view, optionally restricted to those of type //type//. 
     51 
     52{{{(add-subviews view &rest subviews) [method]}}} 
     53 
     54Make //view// be the container for each of the subviews. 
     55 
     56{{{(remove-subviews view &rest subviews) [method]}}} 
     57 
     58Remove each of the subviews from //view//. 
     59 
     60{{{(set-view-width view new-width) [method]}}} 
     61 
     62Sets the width of //view// to new-width, which must be a non-negative real. 
     63 
     64{{{(view-width view) [method]}}} 
     65 
     66Returns the width of //view//. 
     67 
     68{{{(set-view-height view new-height) [method]}}} 
     69 
     70Sets the size of //view// to //new-height//, which must be a non-negative real. 
     71 
     72{{{(view-height view) [method]}}} 
     73 
     74Returns the height of //view//. 
     75 
     76{{{(set-view-size view new-size) [method]}}} 
     77 
     78Sets the size of //view// to //new-size//, which is the height and width encoded as a point. 
     79 
     80{{{(view-size view) [method]}}} 
     81 
     82Returns the size (height and width) of //view// as a point. 
     83 
     84{{{(set-view-tooltip view tooltip) [method]}}} 
     85 
     86Sets the tooltip of view to //tooltip//, which must be a string or 
     87''nil'' to remove the view's tooltip. The tooltip is shown when the 
     88mouse hovers over the view. 
     89 
     90{{{(view-tooltip view) [method]}}} 
     91 
     92Returns the tooltip of //view//. 
     93 
     94{{{(set-view-font view font-spec) [method]}}} 
     95 
     96Sets the font of //view// to //font-%%spec%%//, overriding the view's 
     97default font. Once you have set a view's font with this function, you 
     98can cause the view to revert to its default font by passing ''nil'' as 
     99the font-%%spec%%. 
     100 
     101{{{(view-font view) [method]}}} 
     102 
     103Returns the font of //view//. 
     104 
     105{{{(enable-view view) [method]}}} 
     106 
     107Makes //view// enabled, so it will respond to user input when active. 
     108 
     109{{{(disable-view view) [method]}}} 
     110 
     111Makes //view// disabled, so it will be drawn grayed out and will not respond to user input. 
     112 
     113{{{(view-enabled-p view) [method]}}} 
     114 
     115returns true if view is enabled. 
     116 
     117{{{(view-active-p view) [method]}}} 
     118 
     119True if //view// is active (able to accept user input). 
     120 
     121{{{(invalidate-view view &optional rect) [method]}}} 
     122 
     123Indicates that the contents of the view has become invalid (typically 
     124as a result of changes in the data displayed in the view). The system 
     125will arrange for the view to be redrawn. Optionally a rectangle may be 
     126specified to indicate that only the portion of the view bound by the 
     127rectangle needs to be redrawn. 
     128 
     129{{{(view-ref view) [method]}}} 
     130 
     131Returns the native window system object represented by //view//, to allow you to use the native window system directly. 
     132 
     133---- 
     134---- 
     135 
     136// TODO: need non-carbon version of next two: // 
     137 
     138{{{(set-view-command-id view command-id) [method]}}} 
     139 
     140Sets the command id for the view.  //command-id// may be an ostype or it may be a keyword defined by 
     141define-carbon-command-event, q.v. 
     142 
     143{{{(view-command-id view) [method]}}} 
     144 
     145Returns the command id of the view, if any, as an ostype, or ''nil'' if the view doesn't have a command id associated with it. 
     146 
     147//TODO: something for switching cursor based on what view it's in.// 
     148 
     149//TODO: resizing protocol (window-size-parts in MCL).// 
     150