Code: Select all
ScintillaSendMessage(#Sc, #SCI_GETLINE))
ScintillaSendMessage(#Sc, #SCI_GETCURLINE))Code: Select all
ScintillaSendMessage(#Sc, #SCI_GETLINE))
ScintillaSendMessage(#Sc, #SCI_GETCURLINE))Code: Select all
line_number=ScintillaSendMessage(#Sc, #SCI_LINEFROMPOSITION,ScintillaSendMessage(#Sc, #SCI_GETCURRENTPOS ))Code: Select all
EnableExplicit
Procedure ScintillaCallBack(Gadget, *scinotify.SCNotification)
If *scinotify\updated
PostEvent(#PB_Event_Gadget, 0, Gadget, #PB_EventType_Change)
EndIf
EndProcedure
Define.i Event, CurrentPos, Row, Col, Length
If OpenWindow(0, 0, 0, 330, 200, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ScintillaGadget(0, 10, 10, 310, 160, @ScintillaCallBack())
ScintillaSendMessage(0, #SCI_STYLESETFORE, 0, RGB(255, 0, 0))
CreateStatusBar(0, WindowID(0))
AddStatusBarField(100)
SetActiveGadget(0)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget
If EventGadget() = 0
If EventType() = #PB_EventType_Change
CurrentPos = ScintillaSendMessage(0, #SCI_GETCURRENTPOS)
Row = ScintillaSendMessage(0, #SCI_LINEFROMPOSITION, CurrentPos)
Col = CurrentPos - ScintillaSendMessage(0, #SCI_POSITIONFROMLINE, Row)
Length = ScintillaSendMessage(0, #SCI_GETLENGTH)
StatusBarText(0, 0, Str(Row + 1) + " : " + Str(Col + 1) + " (" + Str(CurrentPos) + ") / [" + Str(Length) + "]", #PB_StatusBar_Center)
EndIf
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
EndIf