[BUG](FIX] Class Hierachy Browser in MVC

Boris Gaertner squeak-dev at lists.squeakfoundation.org
Sun Oct 20 10:35:35 UTC 2002


This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C27835.2FD0AD40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This bug report is for the following versions of Squeak:
  Squeak3.3alpha [latest update: #4981]
  Squeak 3.2 [latest update: #4917]

Under MVC, the class hierarchy browser has a very peculiar little bug:
1. Open a Class Hierarchy Browser in an MVC Project
2. Find and select Class OrderedCollection (or any other class with class
methods)
3 Press the 'class' button.
4. Press the button '?' to see the class comment.
5. Select a method category.
6. remove the mouse pointer from the method category list.

The Button '?' is now deselected and the button 'class' is selected again.
However, the part of the class button that was obscured by the scrollbar
is not selected.
The same bug is visible in the browser that shows the classes of one
system category only.

To avoid that bug, we have to hide the scrollbar during item selection.

In PluggableListController, the instance variable terminateDuringSelect
is used to control the scrollbar display policy during item selection.
It turns out that all we have to do is to provide the PluggableListView
with a controller that has the instance variable terminateDuringSelect
set to true. This is what you find in the attached change set.

You may think that such a small bug is not worth being fixed. But
to tell you the truth, this little harmless bug has annoyed me for two
years!

Greetings,
Boris



------=_NextPart_000_0006_01C27835.2FD0AD40
Content-Type: application/octet-stream;
	name="CHBBug.1.cs"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="CHBBug.1.cs"

'From Squeak3.3alpha of 30 January 2002 [latest update: #4981] on 20 =
October 2002 at 12:22:56 pm'!=0D"Change Set:		Unnamed2=0DDate:			20 =
October 2002=0DAuthor:			Boris Gaertner=0D=0DUnder MVC, the class =
hierarchy browser has a very peculiar little bug:=0D1. Open a Class =
Hierarchy Browser in an MVC Project=0D2. Select Class OrderedCollection =
(or any other class with class methods)=0D3 Press the Class button.=0D4. =
Press the Button '?' to see the comment.=0D5. Select a method =
category.=0D=0DThe Button '?' is now deselected and the button class is =
selected.=0DHowever, the part of the class button that was covered by =
the scrollbar=0Dis not selected.=0DThe same bug is visible in the =
browser that shows the classes of one=0Dsystem category.=0DThe reason is =
that the controller of the category list view is not=0Dcreated with the =
open terminateDuringSelect.=0D=0DThis change set fixes that bug for both =
browsers."!=0D=0D=0D!Browser methodsFor: 'initialize-release' stamp: 'BG =
10/20/2002 11:56'!=0DopenEditString: aString=0D        "Create a =
pluggable version of all the views for a Browser, including views and =
controllers."=0D        | systemCategoryListView classListView =0D       =
 messageCategoryListView messageListView browserCodeView topView =
switchView underPane y optionalButtonsView annotationPane |=0D=0D        =
self couldOpenInMorphic ifTrue: [^ self openAsMorphEditing: aString].=0D =
       "Sensor leftShiftDown ifTrue: [^ self openAsMorphEditing: =
aString].=0D                uncomment-out for testing morphic browser =
embedded in mvc project"=0D=0D        topView _ StandardSystemView new =
model: self.=0D        topView borderWidth: 1. "label and minSize taken =
care of by caller"=0D=0D        systemCategoryListView _ =
PluggableListView on: self=0D                list: =
#systemCategoryList=0D                selected: =
#systemCategoryListIndex=0D                changeSelected: =
#systemCategoryListIndex:=0D                menu: =
#systemCategoryMenu:=0D                keystroke: =
#systemCatListKey:from:.=0D        systemCategoryListView window: (0 @ 0 =
extent: 50 @ 70).=0D        topView addSubView: =
systemCategoryListView.=0D=0D        classListView _ PluggableListView =
on: self=0D                list: #classList=0D                selected: =
#classListIndex=0D                changeSelected: #classListIndex:=0D    =
            menu: #classListMenu:shifted:=0D                keystroke: =
