'From Moshi of 3 March 2007 [latest update: #496] on 10 December 2007 at 4:32:10 pm'! "Change Set: sketchColor-sw Date: 10 December 2007 Author: Scott Wallace TRAC 5437 - Don't offer the color category in a Sketch's viewer."! !CategoryViewer methodsFor: 'categories' stamp: 'sw 12/10/2007 16:31'! showCategoriesFor: aSymbol "Put up a pop-up list of categories in which aSymbol is filed; replace the receiver with a CategoryViewer for the one the user selects, if any" | allCategories aVocabulary hits meths chosen aMenu aCaption symbolToReport | aVocabulary _ self currentVocabulary. allCategories _ scriptedPlayer categoriesForVocabulary: aVocabulary limitClass: ProtoObject. hits _ allCategories select: [:aCategory | meths _ aVocabulary allMethodsInCategory: aCategory forInstance: scriptedPlayer ofClass: scriptedPlayer class. meths includes: aSymbol]. hits isEmpty ifTrue: [^ self inform: 'this tile is not actually suitable for use with this kind of object' translated]. symbolToReport := (aSymbol beginsWith: 'get') ifTrue: [Utilities inherentSelectorForGetter: aSymbol] ifFalse: [aSymbol]. aMenu := SelectionMenu selections: hits. aCaption := hits size = 1 ifTrue: ['is in the following category' translated] ifFalse: ['can be found in the following categories' translated]. chosen _ aMenu startUpWithCaption: symbolToReport, ' ', aCaption. chosen isEmptyOrNil ifFalse: [self outerViewer addCategoryViewerFor: chosen atEnd: true] ! ! !Player methodsFor: 'slots-kernel' stamp: 'sw 12/10/2007 16:25'! usableMethodInterfacesIn: methodInterfaceList "Filter the list given by methodInterfaceList, to remove items inappropriate to the receiver" self hasCostumeThatIsAWorld ifTrue: "Formerly we had been hugely restrictive here, but let's try the other extreme for a while..." [^ methodInterfaceList reject: [:anInterface | #(getShadowColor getDropShadow getRoundedCorners getBorderStyle getBorderColor getBorderWidth) includes: anInterface selector]]. self hasAnyBorderedCostumes ifTrue: [^ methodInterfaceList]. ^ self hasOnlySketchCostumes ifTrue: [methodInterfaceList select: [:anInterface | (#(getColor getSecondColor getBorderColor getBorderWidth getBorderStyle getRoundedCorners getUseGradientFill getRadialGradientFill getRed getGreen getBlue getAlpha getHue getBrightness getSaturation ) includes: anInterface selector) not]] ifFalse: [methodInterfaceList select: [:anInterface | (#(getBorderColor getBorderWidth) includes: anInterface selector) not]]! ! !SketchMorph methodsFor: 'e-toy support' stamp: 'sw 12/10/2007 16:28'! filterViewerCategoryDictionary: dict "dict has keys of categories and values of priority. You can remove categories here." super filterViewerCategoryDictionary: dict. dict removeKey: #color ifAbsent: []! !