ecere 1+1=2

来自中国的朋友,欢迎您在本版面使用中文讨论问题。请注意,如果您想得到不懂中文的人的帮助,请同时提供英文译文。
Help and discussions in Chinese.
Post Reply
liqi98136
Posts: 53
Joined: Sun Jan 17, 2010 11:37 pm

ecere 1+1=2

Post by liqi98136 »

Code: Select all

import "ecere"

class Form1 : Window
{
   text = "1+1=2";
   background = activeBorder;
   borderStyle = sizable;
   hasClose = true;
   size = { 400, 216 };
   anchor = { horz = -91, vert = -108 };

   Button button1
   {
      this, text = "add", size = { 64, 21 }, position = { 224, 64 };

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
 
         editBox3.contents = PrintString(atoi(editBox1.contents) + atoi(editBox2.contents));

         return true;
         
      }
   };
   Label label1 { this, text = "number1", position = { 40, 64 } };
   Label label2 { this, text = "number2", position = { 40, 104 } };
   Label label3 { this, text = "result", position = { 48, 136 } };
   EditBox editBox1 { this, text = "editBox1", position = { 104, 64 } };
   EditBox editBox2 { this, text = "editBox2", position = { 104, 104 } };
   EditBox editBox3 { this, text = "editBox3", position = { 104, 136 } };

   bool OnCreate(void)
   {
       editBox3.contents="0";
       editBox2.contents="0";
       editBox1.contents="0";
      return true;
   }
}

Form1 form1 {};
当editBox1输入完数字后,按回车或者Tab,怎么才能自动跳到editBox2?
Post Reply