#classListKey:from:.=0D        classListView window: (0 @ 0 extent: 50 @ =
62).=0D        topView addSubView: classListView toRightOf: =
systemCategoryListView.=0D=0D        switchView _ self =
buildInstanceClassSwitchView.=0D        switchView borderWidth: 1.=0D    =
    topView addSubView: switchView below: classListView.=0D=0D        =
messageCategoryListView _ PluggableListView on: self=0D                =
list: #messageCategoryList=0D                selected: =
#messageCategoryListIndex=0D                changeSelected: =
#messageCategoryListIndex:=0D                menu: =
#messageCategoryMenu:. =0D     messageCategoryListView controller: =
((messageCategoryListView defaultControllerClass new) =
terminateDuringSelect: true).=0D        messageCategoryListView window: =
(0 @ 0 extent: 50 @ 70).=0D        topView addSubView: =
messageCategoryListView toRightOf: classListView.=0D=0D        =
messageListView _ PluggableListView on: self=0D                list: =
#messageList=0D                selected: #messageListIndex=0D            =
    changeSelected: #messageListIndex:=0D                menu: =
#messageListMenu:shifted:=0D                keystroke: =
#messageListKey:from:.=0D        messageListView window: (0 @ 0 extent: =
50 @ 70).=0D        messageListView menuTitleSelector: =
#messageListSelectorTitle.=0D        topView addSubView: messageListView =
toRightOf: messageCategoryListView.=0D=0D       self =
wantsAnnotationPane=0D                ifTrue:=0D                        =
[annotationPane _ PluggableTextView on: self=0D                          =
      text: #annotation accept: nil=0D                                =
readSelection: nil menu: nil.=0D                        annotationPane =
window: (0 at 0 extent: 200 at self optionalAnnotationHeight).=0D              =
          topView addSubView: annotationPane below: =
systemCategoryListView.=0D                        underPane _ =
annotationPane.=0D                        y _ 110 - self =
optionalAnnotationHeight]=0D                ifFalse: [=0D                =
        underPane _ systemCategoryListView.=0D                        y =
_ 110].=0D=0D        self wantsOptionalButtons ifTrue:=0D                =
[optionalButtonsView _ self buildOptionalButtonsView.=0D                =
optionalButtonsView borderWidth: 1.=0D                topView =
addSubView: optionalButtonsView below: underPane.=0D                =
underPane _ optionalButtonsView.=0D                y _ y - self =
optionalButtonHeight].=0D=0D        browserCodeView _ PluggableTextView =
on: self =0D                        text: #contents accept: =
#contents:notifying:=0D                        readSelection: =
#contentsSelection menu: #codePaneMenu:shifted:.=0D        =
browserCodeView window: (0 at 0 extent: 200 at y).=0D        topView =
addSubView: browserCodeView below: underPane.=0D        aString =
ifNotNil: [browserCodeView editString: aString.=0D                       =
 browserCodeView hasUnacceptedEdits: true].=0D        topView =
setUpdatablePanesFrom: #(systemCategoryList classList =
messageCategoryList messageList).=0D=0D        ^ topView! =
!=0D=0D!Browser methodsFor: 'initialize-release' stamp: 'BG 10/20/2002 =
11:42'!=0DopenSystemCatEditString: aString=0D	"Create a pluggable =
version of all the views for a Browser, including views and controllers. =
 The top list view is of the currently selected system class category--a =
