예제 #1
0
        private void fillFontSelector()
        {
            cBFont.Items.Clear();
            cBFont.Items.AddRange(GCodeFromFont.getHersheyFontNames());
            cBFont.Items.AddRange(GCodeFromFont.fontFileName());

            int tmpIndex = Properties.Settings.Default.createTextFontIndex;

            if (tmpIndex < cBFont.Items.Count)
            {
                cBFont.SelectedIndex = Properties.Settings.Default.createTextFontIndex;
            }
        }
예제 #2
0
        private void TextForm_Load(object sender, EventArgs e)
        {
            cBFont.Items.AddRange(GCodeFromFont.fontNames);
            cBFont.Items.AddRange(GCodeFromFont.fontFileName());

            cBFont.SelectedIndex = Properties.Settings.Default.textFontIndex;
            tBText.Text          = Properties.Settings.Default.textFontText;
            nUDFontSize.Value    = Properties.Settings.Default.textFontSize;

            Location = Properties.Settings.Default.locationTextForm;
            Size desktopSize = System.Windows.Forms.SystemInformation.PrimaryMonitorSize;

            if ((Location.X < -20) || (Location.X > (desktopSize.Width - 100)) || (Location.Y < -20) || (Location.Y > (desktopSize.Height - 100)))
            {
                Location = new Point(0, 0);
            }
            getSettings();
        }
예제 #3
0
        private void TextForm_Load(object sender, EventArgs e)
        {
            cBFont.Items.AddRange(GCodeFromFont.getHersheyFontNames());
            cBFont.Items.AddRange(GCodeFromFont.fontFileName());

            cBFont.SelectedIndex = Properties.Settings.Default.createTextFontIndex;

            Location = Properties.Settings.Default.locationTextForm;
            Size desktopSize = System.Windows.Forms.SystemInformation.PrimaryMonitorSize;

            if ((Location.X < -20) || (Location.X > (desktopSize.Width - 100)) || (Location.Y < -20) || (Location.Y > (desktopSize.Height - 100)))
            {
                CenterToScreen();
            }

            int      toolCount = toolTable.init();
            toolProp tmpTool;
            bool     defaultToolFound = false;

            for (int i = 0; i < toolCount; i++)
            {
                tmpTool = toolTable.getToolProperties(i);
                if (i == tmpTool.toolnr)
                {
                    cBTool.Items.Add(i.ToString() + ") " + tmpTool.name);
                    if (i == Properties.Settings.Default.importGCToolDefNr)
                    {
                        cBTool.SelectedIndex = cBTool.Items.Count - 1;
                        defaultToolFound     = true;
                    }
                }
            }
            if (!defaultToolFound)
            {
                cBTool.SelectedIndex = 0;
            }
            cBToolTable_CheckedChanged(sender, e);

            nUDFontSize.Value     = Properties.Settings.Default.createTextFontSize;
            nUDFontLine.Value     = Properties.Settings.Default.createTextLineDistance;
            nUDFontDistance.Value = Properties.Settings.Default.createTextFontDistance;
        }
예제 #4
0
        //        private static bool gcodePenIsUp = false;
        private void TextForm_Load(object sender, EventArgs e)
        {
            cBFont.Items.AddRange(GCodeFromFont.fontNames);
            cBFont.Items.AddRange(GCodeFromFont.fontFileName());

            cBFont.SelectedIndex = Properties.Settings.Default.textFontIndex;
            tBText.Text          = Properties.Settings.Default.textFontText;
            nUDFontSize.Value    = Properties.Settings.Default.textFontSize;

            Location = Properties.Settings.Default.locationTextForm;
            Size desktopSize = System.Windows.Forms.SystemInformation.PrimaryMonitorSize;

            if ((Location.X < -20) || (Location.X > (desktopSize.Width - 100)) || (Location.Y < -20) || (Location.Y > (desktopSize.Height - 100)))
            {
                Location = new Point(0, 0);
            }
            getSettings();

            int      toolCount = toolTable.init();
            toolProp tmpTool;
            bool     defaultToolFound = false;

            for (int i = 0; i < toolCount; i++)
            {
                tmpTool = toolTable.getToolProperties(i);
                if (i == tmpTool.toolnr)
                {
                    cBTool.Items.Add(i.ToString() + ") " + tmpTool.name);
                    if (i == Properties.Settings.Default.importGCToolDefNr)
                    {
                        cBTool.SelectedIndex = cBTool.Items.Count - 1;
                        defaultToolFound     = true;
                    }
                }
            }
            if (!defaultToolFound)
            {
                cBTool.SelectedIndex = 0;
            }
        }