public bool MouseMove(int x, int y) { int X; X = LeftMargin; foreach (FlatToolBarButton b in buttons) { if (b.style != FlatButtonType.Line && !b.disabled) { if (x >= X && x <= X + b.width && y >= 1 && y <= 22) { if (highlighted != b) { RemoveHighlight(); highlighted = b; b.state = FlatButtonState.Hover; InvalidateButton(b); parent.SetCurrentTip(b.title); } return(true); } X += b.width; } else if (b.style != FlatButtonType.Line) { X += b.width; } else { X += LineWidth; } } return(false); }
void EnableButton(UMLDes.Controls.FlatToolBarButton b, bool en) { if (!b.disabled != en) { b.disabled = !b.disabled; b.parent.InvalidateButton(b); } }
public void RemoveHighlight() { if (highlighted != null) { highlighted.state = FlatButtonState.Basic; InvalidateButton(highlighted); } highlighted = null; }
public FlatToolBarButton AddControl(Control c) { FlatToolBarButton b = new FlatToolBarButton(c, this); buttons.Add(b); ChangedPosition(); parent.Invalidate(); return(b); }
public FlatToolBarButton AddButton(FlatButtonType t, int imageindex, string title, MouseClickEvent ev) { FlatToolBarButton b = new FlatToolBarButton(t, imageindex, ev, title, this); buttons.Add(b); ChangedPosition(); parent.Invalidate(); return(b); }
public void MakeRadioDown(FlatToolBarButton bb) { foreach (FlatToolBarButton b in buttons) { if (b.style == FlatButtonType.RadioDown) { b.style = FlatButtonType.Radio; InvalidateButton(b); } } bb.style = FlatButtonType.RadioDown; InvalidateButton(bb); }
public void InvalidateButton(FlatToolBarButton b) { int X = parent.ClientRectangle.X + place.X + LeftMargin, Y = parent.ClientRectangle.Y + place.Y; foreach (FlatToolBarButton p in buttons) { if (p == b) { parent.Invalidate(new Rectangle(X, Y + 1, b.width, 22)); return; } X += p.width; } }
void PostInitialize() { initialize_tree_view(ProjectTree); UMLDes.Controls.MouseClickEvent m = new UMLDes.Controls.MouseClickEvent(ToolbarAction); UMLDes.Controls.FlatToolBarPanel p; // project toolbar p = toolBar1.AddPanel(0, "Standard"); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.New, "New project", m); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.Open, "Open project", m); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.Save, "Save", m); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.Saveas, "Save as", m); p.AddButton(UMLDes.Controls.FlatButtonType.Line, 0, null, null); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.add_file, "Add files", m); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.new_diagram, "New Static View", m); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.refresh, "Refresh model", m); p.AddButton(UMLDes.Controls.FlatButtonType.Line, 0, null, null); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.print, "Print", m); p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.print_preview, "Print Preview", m); p.AddButton(UMLDes.Controls.FlatButtonType.Line, 0, null, null); tool_cut = p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.cut, "Cut", m); tool_copy = p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.copy, "Copy", m); tool_paste = p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.paste, "Paste", m); p.AddButton(UMLDes.Controls.FlatButtonType.Line, 0, null, null); tool_undo = p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.undo, "Undo", m); tool_redo = p.AddButton(UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.redo, "Redo", m); tool_cut.disabled = tool_copy.disabled = tool_paste.disabled = true; // Scale menu p = toolBar1.AddPanel(0, "Scale"); ComboBox cb = new ComboBox(); cb.TabStop = false; cb.Size = new Size(90, 20); cb.DropDownStyle = ComboBoxStyle.DropDownList; cb.MaxDropDownItems = 15; for (int i = 0; i < ViewCtrl.scalevalue.Length; i += 2) { cb.Items.Add((ViewCtrl.scalevalue[i] * 100 / ViewCtrl.scalevalue[i + 1]).ToString() + "%"); } cb.SelectedIndex = 5; cb.SelectedIndexChanged += new EventHandler(ViewCtrl1.ScaleChanged); ViewCtrl1.scalecombo = cb; p.AddControl(cb); }
public override ArrayList LoadToolbars() { ArrayList l = new ArrayList(); FlatToolBar toolbar = proj.tool_bar; UMLDes.Controls.MouseClickEvent m = new UMLDes.Controls.MouseClickEvent(ToolbarAction); UMLDes.Controls.FlatToolBarPanel p; // UML Elements drawing p = toolbar.AddPanel(0, "UML"); l.Add(p); defbutton = p.AddButton(FlatButtonType.RadioDown, (int)ToolBarIcons.arrow, "Select", m); p.AddButton(FlatButtonType.Line, 0, null, null); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.conn_inher, "Draw inhreitance", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.conn_assoc, "Draw association", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.conn_aggregation, "Draw aggregation", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.conn_composition, "Draw composition", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.conn_attachm, "Draw attachment", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.conn_dependence, "Draw dependency/usage", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.conn_realiz, "Draw realization", m); p.AddButton(FlatButtonType.Line, 0, null, null); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.memo, "Draw memo", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.package, "Draw package", m); p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.constraint, "Draw constraint", m).disabled = true; p.AddButton(FlatButtonType.Radio, (int)ToolBarIcons.actor, "Draw actor", m).disabled = true; drawingmode = p; p = toolbar.AddPanel(0, "Default line type"); l.Add(p); p.AddButton(MouseAgent.conn_style == GuiConnectionStyle.Line ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.straight_conn, "Line", m); p.AddButton(MouseAgent.conn_style == GuiConnectionStyle.Segmented ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.segmented_conn, "Segmented", m); p.AddButton(MouseAgent.conn_style == GuiConnectionStyle.Quadric ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.quadric_conn, "Quadric", m); p.AddButton(MouseAgent.conn_style == GuiConnectionStyle.Besier ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.curved_conn, "Bezier", m).disabled = true; p.AddButton(FlatButtonType.Line, 0, null, null); p.AddButton(FlatButtonType.Simple, (int)ToolBarIcons.show_qual, "Show full qualified", m).disabled = true; p.AddButton(FlatButtonType.Simple, (int)ToolBarIcons.oper_signature, "Operations signature", m).disabled = true; return(l); }
public void MakeRadioDown( FlatToolBarButton bb ) { foreach( FlatToolBarButton b in buttons ) if( b.style == FlatButtonType.RadioDown ) { b.style = FlatButtonType.Radio; InvalidateButton( b ); } bb.style = FlatButtonType.RadioDown; InvalidateButton( bb ); }
public void InvalidateButton( FlatToolBarButton b ) { int X = parent.ClientRectangle.X + place.X + LeftMargin, Y = parent.ClientRectangle.Y + place.Y; foreach( FlatToolBarButton p in buttons ) { if( p == b ) { parent.Invalidate( new Rectangle( X, Y + 1, b.width, 22) ); return; } X += p.width; } }
public FlatToolBarButton AddControl( Control c ) { FlatToolBarButton b = new FlatToolBarButton( c, this ); buttons.Add( b ); ChangedPosition(); parent.Invalidate(); return b; }
public FlatToolBarButton AddButton( FlatButtonType t, int imageindex, string title, MouseClickEvent ev ) { FlatToolBarButton b = new FlatToolBarButton( t, imageindex, ev, title, this ); buttons.Add( b ); ChangedPosition(); parent.Invalidate(); return b; }
void PostInitialize() { initialize_tree_view( ProjectTree ); UMLDes.Controls.MouseClickEvent m = new UMLDes.Controls.MouseClickEvent(ToolbarAction); UMLDes.Controls.FlatToolBarPanel p; // project toolbar p = toolBar1.AddPanel( 0, "Standard" ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.New, "New project", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.Open, "Open project", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.Save, "Save", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.Saveas, "Save as", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Line, 0, null, null ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.add_file, "Add files", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.new_diagram, "New Static View", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.refresh, "Refresh model", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Line, 0, null, null ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.print, "Print", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.print_preview, "Print Preview", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Line, 0, null, null ); tool_cut = p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.cut, "Cut", m ); tool_copy = p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.copy, "Copy", m ); tool_paste = p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.paste, "Paste", m ); p.AddButton( UMLDes.Controls.FlatButtonType.Line, 0, null, null ); tool_undo = p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.undo, "Undo", m ); tool_redo = p.AddButton( UMLDes.Controls.FlatButtonType.Simple, (int)ToolBarIcons.redo, "Redo", m ); tool_cut.disabled = tool_copy.disabled = tool_paste.disabled = true; // Scale menu p = toolBar1.AddPanel( 0, "Scale" ); ComboBox cb = new ComboBox(); cb.TabStop = false; cb.Size = new Size( 90, 20 ); cb.DropDownStyle = ComboBoxStyle.DropDownList; cb.MaxDropDownItems = 15; for( int i = 0; i < ViewCtrl.scalevalue.Length; i += 2 ) cb.Items.Add( (ViewCtrl.scalevalue[i] * 100 / ViewCtrl.scalevalue[i+1] ).ToString() + "%" ); cb.SelectedIndex = 5; cb.SelectedIndexChanged += new EventHandler(ViewCtrl1.ScaleChanged); ViewCtrl1.scalecombo = cb; p.AddControl( cb ); }
public bool MouseMove( int x, int y ) { int X; X = LeftMargin; foreach( FlatToolBarButton b in buttons ) if( b.style != FlatButtonType.Line && !b.disabled ) { if( x >= X && x <= X + b.width && y >= 1 && y <= 22 ) { if( highlighted != b ) { RemoveHighlight(); highlighted = b; b.state = FlatButtonState.Hover; InvalidateButton( b ); parent.SetCurrentTip( b.title ); } return true; } X += b.width; } else if( b.style != FlatButtonType.Line ) X += b.width; else X += LineWidth; return false; }
public void RemoveHighlight() { if( highlighted != null ) { highlighted.state = FlatButtonState.Basic; InvalidateButton( highlighted ); } highlighted = null; }
public override ArrayList LoadToolbars() { ArrayList l = new ArrayList(); FlatToolBar toolbar = proj.tool_bar; UMLDes.Controls.MouseClickEvent m = new UMLDes.Controls.MouseClickEvent(ToolbarAction); UMLDes.Controls.FlatToolBarPanel p; // UML Elements drawing p = toolbar.AddPanel( 0, "UML" ); l.Add( p ); defbutton = p.AddButton( FlatButtonType.RadioDown, (int)ToolBarIcons.arrow, "Select", m ); p.AddButton( FlatButtonType.Line, 0, null, null ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.conn_inher, "Draw inhreitance", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.conn_assoc, "Draw association", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.conn_aggregation, "Draw aggregation", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.conn_composition, "Draw composition", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.conn_attachm, "Draw attachment", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.conn_dependence, "Draw dependency/usage", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.conn_realiz, "Draw realization", m ); p.AddButton( FlatButtonType.Line, 0, null, null ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.memo, "Draw memo", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.package, "Draw package", m ); p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.constraint, "Draw constraint", m ).disabled = true; p.AddButton( FlatButtonType.Radio, (int)ToolBarIcons.actor, "Draw actor", m ).disabled = true; drawingmode = p; p = toolbar.AddPanel( 0, "Default line type" ); l.Add( p ); p.AddButton( MouseAgent.conn_style == GuiConnectionStyle.Line ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.straight_conn, "Line", m ); p.AddButton( MouseAgent.conn_style == GuiConnectionStyle.Segmented ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.segmented_conn, "Segmented", m ); p.AddButton( MouseAgent.conn_style == GuiConnectionStyle.Quadric ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.quadric_conn, "Quadric", m ); p.AddButton( MouseAgent.conn_style == GuiConnectionStyle.Besier ? FlatButtonType.RadioDown : FlatButtonType.Radio, (int)ToolBarIcons.curved_conn, "Bezier", m ).disabled = true; p.AddButton( FlatButtonType.Line, 0, null, null ); p.AddButton( FlatButtonType.Simple, (int)ToolBarIcons.show_qual, "Show full qualified", m ).disabled = true; p.AddButton( FlatButtonType.Simple, (int)ToolBarIcons.oper_signature, "Operations signature", m ).disabled = true; return l; }