[graphic-forms-cvs] r298 - in trunk: docs/manual docs/manual/gfw src/uitoolkit/system src/uitoolkit/widgets

junrue at common-lisp.net junrue at common-lisp.net
Wed Oct 11 20:25:54 UTC 2006


Author: junrue
Date: Wed Oct 11 16:25:54 2006
New Revision: 298

Added:
   trunk/docs/manual/gfw/event-pre-resize.html
   trunk/docs/manual/gfw/event-resize.html
Modified:
   trunk/docs/manual/Graphic-FormsProgrammingReference.wcp
   trunk/src/uitoolkit/system/system-constants.lisp
   trunk/src/uitoolkit/widgets/event-generics.lisp
   trunk/src/uitoolkit/widgets/event.lisp
   trunk/src/uitoolkit/widgets/scrolling-event-dispatcher.lisp
Log:
implemented integral resizing (event-pre-resize)

Modified: trunk/docs/manual/Graphic-FormsProgrammingReference.wcp
==============================================================================
--- trunk/docs/manual/Graphic-FormsProgrammingReference.wcp	(original)
+++ trunk/docs/manual/Graphic-FormsProgrammingReference.wcp	Wed Oct 11 16:25:54 2006
@@ -92,7 +92,7 @@
 DefaultTopic=Introduction.html
 
 [TOPICS]
-TitleList=70
+TitleList=72
 TitleList.Title.0=Legal Information
 TitleList.Level.0=0
 TitleList.Url.0=LegalInfo.html
@@ -151,7 +151,7 @@
 TitleList.Keywords.5=GFG`\graphic-forms.uitoolkit.graphics
 TitleList.ContextNumber.5=
 TitleList.ApplyTemp.5=0
-TitleList.Expanded.5=1
+TitleList.Expanded.5=0
 TitleList.Kind.5=0
 TitleList.Title.6=color
 TitleList.Level.6=2
@@ -251,7 +251,7 @@
 TitleList.Keywords.15=GFS`\graphic-forms.uitoolkit.system
 TitleList.ContextNumber.15=
 TitleList.ApplyTemp.15=0
-TitleList.Expanded.15=1
+TitleList.Expanded.15=0
 TitleList.Kind.15=0
 TitleList.Title.16=code
 TitleList.Level.16=2
@@ -693,79 +693,79 @@
 TitleList.ApplyTemp.59=0
 TitleList.Expanded.59=0
 TitleList.Kind.59=0
-TitleList.Title.60=event-select
+TitleList.Title.60=event-pre-resize
 TitleList.Level.60=2
-TitleList.Url.60=gfw\event-select.html
+TitleList.Url.60=gfw\event-pre-resize.html
 TitleList.Icon.60=0
 TitleList.Status.60=0
-TitleList.Keywords.60=event-select
+TitleList.Keywords.60=event-pre-resize
 TitleList.ContextNumber.60=
 TitleList.ApplyTemp.60=0
 TitleList.Expanded.60=0
 TitleList.Kind.60=0
-TitleList.Title.61=event-source
+TitleList.Title.61=event-resize
 TitleList.Level.61=2
-TitleList.Url.61=gfw\event-source.html
+TitleList.Url.61=gfw\event-resize.html
 TitleList.Icon.61=0
 TitleList.Status.61=0
-TitleList.Keywords.61=event-source
+TitleList.Keywords.61=event-resize
 TitleList.ContextNumber.61=
 TitleList.ApplyTemp.61=0
 TitleList.Expanded.61=0
 TitleList.Kind.61=0
-TitleList.Title.62=message-loop
+TitleList.Title.62=event-select
 TitleList.Level.62=2
-TitleList.Url.62=gfw\message-loop.html
+TitleList.Url.62=gfw\event-select.html
 TitleList.Icon.62=0
 TitleList.Status.62=0
