Marcel Taeumel uploaded a new version of 60Deprecated to project The Trunk:
http://source.squeak.org/trunk/60Deprecated-mt.59.mcz ==================== Summary ==================== Name: 60Deprecated-mt.59 Author: mt Time: 23 October 2019, 10:50:56.455796 am UUID: 1cc93b6a-5a6c-4e7b-b950-31513495da77 Ancestors: 60Deprecated-mt.58 Complements Morphic-mt.1580. =============== Diff against 60Deprecated-mt.58 =============== Item was changed: SystemOrganization addCategory: #'60Deprecated-Collections-Streams'! SystemOrganization addCategory: #'60Deprecated-Kernel-Methods'! SystemOrganization addCategory: #'60Deprecated-Morphic-Pluggable Widgets'! + SystemOrganization addCategory: #'60Deprecated-Morphic-Widgets'! SystemOrganization addCategory: #'60Deprecated-NSPlugin-System-Support'! SystemOrganization addCategory: #'60Deprecated-System-Support'! SystemOrganization addCategory: #'60Deprecated-Tools-Inspector'! SystemOrganization addCategory: #'60Deprecated-Tools-Menus'! Item was added: + LazyListMorph subclass: #MulticolumnLazyListMorph + instanceVariableNames: 'columnWidths' + classVariableNames: '' + poolDictionaries: '' + category: '60Deprecated-Morphic-Widgets'! + + !MulticolumnLazyListMorph commentStamp: '<historical>' prior: 0! + A variant of LazyListMorph that can display multi-column lists.! Item was added: + ----- Method: MulticolumnLazyListMorph>>display:atRow:on: (in category 'drawing') ----- + display: items atRow: row on: canvas + "display the specified item, which is on the specified row; for Multicolumn + lists, items will be a list of strings" + | drawBounds | + drawBounds := (self drawBoundsForRow: row) translateBy: (self hMargin @ 0). + drawBounds := drawBounds intersect: self bounds. + items + with: (1 to: items size) + do: [:item :index | + "move the bounds to the right at each step" + index > 1 + ifTrue: [drawBounds := drawBounds left: drawBounds left + 6 + + (columnWidths at: index - 1)]. + item isText + ifTrue: [canvas + drawString: item + in: drawBounds + font: (font + emphasized: (item emphasisAt: 1)) + color: (self colorForRow: row)] + ifFalse: [canvas + drawString: item + in: drawBounds + font: font + color: (self colorForRow: row)]]! Item was added: + ----- Method: MulticolumnLazyListMorph>>drawOn: (in category 'drawing') ----- + drawOn: aCanvas + self getListSize = 0 ifTrue:[ ^self ]. + + self setColumnWidthsFor: aCanvas. + + super drawOn: aCanvas! Item was added: + ----- Method: MulticolumnLazyListMorph>>getListItem: (in category 'list access') ----- + getListItem: index + ^listSource getListItem: index! Item was added: + ----- Method: MulticolumnLazyListMorph>>listChanged (in category 'list management') ----- + listChanged + columnWidths := nil. + super listChanged! Item was added: + ----- Method: MulticolumnLazyListMorph>>setColumnWidthsFor: (in category 'drawing') ----- + setColumnWidthsFor: aCanvas + | row topRow bottomRow | + "set columnWidths for drawing on the specified canvas" + columnWidths ifNil: [ + columnWidths := (self item: 1) collect: [ :ignored | 0 ]. ]. + topRow := (self topVisibleRowForCanvas: aCanvas) max: 1. + bottomRow := (self bottomVisibleRowForCanvas: aCanvas) max: 1. + topRow > bottomRow ifTrue: [ ^ self ]. + topRow to: bottomRow do: [ :rowIndex | + row := self item: rowIndex. + columnWidths := columnWidths with: row collect: [ :currentWidth :item | + | widthOfItem | + widthOfItem := (font widthOfStringOrText: item). + widthOfItem > currentWidth + ifTrue: [ self changed. widthOfItem ] + ifFalse: [ currentWidth ] ] ]! Item was added: + ----- Method: MulticolumnLazyListMorph>>widthToDisplayItem: (in category 'scroll range') ----- + widthToDisplayItem: item + | widths | + widths := item collect: [ :each | super widthToDisplayItem: each ]. + ^widths sum + (10 * (widths size - 1)) "add in space between the columns" + ! |
Free forum by Nabble | Edit this page |