public MainWindow()
 {
     _memory     = null;
     _lastAnswer = new ConstantExpression(0.0);
     _trackball  = null;
     _viewport   = null;
     VariableExpression.Define(AnswerKey, 0.0);
     Focusable = true;
 }
Exemple #2
0
 public MainWindow()
 {
     _memory = null;
     _lastAnswer = new ConstantExpression(0.0);
     _trackball = null;
     _viewport = null;
     VariableExpression.Define(AnswerKey, 0.0);
     Focusable = true;
 }
        private void OnLoaded(object sender, EventArgs args)
        {
            immediate.Focus();
            _viewport  = new Viewport3D();
            _trackball = new Trackball();
            _trackball.Servants.Add(_viewport);
            _trackball.Attach(screen);
            _trackball.Enabled = true;

            graphNone.Header      = Settings.FunctionNone;
            graph.Header          = Settings.Function;
            graph2D.Header        = Settings.Function2D;
            graph3D.Header        = Settings.Function3D;
            graphOptions.Header   = Settings.Function;
            graphOptions2D.Header = Settings.Function2D;
            graphOptions3D.Header = Settings.Function3D;

            // Workaround for registry bug (key base must exist before getting values - else default won't work)
            Registry.SetValue(_regSaveBase, "Version", "GraphCalc v.1.0", RegistryValueKind.String);

            xMin.Text = (string)Registry.GetValue(_regSaveBase, Settings.XMinReg, Settings.XMinDefault);
            xMax.Text = (string)Registry.GetValue(_regSaveBase, Settings.XMaxReg, Settings.XMaxDefault);
            yMin.Text = (string)Registry.GetValue(_regSaveBase, Settings.YMinReg, Settings.YMinDefault);
            yMax.Text = (string)Registry.GetValue(_regSaveBase, Settings.YMaxReg, Settings.YMaxDefault);

            xMinLabel.Text = Settings.XMin;
            xMaxLabel.Text = Settings.XMax;
            yMinLabel.Text = Settings.YMin;
            yMaxLabel.Text = Settings.YMax;

            xMin2D.Text  = (string)Registry.GetValue(_regSaveBase, Settings.XMin2DReg, Settings.XMin2DDefault);
            xMax2D.Text  = (string)Registry.GetValue(_regSaveBase, Settings.XMax2DReg, Settings.XMax2DDefault);
            yMin2D.Text  = (string)Registry.GetValue(_regSaveBase, Settings.YMin2DReg, Settings.YMin2DDefault);
            yMax2D.Text  = (string)Registry.GetValue(_regSaveBase, Settings.YMax2DReg, Settings.YMax2DDefault);
            tMin2D.Text  = (string)Registry.GetValue(_regSaveBase, Settings.Min2DReg, Settings.Min2DDefault);
            tMax2D.Text  = (string)Registry.GetValue(_regSaveBase, Settings.Max2DReg, Settings.Max2DDefault);
            tStep2D.Text = (string)Registry.GetValue(_regSaveBase, Settings.Step2DReg, Settings.Step2DDefault);

            xMin2DLabel.Text  = Settings.XMin2D;
            xMax2DLabel.Text  = Settings.XMax2D;
            yMin2DLabel.Text  = Settings.YMin2D;
            yMax2DLabel.Text  = Settings.YMax2D;
            tMin2DLabel.Text  = Settings.Min2D;
            tMax2DLabel.Text  = Settings.Max2D;
            tStep2DLabel.Text = Settings.Step2D;

            uMin.Text  = (string)Registry.GetValue(_regSaveBase, Settings.UMinReg, Settings.UMinDefault);
            uMax.Text  = (string)Registry.GetValue(_regSaveBase, Settings.UMaxReg, Settings.UMaxDefault);
            uGrid.Text = (string)Registry.GetValue(_regSaveBase, Settings.UGridReg, Settings.UGridDefault);
            vMin.Text  = (string)Registry.GetValue(_regSaveBase, Settings.VMinReg, Settings.VMinDefault);
            vMax.Text  = (string)Registry.GetValue(_regSaveBase, Settings.VMaxReg, Settings.VMaxDefault);
            vGrid.Text = (string)Registry.GetValue(_regSaveBase, Settings.VGridReg, Settings.VGridDefault);

            uMinLabel.Text  = Settings.UMin;
            uMaxLabel.Text  = Settings.UMax;
            uGridLabel.Text = Settings.UGrid;
            vMinLabel.Text  = Settings.VMin;
            vMaxLabel.Text  = Settings.VMax;
            vGridLabel.Text = Settings.VGrid;

            y.Text  = (string)Registry.GetValue(_regSaveBase, Settings.YReg, Settings.YDefault);
            xt.Text = (string)Registry.GetValue(_regSaveBase, Settings.XtReg, Settings.XtDefault);
            yt.Text = (string)Registry.GetValue(_regSaveBase, Settings.YtReg, Settings.YtDefault);
            fx.Text = (string)Registry.GetValue(_regSaveBase, Settings.FxReg, Settings.FxDefault);
            fy.Text = (string)Registry.GetValue(_regSaveBase, Settings.FyReg, Settings.FyDefault);
            fz.Text = (string)Registry.GetValue(_regSaveBase, Settings.FzReg, Settings.FzDefault);

            yLabel.Text  = Settings.Y;
            xtLabel.Text = Settings.Xt;
            ytLabel.Text = Settings.Yt;
            fxLabel.Text = Settings.Fx;
            fyLabel.Text = Settings.Fy;
            fzLabel.Text = Settings.Fz;
        }
