Package org.sf.feeling.swt.win32.extension.hook.data.struct

Examples of org.sf.feeling.swt.win32.extension.hook.data.struct.Msg


      if (oleMsgProcAddress == 0)
        SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
      int threadId = Extension.GetCurrentThreadId();
      procHandle = Extension.SetWindowsHookEx(Extension.WH_GETMESSAGE,
          oleMsgProcAddress, 0, threadId);
      Display.getDefault().setData(HHOOK, new LONG(procHandle));
      Display.getDefault().setData(HHOOKMSG, new MSG());
    }
  }
View Full Code Here


    }
  }

  int OleMsgProc(int /* long */code, int /* long */wParam,
      int /* long */lParam) {
    LONG hHook = (LONG) Display.getDefault().getData(HHOOK);
    if (hHook == null)
      return 0;
    if (code < 0) {
      return OS.CallNextHookEx(hHook.value, (int) /* 64 */code, wParam,
          lParam);
View Full Code Here

    return shell.getSize();
  }

  public void setEnabled(int type, boolean enabled)
  {
    BorderCanvas border = (BorderCanvas) getBorder(IContainer.BORDER_N);
    ButtonCanvas button = (ButtonCanvas) buttons.get(new Integer(type));

    {
      GridData gridData = (GridData) button.getLayoutData();
      gridData.exclude = !enabled;
      button.setLayoutData(gridData);
      button.setVisible(enabled);
    }

    switch (type)
    {
    case ThemeConstants.BUTTON_MAX:
      ButtonCanvas revButton = (ButtonCanvas) buttons.get(new Integer(
          ThemeConstants.BUTTON_REV));
      GridData revData = (GridData) revButton.getLayoutData();
      revData.exclude = !enabled;
      revButton.setLayoutData(revData);
      revButton.setVisible(enabled);
      break;
    case ThemeConstants.BUTTON_REV:
      ButtonCanvas maxButton = (ButtonCanvas) buttons.get(new Integer(
          ThemeConstants.BUTTON_REV));
      GridData maxData = (GridData) maxButton.getLayoutData();
      maxData.exclude = !enabled;
      maxButton.setLayoutData(maxData);
      maxButton.setVisible(enabled);
      break;
    }
    border.layout();
  }
View Full Code Here

    return ((ButtonCanvas) buttons.get(new Integer(button))).getDrawable();
  }

  public void setButtonSkin(int button, ISkinable drawable)
  {
    ButtonCanvas canvse = ((ButtonCanvas) buttons.get(new Integer(button)));
    canvse.setDrawable(drawable);
    UIManager.transformWindowsButtonLayoutData(canvse, theme);
    buttonArea.layout();
    getBorder(IContainer.BORDER_N).layout();
  }
View Full Code Here

  }

  public void setEnabled(int type, boolean enabled)
  {
    BorderCanvas border = (BorderCanvas) getBorder(IContainer.BORDER_N);
    ButtonCanvas button = (ButtonCanvas) buttons.get(new Integer(type));

    {
      GridData gridData = (GridData) button.getLayoutData();
      gridData.exclude = !enabled;
      button.setLayoutData(gridData);
      button.setVisible(enabled);
    }

    switch (type)
    {
    case ThemeConstants.BUTTON_MAX:
      ButtonCanvas revButton = (ButtonCanvas) buttons.get(new Integer(
          ThemeConstants.BUTTON_REV));
      GridData revData = (GridData) revButton.getLayoutData();
      revData.exclude = !enabled;
      revButton.setLayoutData(revData);
      revButton.setVisible(enabled);
      break;
    case ThemeConstants.BUTTON_REV:
      ButtonCanvas maxButton = (ButtonCanvas) buttons.get(new Integer(
          ThemeConstants.BUTTON_REV));
      GridData maxData = (GridData) maxButton.getLayoutData();
      maxData.exclude = !enabled;
      maxButton.setLayoutData(maxData);
      maxButton.setVisible(enabled);
      break;
    }
    border.layout();
  }
View Full Code Here

    border.layout();
  }

  public boolean getEnabled(int type)
  {
    ButtonCanvas button = (ButtonCanvas) buttons.get(new Integer(type));
    return button.getVisible();
  }