-TitleList.Keywords.62=message-loop
+TitleList.Keywords.62=event-select
 TitleList.ContextNumber.62=
 TitleList.ApplyTemp.62=0
 TitleList.Expanded.62=0
 TitleList.Kind.62=0
-TitleList.Title.63=obtain-event-time
+TitleList.Title.63=event-source
 TitleList.Level.63=2
-TitleList.Url.63=gfw\obtain-event-time.html
+TitleList.Url.63=gfw\event-source.html
 TitleList.Icon.63=0
 TitleList.Status.63=0
-TitleList.Keywords.63=obtain-event-time
+TitleList.Keywords.63=event-source
 TitleList.ContextNumber.63=
 TitleList.ApplyTemp.63=0
 TitleList.Expanded.63=0
 TitleList.Kind.63=0
-TitleList.Title.64=with-graphics-context
+TitleList.Title.64=message-loop
 TitleList.Level.64=2
-TitleList.Url.64=gfw\with-graphics-context.html
+TitleList.Url.64=gfw\message-loop.html
 TitleList.Icon.64=0
 TitleList.Status.64=0
-TitleList.Keywords.64=with-graphics-context
+TitleList.Keywords.64=message-loop
 TitleList.ContextNumber.64=
 TitleList.ApplyTemp.64=0
 TitleList.Expanded.64=0
 TitleList.Kind.64=0
-TitleList.Title.65=Miscellaneous Topics
-TitleList.Level.65=0
-TitleList.Url.65=MiscellaneousTopics.html
+TitleList.Title.65=obtain-event-time
+TitleList.Level.65=2
+TitleList.Url.65=gfw\obtain-event-time.html
 TitleList.Icon.65=0
 TitleList.Status.65=0
-TitleList.Keywords.65=
+TitleList.Keywords.65=obtain-event-time
 TitleList.ContextNumber.65=
 TitleList.ApplyTemp.65=0
 TitleList.Expanded.65=0
 TitleList.Kind.65=0
-TitleList.Title.66=Image Data Plugins
-TitleList.Level.66=1
-TitleList.Url.66=ImageDataPlugins.html
+TitleList.Title.66=with-graphics-context
+TitleList.Level.66=2
+TitleList.Url.66=gfw\with-graphics-context.html
 TitleList.Icon.66=0
 TitleList.Status.66=0
-TitleList.Keywords.66=
+TitleList.Keywords.66=with-graphics-context
 TitleList.ContextNumber.66=
 TitleList.ApplyTemp.66=0
 TitleList.Expanded.66=0
 TitleList.Kind.66=0
-TitleList.Title.67=Terminology Conventions
+TitleList.Title.67=Miscellaneous Topics
 TitleList.Level.67=0
-TitleList.Url.67=TerminologyConventions.html
+TitleList.Url.67=MiscellaneousTopics.html
 TitleList.Icon.67=0
 TitleList.Status.67=0
 TitleList.Keywords.67=
@@ -773,9 +773,9 @@
 TitleList.ApplyTemp.67=0
 TitleList.Expanded.67=0
 TitleList.Kind.67=0
-TitleList.Title.68=Glossary
-TitleList.Level.68=0
-TitleList.Url.68=Glossary.html
+TitleList.Title.68=Image Data Plugins
+TitleList.Level.68=1
+TitleList.Url.68=ImageDataPlugins.html
 TitleList.Icon.68=0
 TitleList.Status.68=0
 TitleList.Keywords.68=
@@ -783,14 +783,34 @@
 TitleList.ApplyTemp.68=0
 TitleList.Expanded.68=0
 TitleList.Kind.68=0
-TitleList.Title.69=Footnotes
+TitleList.Title.69=Terminology Conventions
 TitleList.Level.69=0
-TitleList.Url.69=Footnotes.html
+TitleList.Url.69=TerminologyConventions.html
 TitleList.Icon.69=0
 TitleList.Status.69=0
 TitleList.Keywords.69=
 TitleList.ContextNumber.69=
 TitleList.ApplyTemp.69=0
 TitleList.Expanded.69=0
