--- a/CodeView.st Mon Nov 12 18:24:57 2001 +0100
+++ b/CodeView.st Mon Nov 12 18:27:24 2001 +0100
@@ -179,15 +179,21 @@
to make this independent from what is defined in superclasses,
get the superclass menu and add my functions."
- <resource: #keyboard (#CommentSelection #UncommentSelection
+ <resource: #keyboard (
#Accept #Explain #Format)>
<resource: #programMenu>
|m sub sensor|
m := super editMenu.
+ ((sensor := self sensor) notNil and:[sensor ctrlDown]) ifTrue:[
+ sub := m.
+ m := nil.
+ ] ifFalse:[
+ sub := m subMenuAt:#others.
+ ].
- ((sensor := self sensor) notNil and:[sensor ctrlDown]) ifFalse:[
+ m notNil ifTrue:[
"
codeViews do support #accept
... add it after #inspectIt
@@ -201,33 +207,31 @@
or:[acceptAction isNil]) ifTrue:[
m disable:#accept
].
+ ].
+ sub notNil ifTrue:[
"
and add #explain after $gotoLine in the extra menu
"
- sub := m subMenuAt:#others.
- sub notNil ifTrue:[
- sub addLabels:(resources array:#('-' 'Explain'))
- selectors:#(nil explain)
- accelerators:#(nil Explain)
- after:#gotoLine.
+ sub addLabels:(resources array:#('-' 'Explain'))
+ selectors:#(nil explain)
+ accelerators:#(nil Explain)
+ after:#gotoLine.
- formatAction notNil ifTrue:[
- sub addLabels:(resources array:#('Format'))
- selectors:#(format)
- accelerators:#(Format)
- after:#indent.
- ].
-
- (self hasSelection not
- or:[explainAction isNil]) ifTrue:[
- sub disable:#explain
- ].
+ formatAction notNil ifTrue:[
+ sub addLabels:(resources array:#('Format'))
+ selectors:#(format)
+ accelerators:#(Format)
+ after:#indent.
+ ].
+ (self hasSelection not
+ or:[explainAction isNil]) ifTrue:[
+ sub disable:#explain
].
].
- ^ m.
+ ^ m ? sub.
- "Modified: / 22.11.1999 / 11:41:40 / cg"
+ "Modified: / 12.11.2001 / 16:04:46 / cg"
!
explain
@@ -265,5 +269,5 @@
!CodeView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.46 2001-09-12 07:26:13 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.47 2001-11-12 17:27:24 cg Exp $'
! !