Exemple #1
0
        public Form1()
        {
            InitializeComponent();

            // set up event handlers for the 3D projection control
            lDesignCtrl.AngleChangeEvent   += new ControlAngleChangeCallback(lDesignControlAngleChangeHandler);
            lDesignCtrl.ScalingChangeEvent += new ControlScalingChangeCallback(lScalingChangeEventHandler);

            // load prefs
            lAppPrefs = new AppPrefs();

            // set window position prefs
            Location    = new Point(lAppPrefs.WindowLeft, lAppPrefs.WindowTop);
            ClientSize  = new Size(lAppPrefs.WindowWidth, lAppPrefs.WindowHeight);
            WindowState = (lAppPrefs.WindowMaximized ? FormWindowState.Maximized : FormWindowState.Normal);

            // set listview column widths
            if (lAppPrefs.PartsListColumnWidths.Count > 0)
            {
                int colndx = 0;

                foreach (int colwidth in lAppPrefs.PartsListColumnWidths)
                {
                    if (colndx < lPartsLvw.Columns.Count)
                    {
                        lPartsLvw.Columns[colndx].Width = colwidth;
                        colndx++;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            // set the title
            Text = "GWH CAD Application (Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + ")";

            // populate the last files combo box
            lPopulateLastFilesListFromPrefs();
            if (lTSDesignFileCbx.Items.Count > 0)
            {
                lTSDesignFileCbx.SelectedIndex = 0;
            }

            lTSShowAxesCbx.SelectedIndex   = (lAppPrefs.ShowAxes ? 0 : 1);
            lTSShowLabelsCbx.SelectedIndex = (lAppPrefs.ShowLabels ? 0 : 1);
        }
Exemple #2
0
 public AppPrefs()
 {
     lLoadPrefs();
     GAppPrefs = this;
 }