Import MaxGui.Drivers Strict Local window:TGadget Local textarea:TGadget Local index:TGadget window=CreateWindow("My Window",130,20,400,300,,15|WINDOW_ACCEPTFILES) textarea=CreateTextArea(50,0,ClientWidth(window)-70,200,window) index = CreateTextArea(10,0,30,200,window,TEXTAREA_READONLY) DisableGadget index Local hWnd = QueryGadget(index, QUERY_HWND) SendMessageA(hWnd, EM_SHOWSCROLLBAR, SB_VERT, False) While WaitEvent() Select EventID() Case EVENT_GADGETSELECT Select EventSource() Case textarea SetTextAreaText(index,"") For Local loop:Int = 0 To TextAreaLine(textarea,TextAreaLen(textArea)) AddTextAreaText index, ""+loop If loop = TextAreaLine(textarea,TextAreaLen(textArea)) Then Exit AddTextAreaText index,"~n" Next Local selectedLine:Int = TextAreaCursor(textarea,TEXTAREA_LINES) SelectTextAreaText(index,selectedLine,1,TEXTAREA_LINES) End Select Case EVENT_WINDOWCLOSE End Case EVENT_APPTERMINATE End End Select Wend
Hard one to explain whats wrong, but will show you the steps so you can see my problem, basically, run the program above...
Then, on each line, type a number (incremently) on each line of the big text area like so...
0
1
2
3
4
..
0 to 15 should be sufficent.
You'll probably see that on the left that the number is copied, this is a line counter. When you reach 15, navigate back up the large text area using the cursor keys and you'll see that the cursor is followed on the left.
When you get back up to 0, navigate back down and you should see something very odd happening...
This should pretty much be enough to realise what I'm after... I need the highlighted line number on the left to match the same line position of the cursor in the large text area.
Anyone lend a hand getting this to work, as I havent really got a clue why its jumping like it is! :|
Much appreciated
Dabz