/** * {@inheritDoc} */ public int getThumb() { return scrollBar.getThumb(); }
boolean autoScroll = !supressScrolling && (sb.getSelection() == (sb.getMaximum() - sb.getThumb())); StringBuffer buf = new StringBuffer(); int nbLines = consoleText.getLineCount();
/** * Sets the single <em>selection</em> that is the receiver's * value to the argument which must be greater than or equal * to zero. * * @param selection the new selection (must be zero or greater) * * @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 setSelection (int selection) { checkWidget (); selection = Math.min (selection, getMaximum() - getThumb()); OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_set_value (adjustmentHandle, selection); OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the single <em>selection</em> that is the receiver's * value to the argument which must be greater than or equal * to zero. * * @param selection the new selection (must be zero or greater) * * @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 setSelection (int selection) { checkWidget (); selection = Math.min (selection, getMaximum() - getThumb()); OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_set_value (adjustmentHandle, selection); OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * Sets the single <em>selection</em> that is the receiver's * value to the argument which must be greater than or equal * to zero. * * @param selection the new selection (must be zero or greater) * * @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 setSelection (int selection) { checkWidget (); selection = Math.min (selection, getMaximum() - getThumb()); OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); OS.gtk_adjustment_set_value (adjustmentHandle, selection); OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED); }
/** * {@inheritDoc} */ public void setSelection(int selection) { // RAP [if]: ScrollBar#setSelection() does not limit the value // scrollBar.setSelection(selection); int minimum = scrollBar.getMinimum(); int maximum = scrollBar.getMaximum(); int thumb = scrollBar.getThumb(); if( selection < minimum ) { scrollBar.setSelection( minimum ); } else if ( selection > maximum - thumb ) { scrollBar.setSelection( maximum - thumb ); } else { scrollBar.setSelection( selection ); } }
void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) { int inactive = 1; if (clientArea < maximum) { bar.setMaximum(maximum - margin); bar.setThumb(clientArea - margin); bar.setPageIncrement(clientArea - margin); if (!alwaysShowScroll) bar.setVisible(true); } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) { bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive); } } /**
if (thumb != hBar.getThumb ()) { hBar.setThumb (thumb); hBar.setPageIncrement (thumb);
void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) { int inactive = 1; if (clientArea < maximum) { bar.setMaximum(maximum - margin); bar.setThumb(clientArea - margin); bar.setPageIncrement(clientArea - margin); if (!alwaysShowScroll) bar.setVisible(true); } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) { bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive); } } /**
void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) { int inactive = 1; if (clientArea < maximum) { bar.setMaximum(maximum - margin); bar.setThumb(clientArea - margin); bar.setPageIncrement(clientArea - margin); if (!alwaysShowScroll) bar.setVisible(true); } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) { bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive); } } /**
void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) { int inactive = 1; if (clientArea < maximum) { bar.setMaximum(maximum - margin); bar.setThumb(clientArea - margin); bar.setPageIncrement(clientArea - margin); if (!alwaysShowScroll) bar.setVisible(true); } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) { bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive); } } /**
void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) { int inactive = 1; if (clientArea < maximum) { bar.setMaximum(maximum - margin); bar.setThumb(clientArea - margin); bar.setPageIncrement(clientArea - margin); if (!alwaysShowScroll) bar.setVisible(true); } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) { bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive); } } /**
if (thumb != vBar.getThumb ()) { vBar.setThumb (thumb); vBar.setPageIncrement (thumb);
&& vBar.getMaximum() == vBar.getSelection() + vBar.getThumb();
&& vBar.getMaximum() == vBar.getSelection() + vBar.getThumb();
if (hBar != null) { hBar.setMaximum (Math.max (1, maximum)); /* setting a value of 0 here is ignored */ if (hBar.getThumb () != clientArea.width) { hBar.setThumb (clientArea.width); hBar.setPageIncrement (clientArea.width);