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.
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...
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=102488
Originator: 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.
http://www.koders.com/cpp/fid7B10F36EE0B19A371A61464601DEF25D56B6C6BE.aspx#L543
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...
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSTextInput_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/NSTextInput/firstRectForCharacterRange:
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
user_id=1397929
Originator: NO
Interesting =) i started looking into the linux side, looks straight forward.
Logged In: YES
user_id=1397929
Originator: NO
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?
Logged In: YES
user_id=102488
Originator: YES
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.
Logged In: YES
user_id=1397929
Originator: NO
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.
Logged In: YES
user_id=102488
Originator: YES
Priority dropped as we will have our own codearea soon which will be able to provide x,y of cursor across all platforms