Code: Select all
MessageBox{type=yesNo,yesButton.text="确定"; noButton.text="否"}.Modal();
Regards,
Sam
Code: Select all
MessageBox{type=yesNo,yesButton.text="确定"; noButton.text="否"}.Modal();
Code: Select all
Button button1
{
this, text = "button1", size = { 90, 29 }, position = { 208, 40 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
Window win{};
DialogResult result;
MessageBox msgbox;
msgbox=MessageBox{type=yesNo,text="caption",contents="Here is the msg"};
win=msgbox.firstChild;
while(win)
{
result=win.id;
switch(result)
{
case yes:
win.SetText("确定");
case no:
win.SetText("取消");
break;
default:break;
}
win=msgbox.next;
}
msgbox.Modal();
return true;
}
};
Code: Select all
Win win { }; // This is an instantiation, it creates a new window!
Window win; // This is a handle, it can used to point to something that exists already
Code: Select all
Button button1
{
this, text = "button1", size = { 90, 29 }, position = { 208, 40 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
Window win;
DialogResult result;
MessageBox msgBox {type=yesNo,text="caption",contents="Here is the msg"};
msgBox.Create();
for(win = msgBox.firstChild; win; win = win.next)
{
if(win.nonClient || !eClass_IsDerived(win._class, class(Button))) continue;
switch(win.id)
{
case DialogResult::yes: win.text = "确定"; break;
case DialogResult::no: win.text = "取消"; break;
default: break;
}
}
msgBox.Modal();
return true;
}
};
Code: Select all
import "ecere"
class CnMessageBox : MessageBox
{
bool OnPostCreate()
{
if(MessageBox::OnPostCreate())
{
Window win;
for(win = firstChild; win; win = win.next)
{
if(win.nonClient || !eClass_IsDerived(win._class, class(Button))) continue;
switch(win.id)
{
case DialogResult::yes: win.text = "确定"; break;
case DialogResult::no: win.text = "取消"; break;
default: break;
}
}
return true;
}
return false;
}
}
class Form1 : Window
{
text = "Form1";
background = activeBorder;
borderStyle = sizable;
hasMaximize = true;
hasMinimize = true;
hasClose = true;
size = { 640, 480 };
Button button1
{
this, text = "button1", size = { 90, 29 }, position = { 208, 40 };
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
DialogResult result;
CnMessageBox msgBox {type=yesNo,text="caption",contents="Here is the msg"};
result = msgBox.Modal();
return true;
}
};
}
Form1 form1 {};
Hi Jerome,jerome wrote:Hi Sam,
Yes, that is how liqi did it in the internationalization! The Documentor should already have the Chinese translation activated.
Checkout the other threads, you can try it:
http://www.ecere.com/forums/viewtopic.php?f=30&t=172
http://www.ecere.com/forums/viewtopic.php?f=30&t=145
I still have to integrate that with the new gettext functionality. Perhaps you could help us with this?