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