TabListEditor.st
author Claus Gittinger <cg@exept.de>
Tue, 14 May 2019 09:46:21 +0200
changeset 3663 9d49ecf8661a
parent 3590 885f170ab630
permissions -rw-r--r--
#UI_ENHANCEMENT by cg
class: TabListEditor class
changed:
#canvasSpec
#menu
#windowSpec
tz@739
     1
"
tz@739
     2
 COPYRIGHT (c) 1997 by eXept Software AG
tz@739
     3
              All Rights Reserved
tz@739
     4
tz@739
     5
 This software is furnished under a license and may be used
tz@739
     6
 only in accordance with the terms of that license and with the
tz@739
     7
 inclusion of the above copyright notice. This software may not
tz@739
     8
 be provided or otherwise made available to, or used by, any
tz@739
     9
 other person.  No title to or ownership of the software is
tz@739
    10
 hereby transferred.
tz@739
    11
"
ca@1431
    12
"{ Package: 'stx:libtool2' }"
ca@1373
    13
sv@3330
    14
"{ NameSpace: Smalltalk }"
sv@3330
    15
tz@739
    16
ResourceSpecEditor subclass:#TabListEditor
ca@1373
    17
	instanceVariableNames:'listOfTabs'
tz@739
    18
	classVariableNames:''
tz@739
    19
	poolDictionaries:''
tz@739
    20
	category:'Interface-UIPainter'
tz@739
    21
!
tz@739
    22
tz@739
    23
!TabListEditor class methodsFor:'documentation'!
tz@739
    24
tz@739
    25
copyright
tz@739
    26
"
tz@739
    27
 COPYRIGHT (c) 1997 by eXept Software AG
tz@739
    28
              All Rights Reserved
tz@739
    29
tz@739
    30
 This software is furnished under a license and may be used
tz@739
    31
 only in accordance with the terms of that license and with the
tz@739
    32
 inclusion of the above copyright notice. This software may not
tz@739
    33
 be provided or otherwise made available to, or used by, any
tz@739
    34
 other person.  No title to or ownership of the software is
tz@739
    35
 hereby transferred.
tz@739
    36
"
tz@739
    37
tz@739
    38
tz@739
    39
!
tz@739
    40
tz@739
    41
documentation
tz@739
    42
"
tz@739
    43
    The TabListEditor allows you to create, modify or just inspect
tz@739
    44
    tab lists for tab headers or note books.
tz@739
    45
tz@739
    46
    [start with:]
tz@739
    47
        TabItemEditor open
tz@739
    48
tz@739
    49
    [see also:]
tz@739
    50
        TabItem
tz@739
    51
        TabView
tz@739
    52
        NoteBookView
tz@739
    53
        UIPainter
tz@739
    54
tz@739
    55
    [author:]
tz@739
    56
        Claus Atzkern, eXept Software AG
tz@749
    57
        Thomas Zwick, eXept Software AG
tz@739
    58
"
tz@739
    59
tz@739
    60
tz@739
    61
! !
tz@739
    62
tz@739
    63
!TabListEditor class methodsFor:'instance creation'!
tz@739
    64
tz@739
    65
openModalOnTabList: aTabList
tz@739
    66
    "Open a TabListEditor modal on aTabList"
tz@739
    67
    "self openModalOnTabList: (Array with: (TabItem label: 'Tab Item 1'))"
tz@739
    68
tz@739
    69
    ^self new openModalOnTabList: aTabList
tz@739
    70
tz@739
    71
! !
tz@739
    72
tz@739
    73
!TabListEditor class methodsFor:'accessing'!
tz@739
    74
tz@739
    75
resourceType
tz@739
    76
    "get the type of resource of the method generated by the TabListEditor"
tz@739
    77
tz@739
    78
    ^#tabList
tz@739
    79
tz@739
    80
tz@739
    81
tz@739
    82
tz@739
    83
tz@739
    84
tz@739
    85
! !
tz@739
    86
tz@739
    87
!TabListEditor class methodsFor:'aspects'!
tz@739
    88
tz@739
    89
aspects
tz@739
    90
    "get the aspects for the attributes of the tab list components"
tz@739
    91
tz@739
    92
    ^#(
tz@739
    93
        label
tz@739
    94
        translateLabel
tz@739
    95
        labelForegroundColor
tz@739
    96
        enabled
tz@739
    97
        editAgument
ca@1325
    98
        accessCharacterPosition
ca@1325
    99
        shortcutKey
ca@1373
   100
        activeHelpKey
ca@1373
   101
ca@1373
   102
        majorKey
ca@1373
   103
        minorKey
ca@1373
   104
        createNewBuilder
ca@1373
   105
ca@1373
   106
        hasHorizontalScrollBar
ca@1373
   107
        hasVerticalScrollBar
ca@1373
   108
        miniScrollerHorizontal
ca@1373
   109
        miniScrollerVertical
tz@739
   110
    )
tz@739
   111
tz@739
   112
! !
tz@739
   113
tz@739
   114
!TabListEditor class methodsFor:'help specs'!
tz@739
   115
tz@739
   116
helpSpec
tz@739
   117
    "This resource specification was automatically generated
tz@739
   118
     by the UIHelpTool of ST/X."
tz@739
   119
tz@739
   120
    "Do not manually edit this!! If it is corrupted,
tz@739
   121
     the UIHelpTool may not be able to read the specification."
tz@739
   122
tz@739
   123
    "
tz@739
   124
     UIHelpTool openOnClass:TabListEditor    
tz@739
   125
    "
tz@739
   126
tz@739
   127
    <resource: #help>
tz@739
   128
ca@1845
   129
    ^ super helpSpec addPairsFrom:#(
tz@739
   130
tz@739
   131
#addTabItem
tz@739
   132
'Adds a new tab item.'
tz@739
   133
cg@2346
   134
#applicationProvidesLabel
cg@2346
   135
'If on, the label''s string is a selector returning a string or bitmap image, which is used as logo in the tab item.'
cg@2346
   136
ca@1373
   137
#autoHideScrollBars
ca@1373
   138
'ScrollBars should be made invisible dynamically, if there is nothing to scroll.'
tz@739
   139
ca@1845
   140
#basicTab
ca@1845
   141
'Define the basic attributes.'
ca@1845
   142
tz@739
   143
#canSelect
tz@739
   144
'Turns on/off whether the tab item is selectable.'
tz@739
   145
ca@1845
   146
#canvasTab
ca@1845
   147
'Define an application, which is started if the tab is pressed the first time.'
ca@1845
   148
ca@1845
   149
#color
ca@1845
   150
'Defines the foreground color of the label. The default color derives from the style sheet.'
ca@1845
   151
ca@1373
   152
#createNewBuilder
ca@1373
   153
'Create a new builder for the application; the application use its own aspects.'
ca@1373
   154
ca@1845
   155
#detailTab
ca@1845
   156
'Define the optional/specific attributes.'
ca@1845
   157
ca@1845
   158
#detailsAccelerator
ca@1845
   159
'Key to be pressed to select the tab item from the keyboard (accelerator key).'
ca@1845
   160
ca@1845
   161
#detailsAccessCharaterPosition
ca@1845
   162
'Index of the access character position of the textual label (optional).'
ca@1845
   163
ca@1845
   164
#detailsArgument
ca@1845
   165
'An optional argument stored with the tab item.'
tz@739
   166
tz@739
   167
#fileCreateAspectMethod
tz@739
   168
'Creates the aspect method for the tab list.'
tz@739
   169
tz@739
   170
#fileLoad
tz@739
   171
'Opens a dialog for selecting and loading a tab list spec from a class.'
tz@739
   172
tz@739
   173
#fileNew
tz@739
   174
'Creates a new tab list.'
tz@739
   175
tz@739
   176
#fileSave
tz@739
   177
'Saves current tab list.'
tz@739
   178
ca@1373
   179
#horizontalMiniScroller
ca@1373
   180
'Use a mini-scroller as horizontal scrollbar.'
ca@1373
   181
ca@1845
   182
#horizontalScroller
ca@1845
   183
'Enable horizontal scrollability.'
ca@1373
   184
tz@739
   185
#label
tz@739
   186
'Label of the tab item.'
tz@739
   187
ca@1845
   188
#majorKey
ca@1845
   189
'Name of the class to be started (application if empty); or app-selector returning application instance.'
ca@1373
   190
ca@1845
   191
#minorKey
ca@1845
   192
'Message sent to the class which returns the window specification (default: #windowSpec).'
ca@1373
   193
tz@739
   194
#testPreview
tz@739
   195
'Turns on/off preview of the tab list.'
tz@739
   196
cg@2346
   197
#translateLabel
cg@2346
   198
'If on, the label is translated using the applications language resources.'
cg@2346
   199
ca@1845
   200
#verticalMiniScroller
ca@1845
   201
'Use a mini-scroller as vertical scrollbar.'
ca@1845
   202
ca@1845
   203
#verticalScroller
ca@1845
   204
'Enable vertical scrollability.'
ca@1845
   205
tz@739
   206
)
tz@739
   207
! !
tz@739
   208
tz@739
   209
!TabListEditor class methodsFor:'image specs'!
tz@739
   210
tz@739
   211
newTabItemIcon
sv@3118
   212
    <resource: #image>
tz@739
   213
    "This resource specification was automatically generated
tz@739
   214
     by the ImageEditor of ST/X."
tz@739
   215
    "Do not manually edit this!!!! If it is corrupted,
tz@739
   216
     the ImageEditor may not be able to read the specification."
tz@739
   217
    "
sv@3118
   218
     ImageEditor openOnClass:self andSelector:#newTabItemIcon"
sv@3118
   219
    
sv@3118
   220
    ^ Icon constantNamed:#'TabListEditor newTabItemIcon'
