UIHelpTool.st
author tz
Wed, 04 Feb 1998 16:37:25 +0100
changeset 582 3343d860b400
parent 479 83ebfc3320aa
child 696 e91402372900
permissions -rw-r--r--
help texts added
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
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    15
ApplicationModel subclass:#UIHelpTool
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
    16
	instanceVariableNames:'isModified specClass dictionary listSelection maxCharsPerLine
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
    17
		modifiedHolder'
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    18
	classVariableNames:''
785417b6955d intitial checkin
ca
parents:
diff changeset
    19
	poolDictionaries:''
785417b6955d intitial checkin
ca
parents:
diff changeset
    20
	category:'Interface-UIPainter'
785417b6955d intitial checkin
ca
parents:
diff changeset
    21
!
785417b6955d intitial checkin
ca
parents:
diff changeset
    22
785417b6955d intitial checkin
ca
parents:
diff changeset
    23
!UIHelpTool class methodsFor:'documentation'!
785417b6955d intitial checkin
ca
parents:
diff changeset
    24
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    25
copyright
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    26
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    27
 COPYRIGHT (c) 1995 by eXept Software AG
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    28
              All Rights Reserved
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
 This software is furnished under a license and may be used
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    31
 only in accordance with the terms of that license and with the
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    33
 be provided or otherwise made available to, or used by, any
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    34
 other person.  No title to or ownership of the software is
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    35
 hereby transferred.
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    36
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    37
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    38
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    39
!
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    40
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    41
documentation
785417b6955d intitial checkin
ca
parents:
diff changeset
    42
"
785417b6955d intitial checkin
ca
parents:
diff changeset
    43
    used by the UIPainter to add help text to any component which will be shown
785417b6955d intitial checkin
ca
parents:
diff changeset
    44
    during runing an application with enabled activeHelp mode.
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    45
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    46
    [author:]
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    47
        Claus Atzkern
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    48
"
785417b6955d intitial checkin
ca
parents:
diff changeset
    49
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
    50
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    51
!UIHelpTool class methodsFor:'instance creation'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    52
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    53
openOnClass:aClass
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    54
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    55
     UIHelpTool openOnClass:UIPainter
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    56
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    57
    |helpTool|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    58
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    59
    helpTool := UIHelpTool new.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    60
    helpTool openInterface:#standAloneSpec.
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    61
    helpTool helpSpecFrom:aClass
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    62
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    63
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    64
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    65
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    66
!UIHelpTool class methodsFor:'constants'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    67
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    68
label
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    69
    ^ 'Help'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    70
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    71
151
ca
parents: 148
diff changeset
    72
!UIHelpTool class methodsFor:'help specs'!
ca
parents: 148
diff changeset
    73
ca
parents: 148
diff changeset
    74
helpSpec
ca
parents: 148
diff changeset
    75
    "return a dictionary filled with helpKey -> helptext associations.
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    76
     These are used by the activeHelp tool."
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    77
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
    78
    "
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    79
    UIHelpTool openOnClass:UIHelpTool    
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    80
    "
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    81
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
    82
  ^ super helpSpec addPairsFrom:#(
151
ca
parents: 148
diff changeset
    83
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
    84
#activeHelpAccessKey
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    85
'This ID is used to access an active help text for the selected component'
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
    86
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
    87
)
151
ca
parents: 148
diff changeset
    88
