Code: Select all
import "ecere"
class Form1 : Window
{
text = "Form1";
background = activeBorder;
borderStyle = fixed;
hasClose = true;
size = { 688, 256 };
anchor = { horz = -43, vert = -93 };
Label label1 { this, text = "在左边的ListBox双击一行则将该行文字添加给右边的ListBox", font = { "Tahoma", 9 }, size = { 324, 21 }, position = { 16, 8 } };
Label label2 { this, text = "在右边的ListBox里双击一行则将该行删除", font = { "Tahoma", 9 }, size = { 308, 21 }, position = { 352, 8 } };
ListBox listBox2
{
this, text = "listBox2", size = { 316, 172 }, position = { 352, 40 };
bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
{
if(listBox.currentRow)
listBox.DeleteRow(listBox.currentRow);
return true;
}
};
ListBox listBox1
{
this, text = "listBox1", size = { 324, 172 }, position = { 16, 40 };
bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
{
if( listBox.currentRow)
listBox2.AddString(listBox.currentRow.string);
return true;
}
};
bool OnPostCreate(void)
{
int i;
for(i=0;i<10;i++)
{
this.listBox1.AddStringf("Line #%d",i+1);
this.listBox1.AddStringf("第%d行",i+1);
}
return true;
}
}
Form1 form1 {};