ActiveHelpView.st
author Claus Gittinger <cg@exept.de>
Thu, 12 Sep 2013 15:17:56 +0200
changeset 3246 d167d433053c
parent 3242 f8d10ab0f301
child 3249 38845952e1d4
permissions -rw-r--r--
class: ActiveHelpView changed: #shapeStyle: block shapes on windows
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
"
1485
54e215f2e816 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1261
diff changeset
    12
"{ Package: 'stx:libview2' }"
54e215f2e816 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1261
diff changeset
    13
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    14
View subclass:#ActiveHelpView
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    15
	instanceVariableNames:'myView shapeStyle'
216
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    16
	classVariableNames:''
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    17
	poolDictionaries:''
a5f97668e99a commentary
Claus Gittinger <cg@exept.de>
parents: 138
diff changeset
    18
	category:'Interface-Help'
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    19
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    20
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
    21
!ActiveHelpView class methodsFor:'documentation'!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    22
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    23
copyright
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    24
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    25
 COPYRIGHT (c) 1995 by Claus Gittinger
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    26
	      All Rights Reserved
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    27
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    28
 This software is furnished under a license and may be used
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    33
 hereby transferred.
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    34
"
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    35
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    36
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    37
!
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
documentation
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    40
"
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
    41
    a bubbleHelp view.
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    42
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    43
    Instances of myself show up either as a comics-like talking
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    44
    view, or as a simple square popup. This is configured via the
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    45
    styleSheet; the default is simple-square. 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    46
    To get the fancy comics style, add a resource 'activeHelpStyle' with 
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    47
    a symbol-value of #cartoon.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    48
    However, be aware that some servers have performance problems with
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
    49
    these view-shapes (or do not support shapes at all).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
    50
    Therefore, the default style is a rectangular popupView.
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
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
    63
    "create a bubble-view for some text"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
    64
1676
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    65
    ^ self for:someText onDevice:Screen current.
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    66
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    67
    "
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    68
     |v|
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    69
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    70
     v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:nil.
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    71
     v realize.
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    72
     Delay waitForSeconds:2.
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    73
     v destroy
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    74
    "
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    75
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    76
    "
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    77
     |v|
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    78
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    79
     v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:#cartoon.
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    80
     v realize.
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    81
     Delay waitForSeconds:2.
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    82
     v destroy
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    83
    "
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    84
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    85
    "Modified: 28.6.1997 / 14:24:23 / cg"
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    86
!
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    87
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    88
for:someText onDevice:aDevice
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    89
    "create a bubble-view for some text"
cba066422dd1 added #for:onDevice:
Claus Gittinger <cg@exept.de>
parents: 1583
diff changeset
    90
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    91
    |helpView textView|
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    92
1714
85cd314f0916 Fix ActiveHelp for foreign displays
Stefan Vogel <sv@exept.de>
parents: 1676
diff changeset
    93
    helpView := self onDevice:aDevice.
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    94
1714
85cd314f0916 Fix ActiveHelp for foreign displays
Stefan Vogel <sv@exept.de>
parents: 1676
diff changeset
    95
    textView := Label onDevice:aDevice.
3242
f8d10ab0f301 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3224
diff changeset
    96
    textView font:(helpView font onDevice:aDevice).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    97
    ^ (helpView withView:textView) contents:someText
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    98
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
    99
    "
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   100
     |v|
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   101
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   102
     v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:nil.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   103
     v realize.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   104
     Delay waitForSeconds:2.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   105
     v destroy
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   106
    "
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   107
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   108
    "
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   109
     |v|
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   110
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   111
     v := (ActiveHelpView for:'hello world\this is an ActiveHelpView' withCRs) shapeStyle:#cartoon.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   112
     v realize.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   113
     Delay waitForSeconds:2.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   114
     v destroy
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   115
    "
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   116
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   117
    "Modified: 28.6.1997 / 14:24:23 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   118
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   119
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   120
with:aView
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   121
    "create a talking-view wrapping some other view"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   122
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   123
    ^ self new withView:aView
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   124
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   125
    "
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   126
     (ActiveHelpView with:(TextView new)) realize
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   127
     (ActiveHelpView with:(TextView new)) open
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   128
     (ActiveHelpView with:(Button label:'ok')) open
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   129
    "
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   130
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   131
    "Modified: 27.4.1996 / 15:14:18 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   132
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   133
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   134
!ActiveHelpView methodsFor:'accessing'!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   135
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   136
contents:someText
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   137
    "set the text"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   138
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   139
    (myView isKindOf:Label) ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   140
        myView label:someText asString.
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   141
        myView extent:(myView preferredExtent).
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   142
    ] ifFalse:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   143
        myView contents:someText.
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   144
    ].
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   145
    self resizeToFit
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   146
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   147
    "Modified: 27.4.1996 / 15:14:56 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   148