-TitleList.Kind.69=1
+TitleList.Kind.69=0
+TitleList.Title.70=Glossary
+TitleList.Level.70=0
+TitleList.Url.70=Glossary.html
+TitleList.Icon.70=0
+TitleList.Status.70=0
+TitleList.Keywords.70=
+TitleList.ContextNumber.70=
+TitleList.ApplyTemp.70=0
+TitleList.Expanded.70=0
+TitleList.Kind.70=0
+TitleList.Title.71=Footnotes
+TitleList.Level.71=0
+TitleList.Url.71=Footnotes.html
+TitleList.Icon.71=0
+TitleList.Status.71=0
+TitleList.Keywords.71=
+TitleList.ContextNumber.71=
+TitleList.ApplyTemp.71=0
+TitleList.Expanded.71=0
+TitleList.Kind.71=1
 

Added: trunk/docs/manual/gfw/event-pre-resize.html
==============================================================================
--- (empty file)
+++ trunk/docs/manual/gfw/event-pre-resize.html	Wed Oct 11 16:25:54 2006
@@ -0,0 +1,99 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>event-pre-resize</title>
+<meta name="GENERATOR" content="WinCHM">
+<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
+
+</head>
+
+<body><FONT face=Arial>
+<H4>
+<TABLE style="WIDTH: 100%; BORDER-COLLAPSE: collapse" 
+borderColor=#ffffff cellSpacing=0 cellPadding=2 width="100%" border=1>
+  
+  <TR>
+    <TD width="60%"><STRONG>event-pre-resize</STRONG></TD>
+    <TD>
+      <P><FONT size=2>[Generic Function]</FONT> </P></TD></TR></TABLE>
+<HR></H4>
+<P></FONT><FONT face=Arial><STRONG>syntax</STRONG></FONT></P>
+  <P dir=ltr style="MARGIN-RIGHT: 0px"><FONT 
+face=Arial size=2><FONT face=Arial size=2>(gfw:event-pre-resize <EM><A 
+href="event-dispatcher.html">event-dispatcher</A> widget <A 
+href="../gfs/rectangle.html" >rectangle</A>   
+ type</EM>)</P>
+<H4><FONT face=Arial>arguments 
+<P>
+<TABLE style="WIDTH: 100%; BORDER-COLLAPSE: collapse" borderColor=#ffffff 
+cellSpacing=0 cellPadding=2 width="100%" border=1>
+  
+  <TR>
+    <TD width="20%"><EM><FONT size=2>event-dispatcher</FONT></EM></TD>
+    <TD><FONT size=2>The <A href="event-dispatcher.html" >event-dispatcher</A> that will 
+      process the resize event.</FONT></TD></TR>
+  <TR>
+    <TD width="20%"><FONT size=2><EM>widget</EM></FONT></TD>
+    <TD><FONT size=2>The widget being 
+resized.</FONT></TD></TR>
+  <TR>
+    <TD width="20%"><FONT size=2><EM>rectangle</EM></FONT></TD>
+    <TD><FONT size=2>A <A 
+      href="../gfs/rectangle.html">rectangle</A> object describing the resize drag 
+      rectangle.</FONT></TD></TR>
+  <TR>
+    <TD width="20%"><FONT size=2><EM>type</EM></FONT></TD>
+    <TD>
+      <P><FONT size=2>Identifies which 
+      of eight possible areas of <EM>widget</EM>   's frame 
+      is being sized:<BR><FONT face=Courier size=3>:bottom</FONT>  indicates the bottom 
+      edge of <EM>widget</EM>         
+           <BR><FONT face=Courier 
+      size=3>:bottom-left</FONT>   
+      indicates the bottom-left corner of <EM>widget</EM>    
+       <BR><FONT face=Courier size=3>:bottom-right</FONT>   indicates the 
+      bottom-right corner of 
+      <EM>widget</EM> <BR><FONT 
+      face=Courier size=3>:left</FONT> indicates the left edge of 
+      <EM>widget</EM><BR><FONT face=Courier size=3>:right</FONT> indicates the 
+      right edge of <EM>widget</EM><BR><FONT face=Courier size=3>:top</FONT> 
+      indicates the top edge of <EM>widget</EM><BR><FONT face=Courier 
+      size=3>:top-left</FONT> indicates the top-left corner of 
+      <EM>widget</EM><BR><FONT face=Courier size=3>:top-right</FONT> indicates 
+      the top-right corner of 
+<EM>widget</EM>      
+       
+</FONT></P></TD></TR></TABLE></P>description</FONT></H4><FONT face=Arial size=2>
+<P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>       Implement a method for this generic function to respond to 
+<EM>widget</EM> being resized. This event function gives the 
+application an opportunity to modify the resize drag outline. This is 
+accomplished by changing one or more of the coordinates of 
+<EM>rectangle.</EM>               
+            
+              
+              
+                
+            
+              
+  
+         
+       </FONT></P></FONT></FONT></FONT>
+<H4><FONT face=Arial>see also</FONT></H4><FONT face=Arial size=2><FONT 
+face=Arial size=2><FONT face=Arial size=2>
+<P><A href="event-resize.html">event-resize</A></P>
+<P>
+<HR>
+
+<P></P>
+
+<P dir=ltr style="MARGIN-RIGHT: 0px"> </P>
+<P dir=ltr style="MARGIN-RIGHT: 0px">
+<TABLE style="WIDTH: 100%; BORDER-COLLAPSE: collapse" borderColor=#ffffff 
+cellSpacing=0 cellPadding=2 width="100%" border=1>
+  
+  <TR>
+    <TD width="60%">  </TD>
+    <TD>
+      <P><FONT size=1>Copyright © 2006, Jack D. Unrue</FONT> 
+</P></TD></TR></TABLE></P></FONT></FONT></FONT></body>
+</html>