sv@3118
   221
        ifAbsentPut:[
sv@3118
   222
            (Depth2Image new)
sv@3118
   223
                width:22;
sv@3118
   224
                height:22;
sv@3118
   225
                photometric:(#palette);
sv@3118
   226
                bitsPerSample:(#( 2 ));
sv@3118
   227
                samplesPerPixel:(1);
sv@3118
   228
                bits:(ByteArray 
sv@3118
   229
                            fromPackedString:'U@@@@EUPUEUUVEUPUF**+EUPUF**+EUPUF**+EUP@F**+@@@EV***UV@F*****+@F KNC*+NF(("H*+@F((BC +EF(("H*+@F(("C*+MF*****+@F"@ H*K@F"""(LK@F"" ("K@F"""(*K@F"" H*K@F*****+HK??????@@@@@@@@@');
sv@3118
   230
                colorMapFromArray:#[ 0 0 0 255 255 255 170 170 170 127 127 127 ];
sv@3118
   231
                mask:((ImageMask new)
sv@3118
   232
                            width:22;
sv@3118
   233
                            height:22;
sv@3118
   234
                            bits:(ByteArray 
sv@3118
   235
                                        fromPackedString:'G?<@G?<@G?<@G?<@G?<@???<???<???<???????<???<???<???<???????=???<???????<???????<???<???=');
sv@3118
   236
                            yourself);
sv@3118
   237
                yourself
sv@3118
   238
        ]
ca@1431
   239
! !
tz@739
   240
tz@739
   241
!TabListEditor class methodsFor:'interface specs'!
tz@739
   242
ca@1373
   243
basicSpec
tz@739
   244
    "This resource specification was automatically generated
tz@739
   245
     by the UIPainter of ST/X."
tz@739
   246
tz@739
   247
    "Do not manually edit this!! If it is corrupted,
tz@739
   248
     the UIPainter may not be able to read the specification."
tz@739
   249
tz@739
   250
    "
ca@1373
   251
     UIPainter new openOnClass:TabListEditor andSelector:#basicSpec
ca@1373
   252
     TabListEditor new openInterface:#basicSpec
tz@739
   253
    "
tz@739
   254
tz@739
   255
    <resource: #canvas>
tz@739
   256
cg@1183
   257
    ^ 
cg@1876
   258
     #(FullSpec
cg@1876
   259
        name: basicSpec
cg@1876
   260
        window: 
cg@1876
   261
       (WindowSpec
cg@1876
   262
          label: 'Basic'
cg@1876
   263
          name: 'Basic'
cg@1876
   264
          min: (Point 10 10)
cg@1876
   265
          max: (Point 1280 1024)
cg@2346
   266
          bounds: (Rectangle 0 0 429 240)
cg@1183
   267
        )
cg@1876
   268
        component: 
cg@1876
   269
       (SpecCollection
cg@1876
   270
          collection: (
cg@1876
   271
           (LabelSpec
cg@1876
   272
              label: 'Label:'
cg@1876
   273
              name: 'labelLabel'
cg@1876
   274
              layout: (AlignmentOrigin 98 0 26 0 1 0.5)
cg@1876
   275
              translateLabel: true
cg@1876
   276
              resizeForLabel: true
cg@1183
   277
            )
cg@1876
   278
           (InputFieldSpec
cg@1876
   279
              name: 'label'
cg@1876
   280
              layout: (LayoutFrame 100 0 15 0 -5 1.0 37 0)
cg@1876
   281
              activeHelpKey: label
cg@1876
   282
              tabable: true
cg@1876
   283
              model: label
cg@1876
   284
              group: inputGroup
cg@1876
   285
              immediateAccept: true
cg@1876
   286
              acceptOnReturn: false
cg@1876
   287
              acceptOnTab: false
cg@1876
   288
              acceptOnLostFocus: false
cg@1876
   289
              acceptChannel: acceptChannel
cg@1876
   290
              modifiedChannel: modifiedChannel
cg@1876
   291
              acceptOnPointerLeave: false
ca@1325
   292
            )
cg@1876
   293
           (LabelSpec
cg@1876
   294
              label: 'Accelerator:'
cg@1876
   295
              name: 'shortcutKeyLabel'
cg@1876
   296
              layout: (AlignmentOrigin 98 0 55 0 1 0.5)
cg@1876
   297
              translateLabel: true
cg@1876
   298
              resizeForLabel: true
ca@1325
   299
            )
cg@1876
   300
           (InputFieldSpec
cg@1876
   301
              name: 'shortcutKey'
cg@1876
   302
              layout: (LayoutFrame 100 0 44 0 -5 1.0 66 0)
cg@1876
   303
              activeHelpKey: detailsAccelerator
cg@1876
   304
              tabable: true
cg@1876
   305
              model: shortcutKey
cg@1876
   306
              group: inputGroup
cg@1876
   307
              type: symbolOrNil
cg@1876
   308
              immediateAccept: true
cg@1876
   309
              acceptOnReturn: false
cg@1876
   310
              acceptOnTab: false
cg@1876
   311
              acceptOnLostFocus: false
cg@1876
   312
              acceptChannel: acceptChannel
cg@1876
   313
              modifiedChannel: modifiedChannel
cg@1876
   314
              acceptOnPointerLeave: false
ca@1325
   315
            )
cg@1876
   316
           (LabelSpec
cg@1876
   317
              label: 'Argument:'
cg@1876
   318
              name: 'editAgumentLabel'
cg@1876
   319
              layout: (AlignmentOrigin 98 0 84 0 1 0.5)
cg@1876
   320
              translateLabel: true
cg@1876
   321
              resizeForLabel: true
ca@1325
   322
            )
cg@1876
   323
           (InputFieldSpec
cg@1876
   324
              name: 'editAgument'
cg@1876
   325
              layout: (LayoutFrame 100 0 73 0 -5 1.0 95 0)
cg@1876
   326
              activeHelpKey: detailsArgument
cg@1876
   327
              tabable: true
cg@1876
   328
              model: editAgument
cg@1876
   329
              group: inputGroup
cg@1876
   330
              immediateAccept: true
cg@1876
   331
              acceptOnReturn: false
cg@1876
   332
              acceptOnTab: false
cg@1876
   333
              acceptOnLostFocus: false
cg@1876
   334
              acceptChannel: acceptChannel
cg@1876
   335
              modifiedChannel: modifiedChannel
cg@1876
   336
              acceptOnPointerLeave: false
ca@1325
   337
            )
cg@1876
   338
           (LabelSpec
cg@1876
   339
              label: 'Access Character Position:'
cg@1876
   340
              name: 'accessCharacterPositionLabel'
cg@1876
   341
              layout: (AlignmentOrigin 275 0 113 0 1 0.5)
cg@1876
   342
              translateLabel: true
cg@1876
   343
              resizeForLabel: true
ca@1325
   344
            )
cg@1876
   345
           (InputFieldSpec
cg@1876
   346
              name: 'accessCharacterPosition'
cg@1876
   347
              layout: (LayoutFrame 278 0 103 0 -5 1.0 125 0)
cg@1876
   348
              activeHelpKey: detailsAccessCharaterPosition
cg@1876
   349
              tabable: true
cg@1876
   350
              model: accessCharacterPosition
cg@1876
   351
              group: inputGroup
cg@1876
   352
              type: number
cg@1876
   353
              immediateAccept: true
cg@1876
   354
              acceptOnReturn: false
cg@1876
   355
              acceptOnTab: false
cg@1876
   356
              acceptOnLostFocus: false
cg@1876
   357
              acceptChannel: acceptChannel
cg@1876
   358
              modifiedChannel: modifiedChannel
cg@1876
   359
              acceptOnPointerLeave: false
cg@1183
   360
            )
cg@1876
   361
           (CheckBoxSpec
cg@2346
   362
              label: 'Translate Label '
cg@1876
   363
              name: 'translateLabel'
cg@2346
   364
              layout: (LayoutFrame 96 0 135 0 308 0 161 0)
cg@2346
   365
              activeHelpKey: translateLabel
cg@1876
   366
              tabable: true
cg@1876
   367
              model: translateLabel
cg@1876
   368
              translateLabel: true
cg@1183
   369
            )
cg@2346
   370
           (CheckBoxSpec
cg@2346
   371
              label: 'Application Provides Label '
cg@2346
   372
              name: 'CheckBox1'
cg@2346
   373
              layout: (LayoutFrame 96 0 161 0 308 0 187 0)
cg@2346
   374
              activeHelpKey: applicationProvidesLabel
cg@2346
   375
              tabable: true
cg@2346
   376
              model: applicationProvidesLabel
cg@2346
   377
              translateLabel: true
cg@2346
   378
            )
cg@1876
   379
           (LabelSpec
cg@1876
   380
              label: 'Help Key:'
cg@1876
   381
              name: 'activeHelp'
cg@2346
   382
              layout: (AlignmentOrigin 98 0 203 0 1 0.5)
cg@1876
   383
              translateLabel: true
cg@1876
   384
              resizeForLabel: true
ca@1373
   385
            )
cg@1876
   386
           (InputFieldSpec
cg@1876
   387
              name: 'activeHelpKey'
cg@2346
   388
              layout: (LayoutFrame 100 0 192 0 -5 1.0 214 0)
cg@1876
   389
              activeHelpKey: label
cg@1876
   390
              tabable: true
cg@1876
   391
              model: activeHelpKey
cg@1876
   392
              group: inputGroup
cg@1876
   393
              type: symbolOrNil
cg@1876
   394
              immediateAccept: true
cg@1876
   395
              acceptOnReturn: false
cg@1876
   396
              acceptOnTab: false
cg@1876
   397
              acceptOnLostFocus: false
cg@1876
   398
              acceptChannel: acceptChannel
cg@1876
   399
              modifiedChannel: modifiedChannel
cg@1876
   400
              acceptOnPointerLeave: false
ca@1373
   401
            )
ca@1373
   402
           )
ca@1373
   403
         
ca@1373
   404
        )
ca@1373
   405
      )
ca@1373
   406
!
ca@1373
   407
ca@1373
   408
canvasSpec
ca@1373
   409
    "This resource specification was automatically generated
ca@1373
   410
     by the UIPainter of ST/X."
ca@1373
   411
ca@1373
   412
    "Do not manually edit this!! If it is corrupted,
ca@1373
   413
     the UIPainter may not be able to read the specification."
ca@1373
   414
ca@1373
   415
    "
ca@1373
   416
     UIPainter new openOnClass:TabListEditor andSelector:#canvasSpec
ca@1373
   417
     TabListEditor new openInterface:#canvasSpec
ca@1373
   418
    "
ca@1373
   419
ca@1373
   420
    <resource: #canvas>
ca@1373
   421
ca@1373
   422
    ^ 
cg@3663
   423
    #(FullSpec
cg@3663
   424
       name: canvasSpec
cg@3663
   425
       uuid: '8a7c55d6-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   426
       window: 
cg@3663
   427
      (WindowSpec
cg@3663
   428
         label: 'Canvas'
cg@3663
   429
         name: 'Canvas'
cg@3663
   430
         uuid: '8a7c5964-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   431
         min: (Point 10 10)
cg@3663
   432
         max: (Point 1280 1024)
cg@3663
   433
         bounds: (Rectangle 0 0 383 220)
cg@3663
   434
       )
cg@3663
   435
       component: 
cg@3663
   436
      (SpecCollection
cg@3663
   437
         collection: (
cg@3663
   438
          (LabelSpec
cg@3663
   439
             label: 'Class / Major Key:'
cg@3663
   440
             name: 'majorKeyLabel'
cg@3663
   441
             layout: (AlignmentOrigin 160 0 26 0 1 0.5)
cg@3663
   442
             activeHelpKey: majorKey
cg@3663
   443
             uuid: '8a7cc2f0-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   444
             translateLabel: true
cg@3663
   445
             resizeForLabel: true
cg@3663
   446
           )
cg@3663
   447
          (InputFieldSpec
cg@3663
   448
             name: 'majorKeyField'
cg@3663
   449
             layout: (LayoutFrame 161 0 15 0 -5 1.0 37 0)
cg@3663
   450
             activeHelpKey: majorKey
cg@3663
   451
             uuid: '8a7cc82c-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   452
             tabable: true
cg@3663
   453
             model: majorKey
cg@3663
   454
             group: inputGroup
cg@3663
   455
             type: symbolOrNil
cg@3663
   456
             immediateAccept: true
cg@3663
   457
             acceptOnReturn: false
cg@3663
   458
             acceptOnTab: false
cg@3663
   459
             acceptOnLostFocus: false
cg@3663
   460
             modifiedChannel: modifiedChannel
cg@3663
   461
             acceptOnPointerLeave: false
cg@3663
   462
           )
cg@3663
   463
          (LabelSpec
cg@3663
   464
             label: 'Selector / Minor Key:'
cg@3663
   465
             name: 'minorKeyLabel'
cg@3663
   466
             layout: (AlignmentOrigin 160 0 55 0 1 0.5)
cg@3663
   467
             uuid: '8a7ccda4-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   468
             translateLabel: true
cg@3663
   469
             resizeForLabel: true
cg@3663
   470
           )
cg@3663
   471
          (InputFieldSpec
cg@3663
   472
             name: 'minorKeyField'
cg@3663
   473
             layout: (LayoutFrame 161 0 44 0 -5 1.0 66 0)
cg@3663
   474
             activeHelpKey: majorKey
cg@3663
   475
             uuid: '8a7ccf7a-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   476
             tabable: true
cg@3663
   477
             model: minorKey
cg@3663
   478
             group: inputGroup
cg@3663
   479
             type: symbolOrNil
cg@3663
   480
             immediateAccept: true
cg@3663
   481
             acceptOnReturn: false
cg@3663
   482
             acceptOnTab: false
cg@3663
   483
             acceptOnLostFocus: false
cg@3663
   484
             modifiedChannel: modifiedChannel
cg@3663
   485
             acceptOnPointerLeave: false
cg@3663
   486
           )
cg@3663
   487
          (FramedBoxSpec
cg@3663
   488
             label: 'Scroll Bars'
cg@3663
   489
             name: 'FramedBox'
cg@3663
   490
             layout: (LayoutFrame 0 0.0 119 0.0 0 1.0 218 0)
cg@3663
   491
             uuid: '8a7cd1be-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   492
             labelPosition: topLeft
cg@3663
   493
             translateLabel: true
cg@3663
   494
             component: 
cg@3663
   495
            (SpecCollection
cg@3663
   496
               collection: (
cg@3663
   497
                (HorizontalPanelViewSpec
cg@3663
   498
                   name: 'HorizontalPanel1'
cg@3663
   499
                   layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
cg@3663
   500
                   uuid: '8a7cd42a-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   501
                   horizontalLayout: fitSpace
cg@3663
   502
                   verticalLayout: fitSpace
cg@3663
   503
                   horizontalSpace: 3
cg@3663
   504
                   verticalSpace: 3
cg@3663
   505
                   component: 
cg@3663
   506
                  (SpecCollection
cg@3663
   507
                     collection: (
cg@3663
   508
                      (ViewSpec
cg@3663
   509
                         name: 'Box1'
cg@3663
   510
                         uuid: '8a7cd768-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   511
                         component: 
cg@3663
   512
                        (SpecCollection
cg@3663
   513
                           collection: (
cg@3663
   514
                            (CheckBoxSpec
cg@3663
   515
                               label: 'Vertical'
cg@3663
   516
                               name: 'verticalScrollBarCheckBox'
cg@3663
   517
                               layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0)
cg@3663
   518
                               activeHelpKey: verticalScroller
cg@3663
   519
                               uuid: '8a7cd8ee-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   520
                               tabable: true
cg@3663
   521
                               model: hasVerticalScrollBar
cg@3663
   522
                               translateLabel: true
ca@1373
   523
                             )
cg@3663
   524
                            (CheckBoxSpec
cg@3663
   525
                               label: 'Mini'
cg@3663
   526
                               name: 'miniScrollerVerticalCheckBox'
cg@3663
   527
                               layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0)
cg@3663
   528
                               activeHelpKey: verticalMiniScroller
cg@3663
   529
                               uuid: '8a7cdb82-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   530
                               tabable: true
cg@3663
   531
                               model: miniScrollerVertical
cg@3663
   532
                               translateLabel: true
ca@1373
   533
                             )
cg@3663
   534
                            )
cg@3663
   535
                          
cg@3663
   536
                         )
cg@3663
   537
                         useDefaultExtent: true
cg@3663
   538
                       )
cg@3663
   539
                      (ViewSpec
cg@3663
   540
                         name: 'Box2'
cg@3663
   541
                         uuid: '8a7cdda8-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   542
                         component: 
cg@3663
   543
                        (SpecCollection
cg@3663
   544
                           collection: (
cg@3663
   545
                            (CheckBoxSpec
cg@3663
   546
                               label: 'Horizontal'
cg@3663
   547
                               name: 'horizontalScrollBarCheckBox'
cg@3663
   548
                               layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0)
cg@3663
   549
                               activeHelpKey: horizontalScroller
cg@3663
   550
                               uuid: '8a7cdede-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   551
                               tabable: true
cg@3663
   552
                               model: hasHorizontalScrollBar
cg@3663
   553
                               translateLabel: true
ca@1373
   554
                             )
cg@3663
   555
                            (CheckBoxSpec
cg@3663
   556
                               label: 'Mini'
cg@3663
   557
                               name: 'miniScrollerHorizontalCheckBox'
cg@3663
   558
                               layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0)
cg@3663
   559
                               activeHelpKey: horizontalMiniScroller
cg@3663
   560
                               uuid: '8a7ce064-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   561
                               tabable: true
cg@3663
   562
                               model: miniScrollerHorizontal
cg@3663
   563
                               translateLabel: true
cg@3663
   564
                             )
cg@3663
   565
                            )
cg@3663
   566
                          
cg@3663
   567
                         )
cg@3663
   568
                         extent: (Point 111 53)
ca@1373
   569
                       )
cg@3663
   570
                      (ViewSpec
cg@3663
   571
                         name: 'Box3'
cg@3663
   572
                         uuid: '8a7ce1fe-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   573
                         component: 
cg@3663
   574
                        (SpecCollection
cg@3663
   575
                           collection: (
cg@3663
   576
                            (LabelSpec
cg@3663
   577
                               label: 'Auto Hide:'
cg@3663
   578
                               name: 'Label1'
cg@3663
   579
                               layout: (LayoutFrame 0 0.0 6 0 0 1.0 23 0)
cg@3663
   580
                               uuid: '8a7ce334-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   581
                               translateLabel: true
cg@3663
   582
                               resizeForLabel: true
cg@3663
   583
                               adjust: left
cg@3663
   584
                             )
cg@3663
   585
                            (PopUpListSpec
cg@3663
   586
                               label: 'Default'
cg@3663
   587
                               name: 'PopUpList1'
cg@3663
   588
                               layout: (LayoutFrame 0 0.0 32 0 0 1.0 54 0)
cg@3663
   589
                               activeHelpKey: autoHideScrollBars
cg@3663
   590
                               uuid: '8a7ce4e2-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   591
                               translateLabel: true
cg@3663
   592
                               tabable: true
cg@3663
   593
                               model: autoHideScrollBars
cg@3663
   594
                               menu: 
cg@3663
   595
                              (ImmutableArray
cg@3663
   596
                                 Default On
cg@3663
   597
                                 Off
cg@3663
   598
                               )
cg@3663
   599
                               useIndex: true
cg@3663
   600
                             )
cg@3663
   601
                            )
cg@3663
   602
                          
cg@3663
   603
                         )
cg@3663
   604
                         extent: (Point 112 53)
cg@3663
   605
                       )
cg@3663
   606
                      )
cg@3663
   607
                    
cg@3663
   608
                   )
ca@1373
   609
                 )
cg@3663
   610
                )
cg@3663
   611
              
cg@3663
   612
             )
