Home » U++ Library support » LineEdit, EditFields, DocEdit » DocEdit call RemoveLines make Assertion failed.
DocEdit call RemoveLines make Assertion failed. [message #14358] |
Sat, 23 February 2008 17:17 |
HenryXin
Messages: 10 Registered: February 2008
|
Promising Member |
|
|
Hi,
I am a newbie about upp. I inherit from DocEdit to display this filesystem content, insert filenames, when beyond 200 line, remove lines as following:
#define MAX_CACHE_LINE 200
class MyDocEdit : public DocEdit
{
String inputString;
static String tipString;
String dir;
public:
virtual bool Key(dword key, int count);
MyDocEdit()
{
ShowTip();
}
void ShowTip();
int RunCommand(String user_input);
};
String MyDocEdit::tipString(">");
void MyDocEdit::ShowTip()
{
dir = GetCurrentDirectory();
Insert(cursor, dir+tipString);
this->SetCursor(cursor+(dir+tipString).GetLength());
inputString.Clear();
}
bool MyDocEdit::Key(dword key, int count)
{
switch(key & ~(K_CTRL | K_ALT | K_SHIFT)) {
case K_ENTER:
RunCommand(inputString);
inputString.Clear();
if(this->GetLineCount() > MAX_CACHE_LINE) {
this->RemoveLines(0, this->GetLineCount() - MAX_CACHE_LINE);
ClearLines();
sprintf(str, "%d %d", this->GetLineCount(), (this->GetLineCount() - MAX_CACHE_LINE));
}
ShowTip();
return true;
default:
if(!(key & 0x10000) && !(key & 0x110000)) {
inputString +=(char)key;
}
break;
}
return DocEdit::Key(key, count);
}
int MyDocEdit::RunCommand(String user_input)
{
FindFile ff;
Insert(GetCursor(), "\n");
cursor++;
if(!ff.Search(AppendFileName(dir, "*")))
return false;
do {
Insert(GetCursor(), ff.GetName()+"\n");
SetCursor(GetCursor()+ff.GetName().GetLength()+1);
}
while(ff.Next());
return 0;
}
When lines are beyond 200, Assert failed in C:\upp\uppsrc\CtrlLib\DocEdit.cpp, line 25
this->line.GetCount() == para.GetCount().
I don't find the reason now.
Thanks.
[Updated on: Sat, 23 February 2008 17:20] Report message to a moderator
|
|
|
|
|
DocEdit call RemoveLines make Assertion failed.
By: HenryXin on Sat, 23 February 2008 17:17
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: HenryXin on Sun, 24 February 2008 08:12
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: mirek on Tue, 26 February 2008 21:11
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: HenryXin on Wed, 27 February 2008 03:55
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: mirek on Wed, 27 February 2008 09:41
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: HenryXin on Thu, 28 February 2008 03:31
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: mirek on Mon, 03 March 2008 20:43
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: HenryXin on Sat, 08 March 2008 10:48
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: mirek on Sat, 08 March 2008 16:58
|
|
|
Re: DocEdit call RemoveLines make Assertion failed.
By: HenryXin on Sun, 09 March 2008 06:03
|
Goto Forum:
Current Time: Sat Jun 08 07:42:07 CEST 2024
Total time taken to generate the page: 0.01492 seconds
|