- Timestamp:
- Jun 2, 2009, 5:40:15 PM (16 years ago)
- Location:
- trunk/src/plugins/org.eclipse.swt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/org.eclipse.swt/Eclipse SWT PI/pm/library/swt.c
r137 r146 376 376 if (pszName) releasePSZBytes(env, pszName, c_pszName); 377 377 if (pszClass) releasePSZBytes(env, pszClass, c_pszClass); 378 379 return hwnd; 380 } 381 382 JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_pm_OS_WinCreateWindow__ILorg_eclipse_swt_internal_pm_PSZ_2Lorg_eclipse_swt_internal_pm_PSZ_2IIIIIIIILorg_eclipse_swt_internal_pm_SLDCDATA_2I 383 (JNIEnv *env, jclass that, jint hwndParent, jobject pszClass, 384 jobject pszName, jint flStyle, jint x, jint y, jint cx, jint cy, jint hwndOwner, 385 jint hwndInsertBehind, jint id, jobject pCtlData, jint pPresParams) 386 { 387 PSZ c_pszClass = NULL; 388 PSZ c_pszName = NULL; 389 SLDCDATA c_pCtrlData, *c_ppCtrlData = NULL; 390 jint hwnd; 391 392 DEBUG_CALL("WinCreateWindow\n") 393 394 if (pszClass) c_pszClass = getPSZBytes(env, pszClass); 395 if (pszName) c_pszName = getPSZBytes(env, pszName); 396 if (pCtlData) 397 c_ppCtrlData = getSLDCDATAFields(env, pCtlData, &c_pCtrlData, &PGLOB(SLDCDATAFc)); 398 399 400 hwnd = (jint)WinCreateWindow((HWND)hwndParent, c_pszClass, c_pszName, flStyle, 401 x, y, cx, cy, hwndOwner, hwndInsertBehind, id, (PVOID)c_ppCtrlData, (PVOID)pPresParams); 402 403 if (pszName) releasePSZBytes(env, pszName, c_pszName); 404 if (pszClass) releasePSZBytes(env, pszClass, c_pszClass); 405 if (pCtlData) 406 setSLDCDATAFields(env, pCtlData, c_ppCtrlData, &PGLOB(SLDCDATAFc)); 378 407 379 408 return hwnd; -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT PI/pm/org/eclipse/swt/internal/pm/OS.java
r139 r146 2240 2240 PSZ pszName, int flStyle, int x, int y, int cx, int cy, int hwndOwner, 2241 2241 int hwndInsertBehind, int id, int pCtlData, int pPresParams); 2242 public static final native int WinCreateWindow (int hwndParent, PSZ pszClass, 2243 PSZ pszName, int flStyle, int x, int y, int cx, int cy, int hwndOwner, 2244 int hwndInsertBehind, int id, SLDCDATA pCtlData, int pPresParams); 2242 2245 public static final native boolean WinDestroyWindow (int hwnd); 2243 2246 public static final native int WinDefWindowProc (int hwnd, int ulMsgid, -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Scale.java
r143 r146 1 1 package org.eclipse.swt.widgets; 2 3 /* 4 * OS/2 version. 5 * Copyright (c) 2002, 2009 EclipseOS2 Team. 6 */ 2 7 3 8 /* … … 33 38 34 39 public class Scale extends Control { 35 static final int TrackBarProc =0; 36 // static final TCHAR TrackBarClass = new TCHAR (0, OS.TRACKBAR_CLASS, true); 40 static final int TrackBarProc; 37 41 static final PSZ TrackBarClass = PSZ.getAtom (OS.WC_SLIDER); 38 //static {39 // WNDCLASS lpWndClass = new WNDCLASS();40 // OS.GetClassInfo (0, TrackBarClass, lpWndClass);41 // TrackBarProc = lpWndClass.lpfnWndProc;42 //}42 static { 43 CLASSINFO lpWndClass = new CLASSINFO (); 44 OS.WinQueryClassInfo (OS.NULLHANDLE, TrackBarClass, lpWndClass); 45 TrackBarProc = lpWndClass.pfnWindowProc; 46 } 43 47 44 48 /** … … 72 76 */ 73 77 public Scale (Composite parent, int style) { 74 //super (parent, checkStyle (style));78 super (parent, checkStyle (style)); 75 79 } 76 80 … … 94 98 * @see #removeSelectionListener 95 99 */ 96 //public void addSelectionListener(SelectionListener listener) {97 //checkWidget ();98 //if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);99 //TypedListener typedListener = new TypedListener (listener);100 //addListener (SWT.Selection,typedListener);101 //addListener (SWT.DefaultSelection,typedListener);102 //}103 // 100 public void addSelectionListener(SelectionListener listener) { 101 checkWidget (); 102 if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); 103 TypedListener typedListener = new TypedListener (listener); 104 addListener (SWT.Selection,typedListener); 105 addListener (SWT.DefaultSelection,typedListener); 106 } 107 104 108 int callWindowProc (int msg, int mp1, int mp2) { 105 109 if (handle == 0) return 0; 106 110 return OS.WinCallWindowProc(TrackBarProc, handle, msg, mp1, mp2); 107 111 } 108 // 109 //static int checkStyle (int style) {110 //return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);111 //}112 // 112 113 static int checkStyle (int style) { 114 return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0); 115 } 116 113 117 //public Point computeSize (int wHint, int hHint, boolean changed) { 114 118 // checkWidget (); … … 130 134 // return new Point (width, height); 131 135 //} 132 // 133 //void createHandle () {134 //super.createHandle ();136 137 void createHandle () { 138 super.createHandle (); 135 139 // OS.SendMessage (handle, OS.TBM_SETRANGEMAX, 0, 100); 136 140 // OS.SendMessage (handle, OS.TBM_SETPAGESIZE, 0, 10); 137 141 // OS.SendMessage (handle, OS.TBM_SETTICFREQ, 10, 0); 138 //}139 // 140 //int defaultForeground () {141 // return OS.GetSysColor (OS.COLOR_BTNFACE);142 //}143 // 142 } 143 144 int defaultForeground () { 145 return OS.WinQuerySysColor(handle, OS.SYSCLR_SCROLLBAR, 0); 146 } 147 144 148 ///** 145 149 // * Returns the amount that the receiver's value will be
Note:
See TracChangeset
for help on using the changeset viewer.