ca@1373
   613
           )
cg@3663
   614
          (CheckBoxSpec
cg@3663
   615
             label: 'Create New Builder'
cg@3663
   616
             name: 'createNewBuilder'
cg@3663
   617
             layout: (Point 161 75)
cg@3663
   618
             activeHelpKey: createNewBuilder
cg@3663
   619
             uuid: '8a7ce8de-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   620
             model: createNewBuilder
cg@3663
   621
             translateLabel: true
cg@3663
   622
           )
cg@3663
   623
          )
cg@3663
   624
        
cg@3663
   625
       )
cg@3663
   626
     )
ca@1373
   627
!
ca@1373
   628
ca@1373
   629
detailSpec
ca@1373
   630
    "This resource specification was automatically generated
ca@1373
   631
     by the UIPainter of ST/X."
ca@1373
   632
ca@1373
   633
    "Do not manually edit this!! If it is corrupted,
ca@1373
   634
     the UIPainter may not be able to read the specification."
ca@1373
   635
ca@1373
   636
    "
ca@1373
   637
     UIPainter new openOnClass:TabListEditor andSelector:#detailSpec
ca@1373
   638
     TabListEditor new openInterface:#detailSpec
ca@1373
   639
    "
ca@1373
   640
ca@1373
   641
    <resource: #canvas>
