Workspace.st
author Claus Gittinger <cg@exept.de>
Fri, 04 Sep 1998 18:27:18 +0200
changeset 1656 1202fbc95970
parent 1523 6c0045d6a91f
child 1734 e71982a6a4c5
permissions -rw-r--r--
some fixes forvariable fonts on win32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
5
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
     3
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    13
TextCollector subclass:#Workspace
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
    14
	instanceVariableNames:'doItAction codeStartPosition errorFgColor errorBgColor
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
    15
		commentStrings'
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    16
	classVariableNames:'DefaultErrorForegroundColor DefaultErrorBackgroundColor'
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    17
	poolDictionaries:''
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    18
	category:'Interface-Workspace'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    19
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    20
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    21
!Workspace class methodsFor:'documentation'!
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    22
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    23
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    24
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    25
 COPYRIGHT (c) 1989 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
    26
	      All Rights Reserved
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    27
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    28
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    29
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    31
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    32
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    33
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    34
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    35
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    36
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    37
documentation
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    38
"
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    39
    a view for editable text which can evaluate expressions.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    40
    I.e. its basically a view for editable text, with added
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    41
    'doIt', 'printIt' and 'inspectIt' functions on the popup-menu.
125
claus
parents: 123
diff changeset
    42
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
    43
    The action to be performed on doIt is defined by a block,
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
    44
    which can be defined by the owner of this view.
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
    45
    (thus you can put a workspace into more complex widgets, and
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
    46
     control what should happen on 'doIt').
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
    47
578
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    48
    A useful default action is automatically defined, which simply 
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    49
    evaluates the selection as a smalltalk expression. 
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    50
    (but, a lisp or prolog workspace would define its own action,
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    51
     to call for another compiler/interpreter  ...)
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    52
123
claus
parents: 121
diff changeset
    53
claus
parents: 121
diff changeset
    54
    Caveat:
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
    55
        in this version, Workspace does not yet support doIt in MVC setups.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
    56
        For now, simulate this by setting the doItAction, to notify the
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
    57
        model manually about the doIt.
123
claus
parents: 121
diff changeset
    58
claus
parents: 121
diff changeset
    59
578
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    60
    [instance variables:]
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    61
121
claus
parents: 119
diff changeset
    62
      doItAction      <Block>         block to evaluate for doIt
123
claus
parents: 121
diff changeset
    63
121
claus
parents: 119
diff changeset
    64
      errorFgColor    <Color>         fg-Color to be used when highlighting errors 
claus
parents: 119
diff changeset
    65
claus
parents: 119
diff changeset
    66
      errorBgColor    <Color>         bg-Color to be used when highlighting errors
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
    67
578
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    68
      codeStartPosition               private temporary
121
claus
parents: 119
diff changeset
    69
578
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    70
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    71
    [styleSheet values:]
121
claus
parents: 119
diff changeset
    72
claus
parents: 119
diff changeset
    73
      codeErrorSelectionForegroundColor     fg color to highlight errors
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
    74
                                            (default: selection fg)
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
    75
121
claus
parents: 119
diff changeset
    76
      codeErrorSelectionBackgroundColor     bg color to highlight errors
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
    77
                                            (default: selection bg)
578
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    78
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    79
    [start with:]
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    80
        Workspace open
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    81
578
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    82
    [see also:]
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    83
        Workspace EditTextView 
5b82bc433c14 commentary
Claus Gittinger <cg@exept.de>
parents: 489
diff changeset
    84
        Parser ByteCodeCompiler
583
2ec13b7ceba5 documentation
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
    85
2ec13b7ceba5 documentation
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
    86
    [author:]
2ec13b7ceba5 documentation
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
    87
        Claus Gittinger
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
    88
"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    89
! !
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    90
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    91
!Workspace class methodsFor:'defaults'!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    92
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    93
defaultLabel
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    94
    "my default window label"
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    95
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    96
    ^ 'Workspace'
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    97
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    98
    "Created: / 16.5.1998 / 16:53:37 / cg"
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
    99
!
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   100
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   101
updateStyleCache
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   102
    "extract values from the styleSheet and cache them in class variables"
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   103
1354
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   104
    <resource: #style (#'codeErrorSelection.foregroundColor'
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   105
                       #'codeErrorSelection.backgroundColor')>
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   106
1354
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   107
    DefaultErrorForegroundColor := StyleSheet colorAt:'codeErrorSelection.foregroundColor'.
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   108
    DefaultErrorBackgroundColor := StyleSheet colorAt:'codeErrorSelection.backgroundColor'.
444
ef26eba8c854 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   109
1354
c260c896ea66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1262
diff changeset
   110
    "Modified: 20.10.1997 / 14:06:18 / cg"
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
   111
