Ignore:
Timestamp:
Jun 2, 2009, 5:40:15 PM (16 years ago)
Author:
lpino
Message:
  • More work toward implementing Scale class
File:
1 edited

Legend:

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

    r143 r146  
    11package org.eclipse.swt.widgets;
     2
     3/*
     4 * OS/2 version.
     5 * Copyright (c) 2002, 2009 EclipseOS2 Team.
     6 */
    27
    38/*
     
    3338
    3439public 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;
    3741        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        }
    4347
    4448/**
     
    7276 */
    7377public Scale (Composite parent, int style) {
    74 //      super (parent, checkStyle (style));
     78        super (parent, checkStyle (style));
    7579}
    7680
     
    9498 * @see #removeSelectionListener
    9599 */
    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 //
     100public 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
    104108int callWindowProc (int msg, int mp1, int mp2) {
    105109        if (handle == 0) return 0;
    106110        return OS.WinCallWindowProc(TrackBarProc, handle, msg, mp1, mp2);
    107111}
    108 //
    109 //static int checkStyle (int style) {
    110 //      return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
    111 //}
    112 //
     112
     113static int checkStyle (int style) {
     114        return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
     115}
     116
    113117//public Point computeSize (int wHint, int hHint, boolean changed) {
    114118//      checkWidget ();
     
    130134//      return new Point (width, height);
    131135//}
    132 //
    133 //void createHandle () {
    134 //      super.createHandle ();
     136
     137void createHandle () {
     138        super.createHandle ();
    135139//      OS.SendMessage (handle, OS.TBM_SETRANGEMAX, 0, 100);
    136140//      OS.SendMessage (handle, OS.TBM_SETPAGESIZE, 0, 10);
    137141//      OS.SendMessage (handle, OS.TBM_SETTICFREQ, 10, 0);
    138 //}
    139 //
    140 //int defaultForeground () {
    141 //      return OS.GetSysColor (OS.COLOR_BTNFACE);
    142 //}
    143 //
     142}
     143
     144int defaultForeground () {
     145        return OS.WinQuerySysColor(handle, OS.SYSCLR_SCROLLBAR, 0);
     146}
     147
    144148///**
    145149// * Returns the amount that the receiver's value will be
Note: See TracChangeset for help on using the changeset viewer.