The code for positioning the auto-complete window is win32 only at the moment - there is no (known) way to get at the caret position on macos or linux.
Logged In: YES
I think I've found means of doing this on macos and fltk:
The fltk position_to_x_y function (which is in the bmx module code, so should work for us with some hacking of that) looks like it will tell us the cursor position for a given character in the text buffer.
On MacOS, it looks like Cocoa will give you the rectangle for a specified character range, so again, we might be able to do this with some ObjectiveC hacking...
This needs a C / macos / linux guru to implement...not me...and then to post it in module tweaks on the official forum in order to get it added.
(See use of GetCaretPos_ in the ide source for the win32 version).
Logged In: YES
Interesting =) i started looking into the linux side, looks straight forward.
Well, ive made a TextAreaCursorXY and made it work in win32 atleast.
The code for linux is mostly done, but untested (coding in linux in a vm isnt fun ;)
But i was wonder what would be best to return, Screen or Client coordinates?
I reckon client co-ordinates are probably best (and probably what you'll be given by most OS's / GUI's). The user can easily work out the screen position by adding the gadget x,y.
hmm.. but arent gadget X,Y client coords?
If so youd have to trace each parent.
Anyway, i posted the Win32 tweak to the blitz forum.
and im working on the linux one now, but it seems the position_to_xy is protected :/
which means FLTK itself has to be modified.
Priority dropped as we will have our own codearea soon which will be able to provide x,y of cursor across all platforms
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.