ca@1373
   642
ca@1373
   643
    ^ 
cg@1876
   644
     #(FullSpec
cg@1876
   645
        name: detailSpec
cg@1876
   646
        window: 
cg@1876
   647
       (WindowSpec
cg@1876
   648
          label: 'Details'
cg@1876
   649
          name: 'Details'
cg@1876
   650
          min: (Point 10 10)
cg@1876
   651
          max: (Point 1280 1024)
cg@1876
   652
          bounds: (Rectangle 0 0 358 107)
ca@1373
   653
        )
cg@1876
   654
        component: 
cg@1876
   655
       (SpecCollection
cg@1876
   656
          collection: (
cg@1876
   657
           (CheckBoxSpec
cg@1876
   658
              label: 'Can Select'
cg@1876
   659
              name: 'enabled'
cg@1876
   660
              layout: (Point 46 14)
cg@1876
   661
              activeHelpKey: canSelect
cg@1876
   662
              tabable: true
cg@1876
   663
              model: enabled
cg@1876
   664
              translateLabel: true
cg@1183
   665
            )
cg@1876
   666
           (LabelSpec
cg@1876
   667
              label: 'Color:'
cg@1876
   668
              name: 'ForegroundLabel'
cg@1876
   669
              layout: (AlignmentOrigin 46 0 62 0 1 0.5)
cg@1876
   670
              translateLabel: true
cg@1876
   671
              resizeForLabel: true
cg@1876
   672
              adjust: right
cg@1183
   673
            )
cg@1876
   674
           (ColorMenuSpec
cg@1876
   675
              name: 'ForegroundColorMenu'
cg@1876
   676
              layout: (LayoutFrame 48 0 50 0 -10 1.0 72 0)
cg@1876
   677
              activeHelpKey: color
cg@1876
   678
              model: labelForegroundColor
cg@1876
   679
              labelsAreColored: false
cg@1183
   680
            )
cg@1183
   681
           )
cg@1183
   682
         
cg@1183
   683
        )
tz@739
   684
      )
tz@739
   685
!
tz@739
   686
tz@739
   687
windowSpec
tz@739
   688
    "This resource specification was automatically generated
tz@739
   689
     by the UIPainter of ST/X."
tz@739
   690
tz@739
   691
    "Do not manually edit this!! If it is corrupted,
tz@739
   692
     the UIPainter may not be able to read the specification."
tz@739
   693
tz@739
   694
    "
tz@739
   695
     UIPainter new openOnClass:TabListEditor andSelector:#windowSpec
tz@739
   696
     TabListEditor new openInterface:#windowSpec
tz@739
   697
     TabListEditor open
tz@739
   698
    "
tz@739
   699
tz@739
   700
    <resource: #canvas>
tz@739
   701
cg@1183
   702
    ^ 
cg@3663
   703
    #(FullSpec
cg@3663
   704
       name: windowSpec
cg@3663
   705
       uuid: 'b2e02714-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   706
       window: 
cg@3663
   707
      (WindowSpec
cg@3663
   708
         label: 'Tab List Editor'
cg@3663
   709
         name: 'Tab List Editor'
cg@3663
   710
         uuid: 'b2e02a02-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   711
         min: (Point 440 280)
cg@3663
   712
         bounds: (Rectangle 0 0 536 369)
cg@3663
   713
         menu: menu
cg@3663
   714
       )
cg@3663
   715
       component: 
cg@3663
   716
      (SpecCollection
cg@3663
   717
         collection: (
cg@3663
   718
          (MenuPanelSpec
cg@3663
   719
             name: 'menuToolbarView'
cg@3663
   720
             layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 34 0)
cg@3663
   721
             uuid: 'b2e02c78-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   722
             menu: menuToolbar
cg@3663
   723
             showSeparatingLines: true
cg@3663
   724
           )
cg@3663
   725
          (VariableHorizontalPanelSpec
cg@3663
   726
             name: 'VariablePanel'
cg@3663
   727
             layout: (LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0)
cg@3663
   728
             uuid: 'b2e02f48-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   729
             component: 
cg@3663
   730
            (SpecCollection
cg@3663
   731
               collection: (
cg@3663
   732
                (SelectionInListModelViewSpec
cg@3663
   733
                   name: 'ListOfLabels'
cg@3663
   734
                   uuid: 'b2e031fa-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   735
                   tabable: true
cg@3663
   736
                   model: selectionHolder
cg@3663
   737
                   menu: menuEdit
cg@3663
   738
                   hasHorizontalScrollBar: true
cg@3663
   739
                   hasVerticalScrollBar: true
cg@3663
   740
                   miniScrollerHorizontal: true
cg@3663
   741
                   listModel: listOfTabs
cg@3663
   742
                   highlightMode: line
cg@3663
   743
                   selectConditionSelector: askForItemModification
cg@3663
   744
                 )
cg@3663
   745
                (ViewSpec
cg@3663
   746
                   name: 'SpecView'
cg@3663
   747
                   uuid: 'b2e034d4-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   748
                   level: -1
cg@3663
   749
                   component: 
cg@3663
   750
                  (SpecCollection
cg@3663
   751
                     collection: (
cg@3663
   752
                      (NoteBookViewSpec
cg@3663
   753
                         name: 'NoteBook'
cg@3663
   754
                         layout: (LayoutFrame 1 0.0 0 0.0 0 1.0 -32 1.0)
cg@3663
   755
                         uuid: 'b2e03600-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   756
                         enableChannel: hasSelectionHolder
cg@3663
   757
                         tabable: true
cg@3663
   758
                         model: noteBookModel
cg@3663
   759
                         menu: noteBookTabList
cg@3663
   760
                         useIndex: true
cg@3663
   761
                         translateLabel: true
cg@3663
   762
                         keepCanvasAlive: true
cg@3663
   763
                       )
cg@3663
   764
                      (UISubSpecification
cg@3663
   765
                         name: 'subSpec'
cg@3663
   766
                         layout: (LayoutFrame 2 0.0 -32 1 -2 1.0 0 1)
cg@3663
   767
                         uuid: 'b2e039ac-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   768
                         majorKey: ToolApplicationModel
cg@3663
   769
                         minorKey: windowSpecForCommit
cg@3663
   770
                       )
cg@3663
   771
                      (NoteBookViewSpec
cg@3663
   772
                         name: 'TestNoteBook'
cg@3663
   773
                         layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
cg@3663
   774
                         uuid: 'b2e03b32-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   775
                         visibilityChannel: testMode
cg@3663
   776
                         tabable: true
cg@3663
   777
                         menu: testItemList
cg@3663
   778
                         useIndex: true
cg@3663
   779
                         translateLabel: true
cg@3663
   780
                       )
ca@1373
   781
                      )
cg@3663
   782
                    
cg@3663
   783
                   )
cg@1183
   784
                 )
cg@3663
   785
                )
cg@3663
   786
              
cg@3663
   787
             )
cg@3663
   788
             handles: (Any 0.23999999999999999 1.0)
cg@1183
   789
           )
cg@3663
   790
          (UISubSpecification
cg@3663
   791
             name: 'infoBarSubSpec'
cg@3663
   792
             layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
cg@3663
   793
             uuid: 'b2e03d44-761b-11e9-98ea-b8f6b1108e05'
cg@3663
   794
             majorKey: ToolApplicationModel
cg@3663
   795
             minorKey: windowSpecForInfoBar
cg@3663
   796
           )
cg@3663
   797
          )
cg@3663
   798
        
cg@3663
   799
       )
cg@3663
   800
     )
tz@739
   801
! !
tz@739
   802
ca@1373
   803
!TabListEditor class methodsFor:'list specs'!
ca@1373
   804
ca@1373
   805
noteBookTabList
ca@1373
   806
    "This resource specification was automatically generated
ca@1373
   807
     by the TabListEditor of ST/X."
ca@1373
   808
ca@1373
   809
    "Do not manually edit this!! If it is corrupted,
ca@1373
   810
     the TabListEditor may not be able to read the specification."
ca@1373
   811
ca@1373
   812
    "
ca@1373
   813
     TabListEditor new openOnClass:TabListEditor andSelector:#noteBookTabList
ca@1373
   814
    "
ca@1373
   815
ca@1373
   816
    <resource: #tabList>
ca@1373
   817
ca@1373
   818
    ^     #(
ca@1373
   819
       #(#TabItem
ca@1373
   820
          #label: 'Basic'
ca@1373
   821
          #activeHelpKey: #basicTab
ca@1373
   822
          #minorKey: #basicSpec
ca@1373
   823
        )
ca@1373
   824
       #(#TabItem
ca@1373
   825
          #label: 'Details'
ca@1373
   826
          #activeHelpKey: #detailTab
ca@1373
   827
          #minorKey: #detailSpec
ca@1373
   828
        )
ca@1373
   829
       #(#TabItem
ca@1373
   830
          #label: 'Canvas'
ca@1373
   831
          #activeHelpKey: #canvasTab
ca@1373
   832
          #minorKey: #canvasSpec
ca@1373
   833
        )
ca@1373
   834
       )
ca@1373
   835
     
ca@1373
   836
      collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]
ca@1373
   837
! !
ca@1373
   838
tz@739
   839
!TabListEditor class methodsFor:'menu specs'!
tz@739
   840
tz@739
   841
menu
tz@739
   842
    "This resource specification was automatically generated
tz@739
   843
     by the MenuEditor of ST/X."
tz@739
   844
tz@739
   845
    "Do not manually edit this!! If it is corrupted,
tz@739
   846
     the MenuEditor may not be able to read the specification."
tz@739
   847
cg@3663
   848
tz@739
   849
    "
tz@739
   850
     MenuEditor new openOnClass:TabListEditor andSelector:#menu
tz@739
   851
     (Menu new fromLiteralArrayEncoding:(TabListEditor menu)) startUp
tz@739
   852
    "
tz@739
   853
tz@739
   854
    <resource: #menu>
tz@739
   855
cg@3663
   856
    ^ 
cg@3663
   857
     #(Menu
