PS:don't know why first "\n" in editBox2.AddS shows correct ,but all the rest "\n" show as "|.n" here in the post.
Code: Select all
import "ecere"
import "DynamicString"
static DynamicString buffer{};
class Form1 : Window
{
caption = "Form1";
background = formColor;
borderStyle = sizable;
hasMaximize = true;
hasMinimize = true;
hasClose = true;
size = { 440, 204 };
anchor = { horz = -31, vert = -68 };
DynamicString str{};
Button button1
{
this, caption = "Get", altG, isDefault = true, size = { 90, 29 }, anchor = { left = 48, bottom = 19 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
//char howmany[1024];
//buffer=DynamicString{};
str=editBox1.contents;
//String str=editBox1.contents;
editBox2.AddS(str);
editBox2.AddS("\n");
//buffer.concat(str);
//buffer.concatf("%s\n",str);
//buffer.concatx(str,"",str,"\n");
//buffer.concatx(buffer,str,"\n");
buffer.concatf("%s",str," ",str);
editBox2.SetViewToCursor(true);
Update(null);
//this.Update(0);
//delete str;
MessageBox{contents=buffer}.Modal();//CopyString(buffer);
return true;
}
};
Button button2
{
this, caption = "Exit", escape, size = { 82, 29 }, anchor = { right = 38, bottom = 19 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
Destroy(0);
return true;
}
}
EditBox editBox1 { this, caption = "editBox1", size = { 382, 19 }, anchor = { left = 24, top = 16, right = 26 } };
EditBox editBox2 { this, caption = "editBox2", anchor = { left = 24, top = 56, right = 26, bottom = 61 }, hasVertScroll = true, multiLine = true }
bool OnPostCreate(void)
{
editBox1.Activate();
return true;
};;
}
Form1 form1 {};