UIHelpTool.st
author penk
Wed, 04 Sep 2002 17:35:44 +0200
changeset 1591 d5692dd57326
parent 1554 d5e4612bf7cf
child 1597 b670ad8c30e1
permissions -rw-r--r--
removed via FileBrowser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     1
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     2
 COPYRIGHT (c) 1995 by eXept Software AG
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     3
              All Rights Reserved
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     4
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     5
 This software is furnished under a license and may be used
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     6
 only in accordance with the terms of that license and with the
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     8
 be provided or otherwise made available to, or used by, any
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     9
 other person.  No title to or ownership of the software is
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    10
 hereby transferred.
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    11
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    12
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    13
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    14
1554
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
    15
"{ Package: 'stx:libtool2' }"
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
    16
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    17
ToolApplicationModel subclass:#UIHelpTool
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    18
	instanceVariableNames:'specClass specSelector dictionary dictionaries listSelection
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    19
		maxCharsPerLine modifiedHolder modified'
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    20
	classVariableNames:''
785417b6955d intitial checkin
ca
parents:
diff changeset
    21
	poolDictionaries:''
785417b6955d intitial checkin
ca
parents:
diff changeset
    22
	category:'Interface-UIPainter'
785417b6955d intitial checkin
ca
parents:
diff changeset
    23
!
785417b6955d intitial checkin
ca
parents:
diff changeset
    24
785417b6955d intitial checkin
ca
parents:
diff changeset
    25
!UIHelpTool class methodsFor:'documentation'!
785417b6955d intitial checkin
ca
parents:
diff changeset
    26
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    27
copyright
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    28
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    29
 COPYRIGHT (c) 1995 by eXept Software AG
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    30
              All Rights Reserved
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    31
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    32
 This software is furnished under a license and may be used
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    33
 only in accordance with the terms of that license and with the
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    35
 be provided or otherwise made available to, or used by, any
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    36
 other person.  No title to or ownership of the software is
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    37
 hereby transferred.
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    38
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    39
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    40
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    41
!
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    42
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    43
documentation
785417b6955d intitial checkin
ca
parents:
diff changeset
    44
"
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    45
    The Help Tool allows you to define help dictionaries for the widgets in
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
    46
    window applications. The tool are able to run stand alone or in other master 
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    47
    applications like the GUI Painter and the Menu Editor.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    48
    If the application responds to the selector #showHelp:aHelpText for:aView,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    49
    this selector is called by the widget's view when the mouse cursor moves over. 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    50
    If the application does not responds to that selector, and the activeHelp mode
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    51
    is enabled, an active help bubble is shown at the widget's view.
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    52
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    53
    [instance variables:]
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    54
        specClass       <Symbol>        class implementing the help spec
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    55
        specSelector    <Symbol>        selector returning the help spec
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    56
        dictionary      <Dictionary>    dictionary containing pairs of help keys/texts
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    57
        dictionaries    <Dictionary>    dictionary containing pairs of help spec classes/help dictionaries
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    58
        listSelection   <String>        current selected help key
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    59
        maxCharsPerLine <Integer>       maximum number of allowed characters per text line
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    60
        modifiedHolder  <ValueHolder>   value holder for setting as modified
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    61
        modified        <Boolean>       flag whether the help spec was modified
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    62
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    63
    [author:]
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    64
        Claus Atzkern, eXept Software AG
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    65
        Thomas Zwick, eXept Software AG
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    66
"
785417b6955d intitial checkin
ca
parents:
diff changeset
    67
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
    68
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    69
!UIHelpTool class methodsFor:'instance creation'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    70
832
2c5b61b168e8 allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
    71
open
833
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    72
    ^ self openOnClass:nil.
832
2c5b61b168e8 allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
    73
833
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    74
"/    |className cls|
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    75
"/
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    76
"/    className := Dialog request:(ClassResources string:'Open on which class ?').
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    77
"/    className size > 0 ifTrue:[
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    78
"/        cls := Smalltalk at:className asSymbol.
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    79
"/        cls notNil ifTrue:[
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    80
"/            ^ self openOnClass:cls.
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    81
"/        ].
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    82
"/        self warn:(ClassResources string:'No such class').
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    83
"/    ].
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    84
"/
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    85
"/    "Created: / 20.5.1998 / 00:55:05 / cg"
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    86
"/
832
2c5b61b168e8 allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
    87
833
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    88
    "Modified: / 20.5.1998 / 01:06:07 / cg"
832
2c5b61b168e8 allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
    89
!
2c5b61b168e8 allow #open (its in the docu !)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
    90
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    91
openOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    92
    "opens a Help Tool on aClass"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    93
833
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    94
    self new openOnClass:aClass
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
    95
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    96
    "
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    97
     UIHelpTool openOnClass:self
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    98
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    99
833
ff2f237a309a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
   100
    "Modified: / 20.5.1998 / 01:06:14 / cg"
940
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
   101
!
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
   102
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
   103
openOnClass:aClass andSelector: aSelector
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
   104
    "opens a Help Tool on aClass and aSelector"
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
   105
946
536722005e32 fixed #openOnClass:andSelector:
tz
parents: 940
diff changeset
   106
    ^self new openOnClass:aClass andSelector: aSelector
940
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
   107
  
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   108
! !
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   109
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   110
!UIHelpTool class methodsFor:'constants'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   111
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   112
label
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   113
    "returns the label; used if embedded as sub canvas in the GUI Painter or Menu Editor"
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   114
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   115
    ^'Help'
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   116
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   117
151
ca
parents: 148
diff changeset
   118
!UIHelpTool class methodsFor:'help specs'!
ca
parents: 148
diff changeset
   119
ca
parents: 148
diff changeset
   120
helpSpec
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   121
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   122
     by the UIHelpTool of ST/X."
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   123
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   124
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   125
     the UIHelpTool may not be able to read the specification."
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   126
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
   127
    "
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   128
     UIHelpTool openOnClass:UIHelpTool    
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   129
    "
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   130
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   131
    <resource: #help>
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   132
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   133
    ^super helpSpec addPairsFrom:#(