!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   149
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   150
shapeStyle:aStyleSymbol
3218
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   151
    "set the shapeStyle.
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   152
     Currently, only nil and #cartoon are supported"
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   153
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   154
    shapeStyle := aStyleSymbol.
3246
d167d433053c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3242
diff changeset
   155
    Screen current supportsArbitraryShapedViews ifFalse:[
d167d433053c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3242
diff changeset
   156
        shapeStyle := nil
d167d433053c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3242
diff changeset
   157
    ].
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   158
    self resizeToFit.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   159
    self computeShape.
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
    "Created: 29.5.1996 / 15:39:41 / cg"
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   162
    "Modified: 28.6.1997 / 14:15:22 / cg"
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   163
!
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   164
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   165
withView:aView
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   166
    "set the component view"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   167
3118
f18d1909c51c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 2802
diff changeset
   168
    |fg|
f18d1909c51c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 2802
diff changeset
   169
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   170
    (aView isKindOf:Label) ifTrue:[
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   171
        aView viewBackground:viewBackground.
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   172
        aView backgroundColor:viewBackground.
3118
f18d1909c51c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 2802
diff changeset
   173
        (fg := styleSheet colorAt:#'activeHelp.foregroundColor' default:nil) notNil ifTrue:[
f18d1909c51c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 2802
diff changeset
   174
            aView foregroundColor:fg.    
f18d1909c51c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 2802
diff changeset
   175
        ].
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   176
    ].
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   177
    self addSubView:aView.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   178
    myView := aView.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   179
    myView borderWidth:0
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   180
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   181
    "Modified: 27.4.1996 / 15:16:46 / cg"
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   182
! !
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   183
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   184
!ActiveHelpView methodsFor:'initialization'!
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   185
92
claus
parents: 60
diff changeset
   186
initStyle
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   187
    "setup viewStyle specifics"
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   188
725
3a52a52576cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   189
    <resource: #style (#'activeHelp.backgroundColor'
3a52a52576cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   190
                       #'activeHelp.borderWidth'
1537
364eabac0aec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
   191
                       #'activeHelp.font'
725
3a52a52576cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   192
                       #'activeHelp.style')>
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   193
2776
7181bb9659ae comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
   194
    |bg defaultFont|
236
89a3cda02cbb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 233
diff changeset
   195
92
claus
parents: 60
diff changeset
   196
    super initStyle.
claus
parents: 60
diff changeset
   197
3218
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   198
    (shapeStyle := UserPreferences current toolTipShapeStyle) isNil ifTrue:[
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   199
        shapeStyle := styleSheet at:#'activeHelp.style' default:nil.
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   200
    ].
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   201
2776
7181bb9659ae comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
   202
    defaultFont := styleSheet fontAt:#'activeHelp.font' default:nil.
7181bb9659ae comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
   203
    defaultFont notNil ifTrue:[
7181bb9659ae comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
   204
        self font:defaultFont
1537
364eabac0aec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
   205
    ].
364eabac0aec *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1485
diff changeset
   206
1583
36d82eed6873 Use #isWindowsStyle instead of comparing to style name.
Stefan Vogel <sv@exept.de>
parents: 1537
diff changeset
   207
    bg := styleSheet colorAt:#'activeHelp.backgroundColor' default:nil.
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   208
    bg notNil ifTrue:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   209
        viewBackground := bg
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   210
    ] ifFalse:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   211
        shapeStyle == #cartoon ifTrue:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   212
            viewBackground := White
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   213
        ]
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   214
    ].
2773
eaec2e45bd8d no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 2413
diff changeset
   215
    self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1).
