예제 #1
0
파일: IDialog.cs 프로젝트: ntj/GravurGIS
        public IDialog() : base()
        {
            // Button
            resultButton = new ResultButton();
            this.Controls.Add(resultButton);

            this.toolBar        = new System.Windows.Forms.ToolBar();
            this.tbOkButton     = new System.Windows.Forms.ToolBarButton();
            this.tbCancelButton = new System.Windows.Forms.ToolBarButton();

            //
            // toolBar
            //
            this.toolBar.Buttons.Add(this.tbOkButton);
            this.toolBar.Buttons.Add(this.tbCancelButton);
            this.toolBar.Name         = "toolBar";
            this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);

            this.Controls.Add(this.toolBar);

            // Toolbar
            string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);

            ToolbarMaker.ToolBar = toolBar;
            ToolbarMaker.AddIcon(appPath + @"\Icons\tbOk");
            ToolbarMaker.AddIcon(appPath + @"\Icons\tbCancel");


            this.TopMost = true;
        }
예제 #2
0
 private void Divbutton_Click(object sender, EventArgs e)
 {
     if (calculating)
     {
         ResultButton.PerformClick();
     }
     operation   = 4;
     num1        = Convert.ToDouble(currentNum);
     currentNum  = "";
     calculating = true;
 }
예제 #3
0
        private void OperationButton_Click(object sender, RoutedEventArgs e)
        {
            if (string.Compare(NumberBox.Text, "생일축하합니다") == 0)
            {
                return;
            }

            Button btn = sender as Button;

            from = true;

            if (newHistoty)
            {
                HistoryBox.Text  = NumberBox.Text;
                HistoryBox.Text += btn.Content.ToString();
                newHistoty       = false;
            }
            else if (!newButton)
            {
                HistoryBox.Text += NumberBox.Text;
                HistoryBox.Text += btn.Content.ToString();
            }
            else
            {
                if (HistoryBox.Text.Length > 0)
                {
                    HistoryBox.Text = HistoryBox.Text.Remove(HistoryBox.Text.Length - 1, 1);
                }
                HistoryBox.Text += btn.Content.ToString();
            }

            if (!newButton && operation != null)
            {
                ResultButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            }

            if (string.Compare(NumberBox.Text, "생일축하합니다") == 0)
            {
                return;
            }

            operation = btn.Content.ToString();
            result    = double.Parse(NumberBox.Text);

            from      = false;
            newButton = true;
        }
예제 #4
0
 public void CreateNewModule()
 {
     ShowQuestions(true);
     modulesManager.SetNewModuleActive();
     moduleField.text = "MODULE " + modulesManager.actualModule.module;
     title.text       = modulesManager.actualModule.title;
     debug.text       = modulesManager.actualModule.data.title.Replace('#', ' ');
     Utils.RemoveAllChildsIn(buttonsContainer);
     audiosource.Play();
     for (int i = 0; i < modulesManager.actualModule.results.Count; i++)
     {
         ResultButton button = Instantiate(resultButton_to_instantiate);
         button.transform.SetParent(buttonsContainer);
         button.transform.localScale = Vector3.one;
         button.Init(modulesManager.actualModule.values[i], i);
     }
     ShuffleChildOrder(buttonsContainer);
 }
예제 #5
0
        private void OperatorClick(object sender, EventArgs e)
        {
            Button button = (Button)sender;

            if (resultCalculator != 0)
            {
                ResultButton.PerformClick();
                operatorPerformed   = button.Text;
                labelCurrentOp.Text = resultCalculator + " " + operatorPerformed;
                isOperatorPerformed = true;
            }
            else
            {
                operatorPerformed   = button.Text;
                resultCalculator    = double.Parse(textBoxResult.Text);
                labelCurrentOp.Text = resultCalculator + " " + operatorPerformed;
                isOperatorPerformed = true;
            }
        }