Rich Edit Object and Scrolling
I'm making a chat client lately. It's all going well. I've missed one thing on the way. When a message comes to you and there is more text than can fit without a scrollbar the text doesn't scroll down. I fixed this with scroll down action whenever a message comes. It all goes well but now there is a bug which I'm having problems with tackling. I have my chatbox, it's got some text in it and i click somewhere so the cursor is somewhere in the middle, not at the end of text. Now when a message arrives or a new line is added the text is added at the place of cursor. I was thinking of moving the cursor down by using the Go to line action and I put number of lines from scrolling as the value. But it doesn't seem to work. So does anyone have any solution. I would like quite a detailed solution. Most appreciated would be solution similar to how it's done in Gwerdy Chat.
Plooscva
Re: Rich Edit Object and Scrolling
Make it the rich edit read only?
Re: Rich Edit Object and Scrolling
Doesn't change anything... You can still set teh focus on.
Re: Rich Edit Object and Scrolling
yep, you need to set the char. position to the amount of characters in the RTF object before you apply the text :)
Re: Rich Edit Object and Scrolling
Also use the Rich Edit action Block->Unselect Block
Re: Rich Edit Object and Scrolling
How do you make it so it will scroll down automaticly?
I need help here. This is the only bug I need to fix before I release it.
Re: Rich Edit Object and Scrolling
The best I can come up with is:
[events]
*On message
+GetLineCount( "Rich Edit Object" )-1 is entirely visible
-(Rich Edit) : Deselect block
-(Rich Edit) : Go to character number GetNChars( "Rich Edit Object" )
-(Rich Edit) : Set string to message
*On message
+[NEGATE] GetLineCount( "Rich Edit Object" )-1 is entirely visible
-(Counter) : Set Counter to GetFirstLine( "Rich Edit Object" )
-(Rich Edit) : Go to character number GetNChars( "Rich Edit Object" )
-(Rich Edit) : Set string to message
-(Rich Edit) : Go to line number value( "Counter" )[/events]
The only improvement I can think of is to buffer the new text until you scroll down, so as to not mess up selections and suchlike.