private void frmDoDSummaryProperties_Load(object sender, System.EventArgs e)
        {
            InitializeToolTips();

            frmFont.Font          = Options.Font;
            frmFont.FontMustExist = true;
            frmFont.ShowHelp      = false;
            frmFont.ShowColor     = false;
            txtFont.Text          = UserInterface.Options.frmOptions.FontString(Options.Font);

            frmColourPicker.SolidColorOnly = true;
            frmColourPicker.ShowHelp       = false;

            cboLinear.DataSource = GCDUnits.GCDLinearUnits();
            cboArea.DataSource   = GCDUnits.GCDAreaUnits();
            cboVolume.DataSource = GCDUnits.GCDVolumeUnits();

            GCDUnits.SelectUnit(cboLinear, Options.LinearUnits);
            GCDUnits.SelectUnit(cboArea, Options.AreaUnits);
            GCDUnits.SelectUnit(cboVolume, Options.VolumeUnits);

            picErosion.BackColor    = ProjectManager.ColorErosion;
            picDeposition.BackColor = ProjectManager.ColorDeposition;

            valPrecision.Value = Options.m_nPrecision;

            // Do the row check boxes first with the specifc box checked so that they are enabled.
            rdoRowsSpecific.Checked = true;
            chkRowsAreal.Checked    = Options.m_bRowsAreal;
            chkVolumetric.Checked   = Options.m_bRowsVolumetric;
            chkVertical.Checked     = Options.m_bRowsVerticalAverages;
            chkPercentages.Checked  = Options.m_bRowsPercentages;

            rdoRowsAll.Checked        = Options.m_eRowGroups == DoDSummaryDisplayOptions.RowGroups.ShowAll;
            rdoRowsNormalized.Checked = Options.m_eRowGroups == DoDSummaryDisplayOptions.RowGroups.Normalized;
            rdoRowsSpecific.Checked   = Options.m_eRowGroups == DoDSummaryDisplayOptions.RowGroups.SpecificGroups;

            UpdateControls();

            chkColsRaw.Checked         = Options.m_bColsRaw;
            chkColsThresholded.Checked = Options.m_bColsThresholded;
            chkColsError.Checked       = Options.m_bColsPMError;
            chkColsPercentage.Checked  = Options.m_bColsPCError;
        }
示例#2
0
        private void frmProjectProperties_Load(System.Object sender, System.EventArgs e)
        {
            grdMetaData.AllowUserToResizeRows   = false;
            grdMetaData.AllowUserToOrderColumns = false;

            SetToolTips();

            cboHorizontalUnits.DataSource = GCDUnits.GCDLinearUnits();
            cboVerticalUnits.DataSource   = GCDUnits.GCDLinearUnits();
            cboAreaUnits.DataSource       = GCDUnits.GCDAreaUnits();
            cboVolumeUnits.DataSource     = GCDUnits.GCDVolumeUnits();

            if (CreateMode)
            {
                this.Text  = "Create New GCD Project";
                btnOK.Text = "   Create";
                btnOK.Text = Properties.Resources.CreateButtonText;

                // Default the directory to the parent folder of the last project used.
                if (!string.IsNullOrEmpty(GCDCore.Properties.Settings.Default.LastUsedProjectFolder))
                {
                    string sDir = Path.GetDirectoryName(GCDCore.Properties.Settings.Default.LastUsedProjectFolder);
                    if (Directory.Exists(sDir))
                    {
                        txtDirectory.Text = sDir;
                    }
                }

                GCDUnits.SelectUnit(cboHorizontalUnits, UnitsNet.Units.LengthUnit.Meter);
                GCDUnits.SelectUnit(cboVerticalUnits, UnitsNet.Units.LengthUnit.Meter);
                GCDUnits.SelectUnit(cboAreaUnits, UnitsNet.Units.AreaUnit.SquareMeter);
                GCDUnits.SelectUnit(cboVolumeUnits, UnitsNet.Units.VolumeUnit.CubicMeter);
            }
            else
            {
                this.Text  = "GCD Project Properties";
                btnOK.Text = Properties.Resources.UpdateButtonText;

                txtName.Text        = ProjectManager.Project.Name;
                txtDirectory.Text   = ProjectManager.Project.ProjectFile.DirectoryName;
                txtGCDPath.Text     = ProjectManager.Project.ProjectFile.FullName;
                txtDescription.Text = ProjectManager.Project.Description;

                GCDUnits.SelectUnit(cboHorizontalUnits, ProjectManager.Project.Units.HorizUnit);
                GCDUnits.SelectUnit(cboVerticalUnits, ProjectManager.Project.Units.VertUnit);
                GCDUnits.SelectUnit(cboAreaUnits, ProjectManager.Project.Units.ArUnit);
                GCDUnits.SelectUnit(cboVolumeUnits, ProjectManager.Project.Units.VolUnit);

                // Only allow the units to be changed if no DEMs have been defined
                int demCount = ProjectManager.Project.DEMSurveys.Count;
                cboHorizontalUnits.Enabled = demCount == 0;
                cboVerticalUnits.Enabled   = demCount == 0;
                cboAreaUnits.Enabled       = demCount == 0;
                cboVolumeUnits.Enabled     = demCount == 0;

                // Copy the project meta into the binding list
                foreach (KeyValuePair <string, string> kvp in ProjectManager.Project.MetaData)
                {
                    MetaData.Add(new ProjectMetaData(kvp.Key, kvp.Value));
                }

                // Adjust the controls to be read/write only for editing
                txtName.ReadOnly      = true;
                txtDirectory.ReadOnly = true;

                // Default focus to the OK button in edit mode
                btnOK.Select();
            }

            // Bind the data grid to the binding list
            grdMetaData.DataSource = MetaData;
        }