! !
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
   112
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   113
!Workspace class methodsFor:'getting a System Workspace'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   114
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
   115
open
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   116
    "launch a new workspace"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   117
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   118
    |scr topView workspace f|
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   119
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   120
    topView := StandardSystemView 
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   121
                label:(self classResources string:(self defaultLabel)) 
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   122
                minExtent:(100 @ 100).
23
69f1ba57f67a *** empty log message ***
claus
parents: 15
diff changeset
   123
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   124
    scr := HVScrollableView for:self in:topView.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   125
    scr origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   126
    workspace := scr scrolledView.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   127
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   128
    "/ adjust topViews extent according to my font
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   129
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   130
    f := workspace font.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   131
    topView extent:((f widthOf:'x') * 40) @ (f height * 10).
7
15a9291b9bd0 *** empty log message ***
claus
parents: 5
diff changeset
   132
    topView open.
131
claus
parents: 125
diff changeset
   133
    ^ workspace
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   134
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   135
    "
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   136
     Workspace open
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   137
    "
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   138
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   139
    "Modified: / 16.5.1998 / 16:53:53 / cg"
857
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   140
!
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   141
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   142
openForRemote:hostName
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   143
    "launch a new workspace to evaluate expression on some remote machine.
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   144
     Entered expressions are sent over to some partner machine, evaluated there,
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   145
     and the result is shown here.
857
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   146
     This requires the RemoteObjects package to be loaded."
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   147
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   148
    |server remoteCompiler workspace|
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   149
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   150
    RemoteObjectServer isNil ifTrue:[
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   151
        self warn:'no remoteObjectServer available'.
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   152
        ^ nil
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   153
    ].
857
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   154
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   155
    server := RemoteObjectServer on:hostName.
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   156
    remoteCompiler := server get:#Compiler.
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   157
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   158
    workspace := self open.
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   159
    workspace topView 
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   160
        label:(self classResources string:'Remote Workspace {%1}' with:hostName).
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   161
857
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   162
    workspace doItAction:
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   163
                [:theCode |
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   164
                    remoteCompiler 
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   165
                        evaluate:theCode 
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   166
                        in:nil 
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   167
                        receiver:nil 
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   168
                        notifying:workspace 
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   169
                        logged:true 
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   170
                        ifFail:nil 
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   171
                ]
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   172
    "
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   173
     Workspace openForRemote:'andi'
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   174
    "
4990383442cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 693
diff changeset
   175
1522
b9b131f6c959 made defaultLabel a class method
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
   176
    "Modified: / 16.5.1998 / 16:57:38 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   177
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   178
1523
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   179
!Workspace class methodsFor:'queries'!
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   180
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   181
isVisualStartable
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   182
    "returns whether this application class can be started via #open
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   183
     (i.e. via a double click on the class in the browser)"
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   184
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   185
    ^ self == Workspace
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   186
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   187
    "Created: / 16.5.1998 / 16:59:00 / cg"
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   188
    "Modified: / 16.5.1998 / 16:59:39 / cg"
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   189
! !
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   190
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   191
!Workspace methodsFor:'accessing'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   192
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   193
commentStrings:anArrayOfCommentStrings
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   194
    "define the comment strings"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   195
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   196
    commentStrings := anArrayOfCommentStrings
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   197
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   198
    "Created: / 9.11.1997 / 01:05:25 / cg"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   199
!
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   200
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   201
doItAction
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   202
    "return the action to be performed when 'doIt' is selected"
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
   203
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   204
    ^ doItAction
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   205
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   206
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   207
doItAction:aOneArgBlock
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   208
    "define the action to be performed when 'doIt' is selected.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   209
     The block will be evaluated, passing the selection as a String argument. 
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   210
     A default doItAction is set for you in the initialize method."
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   211
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   212
    doItAction := aOneArgBlock
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   213
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   214
    "Modified: 27.2.1996 / 15:31:37 / cg"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   215
! !
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   216
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   217
!Workspace methodsFor:'compiler interface'!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   218
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   219
currentSourceCode
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   220
    "special interface to compiler - called by parser
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   221
     to get the updated source code after a corrected error"
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   222
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   223
    ^ self contents
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   224
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   225
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   226
wantChangeLog
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   227
    "sent by the compiler to ask if a changeLog entry should
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   228
     be written. Return true here."
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   229
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   230
    ^ true
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   231
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   232
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   233
!Workspace methodsFor:'compiler interface - error handling'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   234
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   235
correctableError:aString position:relPos to:relEndPos from:aCompiler
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   236
    "compiler notifies us of a correctable error;
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   237
     hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort;
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   238
     this method should return true to the compiler if user wants the error
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   239
     to be corrected; false otherwise"
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   240
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   241
    |action|
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   242
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   243
    self highlightingErrorPosition:relPos to:relEndPos do:[
368
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   244
        action := OptionBox 
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   245
                      request:aString
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   246
                      label:'Error'
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   247
                      form:(WarningBox iconBitmap)
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   248
                      buttonLabels:#('cancel' 'correct' 'continue')
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   249
                      values:#(#abort #correct #continue)
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   250
                      default:#continue.
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   251
    ].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   252
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   253
    action == #abort ifTrue:[