! !
ca
parents: 148
diff changeset
    89
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    90
!UIHelpTool class methodsFor:'interface specs'!
785417b6955d intitial checkin
ca
parents:
diff changeset
    91
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    92
keyMenu
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    93
    "this window spec was automatically generated by the ST/X MenuEditor"
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    94
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    95
    "do not manually edit this - the builder may not be able to
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    96
     handle the specification if its corrupted."
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    97
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    98
    "
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
    99
     MenuEditor new openOnClass:UIHelpTool andSelector:#keyMenu
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   100
     (Menu new fromLiteralArrayEncoding:(UIHelpTool keyMenu)) startUp
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   101
    "
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   102
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   103
    <resource: #menu>
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   104
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   105
    ^
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   106
     
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   107
       #(#Menu
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   108
          
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   109
           #(
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   110
             #(#MenuItem
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   111
                #'label:' 'save as ...'
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   112
                #'value:' #saveAs
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   113
            )
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   114
             #(#MenuItem
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   115
                #'label:' '-'
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   116
            )
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   117
             #(#MenuItem
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   118
                #'label:' 'remove'
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   119
                #'value:' #removeKey
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   120
            )
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   121
          ) nil
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   122
          nil
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   123
      )
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   124
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   125
    "Created: / 27.10.1997 / 00:55:20 / cg"
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   126
!
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   127
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   128
menuPanelStandAlone
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   129
    "this window spec was automatically generated by the ST/X MenuEditor"
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   130
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   131
    "do not manually edit this - the builder may not be able to
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   132
     handle the specification if its corrupted."
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   133
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   134
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   135
     MenuEditor new openOnClass:UIHelpTool andSelector:#menuPanelStandAlone
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   136
     (Menu new fromLiteralArrayEncoding:(UIHelpTool menuPanelStandAlone)) startUp
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   137
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   138
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   139
    <resource: #menu>
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   140
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   141
    ^
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   142
     
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   143
       #(#Menu
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   144
          
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   145
           #(
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   146
             #(#MenuItem
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   147
                #'label:' 'file'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   148
                #'submenu:' 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   149
                 #(#Menu
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   150
                    
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   151
                     #(
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   152
                       #(#MenuItem
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   153
                          #'label:' 'reload'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   154
                          #'value:' #doReload
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   155
                      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   156
                       #(#MenuItem
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   157
                          #'label:' '-'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   158
                      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   159
                       #(#MenuItem
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   160
                          #'label:' 'quit'
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   161
                          #'value:' #closeRequest
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   162
                      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   163
                    ) nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   164
                    nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   165
                )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   166
            )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   167
             #(#MenuItem
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   168
                #'label:' 'code'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   169
                #'submenu:' 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   170
                 #(#Menu
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   171
                    
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   172
                     #(
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   173
                       #(#MenuItem
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   174
                          #'label:' 'class'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   175
                          #'value:' #doFromClass
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   176
                      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   177
                       #(#MenuItem
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   178
                          #'label:' '-'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   179
                      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   180
                       #(#MenuItem
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   181
                          #'label:' 'install help spec.'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   182
                          #'value:' #doInstallHelpSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   183
                      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   184
                    ) nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   185
                    nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   186
                )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   187
            )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   188
          ) nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   189
          nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   190
      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   191
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   192
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   193
standAloneSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   194
    "this window spec was automatically generated by the ST/X UIPainter"
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   195
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   196
    "do not manually edit this - the painter/builder may not be able to
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   197
     handle the specification if its corrupted."
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   198
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   199
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   200
     UIPainter new openOnClass:UIHelpTool andSelector:#standAloneSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   201
     UIHelpTool new openInterface:#standAloneSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   202
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   203
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   204
    <resource: #canvas>
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   205
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   206
    ^
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   207
     
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   208
       #(#FullSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   209
          #'window:' 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   210
           #(#WindowSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   211
              #'name:' 'HelpTool'
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   212
              #'layout:' #(#LayoutFrame 219 0 193 0 814 0 690 0)
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   213
              #'label:' 'HelpTool'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   214
              #'min:' #(#Point 10 10)
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   215
              #'max:' #(#Point 1160 870)
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   216
              #'bounds:' #(#Rectangle 219 193 815 691)
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   217
              #'usePreferredExtent:' false
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   218
          )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   219
          #'component:' 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   220
           #(#SpecCollection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   221
              #'collection:' 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   222
               #(
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   223
                 #(#MenuPanelSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   224
                    #'name:' 'menuPanelStandAlone'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   225
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 25 0)
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   226
                    #'menu:' #menuPanelStandAlone
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   227
                )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   228
                 #(#VariableHorizontalPanelSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   229
                    #'name:' 'variableHorizontalPanel1'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   230
                    #'layout:' #(#LayoutFrame 0 0.0 25 0.0 0 1.0 0 1.0)
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   231
                    #'component:' 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   232
                     #(#SpecCollection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   233
                        #'collection:' 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   234
                         #(
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   235
                           #(#TextEditorSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   236
                              #'name:' 'textView'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   237
                              #'hasHorizontalScrollBar:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   238
                              #'hasVerticalScrollBar:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   239
                              #'miniScrollerHorizontal:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   240
                              #'miniScrollerVertical:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   241
                          )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   242
                           #(#SequenceViewSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   243
                              #'name:' 'selectionList'
