Ecere SDK/eC Forums
http://www.ecere.com/forums/
Print view

ecere 1+1=2
http://www.ecere.com/forums/viewtopic.php?f=30&t=34
Page 1 of 1
Author:  liqi98136 [ Wed Mar 10, 2010 7:48 am ]
Post subject:  ecere 1+1=2

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?
All times are UTC-05:00 Page 1 of 1