[graphic-forms-cvs] r194 - in trunk/src: demos/textedit uitoolkit/widgets

junrue at common-lisp.net junrue at common-lisp.net
Thu Jul 13 14:15:32 UTC 2006


Author: junrue
Date: Thu Jul 13 10:15:32 2006
New Revision: 194

Modified:
   trunk/src/demos/textedit/textedit-window.lisp
   trunk/src/uitoolkit/widgets/event.lisp
Log:
WM_ACTIVATE seems to be getting additional notification values than documented so changed an ecase to case; fix select all item enabling in textedit when text is empty

Modified: trunk/src/demos/textedit/textedit-window.lisp
==============================================================================
--- trunk/src/demos/textedit/textedit-window.lisp	(original)
+++ trunk/src/demos/textedit/textedit-window.lisp	Thu Jul 13 10:15:32 2006
@@ -91,16 +91,17 @@
   (unless *textedit-control*
     (return-from manage-textedit-edit-menu nil))
   (let ((items (gfw:items menu))
+        (text (gfw:text *textedit-control*))
         (text-sel (gfw:selection-span *textedit-control*)))
     (gfw:enable (elt items 0) (gfw:undo-available-p *textedit-control*))
     (gfw:enable (elt items 2) text-sel)
     (gfw:enable (elt items 3) text-sel)
     (gfw:enable (elt items 4) (gfw:text-for-pasting-p *textedit-control*))
     (gfw:enable (elt items 5) text-sel)
-    (gfw:enable (elt items 12) (or (null text-sel)
-                                   (> (gfs:span-start text-sel) 0)
-                                   (< (gfs:span-end text-sel)
-                                      (length (gfw:text *textedit-control*)))))))
+    (gfw:enable (elt items 12) (and (> (length text) 0)
+                                    (or (null text-sel)
+                                        (> (gfs:span-start text-sel) 0)
+                                        (< (gfs:span-end text-sel) (length text)))))))
 
 (defun textedit-edit-copy (disp item)
   (declare (ignore disp item))

Modified: trunk/src/uitoolkit/widgets/event.lisp
==============================================================================
--- trunk/src/uitoolkit/widgets/event.lisp	(original)
+++ trunk/src/uitoolkit/widgets/event.lisp	Thu Jul 13 10:15:32 2006
@@ -353,7 +353,7 @@
   (declare (ignore lparam))
   (let ((widget (get-widget (thread-context) hwnd)))
     (if widget
-      (ecase wparam
+      (case wparam
         (#.gfs::+wa-active+      (event-activate   (dispatcher widget) widget))
         (#.gfs::+wa-clickactive+ (event-activate   (dispatcher widget) widget))
         (#.gfs::+wa-inactive+    (event-deactivate (dispatcher widget) widget)))))



More information about the Graphic-forms-cvs mailing list