Bug 2787 - patch: mouse wheel in scrollable listboxes + one small debug "print" commented
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: PC All
: P2 enhancement
Assignee: Tim Angus
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2006-07-19 10:25 EDT by rasz
Modified: 2006-12-29 13:28:49 EST
0 users

See Also:


Attachments
patch in file form (916 bytes, patch)
2006-07-19 14:24 EDT, rasz
fixed comment (917 bytes, patch)
2006-08-03 13:15 EDT, rasz
fixed comment (917 bytes, patch)
2006-08-03 13:16 EDT, rasz

Description rasz 2006-07-19 10:25:41 EDT
Mouse wheel scrolls 3 lines at a time.

Index: trunk/src/ui/ui_shared.c
===================================================================
--- trunk/src/ui/ui_shared.c    (.../svn://svn.icculus.org/tremulous/trunk)    (revision 802)
+++ trunk/src/ui/ui_shared.c    (.../trunk)     (working copy)
@@ -1834,6 +1834,20 @@
       }
     }
     // mouse hit
+    if (key == K_MWHEELUP) {
+        listPtr->startPos-=3;
+        if (listPtr->startPos < 0) {
+          listPtr->startPos = 0;
+        }
+      return qtrue;
+    }
+    if (key == K_MWHEELDOWN) {
+        listPtr->startPos+=3;
+        if (listPtr->startPos > max) {
+          listPtr->startPos = max;
+        }
+      return qtrue;
+    }
     if (key == K_MOUSE1 || key == K_MOUSE2) {
       if (item->window.flags & WINDOW_LB_LEFTARROW) {
         listPtr->startPos--;
@@ -2381,7 +2395,7 @@
       }
     }
   }
-  DC->Print("slider handle key exit\n");
+  #DC->Print("slider handle key exit\n");
   return qfalse;
 }
Comment 1 rasz 2006-07-19 14:24:20 EDT
Created attachment 967 [details]
patch in file form

hmm this attachment should work, will it?
Comment 2 Martin Doucha 2006-08-03 10:24:08 EDT
rasz, you've turned that debug print into a preprocessor directive instead of commenting it out.
Comment 3 rasz 2006-08-03 13:15:51 EDT
Created attachment 1011 [details]
fixed comment
Comment 4 rasz 2006-08-03 13:16:00 EDT
Created attachment 1012 [details]
fixed comment