cg@3663
   858
        (
cg@3663
   859
         (MenuItem
cg@3663
   860
            activeHelpKey: file
cg@3663
   861
            label: 'File'
cg@3663
   862
            submenu: 
cg@3663
   863
           (Menu
cg@3663
   864
              (
cg@3663
   865
               (MenuItem
cg@3663
   866
                  activeHelpKey: fileNew
cg@3663
   867
                  label: 'New'
cg@3663
   868
                  itemValue: doNew
cg@3663
   869
                )
cg@3663
   870
               (MenuItem
cg@3663
   871
                  label: '-'
cg@3663
   872
                )
cg@3663
   873
               (MenuItem
cg@3663
   874
                  activeHelpKey: fileLoad
cg@3663
   875
                  label: 'Load...'
cg@3663
   876
                  itemValue: doLoad
cg@3663
   877
                )
cg@3663
   878
               (MenuItem
cg@3663
   879
                  label: '-'
cg@3663
   880
                )
cg@3663
   881
               (MenuItem
cg@3663
   882
                  activeHelpKey: fileSave
cg@3663
   883
                  label: 'Save'
cg@3663
   884
                  itemValue: doSave
cg@3663
   885
                )
cg@3663
   886
               (MenuItem
cg@3663
   887
                  activeHelpKey: fileSave
cg@3663
   888
                  label: 'Save As...'
cg@3663
   889
                  itemValue: doSaveAs
cg@3663
   890
                )
cg@3663
   891
               (MenuItem
cg@3663
   892
                  label: '-'
cg@3663
   893
                )
cg@3663
   894
               (MenuItem
cg@3663
   895
                  activeHelpKey: fileBrowseClass
cg@3663
   896
                  label: 'Browse Class'
cg@3663
   897
                  itemValue: doBrowseClass
cg@3663
   898
                )
cg@3663
   899
               (MenuItem
cg@3663
   900
                  label: '-'
cg@3663
   901
                )
cg@3663
   902
               (MenuItem
cg@3663
   903
                  activeHelpKey: fileExit
cg@3663
   904
                  label: 'Exit'
cg@3663
   905
                  itemValue: closeRequest
cg@3663
   906
                )
cg@3663
   907
               )
cg@3663
   908
              nil
cg@3663
   909
              nil
tz@739
   910
            )
cg@3663
   911
          )
cg@3663
   912
         (MenuItem
cg@3663
   913
            activeHelpKey: edit
cg@3663
   914
            label: 'Edit'
cg@3663
   915
            submenuChannel: menuEdit
cg@3663
   916
          )
cg@3663
   917
         (MenuItem
cg@3663
   918
            activeHelpKey: add
cg@3663
   919
            label: 'Add'
cg@3663
   920
            submenu: 
cg@3663
   921
           (Menu
cg@3663
   922
              (
cg@3663
   923
               (MenuItem
cg@3663
   924
                  activeHelpKey: addTabItem
cg@3663
   925
                  label: 'Tab Item'
cg@3663
   926
                  itemValue: doCreate
cg@3663
   927
                  labelImage: (ResourceRetriever nil newTabItemIcon 'Tab Item')
tz@739
   928
                )
cg@3663
   929
               )
cg@3663
   930
              nil
cg@3663
   931
              nil
tz@739
   932
            )
cg@3663
   933
          )
cg@3663
   934
         (MenuItem
cg@3663
   935
            activeHelpKey: add
cg@3663
   936
            label: 'Generate'
cg@3663
   937
            submenu: 
cg@3663
   938
           (Menu
cg@3663
   939
              (
cg@3663
   940
               (MenuItem
cg@3663
   941
                  activeHelpKey: fileCreateAspectMethod
cg@3663
   942
                  enabled: hasClassAndSelector
cg@3663
   943
                  label: 'Aspect Method'
cg@3663
   944
                  itemValue: doGenerateAspectMethod
cg@3663
   945
                )
cg@3663
   946
               )
cg@3663
   947
              nil
cg@3663
   948
              nil
tz@739
   949
            )
cg@3663
   950
          )
cg@3663
   951
         (MenuItem
cg@3663
   952
            activeHelpKey: test
cg@3663
   953
            label: 'Test'
cg@3663
   954
            submenu: 
cg@3663
   955
           (Menu
cg@3663
   956
              (
cg@3663
   957
               (MenuItem
cg@3663
   958
                  activeHelpKey: testPreview
cg@3663
   959
                  enabled: canToggleTestMode
cg@3663
   960
                  label: 'Preview'
cg@3663
   961
                  indication: testMode
tz@739
   962
                )
cg@3663
   963
               )
cg@3663
   964
              nil
cg@3663
   965
              nil
tz@739
   966
            )
cg@3663
   967
          )
cg@3663
   968
         (MenuItem
cg@3663
   969
            activeHelpKey: history
cg@3663
   970
            label: 'History'
cg@3663
   971
            submenuChannel: menuHistory
cg@3663
   972
          )
cg@3663
   973
         (MenuItem
cg@3663
   974
            activeHelpKey: help
cg@3663
   975
            label: 'MENU_Help'
cg@3663
   976
            startGroup: conditionalRight
cg@3663
   977
            submenuChannel: menuHelp
cg@3663
   978
          )
cg@3663
   979
         )
cg@3663
   980
        nil
cg@3663
   981
        nil
tz@739
   982
      )
tz@739
   983
!
tz@739
   984
tz@739
   985
menuEdit
tz@739
   986
    "This resource specification was automatically generated
tz@739
   987
     by the MenuEditor of ST/X."
tz@739
   988
tz@739
   989
    "Do not manually edit this!! If it is corrupted,
tz@739
   990
     the MenuEditor may not be able to read the specification."
tz@739
   991
tz@739
   992
    "
tz@739
   993
     MenuEditor new openOnClass:TabListEditor andSelector:#menuEdit
tz@739
   994
     (Menu new fromLiteralArrayEncoding:(TabListEditor menuEdit)) startUp
tz@739
   995
    "
tz@739
   996
tz@739
   997
    <resource: #menu>
tz@739
   998
ca@1374
   999
    ^ 
ca@1374
  1000
     #(#Menu
ca@1374
  1001
        #(
ca@1374
  1002
         #(#MenuItem
ca@1374
  1003
            #label: 'Cut'
ca@1374
  1004
            #value: #doCut
ca@1374
  1005
            #activeHelpKey: #editCut
ca@1374
  1006
            #enabled: #hasSelectionHolder
ca@1374
  1007
          )
ca@1374
  1008
         #(#MenuItem
ca@1374
  1009
            #label: 'Copy'
ca@1374
  1010
            #value: #doCopy
ca@1374
  1011
            #activeHelpKey: #editCopy
ca@1374
  1012
            #enabled: #hasSelectionHolder
ca@1374
  1013
          )
ca@1374
  1014
         #(#MenuItem
ca@1374
  1015
            #label: 'Paste'
ca@1374
  1016
            #value: #doPaste
ca@1374
  1017
            #activeHelpKey: #editPaste
sv@2383
  1018
            #enabled: #canPasteHolder
ca@1374
  1019
          )
ca@1374
  1020
         #(#MenuItem
ca@1374
  1021
            #label: 'Delete'
ca@1374
  1022
            #value: #doDelete
ca@1374
  1023
            #activeHelpKey: #editPaste
ca@1374
  1024
            #enabled: #hasSelectionHolder
ca@1374
  1025
          )
ca@1374
  1026
         #(#MenuItem
ca@1374
  1027
            #label: '-'
ca@1374
  1028
          )
ca@1374
  1029
         #(#MenuItem
ca@1374
  1030
            #label: 'Move Up'
ca@1374
  1031
            #value: #doMoveTabUpOrDown:
ca@1374
  1032
            #activeHelpKey: #editMoveUp
ca@1374
  1033
            #enabled: #canMoveTabItemUpOrDown
ca@1374
  1034
            #argument: #up
ca@1374
  1035
            #labelImage: #(#ResourceRetriever #Icon #upIcon 'Move Up')
ca@1374
  1036
          )
ca@1374
  1037
         #(#MenuItem
ca@1374
  1038
            #label: 'Move Down'
ca@1374
  1039
            #value: #doMoveTabUpOrDown:
ca@1374
  1040
            #activeHelpKey: #editMoveDown
ca@1374
  1041
            #enabled: #canMoveTabItemUpOrDown
ca@1374
  1042
            #argument: #down
ca@1374
  1043
            #labelImage: #(#ResourceRetriever #Icon #downIcon 'Move Down')
ca@1374
  1044
          )
ca@1374
  1045
         #(#MenuItem
ca@1374
  1046
            #label: '-'
ca@1374
  1047
            #isVisible: #hiddenAccelerator
ca@1374
  1048
          )
ca@1374
  1049
         #(#MenuItem
ca@1374
  1050
            #label: 'Accept'
ca@1374
  1051
            #translateLabel: true
ca@1374
  1052
            #isVisible: #hiddenAccelerator
ca@1374
  1053
            #value: #accept
sv@2432
  1054
            #enabled: #enablingCommitButtonsHolder
ca@1374
  1055
          )
ca@1374
  1056
         )
ca@1374
  1057
        nil
ca@1374
  1058
        nil
tz@739
  1059
      )
tz@739
  1060
!
tz@739
  1061
tz@739
  1062
menuToolbar
tz@739
  1063
    "This resource specification was automatically generated
tz@739
  1064
     by the MenuEditor of ST/X."
tz@739
  1065
tz@739
  1066
    "Do not manually edit this!! If it is corrupted,
tz@739
  1067
     the MenuEditor may not be able to read the specification."
tz@739
  1068
tz@739
  1069
    "
tz@739
  1070
     MenuEditor new openOnClass:TabListEditor andSelector:#menuToolbar
tz@739
  1071
     (Menu new fromLiteralArrayEncoding:(TabListEditor menuToolbar)) startUp
tz@739
  1072
    "
tz@739
  1073
tz@739
  1074
    <resource: #menu>
tz@739
  1075
ca@1373
  1076
    ^ 
cg@1909
  1077
     #(Menu
