long /*int*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); value = (int) Math.min (value, (int)(adjustment.upper - adjustment.lower)); adjustment.page_size = (double) value;
int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); value = (int) Math.min (value, (int)(adjustment.upper - adjustment.lower)); adjustment.page_size = (double) value;
/** * Sets the maximum. If this value is negative or less than or * equal to the minimum, the value is ignored. If necessary, first * the thumb and then the selection are adjusted to fit within the * new range. * * @param value the new maximum, which must be greater than the current 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 void setMaximum (int value) { checkWidget (); int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); int minimum = (int) adjustment.lower; if (value <= minimum) return; adjustment.upper = value; adjustment.page_size = Math.min ((int)adjustment.page_size, value - minimum); adjustment.value = Math.min ((int)adjustment.value, (int)(value - adjustment.page_size)); OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_configure(hAdjustment, adjustment.value, adjustment.lower, adjustment.upper, adjustment.step_increment, adjustment.page_increment, adjustment.page_size); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the maximum. If this value is negative or less than or * equal to the minimum, the value is ignored. If necessary, first * the thumb and then the selection are adjusted to fit within the * new range. * * @param value the new maximum, which must be greater than the current 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 void setMaximum (int value) { checkWidget (); int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); int minimum = (int) adjustment.lower; if (value <= minimum) return; adjustment.upper = value; adjustment.page_size = Math.min ((int)adjustment.page_size, value - minimum); adjustment.value = Math.min ((int)adjustment.value, (int)(value - adjustment.page_size)); OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_configure(hAdjustment, adjustment.value, adjustment.lower, adjustment.upper, adjustment.step_increment, adjustment.page_increment, adjustment.page_size); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the minimum value. If this value is negative or greater * than or equal to the maximum, the value is ignored. If necessary, * first the thumb and then the selection are adjusted to fit within * the new range. * * @param value the new 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 void setMinimum (int value) { checkWidget (); if (value < 0) return; int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); int maximum = (int) adjustment.upper; if (value >= maximum) return; adjustment.lower = value; adjustment.page_size = Math.min ((int)adjustment.page_size, maximum - value); adjustment.value = Math.max ((int)adjustment.value, value); OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_configure(hAdjustment, adjustment.value, adjustment.lower, adjustment.upper, adjustment.step_increment, adjustment.page_increment, adjustment.page_size); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the maximum. If this value is negative or less than or * equal to the minimum, the value is ignored. If necessary, first * the thumb and then the selection are adjusted to fit within the * new range. * * @param value the new maximum, which must be greater than the current 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 void setMaximum (int value) { checkWidget (); long /*int*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); int minimum = (int) adjustment.lower; if (value <= minimum) return; adjustment.upper = value; adjustment.page_size = Math.min ((int)adjustment.page_size, value - minimum); adjustment.value = Math.min ((int)adjustment.value, (int)(value - adjustment.page_size)); OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_configure(hAdjustment, adjustment.value, adjustment.lower, adjustment.upper, adjustment.step_increment, adjustment.page_increment, adjustment.page_size); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); value = (int) Math.min (value, (int)(adjustment.upper - adjustment.lower)); adjustment.page_size = (double) value;
/** * Sets the minimum value. If this value is negative or greater * than or equal to the maximum, the value is ignored. If necessary, * first the thumb and then the selection are adjusted to fit within * the new range. * * @param value the new 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 void setMinimum (int value) { checkWidget (); if (value < 0) return; int /*long*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); int maximum = (int) adjustment.upper; if (value >= maximum) return; adjustment.lower = value; adjustment.page_size = Math.min ((int)adjustment.page_size, maximum - value); adjustment.value = Math.max ((int)adjustment.value, value); OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_configure(hAdjustment, adjustment.value, adjustment.lower, adjustment.upper, adjustment.step_increment, adjustment.page_increment, adjustment.page_size); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the minimum value. If this value is negative or greater * than or equal to the maximum, the value is ignored. If necessary, * first the thumb and then the selection are adjusted to fit within * the new range. * * @param value the new 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 void setMinimum (int value) { checkWidget (); if (value < 0) return; long /*int*/ hAdjustment = OS.gtk_range_get_adjustment (handle); GtkAdjustment adjustment = new GtkAdjustment (); gtk_adjustment_get (hAdjustment, adjustment); int maximum = (int) adjustment.upper; if (value >= maximum) return; adjustment.lower = value; adjustment.page_size = Math.min ((int)adjustment.page_size, maximum - value); adjustment.value = Math.max ((int)adjustment.value, value); OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_configure(hAdjustment, adjustment.value, adjustment.lower, adjustment.upper, adjustment.step_increment, adjustment.page_increment, adjustment.page_size); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }