Bug fix: ListView>>viewMode:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug fix: ListView>>viewMode:

Carsten Haerle
Below there is a bug fix the following problem.

Create a non-virtual ListView and set the getTextBlock for the View and the
getTextBlock for the first column of the view, so that they produce
different texts. When you now change the view mode, the text will not be
displayed correctly.

Regards

Carsten Härle

!ListView methodsFor!

viewMode: aSymbol
 "Sets the view mode of the reciver to aSymbol.
 This can be one of:
  #tileIcons
  #largeIcons
  #list
  #report"

 viewMode == aSymbol
  ifFalse:
   [| style |
   viewMode := aSymbol.
   viewMode = #largeIcons ifTrue: [self largeIconExtent: Icon largeExtent].
   viewMode = #tileIcons ifTrue: [self largeIconExtent: Icon tileExtent].
   style := ViewModes at: aSymbol ifAbsent: [LVS_REPORT].
   self
    baseStyle: style
    maskedBy: LVS_TYPEMASK
    recreateIfChanged: false.
   "CHA FIX: the getTextBlock of the view  for the large icons mode and the
getTextBlock
   for the first column for the details mode can be different, so we have to
update the text
   of the icons not just repainting them in case they are non-virtual. So we
need updateAll
   instead of only invalidate."
   self updateAll.
   self trigger: #viewModeChanged]! !
!ListView categoriesFor: #viewMode:!accessing!public! !


Reply | Threaded
Open this post in threaded view
|

Re: Bug fix: ListView>>viewMode:

Blair McGlashan
"Carsten Haerle" <[hidden email]> wrote in message
news:c2nekt$9vi$01$[hidden email]...
> Below there is a bug fix the following problem.
>
> Create a non-virtual ListView and set the getTextBlock for the View and
the
> getTextBlock for the first column of the view, so that they produce
> different texts. When you now change the view mode, the text will not be
> displayed correctly.
>

Thanks Carsten, a patch for this will be included in PL4 as #1510. If anyone
has any other bugs, etc, they'd like patched then please report them by
close of play tomorrow, although we cannot guarantee we will action them (as
usual reports with SUnit tests are the most likely to get in, as it often
takes more time to write the test than it does to fix the problem). No
further reports will be accepted for possible inclusion in PL4 subsequent to
that.

PL4 is planned for release early next week. It's possible a beta may be
issued on Friday.

Regards

Blair