368
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   254
        Object abortSignal raise.
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   255
        ^ false
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   256
    ].
368
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   257
    ^ action == #correct
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   258
53476ee1fbee checkin from browser
Claus Gittinger <cg@exept.de>
parents: 365
diff changeset
   259
    "Modified: 20.2.1996 / 20:48:52 / cg"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   260
!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   261
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   262
error:aString position:relPos to:relEndPos asWarning:asWarning
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   263
    "compiler notifies us of an error; hilight the error (relPos to relEndPos) 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   264
     and show a Box asking for continue/abort."
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   265
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   266
    |answer|
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   267
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   268
    self highlightingErrorPosition:relPos to:relEndPos do:[
213
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   269
        |box lbl|
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   270
213
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   271
        WarningSignal isHandled ifTrue:[
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   272
            WarningSignal raiseErrorString:aString.
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   273
            ^ false
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   274
        ].
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   275
213
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   276
        "
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   277
         ask if we should abort or continue
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   278
        "
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   279
        box := YesNoBox title:aString
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   280
                      yesText:(resources string:'continue')
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   281
                       noText:(resources string:'abort').
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   282
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   283
        asWarning ifTrue:[
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   284
            lbl := 'Compiler warning'
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   285
        ] ifFalse:[
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   286
            lbl := 'Compiler error'.
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   287
        ].
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   288
        box label:lbl.
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   289
        box form:(WarningBox iconBitmap).
921
459081e64241 destroy box after use
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   290
        answer := box confirm.  
459081e64241 destroy box after use
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   291
        box destroy.
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   292
    ].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   293
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   294
    "
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   295
     do the abort if we have to
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   296
    "
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   297
    answer ifFalse:[    
213
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   298
        Object abortSignal raise.
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   299
    ].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   300
    ^ false
213
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   301
6286d3f36c14 raise warningSignal if handled (allows warnBoxes from compiler to be suppressed in debugger)
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   302
    "Created: 24.11.1995 / 22:56:34 / cg"
921
459081e64241 destroy box after use
Claus Gittinger <cg@exept.de>
parents: 858
diff changeset
   303
    "Modified: 7.1.1997 / 23:00:45 / cg"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   304
!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   305
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   306
error:aString position:relPos to:relEndPos from:aCompiler
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   307
    "compiler notifies us of an error; hilight the error (relPos to relEndPos) 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   308
     and show a Box asking for continue/abort."
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   309
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   310
    ^ self error:aString position:relPos to:relEndPos asWarning:false
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   311
!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   312
59
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   313
highlightingErrorPosition:relPos to:relEndPos do:aBlock
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   314
    "evaluate aBlock while some selection is shown highlighted with error colors."
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   315
59
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   316
    |absPosition fg bg|
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   317
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   318
    "
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   319
     change color of selection & hide cursor
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   320
    "
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   321
    fg := selectionFgColor.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   322
    bg := selectionBgColor.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   323
    selectionBgColor := errorBgColor.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   324
    selectionFgColor := errorFgColor.
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   325
    self hideCursor.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   326
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   327
    "
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   328
     select the text - relEndPos may be nil in which case the whole line is selected
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   329
     we have to adjust the positions given by the compiler, since they
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   330
     are relative to the texts start (the compiler did stream-read the code).
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   331
    "
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   332
    codeStartPosition isNil ifTrue:[codeStartPosition := 1].
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   333
    absPosition := codeStartPosition + relPos - 1.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   334
    relEndPos isNil ifTrue:[
59
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   335
	self selectLineWhereCharacterPosition:absPosition
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   336
    ] ifFalse:[
59
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   337
	self selectFromCharacterPosition:absPosition to:(codeStartPosition + relEndPos - 1)
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   338
    ].
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   339
    self makeSelectionVisible.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   340
155
claus
parents: 146
diff changeset
   341
    device flush.
58
28815246bbc1 *** empty log message ***
claus
parents: 54
diff changeset
   342
