'From Squeak3.1alpha of 28 February 2001 [latest update: #3798] on 6 March 2001 at 2:55:40 pm'! "Change Set: browserBtns-sw Date: 6 March 2001 Author: Scott Wallace Adds an optional button that brings up the selector-list menu to the button pane, if a preference is so set. Adds a preference abbreviatedBrowserButtons which, when set, will result in abbreviated wordings on the optional browser buttons. Eventually we'd like to have these be iconic buttons (even if emblazoned with text) that could freely be configured by the user, but everything in good time."! !CodeHolder methodsFor: 'commands' stamp: 'sw 2/27/2001 19:42'! abbreviatedWordingFor: aButtonSelector "Answer the abbreviated form of wording, from a static table which you're welcome to edit. Answer nil if there is no entry -- in which case the long firm will be used on the corresponding browser button." #( (browseSendersOfMessages 'senders') (browseMessages 'impls') (browseVersions 'versions') (methodHierarchy 'inher') (classHierarchy 'hierch') (browseInstVarRefs 'iVars') (browseClassVarRefs 'cVar') (offerMenu '¯')) do: [:pair | pair first == aButtonSelector ifTrue: [^ pair second]]. ^ nil! ! !CodeHolder methodsFor: 'commands' stamp: 'sw 2/22/2001 13:22'! offerMenu "Offer a menu to the user from the bar of tool buttons" self unshiftedYellowButtonActivity "don't ask"! ! !CodeHolder methodsFor: 'misc' stamp: 'sw 2/27/2001 18:10'! menuButton "Answer a button that brings up a menu. Useful when adding new features, but at present is between uses" | aButton | aButton _ SimpleButtonMorph new target: self. aButton actionSelector: #offerMenu; color: Color transparent. aButton label: (Preferences abbreviatedBrowserButtons ifTrue: [self abbreviatedWordingFor: #offerMenu] ifFalse: ['Menu']). aButton actWhen: #buttonDown. ^ aButton ! ! !Browser methodsFor: 'initialize-release' stamp: 'sw 2/22/2001 13:14'! optionalButtonPairs "Answer a tuple (formerly pairs) defining buttons, in the format: button label selector to send help message" | aList | aList _ #( ('senders' browseSendersOfMessages 'browse senders of...') ('implementors' browseMessages 'browse implementors of...') ('versions' browseVersions 'browse versions')), (Preferences decorateBrowserButtons ifTrue: [{#('inheritance' methodHierarchy 'browse method inheritance green: sends to super tan: has override(s) mauve: both of the above' )}] ifFalse: [{#('inheritance' methodHierarchy 'browse method inheritance')}]), #( ('hierarchy' classHierarchy 'browse class hierarchy') ('inst vars' browseInstVarRefs 'inst var refs...') ('class vars' browseClassVarRefs 'class var refs...')). (Smalltalk isMorphic and: [Preferences menuButtonInToolPane]) ifTrue: [aList _ #(('M' offerMenu 'menu')), aList]. ^ aList! ! "Postscript:" Preferences addPreference: #menuButtonInToolPane category: #browsing default: false balloonHelp: 'when true, button panes in the various tools will sport a button which brings up the message-list menu'. Preferences addPreference: #abbreviatedBrowserButtons category: #browsing default: false balloonHelp: 'when true, abbreviated wordings for the buttons in the optional button panes will be used'. !