Beispiel #1
0
        public axVisUtils.Styles.objStyleFont createFont()
        {
            objStyleFont f1 = new objStyleFont();

            f1.Color = Convert.ToUInt32(
                panel2.BackColor.R +
                (panel2.BackColor.G << 8) +
                (panel2.BackColor.B << 16));
            f1.FrameColor = Convert.ToUInt32(
                panel1.BackColor.R +
                (panel1.BackColor.G << 8) +
                (panel1.BackColor.B << 16));
            if (!textBox2.Text.Equals(""))
            {
                f1.FontName = textBox2.Text;
                f1.Size     = Convert.ToInt32(textBox1.Text);
            }
            return(f1);
        }
        public void saveStyle(Rekod.DBTablesEdit.StyleControl sc)
        {
            objStyleBrush  brush1  = sc.createBrush();
            objStyleFont   font1   = sc.createFont();
            objStylePen    pen1    = sc.createPen();
            objStyleSymbol symb1   = sc.createSymbol();
            string         bgColor = "";

            if (sc.checkBox1.Enabled && !sc.checkBox1.Checked)
            {
                bgColor = "4294967295";
            }
            else
            {
                bgColor = brush1.bgColor.ToString();
            }
            SqlWork sqlCmd = new SqlWork();

            sqlCmd.sql = "UPDATE " + Program.scheme + ".table_info SET fontname = '" + font1.FontName + "', " +
                         "fontcolor = " + font1.Color.ToString() + ", " +
                         "fontframecolor = " + font1.FrameColor.ToString() + ", " +
                         "fontsize = " + font1.Size.ToString() + ", " +
                         "symbol = " + symb1.Shape.ToString() + ", " +
                         "pencolor = " + pen1.Color.ToString() + ", " +
                         "pentype = " + pen1.Type.ToString() + ", " +
                         "penwidth = " + pen1.Width.ToString() + ", " +
                         "brushbgcolor = " + bgColor + ", " +
                         "brushfgcolor = " + brush1.fgColor.ToString() + ", " +
                         "brushstyle = " + brush1.Style.ToString() + ", " +
                         "brushhatch = " + brush1.Hatch.ToString() + " WHERE id = " + id.ToString();
            sqlCmd.Execute(true);
            sqlCmd.Close();
            sqlCmd     = new SqlWork();
            sqlCmd.sql = "UPDATE " + Program.scheme + ".table_info SET default_style = true WHERE id = " + id.ToString();
            sqlCmd.Execute(true);
            sqlCmd.Close();

            DBTablesEdit.SyncController.ReloadStyle(id);
        }