59
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   343
    aBlock valueNowOrOnUnwindDo:[
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   344
	"
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   345
	 undo selection color change and show cursor again
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   346
	"
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   347
	selectionFgColor := fg.
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   348
	selectionBgColor := bg.
450ce95a72a4 *** empty log message ***
claus
parents: 58
diff changeset
   349
	self showCursor.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   350
    ].
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   351
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   352
116
claus
parents: 97
diff changeset
   353
warning:aString position:relPos to:relEndPos from:aCompiler 
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
   354
    "compiler notifies us of a warning - same behavior as error"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   355
95
7535cfca9509 *** empty log message ***
claus
parents: 79
diff changeset
   356
    self error:aString position:relPos to:relEndPos asWarning:true 
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   357
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   358
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   359
!Workspace methodsFor:'editing'!
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   360
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   361
commentFrom:line1 to:line2
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   362
    "convenient function to comment out a block.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   363
     All lines from line1 to line2 get an end-of-line comment
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   364
     in the first col."
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   365
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   366
    |eolComment opening closing|
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   367
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   368
    eolComment := commentStrings at:1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   369
    eolComment isNil ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   370
        opening := (commentStrings at:2) at:1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   371
        closing := (commentStrings at:2) at:2.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   372
        (opening isNil or:[closing isNil]) ifTrue:[^ self].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   373
    ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   374
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   375
    line1 to:line2 do:[:lineNr |
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   376
        |l|
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   377
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   378
        l := self listAt:lineNr.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   379
        l isNil ifTrue:[l := ''].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   380
        eolComment notNil ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   381
            l := eolComment , l
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   382
        ] ifFalse:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   383
            l := opening , l , closing
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   384
        ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   385
        self at:lineNr put:l
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   386
    ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   387
    self textChanged.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   388
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   389
    "Modified: / 7.1.1997 / 20:15:06 / cg"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   390
    "Created: / 9.11.1997 / 01:05:35 / cg"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   391
!
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   392
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   393
commentSelection
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   394
    "convenient function to comment out a block.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   395
     All lines from line1 to line2 get an end-of-line comment
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   396
     in the first col."
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   397
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   398
    |e commentPair opening closing|
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   399
1481
a5fb903ee745 moved readOnlyCheck.
Claus Gittinger <cg@exept.de>
parents: 1395
diff changeset
   400
    (self checkModificationsAllowed) ifFalse:[ ^ self].
a5fb903ee745 moved readOnlyCheck.
Claus Gittinger <cg@exept.de>
parents: 1395
diff changeset
   401
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   402
    selectionStartLine notNil ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   403
        (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   404
            self commentFrom:selectionStartLine to:selectionEndLine-1
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   405
        ] ifFalse:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   406
            commentPair := commentStrings at:2.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   407
            opening := commentPair at:1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   408
            closing := commentPair at:2.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   409
            (opening isNil or:[closing isNil]) ifTrue:[^ self].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   410
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   411
            e := selectionEndCol.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   412
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   413
            self insertString:closing atLine:selectionEndLine col:e+1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   414
            self insertString:opening atLine:selectionStartLine col:selectionStartCol.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   415
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   416
            selectionStartLine == selectionEndLine ifTrue:[e := e + opening size].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   417
            self selectFromLine:selectionStartLine col:selectionStartCol
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   418
                         toLine:selectionEndLine col:e+closing size.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   419
        ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   420
    ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   421
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   422
    "Created: / 9.11.1997 / 01:05:40 / cg"
1481
a5fb903ee745 moved readOnlyCheck.
Claus Gittinger <cg@exept.de>
parents: 1395
diff changeset
   423
    "Modified: / 5.4.1998 / 16:52:23 / cg"
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   424
!
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   425
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   426
uncommentFrom:line1 to:line2
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   427
    "convenient function to comment out a block.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   428
     All lines from line1 to line2 get an end-of-line comment
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   429
     in the first col."
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   430
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   431
    |eolComment opening closing rest|
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   432
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   433
    eolComment := commentStrings at:1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   434
    eolComment isNil ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   435
        opening := (commentStrings at:2) at:1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   436
        closing := (commentStrings at:2) at:2.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   437
        (opening isNil or:[closing isNil]) ifTrue:[^ self].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   438
    ] ifFalse:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   439
        rest := eolComment size + 1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   440
    ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   441
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   442
    line1 to:line2 do:[:lineNr |
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   443
        |l|
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   444
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   445
        l := self listAt:lineNr.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   446
        l notNil ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   447
            eolComment notNil ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   448
                (l startsWith:eolComment) ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   449
                    l := l copyFrom:rest
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   450
                ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   451
            ] ifFalse:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   452
                ((l startsWith:opening)
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   453
                and:[l endsWith:closing]) ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   454
                    l := l copyFrom:opening size + 1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   455
                    l := l copyWithoutLast:closing size.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   456
                ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   457
            ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   458
            self at:lineNr put:l
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   459
        ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   460
    ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   461
    self textChanged.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   462
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   463
    "Modified: / 7.1.1997 / 20:17:44 / cg"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   464
    "Created: / 9.11.1997 / 01:05:43 / cg"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   465