View Full Code Here

    buttons = new HashMap(5);

    int buttonType = 0;
    for (buttonType = 0; buttonType < 5; buttonType++)
    {
      final ButtonCanvas buttonCanvas = new ButtonCanvas(buttonArea, buttonType);
      buttonCanvas
          .setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));

      switch (buttonType)
      {
      case ThemeConstants.BUTTON_MAX:
        buttonCanvas.addListener(SWT.MouseUp, new Listener()
        {
          public void handleEvent(Event event)
          {
            if (event.button != 1) return;
            Rectangle rect = new Rectangle(0, 0, buttonCanvas.getBounds().width,
                buttonCanvas.getBounds().height);
            if (!rect.contains(event.x, event.y)) return;
            shell.setMaximized(true);
          }
        });
        break;
      case ThemeConstants.BUTTON_REV:
        buttonCanvas.addListener(SWT.MouseUp, new Listener()
        {
          public void handleEvent(Event event)
          {
            if (event.button != 1) return;
            Rectangle rect = new Rectangle(0, 0, buttonCanvas.getBounds().width,
                buttonCanvas.getBounds().height);
            if (!rect.contains(event.x, event.y)) return;
            shell.setMaximized(false);
          }
        });
        break;
      case ThemeConstants.BUTTON_MIN:
        buttonCanvas.addListener(SWT.MouseUp, new Listener()
        {
          public void handleEvent(Event event)
          {
            if (event.button != 1) return;
            Rectangle rect = new Rectangle(0, 0, buttonCanvas.getBounds().width,
                buttonCanvas.getBounds().height);
            if (!rect.contains(event.x, event.y)) return;
            shell.setMinimized(true);
          }
        });
        break;
      case ThemeConstants.BUTTON_CLOSE:
        buttonCanvas.addListener(SWT.MouseUp, new Listener()
        {
          public void handleEvent(Event event)
          {
            if (event.button != 1) return;
            Rectangle rect = new Rectangle(0, 0, buttonCanvas.getBounds().width,
                buttonCanvas.getBounds().height);
            if (!rect.contains(event.x, event.y)) return;
            shell.close();
          }
        });
        break;
      case ThemeConstants.BUTTON_HELP:
        buttonCanvas.addListener(SWT.MouseUp, new Listener()
        {
          public void handleEvent(Event event)
          {
            if (event.button != 1) return;
            Rectangle rect = new Rectangle(0, 0, buttonCanvas.getBounds().width,
                buttonCanvas.getBounds().height);
            if (!rect.contains(event.x, event.y)) return;
            help(event);
          }
        });
        break;
View Full Code Here

    if (!getEnabled(ThemeConstants.BUTTON_MAX) && !getEnabled(ThemeConstants.BUTTON_REV))
    {
      return;
    }

    ButtonCanvas max = (ButtonCanvas) buttons.get(new Integer(ThemeConstants.BUTTON_MAX));
    hiddenControl(max, maximized);

    ButtonCanvas rev = (ButtonCanvas) buttons.get(new Integer(ThemeConstants.BUTTON_REV));
    hiddenControl(rev, !maximized);

    buttonArea.layout();
    getBorder(IContainer.BORDER_N).layout();
  }
View Full Code Here

      createButtons(northBorder);
    }
    boolean resizable = (style & SWT.RESIZE) != 0;

    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_N, (BorderCanvas) getBorder(IContainer.BORDER_N),
          resizable);
      getBorder(IContainer.BORDER_N).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_N).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_N).addListener(SWT.MouseExit, mouseResizeListener);
    }
    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_E, (BorderCanvas) getBorder(IContainer.BORDER_E),
          resizable);
      getBorder(IContainer.BORDER_E).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_E).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_E).addListener(SWT.MouseExit, mouseResizeListener);
    }
    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_S, (BorderCanvas) getBorder(IContainer.BORDER_S),
          resizable);
      getBorder(IContainer.BORDER_S).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_S).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_S).addListener(SWT.MouseExit, mouseResizeListener);
    }
    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_W, (BorderCanvas) getBorder(IContainer.BORDER_W),
          resizable);
      getBorder(IContainer.BORDER_W).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_W).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_W).addListener(SWT.MouseExit, mouseResizeListener);
    }
    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_NE, (BorderCanvas) getBorder(IContainer.BORDER_NE),
          resizable);
      getBorder(IContainer.BORDER_NE).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_NE).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_NE).addListener(SWT.MouseExit, mouseResizeListener);
    }
    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_NW, (BorderCanvas) getBorder(IContainer.BORDER_NW),
          resizable);
      getBorder(IContainer.BORDER_NW).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_NW).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_NW).addListener(SWT.MouseExit, mouseResizeListener);
    }
    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_SE, (BorderCanvas) getBorder(IContainer.BORDER_SE),
          resizable);
      getBorder(IContainer.BORDER_SE).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_SE).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_SE).addListener(SWT.MouseExit, mouseResizeListener);
    }
    {
      final MouseResizeListener mouseResizeListener = new MouseResizeListener(
          IContainer.BORDER_SW, (BorderCanvas) getBorder(IContainer.BORDER_SW),
          resizable);
      getBorder(IContainer.BORDER_SW).addListener(SWT.MouseDown, mouseResizeListener);
      getBorder(IContainer.BORDER_SW).addListener(SWT.MouseMove, mouseResizeListener);
      getBorder(IContainer.BORDER_SW).addListener(SWT.MouseExit, mouseResizeListener);
View Full Code Here

    };
    shell.addShellListener(shellListener);
    Windows.hideTitleBar(shell.handle);
    Windows.setBorderThick(shell.handle, false);
    Windows.setWindowAsDialogModel(shell.handle, false);
    if (resizeHook == null) resizeHook = new WindowResizeHook(this);
    resizeHook.installHook();
    if (menuManager == null) menuManager = new SystemMenuManager(shell);
  }
View Full Code Here

TOP

Related Classes of org.sf.feeling.swt.win32.extension.hook.data.struct.Msg

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.