Changeset 149 for trunk/src


Ignore:
Timestamp:
Jun 9, 2009, 9:05:52 PM (16 years ago)
Author:
lpino
Message:
  • First working examples with correct initial styles
Location:
trunk/src/plugins/org.eclipse.swt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT PI/pm/library/swt.c

    r146 r149  
    357357}
    358358
    359 JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_pm_OS_WinCreateWindow
     359JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_pm_OS_WinCreateWindow__ILorg_eclipse_swt_internal_pm_PSZ_2Lorg_eclipse_swt_internal_pm_PSZ_2IIIIIIIIII
    360360        (JNIEnv *env, jclass that, jint hwndParent, jobject pszClass,
    361361            jobject pszName, jint flStyle, jint x, jint y, jint cx, jint cy, jint hwndOwner,
     
    396396    if (pCtlData)
    397397        c_ppCtrlData = getSLDCDATAFields(env, pCtlData, &c_pCtrlData, &PGLOB(SLDCDATAFc));
    398 
    399398
    400399    hwnd = (jint)WinCreateWindow((HWND)hwndParent, c_pszClass, c_pszName, flStyle,
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Scale.java

    r147 r149  
    8080    this.style = style;
    8181    SLDCDATA sldcData = new SLDCDATA();
     82    sldcData.usScale1Increments = 10;
     83    //sldcData.usScale2Increments = 10;
     84    sldcData.usScale1Spacing = 0;
     85    //sldcData.usScale2Spacing = 0;
    8286    handle = OS.WinCreateWindow (
    8387        parent.handle,
     
    9094        OS.HWND_BOTTOM, //OS.HWND_TOP,
    9195        0,
    92         0,
     96        sldcData,
    9397        0
    9498    );
    95 // System.out.println("Class = " + windowClass ());
    96 //@@TODO (lpino): Remove
    97 //    System.out.println("ERROR = " + OS.WinGetLastError(parent.getDisplay ().hab));
    9899    if (handle == 0) error (SWT.ERROR_NO_HANDLES);
    99100    OS.WinSetWindowUShort (handle, OS.QWS_ID, (short)(handle & 0xFFFF));
    100101
    101 //@@TODO (dmik): debug code, remove when no more necessary
    102 System.out.println (
    103     "Scale(parent, style): Scale has been created:\n" +
    104     "    hwnd = " + Integer.toHexString (handle) + "\n" +
    105     "    hwnd.parent = hwnd.owner = " + Integer.toHexString (parent.handle) + "\n" +
    106     "    class = " + windowClass() + "\n" +
    107     "    style = " + Integer.toHexString (widgetStyle())
    108     );
     102    OS.WinSendMsg(handle, OS.SLM_SETTICKSIZE, OS.MPFROM2SHORT((short)OS.SMA_SETALLTICKS, (short)2), 0);
    109103    super.register ();
    110104    super.subclass ();
     
    172166
    173167void createHandle () {
     168    System.out.println ("Scale:createHandle");
    174169        super.createHandle ();
     170        OS.WinSendMsg(handle, OS.SLM_SETTICKSIZE, OS.MPFROM2SHORT((short)OS.SMA_SETALLTICKS, (short)10), 0);       
    175171//      OS.SendMessage (handle, OS.TBM_SETRANGEMAX, 0, 100);
    176172//      OS.SendMessage (handle, OS.TBM_SETPAGESIZE, 0, 10);
     
    194190// * </ul>
    195191// */
    196 //public int getIncrement () {
    197 //      checkWidget ();
     192public int getIncrement () {
     193        checkWidget ();
     194        return OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMPOSITION, (short)OS.SMA_INCREMENTVALUE), 0);
    198195//      return OS.SendMessage (handle, OS.TBM_GETLINESIZE, 0, 0);
    199 //}
    200 //
     196}
     197
    201198///**
    202199// * Returns the maximum value which the receiver will allow.
     
    278275// * @see #addSelectionListener
    279276// */
    280 //public void removeSelectionListener(SelectionListener listener) {
    281 //      checkWidget ();
    282 //      if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
    283 //      if (eventTable == null) return;
    284 //      eventTable.unhook (SWT.Selection, listener);
    285 //      eventTable.unhook (SWT.DefaultSelection,listener);     
    286 //}
    287 //
     277public void removeSelectionListener(SelectionListener listener) {
     278        checkWidget ();
     279        if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
     280        if (eventTable == null) return;
     281        eventTable.unhook (SWT.Selection, listener);
     282        eventTable.unhook (SWT.DefaultSelection,listener);     
     283}
     284
    288285///**
    289286// * Sets the amount that the receiver's value will be
     
    390387//
    391388int widgetStyle () {
    392         int bits = super.widgetStyle () | OS.SLS_CENTER | OS.SLS_HOMELEFT | OS.SLS_PRIMARYSCALE1 | OS.SLS_PRIMARYSCALE2;
    393         if ((style & SWT.VERTICAL) != 0) return bits | OS.SLS_VERTICAL;
     389        int bits = super.widgetStyle () | OS.SLS_CENTER | OS.SLS_HOMELEFT | OS.SLS_PRIMARYSCALE1;
     390        if ((style & SWT.VERTICAL) != 0) return bits | OS.SLS_VERTICAL | OS.SLS_HOMETOP;
    394391        return bits;
    395392}
Note: See TracChangeset for help on using the changeset viewer.