[ENH]ScrollPane (scrollBarHidden: true)

Karl Ramberg karl.ramberg at chello.se
Tue May 23 17:07:07 UTC 2000



Doug Way wrote:

> On Tue, 23 May 2000, Karl Ramberg wrote:
>
> > Doug Way wrote:
> >
> > > FYI, I created a similar but more elaborate changeset, which automatically
> > > hides scrollbars when the contents of a pane are small enough to fit in
> > > the pane.
> > >
> > > The changeset works for Squeak 2.6/2.7 and seems to work for 2.8alpha,
> > > although I haven't tested that thoroughly.  It's at
> > > http://www.mindspring.com/~dway/smalltalk/HiddenScrollBar26.cs .
> >
> > It looks good and is much nicer than the one I did :-)  One problem is
> > when inboard scrollboards are turned on they wount show up :-(
> >
> > Fix that and this should be a perfect preference in the scrolling category.
>
> Hmm, I'm not seeing this problem.  (in 2.7 or 2.8alpha)

You are right. The changeset works exelent. I can't explain why
it happed the first time I used it. I better check stuff better before I
complain :-).
A fix for the bug you noticed is attached. :-)

Karl

>
>
> If I file in the changeset, turn on inboardScrollbars and open a browser,
> the scrollbar does appear in the (top-left) class category pane, but not
> in any of the empty panes.  If I select Kernel-Objects, a scrollbar
> appears in the class pane (second-to-left).  If I then select
> Kernel-Magnitudes, the scrollbar dissappears from the class pane, as it
> should, since there are only three classes.
>
> When testing this just now, I did notice a smaller bug... if you turn on
> inboardScrollbars, it automatically puts them on the right, ignoring the
> scrollBarsOnRight preference.  I'll try to fix this.
>
> - Doug Way
>   EAI/Transom Technologies, Ann Arbor, MI
>   http://www.transom.com
>   dway at mat.net, @eai.com
-------------- next part --------------
'From Squeak2.8alpha of 19 February 2000 [latest update: #2158] on 23 May 2000 at 7:01:34 pm'!

!ScrollPane methodsFor: 'initialization' stamp: 'kfr 5/23/2000 18:58'!
initialize
	super initialize.
	hasFocus _ false.
	borderWidth _ 2.  borderColor _ Color black.
	retractableScrollBar _ (Preferences valueOfFlag: #inboardScrollbars) not.
     scrollBarOnLeft _ (Preferences valueOfFlag: #scrollBarsOnRight) not.

	scrollBar := ScrollBar new model: self slotName: 'scrollBar'.
	scrollBar borderWidth: 1; borderColor: Color black.

	scroller := TransformMorph new color: Color transparent.
	scroller offset: -3 at 0.
	self addMorph: scroller.

	self on: #mouseEnter send: #mouseEnter: to: self.
	self on: #mouseLeave send: #mouseLeave: to: self.
	self extent: 150 at 120! !


More information about the Squeak-dev mailing list