151
ca
parents: 148
diff changeset
   134
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   135
#addHelpTextKey
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   136
'Adds the key to the help spec.'
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   137
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   138
#currentHelpTexts
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   139
'Selected help text key.'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   140
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   141
#deleteHelpTextKey
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   142
'Deletes the key from the help spec.'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   143
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   144
#updateHelpTextKey
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   145
'Refetch the help spec.'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   146
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   147
#fileLoad
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   148
'Opens a dialog for selecting and loading a help spec from a class.'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   149
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   150
#fileSave
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   151
'Saves the current help spec.'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   152
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   153
#fileUpdate
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   154
'Reload the help spec.'
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   155
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   156
#helpTextView
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   157
'Shows the help text.'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   158
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   159
#listOfHelpSpecClasses
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   160
'Classes where help specs can be/are implemented.'
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   161
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   162
#listOfHelpTexts
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   163
'List of help text keys.'
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   164
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   165
#removeHelpTextKey
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   166
'Removes the help message from the widget.'
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
   167
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
   168
)
151
ca
parents: 148
diff changeset
   169
! !
ca
parents: 148
diff changeset
   170
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   171
!UIHelpTool class methodsFor:'interface specs'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   172
785417b6955d intitial checkin
ca
parents:
diff changeset
   173
windowSpec
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   174
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   175
     by the UIPainter of ST/X."
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   176
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   177
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   178
     the UIPainter may not be able to read the specification."
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   179
785417b6955d intitial checkin
ca
parents:
diff changeset
   180
    "
151
ca
parents: 148
diff changeset
   181
     UIPainter new openOnClass:UIHelpTool andSelector:#windowSpec
ca
parents: 148
diff changeset
   182
     UIHelpTool new openInterface:#windowSpec
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   183
     UIHelpTool open
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   184
    "
785417b6955d intitial checkin
ca
parents:
diff changeset
   185
785417b6955d intitial checkin
ca
parents:
diff changeset
   186
    <resource: #canvas>
785417b6955d intitial checkin
ca
parents:
diff changeset
   187
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   188
    ^ 
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   189
     #(#FullSpec
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   190
        #name: #windowSpec
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   191
        #window: 
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   192
       #(#WindowSpec
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   193
          #label: 'Help Tool'
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   194
          #name: 'Help Tool'
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   195
          #min: #(#Point 10 10)
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   196
          #max: #(#Point 1160 870)
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   197
          #bounds: #(#Rectangle 218 175 504 446)
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   198
        )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   199
        #component: 
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   200
       #(#SpecCollection
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   201
          #collection: #(
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   202
           #(#VariableVerticalPanelSpec
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   203
              #name: 'VariableVerticalPanel'
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   204
              #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   205
              #component: 
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   206
             #(#SpecCollection
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   207
                #collection: #(
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   208
                 #(#ViewSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   209
                    #name: 'Box1'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   210
                    #component: 
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   211
                   #(#SpecCollection
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   212
                      #collection: #(
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   213
                       #(#HorizontalPanelViewSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   214
                          #name: 'HorizontalPanel1'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   215
                          #layout: #(#LayoutFrame 0 0 0 0 0 1 25 0)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   216
                          #horizontalLayout: #fit
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   217
                          #verticalLayout: #fit
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   218
                          #horizontalSpace: 3
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   219
                          #verticalSpace: 3
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   220
                          #component: 
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   221
                         #(#SpecCollection
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   222
                            #collection: #(
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   223
                             #(#ActionButtonSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   224
                                #label: 'Add'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   225
                                #name: 'AddButton'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   226
                                #activeHelpKey: #addHelpTextKey
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   227
                                #translateLabel: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   228
                                #tabable: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   229
                                #model: #doAdd
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   230
                                #extent: #(#Point 69 25)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   231
                              )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   232
                             #(#ActionButtonSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   233
                                #label: 'Remove'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   234
                                #name: 'RemoveButton'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   235
                                #activeHelpKey: #removeHelpTextKey
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   236
                                #translateLabel: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   237
                                #tabable: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   238
                                #model: #doRemove
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   239
                                #extent: #(#Point 69 25)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   240
                              )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   241
                             #(#ActionButtonSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   242
                                #label: 'Update'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   243
                                #name: 'UpdateButton'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   244
                                #activeHelpKey: #updateHelpTextKey
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   245
                                #translateLabel: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   246
                                #tabable: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   247
                                #model: #doUpdate
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   248
                                #extent: #(#Point 69 25)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   249
                              )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   250
                             #(#ActionButtonSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   251
                                #label: 'Delete'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   252
                                #name: 'DeleteButton'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   253
                                #activeHelpKey: #deleteHelpTextKey
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   254
                                #translateLabel: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   255
                                #tabable: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   256
                                #model: #doDelete
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   257
                                #extent: #(#Point 70 25)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   258
                              )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   259
                             )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   260
                           
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   261
                          )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   262
                        )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   263
                       #(#VariableHorizontalPanelSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   264
                          #name: 'VariableHorizontalPanel'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   265
                          #layout: #(#LayoutFrame 0 0 25 0 0 1 0 1)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   266
                          #component: 
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   267
                         #(#SpecCollection
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   268
                            #collection: #(
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   269
                             #(#SequenceViewSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   270
                                #name: 'listOfHelpKeysView'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   271
                                #activeHelpKey: #listOfHelpTexts
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   272
                                #tabable: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   273
                                #model: #listModel
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   274
                                #hasHorizontalScrollBar: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   275
                                #hasVerticalScrollBar: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   276
                                #miniScrollerHorizontal: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   277
                                #useIndex: false
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   278
                                #sequenceList: #listChannel
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   279
                              )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   280
                             #(#ViewSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   281
                                #name: 'Box'
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   282
                                #component: 
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   283
                               #(#SpecCollection
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   284
                                  #collection: #(
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   285
                                   #(#InputFieldSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   286
                                      #name: 'helpKeyInputField'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   287
                                      #layout: #(#LayoutFrame 2 0.0 2 0 -2 1.0 25 0)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   288
                                      #activeHelpKey: #currentHelpTexts
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   289
                                      #tabable: true
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   290
                                      #model: #listModel
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   291
                                      #immediateAccept: false
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   292
                                      #acceptOnPointerLeave: false
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   293
                                    )
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   294
                                   #(#SequenceViewSpec
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   295
                                      #name: 'listOfHelpSpecClassesView'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   296
                                      #layout: #(#LayoutFrame 0 0.0 27 0 0 1.0 0 1.0)
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   297
                                      #activeHelpKey: #listOfHelpSpecClasses
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   298
                                      #tabable: true
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   299
                                      #model: #selectionOfHelpSpecClass
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   300
                                      #hasHorizontalScrollBar: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   301
                                      #hasVerticalScrollBar: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   302
                                      #miniScrollerHorizontal: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   303
                                      #miniScrollerVertical: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   304
                                      #valueChangeSelector: #helpSpecClassSelected
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   305
                                      #useIndex: false
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   306
                                      #sequenceList: #listOfHelpSpecClasses
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   307
                                    )
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   308
                                   )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   309
                                 
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   310
                                )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   311
                              )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   312
                             )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   313
                           
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   314
                          )
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   315
                          #handles: #(#Any 0.5 1.0)
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   316
                        )
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   317
                       )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   318
                     
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   319
                    )
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   320
                  )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   321
                 #(#TextEditorSpec
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   322
                    #name: 'helpTextView'
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   323
                    #activeHelpKey: #helpTextView
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   324
                    #tabable: true
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   325
                    #hasHorizontalScrollBar: true
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   326
                    #hasVerticalScrollBar: true
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   327
                    #miniScrollerHorizontal: true
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   328
                    #miniScrollerVertical: true
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   329
                  )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   330
                 )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   331
               
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   332
              )
