03-04-2010 01:56 AM
I was able to get this procedure to work with a HoriztonalFieldManager (the manager would scroll to the bottom when the 'b' key was pressed, and scroll to the top when the 't' key was pressed), but I can't seem to find the correct method to create a similar feature for a RichTextField.
HorizontalFieldManager has "setVerticalScroll(HorizontalFieldManager.topmost)
Does RichTextField have a similar feature?
I'm thinking it's somehow connected to 'movefocus,' but I'm not sure how to go about implementing it.
03-04-2010 03:04 AM
03-04-2010 12:00 PM
The Api documentation states that the setCursorPosition method "Places cursor on specific character within this field, at user request...an offset of zero represents the first character in this field's text value."
Can I obtain set the offset to 'x' where 'x' is the last character in my RichTextField?
Will the RichTextField then automatically scroll so the new position that I set the cursor to is visible?
03-04-2010 12:23 PM
I suppose the code might look like this:
//get the total characters in the RichTextField int _textlength = RichTextField.getTextLength(); //set the cursor position to the last character RichTextField.setCursorPosition(_textlenght);
Do you think the RickTextField will automatically scroll to show where the 'setCursorPosition' is now stationed?
03-04-2010 12:33 PM
I will give that a shot as well. I tried it already, but I also added the manager scroll code to the RichText's code--perhaps it is a causing a conflict and that is why it is not working properly.
I'll let you know how it pans out.
03-04-2010 12:52 PM
True--that's what I'm going to do. I think that's where I went wrong.
I'll post a solution if I find it and send a kudos your way after testing...