339
121b64d9b39a change window spec
ca
parents: 335
diff changeset
   244
                              #'model:' #listModel
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   245
                              #'menu:' #keyMenu
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   246
                              #'hasHorizontalScrollBar:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   247
                              #'hasVerticalScrollBar:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   248
                              #'miniScrollerHorizontal:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   249
                              #'miniScrollerVertical:' true
339
121b64d9b39a change window spec
ca
parents: 335
diff changeset
   250
                              #'useIndex:' false
121b64d9b39a change window spec
ca
parents: 335
diff changeset
   251
                              #'sequenceList:' #listChannel
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   252
                          )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   253
                        )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   254
                    )
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   255
                    #'handles:' #(#Any 0.647651 1.0)
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   256
                )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   257
              )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   258
          )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   259
      )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   260
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   261
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   262
windowSpec
785417b6955d intitial checkin
ca
parents:
diff changeset
   263
    "this window spec was automatically generated by the ST/X UIPainter"
785417b6955d intitial checkin
ca
parents:
diff changeset
   264
785417b6955d intitial checkin
ca
parents:
diff changeset
   265
    "do not manually edit this - the painter/builder may not be able to
785417b6955d intitial checkin
ca
parents:
diff changeset
   266
     handle the specification if its corrupted."
785417b6955d intitial checkin
ca
parents:
diff changeset
   267
785417b6955d intitial checkin
ca
parents:
diff changeset
   268
    "
151
ca
parents: 148
diff changeset
   269
     UIPainter new openOnClass:UIHelpTool andSelector:#windowSpec
ca
parents: 148
diff changeset
   270
     UIHelpTool new openInterface:#windowSpec
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   271
    "
151
ca
parents: 148
diff changeset
   272
    "UIHelpTool open"
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   273
785417b6955d intitial checkin
ca
parents:
diff changeset
   274
    <resource: #canvas>
785417b6955d intitial checkin
ca
parents:
diff changeset
   275
785417b6955d intitial checkin
ca
parents:
diff changeset
   276
    ^
785417b6955d intitial checkin
ca
parents:
diff changeset
   277
     
785417b6955d intitial checkin
ca
parents:
diff changeset
   278
       #(#FullSpec
785417b6955d intitial checkin
ca
parents:
diff changeset
   279
          #'window:' 
785417b6955d intitial checkin
ca
parents:
diff changeset
   280
           #(#WindowSpec
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   281
              #'name:' 'HelpTool'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   282
              #'layout:' #(#LayoutFrame 199 0 167 0 484 0 437 0)
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   283
              #'label:' 'unnamed canvas'
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   284
              #'min:' #(#Point 10 10)
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   285
              #'max:' #(#Point 1160 870)
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   286
              #'bounds:' #(#Rectangle 199 167 485 438)
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   287
          )
785417b6955d intitial checkin
ca
parents:
diff changeset
   288
          #'component:' 
785417b6955d intitial checkin
ca
parents:
diff changeset
   289
           #(#SpecCollection
785417b6955d intitial checkin
ca
parents:
diff changeset
   290
              #'collection:' 
785417b6955d intitial checkin
ca
parents:
diff changeset
   291
               #(
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   292
                 #(#LabelSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   293
                    #'name:' 'keyLabel'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   294
                    #'layout:' #(#AlignmentOrigin 3 0.0 42 0.0 0 1)
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   295
                    #'label:' 'Key:'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   296
                    #'adjust:' #left
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   297
                    #'resizeForLabel:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   298
                )
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   299
                 #(#ComboBoxSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   300
                    #'name:' 'comboBox'
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   301
                    #'layout:' #(#LayoutFrame 48 0 22 0 -3 1.0 44 0)
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   302
                    #'activeHelpKey:' #activeHelpAccessKey
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   303
                    #'tabable:' true
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   304
                    #'model:' #listModel
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   305
                    #'type:' #symbolOrNil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   306
                    #'comboList:' #listChannel
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   307
                )
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   308
                 #(#TextEditorSpec
785417b6955d intitial checkin
ca
parents:
diff changeset
   309
                    #'name:' 'textView'
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   310
                    #'layout:' #(#LayoutFrame 3 0.0 45 0.0 -3 1.0 -3 1.0)
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   311
                    #'hasHorizontalScrollBar:' true
785417b6955d intitial checkin
ca
parents:
diff changeset
   312
                    #'hasVerticalScrollBar:' true
