Exemplo n.º 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;
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
            }
        }