Esempio n. 1
0
        private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            Form2 curForm = (Form2) this.ActiveMdiChild;
            switch(toolBarTool.Buttons.IndexOf(e.Button))
            {
                case 0:
                    this.Cursor=System.Windows.Forms.Cursors.WaitCursor;
                    this.OnNewFile();
                    break;
                case 1:
                    AboutDialog myDlg = new AboutDialog();
                    myDlg.ShowDialog(this);
                    break;

                case 2: //just separator
                    break;
                case 3:
                    if (curForm == null)
                        return;
                    curForm.SetDisplayMode(0); //wireframe
                    this.wireframe.Enabled=false;
                    this.shading.Enabled=true;
                    this.transparency.Enabled=false;
                    break;
                case 4:
                    if (curForm == null)
                        return;
                    curForm.SetDisplayMode(1); //shading
                    this.shading.Enabled=false;
                    this.wireframe.Enabled=true;
                    this.transparency.Enabled=true;
                    break;
                case 5:
                    if (curForm == null)
                        return;
                    curForm.ChangeColor(true);
                    break;
                case 6:
                    if (curForm == null)
                        return;
                    MaterialDialog m = new MaterialDialog();
                    m.View=curForm.View;
                    m.ShowDialog(curForm);
                    break;
                case 7:
                    if (curForm == null)
                        return;
                    IE.TransparencyDialog t = new TransparencyDialog();
                    t.View=curForm.View;
                    t.ShowDialog(curForm);
                    break;
                case 8:
                    if (curForm == null)
                        return;
                    curForm.DeleteObjects();
                    break;
                default:
                    break;
            }
        }
Esempio n. 2
0
        private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            Form2 curForm = (Form2)this.ActiveMdiChild;

            switch (toolBarTool.Buttons.IndexOf(e.Button))
            {
            case 0:
                this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
                this.OnNewFile();
                break;

            case 1:
                AboutDialog myDlg = new AboutDialog();
                myDlg.ShowDialog(this);
                break;

            case 2:                     //just separator
                break;

            case 3:
                if (curForm == null)
                {
                    return;
                }
                curForm.SetDisplayMode(0);                         //wireframe
                this.wireframe.Enabled    = false;
                this.shading.Enabled      = true;
                this.transparency.Enabled = false;
                break;

            case 4:
                if (curForm == null)
                {
                    return;
                }
                curForm.SetDisplayMode(1);                         //shading
                this.shading.Enabled      = false;
                this.wireframe.Enabled    = true;
                this.transparency.Enabled = true;
                break;

            case 5:
                if (curForm == null)
                {
                    return;
                }
                curForm.ChangeColor(true);
                break;

            case 6:
                if (curForm == null)
                {
                    return;
                }
                MaterialDialog m = new MaterialDialog();
                m.View = curForm.View;
                m.ShowDialog(curForm);
                break;

            case 7:
                if (curForm == null)
                {
                    return;
                }
                IE.TransparencyDialog t = new TransparencyDialog();
                t.View = curForm.View;
                t.ShowDialog(curForm);
                break;

            case 8:
                if (curForm == null)
                {
                    return;
                }
                curForm.DeleteObjects();
                break;

            default:
                break;
            }
        }