Class Sash

All Implemented Interfaces:
Drawable

public class Sash extends Control
Instances of the receiver represent a selectable user interface object that allows the user to drag a rubber banded outline of the sash within the parent control.
Styles:
HORIZONTAL, VERTICAL, SMOOTH
Events:
Selection

Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.

IMPORTANT: This class is not intended to be subclassed.

See Also:
  • Field Details

    • dragging

      boolean dragging
    • startX

      int startX
    • startY

      int startY
    • lastX

      int lastX
    • lastY

      int lastY
    • defaultCursor

      long defaultCursor
    • INCREMENT

      private static final int INCREMENT
      See Also:
    • PAGE_INCREMENT

      private static final int PAGE_INCREMENT
      See Also:
    • DEFAULT_CROSS_AXIS_SIZE

      private static final int DEFAULT_CROSS_AXIS_SIZE
      See Also:
  • Constructor Details

    • Sash

      public Sash(Composite parent, int style)
      Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

      The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.

      Parameters:
      parent - a composite control which will be the parent of the new instance (cannot be null)
      style - the style of control to construct
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the parent is null
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
      • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
      See Also:
  • Method Details

    • addSelectionListener

      public void addSelectionListener(SelectionListener listener)
      Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in the SelectionListener interface.

      When widgetSelected is called, the x, y, width, and height fields of the event object are valid. If the receiver is being dragged, the event object detail field contains the value SWT.DRAG. widgetDefaultSelected is not called.

      Parameters:
      listener - the listener which should be notified when the control is selected by the user
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the listener is null
      SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      See Also:
    • checkStyle

      static int checkStyle(int style)
    • computeSizeInPixels

      Point computeSizeInPixels(int wHint, int hHint, boolean changed)
      Overrides:
      computeSizeInPixels in class Control
    • createHandle

      void createHandle(int index)
      Overrides:
      createHandle in class Widget
    • gtk_gesture_press_event

      int gtk_gesture_press_event(long gesture, int n_press, double x, double y, long event)
      Description copied from class: Control
      Handling multi-press event on GTK4
      Overrides:
      gtk_gesture_press_event in class Control
      Parameters:
      gesture - the corresponding controller responsible for capturing the event
      n_press - how many touch/button presses happened with this one
      x - the x coordinate, in widget allocation coordinates
      y - the y coordinate, in widget allocation coordinates
      event - the GdkEvent captured
    • gtk_gesture_release_event

      int gtk_gesture_release_event(long gesture, int n_press, double x, double y, long event)
      Overrides:
      gtk_gesture_release_event in class Control
      Parameters:
      gesture - the corresponding controller responsible for capturing the event
      n_press - how many touch/button presses happened with this one
      x - the x coordinate, in widget allocation coordinates
      y - the y coordinate, in widget allocation coordinates
      event - the GdkEvent captured
    • gtk4_motion_event

      void gtk4_motion_event(long controller, double x, double y, long event)
      Overrides:
      gtk4_motion_event in class Control
      Parameters:
      controller - the corresponding controller responsible for capturing the event
      x - the x coordinate
      y - the y coordinate
      event - the GdkEvent captured
    • gtk4_key_press_event

      boolean gtk4_key_press_event(long controller, int keyval, int keycode, int state, long event)
      Overrides:
      gtk4_key_press_event in class Control
      Parameters:
      controller - the corresponding controller responsible for capturing the event
      keyval - the pressed key
      keycode - raw code of the pressed key
      state - the bitmask, representing the state of the modifier keys and pointer buttons
      event - the GdkEvent captured
      Returns:
      TRUE if the event has been fully/properly handled, otherwise FALSE
    • gtk_button_press_event

      long gtk_button_press_event(long widget, long event)
      Overrides:
      gtk_button_press_event in class Control
    • gtk_button_release_event

      long gtk_button_release_event(long widget, long event)
      Overrides:
      gtk_button_release_event in class Control
    • gtk_draw

      long gtk_draw(long widget, long cairo)
      Overrides:
      gtk_draw in class Control
    • gtk_focus_in_event

      long gtk_focus_in_event(long widget, long event)
      Overrides:
      gtk_focus_in_event in class Control
    • gtk3_key_press_event

      long gtk3_key_press_event(long widget, long eventPtr)
      Overrides:
      gtk3_key_press_event in class Control
    • gtk_motion_notify_event

      long gtk_motion_notify_event(long widget, long eventPtr)
      Overrides:
      gtk_motion_notify_event in class Control
    • gtk_realize

      long gtk_realize(long widget)
      Overrides:
      gtk_realize in class Control
    • hookEvents

      void hookEvents()
      Overrides:
      hookEvents in class Control
    • releaseWidget

      void releaseWidget()
      Overrides:
      releaseWidget in class Control
    • removeSelectionListener

      public void removeSelectionListener(SelectionListener listener)
      Removes the listener from the collection of listeners who will be notified when the control is selected by the user.
      Parameters:
      listener - the listener which should no longer be notified
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the listener is null
      SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      See Also:
    • setCursor

      void setCursor(long cursor)
      Overrides:
      setCursor in class Control
    • traversalCode

      int traversalCode(int key, long event)
      Overrides:
      traversalCode in class Control