--- a/CodeView.st Wed May 03 18:30:51 1995 +0200
+++ b/CodeView.st Sat May 06 16:18:13 1995 +0200
@@ -21,7 +21,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.14 1995-05-03 00:28:53 claus Exp $
+$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.15 1995-05-06 14:16:30 claus Exp $
'!
!CodeView class methodsFor:'documentation'!
@@ -42,30 +42,39 @@
version
"
-$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.14 1995-05-03 00:28:53 claus Exp $
+$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.15 1995-05-06 14:16:30 claus Exp $
"
!
documentation
"
- a view for code which can recompile its contents. It adds accept and explain
- to the menu, and defines two actions: acceptAction to be performed for accept
- and explainAction to be performed for explain.
+ a view for code which can recompile its contents.
+ It adds accept and explain to the menu, and defines two new actions:
+ acceptAction to be performed for accept
+ and explainAction to be performed for explain.
These actions are to be defined by the user of this view
(i.e. ususally the owning browser)
+
+ If used with a model, accept sends the changeMsg to it.
+ (however, it is possible to define moth changeMsg and acceptAction)
"
! !
!CodeView methodsFor:'initialization'!
editMenu
+ "return the popUpMenu;
+ to make this independent from what is defined in superclasses,
+ get the superclass menu and add my functions."
+
|m sub idx|
m := super editMenu.
"
codeViews do support #accept
+ ... add it after #inspectIt
"
idx := m indexOf:#inspectIt.
idx ~~ 0 ifTrue:[
@@ -75,7 +84,7 @@
].
"
- and explain in the extra menu
+ and add #explain after $gotoLine in the extra menu
"
sub := m subMenuAt:#others.
sub notNil ifTrue:[
@@ -116,7 +125,7 @@
accept
"accept action;
save cursor and selection; then execute the accept-action and/or
- accept change. Finally restore cursor and selection."
+ changeMessage. Finally restore cursor and selection."
codeStartPosition := 1.
[
@@ -138,7 +147,7 @@
"/
"/ MVC way of doing it
"/
- self sendChangeMessageWith:self contents
+ self sendChangeMessageWith:(self contents)
]
] valueNowOrOnUnwindDo:[
self unselect.
@@ -155,8 +164,7 @@
explainAction notNil ifTrue:[
text := self selection.
text notNil ifTrue:[
- explainAction value:(self contents)
- value:(text asString)
+ explainAction value:(self contents) value:(text asString)
]
]
! !
@@ -169,5 +177,6 @@
(key == #Accept) ifTrue:[^ self accept].
(key == #Explain) ifTrue:[^ self explain].
(key == #Help) ifTrue:[^ self explain].
+
super keyPress:key x:x y:y
! !