private void readjustScrollBar() { int increment = height; int pageIncrement = height; int thumb = height; int selection = round(topRow * rowHeight); int minimum = 0; int maximum = itemCount * rowHeight; minTopPixel = 0; maxTopPixel = maximum - height; if (selection < 0) { // we've scrolled into the negatives minTopPixel = selection; if (maximum < height) { maximum = height - selection; } else { maximum -= selection; } selection = 0; } else if (maximum < height) { // we've scrolled lower than is now possible maximum = height + selection; maxTopPixel = selection; } maxTopPixel = Math.max(0, maxTopPixel); if (hasVScroll) { getVerticalBar().setValues(selection, minimum, maximum, thumb, increment, pageIncrement); } }
void setScrollbar () { if (itemCount == 0) return; ScrollBar verticalBar = getVerticalBar (); if (verticalBar == null) return; int height = getClientArea ().height; ExpandItem item = items [itemCount - 1]; int maxHeight = item.y + getBandHeight () + spacing; if (item.expanded) maxHeight += item.height; //claim bottom free space if (yCurrentScroll > 0 && height > maxHeight) { yCurrentScroll = Math.max (0, yCurrentScroll + maxHeight - height); layoutItems (0, false); } maxHeight += yCurrentScroll; int selection = Math.min (yCurrentScroll, maxHeight); int increment = verticalBar.getIncrement (); int pageIncrement = verticalBar.getPageIncrement (); verticalBar.setValues(selection, 0, maxHeight, height, increment, pageIncrement); verticalBar.setVisible(maxHeight > height); }
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); } } /**
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); } } /**
bottomOffset= bottomOffset - originalSize.y + fakeHeight; textWidget.setSize(originalSize.x + 100, fakeHeight); verticalBar.setValues(0, 0, 1 << 30, 1, 10, 10); arrowHeights= computeScrollArrowHeights(textWidget, bottomOffset); fScrollArrowHeights= arrowHeights;
bottomOffset= bottomOffset - originalSize.y + fakeHeight; textWidget.setSize(originalSize.x + 100, fakeHeight); verticalBar.setValues(0, 0, 1 << 30, 1, 10, 10); arrowHeights= computeScrollArrowHeights(textWidget, bottomOffset); fScrollArrowHeights= arrowHeights;
hBar.setEnabled(true); hBar.setValues(hBar.getSelection(), 0, max, tableSize, 50, tableSize);