- Timestamp:
- Jun 3, 2009, 11:37:45 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
r146 r147 76 76 */ 77 77 public Scale (Composite parent, int style) { 78 super (parent, checkStyle (style)); 78 // super (parent, checkStyle (style)); 79 this.parent = parent; 80 this.style = style; 81 SLDCDATA sldcData = new SLDCDATA(); 82 handle = OS.WinCreateWindow ( 83 parent.handle, 84 windowClass (), 85 windowTitle (), 86 widgetStyle (), 87 0, parent.getHeight (), 0, 0, 88 parent.handle, 89 // to mimic the Windows behavior 90 OS.HWND_BOTTOM, //OS.HWND_TOP, 91 0, 92 0, 93 0 94 ); 95 // System.out.println("Class = " + windowClass ()); 96 //@@TODO (lpino): Remove 97 // System.out.println("ERROR = " + OS.WinGetLastError(parent.getDisplay ().hab)); 98 if (handle == 0) error (SWT.ERROR_NO_HANDLES); 99 OS.WinSetWindowUShort (handle, OS.QWS_ID, (short)(handle & 0xFFFF)); 100 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 ); 109 super.register (); 110 super.subclass (); 111 super.setDefaultFont (); 112 super.setForegroundPixel (OS.CLR_DEFAULT); 113 super.setBackgroundPixel (OS.CLR_DEFAULT); 114 79 115 } 80 116 … … 353 389 //} 354 390 // 355 //int widgetStyle () {356 // int bits = super.widgetStyle () | OS.WS_TABSTOP | OS.TBS_BOTH | OS.TBS_AUTOTICKS;357 // if ((style & SWT.HORIZONTAL) != 0) return bits | OS.TBS_HORZ;358 // return bits | OS.TBS_VERT;359 //}391 int 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; 394 return bits; 395 } 360 396 361 397 PSZ windowClass () {
Note:
See TracChangeset
for help on using the changeset viewer.