Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11855 Posts in 1569 Topics- by 3024 Members - Latest Member: floutleMili

07. February 2012, 03:07:26 AM
Xith3D CommunityGeneral CategoryNews (Moderators: Marvin Fröhlich, 'n ddrylliog)Caret Support for the TextField Widget
Pages: [1]
Print
Author Topic: Caret Support for the TextField Widget  (Read 1170 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« on: 05. February 2007, 04:51:51 PM »

I finished the Caret support for the TextField Widget.

Enjoy Smiley.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #1 on: 05. February 2007, 08:11:05 PM »

Added support for the "Delete" key (delete a char at the right of the caret) (precedently only the "Backspace" key was implemented).

Enjoy.

PS : What about 1. caret positioning with the mouse and 2. selection with the mouse/shift+left/right arrows ?? I think it could all be solved easily : (just a naive approach I thought about quickly) just start from the extreme-left position of the textfield widget, then iterate each time by the width of each character until we get past the X position of the cursor. Then the last character we added the width is the one we want. I hope, this isn't too expensive but I can't think of a simpler (and faster) way for now.. Perhaps you know the Text2D implementation better than me, so just throw your ideas  Cheesy

EDIT : by "throw" I mean "write out on the forum" Smiley, not "throw out" or "trash"  Grin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #2 on: 05. February 2007, 08:27:30 PM »

Added support for the "Delete" key (delete a char at the right of the caret) (precedently only the "Backspace" key was implemented).

Thanks.

PS : What about 1. caret positioning with the mouse and 2. selection with the mouse/shift+left/right arrows ?? I think it could all be solved easily : (just a naive approach I thought about quickly) just start from the extreme-left position of the textfield widget, then iterate each time by the width of each character until we get past the X position of the cursor. Then the last character we added the width is the one we want. I hope, this isn't too expensive but I can't think of a simpler (and faster) way for now.. Perhaps you know the Text2D implementation better than me, so just throw your ideas  Cheesy

EDIT : by "throw" I mean "write out on the forum" Smiley, not "throw out" or "trash"  Grin

This is all planned for after 0.9.0. I must set a feature freeze point to be able to finally release a 0.9.0 version.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #3 on: 05. February 2007, 08:41:10 PM »

This is all planned for after 0.9.0. I must set a feature freeze point to be able to finally release a 0.9.0 version.
Yeah, sure  Cheesy But do you think what I suggest would work ?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #4 on: 05. February 2007, 08:57:05 PM »

But do you think what I suggest would work ?

Yes. The first things are of course an easy task and can be very streight forwardly be coded. For the last one: I'm using exactly such a kind of algoritm to calculate the caret position.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic