[Cuis] StringMorph and lf

Dan dnorton at mindspring.com
Thu Jan 29 14:32:52 CST 2015


Hi Juan,

On 29 Jan 2015 at 11:38, Juan Vuletich wrote:

> Hi Dan,
> 
> On 1/29/2015 12:22 AM, Dan wrote:
> > ...
> > The window won't contain all the lines at times, so lock and
> hideScrollBarsIndefinitely prevent
> > the user from seeing everything. Here's what seems to give the
> best results so far, but there
> > are problems with the scroll bars. This method is sent to self by
> #initialize:
> >
> > setupBoard
> > 	"Specify the layout for the<...>  window"
> > 	| status statusMorph clues |
> > 	
> > 	status := LayoutMorph newRow
> > 		addMorph: (statusMorph := TextModelMorph
> > 			withModel: (statusString := TextModel withText: 'Status
> Area')).
> > 			
> > 	buttonPane := LayoutMorph newRow
> > 		padding: #center;
> > 		color: Color lightGreen.
> > 	
> > 	clues := LayoutMorph newRow
> > 		addMorph: (cluesMorph := TextModelMorph
> > 			withModel: (cluesString := TextModel withText: 'Clues
> Area')).
> > 			
> > 	statusMorph askBeforeDiscardingEdits: false;
> > 		wrapFlag: true;
> > 		hideOrShowScrollBars.
> > 			
> > 	cluesMorph askBeforeDiscardingEdits: false;
> > 		wrapFlag: false; "false because clues are short one-liners"
> > 		hHideScrollBar; "<--- ***** note: it is not hidden"
> > 		hideOrShowScrollBars.
> > 		
> > 	self layoutMorph
> > 			addMorph: status proportionalHeight: 0.15;		
> > 			addAdjusterAndMorph: buttonPane proportionalHeight: 0.05;		
> > 			addAdjusterAndMorph: clues proportionalHeight: 0.80.
> >
> > This way of laying out is a big improvement over Morphic 2.
> However problems with the
> > above are that the vertical scroll slider extends beyond its
> owner's extent. It resumes normal
> > size only after the window is resized. The horizontal scroll bar
> defies my efforts to remove it.
> > Let me know if I should send the rest of the code to you.
> >
> 
> There were a couple of bugs there. Most TextModelMorphs do wordwrap,
> so 
> wrapFlag: false isn't well tested. The attach includes fixes, and a
> new 
> capability to disable keyboard input.
> 
> Modify your code to read:
> 
>          statusMorph askBeforeDiscardingEdits: false;
>                  wrapFlag: true;
>              disableKeyboard.
> 
>          cluesMorph askBeforeDiscardingEdits: false;
>                  wrapFlag: false; "false because clues are short
> one-liners"
>              disableKeyboard.
> 
> There's no need to do any specific setup to scrollbars anymore.
> 
> This change set will be in the next bunch of updates.
>
This is better - I especially appreciate #disableKeyboard. The cursor can not be inserted and 
although selection appears, copy and paste do nothing. The horizontal scroll bar does not 
appear and neither does the vertical, at least at first. But when the vertical is actually needed, 
it does not appear unless the window border is clicked. At times it loses track of the size of 
what needs to be scrolled. The scroll wheel no longer works.

Thanks,
 - Dan






More information about the Cuis mailing list