ActiveHelpView.st
author Claus Gittinger <cg@exept.de>
Thu, 06 Mar 1997 16:18:25 +0100
changeset 497 6544ec670fe0
parent 380 c553cc1bbfa7
child 635 dfbc3a7b87c2
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     1
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     3
	      All Rights Reserved
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     4
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    11
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    12
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    13
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    14
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    15
View subclass:#ActiveHelpView
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    16
	instanceVariableNames:'myView shapeStyle'
216
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    17
	classVariableNames:''
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    18
	poolDictionaries:''
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    19
	category:'Interface-Help'
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    20
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    21
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
    22
!ActiveHelpView class methodsFor:'documentation'!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    23
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    24
copyright
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    25
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    26
 COPYRIGHT (c) 1995 by Claus Gittinger
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    27
	      All Rights Reserved
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    28
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    29
 This software is furnished under a license and may be used
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    34
 hereby transferred.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    35
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    36
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    37
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    38
!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    39
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    40
documentation
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    41
"
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    42
    a talking view.
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    43
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    44
    Instances of myself show up either as a comics-like talking
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    45
    view, or as a simple square popup. This is configured via the
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    46
    styleSheet; the default is simple-square. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    47
    To get the fancy comics style, add a resource 'activeHelpStyle' with 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    48
    a symbol-value of #cartoon.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    49
    However, be aware that some servers have performance problems with
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    50
    these view-shapes (or do not support shapes at all).
216
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    51
221
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    52
    [author:]
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    53
        Claus Gittinger
ea942fe5dc04 documentation
Claus Gittinger <cg@exept.de>
parents: 216
diff changeset
    54
216
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    55
    [See also:]
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    56
        ActiveHelp
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    57
"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    58
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    59
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
    60
!ActiveHelpView class methodsFor:'instance creation'!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    61
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    62
for:someText
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    63
    "create a talking-view for some text"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    64
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    65
    |helpView textView|
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    66
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    67
    helpView := self new.
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    68
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    69
    textView := Label new.
314
a239541adbc9 use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
    70
    textView font:(helpView font on:textView graphicsDevice).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    71
    ^ (helpView withView:textView) contents:someText
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    72
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    73
    "
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    74
     (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) 
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    75
        shapeStyle:nil; realize
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    76
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    77
     (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) 
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    78
        shapeStyle:#cartoon; realize
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    79
    "
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    80
314
a239541adbc9 use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
    81
    "Modified: 5.7.1996 / 17:59:23 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    82
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    83
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    84
with:aView
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    85
    "create a talking-view wrapping some other view"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    86
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    87
    ^ self new withView:aView
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    88
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    89
    "
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    90
     (ActiveHelpView with:(TextView new)) realize
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    91
     (ActiveHelpView with:(TextView new)) open
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    92
     (ActiveHelpView with:(Button label:'ok')) open
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    93
    "
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    94
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    95
    "Modified: 27.4.1996 / 15:14:18 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    96
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    97
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    98
!ActiveHelpView methodsFor:'accessing'!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    99
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   100
contents:someText
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   101
    "set the text"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   102
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   103
    (myView isKindOf:Label) ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   104
        myView label:someText asString.
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   105
        myView extent:(myView preferredExtent).
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   106
    ] ifFalse:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   107
        myView contents:someText.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   108
    ].
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   109
    self resizeToFit
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   110
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   111
    "Modified: 27.4.1996 / 15:14:56 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   112
!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   113
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   114
shapeStyle:aStyleSymbol
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   115
    "set the shapeStyle
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   116
     currently, only nil or #cartoon are supported"
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   117
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   118
    shapeStyle := aStyleSymbol.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   119
    self resizeToFit.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   120
    self computeShape.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   121
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   122
    "Created: 29.5.1996 / 15:39:41 / cg"
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   123
    "Modified: 29.5.1996 / 15:43:54 / cg"
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   124
!
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   125
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   126
withView:aView
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   127
    "set the component view"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   128
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   129
    (aView isKindOf:Label) ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   130
        aView viewBackground:viewBackground.
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   131
        aView backgroundColor:viewBackground.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   132
    ].
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   133
    self addSubView:aView.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   134
    myView := aView.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   135
    myView borderWidth:0
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   136
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   137
    "Modified: 27.4.1996 / 15:16:46 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   138
