- adj->upper = (virtSize + pixelsPerLine - 1) / pixelsPerLine;
- adj->page_size = winSize / pixelsPerLine;
- adj->page_increment = winSize / pixelsPerLine;
-
- // Special case. When client and virtual size are very close but
- // the client is big enough, kill scrollbar.
-
- if ((adj->page_size < adj->upper) && (winSize >= virtSize))
- adj->page_size += 1.0;
-
- // If the scrollbar hits the right side, move the window
- // right to keep it from over extending.
-
- if ( !wxIsNullDouble(adj->value) &&
- (adj->value + adj->page_size > adj->upper) )
- {
- adj->value = adj->upper - adj->page_size;
- if (adj->value < 0.0)
- adj->value = 0.0;
-
- if ( m_win->GetChildren().empty() )
- {
- // This is enough without child windows
- *pos = (int)adj->value;
- }
- else
- {
- // We need to actually scroll window
- g_signal_emit_by_name (adj, "value_changed");
- }
- }
+ // GtkRange won't allow upper == lower, so for disabled state use [0,1]
+ // with a page size of 1. This will also clamp position to 0.
+ upper = 1;
+ page_size = 1;
+ *lines = 0;
+ *linesPerPage = 0;