785417b6955d intitial checkin
ca
parents:
diff changeset
   313
                    #'miniScrollerHorizontal:' true
785417b6955d intitial checkin
ca
parents:
diff changeset
   314
                    #'miniScrollerVertical:' true
785417b6955d intitial checkin
ca
parents:
diff changeset
   315
                )
785417b6955d intitial checkin
ca
parents:
diff changeset
   316
              )
785417b6955d intitial checkin
ca
parents:
diff changeset
   317
          )
785417b6955d intitial checkin
ca
parents:
diff changeset
   318
      )
785417b6955d intitial checkin
ca
parents:
diff changeset
   319
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   320
785417b6955d intitial checkin
ca
parents:
diff changeset
   321
!UIHelpTool methodsFor:'accessing'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   322
151
ca
parents: 148
diff changeset
   323
dictionary
ca
parents: 148
diff changeset
   324
    "return the value of the instance variable 'dictionary' (automatically generated)"
ca
parents: 148
diff changeset
   325
ca
parents: 148
diff changeset
   326
    ^ dictionary!
ca
parents: 148
diff changeset
   327
ca
parents: 148
diff changeset
   328
dictionary:aDictionary
ca
parents: 148
diff changeset
   329
    "set the value of the instance variable 'dictionary' (automatically generated)"
ca
parents: 148
diff changeset
   330
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   331
    (dictionary := aDictionary) isNil ifTrue:[
204
8dcd7f22e4d1 checkin from browser
ca
parents: 196
diff changeset
   332
        dictionary := IdentityDictionary new.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   333
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   334
    self updateList
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   335
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   336
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   337
helpKey
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   338
    listSelection size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   339
        ^ listSelection asSymbol
151
ca
parents: 148
diff changeset
   340
    ].
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   341
    ^ nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   342
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   343
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   344
helpKey:aKey
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   345
    |key|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   346
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   347
    aKey size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   348
        key := aKey asString
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   349
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   350
    self listModel value:key
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   351
151
ca
parents: 148
diff changeset
   352