Added: trunk/docs/manual/gfw/event-resize.html
==============================================================================
--- (empty file)
+++ trunk/docs/manual/gfw/event-resize.html	Wed Oct 11 16:25:54 2006
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>event-resize</title>
+<meta name="GENERATOR" content="WinCHM">
+<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
+
+</head>
+
+<body><FONT face=Arial>
+<H4>
+<TABLE style="WIDTH: 100%; BORDER-COLLAPSE: collapse" 
+borderColor=#ffffff cellSpacing=0 cellPadding=2 width="100%" border=1>
+  
+  <TR>
+    <TD width="60%"><STRONG>event-resize</STRONG></TD>
+    <TD>
+      <P><FONT size=2>[Generic Function]</FONT> </P></TD></TR></TABLE>
+<HR></H4>
+<P></FONT><FONT face=Arial><STRONG>syntax</STRONG></FONT></P>
+  <P dir=ltr style="MARGIN-RIGHT: 0px"><FONT 
+face=Arial size=2><FONT face=Arial size=2>(gfw:event-resize <EM><A 
+href="event-dispatcher.html">event-dispatcher</A> widget <A 
+href="../gfs/size.html">size</A>   
+ type</EM>)</P>
+<H4><FONT face=Arial>arguments 
+<P>
+<TABLE style="WIDTH: 100%; BORDER-COLLAPSE: collapse" borderColor=#ffffff 
+cellSpacing=0 cellPadding=2 width="100%" border=1>
+  
+  <TR>
+    <TD width="20%"><EM><FONT size=2>event-dispatcher</FONT></EM></TD>
+    <TD><FONT size=2>The <A href="event-dispatcher.html" >event-dispatcher</A> that will 
+      process the resize event.</FONT></TD></TR>
+  <TR>
+    <TD width="20%"><FONT size=2><EM>widget</EM></FONT></TD>
+    <TD><FONT size=2>The widget being 
+resized.</FONT></TD></TR>
+  <TR>
+    <TD width="20%"><FONT size=2><EM>size</EM></FONT></TD>
+    <TD><FONT size=2>A <A 
+      href="../gfs/size.html">size</A> object describing widget's new 
+      dimensions.</FONT></TD></TR>
+  <TR>
+    <TD width="20%"><FONT size=2><EM>type</EM></FONT></TD>
+    <TD>
+      <P><FONT size=2>Identifies which of three possible 
+      resizing actions occurred:<BR><FONT face=Courier size=3>:maximized</FONT> 
+      indicates that <EM>widget</EM> was expanded to its maximum <A 
+      href="../gfs/size.html">size</A>, such as when the user clicks on the 
+      maximize button of a window frame<BR><FONT face=Courier 
+      size=3>:minimized</FONT> indicates that <EM>widget</EM> was minimized to 
+      the taskbar<BR><FONT face=Courier size=3>:restored</FONT> indicates that 
+      <EM>widget</EM> was either restored from a minimized state, or that 
+      resizing occurred while <EM>widget</EM> was already in a visible, 
+      non-maximized 
+state</FONT></P></TD></TR></TABLE></P>description</FONT></H4><FONT face=Arial size=2>
+<P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Arial size=2>       Implement a method for this generic function to respond to 
+<EM>widget</EM>               
+            
+              
+              
+                
+            
+              
+  
+      being   
+       resized.</FONT></P>
+<H4><FONT face=Arial>see also</FONT></H4><FONT face=Arial size=2><FONT 
+face=Arial size=2><FONT face=Arial size=2>
+<P><A href="event-pre-resize.html">event-pre-resize</A></P></FONT></FONT></FONT>
+<HR>
+
+<P dir=ltr style="MARGIN-RIGHT: 0px"> </P>
+<P dir=ltr style="MARGIN-RIGHT: 0px">
+<TABLE style="WIDTH: 100%; BORDER-COLLAPSE: collapse" borderColor=#ffffff 
+cellSpacing=0 cellPadding=2 width="100%" border=1>
+  
+  <TR>
+    <TD width="60%">  </TD>
+    <TD>
+      <P><FONT size=1>Copyright © 2006, Jack D. Unrue</FONT> 
+</P></TD></TR></TABLE></P></FONT></FONT></FONT></body>
+</html>

