Beispiel #1
0
        public axVisUtils.Styles.objStyleBrush createBrush()
        {
            objStyleBrush b1      = new objStyleBrush();
            long          opacity = Convert.ToInt64(tbOpacity.Enabled ? 255 & (int)(tbOpacity.Value * 255 / 100d) : 0);

            if (checkBox1.Enabled && checkBox1.Checked || tbOpacity.Enabled)
            {
                b1.bgColor = Convert.ToUInt32(
                    panel4.BackColor.R +
                    (panel4.BackColor.G << 8) +
                    (panel4.BackColor.B << 16) +
                    (opacity << 24));
            }
            else
            {
                b1.bgColor = 0xffffffff;
            }

            b1.fgColor = Convert.ToUInt32(
                panel5.BackColor.R +
                (panel5.BackColor.G << 8) +
                (panel5.BackColor.B << 16));
            if (ibContainer.selectedBrush != null)
            {
                b1.Style = (ushort)ibContainer.selectedBrush.style;
                b1.Hatch = (ushort)ibContainer.selectedBrush.hatch;
            }
            return(b1);
        }
        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);
        }