2776
7181bb9659ae comment/format in: #withView:
Claus Gittinger <cg@exept.de>
parents: 2773
diff changeset
   216
    self borderColor:(styleSheet at:#'activeHelp.borderColor' default:Color black).
236
89a3cda02cbb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 233
diff changeset
   217
725
3a52a52576cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 688
diff changeset
   218
    "Modified: / 26.10.1997 / 17:02:09 / cg"
92
claus
parents: 60
diff changeset
   219
!
claus
parents: 60
diff changeset
   220
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   221
realize
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   222
    self create.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   223
    self computeShape.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   224
    self enableMotionEvents.
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   225
    self enableButtonMotionEvents.
1485
54e215f2e816 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1261
diff changeset
   226
    super realize
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   227
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   228
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   229
!ActiveHelpView methodsFor:'private'!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   230
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   231
computeShape
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   232
    "compute the shape, based upon the size of my component view"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   233
3224
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   234
    |extent oldOrigin shapeForm borderForm y1 bw h w mirrorH mirrorV
3218
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   235
     p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition|
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   236
1261
6124060d2062 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
   237
    device supportsArbitraryShapedViews ifTrue:[
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   238
        (shapeStyle == #cartoon) ifTrue:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   239
            extent := self extent.
3224
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   240
            oldOrigin := self origin.
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   241
            h := extent y.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   242
            w := extent x.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   243
            bw := 4.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   244
            offs := 0.
3218
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   245
            mousePosition := device pointerPosition.
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   246
3218
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   247
            ((mousePosition > (device width * (2/3)))
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   248
            or:[ self corner x > device usableWidth ]) ifTrue:[
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   249
                mirrorH := true.
3224
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   250
                self origin:((oldOrigin x - w) @ (self origin y)).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   251
                offs := bw * 2.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   252
            ] ifFalse:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   253
                mirrorH := false
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   254
            ].
3218
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   255
            ((mousePosition > (device height * (2/3)))
cf42b08823d2 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3118
diff changeset
   256
            or:[ self corner y > device usableHeight ]) ifTrue:[
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   257
                mirrorV := true.
3224
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   258
                self origin:(oldOrigin x @ (self origin y - h)).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   259
            ] ifFalse:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   260
                mirrorV := false
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   261
            ].
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   262
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   263
            borderForm := Form width:w height:h.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   264
            shapeForm := Form width:w height:h.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   265
            borderForm fill:(Color noColor).
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   266
            shapeForm fill:(Color noColor).
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   267
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   268
            hEll := (h // 3 * 2).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   269
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   270
            mirrorV ifTrue:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   271
                y1 := 0.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   272
            ] ifFalse:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   273
                y1 := h // 4.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   274
            ].
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   275
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   276
            borderForm fillArcX:0 y:y1 
3224
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   277
                       width:w height:hEll
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   278
                       from:0 angle:360.
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   279
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   280
            myView origin:(width - myView width // 2) @ (y1 + ((hEll - myView height) // 2)).
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   281
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   282
            h2 := h // 2.
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   283
            w2 := w // 2.
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   284
            w8 := w // 8.
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   285
            w78 := w * 7 // 8.
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   286
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   287
            mirrorH ifTrue:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   288
                mirrorV ifTrue:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   289
                    p1 := w @ h. 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   290
                    p2 := (w78 @ h2).
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   291
                    p3 := (w2 @ h2).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   292
                    pB1 := (w-bw) @ (h-bw). 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   293
                    pB2 := ((w78 - bw) @ (h2 - bw)).
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   294
                    pB3 := ((w2 + bw) @ (h2 - bw))
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   295
                ] ifFalse:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   296
                    p1 := w @ 0. 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   297
                    p2 := (w78 @ h2).
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   298
                    p3 := (w2 @ h2).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   299
                    pB1 := (w-bw) @ bw. 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   300
                    pB2 := ((w78 - bw) @ (h2 + bw)).
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   301
                    pB3 := ((w2 + bw) @ (h2 + bw))
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   302
                ]
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   303
            ] ifFalse:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   304
                mirrorV ifTrue:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   305
                    p1 := 0@h. 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   306
                    p2 := (w8 @ h2). 
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   307
                    p3 := (w2 @ h2).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   308
                    pB1 := bw@(h-bw). 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   309
                    pB2 := ((w8 + bw) @ (h2 - bw)). 
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   310
                    pB3 := ((w2 - bw) @ (h2 - bw)).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   311
                ] ifFalse:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   312
                    p1 := 0@0. 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   313
                    p2 := (w8 @ h2). 
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   314
                    p3 := (w2 @ h2).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   315
                    pB1 := bw@bw. 
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   316
                    pB2 := ((w8 + bw) @ (h2 + bw)). 
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   317
                    pB3 := ((w2 - bw) @ (h2 + bw)).
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   318
                ]
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   319
            ].
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   320
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   321
            borderForm fillPolygon:(Array with:p1 with:p2 with:p3).
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   322
            shapeForm fillPolygon:(Array with:pB1 with:pB2 with:pB3).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   323
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   324
            shapeForm lineWidth:bw.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   325
            shapeForm paint:(Color noColor).
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   326
            shapeForm displayPolygon:(Array with:p3 with:p1 with:p2).
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   327
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   328
            shapeForm paint:(Color colorId:1).
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   329
            shapeForm fillArcX:bw y:y1 + bw 
