예제 #1
0
 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();
         }
     }
 }
예제 #2
0
 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();
         }
     }
 }
예제 #3
0
        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);
            }
        }
예제 #4
0
 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);
         }
     }
 }