Example #1
0
        public VisualEditEx(string strOld, StringBuilder newString, SqlConnection Conn, Form parentForm, string RootDir, bool bImageSupport, int nDefFont)
        {
            InitializeComponent();

            m_bImageSupport = bImageSupport;
            Code = strOld;
            m_Root = RootDir;
            m_newString = newString;
            m_nDefFont = nDefFont;

            font = new FontHelper(m_Root + FontFile, m_Root + FontListFile, m_Root + ColorFile, m_Root);

            string[] FontNames = font.GetAllFontName();

            
            foreach (string strName in FontNames)
            {
                FontBox.Items.Add(strName);
            }
            FontBox.Items.Add("默认(" + m_nDefFont.ToString() +" )");

            m_nLastLength = 0;
            MarkArray = new ArrayList();
            ImageArray = new ArrayList();

            defFont = font.GetFontByID(m_nDefFont);
            defColor = font.GetColorByID(m_nDefFont);
            textBox.SelectionFont = defFont;
            textBox.SelectionColor = defColor;

            refreshText();
        }
Example #2
0
        public VisualEditLibEx(SqlConnection Conn, Class1 parentClass, string tabName, string RootDir, bool bImageSupport, int nFont)
        {
            InitializeComponent();

            m_bImageSupport = bImageSupport;
            m_Root = RootDir;
            m_bHasChanged = false;
            m_Parent = parentClass;
            m_strTabName = tabName;
            m_Conn = Conn;
            m_nDefFont = nFont;

            font = new FontHelper(m_Root + FontFile, m_Root + FontListFile, m_Root + ColorFile, m_Root);

            string[] FontNames = font.GetAllFontName();

            
            foreach (string strName in FontNames)
            {
                FontBox.Items.Add(strName);
            }
            FontBox.Items.Add("默认(" + m_nDefFont.ToString() + ")");

            m_nLastLength = 0;
            MarkArray = new ArrayList();
            ImageArray = new ArrayList();
            LinkArray = new ArrayList();

            defFont = font.GetFontByID(m_nDefFont);
            defColor = font.GetColorByID(m_nDefFont);
            textBox.SelectionColor = defColor;
            textBox.SelectionFont = defFont;

            textBox.Enabled = false;
            linkBox.Enabled = false;

            refreshText();
        }