!
ca
parents: 148
diff changeset
   353
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   354
helpSpecFrom:aClass
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   355
    "read help text from an application associated with the class
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   356
    "
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   357
    |help|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   358
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   359
    specClass  := self applicationClassAssociatedWith:aClass.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   360
    isModified := false.
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   361
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   362
    (specClass respondsTo:#helpSpec) ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   363
        help := specClass helpSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   364
    ] ifFalse:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   365
        specClass := nil
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   366
    ].
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   367
    self dictionary:help
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   368
!
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   369
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   370
modifiedHolder:aValueHolder
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   371
    "set the value holder set to true in case of modifying attributes
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   372
    "
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   373
    modifiedHolder notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   374
        modifiedHolder removeDependent:self. 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   375
    ].
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   376
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   377
    (modifiedHolder := aValueHolder) notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   378
        modifiedHolder addDependent:self.
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   379
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   380
        self editTextView notNil ifTrue: [
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   381
            self editTextView modifiedChannel onChangeSend:#value to:[
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   382
                modifiedHolder notNil ifTrue:[
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   383
                    self editTextView modifiedChannel value ifTrue:[
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   384
                        modifiedHolder value:true
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   385
                    ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   386
                ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   387
            ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   388
        ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   389
    ]
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   390
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   391
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   392
!
785417b6955d intitial checkin
ca
parents:
diff changeset
   393
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   394
updateList
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   395
    "update list from dictionary
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   396
    "
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   397
    self listChannel value:(dictionary keys asSortedCollection)
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   398
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   399
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   400
!UIHelpTool methodsFor:'accessing menu'!
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   401
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   402
keyMenu
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   403
    "this window spec was automatically generated by the UI Builder"
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   404
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   405
    ^ self class keyMenu
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   406
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   407
    "Created: / 27.10.1997 / 00:55:20 / cg"
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   408
! !
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   409
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   410
!UIHelpTool methodsFor:'actions'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   411
785417b6955d intitial checkin
ca
parents:
diff changeset
   412
accept
785417b6955d intitial checkin
ca
parents:
diff changeset
   413
    "accept the text
785417b6955d intitial checkin
ca
parents:
diff changeset
   414
    "
393
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   415
    |view key txt list listChgd|
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   416
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   417
    (listSelection size == 0 or:[(view := self editTextView) isNil]) ifFalse:[
393
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   418
        txt    := view contents asString.
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   419
        key    := listSelection asSymbol.
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   420
        list   := self listChannel value.
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   421
393
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   422
        (listChgd := (dictionary at:key ifAbsent:nil) isNil) ifTrue:[
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   423
            list add:key.
785417b6955d intitial checkin
ca
parents:
diff changeset
   424
        ].
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   425
        dictionary at:key put:txt.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   426
        isModified := true.
393
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   427
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   428
        listChgd ifTrue:[
a824a3a9b834 raise update notification if list size changed
ca
parents: 369
diff changeset
   429
            self updateList
454
8b016ffd83ce set modified if help text accepted
tz
parents: 393
diff changeset
   430
        ].
479
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   431
        modifiedHolder notNil ifTrue: [modifiedHolder value:true]
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   432
    ]
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   433
!
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   434
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   435
installHelpSpecInto:aClass
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   436
    "install help text
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   437
    "
479
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   438
    |cls src superHelpSpecKeys helpSpec|
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   439
335
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   440
    cls := self applicationClassAssociatedWith:aClass.
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   441
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   442
    cls isNil ifTrue:[
465
1b55cc13793b do only save if modified
tz
parents: 459
diff changeset
   443
        ^ self information:'No application class defined!!'.
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   444
    ].
478
7ba29987cc0d do not save modified but empty help dicts
tz
parents: 465
diff changeset
   445
    isModified not ifTrue:[
465
1b55cc13793b do only save if modified
tz
parents: 459
diff changeset
   446
        ^nil
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   447
    ].
456
e2bbb3f9c5fd do only save what has to be save!
tz
parents: 454
diff changeset
   448
e2bbb3f9c5fd do only save what has to be save!
tz
parents: 454
diff changeset
   449
    superHelpSpecKeys := cls superclass helpSpec keys.
479
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   450
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   451
    helpSpec := IdentityDictionary new.
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   452
    dictionary associationsDo:
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   453
    [:asso|
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   454
        (superHelpSpecKeys includes: asso key) ifFalse: [helpSpec at: asso key put: asso value]
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   455
    ].
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   456
    helpSpec isEmpty ifTrue:[
478
7ba29987cc0d do not save modified but empty help dicts
tz
parents: 465
diff changeset
   457
        ^nil
7ba29987cc0d do not save modified but empty help dicts
tz
parents: 465
diff changeset
   458
    ].
456
e2bbb3f9c5fd do only save what has to be save!
tz
parents: 454
diff changeset
   459
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   460
    src  := '' writeStream.
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   461
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   462
    src nextPutAll:
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   463
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   464
'helpSpec
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   465
    "return a dictionary filled with helpKey -> helptext associations.
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   466
     These are used by the activeHelp tool."
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   467
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   468
    "
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   469
    UIHelpTool openOnClass:', cls name asString ,'    
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   470
    "
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   471
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   472
  ^ super helpSpec addPairsFrom:#(
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   473
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   474
'.
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   475
479
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   476
    helpSpec keys asSortedCollection
456
e2bbb3f9c5fd do only save what has to be save!
tz
parents: 454
diff changeset
   477
    do:[:key |
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   478
        |txt t|
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   479
479
83ebfc3320aa stand alone bug fixed
tz
parents: 478
diff changeset
   480
        txt := helpSpec at:key.
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   481
        src nextPutLine:key storeString.
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   482
319
f16aa0e8541e dont crash with nonexisting bitmaps
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   483
        t := txt asString replaceAll:(Character cr) with:(Character space).
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   484
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   485
        (t endsWith:Character space) ifTrue:[
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   486
            t := t copyWithoutLast:1
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   487
        ].
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   488
        src nextPutLine:t storeString; cr.
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   489
    ].
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   490
    src nextPutLine:')'.
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   491
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   492
    Compiler compile:(src contents)
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   493
            forClass:cls class 
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   494
          inCategory:'help specs'.
196
56f63eb42a34 generate help specs
ca
parents: 172
diff changeset
   495
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   496
    isModified := false.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   497
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   498
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   499
785417b6955d intitial checkin
ca
parents:
diff changeset
   500
!UIHelpTool methodsFor:'aspects'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   501
785417b6955d intitial checkin
ca
parents:
diff changeset
   502
listChannel
785417b6955d intitial checkin
ca
parents:
diff changeset
   503
    "automatically generated by UIPainter ..."
785417b6955d intitial checkin
ca
parents:
diff changeset
   504
785417b6955d intitial checkin
ca
parents:
diff changeset
   505
    |holder|
785417b6955d intitial checkin
ca
parents:
diff changeset
   506
785417b6955d intitial checkin
ca
parents:
diff changeset
   507
    (holder := builder bindingAt:#listChannel) isNil ifTrue:[
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   508
        builder aspectAt:#listChannel put:(holder :=  OrderedCollection new asValue).
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   509
    ].
785417b6955d intitial checkin
ca
parents:
diff changeset
   510
    ^ holder
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   511
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   512
    "Modified: / 27.10.1997 / 01:50:33 / cg"
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   513
!
785417b6955d intitial checkin
ca
parents:
diff changeset
   514
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   515
listModel
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   516
    "automatically generated by UIPainter ..."
785417b6955d intitial checkin
ca
parents:
diff changeset
   517
785417b6955d intitial checkin
ca
parents:
diff changeset
   518
    |holder|
785417b6955d intitial checkin
ca
parents:
diff changeset
   519
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   520
    (holder := builder bindingAt:#listModel) isNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   521
        holder := AspectAdaptor new subject:self; forAspect:#listSelection.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   522
        builder aspectAt:#listModel put:holder.
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   523
    ].
785417b6955d intitial checkin
ca
parents:
diff changeset
   524
    ^ holder
785417b6955d intitial checkin
ca
parents:
diff changeset
   525
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   526
785417b6955d intitial checkin
ca
parents:
diff changeset
   527
!UIHelpTool methodsFor:'initialization'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   528
785417b6955d intitial checkin
ca
parents:
diff changeset
   529
initialize
785417b6955d intitial checkin
ca
parents:
diff changeset
   530
    "setup instance attributes
785417b6955d intitial checkin
ca
parents:
diff changeset
   531
    "
785417b6955d intitial checkin
ca
parents:
diff changeset
   532
    super initialize.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   533
    dictionary := IdentityDictionary new.
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   534
    isModified := false.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   535
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   536
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   537
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   538
!UIHelpTool methodsFor:'menu actions'!
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   539
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   540
removeKey
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   541
    |k sym|
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   542
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   543
    k := Dialog request:'name of key to remove:' initialAnswer:listSelection.
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   544
    k size > 0 ifTrue:[
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   545
        ((dictionary includesKey:k)
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   546
        or:[(sym := k asSymbolIfInterned) notNil
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   547
            and:[dictionary includesKey:sym]]) 
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   548
        ifFalse:[
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   549
            ^ self warn:'key is not present.'.
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   550
        ].
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   551
        sym notNil ifTrue:[
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   552
            dictionary removeKey:sym ifAbsent:nil.
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   553
        ].
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   554
        dictionary removeKey:k ifAbsent:nil.
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   555
        isModified := true.
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   556
        self updateList
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   557
     ].
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   558
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   559
    "Created: / 27.10.1997 / 01:48:48 / cg"
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   560
    "Modified: / 27.10.1997 / 02:25:30 / cg"
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   561
!
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   562
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   563
saveAs
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   564
    |key new|
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   565
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   566
    key := Dialog request:'save under key:' initialAnswer:(listSelection ? '').
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   567
    key := key withoutSeparators.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   568
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   569
    key size ~~ 0 ifTrue:[
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   570
        key := key asSymbol.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   571
        new := (dictionary at:key ifAbsent:nil) isNil.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   572
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   573
        dictionary at:key put:(self editTextView contents asString).
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   574
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   575
        new ifTrue:[
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   576
            self updateList
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   577
        ].
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   578
        isModified := true.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   579
        self listModel value:key.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   580
     ].
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   581
! !
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   582
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   583
!UIHelpTool methodsFor:'private'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   584
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   585
editTextView
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   586
    "get the editTextView or nil.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   587
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   588
    |view|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   589
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   590
    (view := builder componentAt:#textView) notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   591
        view := view scrolledView.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   592
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   593
        view acceptAction isNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   594
            view acceptAction:[:aList| self accept ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   595
        ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   596
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   597
        view left ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   598
            (maxCharsPerLine := view extent x // view font width) < 10 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   599
                maxCharsPerLine := nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   600
            ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   601
        ].
454
8b016ffd83ce set modified if help text accepted
tz
parents: 393
diff changeset
   602
    ].       
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   603
    ^ view
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   604
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   605
335
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   606
!UIHelpTool methodsFor:'queries'!
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   607
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   608
applicationClassAssociatedWith:aClass
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   609
    "get application class keeping the associated help text or nil
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   610
    "
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   611
    |cls|
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   612
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   613
    cls := self resolveName:aClass.
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   614
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   615
    (cls notNil and:[cls includesBehavior:UISpecification]) ifTrue:[
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   616
        ^ UISpecificationTool
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   617
    ].
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   618
  ^ cls
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   619
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   620
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   621
!
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   622
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   623
isModified
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   624
    ^ isModified
335
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   625
! !
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   626
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   627
!UIHelpTool methodsFor:'selection'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   628
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   629
listSelection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   630
    "returns current selection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   631
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   632
    ^ listSelection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   633
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   634
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   635
listSelection:aSelection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   636
    "current selection changed
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   637
    "
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   638
    |txt view sel|
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   639
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   640
    aSelection isNumber ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   641
        aSelection ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   642
            sel := self listChannel value at:aSelection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   643
        ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   644
    ] ifFalse:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   645
        aSelection size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   646
            sel := aSelection withoutSeparators.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   647
            sel size == 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   648
                sel := nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   649
            ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   650
        ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   651
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   652
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   653
    listSelection = sel ifFalse:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   654
        listSelection := sel.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   655
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   656
        modifiedHolder notNil ifTrue:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   657
            modifiedHolder value:true.
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   658
        ].
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   659
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   660
        (view := self editTextView) notNil ifTrue:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   661
            listSelection notNil ifTrue:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   662
                txt := dictionary at:(listSelection asSymbol) ifAbsent:nil.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   663
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   664
                (txt isNil or:[maxCharsPerLine isNil]) ifFalse:[
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   665
                    txt := UIPainter convertString:(txt asString) maxLineSize:maxCharsPerLine skipLineFeed:false.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   666
                ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   667
            ].
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   668
            view contents:txt.
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   669
            view modified:false.
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   670
        ]
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   671
    ]
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   672
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   673
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   674
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   675
!UIHelpTool methodsFor:'startup / release'!
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   676
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   677
closeRequest
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   678
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   679
    (isModified and:[self masterApplication isNil]) ifTrue:[
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   680
        (self confirm:'Exit without saving your modifications?') ifFalse:[
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   681
            ^ self
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   682
        ]
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   683
    ].
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   684
    ^ super closeRequest.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   685
