author | Claus Gittinger <cg@exept.de> |
Sun, 01 Sep 2013 10:53:13 +0200 | |
changeset 13452 | ceef36923698 |
parent 13448 | 8f3c88862f5a |
child 13476 | 9e09d2a0bf7c |
permissions | -rw-r--r-- |
12908 | 1 |
" |
2 |
COPYRIGHT (c) 2013 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
View subclass:#CodeCompletionHelpView |
|
15 |
instanceVariableNames:'myView' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-Help' |
|
19 |
! |
|
20 |
||
21 |
!CodeCompletionHelpView class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2013 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
used with codecompletion suggestions |
|
40 |
||
41 |
[author:] |
|
42 |
Claus Gittinger |
|
43 |
||
44 |
[See also:] |
|
45 |
ActiveHelp |
|
46 |
" |
|
47 |
! ! |
|
48 |
||
49 |
!CodeCompletionHelpView class methodsFor:'instance creation'! |
|
50 |
||
51 |
with:aView |
|
52 |
"create a talking-view wrapping some other view" |
|
53 |
||
54 |
^ self new withView:aView |
|
55 |
||
56 |
" |
|
57 |
(ActiveHelpView with:(TextView new)) realize |
|
58 |
(ActiveHelpView with:(TextView new)) open |
|
59 |
(ActiveHelpView with:(Button label:'ok')) open |
|
60 |
" |
|
61 |
||
62 |
"Modified: 27.4.1996 / 15:14:18 / cg" |
|
63 |
! ! |
|
64 |
||
65 |
!CodeCompletionHelpView methodsFor:'accessing'! |
|
66 |
||
67 |
withView:aView |
|
68 |
"set the component view" |
|
69 |
||
70 |
|fg| |
|
71 |
||
72 |
(aView isKindOf:Label) ifTrue:[ |
|
73 |
aView viewBackground:viewBackground. |
|
74 |
aView backgroundColor:viewBackground. |
|
75 |
(fg := styleSheet colorAt:#'activeHelp.foregroundColor' default:nil) notNil ifTrue:[ |
|
76 |
aView foregroundColor:fg. |
|
77 |
]. |
|
78 |
]. |
|
79 |
self addSubView:aView. |
|
80 |
myView := aView. |
|
81 |
myView borderWidth:0. |
|
82 |
myView origin:(0.0@0.0) corner:(1.0@1.0). |
|
83 |
||
84 |
"Modified: 27.4.1996 / 15:16:46 / cg" |
|
85 |
! ! |
|
86 |
||
87 |
!CodeCompletionHelpView methodsFor:'initialization'! |
|
88 |
||
89 |
initStyle |
|
90 |
"setup viewStyle specifics" |
|
91 |
||
92 |
<resource: #style (#'activeHelp.backgroundColor' |
|
93 |
#'activeHelp.borderWidth' |
|
94 |
#'activeHelp.font' |
|
95 |
#'activeHelp.style')> |
|
96 |
||
97 |
|defaultFont| |
|
98 |
||
99 |
super initStyle. |
|
100 |
||
101 |
defaultFont := styleSheet fontAt:#'activeHelp.font' default:nil. |
|
102 |
defaultFont notNil ifTrue:[ |
|
103 |
self font:defaultFont |
|
104 |
]. |
|
105 |
||
106 |
self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1). |
|
107 |
||
108 |
"Modified: / 26.10.1997 / 17:02:09 / cg" |
|
109 |
! |
|
110 |
||
111 |
realize |
|
112 |
self create. |
|
113 |
"/ self computeShape. |
|
114 |
self enableMotionEvents. |
|
115 |
self enableButtonMotionEvents. |
|
116 |
super realize |
|
117 |
! ! |
|
118 |
||
119 |
!CodeCompletionHelpView methodsFor:'private'! |
|
120 |
||
121 |
resizeToFit |
|
122 |
"resize myself to make the component view fit" |
|
123 |
||
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
124 |
|pref bw| |
12908 | 125 |
|
126 |
pref := myView preferredExtent. |
|
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
127 |
bw := self borderWidth. |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
128 |
self extent:(pref + (bw * 2)). |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
129 |
myView origin:(bw asPoint). |
12908 | 130 |
|
131 |
"Modified: 28.6.1997 / 14:23:49 / cg" |
|
132 |
! ! |
|
133 |
||
134 |
!CodeCompletionHelpView methodsFor:'queries'! |
|
135 |
||
136 |
isPopUpView |
|
137 |
"return true - I am a popUp type of view (no decoration, pop-to-top)" |
|
138 |
||
139 |
^ true |
|
140 |
||
141 |
"Modified: 12.5.1996 / 21:58:12 / cg" |
|
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
142 |
! |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
143 |
|
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
144 |
wantsFocusWithButtonPress |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
145 |
"DEFINITELY not, because if we do so, |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
146 |
the editView looses focus on click, and sends me to hell |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
147 |
in its lost focus handling!! |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
148 |
So I will be terminated by a buttonPress, before I get a chance to handle the buttonRelease |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
149 |
(in which I fire my action)" |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
150 |
|
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
151 |
^ false |
12908 | 152 |
! ! |
153 |
||
154 |
!CodeCompletionHelpView class methodsFor:'documentation'! |
|
155 |
||
156 |
version |
|
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
157 |
^ '$Header: /cvs/stx/stx/libtool/CodeCompletionHelpView.st,v 1.2 2013-08-31 23:44:18 cg Exp $' |
12908 | 158 |
! |
159 |
||
160 |
version_CVS |
|
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
161 |
^ '$Header: /cvs/stx/stx/libtool/CodeCompletionHelpView.st,v 1.2 2013-08-31 23:44:18 cg Exp $' |
12908 | 162 |
! ! |
163 |