예제 #1
0
        public NumericInputDialog(string info)
        {
            this.Build();

            infoLabel.Markup = info;
            Button btn;
            uint   row, col;

            for (uint i = 0; i < 10; i++)
            {
                row = (i - 1) / 3;
                col = (i - 1) % 3;
                if (i == 0)
                {
                    row = 3; col = 1;
                }

                btn = new Button(i.ToString());
                btn.SetSizeRequest(80, 80);

                btn.Name     = i.ToString();
                btn.Clicked += new EventHandler(OnNumberClicked);

                ButtonTable.Attach(btn, col, col + 1, row, row + 1);
            }

            row = 3; col = 2;
            btn = new Button("gtk-go-back");
            btn.SetSizeRequest(80, 80);
            btn.Clicked += new EventHandler(OnBackspaceClicked);
            ButtonTable.Attach(btn, col, col + 1, row, row + 1);


            Update();
        }
        void ReleaseDesignerOutlets()
        {
            if (TableHeightConstrant != null)
            {
                TableHeightConstrant.Dispose();
                TableHeightConstrant = null;
            }

            if (ButtonTable != null)
            {
                ButtonTable.Dispose();
                ButtonTable = null;
            }
        }
예제 #3
0
        public void ButtonTable_ClickButtonInRow()
        {
            var buttonTable = new ButtonTable(_webDriver);

            buttonTable.Open();

            var buttonTableRows = buttonTable.buttonTableRows;

            buttonTableRows.Should().HaveCount(3);

            var secondRow = buttonTableRows.Single(x => x.Rownumber == "Row 2");

            secondRow.DeleteButton.Click();

            buttonTableRows = buttonTable.buttonTableRows;
            buttonTableRows.Should().HaveCount(2);
            buttonTableRows.Should().ContainSingle(x => x.Rownumber == "Row 1");
            buttonTableRows.Should().ContainSingle(x => x.Rownumber == "Row 3");
        }
예제 #4
0
        /// <summary>
        /// Initializes Screen Elements
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            //Initialize random for randomness.
            rand = new Random();

            //Set problem and answer
            NewProblem();

            //set focus
            oldFocus = new Vector2(1, 1);
            focus = new Vector2(1, 1);

            //location of elements
            bTableLocation = new Vector2(200, 250);
            problemLocation = new Vector2(Graphics.PreferredBackBufferWidth / 2, 100);
            userAnswerLocation = new Vector2(Graphics.PreferredBackBufferWidth / 2, 100);
            correctLocation = new Vector2(600, 400);
            totalLocation = new Vector2(600, 450);
            feedbackLocation = new Vector2((Graphics.PreferredBackBufferWidth) *3 /4 -125, 300);

            //User input devive
            buttonTable = new ButtonTable(buttonTexture, font, bTableLocation, 4, 3, "Calc", 70);

            feedbackColor = Color.Green;
        }
예제 #5
0
        /// <summary>
        /// Initializes Screen Elements
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            //set focus
            oldFocus = new Vector2(1, 1);
            focus = new Vector2(1, 1);

            //set locations of elements
            bTableLocation = new Vector2(60, 60);
            iTableLocation = new Vector2(590, 60);

            //9x9 table
            buttonTable = new ButtonTable(buttonTexture, font, bTableLocation, 9, 9, "TT", 57);

            iconTable = new IconTable(iconTextures, iTableLocation, 9, 9);
        }