! !
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   686
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   687
!UIHelpTool methodsFor:'user interactions'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   688
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   689
doFromClass
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   690
    "setup new specification from a class accessed through to a dialog
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   691
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   692
    |cls accepted|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   693
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   694
    specClass notNil ifTrue:[cls := specClass name asValue]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   695
                    ifFalse:[cls := '' asValue].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   696
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   697
    [true] whileTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   698
        accepted :=
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   699
            (DialogBox new
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   700
                addTextLabel:'Classes name:';
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   701
                addInputFieldOn:cls; 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   702
                addAbortButton; 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   703
                addOkButton; 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   704
                open
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   705
            ) accepted.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   706
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   707
        accepted ifFalse:[^ self].
335
9f048ededd7d resolveName:
ca
parents: 331
diff changeset
   708
        cls := self applicationClassAssociatedWith:cls value.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   709
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   710
        cls notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   711
            ^ self helpSpecFrom:cls
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   712
        ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   713
        self warn:'no such class'.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   714
    ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   715
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   716
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   717
doInstallHelpSpec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   718
    "install help spec
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   719
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   720
    self installHelpSpecInto:specClass
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   721
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   722
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   723
doReload
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   724
    "reload specification
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   725
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   726
    |oldSel model|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   727
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   728
    model  := self listModel.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   729
    oldSel := model value.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   730
    model value:nil.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   731
    self helpSpecFrom:specClass.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   732
    model value:oldSel.
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   733
    isModified := false.
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   734
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   735
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   736
785417b6955d intitial checkin
ca
parents:
diff changeset
   737
!UIHelpTool class methodsFor:'documentation'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   738
785417b6955d intitial checkin
ca
parents:
diff changeset
   739
version
785417b6955d intitial checkin
ca
parents:
diff changeset
   740
    ^ '$Header$'
785417b6955d intitial checkin
ca
parents:
diff changeset
   741
! !