1302
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   333
              #handles: #(#Any 0.5 1.0)
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   334
            )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   335
           )
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   336
         
f13d0e144c82 unmap previous canvasView; prepare focus sequence
ca
parents: 1243
diff changeset
   337
        )
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   338
      )
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   339
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   340
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   341
windowSpecForStandAlone
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   342
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   343
     by the UIPainter of ST/X."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   344
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   345
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   346
     the UIPainter may not be able to read the specification."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   347
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   348
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   349
     UIPainter new openOnClass:UIHelpTool andSelector:#windowSpecForStandAlone
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   350
     UIHelpTool new openInterface:#windowSpecForStandAlone
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   351
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   352
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   353
    <resource: #canvas>
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   354
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   355
    ^
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   356
     
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   357
       #(#FullSpec
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   358
          #window: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   359
           #(#WindowSpec
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   360
              #name: 'Help Tool'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   361
              #layout: #(#LayoutFrame 191 0 334 0 660 0 663 0)
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   362
              #label: 'Help Tool'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   363
              #min: #(#Point 300 300)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   364
              #max: #(#Point 1152 900)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   365
              #bounds: #(#Rectangle 191 334 661 664)
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   366
              #menu: #menu
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   367
              #usePreferredExtent: false
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   368
          )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   369
          #component: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   370
           #(#SpecCollection
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   371
              #collection: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   372
               #(
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   373
                 #(#UISubSpecification
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   374
                    #name: 'windowSpec'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   375
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -26 1.0)
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   376
                    #minorKey: #windowSpec
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   377
                )
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   378
                 #(#UISubSpecification
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   379
                    #name: 'windowSpecForInfoBar'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   380
                    #layout: #(#LayoutFrame 0 0 -24 1 0 1 0 1)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   381
                    #majorKey: #ToolApplicationModel
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   382
                    #minorKey: #windowSpecForInfoBar
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   383
                )
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   384
              )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   385
          )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   386
      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   387
! !
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   388
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   389
!UIHelpTool class methodsFor:'menu specs'!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   390
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   391
menu
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   392
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   393
     by the MenuEditor of ST/X."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   394
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   395
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   396
     the MenuEditor may not be able to read the specification."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   397
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   398
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   399
     MenuEditor new openOnClass:UIHelpTool andSelector:#menu
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   400
     (Menu new fromLiteralArrayEncoding:(UIHelpTool menu)) startUp
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   401
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   402
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   403
    <resource: #menu>
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   404
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   405
    ^
904
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   406
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   407
       #(#Menu
904
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   408
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   409
           #(
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   410
             #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   411
                #label: 'File'
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   412
                #translateLabel: true
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   413
                #submenu: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   414
                 #(#Menu
904
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   415
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   416
                     #(
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   417
                       #(#MenuItem
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   418
                          #label: 'Load...'
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   419
                          #translateLabel: true
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   420
                          #value: #doLoad
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   421
                          #activeHelpKey: #fileLoad
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   422
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   423
                       #(#MenuItem
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   424
                          #label: 'Update'
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   425
                          #translateLabel: true
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   426
                          #value: #doUpdate
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   427
                          #activeHelpKey: #fileUpdate
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   428
                      )
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   429
                       #(#MenuItem
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   430
                          #label: '-'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   431
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   432
                       #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   433
                          #label: 'Save'
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   434
                          #translateLabel: true
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   435
                          #value: #doSave
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   436
                          #activeHelpKey: #fileSave
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   437
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   438
                       #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   439
                          #label: '-'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   440
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   441
                       #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   442
                          #label: 'Exit'
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   443
                          #translateLabel: true
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   444
                          #value: #closeRequest
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   445
                          #activeHelpKey: #fileExit
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   446
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   447
                    ) nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   448
                    nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   449
                )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   450
            )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   451
             #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   452
                #label: 'Edit'
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   453
                #translateLabel: true
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   454
                #submenu: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   455
                 #(#Menu
904
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   456
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   457
                     #(
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   458
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   459
                          #label: 'Add'
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   460
                          #translateLabel: true
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   461
                          #value: #doAdd
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   462
                          #activeHelpKey: #addHelpTextKey
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   463
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   464
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   465
                          #label: '-'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   466
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   467
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   468
                          #label: 'Delete'
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   469
                          #translateLabel: true
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   470
                          #value: #doDelete
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   471
                          #activeHelpKey: #deleteHelpTextKey
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   472
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   473
                    ) nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   474
                    nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   475
                )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   476
            )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   477
             #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   478
                #label: 'Help'
