Exemple #1
0
        private void MainFrame_Load(object sender, EventArgs e)
        {
            // setup initial values
            cube.EnableRedraw       = false;
            menuHilight1.CheckState = CheckState.Unchecked;
            menuHilight2.CheckState = CheckState.Checked;
            menuHilight3.CheckState = CheckState.Unchecked;
            menuHilight4.CheckState = CheckState.Unchecked;
            menuHilight5.CheckState = CheckState.Unchecked;
            menuPuzzle3.Checked     = true;
            cube.EnableRedraw       = true;

            // load all of our macros.
            foreach (var s in cube.GetMacroNames())
            {
                _ = listMacros.Items.Add(s);
            }

            // load all of our saved settings
            GuiSettings defSettings = null;

            foreach (var s in Directory.GetFiles(".", "*.settings"))
            {
                var settings = new GuiSettings();
                settings.Load(s);
                _ = comboSettings.Items.Add(settings);
                if (settings.Name == DefaultSettingsName)
                {
                    defSettings = settings;
                }
            }

            // make sure the "default" settings exist
            if (defSettings == null)
            {
                defSettings = new GuiSettings
                {
                    Name = DefaultSettingsName
                };
                _ = comboSettings.Items.Add(defSettings);
            }

            // select the default settings
            comboSettings.SelectedItem = defSettings;

            // give the draw surface the focus
            DrawSurface.Select();
        }
Exemple #2
0
        public MainFrame(ICube cube)
        {
            InitializeComponent();

            // setup the drawing surface
            DrawSurface = new DrawSurface
            {
                Location = panelMain.Location,
                Size     = panelMain.Size,
                Anchor   = panelMain.Anchor
            };
            Controls.Add(DrawSurface);

            // setup tags for sliders
            track5dDist.Tag            = CubeParameter.Perspective5d;
            track4dDist.Tag            = CubeParameter.Perspective4d;
            traceFaceSeparation.Tag    = CubeParameter.FaceSeparation;
            trackStickerSeparation.Tag = CubeParameter.StickerSeparation;
            trackStickerSize.Tag       = CubeParameter.StickerSize;
            trackRotationRate.Tag      = CubeParameter.RotationRate;
            trackStereoSeparation.Tag  = CubeParameter.StereoSeparation;

            // setup tags for face checkboxes
            checkFace1.Tag  = 0;
            checkFace2.Tag  = 1;
            checkFace3.Tag  = 2;
            checkFace4.Tag  = 3;
            checkFace5.Tag  = 4;
            checkFace6.Tag  = 5;
            checkFace7.Tag  = 6;
            checkFace8.Tag  = 7;
            checkFace9.Tag  = 8;
            checkFace10.Tag = 9;

            // setup tags for rotation buttons
            btnXY.Tag = new Axes(0, 1);
            btnXZ.Tag = new Axes(0, 2);
            btnXU.Tag = new Axes(0, 3);
            btnXV.Tag = new Axes(0, 4);
            btnYZ.Tag = new Axes(1, 2);
            btnYU.Tag = new Axes(1, 3);
            btnYV.Tag = new Axes(1, 4);
            btnZU.Tag = new Axes(2, 3);
            btnZV.Tag = new Axes(2, 4);
            btnUV.Tag = new Axes(3, 4);

            // default rotations to all
            comboFace.SelectedIndex = 10;

            // setup tags for puzzle type.
            menuPuzzle2.Tag = 2;
            menuPuzzle3.Tag = 3;
            menuPuzzle4.Tag = 4;
            menuPuzzle5.Tag = 5;
            menuPuzzle6.Tag = 6;
            menuPuzzle7.Tag = 7;

            // setup tags for highlight items.
            menuHilight1.Tag = 1;
            menuHilight2.Tag = 2;
            menuHilight3.Tag = 3;
            menuHilight4.Tag = 4;
            menuHilight5.Tag = 5;

            // setup tags for scramble menu items.
            menuScramble1.Tag    = 1;
            menuScramble2.Tag    = 2;
            menuScramble3.Tag    = 3;
            menuScramble4.Tag    = 4;
            menuScramble5.Tag    = 5;
            menuScrambleFull.Tag = 100;

            // setup tags for stereo.
            menuStereoNone.Tag            = 0;
            menuStereoCrossEyed.Tag       = 1;
            menuStereoAnaglyph.Tag        = 2;
            menuStereoAnaglyphNoColor.Tag = 3;

            btnStartMacro.Enabled = true;
            btnStopMacro.Enabled  = false;

            this.cube = cube;
        }