Exemplo n.º 1
0
 void createHandle() {
   super.createHandle();
   state |= THEME_BACKGROUND;
   if (OS.COMCTL32_MAJOR < 6) {
     layout = new TextLayout(display);
     if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION(4, 10)) {
       linkColor = Color.win32_new(display, OS.GetSysColor(OS.COLOR_HOTLIGHT));
     } else {
       linkColor = new Color(display, LINK_FOREGROUND);
     }
     disabledColor = Color.win32_new(display, OS.GetSysColor(OS.COLOR_GRAYTEXT));
     offsets = new Point[0];
     ids = new String[0];
     mnemonics = new int[0];
     selection = new Point(-1, -1);
     focusIndex = mouseDownIndex = -1;
   }
 }
Exemplo n.º 2
0
 void releaseWidget() {
   super.releaseWidget();
   if (layout != null) layout.dispose();
   layout = null;
   if (linkColor != null) linkColor.dispose();
   linkColor = null;
   disabledColor = null;
   offsets = null;
   ids = null;
   mnemonics = null;
   text = null;
 }
Exemplo n.º 3
0
 /**
  * Invokes platform specific functionality to allocate a new color.
  *
  * <p><b>IMPORTANT:</b> This method is <em>not</em> part of the public API for <code>Color</code>.
  * It is marked public only so that it can be shared within the packages provided by SWT. It is
  * not available on all platforms, and should never be called from application code.
  *
  * @param device the device on which to allocate the color
  * @param handle the handle for the color
  * @param alpha the int for the alpha content in the color
  * @return a new color object containing the specified device and handle
  * @noreference This method is not intended to be referenced by clients.
  */
 public static Color win32_new(Device device, int handle, int alpha) {
   Color color = new Color(device);
   color.handle = handle;
   color.alpha = alpha;
   return color;
 }