author | Claus Gittinger <cg@exept.de> |
Mon, 24 Mar 2014 10:02:41 +0100 | |
changeset 14152 | b13faf727c2c |
parent 13670 | 43d2d7c37e61 |
child 18315 | e66798f7c928 |
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 |
|
14152
b13faf727c2c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13670
diff
changeset
|
15 |
instanceVariableNames:'myView editView' |
12908 | 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 |
" |
|
13479 | 39 |
used with code completion suggestions |
12908 | 40 |
|
41 |
[author:] |
|
42 |
Claus Gittinger |
|
43 |
||
44 |
[See also:] |
|
13479 | 45 |
ActiveHelp Workspace::CodeCompletionService |
12908 | 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 |
||
14152
b13faf727c2c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13670
diff
changeset
|
67 |
editView:aView |
b13faf727c2c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13670
diff
changeset
|
68 |
editView := aView |
b13faf727c2c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13670
diff
changeset
|
69 |
! |
b13faf727c2c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13670
diff
changeset
|
70 |
|
12908 | 71 |
withView:aView |
72 |
"set the component view" |
|
73 |
||
74 |
|fg| |
|
75 |
||
76 |
(aView isKindOf:Label) ifTrue:[ |
|
77 |
aView viewBackground:viewBackground. |
|
78 |
aView backgroundColor:viewBackground. |
|
79 |
(fg := styleSheet colorAt:#'activeHelp.foregroundColor' default:nil) notNil ifTrue:[ |
|
80 |
aView foregroundColor:fg. |
|
81 |
]. |
|
82 |
]. |
|
83 |
self addSubView:aView. |
|
84 |
myView := aView. |
|
85 |
myView borderWidth:0. |
|
86 |
myView origin:(0.0@0.0) corner:(1.0@1.0). |
|
87 |
||
88 |
"Modified: 27.4.1996 / 15:16:46 / cg" |
|
89 |
! ! |
|
90 |
||
91 |
!CodeCompletionHelpView methodsFor:'initialization'! |
|
92 |
||
93 |
initStyle |
|
94 |
"setup viewStyle specifics" |
|
95 |
||
13670
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
96 |
<resource: #style ( |
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
97 |
"/ #'activeHelp.backgroundColor' |
12908 | 98 |
#'activeHelp.borderWidth' |
13670
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
99 |
"/ #'activeHelp.font' |
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
100 |
)> |
12908 | 101 |
|
102 |
|defaultFont| |
|
103 |
||
104 |
super initStyle. |
|
105 |
||
13670
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
106 |
"/ defaultFont := styleSheet fontAt:#'activeHelp.font' default:nil. |
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
107 |
"/ defaultFont notNil ifTrue:[ |
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
108 |
"/ self font:defaultFont |
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
109 |
"/ ]. |
12908 | 110 |
|
111 |
self borderWidth:(styleSheet at:#'activeHelp.borderWidth' default:1). |
|
112 |
||
113 |
"Modified: / 26.10.1997 / 17:02:09 / cg" |
|
114 |
! |
|
115 |
||
116 |
realize |
|
117 |
self create. |
|
118 |
"/ self computeShape. |
|
119 |
self enableMotionEvents. |
|
120 |
self enableButtonMotionEvents. |
|
121 |
super realize |
|
122 |
! ! |
|
123 |
||
124 |
!CodeCompletionHelpView methodsFor:'private'! |
|
125 |
||
126 |
resizeToFit |
|
127 |
"resize myself to make the component view fit" |
|
128 |
||
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
129 |
|pref bw| |
12908 | 130 |
|
131 |
pref := myView preferredExtent. |
|
13670
43d2d7c37e61
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13479
diff
changeset
|
132 |
myView extent:pref. |
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
133 |
bw := self borderWidth. |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
134 |
self extent:(pref + (bw * 2)). |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
135 |
myView origin:(bw asPoint). |
12908 | 136 |
|
137 |
"Modified: 28.6.1997 / 14:23:49 / cg" |
|
138 |
! ! |
|
139 |
||
140 |
!CodeCompletionHelpView methodsFor:'queries'! |
|
141 |
||
142 |
isPopUpView |
|
143 |
"return true - I am a popUp type of view (no decoration, pop-to-top)" |
|
144 |
||
145 |
^ true |
|
146 |
||
147 |
"Modified: 12.5.1996 / 21:58:12 / cg" |
|
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
148 |
! |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
149 |
|
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
150 |
wantsFocusWithButtonPress |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
151 |
"DEFINITELY not, because if we do so, |
13476
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
152 |
the editView looses focus on click, and sends me to hell in its lost focus handling!! |
13448
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
153 |
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
|
154 |
(in which I fire my action)" |
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
155 |
|
8f3c88862f5a
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
12908
diff
changeset
|
156 |
^ false |
13476
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
157 |
! |
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
158 |
|
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
159 |
wantsFocusWithPointerEnter |
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
160 |
"DEFINITELY not, because if we do so, |
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
161 |
the editView looses focus on entry, and sends me to hell in its lost focus handling!! |
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
162 |
So I will be terminated by a motion" |
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
163 |
|
9e09d2a0bf7c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13448
diff
changeset
|
164 |
^ false |
12908 | 165 |
! ! |
166 |
||
167 |
!CodeCompletionHelpView class methodsFor:'documentation'! |
|
168 |
||
169 |
version |
|
14152
b13faf727c2c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13670
diff
changeset
|
170 |
^ '$Header: /cvs/stx/stx/libtool/CodeCompletionHelpView.st,v 1.6 2014-03-24 09:02:41 cg Exp $' |
12908 | 171 |
! |
172 |
||
173 |
version_CVS |
|
14152
b13faf727c2c
class: CodeCompletionHelpView
Claus Gittinger <cg@exept.de>
parents:
13670
diff
changeset
|
174 |
^ '$Header: /cvs/stx/stx/libtool/CodeCompletionHelpView.st,v 1.6 2014-03-24 09:02:41 cg Exp $' |
12908 | 175 |
! ! |
176 |