The Trunk: MorphicExtras-dtl.217.mcz

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

The Trunk: MorphicExtras-dtl.217.mcz

commits-2
David T. Lewis uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-dtl.217.mcz

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

Name: MorphicExtras-dtl.217
Author: dtl
Time: 20 November 2017, 7:32:14.452843 pm
UUID: b1677477-d4b1-4725-8506-e6d910979d16
Ancestors: MorphicExtras-dtl.216

Fix opening TabbedPalette from the objects catalog. A TabbedPalette is a morph that does not know its world, so use Project current world rather than #world. Also use Project current world in TabbedPalette class>>authoringPrototype.

=============== Diff against MorphicExtras-dtl.216 ===============

Item was changed:
  ----- Method: TabbedPalette class>>authoringPrototype (in category 'scripting') -----
  authoringPrototype
  | aTabbedPalette aBook aTab |
  aTabbedPalette := self new markAsPartsDonor.
  aTabbedPalette pageSize: 200 @ 300.
  aTabbedPalette tabsMorph highlightColor: Color red regularColor: Color blue.
  aTabbedPalette addMenuTab.
 
  aBook := BookMorph new setNameTo: 'one'; pageSize: aTabbedPalette pageSize.
  aBook color: Color blue muchLighter.
  aBook removeEverything; insertPage; showPageControls.
+ aBook currentPage addMorphBack: (Project current world drawingClass withForm: ScriptingSystem squeakyMouseForm).
- aBook currentPage addMorphBack: (self world drawingClass withForm: ScriptingSystem squeakyMouseForm).
  aTab := aTabbedPalette addTabForBook: aBook.
 
  aBook := BookMorph new setNameTo: 'two'; pageSize: aTabbedPalette pageSize.
  aBook color: Color red muchLighter.
  aBook removeEverything; insertPage; showPageControls.
  aBook currentPage addMorphBack: CurveMorph authoringPrototype.
  aTabbedPalette addTabForBook: aBook.
 
  aTabbedPalette selectTab: aTab.
 
  aTabbedPalette beSticky.
  aTabbedPalette tabsMorph hResizing: #spaceFill.
  ^ aTabbedPalette!

Item was changed:
  ----- Method: TabbedPalette>>addMenuTab (in category 'palette menu') -----
  addMenuTab
  "Add the menu tab.  This is ancient code, not much in the spirit of anything current"
 
  | aMenu aTab aGraphic sk |
  aMenu := MenuMorph new defaultTarget: self.
  aMenu stayUp: true.
  "aMenu add:  'clear' translated action: #showNoPalette."
  aMenu add:  'sort tabs' translated action: #sortTabs:.
  aMenu add:  'choose new colors for tabs' translated action: #recolorTabs.
  aMenu setProperty: #paletteMenu toValue: true.
  "aMenu add:  'make me the Standard palette' translated action: #becomeStandardPalette."
  aTab := self addTabForBook: aMenu  withBalloonText: 'a menu of palette-related controls' translated.
  aTab highlightColor: tabsMorph highlightColor; regularColor: tabsMorph regularColor.
  tabsMorph laySubpartsOutInOneRow; layoutChanged.
 
  aGraphic := ScriptingSystem formAtKey: 'TinyMenu'.
  aGraphic ifNotNil:
  [aTab removeAllMorphs.
+ aTab addMorph: (sk := Project current world drawingClass withForm: aGraphic).
- aTab addMorph: (sk := self world drawingClass withForm: aGraphic).
  sk position: aTab position.
  sk lock.
  aTab fitContents].
  self layoutChanged!