!
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   466
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   467
uncommentSelection
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   468
    "convenient function to comment out a block.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   469
     All lines from line1 to line2 get an end-of-line comment
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   470
     in the first col."
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   471
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   472
    |e commentPair opening closing sz1 sz2|
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   473
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   474
    selectionStartLine notNil ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   475
        (selectionStartCol == 1 and:[selectionEndCol == 0]) ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   476
            self uncommentFrom:selectionStartLine to:selectionEndLine-1
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   477
        ] ifFalse:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   478
            commentPair := commentStrings at:2.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   479
            opening := commentPair at:1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   480
            closing := commentPair at:2.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   481
            (opening isNil or:[closing isNil]) ifTrue:[^ self].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   482
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   483
            sz1 := opening size.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   484
            sz2 := closing size.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   485
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   486
            ((self 
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   487
                stringAtLine:selectionStartLine 
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   488
                from:selectionStartCol
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   489
                to:selectionStartCol+sz1 - 1) = opening
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   490
            and:[(self 
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   491
                stringAtLine:selectionEndLine 
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   492
                from:selectionEndCol - sz2 + 1
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   493
                to:selectionEndCol) = closing ]) ifTrue:[
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   494
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   495
                self deleteCharsAtLine:selectionEndLine fromCol:selectionEndCol-sz2+1 toCol:selectionEndCol.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   496
                self deleteCharsAtLine:selectionStartLine fromCol:selectionStartCol toCol:selectionStartCol+sz1-1.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   497
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   498
                e := selectionEndCol - sz2.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   499
                selectionStartLine == selectionEndLine ifTrue:[e := e - sz1].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   500
                self selectFromLine:selectionStartLine col:selectionStartCol
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   501
                             toLine:selectionEndLine col:e.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   502
            ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   503
        ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   504
    ]
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   505
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   506
    "Modified: / 7.1.1997 / 20:13:32 / cg"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   507
    "Created: / 9.11.1997 / 01:05:46 / cg"
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   508
! !
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   509
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   510
!Workspace methodsFor:'events'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   511
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   512
keyPress:key x:x y:y
132
claus
parents: 131
diff changeset
   513
922
e6a5e1cf9565 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   514
    <resource: #keyboard (#DoIt #InspectIt #PrintIt #'CmdF*' #'CtrlF*')>
132
claus
parents: 131
diff changeset
   515
131
claus
parents: 125
diff changeset
   516
    |cmd commands fKey|
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   517
32
b6c23dfd5663 *** empty log message ***
claus
parents: 23
diff changeset
   518
    (key == #DoIt)      ifTrue:[^ self doIt].
23
69f1ba57f67a *** empty log message ***
claus
parents: 15
diff changeset
   519
    (key == #InspectIt) ifTrue:[^ self inspectIt].
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   520
    (key == #PrintIt)   ifTrue:[^ self printIt].
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   521
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   522
    "
131
claus
parents: 125
diff changeset
   523
     Ctrl-Fn or Cmd-Fn evaluates a key-sequence (n = 0..99)
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   524
     (I added Ctrl-Fn, because some windowmanagers already use cmd-fn)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   525
     see TextView>>keyPress:x:y:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   526
    "
131
claus
parents: 125
diff changeset
   527
    key isSymbol ifTrue:[
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   528
        (key startsWith:'CmdF') ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   529
            fKey := key copyFrom:4 
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   530
        ] ifFalse:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   531
            (key startsWith:'CtrlF') ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   532
               fKey := key copyFrom:5 
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   533
            ]
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   534
        ].
131
claus
parents: 125
diff changeset
   535
    ].
claus
parents: 125
diff changeset
   536
    fKey notNil ifTrue:[
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   537
        fKey := fKey asSymbol.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   538
        commands := Smalltalk at:#FunctionKeySequences ifAbsent:[nil].
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   539
        commands notNil ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   540
            cmd := commands at:fKey ifAbsent:[nil].
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   541
            cmd notNil ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   542
                AbortSignal "ErrorSignal" handle:[:ex |
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   543
                    self warn:'error occurred in keyboard macro'.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   544
                    ex return.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   545
                ] do:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   546
                    Parser evaluate:cmd asString
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   547
                           receiver:self
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   548
                          notifying:nil
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   549
                            compile:false.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   550
                ].
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   551
                ^ self
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   552
            ]
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   553
        ]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   554
    ].
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   555
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   556
    super keyPress:key x:x y:y
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   557
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   558
    "
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   559
     example uses of function keys:
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   560
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   561
     to set tab-distance to 4-cols,
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   562
     select the following:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   563
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   564
       self setTab4
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   565
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   566
     then, press shift-F2 to define the sequence;