! !
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   139
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   140
!ActiveHelpView methodsFor:'initialization'!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   141
92
claus
parents: 60
diff changeset
   142
initStyle
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   143
    "setup viewStyle specifics"
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   144
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   145
    <resource: #style (#activeHelpBackgroundColor
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   146
                       #activeHelpBorderWidth
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   147
                       #activeHelpStyle)>
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   148
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   149
    |bg|
236
89a3cda02cbb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 233
diff changeset
   150
92
claus
parents: 60
diff changeset
   151
    super initStyle.
claus
parents: 60
diff changeset
   152
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   153
    shapeStyle := styleSheet at:'activeHelpStyle' default:nil.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   154
    bg := styleSheet colorAt:'activeHelpBackgroundColor' default:nil.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   155
    bg notNil ifTrue:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   156
        viewBackground := bg
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   157
    ] ifFalse:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   158
        shapeStyle == #cartoon ifTrue:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   159
            viewBackground := White
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   160
        ]
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   161
    ].
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   162
92
claus
parents: 60
diff changeset
   163
    borderWidth := styleSheet at:'activeHelpBorderWidth' default:1.
236
89a3cda02cbb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 233
diff changeset
   164
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   165
    "Modified: 22.1.1997 / 11:56:56 / cg"
92
claus
parents: 60
diff changeset
   166
!
claus
parents: 60
diff changeset
   167
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   168
initialize
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   169
    super initialize.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   170
    font := Font family:'helvetica' size:12.
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   171
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   172
    "Modified: 29.5.1996 / 15:37:40 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   173
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   174
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   175
realize
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   176
    self create.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   177
    self computeShape.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   178
    self enableMotionEvents.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
    self enableButtonMotionEvents.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   180
    super realize
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   181
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   182
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   183
!ActiveHelpView methodsFor:'private'!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   184
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   185
computeShape
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   186
    "compute the shape, based upon the size of my component view"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   187
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   188
    |extent shapeForm borderForm y1 bw h w mirrorH mirrorV
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   189
     p1 p2 p3 pB1 pB2 pB3 offs hEll|
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   190
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   191
    shapeStyle ~~ #cartoon ifTrue:[^ self].
92
claus
parents: 60
diff changeset
   192
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   193
    extent := self extent.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   194
    h := extent y.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   195
    w := extent x.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   196
    bw := 4.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   197
    offs := 0.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   198
314
a239541adbc9 use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
   199
    self corner x > device width ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   200
        mirrorH := true.
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   201
        self origin:((self origin x - w) @ (self origin y)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   202
        offs := bw * 2.
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   203
    ] ifFalse:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   204
        mirrorH := false
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   205
    ].
314
a239541adbc9 use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
   206
    self corner y > device height ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   207
        mirrorV := true.
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   208
        self origin:(self origin x @ (self origin y - h)).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   209
    ] ifFalse:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   210
        mirrorV := false
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   211
    ].
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   212
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   213
    borderForm := Form width:w height:h.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   214
    shapeForm := Form width:w height:h.
237
79c3071addae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   215
    borderForm fill:(Color noColor).
79c3071addae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   216
    shapeForm fill:(Color noColor).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   217
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   218
    hEll := (h // 3 * 2).
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   219
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   220
    mirrorV ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   221
        y1 := 0.
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   222
    ] ifFalse:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   223
        y1 := h // 4.
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   224
    ].
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   225
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   226
    borderForm fillArcX:0 
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   227
                      y:y1 
