Exemplo n.º 1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            SectorTab.Text = e.Node.Text;
            if (e.Node.Level == 0)
            {
                //sectorWindow.createSystem();
            }
            else if (e.Node.Level == 1)
            {
                pCanvas1.Dispose();

                this.pCanvas1 = new UMD.HCIL.Piccolo.PCanvas();
                this.SectorTab.Controls.Add(this.pCanvas1);
                this.pCanvas1.AllowDrop        = true;
                this.pCanvas1.BackColor        = System.Drawing.Color.White;
                this.pCanvas1.Dock             = System.Windows.Forms.DockStyle.Fill;
                this.pCanvas1.GridFitText      = false;
                this.pCanvas1.Location         = new System.Drawing.Point(0, 0);
                this.pCanvas1.Name             = "pCanvas1";
                this.pCanvas1.RegionManagement = true;
                this.pCanvas1.Size             = new System.Drawing.Size(554, 438);
                this.pCanvas1.TabIndex         = 0;
                this.pCanvas1.Text             = "pCanvas1";

                SectorWindow sectorWindow = new SectorWindow(pCanvas1, e.Node.Text.ToString());
            }
        }
Exemplo n.º 2
0
 public NewSectorObject(String typeName, TreeView t1, SectorWindow s1)
 {
     tree             = t1;
     sectorObjectsSQL = mainFrm.sectorObjects;
     type             = typeName;
     _s1 = s1;
     mainFrm.selectedObjectID = 0;
     InitializeComponent();
 }
 public NewSectorObject(String typeName, TreeView t1, SectorWindow s1)
 {
     tree = t1;
     sectorObjectsSQL = mainFrm.sectorObjects;
     type = typeName;
     _s1 = s1;
     mainFrm.selectedObjectID = 0;
     InitializeComponent();
 }
Exemplo n.º 4
0
        private void btnCodes_Click(object sender, RoutedEventArgs e)
        {
            if (!BaseDataBase.CurrentUser.IsAdmin)
            {
                MyMessageBox.Show("ليس لديك صلاحيات للدخول");
                return;
            }
            SectorWindow w = new SectorWindow();

            w.ShowDialog();
        }
Exemplo n.º 5
0
        private void createOptions(SectorWindow sectorWindow)
        {
            if (Properties.Settings.Default.KeepVisualizationSetting == true)
            {
                if (optionsGui1 == null)
                {
                    this.optionsGui1            = new N7.GUI.OptionsGui(sectorWindow);
                    this.optionsGui1.AutoScroll = true;
                    this.optionsGui1.BackColor  = System.Drawing.Color.Transparent;
                    this.optionsGui1.Dock       = System.Windows.Forms.DockStyle.Fill;
                    this.optionsGui1.Location   = new System.Drawing.Point(0, 0);
                    this.optionsGui1.Name       = "optionsGui1";
                    this.optionsGui1.Size       = new System.Drawing.Size(768, 97);
                    this.optionsGui1.TabIndex   = 0;

                    this.sectorOptionsDock.Controls.Add(this.optionsGui1);
                }
                else
                {
                    optionsGui1.setSectorWindow(sectorWindow);
                }
            }
            else
            {
                if (optionsGui1 != null)
                {
                    this.optionsGui1.Dispose();
                }

                this.optionsGui1            = new N7.GUI.OptionsGui(sectorWindow);
                this.optionsGui1.AutoScroll = true;
                this.optionsGui1.BackColor  = System.Drawing.Color.Transparent;
                this.optionsGui1.Dock       = System.Windows.Forms.DockStyle.Fill;
                this.optionsGui1.Location   = new System.Drawing.Point(0, 0);
                this.optionsGui1.Name       = "optionsGui1";
                this.optionsGui1.Size       = new System.Drawing.Size(768, 97);
                this.optionsGui1.TabIndex   = 0;

                this.sectorOptionsDock.Controls.Add(this.optionsGui1);
            }

            optionsGui1.loadAll();
        }