95
7535cfca9509 *** empty log message ***
claus
parents: 79
diff changeset
   567
     press cmd-F2 to execute it 
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   568
     voila: you have set 4-tabs.
95
7535cfca9509 *** empty log message ***
claus
parents: 79
diff changeset
   569
     (some window managers (MWM, 4DWM have cmd-Fn redefined; use Ctrl-Fn then).
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   570
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   571
     to switch back, perform the same procedure with:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   572
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   573
        self setTab8
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   574
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   575
     Within the expression, 'self' is bound to the view. Thus, you can do
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   576
     all kinds of fancy things.
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   577
     For example:
95
7535cfca9509 *** empty log message ***
claus
parents: 79
diff changeset
   578
       if you like a browser to come up on the selection when pressing Cmd-F3:
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   579
       select:
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   580
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   581
        |sel|
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   582
        sel := self selection asString withoutSeparators.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   583
        (Smalltalk includesKey:sel asSymbol) ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   584
            (Smalltalk at:sel asSymbol) isClass ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   585
                SystemBrowser browseClass:(Smalltalk at:sel asSymbol)
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   586
            ]
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   587
        ]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   588
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   589
     then, press shift-F3 to define the command.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   590
     press cmd-F3 to execute it (select some classname before).
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   591
     (notice: on the Indy, Cmd-F3 is already used by the window manager)
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   592
95
7535cfca9509 *** empty log message ***
claus
parents: 79
diff changeset
   593
     if you like a file-include command on Cmd-F4:
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   594
     select:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   595
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   596
        |sel|
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   597
        sel := self selection.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   598
        sel notNil ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   599
            sel := sel asString withoutSeparators.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   600
            s := FileStream readonlyFileNamed:sel.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   601
            s notNil ifTrue:[
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   602
                self paste:(s contents asString).
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   603
                s close
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   604
            ]
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   605
        ]
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   606
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   607
    this will paste the contents of the file at the current cusor position.
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   608
    (select above expression, press Shift-F4,
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   609
     then select any filename and press Cmd-F4)
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   610
        try it here: /etc/passwd 
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 32
diff changeset
   611
    "
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   612
922
e6a5e1cf9565 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   613
    "Modified: 9.1.1997 / 12:18:30 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   614
! !
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   615
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   616
!Workspace methodsFor:'execution'!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   617
1501
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   618
do:code withValueDo:aBlock
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   619
    "helper for doIt, printIt and inspectIt. 
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   620
     Evaluate the selection and, if all went well, evaluate the argument, 
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   621
     aBlock with the value.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   622
     Most work is in preparing for proper cleanup in case of abort
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   623
     or other exception while the evaluation is performed.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   624
     (restore cursor, selectionColors etc.)"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   625
1501
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   626
    |selLine selCol endLine endCol cLine cCol cleanUp|
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   627
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   628
    code notNil ifTrue:[
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   629
        codeStartPosition := self characterPositionOfSelection.
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   630
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   631
        "
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   632
         remember selection for later - if there is an error,
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   633
         the notification method will highlight it.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   634
         thus destroying the current selection
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   635
        "
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   636
        selLine := selectionStartLine.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   637
        selCol := selectionStartCol.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   638
        endLine := selectionEndLine.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   639
        endCol := selectionEndCol.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   640
        cCol := cursorCol.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   641
        cLine := cursorLine.
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   642
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   643
        "
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   644
         cleanup: restore previous selection and cursor positions
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   645
        "
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   646
        cleanUp := [
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   647
                self selectFromLine:selLine col:selCol toLine:endLine col:endCol.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   648
                cLine notNil ifTrue:[
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   649
                    self cursorLine:cLine col:cCol
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   650
                ].
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   651
        ].
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   652
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   653
        "
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   654
         perform the action.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   655
         Be careful to release the reference to the value;
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   656
         otherwise, we could keep lots of garbage from being freed
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   657
         until the view gets closed
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   658
        "
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   659
        self topView withExecuteCursorDo:[
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   660
            [
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   661
                AbortSignal handle:[:ex |
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   662
                     ex return
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   663
                ] do:[
929
22265f1bb110 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   664
                    |value|
22265f1bb110 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   665
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   666
                    doItAction notNil ifTrue:[
929
22265f1bb110 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   667
                        value := doItAction value:(code asString).
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   668
                        cleanUp value. cleanUp := nil.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   669
                        aBlock value:value.
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   670
                    ]
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   671
                ]
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   672
            ] valueNowOrOnUnwindDo:[
929
22265f1bb110 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   673
                cleanUp notNil ifTrue:[
22265f1bb110 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   674
                    cleanUp value. cleanUp := nil
22265f1bb110 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   675
                ].
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   676
            ]
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   677
        ].
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   678
    ]
