Changeset 146 for trunk/src/plugins/org.eclipse.swt/Eclipse SWT
- Timestamp:
- Jun 2, 2009, 5:40:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.