Exemplo n.º 1
0
 protected virtual void MapGoTo(object sender, GoToEventArgs a)
 {
     if (a.Sector <= dc.i.Length / dc.i.sectorSize && a.Sector >= 0)
     {
         dc.selectedSector = a.Sector;
         int sectorsPerRow = sectorGrid.Width / dc.sectorSquareSize;
         if (dc.selectedSector > sectorsPerRow)
         {
             this.gridStartRow = (dc.selectedSector / sectorsPerRow) - 1;
         }
         gridScroll.Value = (int)this.gridStartRow;
         sectorGrid.Invalidate();
         sectorGrid.Update();
     }
     else
     {
         MessageBox.Show("Value too large or too small.");
         _mapGoToForm = new MapGoTo();
         _mapGoToForm.GoTo += MapGoTo;
         _mapGoToForm.ShowDialog();
     }
 }
Exemplo n.º 2
0
 protected virtual void MapGoTo(object sender, GoToEventArgs a)
 {
     if (a.Sector <= dc.i.Length / dc.i.sectorSize && a.Sector >= 0)
     {
         dc.selectedSector = a.Sector;
         int sectorsPerRow = sectorGrid.Width / dc.sectorSquareSize;
         if (dc.selectedSector > sectorsPerRow)
         {
             this.gridStartRow = (dc.selectedSector / sectorsPerRow) - 1;
         }
         gridScroll.Value = (int)this.gridStartRow;
         sectorGrid.Invalidate();
         sectorGrid.Update();
     }
     else
     {
         MessageBox.Show("Value too large or too small.");
         _mapGoToForm       = new MapGoTo();
         _mapGoToForm.GoTo += MapGoTo;
         _mapGoToForm.ShowDialog();
     }
 }
Exemplo n.º 3
0
 private void goToToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _mapGoToForm = new MapGoTo();
     _mapGoToForm.GoTo += MapGoTo;
     _mapGoToForm.ShowDialog();
 }
Exemplo n.º 4
0
 private void goToToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _mapGoToForm       = new MapGoTo();
     _mapGoToForm.GoTo += MapGoTo;
     _mapGoToForm.ShowDialog();
 }