changeset 104:3926f6c95d6f

Fix: Scrollbar events
author Frank Benoit <benoit@tionex.de>
date Sun, 10 Feb 2008 21:46:13 +0100
parents 40c02ead0a2c
children 127fb6e60c53
files dsss.conf dwt/widgets/ScrollBar.d dwt/widgets/Scrollable.d dwt/widgets/Widget.d
diffstat 4 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dsss.conf	Sun Feb 10 03:34:55 2008 +0100
+++ b/dsss.conf	Sun Feb 10 21:46:13 2008 +0100
@@ -2,6 +2,7 @@
 
 [dwt]
 type=library
+debugflags+=-g -gc -debug
 
 
 [simple.d]
--- a/dwt/widgets/ScrollBar.d	Sun Feb 10 03:34:55 2008 +0100
+++ b/dwt/widgets/ScrollBar.d	Sun Feb 10 21:46:13 2008 +0100
@@ -26,6 +26,10 @@
 import dwt.widgets.Scrollable;
 
 import dwt.dwthelper.utils;
+import tango.util.log.Trace;
+void trc( long line ){
+    //Trace.formatln( "ScrollBar {}", line );
+}
 
 /**
  * Instances of this class are selectable user interface
@@ -895,6 +899,7 @@
 }
 
 LRESULT wmScrollChild (int wParam, int lParam) {
+trc(__LINE__);
 
     /* Do nothing when scrolling is ending */
     int code = wParam & 0xFFFF;
--- a/dwt/widgets/Scrollable.d	Sun Feb 10 03:34:55 2008 +0100
+++ b/dwt/widgets/Scrollable.d	Sun Feb 10 21:46:13 2008 +0100
@@ -23,6 +23,10 @@
 import dwt.internal.win32.OS;
 
 import dwt.dwthelper.utils;
+import tango.util.log.Trace;
+void trc( long line ){
+    //Trace.formatln( "Scrollable {}", line );
+}
 
 /**
  * This class is the abstract superclass of all classes which
@@ -255,8 +259,9 @@
 }
 
 override LRESULT WM_HSCROLL (int wParam, int lParam) {
+trc(__LINE__);
     LRESULT result = super.WM_HSCROLL (wParam, lParam);
-    if (result !is 0) return result;
+    if (result !is LRESULT.NULL) return result;
 
     /*
     * Bug on WinCE.  lParam should be NULL when the message is not sent
@@ -272,8 +277,9 @@
 }
 
 override LRESULT WM_MOUSEWHEEL (int wParam, int lParam) {
+trc(__LINE__);
     LRESULT result = super.WM_MOUSEWHEEL (wParam, lParam);
-    if (result !is 0) return result;
+    if (result !is LRESULT.NULL) return result;
 
     /*
     * Translate WM_MOUSEWHEEL to WM_VSCROLL or WM_HSCROLL.
@@ -341,7 +347,9 @@
 }
 
 override LRESULT WM_SIZE (int wParam, int lParam) {
+trc(__LINE__);
     LRESULT code = callWindowProc (handle, OS.WM_SIZE, wParam, lParam);
+    assert( code !is LRESULT.NULL );
     super.WM_SIZE (wParam, lParam);
     // widget may be disposed at this point
     if (code is 0) return LRESULT.ZERO;
@@ -349,8 +357,9 @@
 }
 
 override LRESULT WM_VSCROLL (int wParam, int lParam) {
+trc(__LINE__);
     LRESULT result = super.WM_VSCROLL (wParam, lParam);
-    if (result !is 0) return result;
+    if (result !is LRESULT.NULL) return result;
     /*
     * Bug on WinCE.  lParam should be NULL when the message is not sent
     * by a scroll bar control, but it contains the handle to the window.
@@ -365,6 +374,7 @@
 }
 
 LRESULT wmScroll (ScrollBar bar, bool update, HWND hwnd, int msg, int wParam, int lParam) {
+trc(__LINE__);
     LRESULT result = LRESULT.NULL;
     if (update) {
         int type = msg is OS.WM_HSCROLL ? OS.SB_HORZ : OS.SB_VERT;
--- a/dwt/widgets/Widget.d	Sun Feb 10 03:34:55 2008 +0100
+++ b/dwt/widgets/Widget.d	Sun Feb 10 21:46:13 2008 +0100
@@ -30,6 +30,10 @@
 import tango.io.Stdout;
 import tango.core.Thread;
 import dwt.dwthelper.utils;
+import tango.util.log.Trace;
+void trc( long line ){
+    //Trace.formatln( "Widget {}", line );
+}
 
 /**
  * This class is the abstract superclass of all user interface objects.