'From etoys2.2 of 21 September 2007 [latest update: #1694] on 12 October 2007 at 11:20:36 am'! "Change Set: QuickIndex3-tk Date: 12 October 2007 Author: Ted Kaehler Changed the way names of guides are displayed: Top of Guide: You are allowed to put whatever you want here. What you have been doing is great: Category name, colon, a detailed name of this topic. It may be longer than the title at the bottom. Name at bottom between the prev and next arrows: This will automatically be determined by the .pr name. My program will take the .pr name, remove the category, and put spaces between the words. All you have to do is set the .pr file name. (I will remove any digits after the name. I will remove the version .005 also) Name in the Jump To list: This will be identical to the name at the bottom (that is, when that guide is showing). The same as I generate from the .pr file name. So, all you have to do is adjust .pr file name. Only change the part between the Category name (Books) and the dot. Also sped up menu generation. It now searches the pages, not the directory on the disk. To force it to look at the files on the disk, close help and open again by pressing help button in Sugar bar. Jump To menu is now displayed in the Guide, not off the bottom of the guide. "! PasteUpMorph subclass: #QuickGuideHolderMorph instanceVariableNames: 'guideName guideCategory guideNameInWords ' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Books'! !QuickGuideHolderMorph methodsFor: 'initialization' stamp: 'tk 10/11/2007 22:28'! setGuideWordyName "With guideName and category already filled in, make a name in words. Remove the cat name, and trailing digits. Separate words at capital letters. NavBarHowToUse3 -> 'How To Use' " | gn mm tt | guideCategory _ QuickGuideMorph categoryOf: guideName. gn _ guideName allButFirst: guideCategory size. gn _ gn withoutTrailingDigits. mm _ gn size. gn reversed doWithIndex: [:cc :ind | ind < mm ifTrue: [ cc isUppercase ifTrue: [ tt _ mm + 1 - ind. gn _ (gn copyFrom: 1 to: tt-1), ' ', (gn copyFrom: tt to: gn size)]]]. ^ guideNameInWords _ gn! ! !QuickGuideHolderMorph methodsFor: 'accessing' stamp: 'tk 10/11/2007 21:57'! guideCategory "Answer the value of guideCategory" ^ guideCategory! ! !QuickGuideHolderMorph methodsFor: 'accessing' stamp: 'tk 10/11/2007 21:57'! guideCategory: anObject "Set the value of guideCategory" guideCategory _ anObject! ! !QuickGuideHolderMorph methodsFor: 'accessing' stamp: 'tk 10/11/2007 21:57'! guideNameInWords "Answer the value of guideNameInWords" ^ guideNameInWords! ! !QuickGuideHolderMorph methodsFor: 'accessing' stamp: 'tk 10/11/2007 21:57'! guideNameInWords: anObject "Set the value of guideNameInWords" guideNameInWords _ anObject! ! !QuickGuideHolderMorph methodsFor: 'accessing' stamp: 'tk 10/11/2007 21:46'! guideName: aString guideName _ aString. self setGuideWordyName. self setNamePropertyTo: aString. ! ! !QuickGuideMorph methodsFor: 'menu actions' stamp: 'tk 10/11/2007 21:58'! descriptionReport ^ currentPage guideNameInWords ! ! !QuickGuideMorph methodsFor: 'menu actions' stamp: 'tk 10/12/2007 10:19'! makeCategoryMenu: catName "return a menu with all guides in this category. No title" | subMenu | subMenu _ MenuMorph new defaultTarget: self. pages do: [:pp | pp guideCategory = catName ifTrue: [ subMenu add: pp guideNameInWords translated target: self selector: #goToCardNamed: argument: pp guideName]]. ^ subMenu! ! !QuickGuideMorph methodsFor: 'menu actions' stamp: 'tk 10/12/2007 11:18'! showDescriptionMenu: evt "The Jump To menu. Choose a guide to see next" | aMenu categories subMenu aWorld pos | aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: 'Quick Guides' translated. categories _ self class suggestedCategoryOrder. categories do: [:catName | subMenu _ self makeCategoryMenu: catName. subMenu items ifNotEmpty: [aMenu add: catName translated subMenu: subMenu]]. aMenu add: 'Index' translated action: #goToIndex. aWorld _ aMenu currentWorld. pos _ aWorld primaryHand position - (aMenu fullBounds extent) + (-2@30). aMenu popUpAt: pos forHand: aWorld primaryHand in: aWorld. ! ! !QuickGuideMorph methodsFor: 'menu actions' stamp: 'tk 10/12/2007 10:17'! showMenuCategory: catName "put up a menu with all guides in this category" | subMenu | subMenu _ self makeCategoryMenu: catName. subMenu addTitle: catName translated. subMenu popUpInWorld.! ! PasteUpMorph subclass: #QuickGuideHolderMorph instanceVariableNames: 'guideName guideNameInWords guideCategory' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Books'! "Postscript: If the Help flap is present (with the guide pages), remove it. QuickGuideMorph now has two extra inst vars that must not be nil." | ref f guide | f _ Flaps globalFlapTab: 'Help' translated. f ifNotNil: [ f isInWorld ifTrue: [ref _ f referent. ref ifNotNil: [guide _ ref findDeeplyA: QuickGuideMorph]. guide ifNotNil: [guide unloadPages]. Flaps removeFlapTab: f keepInList: false]]. !