The Trunk: Morphic-mt.1519.mcz

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

The Trunk: Morphic-mt.1519.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1519.mcz

==================== Summary ====================

Name: Morphic-mt.1519
Author: mt
Time: 12 September 2019, 11:45:13.334062 am
UUID: 5c4b64ee-8cf1-e84b-8ccd-757d32487b80
Ancestors: Morphic-mt.1518

Makes SystemProgressMorph more extensible through subclassing. ...and fixes that label-centering bug. :-)

=============== Diff against Morphic-mt.1518 ===============

Item was added:
+ ----- Method: SystemProgressMorph>>createProgressBar (in category 'private') -----
+ createProgressBar
+
+ ^ SystemProgressBarMorph new extent: BarWidth@BarHeight!

Item was added:
+ ----- Method: SystemProgressMorph>>createProgressLabel: (in category 'private') -----
+ createProgressLabel: aString
+
+ ^ (StringMorph contents: aString font: self font)
+ color: self textColor;
+ yourself!

Item was changed:
  ----- Method: SystemProgressMorph>>initialize (in category 'initialization') -----
  initialize
  super initialize.
  activeSlots := 0.
  bars := Array new: 10.
  labels := Array new: 10.
  lock := Semaphore forMutualExclusion.
  self setDefaultParameters;
  setProperty: #morphicLayerNumber toValue: self morphicLayerNumber;
  layoutPolicy: TableLayout new;
  listDirection: #topToBottom;
+ cellPositioning: #topCenter;
- cellPositioning: #leftCenter;
  cellGap: 5;
  listCentering: #center;
  hResizing: #shrinkWrap;
  vResizing: #shrinkWrap;
  layoutInset: Inset;
  minWidth: 150!

Item was changed:
  ----- Method: SystemProgressMorph>>nextSlotFor: (in category 'private') -----
  nextSlotFor: shortDescription
 
  lock critical: [ | label bar slots |
  slots := self labels size.
  self activeSlots = slots ifTrue: [^0].
  self activeSlots: self activeSlots + 1.
  1 to: slots do: [:index |
  label := (self labels at: index).
  label ifNil: [
+ bar := self bars at: index put: self createProgressBar.
+ label := self labels at: index put: (self createProgressLabel: shortDescription).
- bar := self bars at: index put: (SystemProgressBarMorph new extent: BarWidth@BarHeight).
- label := self labels at: index put: ((StringMorph contents: shortDescription font: self font) color: self textColor).
  self
  addMorphBack: label;
  addMorphBack: bar.
  ^index].
  label owner ifNil: [
  bar := self bars at: index.
  label := self labels at: index.
  self
  addMorphBack: (label contents: shortDescription);
  addMorphBack: (bar barSize: 0).
  ^index]]]
  !