author | Jan Vrany <jan.vrany@labware.com> |
Sat, 30 Sep 2023 22:55:25 +0100 | |
branch | jv |
changeset 19648 | 5df52d354504 |
parent 16375 | 7d37905ad40b |
permissions | -rw-r--r-- |
13478 | 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 |
" |
|
13477 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
16051 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
13477 | 16 |
MenuView subclass:#CodeCompletionHelpMenuView |
16051 | 17 |
instanceVariableNames:'infoPerEntry' |
13477 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Help' |
|
21 |
! |
|
22 |
||
16078 | 23 |
PopUpView subclass:#SimulatedMenuForHTMLView |
24 |
instanceVariableNames:'codeCompletionMenu' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:CodeCompletionHelpMenuView |
|
28 |
! |
|
29 |
||
13478 | 30 |
!CodeCompletionHelpMenuView class methodsFor:'documentation'! |
31 |
||
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 2013 by Claus Gittinger |
|
35 |
All Rights Reserved |
|
36 |
||
37 |
This software is furnished under a license and may be used |
|
38 |
only in accordance with the terms of that license and with the |
|
39 |
inclusion of the above copyright notice. This software may not |
|
40 |
be provided or otherwise made available to, or used by, any |
|
41 |
other person. No title to or ownership of the software is |
|
42 |
hereby transferred. |
|
43 |
" |
|
44 |
! |
|
45 |
||
46 |
documentation |
|
47 |
" |
|
48 |
used with code completion suggestions |
|
49 |
||
50 |
[author:] |
|
51 |
Claus Gittinger |
|
52 |
||
53 |
[See also:] |
|
54 |
Workspace::CodeCompletionService |
|
55 |
" |
|
56 |
! ! |
|
13477 | 57 |
|
16051 | 58 |
!CodeCompletionHelpMenuView methodsFor:'accessing'! |
59 |
||
60 |
infoPerEntry:something |
|
61 |
infoPerEntry := something. |
|
62 |
! ! |
|
63 |
||
13537
968b3d74a2b8
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13478
diff
changeset
|
64 |
!CodeCompletionHelpMenuView methodsFor:'initialization'! |
968b3d74a2b8
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13478
diff
changeset
|
65 |
|
968b3d74a2b8
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13478
diff
changeset
|
66 |
initStyle |
13669
bb9278273984
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13537
diff
changeset
|
67 |
|defaultFont| |
bb9278273984
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13537
diff
changeset
|
68 |
|
13537
968b3d74a2b8
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13478
diff
changeset
|
69 |
super initStyle. |
13669
bb9278273984
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13537
diff
changeset
|
70 |
defaultFont := StyleSheet fontAt:#'activeHelp.font' default:nil. |
bb9278273984
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13537
diff
changeset
|
71 |
defaultFont notNil ifTrue:[ |
bb9278273984
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13537
diff
changeset
|
72 |
self font:defaultFont |
bb9278273984
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13537
diff
changeset
|
73 |
]. |
16051 | 74 |
self viewBackground:Color orange lightened lightened lightened. |
13537
968b3d74a2b8
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13478
diff
changeset
|
75 |
! ! |
968b3d74a2b8
class: CodeCompletionHelpMenuView
Claus Gittinger <cg@exept.de>
parents:
13478
diff
changeset
|
76 |
|
13477 | 77 |
!CodeCompletionHelpMenuView methodsFor:'queries'! |
78 |
||
16375 | 79 |
isGraphicItem:line |
80 |
^ false |
|
81 |
! |
|
82 |
||
13477 | 83 |
wantsFocusWithPointerEnter |
84 |
"DEFINITELY not, because if we do so, |
|
85 |
the editView looses focus on entry, and sends me to hell in its lost focus handling!! |
|
86 |
So I will be terminated by a motion" |
|
87 |
||
88 |
^ false |
|
89 |
! ! |
|
90 |
||
16051 | 91 |
!CodeCompletionHelpMenuView methodsFor:'selections'! |
92 |
||
93 |
setSelection:newSelection |
|
94 |
super setSelection:newSelection. |
|
95 |
self showInfoForSelection:newSelection. |
|
96 |
! |
|
97 |
||
98 |
showInfoForSelection:newSelection |
|
16078 | 99 |
|selector info| |
16051 | 100 |
|
16078 | 101 |
"/ work in progress... |
102 |
||
103 |
false ifTrue:[ |
|
16051 | 104 |
newSelection notNil ifTrue:[ |
105 |
selector := self listAt:newSelection. |
|
16078 | 106 |
infoPerEntry notNil ifTrue:[ |
107 |
info := infoPerEntry at:newSelection. |
|
108 |
] ifFalse:[ |
|
109 |
info := 'bla bla bla'. |
|
110 |
]. |
|
111 |
info notNil ifTrue:[ |
|
112 |
(self subMenuAt:newSelection) isNil ifTrue:[ |
|
113 |
"/ TODO: install another menu, showing the tooltop |
|
114 |
||
115 |
|infoView htmlView| |
|
116 |
||
117 |
infoView := SimulatedMenuForHTMLView new. |
|
118 |
htmlView := HTMLView origin:0.0@0.0 corner:1.0@1.0 in:infoView. |
|
119 |
htmlView contents:info. |
|
120 |
||
121 |
self subMenuAt:newSelection put:infoView. |
|
122 |
"/ Transcript showCR:selector. |
|
123 |
self invalidateLine:newSelection. |
|
124 |
]. |
|
125 |
]. |
|
16051 | 126 |
]. |
16078 | 127 |
]. |
128 |
! ! |
|
129 |
||
130 |
!CodeCompletionHelpMenuView::SimulatedMenuForHTMLView methodsFor:'menu protocol'! |
|
131 |
||
132 |
action:anActionBlock |
|
133 |
"ignored for now" |
|
134 |
! |
|
135 |
||
136 |
haveControl:aBoolean |
|
137 |
"ignored here" |
|
138 |
! |
|
139 |
||
140 |
menuView |
|
141 |
^ self |
|
142 |
! |
|
143 |
||
144 |
noShadow |
|
145 |
! |
|
146 |
||
147 |
superMenu:aMenu |
|
148 |
"ignored for now" |
|
16051 | 149 |
! ! |
150 |
||
13477 | 151 |
!CodeCompletionHelpMenuView class methodsFor:'documentation'! |
152 |
||
153 |
version |
|
16051 | 154 |
^ '$Header$' |
13477 | 155 |
! |
156 |
||
157 |
version_CVS |
|
16051 | 158 |
^ '$Header$' |
13477 | 159 |
! ! |
160 |