ExtendedComboBox.st
changeset 4729 c0f052e4f414
parent 4728 8e258bf00d45
child 4831 d4bbefd9f9ca
equal deleted inserted replaced
4728:8e258bf00d45 4729:c0f052e4f414
   346                          #(
   346                          #(
   347                            #(#ActionButtonSpec
   347                            #(#ActionButtonSpec
   348                               #name: 'CancelButton'
   348                               #name: 'CancelButton'
   349                               #label: 'Cancel'
   349                               #label: 'Cancel'
   350                               #translateLabel: true
   350                               #translateLabel: true
   351                               #model: #cancel
   351                               #model: #doCancel
   352                               #extent: #(#Point 165 26)
   352                               #extent: #(#Point 165 26)
   353                           )
   353                           )
   354                            #(#ActionButtonSpec
   354                            #(#ActionButtonSpec
   355                               #name: 'OKButton'
   355                               #name: 'OKButton'
   356                               #label: 'OK'
   356                               #label: 'OK'
   357                               #translateLabel: true
   357                               #translateLabel: true
   358                               #model: #accept
   358                               #model: #doAccept
   359                               #extent: #(#Point 166 26)
   359                               #extent: #(#Point 166 26)
   360                           )
   360                           )
   361                         )
   361                         )
   362                     )
   362                     )
   363                     #horizontalLayout: #fitSpace
   363                     #horizontalLayout: #fitSpace
   375     sidx := 4.
   375     sidx := 4.
   376     menu bottomInset:(menu preferredExtent y negated).
   376     menu bottomInset:(menu preferredExtent y negated).
   377     menu contents:(list at:sidx).
   377     menu contents:(list at:sidx).
   378 
   378 
   379     widget := SubCanvas new.
   379     widget := SubCanvas new.
       
   380     widget client:(SimpleDialog new).
   380     widget spec:spec.
   381     widget spec:spec.
   381     menu menuWidget:widget.
   382     menu menuWidget:widget.
   382     top open.
   383     top open.
   383                                                                                 [exEnd]
   384                                                                                 [exEnd]
   384 
   385 
  1287     ].
  1288     ].
  1288     self forwardEvent:event withFocusOn:focusViewOrNil.
  1289     self forwardEvent:event withFocusOn:focusViewOrNil.
  1289 !
  1290 !
  1290 
  1291 
  1291 forwardEvent:ev withFocusOn:focusView
  1292 forwardEvent:ev withFocusOn:focusView
  1292     "handle a key press event
  1293     "handle an event
  1293     "
  1294     "
  1294     |view x y p syntheticEvent|
  1295     |view x y p syntheticEvent|
  1295 
  1296 
  1296     "/ situation: we get a buttonPress, set implicitGrab (for scrollbars etc.)
  1297     "/ situation: we get a buttonPress, set implicitGrab (for scrollbars etc.)
  1297     "/ but never get the buttonRelease, since someone else (a popUp) grabbed the
  1298     "/ but never get the buttonRelease, since someone else (a popUp) grabbed the
  1317             (ev isButtonReleaseEvent "or:[ev isButtonMultiPressEvent]") ifTrue:[
  1318             (ev isButtonReleaseEvent "or:[ev isButtonMultiPressEvent]") ifTrue:[
  1318                 implicitGrabView := nil.
  1319                 implicitGrabView := nil.
  1319             ].
  1320             ].
  1320             ^ self
  1321             ^ self
  1321         ]
  1322         ]
       
  1323     ].
       
  1324 
       
  1325     ev isKeyPressEvent ifTrue:[
       
  1326         ev key == #Escape ifTrue:[
       
  1327             self hideRequest.
       
  1328             ^ self.
       
  1329         ].
  1322     ].
  1330     ].
  1323 
  1331 
  1324     view := self detectViewAtX:x y:y.
  1332     view := self detectViewAtX:x y:y.
  1325     view isNil ifTrue:[
  1333     view isNil ifTrue:[
  1326         ^ super dispatchEvent:ev withFocusOn:focusView delegate:false
  1334         ^ super dispatchEvent:ev withFocusOn:focusView delegate:false
  1559 ! !
  1567 ! !
  1560 
  1568 
  1561 !ExtendedComboBox class methodsFor:'documentation'!
  1569 !ExtendedComboBox class methodsFor:'documentation'!
  1562 
  1570 
  1563 version
  1571 version
  1564     ^ '$Header: /cvs/stx/stx/libwidg2/ExtendedComboBox.st,v 1.71 2015-03-19 14:39:26 cg Exp $'
  1572     ^ '$Header: /cvs/stx/stx/libwidg2/ExtendedComboBox.st,v 1.72 2015-03-19 15:11:17 cg Exp $'
  1565 !
  1573 !
  1566 
  1574 
  1567 version_CVS
  1575 version_CVS
  1568     ^ '$Header: /cvs/stx/stx/libwidg2/ExtendedComboBox.st,v 1.71 2015-03-19 14:39:26 cg Exp $'
  1576     ^ '$Header: /cvs/stx/stx/libwidg2/ExtendedComboBox.st,v 1.72 2015-03-19 15:11:17 cg Exp $'
  1569 ! !
  1577 ! !
  1570 
  1578