Changes between Initial Version and Version 1 of EasyGuiViewMixins

08/30/08 06:50:48 (9 years ago)



  • EasyGuiViewMixins

    v1 v1  
     1= View mixins = 
     3The view mixins define certain common view protocols. 
     5== View Text mixin == 
     7{{{view-text-mixin () [class]}}} 
     9A mixin for views that display text. Initargs: 
     11'':view-text'' -- initializes the view text, see set-view-text 
     13{{{(set-view-text view-text-mixin text) [method]}}} 
     15Sets the text to display in view-text-mixin to text, which must be a string or ''nil'' to remove the view's text. 
     17{{{(view-text view-text-mixin) [method]}}} 
     19Returns the text of view. 
     21== View Orientation mixin == 
     23{{{view-orientation-mixin () [class]}}} 
     25A mixin for one-dimensional views that can be oriented horizontally or vertically. Initargs: 
     27'':view-orientation'' -- sets the view orientation to one of :horizontal or :vertical. 
     29{{{(view-orientation view-orientation-mixin) [method]}}} 
     31Returns the orientation of ''view-orientation-mixin''. 
     33''TODO: Might want to add :view-length to refer to the right one of view-width/view-height.'' 
     35== View Range mixin == 
     37{{{view-range-mixin () [class]}}} 
     39A mixin for views that contain a numerical value in a range, such as a scroll bar or a progress bar. Initargs: 
     41'':view-value'' -- initializes the view value, see set-view-value 
     43'':view-minimum-value'' -- initializes the view minimum value, see set-view-minimum-value 
     45'':view-maximum-value'' -- initializes the view maximum value, see set-view-maximum-value 
     47{{{(set-view-value view-range-mixin value) [method]}}} 
     49Sets current value to value, which must be a real. 
     51{{{(view-value view-range-mixin) [method]}}} 
     53Returns the current value. 
     55{{{(set-view-minimum-value view-range-mixin minimum) [method]}}} 
     57Sets the minimum value to ''minimum'', which must be a real. 
     59{{{(view-minimum-value view-range-mixin) [method]}}} 
     61Returns the minimum value. 
     63{{{(set-view-maximum-value view-range-mixin maximum) [method]}}} 
     65Sets the maximum value to ''maximum'', which must be a real. 
     67{{{(view-maximum-value view-range-mixin) [method]}}} 
     69Returns the maximum value. 
     71== View State mixin == 
     73{{{view-state-mixin () [class]}}} 
     75A mixin for views that have one of finite number of states, such as a checkbox. Initargs: 
     77'':view-state'' -- initializes the view state, see set-view-state 
     79{{{(view-valid-states view-state-mixin) [method]}}} 
     81Returns the sequence of valid states for the view.  Concrete 
     82subclasses must provide a method for this function. The default method 
     83returns ''nil''. 
     85{{{(set-view-state view-state-mixin state) [method]}}} 
     87Sets current state to state, which must be ''eql'' to an element of view-valid-states. 
     89{{{(view-state view-state-mixin) [method]}}} 
     91Returns the current state. 
     93== View Action mixin == 
     95{{{view-action-mixin () [class]}}} 
     97A mixin for views that invoke a single action when activated, such as a push button. Initargs: 
     99'':view-action'' -- initializes the view action, see set-view-action 
     101{{{(set-view-action view-action-mixin action) [method]}}} 
     103Sets the action of view-action-mixin to ''action'', which must be 
     104either ''nil'' or a funcallable object (function or symbol). If not 
     105''nil'', the action will be called with one argument, the view itself. 
     107{{{(view-action view-action-mixin) [method]}}} 
     109Returns the action of view-action-mixin. 
     111== View Mouse Tracker mixin == 
     113{{{view-mouse-tracker-mixin () [class]}}} 
     115A mixin for views that support mouse tracking, used to implement live update. Initargs: 
     117:view-mouse-tracker -- initializes the view mouse tracker, see set-view-mouse-tracker 
     119{{{(set-view-mouse-tracker view-mouse-tracker-mixin tracker) [method]}}} 
     121Sets the mouse tracking handler for the view view-mouse-tracker-mixin 
     122to ''tracker'', which should be either ''nil'' or a funcallable object 
     123(function or symbol). If not ''nil'', ''tracker'' will be called when the user 
     124first clicks in the view and then repeatedly for as long as the user 
     125holds down the mouse button.  The function will receive two arguments, 
     126the view and the part code for the part of the view where the click 
     127first occurred, unless the mouse has moved out of the initial part, in 
     128which case the second argument will be ''nil''. 
     130{{{(view-mouse-tracker view-mouse-tracker-mixin tracker) [method]}}} 
     132Returns the mouse tracker of view-mouse-tracker-mixin. 
     134== View Nib mixin == 
     136{{{view-nib-mixin () [class]}}} 
     138A mixin for views that can be loaded from nib files, currently windows and menus. Initargs: 
     140'':view-nib-name'' -- specifies the name of the view description in a nib file. 
     142'':view-nib-path'' -- pathname of the nib file containing view-nib-name. Default is "main".  The pathname type defaults to "nib" and in fact cannot be anything else. 
     144See Interface Builder Support section below for more information.