'From Squeak3.1alpha of 5 February 2001 [latest update: #3689] on 22 February 2001 at 6:55:02 am'! "Change Set: preferencesFeatures-sw Date: 22 February 2001 Author: Scott Wallace Adds two minor but useful features to the preferences panel. (1) 'hand me a button for this preference' (2) 'copy name of this preference to the clipboard'"! !PreferencesPanel methodsFor: 'initialization' stamp: 'sw 2/21/2001 14:15'! prefMenu: anEvent rcvr: aMorph pref: prefSymbol "the user clicked on a preference name. put up a menu" | aMenu | aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: prefSymbol. (Preferences okayToChangeProjectLocalnessOf: prefSymbol) ifTrue: [aMenu addUpdating: #isProjectLocalString: enablementSelector: nil target: Preferences selector: #toggleProjectLocalnessOf: argumentList: {prefSymbol}]. aMenu balloonTextForLastItem: 'Some preferences are best applied uniformly to all projects, and others are best set by each individual project. If this item is checked, then this preference will be printed in bold and will have a separate value for each project'. aMenu add: 'browse senders' target: Smalltalk selector: #browseAllCallsOn: argument: prefSymbol. aMenu balloonTextForLastItem: 'This will open a method-list browser on all methods that the send the preference "', prefSymbol, '".'. aMenu add: 'show category...' target: self selector: #findCategoryFromPreference: argument: prefSymbol. aMenu balloonTextForLastItem: 'Allows you to find out which category, or categories, this preference belongs to.'. Smalltalk isMorphic ifTrue: [aMenu add: 'hand me a button for this preference' target: self selector: #tearOfButtonFor: argument: prefSymbol. aMenu balloonTextForLastItem: 'Will give you a button that governs this preference, which you may deposit wherever you wish']. aMenu add: 'copy this name to clipboard' target: self selector: #copyNameOf: argument: prefSymbol. aMenu balloonTextForLastItem: 'Copy the name of the preference to the text clipboard, so that you can paste into code somewhere'. aMenu popUpInWorld! ! !PreferencesPanel methodsFor: 'menu commands' stamp: 'sw 2/21/2001 13:56'! copyNameOf: aSymbol "Copy the name of the given preference to the clipboard" Clipboard clipboardText: aSymbol asString asText! ! !PreferencesPanel methodsFor: 'menu commands' stamp: 'sw 2/21/2001 14:12'! tearOfButtonFor: sym "Hand the user a button the can control the given preference" | aButton | aButton _ Preferences buttonRepresenting: sym wording: sym color: self defaultBackgroundColor inPanel: nil. aButton borderWidth: 1; borderColor: Color black; useRoundedCorners. aButton openInHand "PreferencesPanel new tearOfButtonFor: #debugHaloHandle"! !