Exemplo n.º 1
0
        private void btn_Properties_Edit_Click(object sender, EventArgs e)
        {
            string tempfile = System.IO.Path.GetTempFileName();
            CustomFigSaver.saveFigure(tempfile, (StickCustom)Canvas.activeFigure);

            StickEditor sticked = new StickEditor(tempfile);
            sticked.ShowDialog();
        }
Exemplo n.º 2
0
        private void AddObject(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode theSender = trv_addView.SelectedNode;
            int x = 1;
            switch (theSender.Tag.ToString())
            {
                case "0":
                    foreach (Layer l in Timeline.layers) { if (l.GetType() == typeof(StickLayer)) { x++; } }
                    Program.TimelineForm.addStickLayer("Stick Layer " + x);
                    break;
                case "1":
                    foreach (Layer l in Timeline.layers) { if (l.GetType() == typeof(CustomLayer)) { x++; } }
                    Program.TimelineForm.addCustomLayer("Custom Layer " + x);
                    Timeline.layer_sel = Timeline.layer_cnt - 1;
                    StickEditor f = new StickEditor();
                    f.ShowDialog(this);
                    return;

                case "2":
                    foreach (Layer l in Timeline.layers) { if (l.GetType() == typeof(LineLayer)) { x++; } }
                    Program.TimelineForm.addLineLayer("Line Layer " + x);
                    break;
                case "3":
                    foreach (Layer l in Timeline.layers) { if (l.GetType() == typeof(RectLayer)) { x++; } }
                    Program.TimelineForm.addRectLayer("Rect Layer " + x);
                    break;
                case "4":
                    foreach (Layer l in Timeline.layers) { if (l.GetType() == typeof(LightLayer)) { x++; } }
                    Program.TimelineForm.addLightLayer("Light Layer " + x);
                    return;

                case "5":
                    //layerType = typeof(TextLayer);
                    return;

                case "6":
                    TISFAT_ZERO.Forms.Dialogs.PolyPrompt p = new Forms.Dialogs.PolyPrompt();

                    if(p.ShowDialog() == DialogResult.OK)
                    {
                        foreach (Layer l in Timeline.layers) { if (l.GetType() == typeof(PolyLayer)) { x++; } }
                        Program.TimelineForm.addPolyLayer("Poly Layer " + x, Convert.ToInt32(p.numericUpDown1.Value));
                    }
                    return;

                case "7":
                    dlg_File.Filter = Functions.GetImageFilters();

                    if(dlg_File.ShowDialog() == DialogResult.OK)
                    {
                        foreach (Layer l in Timeline.layers) { if (l.GetType() == typeof(ImageLayer)) { x++; } }
                        Program.TimelineForm.addImageLayer("Image Layer " + x, (Bitmap)Image.FromFile(dlg_File.FileName));
                    }
                    return;

                default:
                    return;
            }
            Program.TimelineForm.Refresh();

            pnl_addTools.Enabled = false;
            slideOutObject = pnl_addTools;
            animTimer.Start();
        }