'From Squeak3.1alpha of 5 February 2001 [latest update: #3536] on 7 February 2001 at 1:06:13 am'! "Change Set: tweaks-sw Date: 7 February 2001 Author: Scott Wallace ¥ Makes it so the Preferences panel does not get dragged by a mouse-click anywhere other than on its title bar (thanx to Bob Arning). ¥ PasteUpMorph dropEnabled is set up so that in the backstop case -- for grandfathered instances -- it assumes the appropriate value."! !PasteUpMorph methodsFor: 'dropping/grabbing' stamp: 'sw 2/4/2001 00:54'! dropEnabled "Get this morph's ability to add and remove morphs via drag-n-drop." ^ (self valueOfProperty: #dropEnabled) ~~ false ! ! !Preferences class methodsFor: 'factored pref panel' stamp: 'sw 2/6/2001 21:30'! openFactoredPanelWithWidth: aWidth "Open up a preferences panel of the given width" "Preferences openFactoredPanelWithWidth: 325" | tabbedPalette controlPage window playfield aColor aFont maxEntriesPerCategory tabsMorph anExtent aPanel | aFont _ StrikeFont familyName: 'NewYork' size: 19. aPanel _ PreferencesPanel new. aColor _ aPanel defaultBackgroundColor. tabbedPalette _ TabbedPalette newSticky. (tabsMorph _ tabbedPalette tabsMorph) color: aColor darker; highlightColor: Color red regularColor: Color brown darker darker. tabbedPalette on: #mouseDown send: #yourself to: #(). maxEntriesPerCategory _ 0. self factoredCategories do: [:aCat | controlPage _ AlignmentMorph newColumn beSticky color: aColor. controlPage on: #mouseDown send: #yourself to: #(). controlPage borderColor: aColor; layoutInset: 4. aCat second do: [:aPrefSymbol | controlPage addMorphBack: (Preferences buttonRepresenting: aPrefSymbol wording: aPrefSymbol color: nil)]. controlPage setNameTo: aCat first asString. aCat first = #? ifTrue: [aPanel addHelpItemsTo: controlPage]. aCat first == #halos ifTrue: [aPanel addHaloControlsTo: controlPage]. tabbedPalette addTabFor: controlPage font: aFont. aCat first = 'search results' ifTrue: [(tabbedPalette tabNamed: aCat first) setBalloonText: 'Use the ? category to find preferences by keyword; the results of your search will show up here']. maxEntriesPerCategory _ maxEntriesPerCategory max: aCat second size]. tabbedPalette selectTabNamed: 'general'. tabsMorph rowsNoWiderThan: aWidth. playfield _ Morph newSticky. playfield on: #mouseDown send: #yourself to: #(). anExtent _ aWidth @ (25 + tabsMorph height + (20 * maxEntriesPerCategory)). playfield extent: anExtent. playfield color: aColor. playfield addMorphBack: tabbedPalette. self couldOpenInMorphic ifTrue: [window _ (SystemWindow labelled: 'Preferences') 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: anExtent + (2 @ 2). window position: 200 @ 20. self currentHand attachMorph: window] ifFalse: [(window _ MVCWiWPasteUpMorph newWorldForProject: nil) addMorph: playfield. MorphWorldView openOn: window label: 'Preferences' extent: playfield extent]! !