Hope I will have some time, and grasp how you did it.
Thanks for the learning stuff
BTW: The Line Number Margin is not working well.
bye
Franco
always
Code: Select all
CallTips:
;not complete, for testing only...
Data$ "Abs (Number.f) - Returns the Absolute value (no sign) of the given float valueee. - Result.f = Abs(Number.f)"
Data$ "ACos (Value.f) - Returns the Arc-Cosinus of the specified value. - Result.f = ACos(Value.f)"
Data$ "ActivateGadget (#Gadget) - Set the focus on the specified Gadget"
Data$ "ActivatePopUpWindow (#PopUpWindowIndex) - Activate (set focus to) the specified Pop-up window."
Data$ "ActivateWindow () - Activate the current window, this means than focus has been put on this window."
Data$ ""
Code: Select all
...
Case #Style_Procedure
If Find_Proc(*Word)
If CompareMemoryString(*Word,@Proc()\s,0)
ReplaceSCIText(start,start+WordLen,@Proc()\s,#False)
EndIf
Endif
Code: Select all
Case #Style_Procedure
If Find_Proc(*Word)
If CompareMemoryString(*Word,@Proc()\s,0)
ReplaceSCIText(start,start+WordLen,@Proc()\s,#False)
EndIf
Else
CallTipText(Start,start+WordLen+1,*Word)
EndIf
Code: Select all
Procedure CallTipText(StartPos,EndPos,buffer)
If buffer>0
Length.l = Len(PeekS(buffer))
CallTipBuffer.l = AllocateMemory(10,Length)
SCI_GotoPos(StartPos)
SCI_GetText(EndPos,CallTipBuffer)
For i = 0 To MaxCallTips ;MaxCallTips is Global
Length.l = Len(PeekS(CallTipBuffer))
If Right(PeekS(CallTipBuffer),EndPos-StartPos-1) = Left(PeekS(@CallTips(i)\s),Length)
CompareMemoryString(CallTipBuffer,@Left(PeekS(@CallTips(i)\s),Length),0)
SCI_CallTipShow(StartPos,@CallTips(i)\s)
EndIf
Next
SCI_GotoPos(EndPos)
FreeMemory(10)
EndIf
EndProcedure
Code: Select all
If (WordUnderCursorPos>Pos Or Pos>WordUnderCursorEnd)
WordUnderCursorPos=Pos:WordUnderCursorEnd=Pos ; also coloring, when the cursor moves out the word
Find_NewTerm(1,line,0,0)
UpdateList(#False)
ColoringLine(#True,-1,line) ; because word under cursor doesn't colored!
EndIfCode: Select all
structure string
s.s
endstructure
newlist tooltip.string()
Proc$="Abs":Tooltip$="Abs (Number.f) - Returns the Absolute value (no sign) of the given float valueee. - Result.f = Abs(Number.f)"
if find_proc(proc$)=0
; word not found, and here is a good insert position (because the list is alphabetic and the find_ set a good position to insert proc$)
addelement(proc())
proc()\s=proc$
;else
; already in the list, but now we insert a tooltip
endif
addelement tooltip()
tooltip()\s=tooltip$
proc()\add=@tooltip()\s ; structure here, because @tooltip$() will not show the right adress, it will give you the adress to the element thing.
Code: Select all
Case #SCN_UPDATEUI
Pos=SCI_GetCurrentPos()
line=SCI_LineFromPosition(Pos)
If line<>Callback_OldLineCode: Select all
Case #SCN_UPDATEUI
Pos=SCI_GetCurrentPos()
line=SCI_LineFromPosition(Pos)
If line<>Callback_OldLine
WordUnderCursorPos=Pos:WordUnderCursorEnd=Pos