Beispiel #1
0
        private void SelectNameFor(GUI.View v)
        {
            string name = v.name, tname;

            if (name.IndexOf('1') != -1)
            {
                name = name.Substring(0, name.IndexOf('1'));
            }
            int i = 1;

            do
            {
                tname = name + i.ToString();
                foreach (GUI.View d in diagrams)
                {
                    if (d.name.Equals(tname))
                    {
                        tname = null;
                        break;
                    }
                }
                i++;
            } while(tname == null);
            v.name = tname;
        }
Beispiel #2
0
        private void AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            object obj = ProjectTree.GetNodeObject(e.Node);

            if (obj != null && obj is UMLDes.GUI.View)
            {
                UMLDes.GUI.View v = obj as UMLDes.GUI.View;
                if (e.Label != null)
                {
                    v.name = e.Label;
                }
            }
            RefreshTitle();
        }
Beispiel #3
0
        public ViewCtrl()
        {
            this.Name = "ViewCtrl";

#if !DEBUG_INVALIDATE
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
#endif

            curr  = null;
            offx  = offy = 0;
            x_res = 1119; y_res = 777;

            SetupResources();
        }
Beispiel #4
0
 public void SelectView(GUI.View v, bool update)
 {
     ViewCtrl1.Curr = v;
     if (update)
     {
         if (view_toolbar_panels != null)
         {
             foreach (FlatToolBarPanel panel in view_toolbar_panels)
             {
                 toolBar1.RemovePanel(panel);
             }
         }
         view_toolbar_panels = v.LoadToolbars();
         RefreshTitle();
         ViewCtrl1.Invalidate();
     }
 }
Beispiel #5
0
        void TreeMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            TreeNode node = (sender as TreeView).GetNodeAt(e.X, e.Y);

            if (node == null)
            {
                return;
            }
            object obj = ProjectTree.GetNodeObject(node);

            dragbox = Rectangle.Empty;
            if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
            {
                if (obj is UMLDes.GUI.View)
                {
                    if (e.Clicks == 2)
                    {
                        UMLDes.GUI.View v = obj as UMLDes.GUI.View;
                        SelectView(v, true);
                    }
                }
                else if (!(obj is UmlDesignerSolution))
                {
                    Size dragSize = SystemInformation.DragSize;
                    dragbox    = new Rectangle(new Point(e.X - (dragSize.Width / 2), e.Y - (dragSize.Height / 2)), dragSize);
                    dragobject = obj as UmlObject;
                }
            }
            else if ((e.Button & MouseButtons.Right) == MouseButtons.Right)
            {
                ProjectTree.SelectedNode = node;
                if (obj != null)
                {
                    TryDropDownMenu(e.X, e.Y, obj, node);
                }
            }
        }
Beispiel #6
0
 private void menu_AddStaticView_Click(object sender, System.EventArgs e)
 {
     UMLDes.GUI.View v = p.newStaticView();
     SelectView(v, true);
 }
Beispiel #7
0
        public ViewCtrl()
        {
            this.Name = "ViewCtrl";

            #if !DEBUG_INVALIDATE
            SetStyle( ControlStyles.AllPaintingInWmPaint, true );
            SetStyle( ControlStyles.DoubleBuffer, true );
            #endif

            curr = null;
            offx = offy = 0;
            x_res = 1119; y_res = 777;

            SetupResources();
        }