EditField.st
changeset 506 3273d75c3526
parent 490 08e8adfb783c
child 561 ef45086071c6
equal deleted inserted replaced
505:e13ee348dcc4 506:3273d75c3526
  1375 ! !
  1375 ! !
  1376 
  1376 
  1377 !EditField methodsFor:'initialization'!
  1377 !EditField methodsFor:'initialization'!
  1378 
  1378 
  1379 editMenu
  1379 editMenu
  1380     |labels selectors m|
  1380     |labels selectors shorties m|
  1381 
  1381 
  1382     labels := #(
  1382     labels := #(
  1383                 'copy'
  1383                 'copy'
  1384                 'cut'
  1384                 'cut'
  1385                 'paste'
  1385                 'paste'
  1386 "
       
  1387                 'replace'
       
  1388 "
       
  1389                 '-'
       
  1390                 'accept'
       
  1391                ).
  1386                ).
  1392 
  1387 
  1393      selectors := #(
  1388     selectors := #(
  1394                  copySelection
  1389                  copySelection
  1395                  cut
  1390                  cut
  1396                  paste
  1391                  paste
  1397 "
       
  1398                  replace
       
  1399 "
       
  1400                  nil
       
  1401                  accept
       
  1402                 ).
  1392                 ).
  1403 
  1393 
       
  1394     shorties := #(
       
  1395                    #Copy
       
  1396                    #Cut
       
  1397                    #Paste
       
  1398                  ).
       
  1399 
       
  1400     (acceptAction notNil 
       
  1401     or:[model notNil and:[changeMsg notNil]]) ifTrue:[
       
  1402         labels := labels , #(
       
  1403                                 '-'
       
  1404                                 'accept'
       
  1405                             ).
       
  1406         selectors := selectors , #(
       
  1407                                 nil
       
  1408                                 #accept
       
  1409                             ).
       
  1410         shorties := shorties , #(
       
  1411                                 nil
       
  1412                                 #Accept
       
  1413                             ).
       
  1414     ].
       
  1415 
  1404     m := PopUpMenu 
  1416     m := PopUpMenu 
  1405           labels:(resources array:labels)
  1417            labels:(resources array:labels)
  1406           selectors:selectors.
  1418            selectors:selectors
       
  1419            accelerators:shorties.
  1407 
  1420 
  1408     self hasSelection ifFalse:[
  1421     self hasSelection ifFalse:[
  1409         m disableAll:#(copySelection cut)
  1422         m disableAll:#(copySelection cut)
  1410     ].
  1423     ].
  1411     enabled ifFalse:[
  1424     enabled ifFalse:[
  1412         m disableAll:#(cut paste accept)
  1425         m disableAll:#(cut paste accept)
  1413     ].
  1426     ].
  1414 
  1427 
  1415     ^ m
  1428     ^ m
  1416 
  1429 
  1417     "Modified: 9.2.1996 / 01:50:10 / cg"
  1430     "Modified: 20.3.1996 / 11:34:12 / cg"
  1418 !
  1431 !
  1419 
  1432 
  1420 initStyle
  1433 initStyle
  1421     super initStyle.
  1434     super initStyle.
  1422 
  1435 
  1605 ! !
  1618 ! !
  1606 
  1619 
  1607 !EditField class methodsFor:'documentation'!
  1620 !EditField class methodsFor:'documentation'!
  1608 
  1621 
  1609 version
  1622 version
  1610     ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.51 1996-03-07 12:36:07 cg Exp $'
  1623     ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.52 1996-03-20 10:43:59 cg Exp $'
  1611 ! !
  1624 ! !