Пример #1
0
 private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
 {
     //TODO: Generate context menu for the main display
     if (!(activeInstrument is InstrumentSelectAndMove))
     {
         e.Cancel = true;
         return;
     }
     SelectedItem = X.Select(simpleGL1.PointToClient(MousePosition));
     if (SelectedItem != null)
     {
         contextMenuStrip1.Items.Clear();
         ToolStripItem x = contextMenuStrip1.Items.Add(SelectedItem.Name);
         x.Enabled = false;
         ToolStripItem z = contextMenuStrip1.Items.Add(STranslation.T["RemoveObject"], null, x_MouseUp);
         x.Click += new EventHandler(x_MouseUp);
         z        = contextMenuStrip1.Items.Add(STranslation.T["Copy"], null, z_MouseUp);
     }
     else
     {
         contextMenuStrip1.Items.Clear();
         ToolStripItem z = contextMenuStrip1.Items.Add(STranslation.T["Pastle"], null, p_MouseUp);
         if (PastleObj == null)
         {
             z.Enabled = false;
         }
         //ToolStripItem x = contextMenuStrip1.Items.Add("null");
         //x.Enabled = false;
     }
 }
Пример #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Config.Read();
     X.InitDrawing(ref simpleGL1, Convert.ToInt32(SConfig.C["System.Scaling"]));
     InitOGL();
     groupBox1.OnUserSelect += new EventHandler <EventArgs>(groupBox1_OnUserSelect);
     z = groupBox1;
 }