U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » LineEdit, EditFields, DocEdit » DocEdit call RemoveLines make Assertion failed.
Re: DocEdit call RemoveLines make Assertion failed. [message #14684 is a reply to message #14682] Sat, 08 March 2008 16:58 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
I see. I guess I was not clear enough Smile

You are NOT supposed to call RemoveLines. RemoveLines is called by DocEdit to tell you that lines were removed (AFTER they were removed by calling "Remove" directly or by user).

What do you want to achieve?

If to keep the "log buffer" to MAX_CACHE_LINES, then use this:

bool MyDocEdit::Key(dword key, int count)
{
	switch(key & ~(K_CTRL | K_ALT | K_SHIFT)) {
		case K_ENTER:
			RunCommand(inputString);
			inputString.Clear();
			if(GetLineCount() > MAX_CACHE_LINE)
				Remove(0, GetPos(GetLineCount() - MAX_CACHE_LINE));
			ShowTip();
			return true;
		default:
			if(!(key & 0x10000) &&  !(key & 0x110000)) { 
				inputString +=(char)key;
			}
			break;
	}
	
	return DocEdit::Key(key, count);
}


Mirek
 
Read Message icon9.gif
Read Message icon7.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Previous Topic: Best way to implement a two-way LineEdit
Next Topic: Enter time as duration
Goto Forum:
  


Current Time: Sun Oct 11 15:28:10 GMT+2 2026

Total time taken to generate the page: 0.00750 seconds