cg@1909
  1078
        (
cg@1909
  1079
         (MenuItem
cg@1909
  1080
            activeHelpKey: fileNew
cg@1909
  1081
            label: 'New'
cg@1909
  1082
            itemValue: doNew
cg@1909
  1083
            translateLabel: true
cg@1909
  1084
            isButton: true
cg@1909
  1085
            labelImage: (ResourceRetriever ToolbarIconLibrary new22x22Icon)
ca@1373
  1086
          )
cg@1909
  1087
         (MenuItem
cg@1909
  1088
            activeHelpKey: fileLoad
cg@1909
  1089
            label: 'Load'
cg@1909
  1090
            itemValue: doLoad
cg@1909
  1091
            translateLabel: true
cg@1909
  1092
            isButton: true
cg@1909
  1093
            labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon)
ca@1373
  1094
          )
cg@1909
  1095
         (MenuItem
cg@1909
  1096
            activeHelpKey: fileSave
cg@1909
  1097
            label: 'Save'
cg@1909
  1098
            itemValue: doSave
cg@1909
  1099
            translateLabel: true
cg@1909
  1100
            isButton: true
cg@1909
  1101
            labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon)
ca@1373
  1102
          )
cg@1909
  1103
         (MenuItem
cg@1909
  1104
            label: '-'
ca@1373
  1105
          )
cg@1909
  1106
         (MenuItem
cg@1909
  1107
            activeHelpKey: editCut
cg@1909
  1108
            enabled: hasSelectionHolder
cg@1909
  1109
            label: 'Cut'
cg@1909
  1110
            itemValue: doCut
cg@1909
  1111
            translateLabel: true
cg@1909
  1112
            isButton: true
cg@1909
  1113
            labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon)
ca@1373
  1114
          )
cg@1909
  1115
         (MenuItem
cg@1909
  1116
            activeHelpKey: editCopy
cg@1909
  1117
            enabled: hasSelectionHolder
cg@1909
  1118
            label: 'Copy'
cg@1909
  1119
            itemValue: doCopy
cg@1909
  1120
            translateLabel: true
cg@1909
  1121
            isButton: true
cg@1909
  1122
            labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon)
ca@1373
  1123
          )
cg@1909
  1124
         (MenuItem
cg@1909
  1125
            activeHelpKey: editPaste
sv@2383
  1126
            enabled: canPasteHolder
cg@1909
  1127
            label: 'Paste'
cg@1909
  1128
            itemValue: doPaste
cg@1909
  1129
            translateLabel: true
cg@1909
  1130
            isButton: true
cg@1909
  1131
            labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon)
ca@1373
  1132
          )
cg@1909
  1133
         (MenuItem
cg@1909
  1134
            activeHelpKey: editDelete
cg@1909
  1135
            enabled: hasSelectionHolder
cg@1909
  1136
            label: 'Delete'
cg@1909
  1137
            itemValue: doDelete
cg@1909
  1138
            translateLabel: true
cg@1909
  1139
            isButton: true
cg@1909
  1140
            isVisible: false
cg@1909
  1141
            labelImage: (ResourceRetriever ToolbarIconLibrary delete22x22Icon)
ca@1373
  1142
          )
cg@1909
  1143
         (MenuItem
cg@1909
  1144
            label: '-'
ca@1373
  1145
          )
cg@1909
  1146
         (MenuItem
cg@1909
  1147
            activeHelpKey: addTabItem
cg@1909
  1148
            label: 'Add Tab Item'
cg@1909
  1149
            itemValue: doCreate
cg@1909
  1150
            translateLabel: true
cg@1909
  1151
            isButton: true
cg@1909
  1152
            labelImage: (ResourceRetriever nil newTabItemIcon)
ca@1373
  1153
          )
cg@1909
  1154
         (MenuItem
cg@1909
  1155
            label: ''
ca@1373
  1156
          )
cg@1909
  1157
         (MenuItem
cg@1909
  1158
            activeHelpKey: editMoveUp
cg@1909
  1159
            enabled: canMoveTabItemUpOrDown
cg@1909
  1160
            label: 'Move Tab Up'
cg@1909
  1161
            itemValue: doMoveTabUpOrDown:
cg@1909
  1162
            translateLabel: true
cg@1909
  1163
            isButton: true
cg@1909
  1164
            startGroup: right
cg@1909
  1165
            labelImage: (ResourceRetriever XPToolbarIconLibrary up22x22Icon)
cg@1909
  1166
            argument: up
ca@1373
  1167
          )
cg@1909
  1168
         (MenuItem
cg@1909
  1169
            activeHelpKey: editMoveDown
cg@1909
  1170
            enabled: canMoveTabItemUpOrDown
cg@1909
  1171
            label: 'Move Tab Down'
cg@1909
  1172
            itemValue: doMoveTabUpOrDown:
cg@1909
  1173
            translateLabel: true
cg@1909
  1174
            isButton: true
cg@1909
  1175
            startGroup: right
cg@1909
  1176
            labelImage: (ResourceRetriever XPToolbarIconLibrary down22x22Icon)
cg@1909
  1177
            argument: down
ca@1373
  1178
          )
ca@1373
  1179
         )
ca@1373
  1180
        nil
ca@1373
  1181
        nil
tz@739
  1182
      )
tz@739
  1183
! !
tz@739
  1184
tz@739
  1185
!TabListEditor methodsFor:'aspects'!
tz@739
  1186
ca@1373
  1187
autoHideScrollBars
ca@1373
  1188
    |holder|
ca@1373
  1189
ca@1373
  1190
    (holder := builder bindingAt:#autoHideScrollBars) isNil ifTrue:[
ca@1373
  1191
        builder aspectAt:#autoHideScrollBars put:(holder := 1 asValue).
ca@1373
  1192
        holder addDependent: self
ca@1373
  1193
    ].
ca@1373
  1194
    ^ holder.
ca@1373
  1195
!
ca@1373
  1196
tz@739
  1197
canMoveTabItemUpOrDown
ca@1373
  1198
    ^ builder booleanValueAspectFor:#canMoveTabItemUpOrDown
ca@1373
  1199
!
ca@1373
  1200
ca@1374
  1201
hasSelectionHolder
ca@1374
  1202
    ^ builder booleanValueAspectFor:#hasSelectionHolder
ca@1374
  1203
!
ca@1374
  1204
ca@1374
  1205
hiddenAccelerator
ca@1374
  1206
    "used to set menu entries with an accelerator not visible to the operator
ca@1374
  1207
    "
ca@1374
  1208
    ^ false
ca@1374
  1209
!
ca@1374
  1210
ca@1326
  1211
inputGroup
ca@1326
  1212
ca@1326
  1213
    |holder|
ca@1326
  1214
ca@1326
  1215
    (holder := builder bindingAt:#inputGroup) isNil ifTrue:[
ca@1326
  1216
        builder aspectAt:#inputGroup put:(holder := EnterFieldGroup new)
ca@1326
  1217
    ].
ca@1326
  1218
    ^ holder.
ca@1326
  1219
ca@1326
  1220
ca@1326
  1221
!
ca@1326
  1222
ca@1373
  1223
listOfTabs
ca@1373
  1224
    ^ listOfTabs
ca@1373
  1225
!
tz@739
  1226
ca@1373
  1227
noteBookModel
ca@1373
  1228
    |holder|
ca@1373
  1229
ca@1373
  1230
    (holder := builder bindingAt:#noteBookModel) isNil ifTrue:[
ca@1373
  1231
        holder := 0 asValue.
ca@1373
  1232
        builder aspectAt:#noteBookModel put:holder.
ca@1373
  1233
    ].
ca@1373
  1234
    ^ holder.
ca@1373
  1235
!
ca@1373
  1236
ca@1373
  1237
noteBookTabList
ca@1373
  1238
    "Generated by the TabListEditor"
ca@1373
  1239
ca@1373
  1240
    |list|
ca@1373
  1241
ca@1373
  1242
    (list := builder bindingAt:#noteBookTabList) isNil ifTrue:[
ca@1373
  1243
        builder aspectAt:#noteBookTabList put:(list := self class noteBookTabList).
ca@1373
  1244
    ].
ca@1373
  1245
    ^ list
tz@739
  1246
!
tz@739
  1247
tz@739
  1248
selectionHolder
tz@739
  1249
    "holder which keeps the current selection
tz@739
  1250
    "
tz@739
  1251
    |holder|
tz@739
  1252
tz@739
  1253
    (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
ca@1373
  1254
        holder := 0 asValue.
tz@739
  1255
        builder aspectAt:#selectionHolder put:holder.
ca@1373
  1256
        holder addDependent:self.
tz@739
  1257
    ].
tz@739
  1258
    ^ holder
tz@739
  1259
!
tz@739
  1260
ca@1373
  1261
testItemList
tz@739
  1262
    |holder|
tz@739
  1263
ca@1373
  1264
    (holder := builder bindingAt:#testItemList) isNil ifTrue:[
ca@1373
  1265
        holder := ValueHolder new.
ca@1373
  1266
        builder aspectAt:#testItemList put:holder.
tz@739
  1267
    ].
ca@1373
  1268
    ^ holder.
tz@739
  1269
!
tz@739
  1270
tz@739
  1271
testMode
tz@739
  1272
tz@739
  1273
    |holder|
tz@739
  1274
tz@739
  1275
    (holder := builder bindingAt:#testMode) isNil ifTrue:[
tz@739
  1276
        builder aspectAt:#testMode put:(holder := false asValue).
tz@739
  1277
        holder addDependent: self
tz@739
  1278
    ].
tz@739
  1279
    ^ holder
tz@739
  1280
tz@739
  1281
! !
tz@739
  1282
tz@739
  1283
!TabListEditor methodsFor:'building'!
tz@739
  1284
ca@1373
  1285
buildFromResourceSpec:aListSpec
ca@1373
  1286
    self buildFromTabList:aListSpec
tz@739
  1287
!
tz@739
  1288
tz@739
  1289
buildFromTabList: aTabList
tz@739
  1290
    "build from a aTabList"
tz@739
  1291
ca@1373
  1292
    self selection:0.
tz@739
  1293
    listOfTabs removeAll.
tz@739
  1294
cg@2819
  1295
    aTabList do:[:aTabItem| 
cg@2819
  1296
        self assert:(aTabItem isKindOf:TabItem).
cg@2819
  1297
        listOfTabs add: aTabItem 
cg@2819
  1298
    ].
cg@1972
  1299
    self clearModified.
ca@1374
  1300
    listOfTabs notEmpty ifTrue:[ self selection:1 ].
cg@2819
  1301
cg@2819
  1302
    "Modified: / 08-11-2010 / 13:57:27 / cg"
