@Override public boolean getEnabled () { checkWidget (); return (state & DISABLED) == 0; }
/** * Returns the minimum value which the receiver will allow. * * @return the minimum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getMinimum() { checkWidget(); return minimum; }
/** * Returns the minimum value which the receiver will allow. * * @return the minimum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getMinimum () { checkWidget(); return minimum; }
/** * Returns the receiver's thumb value. * * @return the thumb value * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getThumb () { checkWidget(); return thumb; }
/** * Returns the 'selection', which is the receiver's value. * * @return the selection * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getSelection() { checkWidget(); return selection; }
/** * Returns the maximum value which the receiver will allow. * * @return the maximum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getMaximum () { checkWidget(); return maximum; }
/** * Returns the size of the receiver's thumb relative to the * difference between its maximum and minimum values. * * @return the thumb value * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getThumb() { checkWidget(); return thumb; }
/** * Returns the maximum value which the receiver will allow. * * @return the maximum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getMaximum() { checkWidget(); return maximum; }
@Override Point computeSizeInPixels (int wHint, int hHint, boolean changed) { checkWidget(); OS.gtk_widget_realize(handle); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize(handle, wHint, hHint, changed); if ((style & SWT.HORIZONTAL) != 0) { if (wHint == SWT.DEFAULT) size.x = 2 * size.x; } else { if (hHint == SWT.DEFAULT) size.y = 2 * size.y; } return size; }
/** * Returns the maximum value which the receiver will allow. * * @return the maximum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getMaximum () { checkWidget (); long /*int*/ hAdjustment = OS.gtk_range_get_adjustment (handle); return (int) OS.gtk_adjustment_get_upper (hAdjustment); }
/** * Returns the 'selection', which is the receiver's value. * * @return the selection * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getSelection () { checkWidget (); int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); return (int) OS.gtk_adjustment_get_value (hAdjustment); }
@Override Point computeSizeInPixels (int wHint, int hHint, boolean changed) { checkWidget(); OS.gtk_widget_realize(handle); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize(handle, wHint, hHint, changed); if ((style & SWT.HORIZONTAL) != 0) { if (wHint == SWT.DEFAULT) size.x = 2 * size.x; } else { if (hHint == SWT.DEFAULT) size.y = 2 * size.y; } return size; }
@Override Point computeSizeInPixels (int wHint, int hHint, boolean changed) { checkWidget(); OS.gtk_widget_realize(handle); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize(handle, wHint, hHint, changed); if ((style & SWT.HORIZONTAL) != 0) { if (wHint == SWT.DEFAULT) size.x = 2 * size.x; } else { if (hHint == SWT.DEFAULT) size.y = 2 * size.y; } return size; }
/** * Returns the 'selection', which is the receiver's value. * * @return the selection * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getSelection () { checkWidget (); long /*int*/ hAdjustment = OS.gtk_range_get_adjustment (handle); return (int) OS.gtk_adjustment_get_value (hAdjustment); }
/** * Returns the maximum value which the receiver will allow. * * @return the maximum * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getMaximum () { checkWidget (); int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); return (int) OS.gtk_adjustment_get_upper (hAdjustment); }
/** * Returns the 'selection', which is the receiver's value. * * @return the selection * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getSelection () { checkWidget (); int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); return (int) OS.gtk_adjustment_get_value (hAdjustment); }
/** * Returns the receiver's thumb value. * * @return the thumb value * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getThumb () { checkWidget (); int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); return (int) OS.gtk_adjustment_get_page_size (hAdjustment); }
/** * Returns the receiver's thumb value. * * @return the thumb value * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getThumb () { checkWidget (); int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); return (int) OS.gtk_adjustment_get_page_size (hAdjustment); }
public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0, height = 0; if ((style & SWT.HORIZONTAL) != 0) { height = (int)NSScroller.scrollerWidthForControlSize(((NSScroller)view).controlSize()); width = height * 10; } else { width = (int)NSScroller.scrollerWidthForControlSize(((NSScroller)view).controlSize()); height = width * 10; } if (wHint != SWT.DEFAULT) width = wHint; if (hHint != SWT.DEFAULT) height = hHint; return new Point (width, height); }
@Override Point computeSizeInPixels (int wHint, int hHint, boolean changed) { checkWidget (); int border = getBorderWidthInPixels (); int width = border * 2, height = border * 2; if ((style & SWT.HORIZONTAL) != 0) { width += OS.GetSystemMetrics (OS.SM_CXHSCROLL) * 10; height += OS.GetSystemMetrics (OS.SM_CYHSCROLL); } else { width += OS.GetSystemMetrics (OS.SM_CXVSCROLL); height += OS.GetSystemMetrics (OS.SM_CYVSCROLL) * 10; } if (wHint != SWT.DEFAULT) width = wHint + (border * 2); if (hHint != SWT.DEFAULT) height = hHint + (border * 2); return new Point (width, height); }