[graphic-forms-cvs] r239 - in trunk: . docs/manual src src/uitoolkit/widgets

junrue at common-lisp.net junrue at common-lisp.net
Mon Aug 28 15:20:04 UTC 2006


Author: junrue
Date: Mon Aug 28 11:20:02 2006
New Revision: 239

Added:
   trunk/src/uitoolkit/widgets/item-manager.lisp
      - copied, changed from r231, trunk/src/uitoolkit/widgets/widget-with-items.lisp
Removed:
   trunk/src/uitoolkit/widgets/widget-with-items.lisp
Modified:
   trunk/docs/manual/api.texinfo
   trunk/docs/manual/glossary.texinfo
   trunk/docs/manual/widget-types.texinfo
   trunk/graphic-forms-uitoolkit.asd
   trunk/src/packages.lisp
   trunk/src/uitoolkit/widgets/widget-classes.lisp
Log:
widget-with-items base class renamed to item-manager and is now a mix-in

Modified: trunk/docs/manual/api.texinfo
==============================================================================
--- trunk/docs/manual/api.texinfo	(original)
+++ trunk/docs/manual/api.texinfo	Mon Aug 28 11:20:02 2006
@@ -75,7 +75,7 @@
 * Layouts::             Layout manager classes.
 * Controls::            Control classes.
 * Windows and dialogs:: Window and dialog classes.
-* Miscellaneous types:: Base classes for more specialized kinds of widgets.
+* Miscellaneous types:: Assorted base classes and utility classes.
 * Event functions::     Functions related to event processing.
 * Layout functions::    Functions related to layout management.
 * Widget functions::    Functions related to widgets.

Modified: trunk/docs/manual/glossary.texinfo
==============================================================================
--- trunk/docs/manual/glossary.texinfo	(original)
+++ trunk/docs/manual/glossary.texinfo	Mon Aug 28 11:20:02 2006
@@ -63,6 +63,13 @@
 invoked in a context-sensitive manner via the mouse or an
 @ref{accelerator}.@*
 
+ at item mix-in class
+ at anchor{mix-in class}
+ at cindex mix-in class
+A mix-in class represents a specific abstraction that
+complements the role(s) of other class(es) in a class
+hierarchy.@*
+
 @item mnemonic
 @anchor{mnemonic}
 @cindex mnemonic

Modified: trunk/docs/manual/widget-types.texinfo
==============================================================================
--- trunk/docs/manual/widget-types.texinfo	(original)
+++ trunk/docs/manual/widget-types.texinfo	Mon Aug 28 11:20:02 2006
@@ -63,13 +63,24 @@
 @deftp Class item item-id
 The @code{item} class is the base class for all non-windowed user
 interface objects serving as subcomponents of a
- at ref{widget-with-items} object. It derives from @ref{event-source}.
+ at ref{item-manager} object. It derives from @ref{event-source}.
 @deffn Initarg :item-id
 @end deffn
 @deffn Accessor item-id
 @end deffn
 @end deftp
 
+ at anchor{item-manager}
+ at deftp Class item-manager items
+This is is a mix-in class for @ref{widget}s containing sub-elements.
+
+ at table @var
+ at item items
+An @sc{adjustable} @sc{vector} containing @ref{item}s representing
+sub-elements.
+ at end table
+ at end deftp
+
 @anchor{layout-managed}
 @deftp Class layout-managed layout layout-p
 Instances of this class employ a @ref{layout-manager} to maintain
@@ -93,9 +104,10 @@
 @anchor{menu}
 @deftp Class menu
 This class represents a container for menu items and submenus. It
-derives from @ref{widget-with-items}.
+derives from @ref{item-manager}.
 @end deftp
 
+ at anchor{menu-item}
 @deftp Class menu-item
 A subclass of @ref{item} representing a @ref{menu} item.
 @end deftp
@@ -129,14 +141,6 @@
 behavior of the widget; style keywords are widget-specific.
 @end deftp
 
- at anchor{widget-with-items}
- at deftp Class widget-with-items items
-The widget-with-items class is the base class for objects composed of
-sub-items.  It derives from @ref{widget}. The @code{items} slot is an
- at sc{adjustable} @sc{vector} containing @ref{item} objects,
-representing sub-elements of the widget.
- at end deftp
-
 
 @node Controls
 @subsection Controls

Modified: trunk/graphic-forms-uitoolkit.asd
==============================================================================
--- trunk/graphic-forms-uitoolkit.asd	(original)
+++ trunk/graphic-forms-uitoolkit.asd	Mon Aug 28 11:20:02 2006
@@ -131,7 +131,7 @@
                        (:file "edit")
                        (:file "label")
                        (:file "button")
-                       (:file "widget-with-items")
+                       (:file "item-manager")
                        (:file "menu")
                        (:file "menu-item")
                        (:file "menu-language")

