This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Setup.exe: Mouse wheel


Hi,

Setup.exe doesn't handle mouse wheel messages.  Some mouse drivers
simulate WM_VSCROLL messages, but the stock drivers on my W2K system
don't.

Attached a simple patch to choose.cc to do this.

so long, benny

2003-05-19  Benjamin Riefenstahl  <Benjamin.Riefenstahl@epost.de>

	* choose.cc (chooser_proc): New callback proc to handle
	WM_MOUSEWHEEL.	
	(ChooserPage::Create): Use it.

--- choose.cc.~2.113.~	2003-03-13 23:21:14.000000000 +0200
+++ choose.cc	2003-05-19 15:22:20.000000000 +0200
@@ -186,6 +186,29 @@
   return 0;
 }
 
+static BOOL CALLBACK
+chooser_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+  switch (message)
+    {
+    case WM_MOUSEWHEEL:
+      {
+	 int zDelta = GET_WHEEL_DELTA_WPARAM(wParam) / 120;
+	 while (zDelta > 0)
+	   {
+	     chooser->scroll (lv, SB_VERT, &chooser->scroll_ulc_y, SB_LINEUP);
+	     --zDelta;
+	   }
+	 while (zDelta < 0)
+	   {
+	     chooser->scroll (lv, SB_VERT, &chooser->scroll_ulc_y, SB_LINEDOWN);	     ++zDelta;
+	   }
+         return TRUE;
+      }
+    }
+  return FALSE;
+}
+
 static LRESULT CALLBACK
 listview_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
@@ -535,7 +558,7 @@
 bool
 ChooserPage::Create ()
 {
-  return PropertyPage::Create (IDD_CHOOSE);
+  return PropertyPage::Create (chooser_proc, IDD_CHOOSE);
 }
 
 void

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]