コード例 #1
0
 private void petriPalette_selectedItemChanged(NetworkToolboxItem selectedItem)
 {
     Cursor cursor = Cursors.Default;
     switch (selectedItem)
     {
         case NetworkToolboxItem.DELETE:
             cursor = Cursors.Cross;
             break;
         case NetworkToolboxItem.DELETETOKEN:
             cursor = Cursors.Cross;
             break;
         case NetworkToolboxItem.MOVE:
             cursor = Cursors.SizeAll;
             break;
         case NetworkToolboxItem.SELECT:
             cursor = Cursors.Default;
             break;
         case NetworkToolboxItem.SINGLESELECT:
             cursor = Cursors.Hand;
             break;
     }
     if (Properties.Settings.Default.ShowCustomCursor)
     {
         switch (selectedItem)
         {
             case NetworkToolboxItem.EDGE:
                 cursor = CursorHelper.getInstance().EdgeDefCursor;
                 break;
             case NetworkToolboxItem.NOTE:
                 cursor = CursorHelper.getInstance().NoteCursor;
                 break;
             case NetworkToolboxItem.POSITION:
                 cursor = CursorHelper.getInstance().PositionCursor;
                 break;
             case NetworkToolboxItem.SELECTEDGE:
                 cursor = CursorHelper.getInstance().SelectEdgeCursor;
                 break;
             case NetworkToolboxItem.TOKEN:
                 cursor = CursorHelper.getInstance().TokenCursor;
                 break;
             case NetworkToolboxItem.TRANSITION:
                 cursor = CursorHelper.getInstance().TransitionCursor;
                 break;
         }
     }
     foreach (Form child in this.MdiChildren)
     {
         child.Cursor = cursor;
     }
     // only for MOVE tool..
     this.reDrawActivePetriNetwork(false);
 }
コード例 #2
0
ファイル: PetriPalette.cs プロジェクト: davidbedok/UBPNS
 private void commonRadioButtonCheckedChanged(object sender, EventArgs e)
 {
     if (sender is RadioButton)
     {
         if ((sender as RadioButton).Checked)
         {
             if ((sender as RadioButton).Tag is NetworkToolboxItem)
             {
                 this.selectedItem = (NetworkToolboxItem)(sender as RadioButton).Tag;
                 this.parentForm.writeConsole("PetriPalette - selected item: " + this.selectedItem);
                 if (this.selectedItemChanged != null)
                 {
                     this.selectedItemChanged(this.selectedItem);
                 }
             }
         }
     }
 }