Changeset 153 for trunk/src


Ignore:
Timestamp:
Jun 16, 2009, 4:18:08 AM (16 years ago)
Author:
lpino
Message:
  • Begin to handle events
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Scale.java

    r151 r153  
    107107    OS.WinSetWindowUShort (handle, OS.QWS_ID, (short)(handle & 0xFFFF));
    108108    OS.WinSendMsg(handle, OS.SLM_SETTICKSIZE, OS.MPFROM2SHORT((short)OS.SMA_SETALLTICKS, (short)6), 0);
    109 //    OS.WinSendMsg(handle, OS.SLM_SETSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMPOSITION, (short)OS.SMA_INCREMENTVALUE), 1);
     109
    110110    super.register ();
    111111    super.subclass ();
     
    263263        int posPixels = OS.SHORT1FROMMP(pixelInfo);
    264264        int totalPixels = ((pixelInfo & 0xFFFF0000)>>16) & 0xFFFF;
    265         int pos = ((MAX_RANGE*posPixels)/totalPixels)+1;
     265        int pos = ((MAX_RANGE*posPixels)/totalPixels);
    266266        return pos;
    267267}
     
    395395        int pixels = OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMPOSITION, (short)OS.SMA_RANGEVALUE ), 0);
    396396        int totalPixels = ((pixels & 0xFFFF0000)>>16) & 0xFFFF;
    397         int pixelPos = (value*totalPixels)/MAX_RANGE;
     397        int pixelPos = ((value*totalPixels)/MAX_RANGE);
    398398        OS.WinSendMsg(handle, OS.SLM_SETSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMPOSITION, (short)OS.SMA_RANGEVALUE), pixelPos);
    399399}
     
    412412        return TrackBarProc;
    413413}
    414 //
    415 //LRESULT wmScrollChild (int wParam, int lParam) {
     414
     415MRESULT wmControlChild (int mp1, int mp2) {
     416    int code = OS.SHORT2FROMMP(mp1);
     417    int pos = mp2;
     418    System.out.println("Pos = " + pos);
     419    Event event = new Event ();
     420//      switch (code) {
     421//              /*
     422//              * This line is intentionally commented.  Do not set the detail
     423//              * field to DRAG to indicate that the dragging has ended when the
     424//              * scroll bar is finally positioned in TB_THUMBPOSITION.
     425//              */
     426////            case OS.TB_THUMBPOSITION:       break;
     427//              case OS.TB_THUMBTRACK:          event.detail = SWT.DRAG;  break;
     428//              case OS.TB_TOP:                         event.detail = SWT.HOME;  break;
     429//              case OS.TB_BOTTOM:              event.detail = SWT.END;  break;
     430//              case OS.TB_LINEDOWN:            event.detail = SWT.ARROW_DOWN;  break;
     431//              case OS.TB_LINEUP:              event.detail = SWT.ARROW_UP;  break;
     432//              case OS.TB_PAGEDOWN:            event.detail = SWT.PAGE_DOWN;  break;
     433//              case OS.TB_PAGEUP:              event.detail = SWT.PAGE_UP;  break;
     434//      }
     435    return null;
     436}
     437
     438//MRESULT wmScrollChild (int mp1, int mp2) {
    416439//     
    417440//      /* Do nothing when scrolling is ending */
    418 //      int code = wParam & 0xFFFF;
    419 //      if (code == OS.TB_ENDTRACK) return null;
    420 //     
     441////    int code = wParam & 0xFFFF;
     442////    if (code == OS.TB_ENDTRACK) return null;
     443//      System.out.println("test");
    421444//      /*
    422445//      * This code is intentionally commented.  The event
     
    425448//      */
    426449//      Event event = new Event ();
    427 ////    switch (code) {
    428 ////            /*
    429 ////            * This line is intentionally commented.  Do not set the detail
    430 ////            * field to DRAG to indicate that the dragging has ended when the
    431 ////            * scroll bar is finally positioned in TB_THUMBPOSITION.
    432 ////            */
    433 //////          case OS.TB_THUMBPOSITION:       break;
    434 ////            case OS.TB_THUMBTRACK:          event.detail = SWT.DRAG;  break;
    435 ////            case OS.TB_TOP:                         event.detail = SWT.HOME;  break;
    436 ////            case OS.TB_BOTTOM:              event.detail = SWT.END;  break;
    437 ////            case OS.TB_LINEDOWN:            event.detail = SWT.ARROW_DOWN;  break;
    438 ////            case OS.TB_LINEUP:              event.detail = SWT.ARROW_UP;  break;
    439 ////            case OS.TB_PAGEDOWN:            event.detail = SWT.PAGE_DOWN;  break;
    440 ////            case OS.TB_PAGEUP:              event.detail = SWT.PAGE_UP;  break;
    441 ////    }
    442450//     
    443451//      /*
Note: See TracChangeset for help on using the changeset viewer.