Modified: trunk/src/uitoolkit/system/system-constants.lisp
==============================================================================
--- trunk/src/uitoolkit/system/system-constants.lisp	(original)
+++ trunk/src/uitoolkit/system/system-constants.lisp	Wed Oct 11 16:25:54 2006
@@ -1331,6 +1331,15 @@
 (defconstant +wm-appcommand+               #x0319)
 (defconstant +wm-themechanged+             #x031A)
 
+(defconstant +wmsz-left+                        1)
+(defconstant +wmsz-right+                       2)
+(defconstant +wmsz-top+                         3)
+(defconstant +wmsz-topleft+                     4)
+(defconstant +wmsz-topright+                    5)
+(defconstant +wmsz-bottom+                      6)
+(defconstant +wmsz-bottomleft+                  7)
+(defconstant +wmsz-bottomright+                 8)
+
 (defconstant +ws-overlapped+           #x00000000)
 (defconstant +ws-popup+                #x80000000)
 (defconstant +ws-child+                #x40000000)

Modified: trunk/src/uitoolkit/widgets/event-generics.lisp
==============================================================================
--- trunk/src/uitoolkit/widgets/event-generics.lisp	(original)
+++ trunk/src/uitoolkit/widgets/event-generics.lisp	Wed Oct 11 16:25:54 2006
@@ -168,10 +168,10 @@
   (:method (dispatcher widget)
     (declare (ignorable dispatcher widget))))
 
-(defgeneric event-pre-resize (dispatcher widget)
-  (:documentation "Implement this to preempt resizing; return T if processed or nil if not.")
-  (:method (dispatcher widget)
-    (declare (ignorable dispatcher widget))))
+(defgeneric event-pre-resize (dispatcher widget rect type)
+  (:documentation "Implement this to modify widget's resize drag rectangle.")
+  (:method (dispatcher widget rect type)
+    (declare (ignorable dispatcher widget rect type))))
 
 (defgeneric event-resize (dispatcher widget size type)
   (:documentation "Implement this to respond to widget being resized.")

Modified: trunk/src/uitoolkit/widgets/event.lisp
==============================================================================
--- trunk/src/uitoolkit/widgets/event.lisp	(original)
+++ trunk/src/uitoolkit/widgets/event.lisp	Wed Oct 11 16:25:54 2006
@@ -488,12 +488,27 @@
   0)
 
 (defmethod process-message (hwnd (msg (eql gfs::+wm-sizing+)) wparam lparam)
-  (declare (ignore wparam lparam))
-  (let* ((tc (thread-context))
-         (w (get-widget tc hwnd)))
-    (if (and w (event-pre-resize (dispatcher w) w))
-      1
-      0)))
+  (let* ((w (get-widget (thread-context) hwnd))
+         (ptr (cffi:make-pointer (logand #xFFFFFFFF lparam)))
+         (rect (cffi:convert-from-foreign ptr 'gfs::rect-pointer))
+         (type (case wparam
+                 (#.gfs::+wmsz-bottom+      :bottom)
+                 (#.gfs::+wmsz-bottomleft+  :bottom-left)
+                 (#.gfs::+wmsz-bottomright+ :bottom-right)
+                 (#.gfs::+wmsz-left+        :left)
+                 (#.gfs::+wmsz-right+       :right)
+                 (#.gfs::+wmsz-top+         :top)
+                 (#.gfs::+wmsz-topleft+     :top-left)
+                 (#.gfs::+wmsz-topright+    :top-right))))
+    (event-pre-resize (dispatcher w) w rect type)
+    (cffi:with-foreign-slots ((gfs::left gfs::top gfs::right gfs::bottom) ptr gfs::rect)
+      (let ((pnt (gfs:location rect))
+            (size (gfs:size rect)))
+        (setf gfs::left   (gfs:point-x pnt)
+              gfs::top    (gfs:point-y pnt)
+              gfs::right  (+ (gfs:point-x pnt) (gfs:size-width size))
+              gfs::bottom (+ (gfs:point-y pnt) (gfs:size-height size))))))
+  1)
 
 (defmethod process-message (hwnd (msg (eql gfs::+wm-timer+)) wparam lparam)
   (declare (ignore lparam))

Modified: trunk/src/uitoolkit/widgets/scrolling-event-dispatcher.lisp
==============================================================================
--- trunk/src/uitoolkit/widgets/scrolling-event-dispatcher.lisp	(original)
+++ trunk/src/uitoolkit/widgets/scrolling-event-dispatcher.lisp	Wed Oct 11 16:25:54 2006
@@ -135,6 +135,17 @@
 ;;; methods
 ;;;
 
+(defmethod event-pre-resize ((disp scrolling-event-dispatcher) (window window) rect type)
+  (declare (ignore type))
+  (let ((h-step (gfs:size-width (step-increments disp)))
+        (v-step (gfs:size-height (step-increments disp)))
+        (size (gfs:size rect)))
+    (if (/= h-step 1)
+      (setf (gfs:size-width size) (* (floor (gfs:size-width size) h-step) h-step)))
+    (if (/= v-step 1)
+      (setf (gfs:size-height size) (* (floor (gfs:size-height size) v-step) v-step)))
+    (setf (gfs:size rect) size)))
+
 (defmethod event-resize ((disp scrolling-event-dispatcher) (window window) size type)
   (declare (ignore size type))
   (call-next-method)



More information about the Graphic-forms-cvs mailing list