257
605e68c1223f use new withExecuteCursorDo:
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   679
1501
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   680
    "Modified: / 11.1.1997 / 20:56:30 / cg"
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   681
    "Modified: / 22.4.1998 / 21:56:13 / ca"
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   682
    "Created: / 22.4.1998 / 21:57:05 / ca"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   683
! !
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   684
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   685
!Workspace methodsFor:'initialize / release'!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   686
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   687
initStyle
966
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   688
    "setup viewStyle specifics"
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   689
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   690
    super initStyle.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   691
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   692
    errorFgColor := DefaultErrorForegroundColor.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   693
    errorFgColor isNil ifTrue:[errorFgColor := selectionFgColor].
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   694
    errorBgColor := DefaultErrorBackgroundColor.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   695
    errorBgColor isNil ifTrue:[
966
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   696
        device hasColors ifTrue:[
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   697
            errorBgColor := Color red
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   698
        ] ifFalse:[
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   699
            errorBgColor := selectionBgColor
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   700
        ]
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   701
    ].
966
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   702
824e0ecc0e6f comments
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
   703
    "Modified: 22.1.1997 / 11:58:00 / cg"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   704
!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   705
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   706
initialize
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   707
    super initialize.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   708
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   709
    showMatchingParenthesis := true.
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   710
    commentStrings := #(
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   711
                        '"/'
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   712
                        ('"' '"')
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   713
                       ).
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   714
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   715
    self initializeDoITAction.
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   716
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   717
    "Modified: / 9.11.1997 / 01:10:18 / cg"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   718
!
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   719
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   720
initializeDoITAction
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   721
    "set up the block to be evaluated for doIts.
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   722
     This is done here in a separate method to allow easier
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   723
     redefinition in subclasses"
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   724
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   725
    doItAction := [:theCode |
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   726
	Compiler 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   727
	    evaluate:theCode 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   728
	    in:nil 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   729
	    receiver:nil 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   730
	    notifying:self 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   731
	    logged:true 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   732
	    ifFail:nil 
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   733
    ].
1251
f8d97e73a18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   734
!
f8d97e73a18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   735
f8d97e73a18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   736
reinitialize
f8d97e73a18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   737
    super reinitialize.
f8d97e73a18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   738
    self cursor:Cursor normal.
f8d97e73a18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   739
f8d97e73a18b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   740
    "Created: 17.6.1997 / 15:39:02 / cg"
201
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   741
! !
d2888811c664 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   742
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   743
!Workspace methodsFor:'menu & menu actions'!
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   744
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   745
doIt
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   746
    "user selected 'doIt' from menu; show a wait-cursor, evaluate the code
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   747
     and finally restore cursor; return result of evaluation"
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   748
1521
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   749
    ^ self 
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   750
        do:(self selection) 
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   751
        withValueDo:[:result | ]
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   752
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   753
    "Modified: / 16.5.1998 / 16:45:01 / cg"
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   754
!
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   755
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   756
editMenu
1107
25753e7f960f commentary
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   757
    "return my popUpMenu; thats the superclasses menu
25753e7f960f commentary
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   758
     PLUS st-evaluation items: doIt, printIt and inspectIt."
25753e7f960f commentary
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   759
489
5816aa12fec8 resources
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   760
    <resource: #keyboard (#DoIt #PrintIt #InspectIt)>
1262
d69149b5be1f resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1251
diff changeset
   761
    <resource: #programMenu>
489
5816aa12fec8 resources
Claus Gittinger <cg@exept.de>
parents: 444
diff changeset
   762
1516
677fbbd9b32f care for nil sensor
Claus Gittinger <cg@exept.de>
parents: 1501
diff changeset
   763
    |m idx sensor|
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   764
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   765
    m := super editMenu.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   766