Modified: trunk/src/packages.lisp
==============================================================================
--- trunk/src/packages.lisp	(original)
+++ trunk/src/packages.lisp	Mon Aug 28 11:20:02 2006
@@ -256,6 +256,7 @@
     #:flow-layout
     #:heap-layout
     #:item
+    #:item-manager
     #:layout-managed
     #:layout-manager
     #:menu
@@ -265,7 +266,6 @@
     #:timer
     #:top-level
     #:widget
-    #:widget-with-items
     #:window
 
 ;; constants

Copied: trunk/src/uitoolkit/widgets/item-manager.lisp (from r231, trunk/src/uitoolkit/widgets/widget-with-items.lisp)
==============================================================================
--- trunk/src/uitoolkit/widgets/widget-with-items.lisp	(original)
+++ trunk/src/uitoolkit/widgets/item-manager.lisp	Mon Aug 28 11:20:02 2006
@@ -1,5 +1,5 @@
 ;;;;
-;;;; widget-with-items.lisp
+;;;; item-manager.lisp
 ;;;;
 ;;;; Copyright (C) 2006, Jack D. Unrue
 ;;;; All rights reserved.
@@ -33,23 +33,23 @@
 
 (in-package :graphic-forms.uitoolkit.widgets)
 
-(defmethod append-item :before ((self widget-with-items) text (image gfg:image) (disp event-dispatcher) &optional checked disabled)
+(defmethod append-item :before ((self item-manager) text (image gfg:image) (disp event-dispatcher) &optional checked disabled)
   (declare (ignore text image disp checked disabled))
   (if (gfs:disposed-p self)
     (error 'gfs:disposed-error)))
 
-(defmethod delete-all ((self widget-with-items))
+(defmethod delete-all ((self item-manager))
   (let ((items (items self)))
     (dotimes (i (length items))
       (gfs:dispose (aref items i))))
   (setf (items self) (make-array 7 :fill-pointer 0 :adjustable t)))
 
-(defmethod delete-item :before ((self widget-with-items) index)
+(defmethod delete-item :before ((self item-manager) index)
   (declare (ignore index))
   (if (gfs:disposed-p self)
     (error 'gfs:disposed-error)))
 
-(defmethod delete-item ((self widget-with-items) index)
+(defmethod delete-item ((self item-manager) index)
   (let* ((items (items self))
          (it (elt items index)))
     (setf (items self) (remove it items :test #'items-equal-p))
@@ -57,21 +57,21 @@
       (error 'gfs:disposed-error))
     (gfs:dispose it)))
 
-(defmethod delete-item-span :before ((self widget-with-items) (sp gfs:span))
+(defmethod delete-item-span :before ((self item-manager) (sp gfs:span))
   (declare (ignore sp))
   (if (gfs:disposed-p self)
     (error 'gfs:disposed-error)))
 
-(defmethod delete-item-span ((self widget-with-items) (sp gfs:span))
+(defmethod delete-item-span ((self item-manager) (sp gfs:span))
   (dotimes (i (1+ (- (gfs:span-end sp) (gfs:span-start sp))))
     (delete-item self (gfs:span-start sp))))
 
-(defmethod item-index :before ((self widget-with-items) (it item))
+(defmethod item-index :before ((self item-manager) (it item))
   (declare (ignore it))
   (if (gfs:disposed-p self)
     (error 'gfs:disposed-error)))
 
-(defmethod item-index ((self widget-with-items) (it item))
+(defmethod item-index ((self item-manager) (it item))
   (let ((pos (position it (items self) :test #'items-equal-p)))
     (if (null pos)
       (return-from item-index 0))

Modified: trunk/src/uitoolkit/widgets/widget-classes.lisp
==============================================================================
--- trunk/src/uitoolkit/widgets/widget-classes.lisp	(original)
+++ trunk/src/uitoolkit/widgets/widget-classes.lisp	Mon Aug 28 11:20:02 2006
@@ -154,21 +154,21 @@
 (defclass font-dialog (widget) ()
   (:documentation "This class represents the standard font dialog."))
 
-(defclass widget-with-items (widget)
+(defclass item-manager ()
   ((items
     :accessor items
     ;; FIXME: allow subclasses to set initial size?
     :initform (make-array 7 :fill-pointer 0 :adjustable t)))
-  (:documentation "The widget-with-items class is the base class for objects composed of sub-items."))
+  (:documentation "A mix-in for objects composed of sub-elements."))
 
-(defclass list-box (widget-with-items)
+(defclass list-box (widget item-manager)
   ((callback-event-name
     :accessor callback-event-name-of
     :initform 'event-select
     :allocation :class)) ; shadowing same slot from event-source
   (:documentation "The list-box class represents the standard listbox control."))
 
-(defclass menu (widget-with-items)
+(defclass menu (widget item-manager)
   ((callback-event-name
     :accessor callback-event-name-of
     :initform 'event-activate



More information about the Graphic-forms-cvs mailing list