Beispiel #1
0
        private void osnapsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Childform frm = this.ActiveMdiChild as Childform;

            if (frm == null)
            {
                return;
            }

            VectorDraw.Professional.vdObjects.vdDocument doc = frm.vdScrollableControl1.BaseControl.ActiveDocument;
            VectorDraw.Professional.Dialogs.OSnapDialog.Show(doc, doc.ActionControl);
        }
Beispiel #2
0
        void CommandExecute(string commandname, bool isDefaultImplemented, ref bool success)
        {
            if (string.Compare(commandname, "open", true) == 0)
            {
                success = true;
                createForm();
                Childform form = this.ActiveMdiChild as Childform;
                VectorDraw.Professional.vdObjects.vdDocument doc = form.vdScrollableControl1.BaseControl.ActiveDocument;
                object ret = doc.GetOpenFileNameDlg(0, "", 0);
                if (ret == null)
                {
                    form.Close();
                    return;
                }

                string fname       = (string)ret;
                bool   successopen = doc.Open(fname);
                if (!successopen)
                {
                    System.Windows.Forms.MessageBox.Show("Error openning " + fname);
                    form.Close();
                    return;
                }
                doc.Redraw(false);
            }
            else if (string.Compare(commandname, "new", true) == 0)
            {
                createForm();
                success = true;
            }
            else if (string.Compare(commandname, "pan", true) == 0)
            {
                Childform frm = this.ActiveMdiChild as Childform;
                if (frm == null)
                {
                    return;
                }
                frm.vdScrollableControl1.BaseControl.ActiveDocument.CommandAction.Pan();
            }
        }