Exemplo n.º 6
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            checkIfChanged();

            SectorTab.Text = e.Node.Text;
            String selName = e.Node.Text.ToString();

            pCanvas1.Dispose();

            this.pCanvas1 = new UMD.HCIL.Piccolo.PCanvas();
            this.SectorTab.Controls.Add(this.pCanvas1);
            this.pCanvas1.AllowDrop        = true;
            this.pCanvas1.BackColor        = System.Drawing.Color.White;
            this.pCanvas1.Dock             = System.Windows.Forms.DockStyle.Fill;
            this.pCanvas1.GridFitText      = false;
            this.pCanvas1.Location         = new System.Drawing.Point(0, 0);
            this.pCanvas1.Name             = "pCanvas1";
            this.pCanvas1.RegionManagement = true;
            this.pCanvas1.Size             = new System.Drawing.Size(554, 438);
            this.pCanvas1.TabIndex         = 0;
            this.pCanvas1.Text             = "pCanvas1";

            if (e.Node.Level == 0)
            {
                if (e.Node.Nodes.Count > 0)
                {
                    DataRow[] systemRow = systems.findRowsByName(selName);
                    String    systemID  = systemRow[0]["system_id"].ToString();
                    selectedSystemRow = systemRow[0];

                    //Populate Properties
                    SystemProps sp = new SystemProps();
                    sp.Name = selName;

                    int   R     = int.Parse(systemRow[0]["color_r"].ToString());
                    int   G     = int.Parse(systemRow[0]["color_g"].ToString());
                    int   B     = int.Parse(systemRow[0]["color_b"].ToString());
                    Color color = Color.FromArgb(R, G, B);
                    sp.Color = color;

                    sp.GalaxyX = float.Parse(systemRow[0]["galaxy_x"].ToString());
                    sp.GalaxyY = float.Parse(systemRow[0]["galaxy_y"].ToString());
                    sp.GalaxyZ = float.Parse(systemRow[0]["galaxy_z"].ToString());
                    sp.Notes   = systemRow[0]["notes"].ToString();

                    DataRow[] sectorTable = sectors.getRowsBySystemID(systemID);

                    createPropertyGrid();
                    propertyGrid1.SelectedObject = sp;

                    systemWindow = new SystemWindow(pCanvas1, selName, sectorTable, propertyGrid1, selectedSystemRow);
                    propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(systemWindow.pg_PropertyValueChanged);
                }
                else
                {
                    MessageBox.Show("Sorry, There are no sector's to display in the selected system! \n Please add a new sector to it, or select another system.");
                }
            }
            else if (e.Node.Level == 1)
            {
                DataRow[] sectorRow = sectors.findRowsByName(selName);
                sectorID = int.Parse(sectorRow[0]["sector_id"].ToString());
                createPropertyGrid();
                sectorWindow = new SectorWindow(pCanvas1, sectorRow, propertyGrid1, dataGridView1);
                createOptions(sectorWindow);
                sectorObjects = sectorWindow.getSectorObjectsSQL();
                propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(sectorWindow.PropertyGrid1_PropertyValueChanged);

                dataGridView1.Rows.Clear();
                DataTable secObjects = sectorObjects.getSectorObject();
                object[]  dataSource = new object[4];
                foreach (DataRow dr in secObjects.Rows)
                {
                    int    id   = int.Parse(dr["sector_object_id"].ToString());
                    String name = dr["name"].ToString();
                    int    baID = int.Parse(dr["base_asset_id"].ToString());
                    int    type = int.Parse(dr["type"].ToString());

                    dataSource[0] = id;
                    dataSource[1] = name;
                    dataSource[2] = baID;
                    dataSource[3] = type;

                    dataGridView1.Rows.Add(dataSource);
                }
            }
        }
Exemplo n.º 7
0
 public NewFrm(TreeView t1, SectorWindow s1)
 {
     tree = t1;
     sw = s1;
     InitializeComponent();
 }
Exemplo n.º 8
0
 public NewFrm(TreeView t1, SectorWindow s1)
 {
     tree = t1;
     sw   = s1;
     InitializeComponent();
 }
 public NewSectorObjectType(TreeView t1, SectorWindow s1)
 {
     tree = t1;
     secWin = s1;
     InitializeComponent();
 }
Exemplo n.º 10
0
 public void setSectorWindow(SectorWindow sw)
 {
     sectorWindow = sw;
 }
Exemplo n.º 11
0
 public OptionsGui(SectorWindow sw)
 {
     sectorWindow = sw;
     InitializeComponent();
 }
Exemplo n.º 12
0
 public void setSectorWindow(SectorWindow sw)
 {
     sectorWindow = sw;
 }
Exemplo n.º 13
0
 public OptionsGui(SectorWindow sw)
 {
     sectorWindow = sw;
     InitializeComponent();
 }
Exemplo n.º 14
0
 public NewSectorObjectType(TreeView t1, SectorWindow s1)
 {
     tree   = t1;
     secWin = s1;
     InitializeComponent();
 }