UISelectionPanel.st
changeset 112 6fe6c4d1672e
parent 107 e3e9acbe8fe3
child 116 61628bedc85a
equal deleted inserted replaced
111:c6699a14d3d9 112:6fe6c4d1672e
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 
    13 
    14 View subclass:#UISelectionPanel
    14 ApplicationModel subclass:#UISelectionPanel
    15 	instanceVariableNames:'action window tabView labelView inputView selection
    15 	instanceVariableNames:'selection selectors receiver'
    16 		lastClickPoint specification'
       
    17 	classVariableNames:''
    16 	classVariableNames:''
    18 	poolDictionaries:''
    17 	poolDictionaries:''
    19 	category:'Interface-UIPainter'
    18 	category:'Interface-UIPainter'
       
    19 !
       
    20 
       
    21 View subclass:#Canvas
       
    22 	instanceVariableNames:'inputView selection specification lastClickPoint labelHolder
       
    23 		nameHolder'
       
    24 	classVariableNames:''
       
    25 	poolDictionaries:''
       
    26 	privateIn:UISelectionPanel
    20 !
    27 !
    21 
    28 
    22 DropObject subclass:#DropSpecification
    29 DropObject subclass:#DropSpecification
    23 	instanceVariableNames:''
    30 	instanceVariableNames:''
    24 	classVariableNames:''
    31 	classVariableNames:''
    25 	poolDictionaries:''
    32 	poolDictionaries:''
    26 	privateIn:UISelectionPanel
    33 	privateIn:UISelectionPanel::Canvas
    27 !
    34 !
    28 
    35 
    29 !UISelectionPanel class methodsFor:'documentation'!
    36 !UISelectionPanel class methodsFor:'documentation'!
    30 
    37 
    31 copyright
    38 copyright
    54     [see also:]
    61     [see also:]
    55         TabView
    62         TabView
    56         UIPainter
    63         UIPainter
    57 
    64 
    58     [start with:]
    65     [start with:]
    59         UISelectionPanel defaultPanel
    66         UISelectionPanel open
    60 
    67 
    61 "
    68 "
    62 
    69 
    63 !
       
    64 
       
    65 examples
       
    66 "
       
    67     creates and opens the default panel
       
    68                                                                         [exBegin]
       
    69     self defaultPanel.
       
    70                                                                         [exEnd]
       
    71 
       
    72 
       
    73     create a panel with labels and selectors implemented by the receiver
       
    74     which returns a FullSpec.
       
    75                                                                         [exBegin]
       
    76     |top slv inset list view idx frame colSelected colUnselected|
       
    77 
       
    78     top := StandardSystemView new
       
    79         label:'UI-Selection Panel';
       
    80         extent:450@150.
       
    81 
       
    82     view := self origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
       
    83 
       
    84     view labels:#( 'Button & Toggles'
       
    85                    'Panels'
       
    86                    'Slider'
       
    87                  )
       
    88       selectors:#( #buttonToggleSpec
       
    89                    #panelSpec
       
    90                    #sliderSpec
       
    91                  )
       
    92        receiver:self.
       
    93 
       
    94     top open.
       
    95                                                                         [exEnd]
       
    96 "
       
    97 ! !
    70 ! !
    98 
    71 
    99 !UISelectionPanel class methodsFor:'instance creation'!
    72 !UISelectionPanel class methodsFor:'instance creation'!
   100 
    73 
   101 defaultPanel
    74 open
   102     |top slv inset list view idx frame colSelected colUnselected|
    75     |appl|
   103 
    76 
   104     top := StandardSystemView new
    77     appl := self new.
   105         label:'UI-Selection Panel';
    78 
   106         extent:480@255.
    79     appl labels:#( 'Button & Toggle'
   107 
       
   108     view := self origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
       
   109 
       
   110     view labels:#( 'Button & Toggle'
       
   111                    'Panel'
    80                    'Panel'
   112                    'Text'
    81                    'Text'
   113                    'View'
    82                    'View'
   114                    'Menu & Combo'
    83                    'Menu & Combo'
   115                    'Slider'
    84                    'Slider'
   116                  )
    85                  )
       
    86 
   117       selectors:#( #buttonToggleSpec
    87       selectors:#( #buttonToggleSpec
   118                    #panelSpec
    88                    #panelSpec
   119                    #textSpec
    89                    #textSpec
   120                    #viewsSpec
    90                    #viewsSpec
   121                    #menuComboSpec
    91                    #menuComboSpec
   122                    #sliderSpec
    92                    #sliderSpec
   123                  )
    93                  )
   124        receiver:self.
    94        receiver:self.
   125 
    95 
   126     top open.
    96     appl open.
   127 
    97   ^ appl.
   128 ! !
    98 ! !
   129 
    99 
   130 !UISelectionPanel class methodsFor:'interface specs'!
   100 !UISelectionPanel class methodsFor:'default specs'!
   131 
   101 
   132 buttonToggleSpec
   102 buttonToggleSpec
   133     "this window spec was automatically generated by the ST/X UIPainter"
   103     "this window spec was automatically generated by the ST/X UIPainter"
   134 
   104 
   135     "do not manually edit this - the painter/builder may not be able to
   105     "do not manually edit this - the painter/builder may not be able to
   141     "
   111     "
   142 
   112 
   143     <resource: #canvas>
   113     <resource: #canvas>
   144 
   114 
   145     ^
   115     ^
   146      
   116 
   147        #(#FullSpec
   117        #(#FullSpec
   148           #'window:' 
   118           #'window:' 
   149            #(#WindowSpec
   119            #(#WindowSpec
   150               #'name:' 'uIPainterView'
   120               #'name:' 'uIPainterView'
   151               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   121               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   243                     #'isTriggerOnDown:' false
   213                     #'isTriggerOnDown:' false
   244                 )
   214                 )
   245               )
   215               )
   246           )
   216           )
   247       )
   217       )
   248 !
   218 
       
   219 
       
   220 !
       
   221 
       
   222 panelSpec
       
   223     "this window spec was automatically generated by the ST/X UIPainter"
       
   224 
       
   225     "do not manually edit this - the painter/builder may not be able to
       
   226      handle the specification if its corrupted."
       
   227 
       
   228     "
       
   229      UIPainter new openOnClass:UISelectionPanel andSelector:#panelSpec
       
   230      UISelectionPanel new openInterface:#panelSpec
       
   231     "
       
   232 
       
   233     <resource: #canvas>
       
   234 
       
   235     ^
       
   236 
       
   237        #(#FullSpec
       
   238           #'window:' 
       
   239            #(#WindowSpec
       
   240               #'name:' 'uIPainterView'
       
   241               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   242               #'label:' 'unnamed'
       
   243               #'bounds:' #(#Rectangle 0 0 475 136)
       
   244           )
       
   245           #'component:' 
       
   246            #(#SpecCollection
       
   247               #'collection:' 
       
   248                #(
       
   249                  #(#HorizontalPanelViewSpec
       
   250                     #'name:' 'HorizontalPanelView'
       
   251                     #'layout:' #(#LayoutFrame 20 0 20 0 104 0 105 0)
       
   252                     #'component:' 
       
   253                      #(#SpecCollection
       
   254                         #'collection:' 
       
   255                          #(
       
   256                            #(#LabelSpec
       
   257                               #'name:' 'label1'
       
   258                               #'label:' 'A'
       
   259                               #'level:' 2
       
   260                               #'adjust:' #center
       
   261                               #'hasCharacterOrientedLabel:' true
       
   262                               #'extent:' #(#Point 23 23)
       
   263                               #'canUIDrag:' false
       
   264                           )
       
   265                            #(#LabelSpec
       
   266                               #'name:' 'label2'
       
   267                               #'label:' 'B'
       
   268                               #'level:' 2
       
   269                               #'adjust:' #center
       
   270                               #'hasCharacterOrientedLabel:' true
       
   271                               #'extent:' #(#Point 23 23)
       
   272                               #'canUIDrag:' false
       
   273                           )
       
   274                            #(#LabelSpec
       
   275                               #'name:' 'label3'
       
   276                               #'label:' 'C'
       
   277                               #'level:' 2
       
   278                               #'adjust:' #center
       
   279                               #'hasCharacterOrientedLabel:' true
       
   280                               #'extent:' #(#Point 23 23)
       
   281                               #'canUIDrag:' false
       
   282                           )
       
   283                         )
       
   284                     )
       
   285                     #'level:' 0
       
   286                     #'horizontalLayout:' #center
       
   287                     #'verticalLayout:' #center
       
   288                     #'horizontalSpace:' 3
       
   289                     #'verticalSpace:' 3
       
   290                 )
       
   291                  #(#VariableHorizontalPanelSpec
       
   292                     #'name:' 'VariableHorizontalPanel'
       
   293                     #'layout:' #(#LayoutFrame 249 0 20 0 337 0 105 0)
       
   294                     #'component:' 
       
   295                      #(#SpecCollection
       
   296                         #'collection:' 
       
   297                          #(
       
   298                            #(#LabelSpec
       
   299                               #'name:' 'label4'
       
   300                               #'label:' 'A'
       
   301                               #'level:' 2
       
   302                               #'adjust:' #center
       
   303                               #'hasCharacterOrientedLabel:' true
       
   304                               #'canUIDrag:' false
       
   305                           )
       
   306                            #(#LabelSpec
       
   307                               #'name:' 'label5'
       
   308                               #'label:' 'B'
       
   309                               #'level:' 2
       
   310                               #'adjust:' #center
       
   311                               #'hasCharacterOrientedLabel:' true
       
   312                               #'canUIDrag:' false
       
   313                           )
       
   314                         )
       
   315                     )
       
   316                 )
       
   317                  #(#VerticalPanelViewSpec
       
   318                     #'name:' 'VerticalPanelView'
       
   319                     #'layout:' #(#LayoutFrame 110 0 20 0 168 0 105 0)
       
   320                     #'component:' 
       
   321                      #(#SpecCollection
       
   322                         #'collection:' 
       
   323                          #(
       
   324                            #(#LabelSpec
       
   325                               #'name:' 'label6'
       
   326                               #'label:' 'A'
       
   327                               #'level:' 2
       
   328                               #'adjust:' #center
       
   329                               #'hasCharacterOrientedLabel:' true
       
   330                               #'extent:' #(#Point 23 23)
       
   331                               #'canUIDrag:' false
       
   332                           )
       
   333                            #(#LabelSpec
       
   334                               #'name:' 'label7'
       
   335                               #'label:' 'B'
       
   336                               #'level:' 2
       
   337                               #'adjust:' #center
       
   338                               #'hasCharacterOrientedLabel:' true
       
   339                               #'extent:' #(#Point 23 23)
       
   340                               #'canUIDrag:' false
       
   341                           )
       
   342                            #(#LabelSpec
       
   343                               #'name:' 'label8'
       
   344                               #'label:' 'C'
       
   345                               #'level:' 2
       
   346                               #'adjust:' #center
       
   347                               #'hasCharacterOrientedLabel:' true
       
   348                               #'extent:' #(#Point 23 23)
       
   349                               #'canUIDrag:' false
       
   350                           )
       
   351                         )
       
   352                     )
       
   353                     #'level:' 0
       
   354                     #'horizontalLayout:' #center
       
   355                     #'verticalLayout:' #center
       
   356                     #'horizontalSpace:' 3
       
   357                     #'verticalSpace:' 3
       
   358                 )
       
   359                  #(#VariableVerticalPanelSpec
       
   360                     #'name:' 'VariableVerticalPanel'
       
   361                     #'layout:' #(#LayoutFrame 342 0 20 0 426 0 105 0)
       
   362                     #'component:' 
       
   363                      #(#SpecCollection
       
   364                         #'collection:' 
       
   365                          #(
       
   366                            #(#LabelSpec
       
   367                               #'name:' 'label9'
       
   368                               #'label:' 'A'
       
   369                               #'level:' 2
       
   370                               #'adjust:' #center
       
   371                               #'hasCharacterOrientedLabel:' true
       
   372                               #'canUIDrag:' false
       
   373                           )
       
   374                            #(#LabelSpec
       
   375                               #'name:' 'label10'
       
   376                               #'label:' 'B'
       
   377                               #'level:' 2
       
   378                               #'adjust:' #center
       
   379                               #'hasCharacterOrientedLabel:' true
       
   380                               #'canUIDrag:' false
       
   381                           )
       
   382                         )
       
   383                     )
       
   384                 )
       
   385                  #(#PanelViewSpec
       
   386                     #'name:' 'PanelView'
       
   387                     #'layout:' #(#LayoutFrame 174 0 20 0 232 0 105 0)
       
   388                     #'component:' 
       
   389                      #(#SpecCollection
       
   390                         #'collection:' 
       
   391                          #(
       
   392                            #(#LabelSpec
       
   393                               #'name:' 'label11'
       
   394                               #'label:' 'A'
       
   395                               #'level:' 2
       
   396                               #'adjust:' #center
       
   397                               #'hasCharacterOrientedLabel:' true
       
   398                               #'extent:' #(#Point 23 23)
       
   399                               #'canUIDrag:' false
       
   400                           )
       
   401                            #(#LabelSpec
       
   402                               #'name:' 'label12'
       
   403                               #'label:' 'B'
       
   404                               #'level:' 2
       
   405                               #'adjust:' #center
       
   406                               #'hasCharacterOrientedLabel:' true
       
   407                               #'extent:' #(#Point 23 23)
       
   408                               #'canUIDrag:' false
       
   409                           )
       
   410                            #(#LabelSpec
       
   411                               #'name:' 'label13'
       
   412                               #'label:' 'C'
       
   413                               #'level:' 2
       
   414                               #'adjust:' #center
       
   415                               #'hasCharacterOrientedLabel:' true
       
   416                               #'extent:' #(#Point 23 23)
       
   417                               #'canUIDrag:' false
       
   418                           )
       
   419                            #(#LabelSpec
       
   420                               #'name:' 'label14'
       
   421                               #'label:' 'D'
       
   422                               #'level:' 2
       
   423                               #'adjust:' #center
       
   424                               #'hasCharacterOrientedLabel:' true
       
   425                               #'extent:' #(#Point 23 23)
       
   426                               #'canUIDrag:' false
       
   427                           )
       
   428                            #(#LabelSpec
       
   429                               #'name:' 'label15'
       
   430                               #'label:' 'E'
       
   431                               #'level:' 2
       
   432                               #'adjust:' #center
       
   433                               #'hasCharacterOrientedLabel:' true
       
   434                               #'extent:' #(#Point 23 23)
       
   435                               #'canUIDrag:' false
       
   436                           )
       
   437                         )
       
   438                     )
       
   439                     #'level:' 0
       
   440                     #'horizontalLayout:' #fitSpace
       
   441                     #'verticalLayout:' #fitSpace
       
   442                     #'horizontalSpace:' 3
       
   443                     #'verticalSpace:' 3
       
   444                 )
       
   445               )
       
   446           )
       
   447       )
       
   448 
       
   449 !
       
   450 
       
   451 sliderSpec
       
   452     "this window spec was automatically generated by the ST/X UIPainter"
       
   453 
       
   454     "do not manually edit this - the painter/builder may not be able to
       
   455      handle the specification if its corrupted."
       
   456 
       
   457     "
       
   458      UIPainter new openOnClass:UISelectionPanel andSelector:#sliderSpec
       
   459      UISelectionPanel new openInterface:#sliderSpec
       
   460     "
       
   461 
       
   462     <resource: #canvas>
       
   463 
       
   464     ^
       
   465 
       
   466        #(#FullSpec
       
   467           #'window:' 
       
   468            #(#WindowSpec
       
   469               #'name:' 'uIPainterView'
       
   470               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   471               #'label:' 'unnamed'
       
   472               #'bounds:' #(#Rectangle 0 0 445 162)
       
   473           )
       
   474           #'component:' 
       
   475            #(#SpecCollection
       
   476               #'collection:' 
       
   477                #(
       
   478                  #(#SliderSpec
       
   479                     #'name:' 'Vertical Slider'
       
   480                     #'layout:' #(#LayoutFrame 20 0 20 0 38 0 108 0)
       
   481                     #'orientation:' #vertical
       
   482                 )
       
   483                  #(#ThumbWheelSpec
       
   484                     #'name:' 'Vertical ThumbWheel'
       
   485                     #'layout:' #(#LayoutFrame 48 0 20 0 63 0 108 0)
       
   486                     #'orientation:' #vertical
       
   487                     #'start:' 0
       
   488                     #'stop:' 360
       
   489                 )
       
   490                  #(#ThumbWheelSpec
       
   491                     #'name:' 'Horizontal ThumbWheel'
       
   492                     #'layout:' #(#LayoutFrame 102 0 20 0 191 0 35 0)
       
   493                     #'orientation:' #horizontal
       
   494                     #'start:' 0
       
   495                     #'stop:' 360
       
   496                 )
       
   497                  #(#SliderSpec
       
   498                     #'name:' 'Horizontal Slider'
       
   499                     #'layout:' #(#LayoutFrame 102 0 47 0 191 0 65 0)
       
   500                     #'orientation:' #horizontal
       
   501                     #'start:' 0
       
   502                     #'stop:' 100
       
   503                 )
       
   504               )
       
   505           )
       
   506       )
       
   507 
       
   508 !
       
   509 
       
   510 textSpec
       
   511     "this window spec was automatically generated by the ST/X UIPainter"
       
   512 
       
   513     "do not manually edit this - the painter/builder may not be able to
       
   514      handle the specification if its corrupted."
       
   515 
       
   516     "
       
   517      UIPainter new openOnClass:UISelectionPanel andSelector:#textSpec
       
   518      UISelectionPanel new openInterface:#textSpec
       
   519     "
       
   520 
       
   521     <resource: #canvas>
       
   522 
       
   523     ^
       
   524 
       
   525        #(#FullSpec
       
   526           #'window:' 
       
   527            #(#WindowSpec
       
   528               #'name:' 'uIPainterView'
       
   529               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   530               #'label:' 'unnamed'
       
   531               #'bounds:' #(#Rectangle 0 0 573 264)
       
   532           )
       
   533           #'component:' 
       
   534            #(#SpecCollection
       
   535               #'collection:' 
       
   536                #(
       
   537                  #(#InputFieldSpec
       
   538                     #'name:' 'EditField'
       
   539                     #'layout:' #(#LayoutFrame 20 0 20 0 115 0 42 0)
       
   540                     #'immediateAccept:' false
       
   541                     #'acceptOnLeave:' true
       
   542                     #'acceptOnReturn:' true
       
   543                     #'acceptOnTab:' true
       
   544                     #'acceptOnLostFocus:' true
       
   545                     #'hasBorder:' false
       
   546                 )
       
   547                  #(#LabelSpec
       
   548                     #'name:' 'Text Label'
       
   549                     #'layout:' #(#LayoutFrame 20 0 50 0 115 0 66 0)
       
   550                     #'label:' 'Text Label'
       
   551                     #'level:' 0
       
   552                     #'adjust:' #center
       
   553                     #'hasCharacterOrientedLabel:' true
       
   554                 )
       
   555                  #(#TextEditorSpec
       
   556                     #'name:' 'EditTextView'
       
   557                     #'layout:' #(#LayoutFrame 130 0 20 0 234 0 100 0)
       
   558                     #'hasHorizontalScrollBar:' true
       
   559                     #'hasVerticalScrollBar:' true
       
   560                     #'miniScrollerHorizontal:' false
       
   561                     #'miniScrollerVertical:' false
       
   562                 )
       
   563                  #(#TextEditorSpec
       
   564                     #'name:' 'EditTextView miniH'
       
   565                     #'layout:' #(#LayoutFrame 246 0 20 0 350 0 100 0)
       
   566                     #'hasHorizontalScrollBar:' true
       
   567                     #'hasVerticalScrollBar:' true
       
   568                     #'miniScrollerHorizontal:' true
       
   569                     #'miniScrollerVertical:' false
       
   570                 )
       
   571                  #(#SequenceViewSpec
       
   572                     #'name:' 'SelectionInListView miniH'
       
   573                     #'layout:' #(#LayoutFrame 246 0 116 0 350 0 196 0)
       
   574                     #'hasHorizontalScrollBar:' true
       
   575                     #'hasVerticalScrollBar:' true
       
   576                     #'miniScrollerHorizontal:' true
       
   577                     #'miniScrollerVertical:' false
       
   578                 )
       
   579                  #(#SequenceViewSpec
       
   580                     #'name:' 'SelectionInListView'
       
   581                     #'layout:' #(#LayoutFrame 130 0 116 0 234 0 196 0)
       
   582                     #'hasHorizontalScrollBar:' true
       
   583                     #'hasVerticalScrollBar:' true
       
   584                     #'miniScrollerHorizontal:' false
       
   585                     #'miniScrollerVertical:' false
       
   586                 )
       
   587                  #(#TextEditorSpec
       
   588                     #'name:' 'EditTextView noH'
       
   589                     #'layout:' #(#LayoutFrame 364 0 20 0 468 0 100 0)
       
   590                     #'hasHorizontalScrollBar:' false
       
   591                     #'hasVerticalScrollBar:' true
       
   592                     #'miniScrollerHorizontal:' false
       
   593                     #'miniScrollerVertical:' false
       
   594                 )
       
   595                  #(#SequenceViewSpec
       
   596                     #'name:' 'scrollableView2'
       
   597                     #'layout:' #(#LayoutFrame 365 0 116 0 469 0 196 0)
       
   598                     #'hasHorizontalScrollBar:' false
       
   599                     #'hasVerticalScrollBar:' true
       
   600                     #'miniScrollerHorizontal:' false
       
   601                     #'miniScrollerVertical:' false
       
   602                 )
       
   603               )
       
   604           )
       
   605       )
       
   606 
       
   607 !
       
   608 
       
   609 viewsSpec
       
   610     "this window spec was automatically generated by the ST/X UIPainter"
       
   611 
       
   612     "do not manually edit this - the painter/builder may not be able to
       
   613      handle the specification if its corrupted."
       
   614 
       
   615     "
       
   616      UIPainter new openOnClass:UISelectionPanel andSelector:#viewsSpec
       
   617      UISelectionPanel new openInterface:#viewsSpec
       
   618     "
       
   619 
       
   620     <resource: #canvas>
       
   621 
       
   622     ^
       
   623 
       
   624        #(#FullSpec
       
   625           #'window:' 
       
   626            #(#WindowSpec
       
   627               #'name:' 'uIPainterView'
       
   628               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   629               #'label:' 'unnamed'
       
   630               #'bounds:' #(#Rectangle 0 0 485 245)
       
   631           )
       
   632           #'component:' 
       
   633            #(#SpecCollection
       
   634               #'collection:' 
       
   635                #(
       
   636                  #(#FramedBoxSpec
       
   637                     #'name:' 'FramedBox'
       
   638                     #'layout:' #(#LayoutFrame 20 0 20 0 122 0 95 0)
       
   639                     #'label:' 'FramedBox'
       
   640                     #'labelPosition:' #topCenter
       
   641                     #'showFrame:' true
       
   642                 )
       
   643                  #(#ViewSpec
       
   644                     #'name:' 'View'
       
   645                     #'layout:' #(#LayoutFrame 134 0 20 0 236 0 95 0)
       
   646                 )
       
   647                  #(#SubCanvasSpec
       
   648                     #'name:' 'SubCanvas'
       
   649                     #'layout:' #(#LayoutFrame 250 0 20 0 352 0 95 0)
       
   650                 )
       
   651                  #(#LabelSpec
       
   652                     #'name:' 'subCanvasLabel'
       
   653                     #'layout:' #(#LayoutFrame 266 0 25 0 337 0 42 0)
       
   654                     #'label:' 'SubCanvas'
       
   655                     #'level:' 0
       
   656                     #'adjust:' #center
       
   657                     #'hasCharacterOrientedLabel:' true
       
   658                     #'canUIDrag:' false
       
   659                 )
       
   660                  #(#DividerSpec
       
   661                     #'name:' 'Horizontal Seperator'
       
   662                     #'layout:' #(#LayoutFrame 20 0 111 0 353 0 128 0)
       
   663                     #'orientation:' #horizontal
       
   664                 )
       
   665                  #(#DividerSpec
       
   666                     #'name:' 'Vertical Seperator'
       
   667                     #'layout:' #(#LayoutFrame 364 0 20 0 383 0 128 0)
       
   668                     #'orientation:' #vertical
       
   669                 )
       
   670                  #(#LabelSpec
       
   671                     #'name:' 'viewLabel'
       
   672                     #'layout:' #(#LayoutFrame 160 0 25 0 211 0 42 0)
       
   673                     #'label:' 'View'
       
   674                     #'level:' 0
       
   675                     #'adjust:' #center
       
   676                     #'hasCharacterOrientedLabel:' true
       
   677                     #'canUIDrag:' false
       
   678                 )
       
   679               )
       
   680           )
       
   681       )
       
   682 
       
   683 ! !
       
   684 
       
   685 !UISelectionPanel class methodsFor:'interface specs'!
   249 
   686 
   250 menuComboSpec
   687 menuComboSpec
   251     "this window spec was automatically generated by the ST/X UIPainter"
   688     "this window spec was automatically generated by the ST/X UIPainter"
   252 
   689 
   253     "do not manually edit this - the painter/builder may not be able to
   690     "do not manually edit this - the painter/builder may not be able to
   266           #'window:' 
   703           #'window:' 
   267            #(#WindowSpec
   704            #(#WindowSpec
   268               #'name:' 'uIPainterView'
   705               #'name:' 'uIPainterView'
   269               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   706               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   270               #'label:' 'unnamed'
   707               #'label:' 'unnamed'
   271               #'bounds:' #(#Rectangle 0 0 450 100)
   708               #'bounds:' #(#Rectangle 0 0 464 253)
   272           )
   709           )
   273           #'component:' 
   710           #'component:' 
   274            #(#SpecCollection
   711            #(#SpecCollection
   275               #'collection:' 
   712               #'collection:' 
   276                #(
   713                #(
   292                  #(#PopUpListSpec
   729                  #(#PopUpListSpec
   293                     #'name:' 'PopUpList'
   730                     #'name:' 'PopUpList'
   294                     #'layout:' #(#LayoutFrame 145 0 20 0 248 0 42 0)
   731                     #'layout:' #(#LayoutFrame 145 0 20 0 248 0 42 0)
   295                     #'label:' 'PopUpList'
   732                     #'label:' 'PopUpList'
   296                 )
   733                 )
       
   734                  #(#MenuPanelSpec
       
   735                     #'name:' 'MenuPanel'
       
   736                     #'layout:' #(#LayoutFrame 145 0 51 0 248 0 73 0)
       
   737                 )
       
   738                  #(#TabViewSpec
       
   739                     #'name:' 'TabView'
       
   740                     #'layout:' #(#LayoutFrame 269 0 20 0 409 0 56 0)
       
   741                     #'tabWidget:' #Window
       
   742                     #'direction:' #top
       
   743                     #'useIndex:' false
       
   744                     #'fitLastRow:' true
       
   745                     #'moveSelectedRow:' true
       
   746                 )
       
   747                  #(#NoteBookViewSpec
       
   748                     #'name:' 'noteBookView'
       
   749                     #'layout:' #(#LayoutFrame 269 0 66 0 409 0 182 0)
       
   750                     #'tabWidget:' #Window
       
   751                     #'direction:' #top
       
   752                     #'useIndex:' false
       
   753                     #'fitLastRow:' true
       
   754                     #'moveSelectedRow:' true
       
   755                     #'level:' 2
       
   756                 )
   297               )
   757               )
   298           )
   758           )
   299       )
   759       )
   300 !
   760 !
   301 
   761 
   302 panelSpec
   762 windowSpec
   303     "this window spec was automatically generated by the ST/X UIPainter"
   763     "this window spec was automatically generated by the ST/X UIPainter"
   304 
   764 
   305     "do not manually edit this - the painter/builder may not be able to
   765     "do not manually edit this - the painter/builder may not be able to
   306      handle the specification if its corrupted."
   766      handle the specification if its corrupted."
   307 
   767 
   308     "
   768     "
   309      UIPainter new openOnClass:UISelectionPanel andSelector:#panelSpec
   769      UIPainter new openOnClass:UISelectionPanel andSelector:#windowSpec
   310      UISelectionPanel new openInterface:#panelSpec
   770      UISelectionPanel new openInterface:#windowSpec
   311     "
   771     "
       
   772     "UISelectionPanel open"
   312 
   773 
   313     <resource: #canvas>
   774     <resource: #canvas>
   314 
   775 
   315     ^
   776     ^
   316      
   777      
   317        #(#FullSpec
   778        #(#FullSpec
   318           #'window:' 
   779           #'window:' 
   319            #(#WindowSpec
   780            #(#WindowSpec
   320               #'name:' 'uIPainterView'
   781               #'name:' 'uIPainterView'
   321               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   782               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   322               #'label:' 'unnamed'
   783               #'label:' 'Tree-View'
   323               #'bounds:' #(#Rectangle 0 0 475 136)
   784               #'bounds:' #(#Rectangle 0 0 480 260)
   324           )
   785           )
   325           #'component:' 
   786           #'component:' 
   326            #(#SpecCollection
   787            #(#SpecCollection
   327               #'collection:' 
   788               #'collection:' 
   328                #(
   789                #(
   329                  #(#HorizontalPanelViewSpec
       
   330                     #'name:' 'HorizontalPanelView'
       
   331                     #'layout:' #(#LayoutFrame 20 0 20 0 104 0 105 0)
       
   332                     #'component:' 
       
   333                      #(#SpecCollection
       
   334                         #'collection:' 
       
   335                          #(
       
   336                            #(#ActionButtonSpec
       
   337                               #'name:' 'button1'
       
   338                               #'label:' 'A'
       
   339                               #'isTriggerOnDown:' false
       
   340                               #'extent:' #(#Point 22 23)
       
   341                               #'canUIDrag:' false
       
   342                           )
       
   343                            #(#ActionButtonSpec
       
   344                               #'name:' 'button8'
       
   345                               #'label:' 'B'
       
   346                               #'isTriggerOnDown:' false
       
   347                               #'extent:' #(#Point 22 23)
       
   348                               #'canUIDrag:' false
       
   349                           )
       
   350                            #(#ActionButtonSpec
       
   351                               #'name:' 'button9'
       
   352                               #'label:' 'C'
       
   353                               #'isTriggerOnDown:' false
       
   354                               #'extent:' #(#Point 22 23)
       
   355                               #'canUIDrag:' false
       
   356                           )
       
   357                         )
       
   358                     )
       
   359                     #'level:' 0
       
   360                     #'horizontalLayout:' #center
       
   361                     #'verticalLayout:' #center
       
   362                     #'horizontalSpace:' 3
       
   363                     #'verticalSpace:' 3
       
   364                 )
       
   365                  #(#VariableHorizontalPanelSpec
       
   366                     #'name:' 'VariableHorizontalPanel'
       
   367                     #'layout:' #(#LayoutFrame 275 0 20 0 363 0 105 0)
       
   368                     #'component:' 
       
   369                      #(#SpecCollection
       
   370                         #'collection:' 
       
   371                          #(
       
   372                            #(#ActionButtonSpec
       
   373                               #'name:' 'button2'
       
   374                               #'label:' 'A'
       
   375                               #'isTriggerOnDown:' false
       
   376                               #'canUIDrag:' false
       
   377                           )
       
   378                            #(#ActionButtonSpec
       
   379                               #'name:' 'button3'
       
   380                               #'label:' 'B'
       
   381                               #'isTriggerOnDown:' false
       
   382                               #'canUIDrag:' false
       
   383                           )
       
   384                         )
       
   385                     )
       
   386                 )
       
   387                  #(#VerticalPanelViewSpec
       
   388                     #'name:' 'VerticalPanelView'
       
   389                     #'layout:' #(#LayoutFrame 110 0 20 0 191 0 105 0)
       
   390                     #'component:' 
       
   391                      #(#SpecCollection
       
   392                         #'collection:' 
       
   393                          #(
       
   394                            #(#ActionButtonSpec
       
   395                               #'name:' 'button4'
       
   396                               #'label:' 'A'
       
   397                               #'isTriggerOnDown:' false
       
   398                               #'extent:' #(#Point 22 23)
       
   399                               #'canUIDrag:' false
       
   400                           )
       
   401                            #(#ActionButtonSpec
       
   402                               #'name:' 'button5'
       
   403                               #'label:' 'B'
       
   404                               #'isTriggerOnDown:' false
       
   405                               #'extent:' #(#Point 22 23)
       
   406                               #'canUIDrag:' false
       
   407                           )
       
   408                            #(#ActionButtonSpec
       
   409                               #'name:' 'button10'
       
   410                               #'label:' 'C'
       
   411                               #'isTriggerOnDown:' false
       
   412                               #'extent:' #(#Point 22 23)
       
   413                               #'canUIDrag:' false
       
   414                           )
       
   415                         )
       
   416                     )
       
   417                     #'level:' 0
       
   418                     #'horizontalLayout:' #center
       
   419                     #'verticalLayout:' #center
       
   420                     #'horizontalSpace:' 3
       
   421                     #'verticalSpace:' 3
       
   422                 )
       
   423                  #(#VariableVerticalPanelSpec
       
   424                     #'name:' 'VariableVerticalPanel'
       
   425                     #'layout:' #(#LayoutFrame 372 0 20 0 456 0 105 0)
       
   426                     #'component:' 
       
   427                      #(#SpecCollection
       
   428                         #'collection:' 
       
   429                          #(
       
   430                            #(#ActionButtonSpec
       
   431                               #'name:' 'button6'
       
   432                               #'label:' 'A'
       
   433                               #'isTriggerOnDown:' false
       
   434                               #'canUIDrag:' false
       
   435                           )
       
   436                            #(#ActionButtonSpec
       
   437                               #'name:' 'button7'
       
   438                               #'label:' 'B'
       
   439                               #'isTriggerOnDown:' false
       
   440                               #'canUIDrag:' false
       
   441                           )
       
   442                         )
       
   443                     )
       
   444                 )
       
   445                  #(#PanelViewSpec
       
   446                     #'name:' 'PanelView'
       
   447                     #'layout:' #(#LayoutFrame 197 0 20 0 255 0 105 0)
       
   448                     #'component:' 
       
   449                      #(#SpecCollection
       
   450                         #'collection:' 
       
   451                          #(
       
   452                            #(#ActionButtonSpec
       
   453                               #'name:' 'button11'
       
   454                               #'label:' 'A'
       
   455                               #'isTriggerOnDown:' false
       
   456                               #'extent:' #(#Point 22 23)
       
   457                               #'canUIDrag:' false
       
   458                           )
       
   459                            #(#ActionButtonSpec
       
   460                               #'name:' 'button12'
       
   461                               #'label:' 'B'
       
   462                               #'isTriggerOnDown:' false
       
   463                               #'extent:' #(#Point 22 23)
       
   464                               #'canUIDrag:' false
       
   465                           )
       
   466                            #(#ActionButtonSpec
       
   467                               #'name:' 'button13'
       
   468                               #'label:' 'C'
       
   469                               #'isTriggerOnDown:' false
       
   470                               #'extent:' #(#Point 22 23)
       
   471                               #'canUIDrag:' false
       
   472                           )
       
   473                            #(#ActionButtonSpec
       
   474                               #'name:' 'button14'
       
   475                               #'label:' 'D'
       
   476                               #'isTriggerOnDown:' false
       
   477                               #'extent:' #(#Point 22 23)
       
   478                               #'canUIDrag:' false
       
   479                           )
       
   480                            #(#ActionButtonSpec
       
   481                               #'name:' 'button15'
       
   482                               #'label:' 'E'
       
   483                               #'isTriggerOnDown:' false
       
   484                               #'extent:' #(#Point 22 23)
       
   485                               #'canUIDrag:' false
       
   486                           )
       
   487                         )
       
   488                     )
       
   489                     #'level:' 0
       
   490                     #'horizontalLayout:' #fitSpace
       
   491                     #'verticalLayout:' #fitSpace
       
   492                     #'horizontalSpace:' 3
       
   493                     #'verticalSpace:' 3
       
   494                 )
       
   495               )
       
   496           )
       
   497       )
       
   498 !
       
   499 
       
   500 sliderSpec
       
   501     "this window spec was automatically generated by the ST/X UIPainter"
       
   502 
       
   503     "do not manually edit this - the painter/builder may not be able to
       
   504      handle the specification if its corrupted."
       
   505 
       
   506     "
       
   507      UIPainter new openOnClass:UISelectionPanel andSelector:#sliderSpec
       
   508      UISelectionPanel new openInterface:#sliderSpec
       
   509     "
       
   510 
       
   511     <resource: #canvas>
       
   512 
       
   513     ^
       
   514      
       
   515        #(#FullSpec
       
   516           #'window:' 
       
   517            #(#WindowSpec
       
   518               #'name:' 'uIPainterView'
       
   519               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   520               #'label:' 'unnamed'
       
   521               #'bounds:' #(#Rectangle 0 0 445 162)
       
   522           )
       
   523           #'component:' 
       
   524            #(#SpecCollection
       
   525               #'collection:' 
       
   526                #(
       
   527                  #(#SliderSpec
       
   528                     #'name:' 'Vertical Slider'
       
   529                     #'layout:' #(#LayoutFrame 20 0 20 0 38 0 108 0)
       
   530                     #'orientation:' #vertical
       
   531                 )
       
   532                  #(#ThumbWheelSpec
       
   533                     #'name:' 'Vertical ThumbWheel'
       
   534                     #'layout:' #(#LayoutFrame 48 0 20 0 63 0 108 0)
       
   535                     #'orientation:' #vertical
       
   536                     #'start:' 0
       
   537                     #'stop:' 360
       
   538                 )
       
   539                  #(#ThumbWheelSpec
       
   540                     #'name:' 'Horizontal ThumbWheel'
       
   541                     #'layout:' #(#LayoutFrame 102 0 20 0 191 0 35 0)
       
   542                     #'orientation:' #horizontal
       
   543                     #'start:' 0
       
   544                     #'stop:' 360
       
   545                 )
       
   546                  #(#SliderSpec
       
   547                     #'name:' 'Horizontal Slider'
       
   548                     #'layout:' #(#LayoutFrame 102 0 47 0 191 0 65 0)
       
   549                     #'orientation:' #horizontal
       
   550                     #'start:' 0
       
   551                     #'stop:' 100
       
   552                 )
       
   553               )
       
   554           )
       
   555       )
       
   556 !
       
   557 
       
   558 textSpec
       
   559     "this window spec was automatically generated by the ST/X UIPainter"
       
   560 
       
   561     "do not manually edit this - the painter/builder may not be able to
       
   562      handle the specification if its corrupted."
       
   563 
       
   564     "
       
   565      UIPainter new openOnClass:UISelectionPanel andSelector:#textSpec
       
   566      UISelectionPanel new openInterface:#textSpec
       
   567     "
       
   568 
       
   569     <resource: #canvas>
       
   570 
       
   571     ^
       
   572      
       
   573        #(#FullSpec
       
   574           #'window:' 
       
   575            #(#WindowSpec
       
   576               #'name:' 'uIPainterView'
       
   577               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   578               #'label:' 'unnamed'
       
   579               #'bounds:' #(#Rectangle 0 0 573 264)
       
   580           )
       
   581           #'component:' 
       
   582            #(#SpecCollection
       
   583               #'collection:' 
       
   584                #(
       
   585                  #(#InputFieldSpec
       
   586                     #'name:' 'EditField'
       
   587                     #'layout:' #(#LayoutFrame 20 0 20 0 115 0 42 0)
       
   588                     #'immediateAccept:' false
       
   589                     #'acceptOnLeave:' true
       
   590                     #'acceptOnReturn:' true
       
   591                     #'acceptOnTab:' true
       
   592                     #'acceptOnLostFocus:' true
       
   593                     #'hasBorder:' false
       
   594                 )
       
   595                  #(#LabelSpec
   790                  #(#LabelSpec
   596                     #'name:' 'Text Label'
   791                     #'name:' 'label1'
   597                     #'layout:' #(#LayoutFrame 20 0 50 0 115 0 66 0)
   792                     #'layout:' #(#LayoutFrame 0 0.0 -20 1.0 0 1.0 0 1.0)
   598                     #'label:' 'Text Label'
   793                     #'label:' 'selection'
   599                     #'level:' 0
   794                     #'labelChannel:' #'nameOfObject'
       
   795                     #'level:' 2
   600                     #'adjust:' #center
   796                     #'adjust:' #center
   601                     #'hasCharacterOrientedLabel:' true
   797                     #'hasCharacterOrientedLabel:' false
   602                 )
   798                 )
   603                  #(#TextEditorSpec
   799                  #(#NoteBookViewSpec
   604                     #'name:' 'EditTextView'
   800                     #'name:' 'noteBookView1'
   605                     #'layout:' #(#LayoutFrame 130 0 20 0 234 0 100 0)
   801                     #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -21 1.0)
   606                     #'hasHorizontalScrollBar:' true
   802                     #'model:' #tabModel
   607                     #'hasVerticalScrollBar:' true
   803                     #'menu:' #tabList
   608                     #'miniScrollerHorizontal:' false
       
   609                     #'miniScrollerVertical:' false
       
   610                 )
       
   611                  #(#TextEditorSpec
       
   612                     #'name:' 'EditTextView miniH'
       
   613                     #'layout:' #(#LayoutFrame 246 0 20 0 350 0 100 0)
       
   614                     #'hasHorizontalScrollBar:' true
       
   615                     #'hasVerticalScrollBar:' true
       
   616                     #'miniScrollerHorizontal:' true
       
   617                     #'miniScrollerVertical:' false
       
   618                 )
       
   619                  #(#SequenceViewSpec
       
   620                     #'name:' 'SelectionInListView miniH'
       
   621                     #'layout:' #(#LayoutFrame 246 0 116 0 350 0 196 0)
       
   622                     #'hasHorizontalScrollBar:' true
       
   623                     #'hasVerticalScrollBar:' true
       
   624                     #'miniScrollerHorizontal:' true
       
   625                     #'miniScrollerVertical:' false
       
   626                 )
       
   627                  #(#SequenceViewSpec
       
   628                     #'name:' 'SelectionInListView'
       
   629                     #'layout:' #(#LayoutFrame 130 0 116 0 234 0 196 0)
       
   630                     #'hasHorizontalScrollBar:' true
       
   631                     #'hasVerticalScrollBar:' true
       
   632                     #'miniScrollerHorizontal:' false
       
   633                     #'miniScrollerVertical:' false
       
   634                 )
       
   635                  #(#TextEditorSpec
       
   636                     #'name:' 'EditTextView noH'
       
   637                     #'layout:' #(#LayoutFrame 364 0 20 0 468 0 100 0)
       
   638                     #'hasHorizontalScrollBar:' false
       
   639                     #'hasVerticalScrollBar:' true
       
   640                     #'miniScrollerHorizontal:' false
       
   641                     #'miniScrollerVertical:' false
       
   642                 )
       
   643                  #(#SequenceViewSpec
       
   644                     #'name:' 'scrollableView2'
       
   645                     #'layout:' #(#LayoutFrame 365 0 116 0 469 0 196 0)
       
   646                     #'hasHorizontalScrollBar:' false
       
   647                     #'hasVerticalScrollBar:' true
       
   648                     #'miniScrollerHorizontal:' false
       
   649                     #'miniScrollerVertical:' false
       
   650                 )
       
   651               )
       
   652           )
       
   653       )
       
   654 !
       
   655 
       
   656 viewsSpec
       
   657     "this window spec was automatically generated by the ST/X UIPainter"
       
   658 
       
   659     "do not manually edit this - the painter/builder may not be able to
       
   660      handle the specification if its corrupted."
       
   661 
       
   662     "
       
   663      UIPainter new openOnClass:UISelectionPanel andSelector:#viewsSpec
       
   664      UISelectionPanel new openInterface:#viewsSpec
       
   665     "
       
   666 
       
   667     <resource: #canvas>
       
   668 
       
   669     ^
       
   670      
       
   671        #(#FullSpec
       
   672           #'window:' 
       
   673            #(#WindowSpec
       
   674               #'name:' 'uIPainterView'
       
   675               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
   676               #'label:' 'unnamed'
       
   677               #'bounds:' #(#Rectangle 0 0 457 177)
       
   678           )
       
   679           #'component:' 
       
   680            #(#SpecCollection
       
   681               #'collection:' 
       
   682                #(
       
   683                  #(#FramedBoxSpec
       
   684                     #'name:' 'FramedBox'
       
   685                     #'layout:' #(#LayoutFrame 20 0 20 0 125 0 75 0)
       
   686                     #'label:' 'FramedBox'
       
   687                     #'labelPosition:' #topCenter
       
   688                     #'showFrame:' true
       
   689                 )
       
   690                  #(#ViewSpec
       
   691                     #'name:' 'View'
       
   692                     #'layout:' #(#LayoutFrame 134 0 20 0 239 0 75 0)
       
   693                     #'component:' 
       
   694                      #(#SpecCollection
       
   695                         #'collection:' 
       
   696                          #(
       
   697                            #(#LabelSpec
       
   698                               #'name:' 'label1'
       
   699                               #'layout:' #(#Point 3 2)
       
   700                               #'label:' 'View'
       
   701                               #'level:' 0
       
   702                               #'adjust:' #center
       
   703                               #'hasCharacterOrientedLabel:' true
       
   704                               #'canUIDrag:' false
       
   705                           )
       
   706                         )
       
   707                     )
       
   708                 )
       
   709                  #(#SubCanvasSpec
       
   710                     #'name:' 'SubCanvas'
       
   711                     #'layout:' #(#LayoutFrame 134 0 87 0 239 0 142 0)
       
   712                 )
       
   713                  #(#LabelSpec
       
   714                     #'name:' 'label2'
       
   715                     #'layout:' #(#Point 136 87)
       
   716                     #'label:' 'SubCanvas'
       
   717                     #'level:' 0
       
   718                     #'adjust:' #center
       
   719                     #'hasCharacterOrientedLabel:' true
       
   720                     #'canUIDrag:' false
       
   721                 )
       
   722                  #(#DividerSpec
       
   723                     #'name:' 'Horizontal Seperator'
       
   724                     #'layout:' #(#LayoutFrame 292 0 20 0 356 0 37 0)
       
   725                     #'orientation:' #horizontal
       
   726                 )
       
   727                  #(#DividerSpec
       
   728                     #'name:' 'Vertical Seperator'
       
   729                     #'layout:' #(#LayoutFrame 267 0 20 0 286 0 75 0)
       
   730                     #'orientation:' #vertical
       
   731                 )
       
   732                  #(#TabViewSpec
       
   733                     #'name:' 'TabView'
       
   734                     #'layout:' #(#LayoutFrame 20 0 87 0 125 0 142 0)
       
   735                     #'tabWidget:' #Window
   804                     #'tabWidget:' #Window
   736                     #'direction:' #top
   805                     #'direction:' #top
   737                     #'fitLastRow:' true
   806                     #'fitLastRow:' true
       
   807                     #'useIndex:' true
   738                     #'moveSelectedRow:' true
   808                     #'moveSelectedRow:' true
   739                 )
   809                     #'level:' 2
   740                  #(#LabelSpec
   810                     #'canvas:' #canvas
   741                     #'name:' 'label3'
       
   742                     #'layout:' #(#Point 23 87)
       
   743                     #'label:' 'TabView'
       
   744                     #'level:' 0
       
   745                     #'adjust:' #center
       
   746                     #'hasCharacterOrientedLabel:' true
       
   747                     #'canUIDrag:' false
       
   748                 )
   811                 )
   749               )
   812               )
   750           )
   813           )
   751       )
   814       )
   752 ! !
   815 ! !
   753 
   816 
   754 !UISelectionPanel methodsFor:'accessing'!
   817 !UISelectionPanel methodsFor:'accessing'!
   755 
   818 
   756 labels:labels selectors:selectors receiver:receiver
   819 labels:loLabels selectors:loSelectors receiver:aReceiver
   757     "change specification and tabs
   820     selectors := loSelectors.
   758     "
   821     receiver := aReceiver.
   759     tabView action:[:aNrOrNil||spec|
   822     (self tabList) value:loLabels.
   760         aNrOrNil notNil ifTrue:[
   823 
   761             spec := receiver perform:(selectors at:aNrOrNil).
   824 ! !
       
   825 
       
   826 !UISelectionPanel methodsFor:'aspects'!
       
   827 
       
   828 canvas
       
   829     |holder|
       
   830 
       
   831     (holder := builder bindingAt:#canvas) isNil ifTrue:[
       
   832         builder aspectAt:#canvas put:(holder := Canvas new)
       
   833     ].
       
   834     ^ holder
       
   835 !
       
   836 
       
   837 nameOfObject
       
   838     |holder canvas|
       
   839 
       
   840     (holder := builder bindingAt:#nameOfObject) isNil ifTrue:[
       
   841         builder aspectAt:#nameOfObject put:(holder := ValueHolder new).
       
   842         canvas := self canvas.
       
   843         canvas nameHolder:holder.
       
   844     ].
       
   845     ^ holder
       
   846 !
       
   847 
       
   848 tabList
       
   849     "returns list of tab-labels
       
   850     "
       
   851     |holder|
       
   852 
       
   853     (holder := builder bindingAt:#tabList) isNil ifTrue:[
       
   854         builder aspectAt:#tabList put:(holder := ValueHolder new).
       
   855     ].
       
   856     ^ holder
       
   857 !
       
   858 
       
   859 tabModel
       
   860     "returns my model; catching select notifications
       
   861     "
       
   862     |holder|
       
   863 
       
   864     (holder := builder bindingAt:#tabModel) isNil ifTrue:[
       
   865         holder := AspectAdaptor new subject:self; forAspect:#selection.
       
   866         builder aspectAt:#tabModel put:holder.
       
   867     ].
       
   868     ^ holder
       
   869 
       
   870 ! !
       
   871 
       
   872 !UISelectionPanel methodsFor:'selection'!
       
   873 
       
   874 selection
       
   875     ^ selection
       
   876 !
       
   877 
       
   878 selection:aValue
       
   879     |spec|
       
   880 
       
   881     selection ~~ aValue ifTrue:[
       
   882         (selection := aValue) notNil ifTrue:[
       
   883             selectors size >= aValue ifTrue:[
       
   884                 spec := receiver perform:(selectors at:selection)
       
   885             ]
   762         ].
   886         ].
   763         self specification:spec.
   887         (builder aspectAt:#canvas) specification:spec
   764     ].
   888     ].
   765     tabView list:labels.
   889 ! !
   766     self recomputeSizes.
   890 
   767 
   891 !UISelectionPanel::Canvas methodsFor:'accessing'!
   768 
   892 
   769 !
   893 nameHolder:aValueHolder
   770 
   894     "set value holder which keeps the name of the object
   771 specification:specOrSpecArray
   895      under the cursor or selected
   772     "load a spec
   896     "
       
   897     nameHolder := aValueHolder
       
   898 !
       
   899 
       
   900 specification:aSpecOrSpecArray
       
   901     "load a new specification
   773     "
   902     "
   774     |builder|
   903     |builder|
   775 
   904 
   776     self selection:nil.
   905     self selection:nil.
   777     labelView label:''.
   906 
   778 
   907     self subViews copy do:[:aSubView|
   779     window subViews copy do:[:aSubView|
       
   780         aSubView ~~ inputView ifTrue:[
   908         aSubView ~~ inputView ifTrue:[
   781             aSubView == labelView ifTrue:[self halt].
       
   782             aSubView destroy
   909             aSubView destroy
   783         ]
   910         ]
   784     ].
   911     ].
   785 
   912 
   786     specOrSpecArray notNil ifTrue:[
   913     aSpecOrSpecArray notNil ifTrue:[
   787         specification := UISpecification from:specOrSpecArray.
   914         specification := UISpecification from:aSpecOrSpecArray.
   788 
       
   789         builder := UIBuilder new.
   915         builder := UIBuilder new.
   790         specification buildViewFor:builder in:window.
   916         specification buildViewFor:builder in:self.
   791         window realizeAllSubViews.
   917         self realizeAllSubViews.
   792         inputView raise.
   918         inputView raise.
       
   919     ] ifFalse:[
       
   920         specification := nil
   793     ]
   921     ]
   794 ! !
   922 
   795 
   923 ! !
   796 !UISelectionPanel methodsFor:'change & update'!
   924 
   797 
   925 !UISelectionPanel::Canvas methodsFor:'drag & drop'!
   798 recomputeSizes
   926 
   799     "recompute sizes dependent on list
   927 buildSpecFrom:aSpec
   800     "
   928     "build spec out of spec
   801     |y x extent|
   929     "
   802 
   930     |spec comp coll|
   803     extent := tabView preferredExtent.
   931 
   804     x := extent x.
   932     (aSpec notNil and:[aSpec canUIDrag]) ifFalse:[
   805 
   933         ^ nil
   806     x <= (self extent x) ifTrue:[
   934     ].
   807         y := extent y.
   935 
   808     ] ifFalse:[
   936     spec := aSpec copy.
   809         y := tabView preferredSizeXorY.
   937 
   810     ].
   938     (aSpec class supportsSubComponents and:[aSpec component notNil]) ifFalse:[
   811     tabView bottomInset:(y negated).
   939         ^ spec
   812     window  topInset:y.
   940     ].
   813 
   941     comp := aSpec component.
   814 
   942     spec component:nil.
   815 !
   943 
   816 
   944     comp canUIDrag ifFalse:[
   817 update:something with:aParameter from:changedObject
   945       ^ spec
   818     "tabView might change its size
   946     ].
   819     "
   947     coll := OrderedCollection new.
   820     (something == #preferredExtent and:[changedObject == tabView]) ifFalse:[
   948 
   821         ^ self
   949     comp do:[:anEntry||spc|
   822     ].
   950         (spc := self buildSpecFrom:anEntry) notNil ifTrue:[
   823     self recomputeSizes
   951             coll add:spc
   824 
   952         ]
   825 
   953     ].
   826 ! !
   954     coll isEmpty ifTrue:[
   827 
   955       ^ spec
   828 !UISelectionPanel methodsFor:'drag & drop'!
   956     ].
       
   957     comp := comp copy.
       
   958     comp collection:coll.
       
   959     spec component:comp.
       
   960   ^ spec
       
   961 
       
   962 
       
   963 !
   829 
   964 
   830 startDrag
   965 startDrag
   831     "start drag of selection
   966     "start drag of selection
   832     "
   967     "
   833     |dragObj spec|
   968     |dragObj spec name|
   834 
   969 
   835     spec := self findSpecFor:selection.
   970     spec := self findSpecFor:selection.
   836 
   971 
   837     spec notNil ifTrue:[
   972     spec notNil ifTrue:[
   838         spec := self buildSpecFrom:spec.
   973         spec := self buildSpecFrom:spec.
       
   974         name := spec className asString.
       
   975         name := name copyFrom:1 to:(name size - ('Spec' size) + 1). 
       
   976         name at:1 put:(name at:1) asLowercase.
       
   977         name at:(name size) put:$1.
       
   978         spec name:name.
   839 
   979 
   840         self showUnselected.
   980         self showUnselected.
   841         dragObj := DropSpecification for:selection specification:spec.
   981         dragObj := DropSpecification for:selection specification:spec.
   842         self showSelected.
   982         self showSelected.
   843         DragAndDropManager startDrag:dragObj from:inputView.
   983         DragAndDropManager startDrag:dragObj from:inputView.
   844     ]
   984     ]
   845 
   985 
   846 ! !
   986 
   847 
   987 ! !
   848 !UISelectionPanel methodsFor:'event handling'!
   988 
       
   989 !UISelectionPanel::Canvas methodsFor:'event handling'!
   849 
   990 
   850 buttonMotion:state x:x y:y
   991 buttonMotion:state x:x y:y
   851     "start a drag on selection
   992     "start a drag on selection
   852     "
   993     "
   853     |obj sensor|
   994     |obj sensor|
   858             (lastClickPoint dist:(x@y)) > 10.0 ifTrue:[
   999             (lastClickPoint dist:(x@y)) > 10.0 ifTrue:[
   859                 self startDrag
  1000                 self startDrag
   860             ]
  1001             ]
   861         ]
  1002         ]
   862     ] ifFalse:[
  1003     ] ifFalse:[
   863         obj := self findObjectAtX:x y:y.
  1004         (nameHolder notNil and:[(obj := self findObjectAtX:x y:y) notNil]) ifTrue:[
   864 
  1005             nameHolder value:(obj name)
   865         obj notNil ifTrue:[
       
   866             labelView label:obj name
       
   867         ]
  1006         ]
   868     ].
  1007     ]
       
  1008 
   869 !
  1009 !
   870 
  1010 
   871 buttonPress:button x:x y:y
  1011 buttonPress:button x:x y:y
   872     "change selection
  1012     "change selection
   873     "
  1013     "
   875     self selection:(self findObjectAtX:x y:y).
  1015     self selection:(self findObjectAtX:x y:y).
   876 
  1016 
   877 
  1017 
   878 !
  1018 !
   879 
  1019 
   880 doesNotUnderstand:aMessage
       
   881     "any event message not catched; discard message
       
   882     "
       
   883 
       
   884 
       
   885 !
       
   886 
       
   887 exposeX:x y:y width:w height:h
  1020 exposeX:x y:y width:w height:h
   888     "handle an expose event from device; redraw selection
  1021     "handle an expose event from device; redraw selection
   889     "
  1022     "
   890     super exposeX:x y:y width:w height:h.
  1023     super exposeX:x y:y width:w height:h.
   891     self showSelected.
  1024     self showSelected.
   892 
  1025 
   893 ! !
  1026 
   894 
  1027 ! !
   895 !UISelectionPanel methodsFor:'initialization'!
  1028 
       
  1029 !UISelectionPanel::Canvas methodsFor:'initialization'!
   896 
  1030 
   897 initialize
  1031 initialize
   898     |y|
       
   899 
       
   900     super initialize.
  1032     super initialize.
   901     tabView   := TabView           origin:0.0@0.0 corner:1.0@0.0 in:self.
  1033 
   902     window    := NoteBookFrameView origin:0.0@0.0 corner:1.0@1.0 in:self.
  1034     inputView := InputView origin:0.0@0.0 extent:1.0@1.0 in:self.
   903     labelView := Label             origin:0.0@1.0 corner:1.0@1.0 in:self.
       
   904     inputView := InputView         origin:0.0@0.0 extent:1.0@1.0 in:window.
       
   905 
       
   906     y := labelView preferredExtent y.
       
   907     window bottomInset:y.
       
   908     labelView topInset:(y negated).
       
   909 
  1035 
   910     inputView eventReceiver:self.
  1036     inputView eventReceiver:self.
   911     inputView enableButtonEvents.
  1037     inputView enableButtonEvents.
   912     inputView enableButtonMotionEvents.
  1038     inputView enableButtonMotionEvents.
   913     inputView enableMotionEvents.
  1039     inputView enableMotionEvents.
   914     inputView delegate:(KeyboardForwarder from:inputView toView:tabView).
  1040 
   915 
  1041 ! !
   916 
  1042 
   917     tabView tabWidget:#Window.
  1043 !UISelectionPanel::Canvas methodsFor:'searching'!
   918     tabView useIndex:true.
       
   919 
       
   920     tabView styleAt:#expandSelection   put:6@2.
       
   921     tabView font:(Label defaultFont).
       
   922     tabView addDependent:self.
       
   923     self delegate:(KeyboardForwarder from:self toView:tabView).
       
   924 
       
   925     window     viewBackground:(tabView styleAt:#selectedColor).
       
   926     labelView backgroundColor:(tabView styleAt:#unselectedColor).
       
   927 
       
   928 ! !
       
   929 
       
   930 !UISelectionPanel methodsFor:'searching'!
       
   931 
       
   932 buildSpecFrom:aSpec
       
   933     "build spec out of spec
       
   934     "
       
   935     |spec comp coll|
       
   936 
       
   937     (aSpec notNil and:[aSpec canUIDrag]) ifFalse:[
       
   938         ^ nil
       
   939     ].
       
   940 
       
   941     (aSpec class supportsSubComponents and:[aSpec component notNil]) ifFalse:[
       
   942         ^ aSpec
       
   943     ].
       
   944     comp := aSpec component.
       
   945     spec := aSpec copy.
       
   946     spec component:nil.
       
   947 
       
   948     comp canUIDrag ifFalse:[
       
   949       ^ spec
       
   950     ].
       
   951     coll := OrderedCollection new.
       
   952 
       
   953     comp do:[:anEntry||spc|
       
   954         (spc := self buildSpecFrom:anEntry) notNil ifTrue:[
       
   955             coll add:spc
       
   956         ]
       
   957     ].
       
   958     coll isEmpty ifTrue:[
       
   959       ^ spec
       
   960     ].
       
   961     comp := comp copy.
       
   962     comp collection:coll.
       
   963     spec component:comp.
       
   964   ^ spec
       
   965 !
       
   966 
  1044 
   967 findObjectAtX:x y:y
  1045 findObjectAtX:x y:y
   968     "find the origin/corner of the currentWidget
  1046     "find the origin/corner of the currentWidget
   969     "
  1047     "
   970     |view viewId point|
  1048     |view viewId point|
   971 
  1049 
   972     point   := Point x:x y:y.
  1050     point   := Point x:x y:y.
   973     point   := device translatePoint:point from:(inputView id)
  1051     point   := device translatePoint:point from:(inputView id)
   974                                              to:(inputView device rootView id).
  1052                                              to:(inputView device rootView id).
   975     inputView lower.
  1053     inputView lower.
   976     viewId := device viewIdFromPoint:point in:(window id).
  1054     viewId := device viewIdFromPoint:point in:(self id).
   977     view   := device viewFromId:viewId.
  1055     view   := device viewFromId:viewId.
   978     inputView raise.
  1056     inputView raise.
   979 
  1057 
   980     (view ~~ window and:[view ~~ inputView]) ifTrue:[
  1058     (view ~~ self and:[view ~~ inputView]) ifTrue:[
   981         (self findSpecFor:view) notNil ifTrue:[
  1059         (self findSpecFor:view) notNil ifTrue:[
   982              ^ view
  1060              ^ view
   983         ]
  1061         ]
   984     ].
  1062     ].
   985     ^ nil
  1063     ^ nil
       
  1064 
       
  1065 
   986 
  1066 
   987 
  1067 
   988 !
  1068 !
   989 
  1069 
   990 findSpecFor:anObject
  1070 findSpecFor:anObject
  1004     ].
  1084     ].
  1005     ^ nil
  1085     ^ nil
  1006 
  1086 
  1007 ! !
  1087 ! !
  1008 
  1088 
  1009 !UISelectionPanel methodsFor:'selections'!
  1089 !UISelectionPanel::Canvas methodsFor:'selection'!
  1010 
  1090 
  1011 handlesOf:aComponent do:aOneArgBlock
  1091 handlesOf:aComponent do:aOneArgBlock
  1012     "evaluate the block on each handle; the argument to the block
  1092     "evaluate the block on each handle; the argument to the block
  1013      is a rectangle
  1093      is a rectangle
  1014     "
  1094     "
  1021         aOneArgBlock value:(aComponent rightCenter  - (4@4) extent:7@7).
  1101         aOneArgBlock value:(aComponent rightCenter  - (4@4) extent:7@7).
  1022         aOneArgBlock value:(aComponent topCenter    - (4@4) extent:7@7).
  1102         aOneArgBlock value:(aComponent topCenter    - (4@4) extent:7@7).
  1023         aOneArgBlock value:(aComponent bottomCenter - (4@4) extent:7@7).
  1103         aOneArgBlock value:(aComponent bottomCenter - (4@4) extent:7@7).
  1024     ]
  1104     ]
  1025 
  1105 
  1026 
       
  1027 !
  1106 !
  1028 
  1107 
  1029 selection:anObject
  1108 selection:anObject
  1030     "selection changed
  1109     "selection changed
  1031     "
  1110     "
  1032     |spec|
  1111     |name|
  1033 
  1112 
  1034     selection ~~ anObject ifTrue:[
  1113     selection ~~ anObject ifTrue:[
  1035         self showUnselected.
  1114         self showUnselected.
  1036         spec := self findSpecFor:anObject.
  1115         (self findSpecFor:anObject) notNil ifTrue:[
  1037 
       
  1038         spec notNil ifTrue:[
       
  1039             selection := anObject.
  1116             selection := anObject.
       
  1117             name := anObject name.
  1040             self showSelected
  1118             self showSelected
  1041         ] ifFalse:[
  1119         ] ifFalse:[
  1042             selection := nil
  1120             selection := nil
  1043         ].
  1121         ].
  1044 
  1122         nameHolder notNil ifTrue:[nameHolder value:name]
  1045         selection notNil ifTrue:[
       
  1046             labelView label:(selection name)
       
  1047         ]
       
  1048     ]
  1123     ]
  1049 
  1124 
  1050 !
  1125 !
  1051 
  1126 
  1052 showSelected
  1127 showSelected
  1053     "show selected
  1128     "show selected
  1054     "
  1129     "
  1055     selection notNil ifTrue:[
  1130     selection notNil ifTrue:[
  1056         window clippedByChildren:false.
  1131         self clippedByChildren:false.
  1057 
  1132 
  1058         self handlesOf:selection do:[:aRectangle|
  1133         self handlesOf:selection do:[:aRectangle|
  1059             window fillRectangle:aRectangle
  1134             self fillRectangle:aRectangle
  1060         ].
  1135         ].
  1061         window clippedByChildren:true.
  1136         self clippedByChildren:true.
  1062     ].
  1137     ].
       
  1138 
       
  1139 
  1063 !
  1140 !
  1064 
  1141 
  1065 showUnselected
  1142 showUnselected
  1066     "show unselected
  1143     "show unselected
  1067     "
  1144     "
  1069 
  1146 
  1070     selection isNil ifTrue:[
  1147     selection isNil ifTrue:[
  1071         ^ self
  1148         ^ self
  1072     ].
  1149     ].
  1073 
  1150 
  1074     window clippedByChildren:false.
  1151     self clippedByChildren:false.
  1075 
  1152 
  1076     self handlesOf:selection do:[:aRectangle|
  1153     self handlesOf:selection do:[:aRectangle|
  1077         window clearRectangle:aRectangle
  1154         self clearRectangle:aRectangle
  1078     ].
  1155     ].
  1079     window clippedByChildren:true.
  1156     self clippedByChildren:true.
  1080 
  1157 
  1081 "must redraw all components which are affected b the handles
  1158 "must redraw all components which are affected b the handles
  1082 "
  1159 "
  1083     r := (selection originRelativeTo:window) - (4@4) extent:(selection extent + (4@4)).
  1160     r := (selection originRelativeTo:self) - (4@4) extent:(selection extent + (4@4)).
  1084 
  1161 
  1085     window subViews do:[:aComponent |
  1162     self subViews do:[:aComponent |
  1086         |absOrg absFrame|
  1163         |absOrg absFrame|
  1087 
  1164 
  1088         aComponent ~~ inputView ifTrue:[
  1165         aComponent ~~ inputView ifTrue:[
  1089             absOrg   := aComponent originRelativeTo:window.
  1166             absOrg   := aComponent originRelativeTo:self.
  1090             absFrame := absOrg extent:(aComponent extent).
  1167             absFrame := absOrg extent:(aComponent extent).
  1091 
  1168 
  1092             (absFrame intersects:r) ifTrue:[
  1169             (absFrame intersects:r) ifTrue:[
  1093                 aComponent withAllSubViewsDo:[:aView|
  1170                 aComponent withAllSubViewsDo:[:aView|
  1094                     aView clear.
  1171                     aView clear.
  1096                 ]
  1173                 ]
  1097             ]
  1174             ]
  1098         ]
  1175         ]
  1099     ]
  1176     ]
  1100 
  1177 
  1101 ! !
  1178 
  1102 
  1179 ! !
  1103 !UISelectionPanel::DropSpecification class methodsFor:'instance creation'!
  1180 
       
  1181 !UISelectionPanel::Canvas::DropSpecification class methodsFor:'instance creation'!
  1104 
  1182 
  1105 for:aView specification:aSpec
  1183 for:aView specification:aSpec
  1106     "create drop object for a view derived from a specification
  1184     "create drop object for a view derived from a specification
  1107     "
  1185     "
  1108     aView topView raise.
  1186     aView topView raise.
  1118         DisplayObject paint:(Color colorId:1).
  1196         DisplayObject paint:(Color colorId:1).
  1119         DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y.
  1197         DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y.
  1120     ].
  1198     ].
  1121 
  1199 
  1122     ^ self new theObject:aSpec
  1200     ^ self new theObject:aSpec
       
  1201 
       
  1202 
  1123 ! !
  1203 ! !
  1124 
  1204 
  1125 !UISelectionPanel class methodsFor:'documentation'!
  1205 !UISelectionPanel class methodsFor:'documentation'!
  1126 
  1206 
  1127 version
  1207 version
  1128     ^ '$Header$'
  1208     ^ '$Header$'
  1129 ! !
  1209 
       
  1210 ! !