1635 " |
1641 " |
1636 self accept:true. |
1642 self accept:true. |
1637 ! |
1643 ! |
1638 |
1644 |
1639 accept:ok |
1645 accept:ok |
1640 "ok if true the modifications are accepted |
1646 "if ok is true, the modifications are accepted. |
1641 than reload from item |
1647 then reload from item |
1642 " |
1648 " |
1643 |selectedItem rscRetrHolder helpKeyHolder helpTool imageTool acceptChannel| |
1649 |selectedItem rscRetrHolder helpKeyHolder helpTool imageTool acceptChannel| |
1644 |
1650 |
1645 selectedItem := self selectedItem. |
1651 selectedItem := self selectedItem. |
1646 |
1652 |
1647 selectedItem ifNotNil:[ |
1653 selectedItem ifNotNil:[ |
1648 self withoutNotifyDo:[ |
1654 self withoutNotifyDo:[ |
1649 rscRetrHolder := aspects at:#resourceRetriever. |
1655 rscRetrHolder := aspects at:#resourceRetriever. |
1650 helpKeyHolder := aspects at:#activeHelpKey. |
1656 helpKeyHolder := aspects at:#activeHelpKey. |
1651 imageTool := self imageTool. |
1657 imageTool := self imageTool. |
1652 helpTool := self helpTool. |
1658 helpTool := self helpTool. |
1653 acceptChannel := self acceptChannel. |
1659 acceptChannel := self acceptChannel. |
1654 |
1660 |
1655 acceptChannel triggerValue:true. |
1661 acceptChannel triggerValue:true. |
1656 acceptChannel setValue:false. |
1662 acceptChannel setValue:false. |
1657 |
1663 |
1658 ok ifTrue:[ |
1664 ok ifTrue:[ |
1659 helpTool accept. |
1665 helpTool accept. |
1660 rscRetrHolder value:(imageTool resourceRetriever). |
1666 rscRetrHolder value:(imageTool resourceRetriever). |
1661 helpKeyHolder value:(helpTool helpKey). |
1667 helpKeyHolder value:(helpTool helpKey). |
1662 selectedItem fromAspects:aspects. |
1668 selectedItem fromAspects:aspects. |
1663 self setModified. |
1669 self setModified. |
1664 |
1670 |
1665 selectedItem isRootItem ifTrue:[ |
1671 selectedItem isRootItem ifTrue:[ |
1666 "/ update specSelector |
1672 "/ update specSelector |
1667 specSelector := selectedItem rawLabel. |
1673 specSelector := selectedItem rawLabel. |
1668 ]. |
1674 ]. |
1669 ]. |
1675 ]. |
1670 selectedItem toAspects:aspects. |
1676 selectedItem toAspects:aspects. |
1671 helpTool helpKey:(helpKeyHolder value). |
1677 helpTool helpKey:(helpKeyHolder value). |
1672 imageTool resourceRetriever:(rscRetrHolder value). |
1678 imageTool resourceRetriever:(rscRetrHolder value). |
1673 ] |
1679 ] |
1674 ]. |
1680 ]. |
1675 self updateChannels. |
1681 self updateChannels. |
1676 "/ self clearModified. |
1682 "/ self clearModified. |
1677 self clearModifiedFlag. |
1683 self clearModifiedFlag. |
1678 |
1684 |
2478 |
2484 |
2479 listOfItems root recursiveDo:[:el| |
2485 listOfItems root recursiveDo:[:el| |
2480 selectors addAll:(el aspectSelectors). |
2486 selectors addAll:(el aspectSelectors). |
2481 ]. |
2487 ]. |
2482 ^ selectors asOrderedCollection |
2488 ^ selectors asOrderedCollection |
|
2489 ! |
|
2490 |
|
2491 doBrowseActionMethod |
|
2492 |selector cls category| |
|
2493 |
|
2494 selector := (self aspectFor:#itemValue) value. |
|
2495 |
|
2496 selector isEmptyOrNil ifTrue:[ |
|
2497 Dialog information:(resources |
|
2498 string:'Please enter an action method name.'). |
|
2499 ^ self |
|
2500 ]. |
|
2501 |
|
2502 selector := selector asSymbol. |
|
2503 |
|
2504 specClass isNil ifTrue:[ |
|
2505 self warn:'Please define the application class first.'. |
|
2506 ^ self |
|
2507 ]. |
|
2508 |
|
2509 cls := self resolveName:specClass. |
|
2510 cls isNil ifTrue:[ |
|
2511 self warn:'Class ', specClass asString, ' does not exist!!'. |
|
2512 ^ self |
|
2513 ]. |
|
2514 |
|
2515 (cls implements:selector) ifFalse:[ |
|
2516 category := UserPreferences current categoryForMenuActionsMethods. |
|
2517 |
|
2518 CodeGeneratorTool |
|
2519 createActionMethodFor:selector in:cls |
|
2520 category:category |
|
2521 redefine:(self redefineAspectMethodsChannel value). |
|
2522 ]. |
|
2523 |
|
2524 UserPreferences current systemBrowserClass |
|
2525 openInClass:cls selector:selector. |
2483 ! |
2526 ! |
2484 |
2527 |
2485 doGenerateAspectMethods |
2528 doGenerateAspectMethods |
2486 "compile aspect and action methods" |
2529 "compile aspect and action methods" |
2487 |
2530 |
3660 UIPainter new openOnClass:MenuEditor::ActionItem andSelector:#basicsEditSpec |
3703 UIPainter new openOnClass:MenuEditor::ActionItem andSelector:#basicsEditSpec |
3661 " |
3704 " |
3662 |
3705 |
3663 <resource: #canvas> |
3706 <resource: #canvas> |
3664 |
3707 |
3665 ^ |
3708 ^ |
3666 #(FullSpec |
3709 #(FullSpec |
3667 name: basicsEditSpec |
3710 name: basicsEditSpec |
3668 window: |
3711 window: |
3669 (WindowSpec |
3712 (WindowSpec |
3670 label: 'basicsEditSpec' |
3713 label: 'basicsEditSpec' |
3671 name: 'basicsEditSpec' |
3714 name: 'basicsEditSpec' |
3672 min: (Point 10 10) |
3715 min: (Point 10 10) |
3673 bounds: (Rectangle 0 0 340 340) |
3716 bounds: (Rectangle 0 0 340 340) |
3674 ) |
3717 ) |
3675 component: |
3718 component: |
3676 (SpecCollection |
3719 (SpecCollection |
3677 collection: ( |
3720 collection: ( |
3678 (LabelSpec |
3721 (LabelSpec |
3679 label: 'Name Key:' |
3722 label: 'Name Key:' |
3680 name: 'nameKeyLabel' |
3723 name: 'nameKeyLabel' |
3748 acceptOnTab: true |
3791 acceptOnTab: true |
3749 acceptOnLostFocus: true |
3792 acceptOnLostFocus: true |
3750 acceptChannel: acceptChannel |
3793 acceptChannel: acceptChannel |
3751 modifiedChannel: modifiedChannel |
3794 modifiedChannel: modifiedChannel |
3752 acceptOnPointerLeave: true |
3795 acceptOnPointerLeave: true |
|
3796 ) |
|
3797 (ActionButtonSpec |
|
3798 label: 'browseActionImage' |
|
3799 name: 'Button1' |
|
3800 layout: (LayoutFrame -25 1 71 0 -5 1 93 0) |
|
3801 hasCharacterOrientedLabel: false |
|
3802 translateLabel: true |
|
3803 resizeForLabel: true |
|
3804 tabable: true |
|
3805 model: doBrowseActionMethod |
3753 ) |
3806 ) |
3754 (LabelSpec |
3807 (LabelSpec |
3755 label: 'Argument:' |
3808 label: 'Argument:' |
3756 name: 'argumentLabel' |
3809 name: 'argumentLabel' |
3757 layout: (AlignmentOrigin 107 0 107 0 1 0.5) |
3810 layout: (AlignmentOrigin 107 0 107 0 1 0.5) |