1516
677fbbd9b32f care for nil sensor
Claus Gittinger <cg@exept.de>
parents: 1501
diff changeset
   767
    ((sensor := self sensor) notNil and:[sensor ctrlDown]) ifTrue:[
1501
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   768
        m addLabels:(resources array:#('-' 'commentIt' 'uncommentIt' '-' 'timeIt' 'spyOnIt'))
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   769
          selectors:#(nil commentSelection uncommentSelection nil timeIt spyOnIt)
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   770
          accelerators:#(nil CommentSelection UncommentSelection nil nil nil)
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   771
          after:#again.
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   772
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   773
        self hasSelection ifFalse:[
1501
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   774
            m disableAll:#(commentSelection uncommentSelection timeIt spyOnIt) 
1395
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   775
        ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   776
        ^ m
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   777
    ].
cbadcf93c173 moved comment stuff from CodeView to here.
Claus Gittinger <cg@exept.de>
parents: 1354
diff changeset
   778
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   779
    "
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   780
     workspaces support #doIt, #printIt and #inspectIt
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   781
     add them after paste.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   782
    "
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   783
    idx := m indexOf:#paste.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   784
    idx == 0 ifTrue:[idx := m indexOf:#pasteOrReplace].
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   785
    idx ~~ 0 ifTrue:[
430
022b667e0d70 added accelerator display
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   786
        m addLabels:(resources array:#('-' 'doIt' 'printIt' 'inspectIt'))
022b667e0d70 added accelerator display
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   787
          selectors:#(nil doIt printIt inspectIt)
922
e6a5e1cf9565 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
   788
          accelerators:#(nil #DoIt #PrintIt #InspectIt)
430
022b667e0d70 added accelerator display
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   789
          after:idx
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   790
    ].
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   791
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   792
    self hasSelection ifFalse:[
430
022b667e0d70 added accelerator display
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   793
        m disableAll:#(printIt doIt inspectIt) 
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   794
    ].
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   795
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   796
    ^ m.
430
022b667e0d70 added accelerator display
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   797
1501
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   798
    "Modified: / 22.4.1998 / 21:49:06 / ca"
1516
677fbbd9b32f care for nil sensor
Claus Gittinger <cg@exept.de>
parents: 1501
diff changeset
   799
    "Modified: / 7.5.1998 / 02:47:00 / cg"
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   800
!
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   801
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   802
inspectIt
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   803
    "user selected 'inspectIt' from menu; use doIt to evaluate the code
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   804
     and start an inspector on the result"
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   805
1521
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   806
    ^ self 
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   807
        do:(self selection) 
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   808
        withValueDo:[:result | result inspect]
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   809
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   810
    "Modified: / 16.5.1998 / 16:44:56 / cg"
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   811
!
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   812
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   813
printIt
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   814
    "user selected 'printIt' from menu; use doIt to evaluate the code
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   815
     and insert result of evaluation into my text.
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   816
     If the text is readOnly, do nothing."
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   817
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   818
    readOnly ifTrue:[
693
8369529a2ac4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   819
        self beep
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   820
    ] ifFalse:[ 
1521
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   821
        self 
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   822
            do:(self selection) 
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   823
            withValueDo:[:result | 
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   824
                self cursorLine:selectionEndLine col:(selectionEndCol + 1).
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   825
                self insertSelectedStringAtCursor:(result displayString "printString")
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   826
            ]
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   827
    ]
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   828
1521
e2bb7811e4db removed useless intermediate invoke (looks better in debugView)
Claus Gittinger <cg@exept.de>
parents: 1516
diff changeset
   829
    "Modified: / 16.5.1998 / 16:44:44 / cg"
1501
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   830
!
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   831
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   832
spyOnIt
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   833
    "user selected 'spyOnIt' from menu; show a wait-cursor, evaluate the code
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   834
     and finally restore cursor; return result of evaluation"
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   835
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   836
    |code|
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   837
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   838
    code := 'MessageTally spyOn:[' , self selection asString string, ']'.
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   839
    self do:code withValueDo:[:result | ]
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   840
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   841
    "Modified: / 22.4.1998 / 22:03:53 / ca"
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   842
!
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   843
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   844
timeIt
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   845
    "user selected 'timeIt' from menu; show a wait-cursor, evaluate the code
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   846
     and finally restore cursor; return result of evaluation"
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   847
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   848
    |code|
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   849
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   850
    code := '|t| t := Time millisecondsToRun:[' , self selection asString string, '].
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   851
Transcript showCR:''execution time: '' , t printString , '' ms''.'.
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   852
    self do:code withValueDo:[:result | ]
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   853
5d106262fac2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   854
    "Modified: / 22.4.1998 / 22:03:51 / ca"
418
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   855
! !
777061f25321 commentary
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   856
206
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   857
!Workspace class methodsFor:'documentation'!
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   858
2363a64a7c88 version at the end
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   859
version
1523
6c0045d6a91f open workspace via double-click in the browser
Claus Gittinger <cg@exept.de>
parents: 1522
diff changeset
   860
    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.63 1998-05-16 14:59:56 cg Exp $'
858
ef7ba327189b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
   861
! !