Exemplo n.º 1
0
        public bool setStyles(axVisUtils.Styles.objStylesM style)
        {
            bool rez = true;

            if (!setStyleSymbol(style.SymbolStyle))
            {
                rez = false;
            }

            if (!setStyleFont(style.FontStyle))
            {
                rez = false;
            }
            if (!setStylePen(style.PenStyle))
            {
                rez = false;
            }
            if (!setStyleBrush(style.BrushStyle))
            {
                rez = false;
            }
            if (style.BrushStyle.bgColor == 4294967295)
            {
                checkBox1.Checked = false;
            }
            else
            {
                checkBox1.Checked = true;
            }
            return(rez);
        }
        private axVisUtils.Styles.objStylesM setStyleFromDB(int idT)
        {
            axVisUtils.Styles.objStylesM s1 = new axVisUtils.Styles.objStylesM();

            string sql = "SELECT fontname, fontcolor, fontframecolor, fontsize,";

            sql += " symbol,";
            sql += " pencolor, pentype, penwidth,";
            sql += " brushbgcolor, brushfgcolor, brushstyle, brushhatch";
            sql += " FROM " + Program.scheme + ".table_info WHERE id=" + id.ToString();
            SqlWork sqlCmd = new SqlWork();

            sqlCmd.sql = sql;
            sqlCmd.Execute(false);
            while (sqlCmd.CanRead())
            {
                s1.FontStyle.FontName   = sqlCmd.GetString(0);
                s1.FontStyle.Color      = sqlCmd.GetValue <uint>(1);
                s1.FontStyle.FrameColor = sqlCmd.GetValue <uint>(2);
                s1.FontStyle.Size       = sqlCmd.GetInt32(3);

                s1.SymbolStyle.Shape = sqlCmd.GetValue <uint>(4);

                s1.PenStyle.Color = sqlCmd.GetValue <uint>(5);
                s1.PenStyle.Type  = sqlCmd.GetValue <ushort>(6);
                s1.PenStyle.Width = sqlCmd.GetValue <uint>(7);

                s1.BrushStyle.bgColor = sqlCmd.GetValue <uint>(8);
                s1.BrushStyle.fgColor = sqlCmd.GetValue <uint>(9);
                s1.BrushStyle.Style   = sqlCmd.GetValue <ushort>(10);
                s1.BrushStyle.Hatch   = sqlCmd.GetValue <ushort>(11);
            }
            sqlCmd.Close();
            return(s1);
        }