Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-mt.83.mcz ==================== Summary ==================== Name: HelpSystem-Core-mt.83 Author: mt Time: 17 November 2015, 5:50:09.217 pm UUID: 83730db9-bbb0-4a1e-bcde-60e779900936 Ancestors: HelpSystem-Core-mt.82 Adds support for opening the help browser in a source code-mode. Useful for opening the terse guide. =============== Diff against HelpSystem-Core-mt.82 =============== Item was added: + ----- Method: HelpBrowser class>>openForCodeOn: (in category 'instance creation') ----- + openForCodeOn: aHelpTopic + + | browser window | + browser := (self defaultHelpBrowser new) + rootTopic: aHelpTopic; + yourself. + window := ToolBuilder open: (browser buildForCodeWith: ToolBuilder default). + + ^ window! Item was changed: ----- Method: HelpBrowser class>>openOn: (in category 'instance creation') ----- openOn: aHelpTopic "Open the receiver on the given help topic or any other object that can be transformed into a help topic by sending #asHelpTopic." ^(self defaultHelpBrowser new) rootTopic: aHelpTopic; + open! - open; - yourself! Item was added: + ----- Method: HelpBrowser>>buildCodeContentsWith: (in category 'toolbuilder') ----- + buildCodeContentsWith: builder + + ^ builder pluggableCodePaneSpec new + model: self; + getText: #topicContents; + setText: #accept:; + menu: #codePaneMenu:shifted:; + softLineWrap: false; + frame: (LayoutFrame + fractions: (0.3@0.0 corner: 1@1) + offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0@0)); + yourself! Item was added: + ----- Method: HelpBrowser>>buildContentsWith: (in category 'toolbuilder') ----- + buildContentsWith: builder + + ^ builder pluggableTextSpec new + model: self; + getText: #topicContents; + setText: #accept:; + menu: #codePaneMenu:shifted:; + frame: (LayoutFrame + fractions: (0.3@0.0 corner: 1@1) + offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0@0)); + yourself! Item was added: + ----- Method: HelpBrowser>>buildForCodeWith: (in category 'toolbuilder') ----- + buildForCodeWith: builder + + | windowSpec | + windowSpec := self buildWindowWith: builder. + + windowSpec children + add: (self buildSearchWith: builder); + add: (self buildTreeWith: builder); + add: (self buildCodeContentsWith: builder). + + ^ builder build: windowSpec! Item was added: + ----- Method: HelpBrowser>>buildSearchWith: (in category 'toolbuilder') ----- + buildSearchWith: builder + + ^ builder pluggableInputFieldSpec new + model: self; + getText: #searchTerm; + setText: #searchTerm:; + help: 'Search...'; + frame: (LayoutFrame + fractions: (0@0 corner: 1@0) + offsets: (0@0 corner: 0@ (Preferences standardDefaultTextFont height * 2))); + yourself! Item was added: + ----- Method: HelpBrowser>>buildTreeWith: (in category 'toolbuilder') ----- + buildTreeWith: builder + + ^ builder pluggableTreeSpec new + model: self; + nodeClass: HelpTopicListItemWrapper; + roots: #toplevelTopics; + getSelected: #currentTopic; + setSelected: #currentTopic:; + getSelectedPath: #currentTopicPath; + setSelectedParent: #currentParentTopic:; + autoDeselect: false; + frame: (LayoutFrame + fractions: (0@0 corner: 0.3@1) + offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0@0)); + yourself! Item was added: + ----- Method: HelpBrowser>>buildWindowWith: (in category 'toolbuilder') ----- + buildWindowWith: builder + + ^ builder pluggableWindowSpec new + model: self; + children: OrderedCollection new; + label: #label; + yourself! Item was changed: ----- Method: HelpBrowser>>buildWith: (in category 'toolbuilder') ----- buildWith: builder + | windowSpec | + windowSpec := self buildWindowWith: builder. + + windowSpec children + add: (self buildSearchWith: builder); + add: (self buildTreeWith: builder); + add: (self buildContentsWith: builder). - | windowSpec treeSpec textSpec searchSpec | - windowSpec := builder pluggableWindowSpec new. - windowSpec - model: self; - children: OrderedCollection new; - label: #label. - searchSpec := builder pluggableInputFieldSpec new. - searchSpec - model: self; - getText: #searchTerm; - setText: #searchTerm:; - help: 'Search...'; - frame: (LayoutFrame - fractions: (0@0 corner: 1@0) - offsets: (0@0 corner: 0@ (Preferences standardDefaultTextFont height * 2))). - windowSpec children add: searchSpec. - - treeSpec := builder pluggableTreeSpec new. - treeSpec - model: self; - nodeClass: HelpTopicListItemWrapper; - roots: #toplevelTopics; - getSelected: #currentTopic; - setSelected: #currentTopic:; - getSelectedPath: #currentTopicPath; - setSelectedParent: #currentParentTopic:; - autoDeselect: false; - frame: (LayoutFrame - fractions: (0@0 corner: 0.3@1) - offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0@0)). - windowSpec children add: treeSpec. - - textSpec := builder pluggableTextSpec new. - textSpec - model: self; - getText: #topicContents; - setText: #accept:; - menu: #codePaneMenu:shifted:; - frame: (LayoutFrame - fractions: (0.3@0.0 corner: 1@1) - offsets: (0@ (Preferences standardDefaultTextFont height * 2) corner: 0@0)). - windowSpec children add: textSpec. - ^ builder build: windowSpec! Item was changed: ----- Method: HelpBrowser>>open (in category 'ui') ----- open + ^ ToolBuilder open: self! - ToolBuilder open: self.! |
Free forum by Nabble | Edit this page |