-
Notifications
You must be signed in to change notification settings - Fork 1
/
selectSystemPrompt.cs
58 lines (51 loc) · 2.38 KB
/
selectSystemPrompt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HazeronMapper
{
public partial class selectSystemPrompt : Form
{
public selectSystemPrompt()
{ }
public selectsys_returnObj selectSystemPromptdlg(Galaxy galaxy)
{
SystemObj selectedSystem = null;
Dictionary<string, SystemObj> systemdict = new Dictionary<string, SystemObj>(galaxy.systems_dictionary());
galaxy.listupdate_sectors(1);
List<SystemObj> syslist = new List<SystemObj>(galaxy.systems_list());
//selectedSystem = syslist[0];
InitializeComponent();
dataGridView_systems.DataSource = syslist;
dataGridView_systems.RowHeadersVisible = false;
dataGridView_systems.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dataGridView_systems.Columns["name"].HeaderText = "Name";
dataGridView_systems.Columns["name"].DisplayIndex = 0;
dataGridView_systems.Columns["location"].HeaderText = "Coordinates";
dataGridView_systems.Columns["location"].DisplayIndex = 1;
dataGridView_systems.Columns["sector"].HeaderText = "Sector";
dataGridView_systems.Columns["notes"].HeaderText = "Notes";
dataGridView_systems.Columns["maploc"].Visible = false;
dataGridView_systems.Refresh();
this.ShowDialog();
//button_ok.Click += (sender, e) => { this.Close(); };
//string key = dataGridView_systems.SelectedRows[0].Cells[1].Value.ToString();
int keycolumnindex = dataGridView_systems.Columns["location"].Index;
int keyrowindex = dataGridView_systems.Rows.IndexOf(dataGridView_systems.SelectedRows[0]);
DataGridViewCell cell = dataGridView_systems[keycolumnindex, keyrowindex];
string key = cell.Value.ToString();
selectedSystem = systemdict[key];
selectsys_returnObj returnobj = new selectsys_returnObj(selectedSystem, (int)numericUpDown_depth.Value, checkBox_resetloc.Checked);
return returnobj;
}
private void button_ok_Click(object sender, EventArgs e)
{
this.Close();
}
}
}