904
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   479
                #translateLabel: true
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   480
                #startGroup: #right
904
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   481
                #activeHelpKey: #help
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   482
                #submenuChannel: #menuHelp
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   483
            )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   484
          ) nil
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   485
          nil
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   486
      )
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   487
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   488
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   489
785417b6955d intitial checkin
ca
parents:
diff changeset
   490
!UIHelpTool methodsFor:'accessing'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   491
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   492
dictionaries
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   493
    "returns the dictionary of the help dictionaries of the classes having help specs"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   494
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   495
    ^dictionaries
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   496
!
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   497
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   498
dictionaries:aDictionaryOfDictionaries
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   499
    "sets a dictionary of the help dictionaries of the classes having help specs"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   500
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   501
    (dictionaries := aDictionaryOfDictionaries) isNil ifTrue:[
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   502
        dictionaries := Dictionary new.
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   503
    ].
715
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   504
    self updateList.
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   505
!
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   506
151
ca
parents: 148
diff changeset
   507
dictionary
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   508
    "returns the dictionary of the selected class"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   509
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   510
    ^dictionary
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   511
!
151
ca
parents: 148
diff changeset
   512
ca
parents: 148
diff changeset
   513
dictionary:aDictionary
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   514
    "sets dictionary of the selected class"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   515
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   516
    (dictionary := aDictionary) isNil ifTrue:[
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   517
        dictionary := Dictionary new.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   518
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   519
    self updateList
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   520
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   521
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   522
helpKey
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   523
    "returns the help key of selected help text"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   524
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   525
    listSelection size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   526
        ^ listSelection asSymbol
151
ca
parents: 148
diff changeset
   527
    ].
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   528
    ^ nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   529
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   530
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   531
helpKey:aKey
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   532
    "sets the help key into the selection channel in order to show the help text"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   533
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   534
    |key|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   535
    aKey size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   536
        key := aKey asString
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   537
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   538
    self listModel value:key
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   539
151
ca
parents: 148
diff changeset
   540
!
ca
parents: 148
diff changeset
   541
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   542
modified
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   543
    "returns whether the help tool was modified"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   544
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   545
    ^modified
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   546
!
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   547
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   548
modified: aBoolean
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   549
    "sets the help tool as modified"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   550
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   551
    modified := aBoolean
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   552
!
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   553
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   554
modifiedHolder:aValueHolder
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   555
    "sets the value holder to true in case of modifying attributes"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   556
891
bafed0c2436d avoid repeated send-sequences
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   557
    |eTxtView modChannel|
