private void MoveTabOneStepDown() { if (_tabToOpen >= 0) { ToolboxTab opentab = GetTab(_tabToOpen); ToolboxTab movetab = GetTab(_tabToOpen + 1); SelectedTab.Shrink(_moveStep); for (int i = _tabToOpen + 1; i <= _selectedTabIndex; i++) { ToolboxTab t = GetTab(i); t.MoveDown(_moveStep); } opentab.Growth(_moveStep); int endpoint = GetTabTopFromBottom(_tabToOpen + 1); if (movetab.Top >= endpoint) { EndAllMovements(); if (TabChanged != null) { ToolBoxEventArgs ea = new ToolBoxEventArgs( SelectedTab.Caption, "", "", SelectedTabIndex, -1, null); TabChanged(this, ea); } // opentab.ReDraw(); // SelectedTab.ReDraw(); } } }
private void MoveTabOneStepUp() { if (_tabToOpen >= 0) { ToolboxTab seltab = SelectedTab; ToolboxTab tab = GetTab(_tabToOpen); if (tab != null) { seltab.Shrink(_moveStep); for (int i = _selectedTabIndex + 1; i <= _tabToOpen; i++) { ToolboxTab t = GetTab(i); t.MoveUp(_moveStep); } tab.Growth(_moveStep); int endpoint = GetTabTop(_tabToOpen); if (tab.Top <= endpoint) { EndAllMovements(); if (TabChanged != null) { ToolBoxEventArgs ea = new ToolBoxEventArgs( SelectedTab.Caption, "", "", SelectedTabIndex, -1, null); TabChanged(this, ea); } } //SelectedTab.ReDraw(); //tab.ReDraw(); } } }
private void OnSelectItem(object sender, EventArgs e) { ToolboxItem item = sender as ToolboxItem; if (item != null && ItemSelect != null) { ToolBoxEventArgs ea = new ToolBoxEventArgs( SelectedTab.Caption, item.Caption, item.Id, SelectedTabIndex, item.Index, item.Tag); ItemSelect(this, ea); } }
private void OnItemDrag(object sender, EventArgs e) { if (_allowItemDrop) { ToolboxItem item = sender as ToolboxItem; if (item != null) { ToolBoxEventArgs ea = new ToolBoxEventArgs( SelectedTab.Caption, item.Caption, item.Id, SelectedTabIndex, item.Index, item.Tag); DoDragDrop(ea, DragDropEffects.Copy); } } }