Exemple #4
0
        private void OnLoaded(object sender, EventArgs args)
        {
            immediate.Focus();
            _viewport = new Viewport3D();
            _trackball = new Trackball();
            _trackball.Servants.Add(_viewport);
            _trackball.Attach(screen);
            _trackball.Enabled = true;

            graphNone.Header = Settings.FunctionNone;
            graph.Header = Settings.Function;
            graph2D.Header = Settings.Function2D;
            graph3D.Header = Settings.Function3D;
            graphOptions.Header = Settings.Function;
            graphOptions2D.Header = Settings.Function2D;
            graphOptions3D.Header = Settings.Function3D;

            // Workaround for registry bug (key base must exist before getting values - else default won't work)
            Registry.SetValue(_regSaveBase, "Version", "GraphCalc v.1.0", RegistryValueKind.String);

            xMin.Text = (string) Registry.GetValue(_regSaveBase, Settings.XMinReg, Settings.XMinDefault);
            xMax.Text = (string) Registry.GetValue(_regSaveBase, Settings.XMaxReg, Settings.XMaxDefault);
            yMin.Text = (string) Registry.GetValue(_regSaveBase, Settings.YMinReg, Settings.YMinDefault);
            yMax.Text = (string) Registry.GetValue(_regSaveBase, Settings.YMaxReg, Settings.YMaxDefault);

            xMinLabel.Text = Settings.XMin;
            xMaxLabel.Text = Settings.XMax;
            yMinLabel.Text = Settings.YMin;
            yMaxLabel.Text = Settings.YMax;

            xMin2D.Text = (string) Registry.GetValue(_regSaveBase, Settings.XMin2DReg, Settings.XMin2DDefault);
            xMax2D.Text = (string) Registry.GetValue(_regSaveBase, Settings.XMax2DReg, Settings.XMax2DDefault);
            yMin2D.Text = (string) Registry.GetValue(_regSaveBase, Settings.YMin2DReg, Settings.YMin2DDefault);
            yMax2D.Text = (string) Registry.GetValue(_regSaveBase, Settings.YMax2DReg, Settings.YMax2DDefault);
            tMin2D.Text = (string) Registry.GetValue(_regSaveBase, Settings.Min2DReg, Settings.Min2DDefault);
            tMax2D.Text = (string) Registry.GetValue(_regSaveBase, Settings.Max2DReg, Settings.Max2DDefault);
            tStep2D.Text = (string) Registry.GetValue(_regSaveBase, Settings.Step2DReg, Settings.Step2DDefault);

            xMin2DLabel.Text = Settings.XMin2D;
            xMax2DLabel.Text = Settings.XMax2D;
            yMin2DLabel.Text = Settings.YMin2D;
            yMax2DLabel.Text = Settings.YMax2D;
            tMin2DLabel.Text = Settings.Min2D;
            tMax2DLabel.Text = Settings.Max2D;
            tStep2DLabel.Text = Settings.Step2D;

            uMin.Text = (string) Registry.GetValue(_regSaveBase, Settings.UMinReg, Settings.UMinDefault);
            uMax.Text = (string) Registry.GetValue(_regSaveBase, Settings.UMaxReg, Settings.UMaxDefault);
            uGrid.Text = (string) Registry.GetValue(_regSaveBase, Settings.UGridReg, Settings.UGridDefault);
            vMin.Text = (string) Registry.GetValue(_regSaveBase, Settings.VMinReg, Settings.VMinDefault);
            vMax.Text = (string) Registry.GetValue(_regSaveBase, Settings.VMaxReg, Settings.VMaxDefault);
            vGrid.Text = (string) Registry.GetValue(_regSaveBase, Settings.VGridReg, Settings.VGridDefault);

            uMinLabel.Text = Settings.UMin;
            uMaxLabel.Text = Settings.UMax;
            uGridLabel.Text = Settings.UGrid;
            vMinLabel.Text = Settings.VMin;
            vMaxLabel.Text = Settings.VMax;
            vGridLabel.Text = Settings.VGrid;

            y.Text = (string) Registry.GetValue(_regSaveBase, Settings.YReg, Settings.YDefault);
            xt.Text = (string) Registry.GetValue(_regSaveBase, Settings.XtReg, Settings.XtDefault);
            yt.Text = (string) Registry.GetValue(_regSaveBase, Settings.YtReg, Settings.YtDefault);
            fx.Text = (string) Registry.GetValue(_regSaveBase, Settings.FxReg, Settings.FxDefault);
            fy.Text = (string) Registry.GetValue(_regSaveBase, Settings.FyReg, Settings.FyDefault);
            fz.Text = (string) Registry.GetValue(_regSaveBase, Settings.FzReg, Settings.FzDefault);

            yLabel.Text = Settings.Y;
            xtLabel.Text = Settings.Xt;
            ytLabel.Text = Settings.Yt;
            fxLabel.Text = Settings.Fx;
            fyLabel.Text = Settings.Fy;
            fzLabel.Text = Settings.Fz;
        }