UISelectionPanel.st
changeset 207 a31cc933368a
parent 190 8110fbe94104
child 216 2bfcf491429e
equal deleted inserted replaced
206:1c3fb15ffd62 207:a31cc933368a
    17 	classVariableNames:'UserClass UserSpecs UserLabels'
    17 	classVariableNames:'UserClass UserSpecs UserLabels'
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	category:'Interface-UIPainter'
    19 	category:'Interface-UIPainter'
    20 !
    20 !
    21 
    21 
       
    22 Object subclass:#ExampleUserDefinedGallery
       
    23 	instanceVariableNames:''
       
    24 	classVariableNames:''
       
    25 	poolDictionaries:''
       
    26 	privateIn:UISelectionPanel
       
    27 !
       
    28 
    22 !UISelectionPanel class methodsFor:'documentation'!
    29 !UISelectionPanel class methodsFor:'documentation'!
    23 
    30 
    24 copyright
    31 copyright
    25 "
    32 "
    26  COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
    33  COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
    55         UIGalleryView
    62         UIGalleryView
    56         UIPainter
    63         UIPainter
    57 
    64 
    58 "
    65 "
    59 
    66 
       
    67 ! !
       
    68 
       
    69 !UISelectionPanel class methodsFor:'initialization'!
       
    70 
       
    71 initialize
       
    72     super initialize.
       
    73     UserClass  := UISelectionPanel::ExampleUserDefinedGallery.
       
    74     UserSpecs  := #listOfSelectors.
       
    75     UserLabels := #listOfLabels.
    60 ! !
    76 ! !
    61 
    77 
    62 !UISelectionPanel class methodsFor:'accessing'!
    78 !UISelectionPanel class methodsFor:'accessing'!
    63 
    79 
    64 specifications
    80 specifications
  1416 
  1432 
  1417 !UISelectionPanel methodsFor:'user defined'!
  1433 !UISelectionPanel methodsFor:'user defined'!
  1418 
  1434 
  1419 userDefined
  1435 userDefined
  1420     |cls lbl sel builder|
  1436     |cls lbl sel builder|
  1421 
       
  1422     (cls := userClass) notNil ifTrue:[
  1437     (cls := userClass) notNil ifTrue:[
  1423         cls isBehavior ifFalse:[
  1438         cls isBehavior ifFalse:[
  1424             cls := Smalltalk at:cls asSymbol
  1439             cls := Smalltalk at:cls asSymbol
  1425         ].
  1440         ].
  1426         (cls notNil and:[(cls respondsTo:userLabels)]) ifTrue:[
  1441         (cls notNil and:[(cls respondsTo:userLabels)]) ifTrue:[
  1427             lbl := cls perform:userLabels.
  1442             lbl := cls perform:userLabels.
  1428             sel := Array new:(lbl size) withAll:#userDefinedSpec.
  1443             sel := Array new:(lbl size) withAll:#userDefinedSpec.
  1429             self galleryList value:lbl.
  1444             self galleryList value:lbl.
  1430             self minorKeys   value:sel.
  1445             self minorKeys   value:sel.
       
  1446           ^ self
  1431         ]
  1447         ]
  1432     ].
  1448     ].
  1433     builder := UIBuilder new.
  1449     builder := UIBuilder new.
  1434     builder application:self.
  1450     builder application:self.
  1435     (self builder componentAt:#gallery) builder:builder. 
  1451     (self builder componentAt:#gallery) builder:builder. 
  1466         ]
  1482         ]
  1467     ].
  1483     ].
  1468   ^ nil
  1484   ^ nil
  1469 ! !
  1485 ! !
  1470 
  1486 
       
  1487 !UISelectionPanel::ExampleUserDefinedGallery class methodsFor:'user defined gallery'!
       
  1488 
       
  1489 clocksSpec
       
  1490     "this window spec was automatically generated by the ST/X UIPainter"
       
  1491 
       
  1492     "do not manually edit this - the painter/builder may not be able to
       
  1493      handle the specification if its corrupted."
       
  1494 
       
  1495     "
       
  1496      UIPainter new openOnClass:UISelectionPanel::ExampleUserDefinedGallery andSelector:#clocksSpec
       
  1497      UISelectionPanel::ExampleUserDefinedGallery new openInterface:#clocksSpec
       
  1498     "
       
  1499 
       
  1500     <resource: #canvas>
       
  1501 
       
  1502     ^
       
  1503      
       
  1504        #(#FullSpec
       
  1505           #'window:' 
       
  1506            #(#WindowSpec
       
  1507               #'name:' 'uIPainterView'
       
  1508               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
  1509               #'label:' 'Interface Builder'
       
  1510               #'bounds:' #(#Rectangle 0 0 380 271)
       
  1511           )
       
  1512           #'component:' 
       
  1513            #(#SpecCollection
       
  1514               #'collection:' 
       
  1515                #(
       
  1516                  #(#ArbitraryComponentSpec
       
  1517                     #'name:' 'arbitraryComponent1'
       
  1518                     #'layout:' #(#LayoutFrame 11 0 11 0 125 0 123 0)
       
  1519                     #'component:' #ClockView
       
  1520                     #'hasHorizontalScrollBar:' false
       
  1521                     #'hasVerticalScrollBar:' false
       
  1522                     #'hasBorder:' false
       
  1523                     #'miniScrollerHorizontal:' false
       
  1524                     #'miniScrollerVertical:' false
       
  1525                 )
       
  1526                  #(#ArbitraryComponentSpec
       
  1527                     #'name:' 'arbitraryComponent2'
       
  1528                     #'layout:' #(#LayoutFrame 136 0 10 0 240 0 33 0)
       
  1529                     #'component:' #DigitalClockView
       
  1530                     #'hasHorizontalScrollBar:' false
       
  1531                     #'hasVerticalScrollBar:' false
       
  1532                     #'hasBorder:' false
       
  1533                     #'miniScrollerHorizontal:' false
       
  1534                     #'miniScrollerVertical:' false
       
  1535                 )
       
  1536               )
       
  1537           )
       
  1538       )
       
  1539 !
       
  1540 
       
  1541 funSpec
       
  1542     "this window spec was automatically generated by the ST/X UIPainter"
       
  1543 
       
  1544     "do not manually edit this - the painter/builder may not be able to
       
  1545      handle the specification if its corrupted."
       
  1546 
       
  1547     "
       
  1548      UIPainter new openOnClass:UISelectionPanel::ExampleUserDefinedGallery andSelector:#funSpec
       
  1549      UISelectionPanel::ExampleUserDefinedGallery new openInterface:#funSpec
       
  1550     "
       
  1551 
       
  1552     <resource: #canvas>
       
  1553 
       
  1554     ^
       
  1555      
       
  1556        #(#FullSpec
       
  1557           #'window:' 
       
  1558            #(#WindowSpec
       
  1559               #'name:' 'uIPainterView'
       
  1560               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
  1561               #'label:' 'Interface Builder'
       
  1562               #'bounds:' #(#Rectangle 0 0 393 182)
       
  1563           )
       
  1564           #'component:' 
       
  1565            #(#SpecCollection
       
  1566               #'collection:' 
       
  1567                #(
       
  1568                  #(#ArbitraryComponentSpec
       
  1569                     #'name:' 'arbitraryComponent1'
       
  1570                     #'layout:' #(#LayoutFrame 54 0 27 0 287 0 145 0)
       
  1571                     #'hasHorizontalScrollBar:' false
       
  1572                     #'hasVerticalScrollBar:' false
       
  1573                     #'hasBorder:' false
       
  1574                     #'miniScrollerHorizontal:' false
       
  1575                     #'miniScrollerVertical:' false
       
  1576                 )
       
  1577               )
       
  1578           )
       
  1579       )
       
  1580 !
       
  1581 
       
  1582 listOfLabels
       
  1583     ^ #( 'clocks' 'fun')
       
  1584 
       
  1585 
       
  1586 !
       
  1587 
       
  1588 listOfSelectors
       
  1589     ^ #( clocksSpec funSpec )
       
  1590 
       
  1591 
       
  1592 ! !
       
  1593 
  1471 !UISelectionPanel class methodsFor:'documentation'!
  1594 !UISelectionPanel class methodsFor:'documentation'!
  1472 
  1595 
  1473 version
  1596 version
  1474     ^ '$Header$'
  1597     ^ '$Header$'
  1475 ! !
  1598 ! !
       
  1599 UISelectionPanel initialize!