single item list."=0D	| systemCategoryListView classListView =
messageCategoryListView messageListView browserCodeView topView =
switchView y annotationPane underPane optionalButtonsView |=0D=0D	=
Smalltalk isMorphic ifTrue: [^ self openAsMorphSysCatEditing: =
aString].=0D=0D	topView _ (StandardSystemView new) model: self.=0D	=
topView borderWidth: 1.=0D		"label and minSize taken care of by =
caller"=0D=0D	systemCategoryListView _ PluggableListView on: self=0D		=
list: #systemCategorySingleton=0D		selected: #indexIsOne =0D		=
changeSelected: #indexIsOne:=0D		menu: #systemCatSingletonMenu:=0D		=
keystroke: #systemCatSingletonKey:from:.=0D	systemCategoryListView =
window: (0 @ 0 extent: 200 @ 12).=0D	topView addSubView: =
systemCategoryListView.=0D=0D	classListView _ PluggableListView on: =
self=0D		list: #classList=0D		selected: #classListIndex=0D		=
changeSelected: #classListIndex:=0D		menu: #classListMenu:shifted:=0D		=
keystroke: #classListKey:from:.=0D	classListView window: (0 @ 0 extent: =
67 @ 62).=0D	topView addSubView: classListView below: =
systemCategoryListView.=0D=0D	messageCategoryListView _ =
PluggableListView on: self=0D		list: #messageCategoryList=0D		selected: =
#messageCategoryListIndex=0D		changeSelected: =
#messageCategoryListIndex:=0D		menu: #messageCategoryMenu:.=0D     =
messageCategoryListView controller: ((messageCategoryListView =
defaultControllerClass new) terminateDuringSelect: true).=0D	=
messageCategoryListView window: (0 @ 0 extent: 66 @ 70).=0D	topView =
addSubView: messageCategoryListView toRightOf: classListView.=0D=0D	=
switchView _ self buildInstanceClassSwitchView.=0D	switchView =0D		=
window: switchView window =0D		viewport: (classListView viewport =
bottomLeft =0D					corner: messageCategoryListView viewport =
bottomLeft).=0D	switchView borderWidth: 1.=0D	topView addSubView: =
switchView below: classListView.=0D=0D	messageListView _ =
PluggableListView on: self=0D		list: #messageList=0D		selected: =
#messageListIndex=0D		changeSelected: #messageListIndex:=0D		menu: =
#messageListMenu:shifted:=0D		keystroke: #messageListKey:from:.=0D	=
messageListView menuTitleSelector: #messageListSelectorTitle.=0D	=
messageListView window: (0 @ 0 extent: 67 @ 70).=0D	topView addSubView: =
messageListView toRightOf: messageCategoryListView.=0D=0D	 self =
wantsAnnotationPane=0D		ifTrue:=0D			[annotationPane _ PluggableTextView =
on: self=0D				text: #annotation accept: nil=0D				readSelection: nil =
menu: nil.=0D			annotationPane window: (0 at 0 extent: 200 at self =
optionalAnnotationHeight).=0D			topView addSubView: annotationPane =
below: switchView.=0D			y _ 110 - 12 - self optionalAnnotationHeight.=0D	=
		underPane _ annotationPane]=0D		ifFalse:=0D			[y _ 110 - 12.=0D			=
underPane _ switchView].=0D=0D	self wantsOptionalButtons ifTrue:=0D		=
[optionalButtonsView _ self buildOptionalButtonsView.=0D		=
optionalButtonsView borderWidth: 1.=0D		topView addSubView: =
optionalButtonsView below: underPane.=0D		underPane _ =
optionalButtonsView.=0D		y _ y - self optionalButtonHeight].=0D=0D	=
browserCodeView _ PluggableTextView on: self =0D			text: #contents =
accept: #contents:notifying:=0D			readSelection: #contentsSelection =
menu: #codePaneMenu:shifted:.=0D	browserCodeView window: (0 at 0 extent: =
200 at y).=0D	topView addSubView: browserCodeView below: underPane.=0D	=
aString ifNotNil: [browserCodeView editString: aString.=0D			=
browserCodeView hasUnacceptedEdits: true].=0D	topView =
setUpdatablePanesFrom: #(classList messageCategoryList messageList).=0D	=
^ topView! !=0D=0D
------=_NextPart_000_0006_01C27835.2FD0AD40--




More information about the Squeak-dev mailing list