cg@1972
  1303
!
tz@739
  1304
cg@1972
  1305
loadFromClass:aClass andSelector:aSelector
cg@1972
  1306
    "build from class and selector"
cg@1972
  1307
cg@1972
  1308
    |cls spec|
cg@1972
  1309
cg@1972
  1310
    self assert:(aClass isNil or:[aClass isClass]).
cg@1972
  1311
cg@1972
  1312
    self testMode value: false.
cg@1972
  1313
    self selection:0.
cg@1972
  1314
cg@1972
  1315
    "if opened on a tab list"
cg@1972
  1316
    (aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) ifFalse:[
cg@1972
  1317
        listOfTabs removeAll.
cg@1972
  1318
cg@1972
  1319
        cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass].
cg@1972
  1320
        specSelector := aSelector.
cg@1972
  1321
cg@1972
  1322
        cls notNil ifTrue:[
cg@1972
  1323
            specSelector notNil ifTrue:[
cg@1972
  1324
cg@1972
  1325
                (cls respondsTo: aSelector) ifTrue:[ 
cg@1972
  1326
                    spec := cls perform: aSelector.
cg@1972
  1327
                ].
cg@1972
  1328
                spec size ~~ 0 ifTrue:[
cg@2819
  1329
                    spec do:[:aTabOrArray|
cg@2819
  1330
                        |tab|
cg@2819
  1331
cg@2819
  1332
                        aTabOrArray isArray ifTrue:[  
cg@2819
  1333
                            tab := aTabOrArray decodeAsLiteralArray
cg@2819
  1334
                        ] ifFalse:[
cg@2819
  1335
                            tab := aTabOrArray.
cg@2819
  1336
                        ].
cg@2819
  1337
                        self assert:(tab isKindOf:TabItem).
cg@2819
  1338
                        listOfTabs add:tab.
cg@1972
  1339
                    ].
cg@1972
  1340
                    self addHistoryEntryForClass:cls selector:specSelector.
cg@1972
  1341
                ]
cg@1972
  1342
            ]
cg@1972
  1343
        ].
cg@1972
  1344
cg@1972
  1345
        self clearModified.
cg@1972
  1346
    ].
cg@1972
  1347
    listOfTabs notEmpty ifTrue:[ self selection:1 ].
cg@2819
  1348
cg@2819
  1349
    "Modified: / 08-11-2010 / 13:59:09 / cg"
tz@739
  1350
! !
tz@739
  1351
tz@739
  1352
!TabListEditor methodsFor:'change & update'!
tz@739
  1353
tz@739
  1354
update:something with:aParameter from:someObject
tz@739
  1355
    "one of my aspects has changed; update modified channel
tz@739
  1356
    "
ca@1374
  1357
    |list|
tz@739
  1358
ca@1373
  1359
    someObject = self selectionHolder ifTrue:[
ca@1373
  1360
        ^ self selectionChanged
ca@1373
  1361
    ].
tz@739
  1362
ca@1373
  1363
    someObject = self testMode ifFalse:[              
ca@1373
  1364
        ^ super update:something with:aParameter from:someObject.
ca@1373
  1365
    ].
ca@1373
  1366
ca@1373
  1367
    someObject value ifTrue:[
ca@1375
  1368
        self noteBookModel value:0.
ca@1375
  1369
ca@1374
  1370
        listOfTabs notEmpty ifTrue:[
ca@1373
  1371
            list := listOfTabs collect:[:aTab| |tab|
ca@1373
  1372
                tab := aTab copy.
ca@1373
  1373
                tab setAttributesFromClass:specClass.
ca@1373
  1374
                tab
ca@1374
  1375
            ]
ca@1374
  1376
        ].
ca@1374
  1377
        self selection:0.
ca@1373
  1378
    ].
ca@1373
  1379
    self testItemList value:list.
ca@1373
  1380
    self updateInfoLabel.
ca@1373
  1381
tz@739
  1382
! !
tz@739
  1383
ca@1373
  1384
!TabListEditor methodsFor:'queries'!
tz@739
  1385
ca@1373
  1386
canToggleTestMode
sv@2281
  1387
    "checks whether testMode button is enabled"
sv@2281
  1388
ca@1373
  1389
    self testMode value ifTrue:[
ca@1373
  1390
        ^ true
ca@1373
  1391
    ].
tz@739
  1392
sv@2281
  1393
    self enablingCommitButtonsHolder value ifFalse:[
ca@1373
  1394
        ^ listOfTabs notEmpty
ca@1373
  1395
    ].
ca@1373
  1396
    ^ false
tz@739
  1397
! !
tz@739
  1398
tz@739
  1399
!TabListEditor methodsFor:'selection'!
tz@739
  1400
ca@1373
  1401
selectedElement
ca@1373
  1402
    |idx tab|
ca@1373
  1403
ca@1373
  1404
    idx := self selection.
ca@1373
  1405
ca@1373
  1406
    idx ~~ 0 ifTrue:[
ca@1373
  1407
        (tab := listOfTabs at:idx ifAbsent:nil) notNil ifTrue:[
ca@1373
  1408
            ^ tab
ca@1373
  1409
        ].
ca@1373
  1410
        self selection:0
ca@1373
  1411
    ].
ca@1373
  1412
    ^ nil
tz@739
  1413
!
tz@739
  1414
ca@1373
  1415
selection
ca@1373
  1416
    ^ self selectionHolder value ? 0
ca@1373
  1417
!
tz@739
  1418
ca@1373
  1419
selection:anIndex
ca@1373
  1420
    self selectionHolder value:(anIndex ? 0).
ca@1373
  1421
!
tz@739
  1422
ca@1373
  1423
selectionChanged
ca@1373
  1424
    |noteBookModel hasSelection|
tz@739
  1425
ca@1373
  1426
    hasSelection  := self selection ~~ 0.
ca@1373
  1427
    noteBookModel := self noteBookModel.
tz@739
  1428
ca@1373
  1429
    hasSelection ifTrue:[
ca@1373
  1430
        self testMode value:false.
ca@1373
  1431
        noteBookModel value == 0 ifTrue:[noteBookModel value:1]
tz@739
  1432
    ] ifFalse:[
ca@1373
  1433
        noteBookModel value:0
tz@739
  1434
    ].
tz@739
  1435
    self cancel.
ca@1374
  1436
    self hasSelectionHolder value:hasSelection.
sv@2281
  1437
    self canPasteHolder.
ca@1373
  1438
!
tz@739
  1439
ca@1373
  1440
setSelection:anIndex
ca@1374
  1441
    |index|
ca@1374
  1442
ca@1374
  1443
    index := anIndex ? 0.
ca@1374
  1444
    self selectionHolder value:index withoutNotifying:self
tz@739
  1445
! !
tz@739
  1446
cg@3036
  1447
!TabListEditor methodsFor:'startup & release'!
tz@739
  1448
tz@739
  1449
initialize
tz@739
  1450
    "setup aspects used by column description specifications
tz@739
  1451
    "
tz@739
  1452
    super initialize.
ca@1373
  1453
    listOfTabs := List new.
tz@739
  1454
!
tz@739
  1455
tz@739
  1456
openModalOnTabList: aTabList
tz@739
  1457
    "build a tab list from aTabList and open it modal"
tz@739
  1458
tz@739
  1459
    super openModalOnResourceSpec: aTabList
tz@739
  1460
tz@739
  1461
! !
tz@739
  1462
tz@739
  1463
!TabListEditor methodsFor:'user actions'!
tz@739
  1464
tz@739
  1465
accept
tz@739
  1466
    "accept changes
tz@739
  1467
    "
cg@3093
  1468
    |tab asb|
tz@739
  1469
ca@1373
  1470
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1471
        super accept.
cg@3093
  1472
        aspects keysAndValuesDo:[:k :m| tab perform:k asMutator with:(m value) ].
cg@1066
  1473
ca@1373
  1474
        asb := self autoHideScrollBars value.
ca@1373
  1475
        asb := asb ~~ 1 ifTrue:[asb == 2] ifFalse:[nil].
ca@1373
  1476
        tab autoHideScrollBars:asb.
tz@739
  1477
    ].
tz@739
  1478
    self cancel.
ca@1373
  1479
!
ca@1373
  1480
ca@1373
  1481
addTab:aTab
ca@1373
  1482
    |idx|
ca@1373
  1483
ca@1373
  1484
    aTab notNil ifTrue:[
cg@2819
  1485
        self assert:(aTab isKindOf:TabItem).
ca@1373
  1486
        self testMode value: false.
ca@1373
  1487
ca@1373
  1488
        (idx := self selection) == 0 ifTrue:[
ca@1373
  1489
            listOfTabs add:aTab.
ca@1373
  1490
            self selection:(listOfTabs size).
ca@1373
  1491
        ] ifFalse:[
ca@1373
  1492
            listOfTabs add:aTab afterIndex:idx
ca@1373
  1493
        ].
cg@1972
  1494
        self setModified.
ca@1373
  1495
    ].
cg@2819
  1496
cg@2819
  1497
    "Modified: / 08-11-2010 / 13:55:27 / cg"
tz@739
  1498
!
tz@739
  1499
tz@739
  1500
cancel
sv@2281
  1501
    "cancel all changes"
sv@2281
  1502
ca@1373
  1503
    |tab idx asb|
tz@739
  1504
ca@1373
  1505
    (     (idx := self selection) ~~ 0
ca@1373
  1506
     and:[(tab := self selectedElement) notNil]
ca@1373
  1507
    ) ifTrue:[
ca@1373
  1508
        aspects keysAndValuesDo:[:k :m| m value:(tab perform:k) ].
ca@1373
  1509
        listOfTabs at:idx put:tab.
tz@739
  1510
ca@1373
  1511
        asb := tab autoHideScrollBars.
ca@1373
  1512
        asb notNil ifTrue:[asb := asb == true ifTrue:[2] ifFalse:[3]]
ca@1373
  1513
                  ifFalse:[asb := 1].
tz@739
  1514
ca@1373
  1515
        self autoHideScrollBars value:asb.
tz@739
  1516
    ].
ca@1373
  1517
    self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]).
sv@2281
  1518
    self enablingCommitButtonsHolder value: false
tz@739
  1519
!
tz@739
  1520
tz@739
  1521
