[graphic-forms-cvs] r152 - in trunk: docs/manual src/tests/uitoolkit src/uitoolkit/widgets
junrue at common-lisp.net
junrue at common-lisp.net
Mon Jun 5 18:33:21 UTC 2006
Author: junrue
Date: Mon Jun 5 14:33:21 2006
New Revision: 152
Modified:
trunk/docs/manual/api.texinfo
trunk/docs/manual/glossary.texinfo
trunk/src/tests/uitoolkit/layout-tester.lisp
trunk/src/uitoolkit/widgets/button.lisp
Log:
added :tri-state button style; added documentation for button styles
Modified: trunk/docs/manual/api.texinfo
==============================================================================
--- trunk/docs/manual/api.texinfo (original)
+++ trunk/docs/manual/api.texinfo Mon Jun 5 14:33:21 2006
@@ -177,22 +177,50 @@
@anchor{button}
@deftp Class button
-This @ref{control} class represents selectable controls that issue
-notifications when clicked.@*@*
-The following initargs are supported:
+This @ref{control} class represents selectable controls that invoke
+the @ref{event-select} method defined for an @ref{event-dispatcher}
+associated with the @code{button}.
@deffn Initarg :image
+Supplies an image to be used as the @code{button} label.
@end deffn
@deffn Initarg :style
@table @code
@item :cancel-button
+Placing a @code{:cancel-button} in a @ref{dialog} enables the
+ at sc{escape} key @ref{accelerator} for dismissing the dialog. This
+action should be interpreted as the user discarding the content of the
+dialog.
@item :check-box
+This style specifies a @code{button} having a small box, which may
+contain a check mark depending on the @code{button}'s selection state,
+adjacent to a text label.
@item :default-button
+Placing a @code{:default-button} in a dialog enables the @sc{return}
+key @ref{accelerator} for dismissing the dialog. This action should be
+interpreted as the user accepting the content of the dialog. Also, the
+ at code{button} is rendered with an extra thick border.
@item :push-button
+This style specifies a traditional push button control. No special
+keyboard accelerators are enabled.
@item :radio-button
+This style specifies a @code{button} having a small circle, which may
+be filled or unfilled depending on the @code{button}'s selection
+state, adjacent to a text label. Radio @code{button}s are typically
+used in groups and are managed such that only one member of the group
+is enabled at a time.
@item :toggle-button
+This style specifies a control that when unselected looks like a push
+ at code{button}. But when in the selected state, the @code{button}
+maintains a sunken look. It is similar in function to a
+ at code{:check-box}.
+ at item :tri-state
+This style specifies a control that looks similar to a @code{:check-box},
+but the box can be grayed as well as checked or cleared. The grayed look
+is used to indicate an undetermined state.
@end table
@end deffn
@deffn Initarg :text
+Supplies the text for the @code{button} label.
@end deffn
@end deftp
Modified: trunk/docs/manual/glossary.texinfo
==============================================================================
--- trunk/docs/manual/glossary.texinfo (original)
+++ trunk/docs/manual/glossary.texinfo Mon Jun 5 14:33:21 2006
@@ -13,6 +13,19 @@
Terms and definitions. Content will be added in due time.
@table @samp
+
+ at item accelerator
+ at anchor{accelerator}
+ at cindex accelerator
+An accelerator is a key sequence assigned to an application function
+that allows a user to bypass navigation of the menu or control
+hierarchy normally required to invoke the function. Some accelerators
+are established by Windows style guidelines, such as @sc{control-c}
+for the clipboard copy operation from an Edit menu. Applications may
+define other accelerators as appropriate. Accelerators are generally
+intended for more knowledgeable users and should not be the sole
+mechanism for invoking functionality. Compare with @ref{mnemonic}.
+
@item control
@cindex control
A control is a system-defined window class that accepts user input
@@ -29,4 +42,13 @@
@cindex menu
A collection of menu items.
+ at item mnemonic
+ at anchor{mnemonic}
+ at cindex mnemonic
+A mnemonic is a key sequence (usually a single character modified by
+the @sc{alt} key) that enables mouse-free navigation of a menu or
+control hierarchy to invoke an application function. Depending on
+the user's system settings, mnemonic characters may be hidden until
+the user presses the @sc{alt} key. Compare with @ref{accelerator}.
+
@end table
Modified: trunk/src/tests/uitoolkit/layout-tester.lisp
==============================================================================
--- trunk/src/tests/uitoolkit/layout-tester.lisp (original)
+++ trunk/src/tests/uitoolkit/layout-tester.lisp Mon Jun 5 14:33:21 2006
@@ -104,7 +104,8 @@
((or (eql subtype :check-box)
(eql subtype :push-button)
(eql subtype :radio-button)
- (eql subtype :toggle-button))
+ (eql subtype :toggle-button)
+ (eql subtype :tri-state))
(setf w (make-instance widget-class
:parent *layout-tester-win*
:dispatcher be
@@ -389,6 +390,7 @@
(add-checkbox-disp (make-instance 'add-child-dispatcher :subtype :check-box))
(add-radio-disp (make-instance 'add-child-dispatcher :subtype :radio-button))
(add-toggle-disp (make-instance 'add-child-dispatcher :subtype :toggle-button))
+ (add-tri-state-disp (make-instance 'add-child-dispatcher :subtype :tri-state))
(add-panel-disp (make-instance 'add-child-dispatcher :widget-class 'test-panel
:subtype :panel))
(add-image-label-disp (make-instance 'add-child-dispatcher :widget-class 'gfw:label
@@ -414,7 +416,8 @@
(:item "Label - Text" :dispatcher add-text-label-disp)
(:item "Panel" :dispatcher add-panel-disp)
(:item "Radiobutton" :dispatcher add-radio-disp)
- (:item "Toggle" :dispatcher add-toggle-disp)))
+ (:item "Toggle" :dispatcher add-toggle-disp)
+ (:item "Tri-State" :dispatcher add-tri-state-disp)))
(:item "Remove" :dispatcher rem-menu-disp
:submenu ((:item "")))
(:item "Visible" :dispatcher vis-menu-disp
Modified: trunk/src/uitoolkit/widgets/button.lisp
==============================================================================
--- trunk/src/uitoolkit/widgets/button.lisp (original)
+++ trunk/src/uitoolkit/widgets/button.lisp Mon Jun 5 14:33:21 2006
@@ -57,7 +57,9 @@
((eq sym :radio-button)
(setf std-flags (logior std-flags gfs::+bs-autoradiobutton+)))
((eq sym :toggle-button)
- (setf std-flags (logior std-flags gfs::+bs-autocheckbox+ gfs::+bs-pushlike+)))))
+ (setf std-flags (logior std-flags gfs::+bs-autocheckbox+ gfs::+bs-pushlike+)))
+ ((eq sym :tri-state)
+ (setf std-flags (logior std-flags gfs::+bs-auto3state+)))))
(if (null style)
(logior std-flags gfs::+bs-pushbutton+))
(values std-flags 0)))
@@ -88,7 +90,7 @@
(let ((text-size (widget-text-size self gfs::+dt-singleline+))
(size (gfs:make-size))
(b-width (* (border-width self) 2))
- (need-cb-size (intersection '(:check-box :radio-button) (style-of self)))
+ (need-cb-size (intersection '(:check-box :radio-button :tri-state) (style-of self)))
(cb-size (check-box-size)))
(cond
((>= width-hint 0)
More information about the Graphic-forms-cvs
mailing list