public FlatToolBarPanel AddPanel( int row, string name ) { FlatToolBarPanel p = new FlatToolBarPanel( 100000, row * (BarPanelHeight + 2), name, this ); panels.Add( p ); FixupHeightAndRows( p, -1 ); p.ChangedPosition(); return p; }
public FlatToolBarPanel AddPanel(int row, string name) { FlatToolBarPanel p = new FlatToolBarPanel(100000, row * (BarPanelHeight + 2), name, this); panels.Add(p); FixupHeightAndRows(p, -1); p.ChangedPosition(); return(p); }
protected override void OnMouseMove(MouseEventArgs e) { int x = e.X - ClientRectangle.X, y = e.Y - ClientRectangle.Y; if (!moving) { foreach (FlatToolBarPanel p in panels) { if (p.place.Contains(x, y)) { if (!p.MouseMove(x - p.place.X, y - p.place.Y)) { Cursor.Current = Cursors.SizeAll; move_x = x - p.place.X; move_y = y - p.place.Y; ready_to_move = true; move_panel = p; if (highlighted != null) { highlighted.RemoveHighlight(); } highlighted = null; tt.Active = false; return; } else { if (highlighted != p && highlighted != null) { highlighted.RemoveHighlight(); } highlighted = p; } } } ready_to_move = false; Cursor.Current = Cursors.Arrow; } else { int old_y = move_panel.place.Y; move_panel.place.Y = (y + 3) / (BarPanelHeight + 2) * (BarPanelHeight + 2); if (move_panel.place.Y < 0) { move_panel.place.Y = 0; } move_panel.place.X = x - move_x; FixupHeightAndRows(move_panel, old_y); move_panel.ChangedPosition(); } }