AssistantApplication.st
changeset 3809 3c92fe6d04a5
parent 3808 1addc5e0331e
child 3810 0df3ba9c453a
equal deleted inserted replaced
3808:1addc5e0331e 3809:3c92fe6d04a5
    20     along achain of pages as specified in the AssistantSpec
    20     along achain of pages as specified in the AssistantSpec
    21 
    21 
    22     see stx:doc/coding:DemoAssistant for a demo example.
    22     see stx:doc/coding:DemoAssistant for a demo example.
    23     see ProjectBuilderAssistantApplication for a concrete example.
    23     see ProjectBuilderAssistantApplication for a concrete example.
    24 "
    24 "
       
    25 ! !
       
    26 
       
    27 !AssistantApplication class methodsFor:'help'!
       
    28 
       
    29 flyByHelpSpec
       
    30     <resource: #help>
       
    31 
       
    32     ^ super flyByHelpSpec addPairsFrom:#(
       
    33 
       
    34 #backButton
       
    35 'Navigate to the previous page %(previousPageInfo)'
       
    36 
       
    37 #nextButton
       
    38 'Navigate to the next page %(nextPageInfo)'
       
    39 
       
    40 )
    25 ! !
    41 ! !
    26 
    42 
    27 !AssistantApplication class methodsFor:'image specs'!
    43 !AssistantApplication class methodsFor:'image specs'!
    28 
    44 
    29 bulletIcon
    45 bulletIcon
   120               name: 'ToolBar1'
   136               name: 'ToolBar1'
   121               layout: (LayoutFrame 0 0 0 0 0 1 40 0)
   137               layout: (LayoutFrame 0 0 0 0 0 1 40 0)
   122               menu: toolbarMenu
   138               menu: toolbarMenu
   123               textDefault: true
   139               textDefault: true
   124             )
   140             )
   125            (VariableHorizontalPanelSpec
   141            (ViewSpec
   126               name: 'VariableHorizontalPanel1'
   142               name: 'Box1'
   127               layout: (LayoutFrame 0 0 40 0 0 1 -40 1)
   143               layout: (LayoutFrame 0 0 40 0 0 1 -25 1)
   128               component: 
   144               component: 
   129              (SpecCollection
   145              (SpecCollection
   130                 collection: (
   146                 collection: (
   131                  (SequenceViewSpec
   147                  (VariableHorizontalPanelSpec
   132                     name: 'List1'
   148                     name: 'VariableHorizontalPanel1'
   133                     level: 0
   149                     layout: (LayoutFrame 0 0 0 0 0 1 -40 1)
   134                     enableChannel: false
   150                     component: 
   135                     hasHorizontalScrollBar: true
   151                    (SpecCollection
   136                     hasVerticalScrollBar: true
   152                       collection: (
   137                     useIndex: true
   153                        (SequenceViewSpec
   138                     sequenceList: pageLabelsInList
   154                           name: 'List1'
       
   155                           level: 0
       
   156                           enableChannel: false
       
   157                           hasHorizontalScrollBar: true
       
   158                           hasVerticalScrollBar: true
       
   159                           useIndex: true
       
   160                           sequenceList: pageLabelsInList
       
   161                         )
       
   162                        (SubCanvasSpec
       
   163                           name: 'SubCanvas1'
       
   164                           hasHorizontalScrollBar: false
       
   165                           hasVerticalScrollBar: false
       
   166                           miniScrollerHorizontal: false
       
   167                           miniScrollerVertical: false
       
   168                           specHolder: currentPageSpecHolder
       
   169                           createNewBuilder: false
       
   170                         )
       
   171                        )
       
   172                      
       
   173                     )
       
   174                     handles: (Any 0.5 1.0)
   139                   )
   175                   )
   140                  (SubCanvasSpec
   176                  (HorizontalPanelViewSpec
   141                     name: 'SubCanvas1'
   177                     name: 'ButtonPanel1'
   142                     hasHorizontalScrollBar: false
   178                     layout: (LayoutFrame 0 0 -40 1 0 0.5 0 1)
   143                     hasVerticalScrollBar: false
   179                     horizontalLayout: centerMax
   144                     miniScrollerHorizontal: false
   180                     verticalLayout: center
   145                     miniScrollerVertical: false
   181                     horizontalSpace: 3
   146                     specHolder: currentPageSpecHolder
   182                     verticalSpace: 3
   147                     createNewBuilder: false
   183                     component: 
       
   184                    (SpecCollection
       
   185                       collection: (
       
   186                        (ActionButtonSpec
       
   187                           label: 'Back'
       
   188                           name: 'Button1'
       
   189                           activeHelpKey: backButton
       
   190                           visibilityChannel: backButtonVisible
       
   191                           translateLabel: true
       
   192                           labelChannel: backButtonLabelHolder
       
   193                           model: goBackward
       
   194                           enableChannel: backButtonEnabled
       
   195                           extent: (Point 132 22)
       
   196                         )
       
   197                        (ActionButtonSpec
       
   198                           label: 'Next'
       
   199                           name: 'Button2'
       
   200                           activeHelpKey: nextButton
       
   201                           visibilityChannel: forwardButtonVisible
       
   202                           translateLabel: true
       
   203                           labelChannel: nextButtonLabelHolder
       
   204                           model: goForward
       
   205                           enableChannel: forwardButtonEnabled
       
   206                           extent: (Point 132 22)
       
   207                         )
       
   208                        )
       
   209                      
       
   210                     )
   148                   )
   211                   )
   149                  )
   212                  (HorizontalPanelViewSpec
   150                
   213                     name: 'ButtonPanel2'
   151               )
   214                     layout: (LayoutFrame 0 0.5 -40 1 0 1 0 1)
   152               handles: (Any 0.29962546816479 1.0)
   215                     horizontalLayout: centerMax
   153             )
   216                     verticalLayout: center
   154            (HorizontalPanelViewSpec
   217                     horizontalSpace: 3
   155               name: 'ButtonPanel1'
   218                     verticalSpace: 3
   156               layout: (LayoutFrame 0 0 -40 1 0 0.5 0 1)
   219                     ignoreInvisibleComponents: false
   157               horizontalLayout: centerMax
   220                     component: 
   158               verticalLayout: center
   221                    (SpecCollection
   159               horizontalSpace: 3
   222                       collection: (
   160               verticalSpace: 3
   223                        (ActionButtonSpec
   161               component: 
   224                           label: 'Finish'
   162              (SpecCollection
   225                           name: 'Button7'
   163                 collection: (
   226                           visibilityChannel: finishButtonVisible
   164                  (ActionButtonSpec
   227                           translateLabel: true
   165                     label: 'Back'
   228                           resizeForLabel: true
   166                     name: 'Button1'
   229                           model: doFinish
   167                     visibilityChannel: backButtonVisible
   230                           enableChannel: finishButtonEnabled
   168                     translateLabel: true
   231                           extent: (Point 65 22)
   169                     labelChannel: backButtonLabelHolder
   232                         )
   170                     model: goBackward
   233                        (ActionButtonSpec
   171                     enableChannel: backButtonEnabled
   234                           label: 'Cancel'
   172                     useDefaultExtent: true
   235                           name: 'Button8'
   173                   )
   236                           translateLabel: true
   174                  (ActionButtonSpec
   237                           resizeForLabel: true
   175                     label: 'Next'
   238                           model: doCancel
   176                     name: 'Button2'
   239                           extent: (Point 65 22)
   177                     visibilityChannel: forwardButtonVisible
   240                         )
   178                     translateLabel: true
   241                        )
   179                     labelChannel: nextButtonLabelHolder
   242                      
   180                     model: goForward
   243                     )
   181                     enableChannel: forwardButtonEnabled
       
   182                     useDefaultExtent: true
       
   183                   )
   244                   )
   184                  )
   245                  )
   185                
   246                
   186               )
   247               )
   187             )
   248             )
   188            (HorizontalPanelViewSpec
   249            (LabelSpec
   189               name: 'ButtonPanel2'
   250               label: 'Label'
   190               layout: (LayoutFrame 0 0.5 -40 1 0 1 0 1)
   251               name: 'Label1'
   191               horizontalLayout: centerMax
   252               layout: (LayoutFrame 1 0 -25 1 -1 1 -1 1)
   192               verticalLayout: center
   253               level: -1
   193               horizontalSpace: 3
   254               translateLabel: true
   194               verticalSpace: 3
   255               labelChannel: infoHolder
   195               ignoreInvisibleComponents: false
   256               adjust: left
   196               component: 
       
   197              (SpecCollection
       
   198                 collection: (
       
   199                  (ActionButtonSpec
       
   200                     label: 'Finish'
       
   201                     name: 'Button7'
       
   202                     visibilityChannel: finishButtonVisible
       
   203                     translateLabel: true
       
   204                     resizeForLabel: true
       
   205                     model: doFinish
       
   206                     enableChannel: finishButtonEnabled
       
   207                     useDefaultExtent: true
       
   208                   )
       
   209                  (ActionButtonSpec
       
   210                     label: 'Cancel'
       
   211                     name: 'Button8'
       
   212                     translateLabel: true
       
   213                     resizeForLabel: true
       
   214                     model: doCancel
       
   215                     useDefaultExtent: true
       
   216                   )
       
   217                  )
       
   218                
       
   219               )
       
   220             )
   257             )
   221            )
   258            )
   222          
   259          
   223         )
   260         )
   224       )
   261       )
   522                     ].
   559                     ].
   523                 ].
   560                 ].
   524     ^ newList
   561     ^ newList
   525 ! !
   562 ! !
   526 
   563 
       
   564 !AssistantApplication methodsFor:'help'!
       
   565 
       
   566 flyByHelpTextForKey:aKey
       
   567     <resource: #help>
       
   568 
       
   569     |text bindings nextSpec prevSpec|
       
   570 
       
   571     text := super flyByHelpTextForKey:aKey.
       
   572 
       
   573     nextSpec := self nextEnabledPageSpec.
       
   574     prevSpec := self previousEnabledPageSpec.
       
   575 
       
   576     bindings := Dictionary new.
       
   577     bindings 
       
   578         at:#'previousPageInfo' 
       
   579         put:(prevSpec notNil ifTrue:[ '"',prevSpec pageTitle,'"' ] ifFalse:['']).
       
   580     bindings 
       
   581         at:#'nextPageInfo'
       
   582         put:(nextSpec notNil ifTrue:[ '"',nextSpec pageTitle,'"' ] ifFalse:['']).
       
   583 
       
   584     ^ self resources string:text withArgs:bindings.    
       
   585 ! !
       
   586 
   527 !AssistantApplication methodsFor:'initialization & release'!
   587 !AssistantApplication methodsFor:'initialization & release'!
   528 
   588 
   529 postBuildWith:aBuilder
   589 postBuildWith:aBuilder
   530     |maxCanvasExtent|
   590     |maxCanvasExtent|
   531 
   591 
   685 ! !
   745 ! !
   686 
   746 
   687 !AssistantApplication class methodsFor:'documentation'!
   747 !AssistantApplication class methodsFor:'documentation'!
   688 
   748 
   689 version_CVS
   749 version_CVS
   690     ^ '$Header: /cvs/stx/stx/libwidg2/AssistantApplication.st,v 1.6 2009-10-20 22:23:27 cg Exp $'
   750     ^ '$Header: /cvs/stx/stx/libwidg2/AssistantApplication.st,v 1.7 2009-10-21 13:32:50 cg Exp $'
   691 ! !
   751 ! !