Changes between Initial Version and Version 1 of EasyGuiBasicViews

08/30/08 06:20:41 (9 years ago)



  • EasyGuiBasicViews

    v1 v1  
     1= Views = 
     3== Basic Views == 
     5The basic framework object is a ''view''.  Views (windows, menus, controls) 
     6are represented by CLOS objects, and are created using ''make-instance''. 
     8{{{view ()[class]}}} 
     10An abstract superclass of all views (windows, menus, controls). All views support the following initargs: 
     12'':view-nick-name'' -- initializes the view nick-name, see set-view-nick-name 
     14'':view-subviews'' -- initializes the view subviews, see add-container 
     16'':view-size'' -- initializes the view size, see set-view-size 
     18'':view-width'' -- initializes the view width (overrides :view-size) 
     20'':view-height'' -- initializes the view height (overrides :view-size) 
     22'':view-tooltip'' -- initializes the view tooltip, see set-view-tooltip 
     24'':view-font'' -- initializes the view font, see set-view-font. 
     26'':view-enabled-p'' -- (default true), initializes the enabled/disabled state, see enable-view/disable-view 
     28'':view-ref'' --specifies an existing native window system object to base the view on. 
     30'':view-command-id'' -- initializes the view command id, see set-view-command-id. 
     32{{{(view-p object) [function]}}} 
     34True if //object// is a view. 
     36{{{(set-view-nick-name view name) [method]}}} 
     38Give the view a nick-name //name//, which can be any object. 
     40{{{(view-nick-name view) [method]}}} 
     42Returns the view's nick-name. 
     44{{{(view-named name view) [method]}}} 
     46Finds a subview of //view// whose nick-name is ''eql'' to //name//. 
     48{{{(view-subviews view &key type) [method]}}} 
     50Returns all subviews of //view//, i.e. all views whose view-container is view, optionally restricted to those of type //type//. 
     52{{{(add-subviews view &rest subviews) [method]}}} 
     54Make //view// be the container for each of the subviews. 
     56{{{(remove-subviews view &rest subviews) [method]}}} 
     58Remove each of the subviews from //view//. 
     60{{{(set-view-width view new-width) [method]}}} 
     62Sets the width of //view// to new-width, which must be a non-negative real. 
     64{{{(view-width view) [method]}}} 
     66Returns the width of //view//. 
     68{{{(set-view-height view new-height) [method]}}} 
     70Sets the size of //view// to //new-height//, which must be a non-negative real. 
     72{{{(view-height view) [method]}}} 
     74Returns the height of //view//. 
     76{{{(set-view-size view new-size) [method]}}} 
     78Sets the size of //view// to //new-size//, which is the height and width encoded as a point. 
     80{{{(view-size view) [method]}}} 
     82Returns the size (height and width) of //view// as a point. 
     84{{{(set-view-tooltip view tooltip) [method]}}} 
     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. 
     90{{{(view-tooltip view) [method]}}} 
     92Returns the tooltip of //view//. 
     94{{{(set-view-font view font-spec) [method]}}} 
     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%%. 
     101{{{(view-font view) [method]}}} 
     103Returns the font of //view//. 
     105{{{(enable-view view) [method]}}} 
     107Makes //view// enabled, so it will respond to user input when active. 
     109{{{(disable-view view) [method]}}} 
     111Makes //view// disabled, so it will be drawn grayed out and will not respond to user input. 
     113{{{(view-enabled-p view) [method]}}} 
     115returns true if view is enabled. 
     117{{{(view-active-p view) [method]}}} 
     119True if //view// is active (able to accept user input). 
     121{{{(invalidate-view view &optional rect) [method]}}} 
     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. 
     129{{{(view-ref view) [method]}}} 
     131Returns the native window system object represented by //view//, to allow you to use the native window system directly. 
     136// TODO: need non-carbon version of next two: // 
     138{{{(set-view-command-id view command-id) [method]}}} 
     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. 
     143{{{(view-command-id view) [method]}}} 
     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. 
     147//TODO: something for switching cursor based on what view it's in.// 
     149//TODO: resizing protocol (window-size-parts in MCL).//