3224
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   330
                      width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2))
ce24ea76ae05 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
   331
                      from:0 angle:360.
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   332
        ].
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   333
        borderForm notNil ifTrue:[
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   334
            self borderShape:borderForm.
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   335
            self viewShape:shapeForm
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   336
        ].
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   337
    ]
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   338
1182
629ae33e4df7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   339
    "Modified: / 5.6.1999 / 21:41:01 / cg"
1261
6124060d2062 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
   340
    "Modified: / 27.10.1999 / 13:45:45 / stefan"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   341
!
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   342
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   343
resizeToFit
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   344
    "resize myself to make the component view fit"
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   345
3223
2f47681f1d62 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
   346
    |h w pref bw|
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   347
285
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   348
    pref := myView preferredExtent.
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   349
    shapeStyle == #cartoon ifTrue:[
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   350
        h := pref y. 
208c1e1ad9a8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   351
        w := pref x. 
3223
2f47681f1d62 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
   352
        self extent:((w / 0.85) @ (h * 4)) rounded.
92
claus
parents: 60
diff changeset
   353
    ] ifFalse:[
3223
2f47681f1d62 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
   354
        bw := self borderWidth.
2f47681f1d62 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
   355
        self extent:(pref + (bw * 2)).
2f47681f1d62 class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
   356
        myView origin:(bw asPoint).
92
claus
parents: 60
diff changeset
   357
    ]
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   358
635
dfbc3a7b87c2 comments
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   359
    "Modified: 28.6.1997 / 14:23:49 / cg"
233
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   360
! !
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   361
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   362
!ActiveHelpView methodsFor:'queries'!
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   363
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   364
isPopUpView
261
6d7941a96ad0 commentary
Claus Gittinger <cg@exept.de>
parents: 241
diff changeset
   365
    "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
   366
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   367
    ^ true
196eb68b707c documentation
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   368
261
6d7941a96ad0 commentary
Claus Gittinger <cg@exept.de>
parents: 241
diff changeset
   369
    "Modified: 12.5.1996 / 21:58:12 / cg"
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   370
! !
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   371
380
c553cc1bbfa7 commentary
Claus Gittinger <cg@exept.de>
parents: 314
diff changeset
   372
!ActiveHelpView class methodsFor:'documentation'!
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   373
138
492fb73ca439 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 114
diff changeset
   374
version
3246
d167d433053c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3242
diff changeset
   375
    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.38 2013-09-12 13:17:56 cg Exp $'
2773
eaec2e45bd8d no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 2413
diff changeset
   376
!
eaec2e45bd8d no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 2413
diff changeset
   377
eaec2e45bd8d no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 2413
diff changeset
   378
version_CVS
3246
d167d433053c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 3242
diff changeset
   379
    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.38 2013-09-12 13:17:56 cg Exp $'
60
c9dc64d2b4d6 Initial revision
claus
parents:
diff changeset
   380
! !
3118
f18d1909c51c class: ActiveHelpView
Claus Gittinger <cg@exept.de>
parents: 2802
diff changeset
   381