[Gambas-user] REQ: Completion (Suggest Solution)
ron
ronstk at ...239...
Sat Mar 20 18:21:48 CET 2004
On Thursday 18 March 2004 20:13, ron wrote:
> Hi,
>
> Completion works on Public items but should it not
> also work on Private items inside the same class?
>
> Ron
>
Hi Benoit,
Durring the change for the FEditor bug I try to fix the Private/Public to.
My solution is in FCompletion.class is as follows
line 139:
DIM sName AS String
lvwComp.Clear
cSymbol = CComponent.GetClassSymbols(sClass)
change to by adding
DIM sName AS String
DIM bAlien AS Boolean
'PRINT "FillWithSymbol()";project.ActiveForm.Title,sClass
bAlien=Left(project.ActiveForm.Title,Len(sClass))<>sClass
' PRINT "Alien=";If(bAlien,"true","false")
lvwComp.Clear
--------
line now 150
IF hSymbol.Kind = ":" THEN CONTINUE
IF hSymbol.NotPublic THEN CONTINUE
IF bStatic THEN
changed to
IF hSymbol.Kind = ":" THEN CONTINUE
IF bAlien AND hSymbol.NotPublic THEN CONTINUE
IF bStatic THEN
------
optional change line 162
FOR EACH sSymbol IN aSymbol
hSymbol = cSymbol[sSymbol]
TRY lvwComp.Add(sSymbol, sSymbol, Picture[hSymbol.GetIcon()])
NEXT
change to
FOR EACH sSymbol IN aSymbol
hSymbol = cSymbol[sSymbol]
TRY lvwComp.Add(sSymbol, sSymbol & If( hSymbol.NotPublic," (priv)",""),
Picture[hSymbol.GetIcon()])
NEXT
--------
must if optional is done line 319 now
$hEditor.Selection($hEditor.ToPos($hEditor.Line, $iCol),
$hEditor.Column - $iCol)
$hEditor.Insert(lvwComp.Current..Text)
$hEditor.Frozen = FALSE
change to
$hEditor.Selection($hEditor.ToPos($hEditor.Line, $iCol),
$hEditor.Column - $iCol)
$hEditor.Insert(lvwComp.Current.Key)'
$hEditor.Frozen = FALSE
--------
Explanation for the optional is in this way in the completion box can
a hint added to the entry and is not pasted when it is chosen
Here I did it to sign it is a private declaration.
When you edit in a class with PRIVATE and PUBLIC SUB's
both are now in Completion box
When you edit in another class only the PUBLIC is visible.
Greeting Ron
More information about the User
mailing list