TabListEditor.st
changeset 1183 ee9956e2689b
parent 1145 8d3ca8f7bb71
child 1245 fd0127c25b66
equal deleted inserted replaced
1182:ad878ef29fa7 1183:ee9956e2689b
   117 
   117 
   118 #addTabItem
   118 #addTabItem
   119 'Adds a new tab item.'
   119 'Adds a new tab item.'
   120 
   120 
   121 #argument
   121 #argument
   122 'An argument not explicitly used by the tab item.'
   122 'An optional argument stored with the tab item.'
   123 
   123 
   124 #canSelect
   124 #canSelect
   125 'Turns on/off whether the tab item is selectable.'
   125 'Turns on/off whether the tab item is selectable.'
   126 
   126 
   127 #color
   127 #color
   184      TabListEditor new openInterface:#tabSpec
   184      TabListEditor new openInterface:#tabSpec
   185     "
   185     "
   186 
   186 
   187     <resource: #canvas>
   187     <resource: #canvas>
   188 
   188 
   189     ^
   189     ^ 
   190      
   190      #(#FullSpec
   191        #(#FullSpec
   191         #name: #tabSpec
   192           #window: 
   192         #window: 
   193            #(#WindowSpec
   193        #(#WindowSpec
   194               #name: 'Tab Basic'
   194           #label: 'Tab Basic'
   195               #layout: #(#LayoutFrame 463 0 289 0 825 0 514 0)
   195           #name: 'Tab Basic'
   196               #label: 'Tab Basic'
   196           #layout: #(#LayoutFrame 220 0 200 0 634 0 425 0)
   197               #min: #(#Point 10 10)
   197           #min: #(#Point 10 10)
   198               #max: #(#Point 1280 1024)
   198           #max: #(#Point 1280 1024)
   199               #bounds: #(#Rectangle 463 289 826 515)
   199           #bounds: #(#Rectangle 220 200 635 426)
   200               #usePreferredExtent: false
   200         )
   201           )
   201         #component: 
   202           #component: 
   202        #(#SpecCollection
   203            #(#SpecCollection
   203           #collection: #(
   204               #collection: 
   204            #(#LabelSpec
   205                #(
   205               #label: 'Label:'
   206                  #(#LabelSpec
   206               #name: 'Label'
   207                     #name: 'Label'
   207               #layout: #(#AlignmentOrigin 98 0 26 0 1 0.5)
   208                     #layout: #(#AlignmentOrigin 98 0 26 0 1 0.5)
   208               #resizeForLabel: true
   209                     #label: 'Label:'
   209             )
   210                     #resizeForLabel: true
   210            #(#InputFieldSpec
   211                 )
   211               #name: 'LabelField'
   212                  #(#InputFieldSpec
   212               #layout: #(#LayoutFrame 100 0 15 0 -5 1.0 37 0)
   213                     #name: 'LabelField'
   213               #activeHelpKey: #label
   214                     #layout: #(#LayoutFrame 100 0 15 0 -5 1.0 37 0)
   214               #model: #label
   215                     #activeHelpKey: #label
   215               #acceptOnLostFocus: true
   216                     #model: #label
   216               #acceptChannel: #acceptChannel
   217                               #modifiedChannel: #modifiedChannel
   217               #modifiedChannel: #modifiedChannel
   218                               #acceptChannel: #acceptChannel
   218               #acceptOnPointerLeave: false
   219                               #acceptOnLostFocus: true
   219             )
   220                 )
   220            #(#CheckBoxSpec
   221                  #(#CheckBoxSpec
   221               #label: 'Application provides translation '
   222                     #name: 'TranslateLabel'
   222               #name: 'TranslateLabel'
   223                     #layout: #(#LayoutFrame 100 0 40 0 -5 1 66 0)
   223               #layout: #(#LayoutFrame 59 0 45 0 -8 1 71 0)
   224                     #activeHelpKey: #labelDerivesFromApplication
   224               #activeHelpKey: #labelDerivesFromApplication
   225                     #model: #translateLabel
   225               #model: #translateLabel
   226                     #label: 'Label derives from Application'
   226             )
   227                 )
   227            #(#LabelSpec
   228                  #(#LabelSpec
   228               #label: 'Argument:'
   229                     #name: 'ArgumentLabel'
   229               #name: 'ArgumentLabel'
   230                     #layout: #(#AlignmentOrigin 98 0 81 0 1 0.5)
   230               #layout: #(#AlignmentOrigin 98 0 182 0 1 0.5)
   231                     #label: 'Argument:'
   231               #resizeForLabel: true
   232                     #resizeForLabel: true
   232             )
   233                 )
   233            #(#InputFieldSpec
   234                  #(#InputFieldSpec
   234               #name: 'ArgumentField'
   235                     #name: 'ArgumentField'
   235               #layout: #(#LayoutFrame 100 0 171 0 -5 1.0 193 0)
   236                     #layout: #(#LayoutFrame 100 0 70 0 -5 1.0 92 0)
   236               #activeHelpKey: #argument
   237                     #activeHelpKey: #argument
   237               #model: #editAgument
   238                     #model: #editAgument
   238               #acceptOnLostFocus: true
   239                               #modifiedChannel: #modifiedChannel
   239               #acceptChannel: #acceptChannel
   240                               #acceptChannel: #acceptChannel
   240               #modifiedChannel: #modifiedChannel
   241                               #acceptOnLostFocus: true
   241               #acceptOnPointerLeave: false
   242                 )
   242             )
   243                  #(#LabelSpec
   243            #(#LabelSpec
   244                     #name: 'ForegroundLabel'
   244               #label: 'Color:'
   245                     #layout: #(#AlignmentOrigin 98 0 115 0 1 0.5)
   245               #name: 'ForegroundLabel'
   246                     #label: 'Color:'
   246               #layout: #(#AlignmentOrigin 98 0 91 0 1 0.5)
   247                     #adjust: #right
   247               #resizeForLabel: true
   248                     #resizeForLabel: true
   248               #adjust: #right
   249                 )
   249             )
   250                  #(#ColorMenuSpec
   250            #(#ColorMenuSpec
   251                     #name: 'ForegroundColorMenu'
   251               #name: 'ForegroundColorMenu'
   252                     #layout: #(#LayoutFrame 100 0 103 0 -5 1.0 125 0)
   252               #layout: #(#LayoutFrame 100 0 79 0 -5 1.0 101 0)
   253                     #activeHelpKey: #color
   253               #activeHelpKey: #color
   254                     #model: #labelForegroundColor
   254               #model: #labelForegroundColor
   255                     #labelsAreColored: false
   255               #labelsAreColored: false
   256                 )
   256             )
   257                  #(#CheckBoxSpec
   257            #(#CheckBoxSpec
   258                     #name: 'CanSelect'
   258               #label: 'Can Select'
   259                     #layout: #(#LayoutFrame 100 0 135 0 -5 1 157 0)
   259               #name: 'CanSelect'
   260                     #activeHelpKey: #canSelect
   260               #layout: #(#LayoutFrame 59 0 110 0 -8 1 132 0)
   261                     #model: #enabled
   261               #activeHelpKey: #canSelect
   262                     #label: 'Can Select'
   262               #model: #enabled
   263                 )
   263             )
   264               )
   264            )
   265           )
   265          
       
   266         )
   266       )
   267       )
   267 !
   268 !
   268 
   269 
   269 windowSpec
   270 windowSpec
   270     "This resource specification was automatically generated
   271     "This resource specification was automatically generated
   279      TabListEditor open
   280      TabListEditor open
   280     "
   281     "
   281 
   282 
   282     <resource: #canvas>
   283     <resource: #canvas>
   283 
   284 
   284     ^
   285     ^ 
   285      
   286      #(#FullSpec
   286        #(#FullSpec
   287         #name: #windowSpec
   287           #window: 
   288         #window: 
   288            #(#WindowSpec
   289        #(#WindowSpec
   289               #name: 'Tab List Editor'
   290           #label: 'Tab List Editor'
   290               #layout: #(#LayoutFrame 117 0 340 0 586 0 669 0)
   291           #name: 'Tab List Editor'
   291               #label: 'Tab List Editor'
   292           #layout: #(#LayoutFrame 58 0 290 0 659 0 707 0)
   292               #min: #(#Point 440 280)
   293           #min: #(#Point 440 280)
   293               #max: #(#Point 1152 900)
   294           #max: #(#Point 1152 900)
   294               #bounds: #(#Rectangle 117 340 587 670)
   295           #bounds: #(#Rectangle 58 290 660 708)
   295               #menu: #menu
   296           #menu: #menu
   296               #usePreferredExtent: false
   297         )
   297           )
   298         #component: 
   298           #component: 
   299        #(#SpecCollection
   299            #(#SpecCollection
   300           #collection: #(
   300               #collection: 
   301            #(#MenuPanelSpec
   301                #(
   302               #name: 'menuToolbarView'
   302                  #(#MenuPanelSpec
   303               #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
   303                     #name: 'menuToolbarView'
   304               #menu: #menuToolbar
   304                     #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
   305               #showSeparatingLines: true
   305                     #menu: #menuToolbar
   306             )
   306                     #showSeparatingLines: true
   307            #(#VariableHorizontalPanelSpec
   307                 )
   308               #name: 'VariablePanel'
   308                  #(#VariableHorizontalPanelSpec
   309               #layout: #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0)
   309                     #name: 'VariablePanel'
   310               #handles: #(#Any 0.259875 1.0)
   310                     #layout: #(#LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0)
   311               #component: 
       
   312              #(#SpecCollection
       
   313                 #collection: #(
       
   314                  #(#SequenceViewSpec
       
   315                     #name: 'ColumnView'
       
   316                     #model: #selectionHolder
       
   317                     #menu: #menuEdit
       
   318                     #hasHorizontalScrollBar: true
       
   319                     #hasVerticalScrollBar: true
       
   320                     #miniScrollerHorizontal: true
       
   321                     #useIndex: true
       
   322                     #sequenceList: #listOfLabels
       
   323                   )
       
   324                  #(#ViewSpec
       
   325                     #name: 'SpecView'
       
   326                     #level: -1
   311                     #component: 
   327                     #component: 
   312                      #(#SpecCollection
   328                    #(#SpecCollection
   313                         #collection: 
   329                       #collection: #(
   314                          #(
   330                        #(#ViewSpec
   315                            #(#SequenceViewSpec
   331                           #name: 'TestView'
   316                               #name: 'ColumnView'
   332                           #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 0 1.0)
   317                               #model: #selectionHolder
   333                           #component: 
   318                               #menu: #menuEdit
   334                          #(#SpecCollection
   319                               #hasHorizontalScrollBar: true
   335                             #collection: #(
   320                               #hasVerticalScrollBar: true
   336                              #(#TabViewSpec
   321                               #miniScrollerHorizontal: true
   337                                 #name: 'TestTabsView'
   322                               #useIndex: true
   338                                 #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 0.5)
   323                               #sequenceList: #listOfLabels
       
   324                           )
       
   325                            #(#ViewSpec
       
   326                               #name: 'SpecView'
       
   327                               #component: 
       
   328                                #(#SpecCollection
       
   329                                   #collection: 
       
   330                                    #(
       
   331                                      #(#ViewSpec
       
   332                                         #name: 'TestView'
       
   333                                         #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 0 1.0)
       
   334                                         #component: 
       
   335                                          #(#SpecCollection
       
   336                                             #collection: 
       
   337                                              #(
       
   338                                                #(#TabViewSpec
       
   339                                                   #name: 'TestTabsView'
       
   340                                                   #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 0.5)
       
   341                                               )
       
   342                                             )
       
   343                                         )
       
   344                                     )
       
   345                                      #(#SubCanvasSpec
       
   346                                         #name: 'specCanvas'
       
   347                                         #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -30 1.0)
       
   348                                         #specHolder: #specChannel
       
   349                                     )
       
   350                                      #(#UISubSpecification
       
   351                                         #name: 'subSpec'
       
   352                                         #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1)
       
   353                                         #majorKey: #ToolApplicationModel
       
   354                                         #minorKey: #windowSpecForCommit
       
   355                                     )
       
   356                                   )
       
   357                               )
   339                               )
   358                               #level: -1
   340                              )
       
   341                            
   359                           )
   342                           )
   360                         )
   343                         )
       
   344                        #(#SubCanvasSpec
       
   345                           #name: 'specCanvas'
       
   346                           #layout: #(#LayoutFrame 1 0.0 0 0.0 0 1.0 -30 1.0)
       
   347                           #specHolder: #specChannel
       
   348                         )
       
   349                        #(#UISubSpecification
       
   350                           #name: 'subSpec'
       
   351                           #layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1)
       
   352                           #majorKey: #ToolApplicationModel
       
   353                           #minorKey: #windowSpecForCommit
       
   354                         )
       
   355                        )
       
   356                      
   361                     )
   357                     )
   362                     #handles: #(#Any 0.259875 1.0)
   358                   )
   363                 )
   359                  )
   364                  #(#UISubSpecification
   360                
   365                     #name: 'infoBarSubSpec'
       
   366                     #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
       
   367                     #majorKey: #ToolApplicationModel
       
   368                     #minorKey: #windowSpecForInfoBar
       
   369                 )
       
   370               )
   361               )
   371           )
   362             )
       
   363            #(#UISubSpecification
       
   364               #name: 'infoBarSubSpec'
       
   365               #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
       
   366               #majorKey: #ToolApplicationModel
       
   367               #minorKey: #windowSpecForInfoBar
       
   368             )
       
   369            )
       
   370          
       
   371         )
   372       )
   372       )
   373 ! !
   373 ! !
   374 
   374 
   375 !TabListEditor class methodsFor:'menu specs'!
   375 !TabListEditor class methodsFor:'menu specs'!
   376 
   376 
   737 !
   737 !
   738 
   738 
   739 listOfLabels
   739 listOfLabels
   740     "returns a holder which keeps the list of tab labels
   740     "returns a holder which keeps the list of tab labels
   741     "
   741     "
   742     |list|
   742 
   743 
   743     ^ builder listAspectFor:#listOfLabels
   744     (list := builder bindingAt:#listOfLabels) isNil ifTrue:[
       
   745         builder aspectAt:#listOfLabels put:(list :=  List new).
       
   746     ].
       
   747     ^ list
       
   748 !
   744 !
   749 
   745 
   750 selectionHolder
   746 selectionHolder
   751     "holder which keeps the current selection
   747     "holder which keeps the current selection
   752     "
   748     "