Beispiel #1
0
        static void testPushButton()
        {
            Separate();
            Console.WriteLine("                  Test PushButton class");
            Separate();
            UINode.UIRoot.Clear();
            Console.WriteLine("\n                Create new button and add it to root\n");
            PushButton b1 = new PushButton("Button caption", null, "b1");

            UINode.UIRoot.Add(b1);
            Console.WriteLine("\n                Click the button\n");
            b1.Click();

            Console.WriteLine("\n                Add action to the button and release it\n");
            b1.OnClick += Foo;
            b1.Release();
            b1.Click(null, new MouseEventArgs(10, 14, MouseButton.LEFT, KeyboardKey.LCTRL | KeyboardKey.RSHIFT));


            b1.OnRelease += Bar;
            b1.Release();

            Console.WriteLine("\n                Click the (Button)PushButton\n");
            ((Button)b1).Click();
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++");
        }
Beispiel #2
0
        static void testAnonimous()
        {
            Separate();
            Console.WriteLine("                      Test Anonimous methods");
            Separate();

            var root   = UINode.CreateRootNode(1000, 1000, "default style", "root");
            var button = new PushButton("pushButton1");

            root.Add(button);
            var counter = 0;

            button.OnClick += delegate(object sender, MouseEventArgs args)
            {
                Console.WriteLine("Pushed {0}", counter++);
            };
            button.OnRelease += delegate(object sender, MouseEventArgs args)
            {
                Console.WriteLine("Released {0}", counter++);
            };
            for (int i = 0; i < 3; i++)
            {
                button.Click();
                button.Release();
            }
        }
Beispiel #3
0
        static void TestRelease()
        {
            Console.WriteLine("-");
            Console.WriteLine(new StackFrame().GetMethod().Name);
            Console.WriteLine("-");

            var button = new PushButton("click me");

            button.OnRelease += (sender, args) =>
            {
                Console.WriteLine("Lambda: {0}=>{1}", sender, args);
            };
            button.OnRelease += Foo;
            button.Release(new MouseEventArgs(1, 2, MouseButton.MIDDLE, KeyboardKey.LALT | KeyboardKey.LSHIFT));
        }
Beispiel #4
0
        static void testPushButton()
        {
            Separate();
            Console.WriteLine("                  Test PushButton class");
            Separate();
            UINode.UIRoot.Clear();
            Console.WriteLine("\n                Create new button and add it to root\n");
            PushButton b1 = new PushButton("Button caption", null, null, null, "b1");

            UINode.UIRoot.Add(b1);
            Console.WriteLine("\n                Click the button\n");
            b1.Click();
            Console.WriteLine("\n                Add action to the button and release it\n");
            b1.OnClicked  = Foo;
            b1.OnReleased = Bar;
            b1.Release();
            Console.WriteLine("\n                Click the (Button)PushButton\n");
            ((Button)b1).Click();
            Console.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++");
        }