241
30383e124f8c fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   228
                  width:w
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   229
                 height:hEll
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   230
                   from:0
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   231
                  angle:360.
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   232
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   233
    myView origin:(width - myView width // 2) @ (y1 + ((hEll - myView height) // 2)).
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   234
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   235
    mirrorH ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   236
        mirrorV ifTrue:[
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   237
            p1 := w @ h. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   238
            p2 := ((w * 7 // 8) @ (h // 2)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   239
            p3 := ((w // 2) @ (h // 2)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   240
            pB1 := (w-bw) @ (h-bw). 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   241
            pB2 := ((w * 7 // 8 - bw) @ (h // 2 - bw)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   242
            pB3 := ((w // 2 + bw) @ (h // 2 - bw))
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   243
        ] ifFalse:[
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   244
            p1 := w @ 0. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   245
            p2 := ((w * 7 // 8) @ (h // 2)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   246
            p3 := ((w // 2) @ (h // 2)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   247
            pB1 := (w-bw) @ bw. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   248
            pB2 := ((w * 7 // 8 - bw) @ (h // 2 + bw)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   249
            pB3 := ((w // 2 + bw) @ (h // 2 + bw))
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   250
        ]
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   251
    ] ifFalse:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   252
        mirrorV ifTrue:[
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   253
            p1 := 0@h. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   254
            p2 := ((w // 8) @ (h // 2)). 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   255
            p3 := ((w // 2) @ (h // 2)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   256
            pB1 := bw@(h-bw). 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   257
            pB2 := ((w // 8 + bw) @ (h // 2 - bw)). 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   258
            pB3 := ((w // 2 - bw) @ (h // 2 - bw)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   259
        ] ifFalse:[
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   260
            p1 := 0@0. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   261
            p2 := ((w // 8) @ (h // 2)). 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   262
            p3 := ((w // 2) @ (h // 2)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   263
            pB1 := bw@bw. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   264
            pB2 := ((w // 8 + bw) @ (h // 2 + bw)). 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   265
            pB3 := ((w // 2 - bw) @ (h // 2 + bw)).
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   266
        ]
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   267
    ].
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   268
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   269
    borderForm fillPolygon:(Array with:p1 with:p2 with:p3).
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   270
    shapeForm fillPolygon:(Array with:pB1 with:pB2 with:pB3).
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   271
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   272
    shapeForm lineWidth:bw.
237
79c3071addae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
   273
    shapeForm paint:(Color noColor).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   274
    shapeForm displayPolygon:(Array with:p3 with:p1 with:p2).
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   275
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   276
    shapeForm paint:(Color colorId:1).
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   277
    shapeForm fillArcX:bw 
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   278
                     y:y1 + bw 
241
30383e124f8c fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   279
                 width:(w - (bw * 2))
30383e124f8c fill/drawArc..w:h:.. renamed to ...width:height:...
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   280
                height:(h // 3 * 2 - (bw * 2))
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   281
                  from:0
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   282
                 angle:360.
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   283
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   284
    self borderShape:borderForm.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   285
    self viewShape:shapeForm
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   286
314
a239541adbc9 use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 285
diff changeset
   287
    "Modified: 5.7.1996 / 17:59:05 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   288
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   289
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   290
resizeToFit
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   291
    "resize myself to make the component view fit"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   292
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   293
    |h w pref|
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   294
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   295
    pref := myView preferredExtent.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   296
    shapeStyle == #cartoon ifTrue:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   297
        h := pref y. 
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   298
        w := pref x. 
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   299
        self extent:((w / 0.85) rounded asInteger)
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   300
                     @ 
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   301
                    ((h * 4) rounded asInteger)
92
claus
parents: 60
diff changeset
   302
    ] ifFalse:[
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   303
        self extent:pref
92
claus
parents: 60
diff changeset
   304
    ]
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   305
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   306
    "Modified: 29.5.1996 / 15:54:23 / cg"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   307
! !
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   308
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   309
!ActiveHelpView methodsFor:'queries'!
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   310
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   311
isPopUpView
261
6d7941a96ad0 commentary
Claus Gittinger <cg@exept.de>
parents: 241
diff changeset
   312
    "return true - I am a popUp type of view (no decoration, pop-to-top)"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   313
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   314
    ^ true
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   315
261
6d7941a96ad0 commentary
Claus Gittinger <cg@exept.de>
parents: 241
diff changeset
   316
    "Modified: 12.5.1996 / 21:58:12 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   317
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   318
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   319
!ActiveHelpView class methodsFor:'documentation'!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   320
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   321
version
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   322
    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.16 1997-01-22 17:17:33 cg Exp $'
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   323
! !