doCopy
tz@739
  1522
    "copy selected tab
tz@739
  1523
    "
ca@1373
  1524
    |tab|
ca@1373
  1525
ca@1373
  1526
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1527
        self clipboard:tab.
tz@749
  1528
        self updateAllToolInstances.
tz@739
  1529
    ]
tz@739
  1530
!
tz@739
  1531
ca@1373
  1532
doCreate
ca@1373
  1533
    self addTab:(TabItem label:'TAB').
tz@739
  1534
!
tz@739
  1535
tz@739
  1536
doCut
ca@1373
  1537
    "cut the selected tab; put to pasteBuffer
tz@739
  1538
    "
ca@1373
  1539
    |tab|
tz@739
  1540
ca@1373
  1541
    (tab := self selectedElement) notNil ifTrue:[
ca@1373
  1542
        self clipboard:tab.
ca@1373
  1543
        self doDelete.
tz@739
  1544
    ].
tz@739
  1545
tz@739
  1546
!
tz@739
  1547
tz@739
  1548
doDelete
tz@739
  1549
    "delete selected tab
tz@739
  1550
    "
ca@1374
  1551
    |index size|
tz@739
  1552
ca@1373
  1553
    (index := self selection) ~~ 0 ifTrue:[
tz@739
  1554
        self testMode value: false.
ca@1374
  1555
ca@1374
  1556
        (size := listOfTabs size) == 1 ifTrue:[
ca@1374
  1557
            self selection:0
ca@1374
  1558
        ] ifFalse:[
ca@1374
  1559
            self setSelection:0
ca@1374
  1560
        ].
tz@739
  1561
        listOfTabs removeIndex:index.
ca@1374
  1562
        index < size ifFalse:[
ca@1374
  1563
            index := index - 1
ca@1374
  1564
        ].
ca@1373
  1565
        self selection:index.
ca@1373
  1566
        self updateAllToolInstances.
cg@1972
  1567
        self setModified.
tz@739
  1568
    ].       
tz@739
  1569
!
tz@739
  1570
tz@739
  1571
doGenerateAspectMethod
tz@739
  1572
    "generate aspect method
tz@739
  1573
    "
tz@739
  1574
    |cls code|
tz@739
  1575
cg@3381
  1576
    (specClass notNil and:[specSelector notNil]) ifFalse:[
cg@3381
  1577
        ^ self information:'No class and selector defined!!'   
tz@739
  1578
    ].
tz@739
  1579
tz@739
  1580
    cls := self resolveName: specClass.
tz@739
  1581
tz@739
  1582
    (cls canUnderstand:specSelector) ifTrue:[
tz@739
  1583
        "/ method already exists, do not overwrite the method automaticaly
tz@739
  1584
tz@739
  1585
        ( YesNoBox title:'method '
tz@739
  1586
                         , (Text string:('#', specSelector) emphasis:#bold)
tz@739
  1587
                         , ' already exists!!'
tz@739
  1588
                 yesText:'overwrite'
tz@739
  1589
                  noText:'cancel'
tz@739
  1590
        ) confirm ifFalse:[
tz@739
  1591
            ^ self
tz@739
  1592
        ]
tz@739
  1593
    ].
tz@739
  1594
tz@739
  1595
    code := '!!' , cls name , ' methodsFor:''aspects''!!\\' ,
tz@739
  1596
            specSelector , '\' ,
tz@739
  1597
            '    "Generated by the TabListEditor"\' ,
tz@739
  1598
            '\' ,
tz@739
  1599
            '    |list|\' ,
tz@739
  1600
            '\' ,
tz@739
  1601
            '    (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' ,
tz@739
  1602
            '        builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' ,
tz@739
  1603
            '    ].\' ,
tz@739
  1604
            '    ^ list\' ,
tz@739
  1605
            '!! !!\\'.
tz@739
  1606
cg@3074
  1607
    Class packageQuerySignal answer:cls package do:[
cg@3074
  1608
        (ReadStream on:(code withCRs)) fileIn
cg@3074
  1609
    ]
tz@739
  1610
cg@3074
  1611
    "Modified: / 28-01-2014 / 21:57:09 / cg"
tz@739
  1612
!
tz@739
  1613
tz@739
  1614
doMoveTabUpOrDown:what
tz@739
  1615
    "step up or down
tz@739
  1616
    "
ca@1373
  1617
    |tab idx sz|
tz@739
  1618
ca@1373
  1619
    (listOfTabs size > 1 and:[(idx := self selection) ~~ 0]) ifFalse:[
tz@739
  1620
        ^ self
tz@739
  1621
    ].
tz@739
  1622
ca@1373
  1623
    (tab := listOfTabs at:idx ifAbsent:nil) isNil ifTrue:[
ca@1373
  1624
        ^ self selection:0
ca@1373
  1625
    ].
tz@739
  1626
ca@1373
  1627
    self setSelection:0.
ca@1373
  1628
    listOfTabs removeIndex:idx.
tz@739
  1629
ca@1373
  1630
    sz := listOfTabs size.
cg@1145
  1631
tz@739
  1632
    what == #down ifTrue:[
ca@1373
  1633
        idx := idx > sz ifTrue:[1] ifFalse:[idx + 1]
tz@739
  1634
    ] ifFalse:[
ca@1373
  1635
        idx := idx == 1 ifTrue:[sz + 1] ifFalse:[idx - 1]
tz@739
  1636
    ].
tz@739
  1637
ca@1373
  1638
    listOfTabs add:tab beforeIndex:idx.
ca@1373
  1639
    self setSelection:idx.
cg@1972
  1640
    self setModified.
tz@739
  1641
!
tz@739
  1642
tz@739
  1643
doPaste
tz@739
  1644
    "paste a tab
tz@739
  1645
    "
ca@1373
  1646
    |tab|
tz@739
  1647
ca@1373
  1648
    ((tab := self class clipboard) notNil and:[tab isKindOf:TabItem]) ifTrue:[
ca@1373
  1649
        self addTab:(tab deepCopy).
ca@1373
  1650
    ]
tz@739
  1651
!
tz@739
  1652
tz@739
  1653
doSave
cg@1972
  1654
    "generate code for class and instance"
cg@1972
  1655
cg@3056
  1656
    |cls code spec category package mthd list|
tz@739
  1657
sv@3330
  1658
    (specClass notNil and:[specSelector notNil]) ifFalse:[
sv@3330
  1659
        ^ self doSaveAs
tz@739
  1660
    ].
tz@739
  1661
tz@739
  1662
    cls := self resolveName: specClass.
tz@739
  1663
tz@739
  1664
    listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!'].
tz@739
  1665
sv@3330
  1666
    spec  := WriteStream on:''.
ca@1245
  1667
    list := Array new:(listOfTabs size).
ca@1245
  1668
    listOfTabs keysAndValuesDo:[:i :el|list at:i put:(el literalArrayEncoding)].
ca@1245
  1669
ca@1245
  1670
    UISpecification prettyPrintSpecArray:list on:spec indent:5.
tz@739
  1671
    spec := spec contents.
tz@739
  1672
tz@739
  1673
    "/ if that method already exists, do not overwrite the category
tz@739
  1674
tz@739
  1675
    category := 'list specs'.
tz@739
  1676
tz@739
  1677
    (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
tz@739
  1678
        category := mthd category.
cg@3056
  1679
        package := mthd package.
tz@739
  1680
    ].
tz@739
  1681
tz@739
  1682
    code := Character excla asString 
tz@739
  1683
            , cls name , ' class methodsFor:' , category storeString
tz@739
  1684
            , Character excla asString , '\\'
tz@739
  1685
tz@739
  1686
            , specSelector , '\'
tz@739
  1687
            , (self class codeGenerationComment replChar:$!! withString:'!!!!')
tz@739
  1688
            , '\\    "\'
cg@1855
  1689
            , '     TabListEditor new openOnClass: self andSelector:#' , specSelector , '\'
tz@739
  1690
            , '    "\'.
tz@739
  1691
tz@739
  1692
    code := code 
tz@739
  1693
            , '\'
tz@739
  1694
            , '    <resource: #tabList>\\'
tz@739
  1695
            , '    ^' 
tz@739
  1696
            , '     ', spec, '\'
cg@3590
  1697
            , '      collect:#decodeAsLiteralArray "[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]"'
tz@739
  1698
            , '\'
tz@739
  1699
            , Character excla asString
tz@739
  1700
            , ' '
tz@739
  1701
            , Character excla asString
tz@739
  1702
            , '\'.
tz@739
  1703
tz@739
  1704
    code := code withCRs.
cg@3056
  1705
    Class packageQuerySignal 
cg@3056
  1706
        answer:package
cg@3056
  1707
        do:[
cg@3074
  1708
            Class packageQuerySignal answer:cls package do:[
cg@3074
  1709
                (ReadStream on:code) fileIn.
cg@3074
  1710
            ].
cg@3056
  1711
            (cls canUnderstand:specSelector) ifFalse:[
cg@3584
  1712
                (YesNoBox confirm:(resources string:'Generate aspect method (on instance side) to hold the tabList (#%1)?' with:specSelector)) ifTrue:[
cg@3056
  1713
                    self doGenerateAspectMethod
cg@3056
  1714
                ]
cg@3056
  1715
            ].
cg@3056
  1716
        ].
tz@739
  1717
cg@1972
  1718
    self addHistoryEntryForClass:cls selector:specSelector.
cg@1972
  1719
    self clearModified.
tz@739
  1720
    hasSaved  := true.
cg@3074
  1721
cg@3074
  1722
    "Modified: / 28-01-2014 / 21:56:54 / cg"
cg@3590
  1723
    "Modified: / 11-08-2018 / 18:52:00 / Claus Gittinger"
cg@1856
  1724
!
cg@1856
  1725
cg@1856
  1726
openDocumentation
cg@1856
  1727
   self openHTMLDocument:'tools/uipainter/TabListEditor.html'.
tz@739
  1728
! !
tz@739
  1729
tz@739
  1730
!TabListEditor class methodsFor:'documentation'!
tz@739
  1731
tz@739
  1732
version
cg@1066
  1733
    ^ '$Header$'
cg@2667
  1734
!
cg@2667
  1735
cg@2667
  1736
version_CVS
cg@2667
  1737
    ^ '$Header$'
tz@739
  1738
! !
cg@3036
  1739