[etoys-dev] Etoys: System-bf.13.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat May 8 15:56:47 EDT 2010
Bert Freudenberg uploaded a new version of System to project Etoys:
http://source.squeak.org/etoys/System-bf.13.mcz
==================== Summary ====================
Name: System-bf.13
Author: bf
Time: 8 May 2010, 12:56:20 pm
UUID: 37c9021b-94a2-4e76-93e3-f2b9c847e425
Ancestors: System-bf.12
- fix Preferences fonts and layout
=============== Diff against System-bf.12 ===============
Item was changed:
----- Method: BooleanPreferenceView>>representativeButtonWithColor:inPanel: (in category 'user interface') -----
representativeButtonWithColor: aColor inPanel: aPreferencesPanel
"Return a button that controls the setting of prefSymbol. It will keep up to date even if the preference value is changed in a different place"
| outerButton aButton str miniWrapper |
outerButton := AlignmentMorph newRow height: 24.
outerButton color: (aColor ifNil: [Color r: 0.645 g: 1.0 b: 1.0]).
outerButton hResizing: (aPreferencesPanel ifNil: [#shrinkWrap] ifNotNil: [#spaceFill]).
outerButton vResizing: #shrinkWrap.
outerButton addMorph: (aButton := UpdatingThreePhaseButtonMorph checkBox).
aButton
target: self preference;
actionSelector: #togglePreferenceValue;
getSelector: #preferenceValue.
outerButton addTransparentSpacerOfSize: (2 @ 0).
+ str := StringMorph contents: self preference name font: Preferences standardButtonFont.
- str := StringMorph contents: self preference name font: (StrikeFont familyName: 'NewYork' size: 12).
self preference localToProject ifTrue:
[str emphasis: 1].
miniWrapper := AlignmentMorph newRow hResizing: #shrinkWrap; vResizing: #shrinkWrap.
+ miniWrapper layoutInset: 0.
miniWrapper beTransparent addMorphBack: str lock.
aPreferencesPanel
ifNotNil: "We're in a Preferences panel"
[miniWrapper on: #mouseDown send: #offerPreferenceNameMenu:with:in: to: self withValue: aPreferencesPanel.
miniWrapper on: #mouseEnter send: #menuButtonMouseEnter: to: miniWrapper.
miniWrapper on: #mouseLeave send: #menuButtonMouseLeave: to: miniWrapper.
miniWrapper setBalloonText: 'Click here for a menu of options regarding this preference. Click on the checkbox to the left to toggle the setting of this preference' translated]
ifNil: "We're a naked button, not in a panel"
[miniWrapper setBalloonText: self preference helpString translated; setProperty: #balloonTarget toValue: aButton].
outerButton addMorphBack: miniWrapper.
outerButton setNameTo: self preference name.
aButton setBalloonText: self preference helpString.
^ outerButton
+ !
-
- "(Preferences preferenceAt: #balloonHelpEnabled) view tearOffButton"!
Item was changed:
----- Method: Preferences class>>openNewPreferencesPanel (in category 'preferences panel') -----
openNewPreferencesPanel
"Create and open a new Preferences Panel"
+ | window |
+ window := self preferencesControlPanel.
+ self currentWorld addMorphFront: window.
+ window center: self currentWorld center.
+ window activateAndForceLabelToShow.
- self openFactoredPanelWithWidth: 370
"Preferences openNewPreferencesPanel"!
Item was changed:
----- Method: Preferences class>>initializePreferencePanel:in: (in category 'preferences panel') -----
initializePreferencePanel: aPanel in: aPasteUpMorph
"Initialize the given Preferences panel. in the given pasteup, which is the top-level panel installed in the container window. Also used to reset it after some change requires reformulation"
| tabbedPalette controlPage aColor aFont maxEntriesPerCategory tabsMorph anExtent prefObjects cc |
aPasteUpMorph removeAllMorphs.
+ aFont := Preferences standardListFont.
- aFont := StrikeFont familyName: 'NewYork' size: 19.
-
aColor := aPanel defaultBackgroundColor.
tabbedPalette := TabbedPalette newSticky.
tabbedPalette dropEnabled: false.
(tabsMorph := tabbedPalette tabsMorph) color: aColor darker;
highlightColor: Color red regularColor: Color brown darker darker.
tabbedPalette on: #mouseDown send: #yourself to: #().
maxEntriesPerCategory := 0.
self listOfCategories do:
[:aCat |
controlPage := AlignmentMorph newColumn beSticky color: aColor.
controlPage on: #mouseDown send: #yourself to: #().
controlPage dropEnabled: false.
Preferences alternativeWindowLook ifTrue:
[cc := Color transparent.
controlPage color: cc].
controlPage borderColor: aColor;
layoutInset: 4.
(prefObjects := self preferenceObjectsInCategory: aCat) do:
[:aPreference | | button |
button _ aPreference representativeButtonWithColor: cc inPanel: aPanel.
button ifNotNil: [controlPage addMorphBack: button]].
controlPage setNameTo: aCat asString.
aCat = #?
ifTrue: [aPanel addHelpItemsTo: controlPage].
tabbedPalette addTabFor: controlPage font: aFont.
aCat = 'search results' ifTrue:
[(tabbedPalette tabNamed: aCat) setBalloonText:
'Use the ? category to find preferences by keyword; the results of your search will show up here' translated].
maxEntriesPerCategory := maxEntriesPerCategory max: prefObjects size].
tabbedPalette selectTabNamed: '?'.
tabsMorph rowsNoWiderThan: aPasteUpMorph width.
aPasteUpMorph on: #mouseDown send: #yourself to: #().
+ anExtent := aPasteUpMorph width @ (490 max: (25 + tabsMorph height + (24 * maxEntriesPerCategory))).
- anExtent := aPasteUpMorph width @ (490 max: (25 + tabsMorph height + (20 * maxEntriesPerCategory))).
aPasteUpMorph extent: anExtent.
aPasteUpMorph color: aColor.
aPasteUpMorph addMorphBack: tabbedPalette.!
Item was changed:
----- Method: Preferences class>>preferencesControlPanel (in category 'preferences panel') -----
preferencesControlPanel
"Answer a Preferences control panel window"
"Preferences preferencesControlPanel openInHand"
| window playfield aPanel |
aPanel _ PreferencesPanel new.
+ playfield _ PasteUpMorph new width: 450.
- playfield _ PasteUpMorph new width: 325.
playfield dropEnabled: false.
window _ (SystemWindow labelled: 'Preferences' translated) model: aPanel.
self initializePreferencePanel: aPanel in: playfield.
window on: #keyStroke send: #keyStroke: to: aPanel.
window bounds: (100 @ 100 - (0 @ window labelHeight + window borderWidth) extent: playfield extent + (2 * window borderWidth)).
window addMorph: playfield frame: (0 @ 0 extent: 1 @ 1).
window updatePaneColors.
window setProperty: #minimumExtent toValue: playfield extent + (12 at 15).
^ window!
Item was removed:
- ----- Method: Preferences class>>openFactoredPanelWithWidth: (in category 'preferences panel') -----
- openFactoredPanelWithWidth: aWidth
- "Open up a preferences panel of the given width"
-
- "Preferences openFactoredPanelWithWidth: 325"
- | window playfield aPanel |
-
- aPanel _ PreferencesPanel new.
- playfield _ PasteUpMorph new width: aWidth.
- playfield dropEnabled: false.
- self initializePreferencePanel: aPanel in: playfield.
- self couldOpenInMorphic
- ifTrue: [window _ (SystemWindow labelled: 'Preferences' translated)
- model: aPanel.
- window on: #keyStroke send: #keyStroke: to: aPanel.
- window
- bounds: (100 @ 100 - (0 @ window labelHeight + window borderWidth) extent: playfield extent + (2 * window borderWidth)).
- window
- addMorph: playfield
- frame: (0 @ 0 extent: 1 @ 1).
- window updatePaneColors.
- window setProperty: #minimumExtent toValue: playfield extent + (12 at 15).
- self currentWorld addMorphFront: window.
- window center: self currentWorld center.
- window activateAndForceLabelToShow]
- ifFalse:
- [(window _ MVCWiWPasteUpMorph newWorldForProject: nil) addMorph: playfield.
- MorphWorldView
- openOn: window
- label: 'Preferences' translated
- extent: playfield extent]!
More information about the etoys-dev
mailing list