Changeset 154 for trunk/src/plugins


Ignore:
Timestamp:
Jun 16, 2009, 11:33:49 PM (16 years ago)
Author:
lpino
Message:
  • Complete Scale event handling SWT.Selection
File:
1 edited

Legend:

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

    r153 r154  
    152152}
    153153
    154 //public Point computeSize (int wHint, int hHint, boolean changed) {
    155 //      checkWidget ();
    156 //      int border = getBorderWidth ();
    157 //      int width = border * 2, height = border * 2;
     154public Point computeSize (int wHint, int hHint, boolean changed) {
     155        checkWidget ();
     156        int border = getBorderWidth ();
     157        int width = border * 2, height = border * 2;
    158158//      RECT rect = new RECT ();
    159159//      OS.SendMessage (handle, OS.TBM_GETTHUMBRECT, 0, rect);
     160        OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SHAFTDIMENSIONS, (short)OS.SMA_RANGEVALUE), 0);
     161        OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMDIMENSIONS, (short)OS.SMA_RANGEVALUE), 0);
     162        OS.WinSendMsg(handle, OS.SLM_QUERYTICKSIZE, 1, 0);
    160163//      if ((style & SWT.HORIZONTAL) != 0) {
    161164//              width += OS.GetSystemMetrics (OS.SM_CXHSCROLL) * 10;
     
    169172//      if (wHint != SWT.DEFAULT) width = wHint + (border * 2);
    170173//      if (hHint != SWT.DEFAULT) height = hHint + (border * 2);
    171 //      return new Point (width, height);
    172 //}
     174        return new Point (width, height);
     175}
    173176
    174177void createHandle () {
     
    195198        checkWidget ();
    196199        return 1;
    197 //        return OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMPOSITION, (short)OS.SMA_INCREMENTVALUE), 0);
    198200//      return OS.SendMessage (handle, OS.TBM_GETLINESIZE, 0, 0);
    199201}
     
    416418    int code = OS.SHORT2FROMMP(mp1);
    417419    int pos = mp2;
    418     System.out.println("Pos = " + pos);
     420    if (code == OS.SLN_KILLFOCUS || code == OS.SLN_SETFOCUS) return null;
    419421    Event event = new Event ();
    420 //      switch (code) {
     422        switch (code) {
    421423//              /*
    422424//              * This line is intentionally commented.  Do not set the detail
     
    425427//              */
    426428////            case OS.TB_THUMBPOSITION:       break;
    427 //              case OS.TB_THUMBTRACK:          event.detail = SWT.DRAG;  break;
     429                case OS.SLN_SLIDERTRACK:                event.detail = SWT.DRAG;  break;
    428430//              case OS.TB_TOP:                         event.detail = SWT.HOME;  break;
    429431//              case OS.TB_BOTTOM:              event.detail = SWT.END;  break;
     
    432434//              case OS.TB_PAGEDOWN:            event.detail = SWT.PAGE_DOWN;  break;
    433435//              case OS.TB_PAGEUP:              event.detail = SWT.PAGE_UP;  break;
    434 //      }
     436        }
     437    sendEvent (SWT.Selection, event);
    435438    return null;
    436439}
    437440
    438 //MRESULT wmScrollChild (int mp1, int mp2) {
    439 //     
    440 //      /* Do nothing when scrolling is ending */
    441 ////    int code = wParam & 0xFFFF;
    442 ////    if (code == OS.TB_ENDTRACK) return null;
    443 //      System.out.println("test");
    444 //      /*
    445 //      * This code is intentionally commented.  The event
    446 //      * detail field is not currently supported on all
    447 //      * platforms.
    448 //      */
    449 //      Event event = new Event ();
    450 //     
    451 //      /*
    452 //      * Send the event because WM_HSCROLL and WM_VSCROLL
    453 //      * are sent from a modal message loop in windows that
    454 //      * is active when the user is scrolling.
    455 //      */
    456 //      sendEvent (SWT.Selection, event);
    457 //      // widget could be disposed at this point
    458 //      return null;
    459 //}
    460 
    461 }
     441}
Note: See TracChangeset for help on using the changeset viewer.