bafed0c2436d avoid repeated send-sequences
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   558
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   559
    modifiedHolder notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   560
        modifiedHolder removeDependent:self. 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   561
    ].
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   562
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   563
    (modifiedHolder := aValueHolder) notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   564
        modifiedHolder addDependent:self.
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   565
891
bafed0c2436d avoid repeated send-sequences
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   566
        (eTxtView := self editTextView) notNil ifTrue: [
bafed0c2436d avoid repeated send-sequences
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   567
            modChannel := eTxtView modifiedChannel.
1329
a38c2e29d1fb use onChangeEvaluate:
Claus Gittinger <cg@exept.de>
parents: 1302
diff changeset
   568
            modChannel onChangeEvaluate:[
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   569
                modifiedHolder notNil ifTrue:[
891
bafed0c2436d avoid repeated send-sequences
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   570
                    modChannel value ifTrue:[
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   571
                        modifiedHolder value:true
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   572
                    ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   573
                ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   574
            ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   575
        ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   576
    ]
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   577
891
bafed0c2436d avoid repeated send-sequences
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   578
    "Modified: / 16.7.1998 / 18:12:09 / cg"
715
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   579
!
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   580
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   581
specClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   582
    "returns the class on which the help tool works"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   583
715
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   584
    ^specClass
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   585
! !
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   586
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   587
!UIHelpTool methodsFor:'aspects'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   588
785417b6955d intitial checkin
ca
parents:
diff changeset
   589
listChannel
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   590
    "returns the value holder of the help texts"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   591
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   592
    |holder|
785417b6955d intitial checkin
ca
parents:
diff changeset
   593
    (holder := builder bindingAt:#listChannel) isNil ifTrue:[
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   594
        builder aspectAt:#listChannel put:(holder :=  OrderedCollection new asValue).
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   595
    ].
785417b6955d intitial checkin
ca
parents:
diff changeset
   596
    ^ holder
785417b6955d intitial checkin
ca
parents:
diff changeset
   597
!
785417b6955d intitial checkin
ca
parents:
diff changeset
   598
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   599
listModel
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   600
    "returns the value holder of the help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   601
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   602
    |holder|
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   603
    (holder := builder bindingAt:#listModel) isNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   604
        holder := AspectAdaptor new subject:self; forAspect:#listSelection.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   605
        builder aspectAt:#listModel put:holder.
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   606
    ].
785417b6955d intitial checkin
ca
parents:
diff changeset
   607
    ^ holder
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   608
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   609
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   610
listOfHelpSpecClasses
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   611
    "returns the value holder of the specClass and its superclasses 
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   612
     which are subclasses of ApplicationModel"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   613
1184
c67bdfe67afd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
   614
    ^ builder listAspectFor:#listOfHelpSpecClasses
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   615
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   616
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   617
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   618
selectionOfHelpSpecClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   619
    "returns the value holder of the selected help spec class"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   620
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   621
    |holder|
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   622
    (holder := builder bindingAt:#selectionOfHelpSpecClass) isNil ifTrue:[
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   623
        builder aspectAt:#selectionOfHelpSpecClass put: (holder := ValueHolder new)
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   624
    ].
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   625
    ^ holder
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   626
1336
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   627
!
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   628
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   629
valueOfInfoLabel
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   630
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   631
    masterApplication notNil ifTrue:[
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   632
        ^ masterApplication valueOfInfoLabel
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   633
    ].
3c84dc6f8d4b delegate valueOfInfoLabel to masterApplication if exists
ca
parents: 1329
diff changeset
   634
    ^ super valueOfInfoLabel
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   635
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   636
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   637
!UIHelpTool methodsFor:'building'!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   638
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   639
buildFromClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   640
    "reads the help dictionary from aClass and find remaining classes 
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   641
     'between' aClass and ApplicationModel" 
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   642
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   643
    modified := false.
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   644
    specClass  := self getHelpSpecClassFromClass:aClass.
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   645
    self rebuild.
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   646
!
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   647
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   648
buildFromClass: aClass andSelector: aSelector
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   649
    "sets aSelector and reads the help dictionary from aClass"
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   650
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   651
    specSelector := aSelector.
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   652
    self buildFromClass:aClass
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   653
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   654
!
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   655
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   656
rebuild
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   657
    "reads the help dictionary from aClass and find remaining classes 
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   658
     'between' aClass and ApplicationModel" 
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   659
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   660
    |list listOfHelpSpecClassesView|
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   661
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   662
    specClass notNil ifTrue:[   
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   663
        dictionary   := Dictionary new.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   664
        dictionaries := Dictionary new.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   665
    ].
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   666
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   667
    (specClass isClass and: [specClass isLoaded])
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   668
    ifTrue: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   669
    [                                               
1554
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
   670
        (specClass class includesSelector:specSelector) ifFalse:[
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   671
            dictionaries at: specClass name put: dictionary 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   672
        ].
963
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   673
        list := self listOfHelpSpecClasses.
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   674
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   675
        list contents:  (specClass withAllSuperclasses reverse collect: [:cls| cls name]).
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   676
        (list includes: #ApplicationModel)
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   677
            ifTrue: [list removeAll: (ApplicationModel withAllSuperclasses collect: [:cls| cls name])].
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   678
        self selectionOfHelpSpecClass value: specClass name.  
963
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   679
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   680
        listOfHelpSpecClassesView := builder componentAt: #listOfHelpSpecClassesView.
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   681
        listOfHelpSpecClassesView notNil ifTrue:[
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   682
            listOfHelpSpecClassesView selection: 
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   683
                    (list value indexOf: specClass name).
62cdb7923a3b care for setup, before view components are built
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   684
        ].
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   685
        self helpSpecClassSelected.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   686
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   687
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   688
    self updateList
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   689
! !
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   690
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   691
!UIHelpTool methodsFor:'callbacks'!
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   692
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   693
helpSpecClassSelected
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   694
    "extracts the help dictionary from the selected class and make it current"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   695
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   696
    |clsName|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   697
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   698
    clsName := self selectionOfHelpSpecClass value.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   699
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   700
    (dictionary := dictionaries at: clsName ifAbsent: nil) isNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   701
    ifTrue:
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   702
    [        
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   703
        dictionary := dictionaries at: clsName put: (self extractHelpSpecForClass: (Smalltalk at: clsName))
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   704
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   705
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   706
    self updateList.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   707
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   708
    listSelection notNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   709
    ifTrue: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   710
    [
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   711
        (dictionary keys includes: listSelection asSymbol)
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   712
            ifTrue: [(builder componentAt: #listOfHelpKeysView) selection: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   713
                     (self listChannel value indexOf: (builder componentAt: #helpKeyInputField) contents)]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   714
            ifFalse: [(builder componentAt: #listOfHelpKeysView) selection: nil].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   715
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   716
    listSelection notNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   717
    ifTrue: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   718
    [
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   719
        self editTextView contents: (dictionary at: listSelection asSymbol ifAbsent: '')
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   720
    ]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   721
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   722
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   723
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   724
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   725
!UIHelpTool methodsFor:'help'!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   726
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   727
defaultInfoLabel
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   728
    "returns the default label for the info bar"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   729
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   730
    specClass isClass
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   731
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   732
    [
1554
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
   733
        (specClass class includesSelector: specSelector)
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   734
        ifFalse: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   735
        [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   736
            ^specSelector isNil 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   737
                ifTrue:  [specClass name, ' >> ? (no selector defined)']
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   738
                ifFalse: [specClass name, ' >> ', specSelector, ' (not implemented)']
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   739
        ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   740
        ^specClass name, ' >> ', specSelector
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   741
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   742
    ^'No class and selector defined.'
904
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   743
!
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   744
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   745
openDocumentation
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   746
    "opens the documentation file of the Help Tool"
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   747
b40cce7f3748 use standard help calls
tz
parents: 896
diff changeset
   748
    self openHTMLDocument: 'tools/uipainter/HelpTool.html'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   749
! !
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   750
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   751
!UIHelpTool methodsFor:'private'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   752
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   753
askForModification
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   754
    "asks for modification"
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   755
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   756
    modified
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   757
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   758
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   759
        ((YesNoBox title: 'List was modified!!')        
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   760
            noText:'Cancel';
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   761
            yesText:'Waste it and proceed';
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   762
            showAtPointer;
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   763
            accepted) ifFalse: [^false].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   764
        modified := false
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   765
    ].
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   766
    ^true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   767
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   768
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   769
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   770
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   771
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   772
editTextView
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   773
    "returns the editTextView or nil"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   774
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   775
    |view|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   776
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   777
    (view := builder componentAt:#helpTextView) notNil ifTrue:[
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   778
        view := view scrolledView.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   779
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   780
        view acceptAction isNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   781
            view acceptAction:[:aList| self accept ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   782
        ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   783
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   784
        view left ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   785
            (maxCharsPerLine := view extent x // view font width) < 10 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   786
                maxCharsPerLine := nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   787
            ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   788
        ].
454
8b016ffd83ce set modified if help text accepted
tz
parents: 393
diff changeset
   789
    ].       
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   790
    ^ view
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   791
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   792
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   793
extractHelpSpecForClass: aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   794
    "extracts the help dictionary of aClass, it current and return it"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   795
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   796
    |helpSpecSuperClass superHelpSpecKeys helpSpec|
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   797
1554
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
   798
    ((aClass class includesSelector: specSelector)
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
   799
    and: [(helpSpecSuperClass := aClass allSuperclasses detect: [:cls| cls class includesSelector: specSelector] ifNone: nil) notNil])
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   800
    ifTrue:[                  
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   801
        superHelpSpecKeys := helpSpecSuperClass helpSpec keys.
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   802
        helpSpec := Dictionary new.
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   803
        aClass helpSpec keysAndValuesDo:[:key :value |
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   804
            (superHelpSpecKeys includes:key) ifFalse: [
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   805
                helpSpec at:key put:value
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   806
            ]
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   807
        ].          
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   808
        ^ dictionary := helpSpec
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   809
    ].
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   810
    ^ dictionary := Dictionary new 
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   811
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   812
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   813
findHelpSpecForKey: aHelpKey
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   814
    "finds the help spec class including aHelpKey in its help dictionary and make it current"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   815
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   816
    |dictTemp listOfHelpSpecClasses|
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   817
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   818
    aHelpKey isNil ifTrue: [^nil].
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   819
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   820
    dictTemp := dictionary.
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   821
    listOfHelpSpecClasses := self listOfHelpSpecClasses.
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   822
    listOfHelpSpecClasses value do:[:clsName|            
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   823
        (dictionary := dictionaries at: clsName ifAbsent: nil) isNil ifTrue:[        
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   824
            dictionary := dictionaries at: clsName put: (self extractHelpSpecForClass: (Smalltalk at: clsName))
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   825
        ].
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   826
        (dictionary includesKey: aHelpKey asSymbol) ifTrue:[            
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   827
            self updateList.
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   828
            ^(builder componentAt: #listOfHelpSpecClassesView) selection: 
1198
6b7cfe55105b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   829
                (listOfHelpSpecClasses value indexOf: clsName).
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   830
        ]
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   831
    ].
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   832
    dictionary := dictTemp
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   833
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   834
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   835
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   836
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   837
getHelpSpecClassFromClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   838
    "returns application class keeping the associated help text or nil"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   839
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   840
    |cls|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   841
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   842
    ((cls := self resolveName:aClass) notNil and:[cls respondsTo: #helpSpecClass]) ifTrue:[
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   843
        ^cls helpSpecClass
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   844
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   845
    ^cls
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   846
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   847
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   848
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   849
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   850
getUnformattedHelpText: aHelpText
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   851
    "unformats aHelpText and returns it"
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   852
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   853
    |helpText|
896
0e732b716759 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 891
diff changeset
   854
0e732b716759 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 891
diff changeset
   855
    helpText := aHelpText asString copyReplaceAll:(Character cr) with:(Character space).
0e732b716759 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 891
diff changeset
   856
    (helpText endsWith:(Character space)) ifTrue:[
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   857
        helpText := helpText copyWithoutLast:1
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   858
    ].
896
0e732b716759 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 891
diff changeset
   859
    ^ helpText
0e732b716759 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 891
diff changeset
   860
0e732b716759 use #copyReplaceAll:with:
Claus Gittinger <cg@exept.de>
parents: 891
diff changeset
   861
    "Modified: / 20.7.1998 / 13:17:52 / cg"
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   862
!
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   863
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   864
installHelpSpecOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   865
    "saves the help dicts in aClass which is subclass of ApplicationModel"
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   866
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   867
    |cls src helpSpec|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   868
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   869
    cls := self getHelpSpecClassFromClass: aClass.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   870
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   871
    cls isNil ifTrue:[
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   872
        self information:'No application class defined!!'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   873
        ^nil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   874
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   875
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   876
    (cls isSubclassOf: ApplicationModel) ifFalse:[
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   877
        self information: 'Cannot save help spec into class ', cls name asBoldText, ',\because it is not a subclass of ApplicationModel!!' withCRs.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   878
        ^nil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   879
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   880
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   881
    helpSpec := dictionaries 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   882
        at: cls name 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   883
        ifAbsent: [specClass notNil 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   884
            ifTrue:  [dictionaries at: aClass put: (self extractHelpSpecForClass: (Smalltalk at: aClass))]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   885
            ifFalse: [dictionary size > 0 ifTrue: [dictionary] ifFalse: [Dictionary new]]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   886
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   887
    helpSpec associationsDo:
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   888
    [:h|
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   889
        helpSpec at: h key put: (self getUnformattedHelpText: h value)
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   890
    ].
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   891
1554
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
   892
    (cls class includesSelector: specSelector) 
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   893
    ifTrue: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   894
    [
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   895
        |superclassHelpKeys implementedHelpSpec hasChanged|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   896
        implementedHelpSpec := Dictionary new.
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   897
        superclassHelpKeys := (cls superclass respondsTo: specSelector)
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   898
            ifTrue:  [cls superclass helpSpec keys]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   899
            ifFalse: [Array new].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   900
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   901
        cls helpSpec associationsDo: [:h| (superclassHelpKeys includes: h key) 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   902
            ifFalse: [implementedHelpSpec at: h key put: h value]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   903
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   904
        hasChanged := false.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   905
        implementedHelpSpec associationsDo: [:h| (helpSpec            includesAssociation: h) ifFalse: [hasChanged := true]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   906
        helpSpec            associationsDo: [:h| (implementedHelpSpec includesAssociation: h) ifFalse: [hasChanged := true]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   907
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   908
        (implementedHelpSpec notEmpty and: [hasChanged and:
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   909
        [DialogBox confirm: 'Class ', cls name asBoldText, ' already implements\a help spec!!\\Do only replace, if you have removed\help keys in an existing help spec.\' withCRs yesLabel: ' Merge ' noLabel: ' Replace ']])
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   910
        ifTrue:
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   911
        [      
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   912
             implementedHelpSpec associationsDo: [:h| (helpSpec includesKey: h key) 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   913
                ifFalse: [helpSpec at: h key put: h value]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   914
        ]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   915
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   916
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   917
    helpSpec isEmpty ifTrue:[
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   918
        ^(cls superclass respondsTo: specSelector) ifTrue: [cls class removeSelector: specSelector].
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   919
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   920
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   921
    src  := '' writeStream.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   922
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   923
    src nextPutAll:
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   924
        specSelector, '\' withCRs,
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   925
        (ResourceSpecEditor codeGenerationCommentForClass: UIHelpTool) withCRs,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   926
    '\\' withCRs,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   927
    '    "\' withCRs,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   928
    '     UIHelpTool openOnClass:', cls name asString ,'    
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   929
    "
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   930
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   931
    <resource: #help>
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   932
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   933
    ^super ', specSelector, ' addPairsFrom:#(
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   934
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   935
'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   936
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   937
    helpSpec keys asSortedCollection do:
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   938
    [:key|
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   939
        src nextPutLine: key storeString.
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   940
        src nextPutLine: (helpSpec at: key) storeString; cr.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   941
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   942
    src nextPutLine:')'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   943
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   944
    Compiler 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   945
        compile:(src contents)
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   946
        forClass:cls class 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   947
        inCategory:'help specs'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   948
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   949
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   950
installHelpSpecsOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   951
    "saves the help dicts on aClass and its superclasses which are subclasses of ApplicationModel"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   952
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   953
    |cls helpSpecClasses|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   954
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   955
    cls := self getHelpSpecClassFromClass:aClass.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   956
    cls isNil ifTrue: [^self information:'No application class defined!!'].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   957
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   958
    modified ifFalse:[
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   959
        masterApplication isNil ifTrue: [self information:'Nothing was modified!!'].
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   960
        ^nil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   961
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   962
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   963
    (helpSpecClasses := self listOfHelpSpecClasses value) notNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   964
    ifTrue:
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   965
    [        
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   966
        (helpSpecClasses includes: cls name) ifFalse: [helpSpecClasses add: cls name].
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   967
        helpSpecClasses do: [:clsName| (self installHelpSpecOnClass: clsName) isNil ifTrue: [^modified := false]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   968
    ]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   969
    ifFalse:
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   970
    [      
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   971
        self installHelpSpecOnClass: cls
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   972
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   973
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   974
    modified := false.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   975
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   976
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   977
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   978
resourceMessage: aString
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   979
    "extracts from aString the specClass and the specSelector"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   980
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   981
    (aString notNil and: [self askForModification]) 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   982
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   983
    [            
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   984
        |msg cls sel|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   985
        msg := aString asCollectionOfWords.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   986
        (msg size == 2 and:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   987
        [(cls := self resolveName:(msg at:1)) notNil])
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   988
        ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   989
        [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   990
            specClass := cls name.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   991
            specSelector := (msg at: 2) asSymbol.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   992
            ^true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   993
        ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   994
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   995
    ^false
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   996
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   997
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   998
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   999
updateList
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1000
    "updates the list channel from dictionary"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1001
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
  1002
    self listChannel value: dictionary keys asSortedCollection
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1003
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1004
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1005
!UIHelpTool methodsFor:'selection'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1006
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1007
listSelection
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1008
    "returns current selection"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1009
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1010
    ^ listSelection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1011
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1012
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1013
listSelection:aSelection
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1014
    "sets current selection"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1015
1243
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1016
    |txt view selection|
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
  1017
1243
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1018
    aSelection notNil ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1019
        aSelection isNumber ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1020
            aSelection ~~ 0 ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1021
                selection := self listChannel value at:aSelection ifAbsent:nil
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1022
            ]
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1023
        ] ifFalse:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1024
            selection := aSelection withoutSeparators.
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1025
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1026
            selection size == 0 ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1027
                selection := nil
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1028
            ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1029
        ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1030
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1031
1243
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1032
    selection isNil ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1033
        (builder componentAt:#listOfHelpKeysView) selection:nil
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1034
    ] ifFalse:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1035
        (dictionary includesKey:selection asSymbol) ifFalse:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1036
            self findHelpSpecForKey:selection
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1037
        ]
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1038
    ].
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1039
    listSelection == selection ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1040
        ^ self
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1041
    ].
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1042
    listSelection := selection.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1043
1243
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1044
    modifiedHolder notNil ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1045
        modifiedHolder value:true.
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1046
    ].
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1047
1243
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1048
    (view := self editTextView) notNil ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1049
        listSelection notNil ifTrue:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1050
            txt := dictionary at:(listSelection asSymbol) ifAbsent:nil.
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1051
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1052
            (txt isNil or:[maxCharsPerLine isNil]) ifFalse:[
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1053
                txt := UIPainter convertString:(txt asString) maxLineSize:maxCharsPerLine skipLineFeed:false.
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1054
            ]
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1055
        ]. 
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1056
        view contents:txt.
03c4a3e4ddd2 bug fix
ca
parents: 1198
diff changeset
  1057
        view modified:false.
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
  1058
    ]
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1059
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1060
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1061
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1062
!UIHelpTool methodsFor:'startup / release'!
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1063
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1064
closeRequest
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1065
    "asks for permission before closing"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1066
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1067
    (self masterApplication isNil and:[self askForModification]) ifTrue:[
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1068
        super closeRequest
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1069
    ]
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1070
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1071
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1072
initialize
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1073
    "initializes instance variables"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1074
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1075
    super initialize.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1076
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1077
    specSelector := #helpSpec.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1078
    dictionary   := Dictionary new.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1079
    dictionaries := Dictionary new.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1080
    modified   := false.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1081
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
  1082
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
  1083
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1084
loadFromMessage:aString
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1085
    "loads a help spec by evaluating aString"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1086
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1087
    (aString notNil and: [self askForModification]) 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1088
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1089
    [            
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1090
        |msg cls sel|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1091
        msg := aString asCollectionOfWords.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1092
        (msg size == 2 and:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1093
        [(cls := self resolveName:(msg at:1)) notNil and:
1554
d5e4612bf7cf implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1506
diff changeset
  1094
        [cls class includesSelector: (sel := (msg at: 2) asSymbol)]])
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1095
        ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1096
        [               
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1097
            self buildFromClass: (specClass := cls name) andSelector: (specSelector := sel).
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1098
            ^true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1099
        ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1100
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1101
    ^false
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1102
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1103
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
  1104
openInterface:aSymbol
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1105
    "do not open as stand alone"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1106
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1107
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1108
   
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1109
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1110
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1111
openOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1112
    "opens the UIHelpTool on aClass"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1113
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1114
    super openInterface: #windowSpecForStandAlone.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1115
    self masterApplication isNil ifTrue: [(builder componentAt: #RemoveButton) beInvisible].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1116
    builder window label: 'Help Tool'.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1117
    self buildFromClass: aClass
940
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1118
!
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1119
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1120
openOnClass:aClass andSelector: aSelector
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1121
    "opens the UIHelpTool on aClass and aSelector"
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1122
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1123
    super openInterface: #windowSpecForStandAlone.
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1124
    self masterApplication isNil ifTrue: [(builder componentAt: #RemoveButton) beInvisible].
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1125
    builder window label: 'Help Tool'.
fa34addf6b1d added #openOnClass:aClass andSelector: aSelector
tz
parents: 904
diff changeset
  1126
    self buildFromClass: aClass andSelector: aSelector
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1127
! !
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1128
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1129
!UIHelpTool methodsFor:'user actions'!
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1130
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1131
accept
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1132
    "accepts the help text"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1133
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1134
    |view key txt list listChgd|   
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1135
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1136
    (listSelection size == 0 or:[(view := self editTextView) isNil]) ifFalse:[
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1137
        txt    := view contents asString.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1138
        key    := listSelection asSymbol.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1139
        list   := self listChannel value.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1140
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1141
        (listChgd := (dictionary at:key ifAbsent:nil) isNil) ifTrue:[
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1142
            list add:key.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1143
        ].             
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1144
        dictionary at:key put:txt.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1145
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1146
        listChgd ifTrue:[
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1147
            self updateList.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1148
            (builder componentAt: #listOfHelpKeysView) selection: (list indexOf: key).
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1149
        ]. 
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1150
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1151
        modified := true.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1152
        modifiedHolder notNil ifTrue: [modifiedHolder value:true]
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1153
    ]
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1154
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1155
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1156
doAdd
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1157
    "adds a help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1158
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1159
    |helpKey|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1160
    (helpKey := (builder componentAt: #helpKeyInputField asSymbol) contents) size > 0
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1161
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1162
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1163
        self listModel value: helpKey.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1164
        self accept
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1165
    ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1166
    ifFalse:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1167
    [
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1168
        self warn:'No key was entered !!'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1169
    ]
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1170
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1171
    "Modified: / 20.5.1998 / 01:15:06 / cg"
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1172
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1173
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1174
doDelete
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1175
    "deletes the selected help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1176
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1177
    listSelection notNil
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1178
    ifTrue:
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1179
    [
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1180
        dictionary removeKey: listSelection asSymbol ifAbsent: nil.
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1181
        self doRemove.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1182
        self updateList.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1183
        modified := true.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1184
        modifiedHolder notNil ifTrue: [modifiedHolder value:true]
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1185
    ]
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1186
    ifFalse:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1187
    [
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1188
        self warn:'No key selected !!'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1189
    ]
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1190
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1191
    "Modified: / 20.5.1998 / 01:15:00 / cg"
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1192
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1193
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1194
doLoad
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1195
    "opens a Resource Selection Browser in order to get a resource message"
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1196
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1197
    self loadFromMessage: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1198
        (ResourceSelectionBrowser
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1199
            request: 'Load Help Spec From Class'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1200
            onSuperclass: nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1201
            andClass: specClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1202
            andSelector: specSelector ? #help
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1203
            withResourceTypes: (Array with: #help)).
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1204
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1205
    self updateInfoLabel
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1206
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1207
!
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1208
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1209
doNew
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1210
    "resets the help tool"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1211
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1212
    specClass := listSelection := nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1213
    self dictionary: nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1214
    self dictionaries: nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1215
    self listOfHelpSpecClasses removeAll.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1216
    modified := false.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1217
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1218
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1219
doReload
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1220
    "reloads the help dictionaries"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1221
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1222
    |oldSel model|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1223
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1224
    model  := self listModel.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1225
    oldSel := model value.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1226
    model value:nil.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1227
    self helpSpecFrom:specClass.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1228
    model value:oldSel.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1229
    modified := false.
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1230
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1231
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1232
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1233
doRemove
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1234
    "removes the selected help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1235
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1236
    listSelection notNil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1237
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1238
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1239
        self listModel value: nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1240
        self updateList.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1241
        modifiedHolder notNil ifTrue: [modifiedHolder value:true]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1242
    ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1243
    ifFalse:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1244
    [
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1245
        self warn:'No key selected !!'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1246
    ]
835
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1247
13793eec85d5 national strings
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
  1248
    "Modified: / 20.5.1998 / 01:15:11 / cg"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1249
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1250
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1251
doSave
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1252
    "saves the help dictionaries on specClass"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1253
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1254
    self installHelpSpecsOnClass:specClass
1340
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1255
!
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1256
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1257
doUpdate
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1258
    "reread the helpspecs and update my lists"
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1259
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1260
    specClass isNil ifTrue:[
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1261
        ^ self warn:'No spec loaded'.
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1262
    ].
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1263
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1264
    (self askForModification) ifTrue:[
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1265
        self rebuild
4276358d937b added update function; changed layout
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1266
    ]
148
785417b6955d intitial checkin
ca
parents:
diff changeset
  1267
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
  1268
785417b6955d intitial checkin
ca
parents:
diff changeset
  1269
!UIHelpTool class methodsFor:'documentation'!
785417b6955d intitial checkin
ca
parents:
diff changeset
  1270
785417b6955d intitial checkin
ca
parents:
diff changeset
  1271
version
785417b6955d intitial checkin
ca
parents:
diff changeset
  1272
    ^ '$Header$'
785417b6955d intitial checkin
ca
parents:
diff changeset
  1273
! !