[ENH] Optimized (Hidden) Morphic Scollbars Preference

Doug Way dway at mat.net
Mon Mar 22 05:16:27 UTC 1999


This is an preference enhancement to optimize the Morphic scrollbars so
that they are only displayed when necessary.  In other words, they are not
displayed if the contents of a pane is smaller than the size of the pane
itself.

This is based on Carl Gundel's original enhancement for pop-up scrollbars,
but it now includes inboard (fixed) scrollbars as well.  In addition, I
further enhanced it so that if you're typing in a PluggableTextMorph (e.g.
Workspace) and you cross the "scrollability" threshold, the scrollbar will
appear/dissappear as appropriate.  Basically, all cases should be covered.

For popup scrollbars, the popups will only appear when necessary, which
can improve UI performace for slower computers.  For inboard scrollbars,
the innerBounds of the pane is increased when the scrollbar dissappears so
that you can see more of the pane's contents (in width).

The preference is called "optimizeMorphicScrollbars".  (You'll need to do
"Preferences chooseInitialSettings" for it to appear.  I noticed that the
list of preferences is getting pretty large... they'll probably need to be
grouped somehow at some point?)

The preference default is currently set to false (off)... some pop-up
scrollbar users will probably prefer to always have them pop up, since
that indicates which pane currently has focus.  (It would be good to have
an additional way to visually indicate focus... something similar to the
red border for not-yet-accepted text.)  Also, there's no good way for
one-button (Mac) mouse users to reliably access the menu button in the
scrollbar if they don't like using the Option key.  (I'm familiar with
this since I use a Mac most of the time.)  There wasn't any obvious
solution to this problem, so menu-button users (generally a minority) will
probably want to leave the default as false.  The idea of having just the
menu button pop up or appear fixed seemed kind of ugly... although someone
could always add this as a third option.

I did have to add a boolean inst var to ScrollPane called "hasFocus" in
order to reliably keep track of whether the pane has focus or not.  (It's
set to true/false on mouseEnter/Leave events.)  It seems like this should
probably moved up to a superclass to be more generally useful, but I left
it at ScrollPane for now.  Another thing I got stuck on for awhile was
losing the current selection when resetting the innerBounds from within a
pane, but I eventually figured that out.

Anyway, the enhancement is at:
http://www.mindspring.com/~dway/smalltalk/HiddenScrollBar-dew.cs

I did a decent amount of testing, but if anyone sees any bugs or problems,
let me know.

- Doug Way
  EAI/Transom Technogies, Ann Arbor, MI
  dway at eai.com, dway at mat.net
  http://www.transom.com

  Smalltalk: Guaranteed Y2T Compliant





More information about the Squeak-dev mailing list