Exemple #1
0
        private void fontToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form tmp = this.ActiveMdiChild;

            if (tmp == null)
            {
                return;
            }

            if (tmp is RtfEditor)
            {
                RtfEditor rtf = (RtfEditor)tmp;
                fontDialog1.Font = rtf.RtdSelectionFont;
                if (fontDialog1.ShowDialog() == DialogResult.OK)
                {
                    rtf.RtdSelectionFont = fontDialog1.Font;
                }
            }
            else
            {
                TxtEditor txt = (TxtEditor)tmp;
                fontDialog1.Font = txt.TxbSelectionFont;
                if (fontDialog1.ShowDialog() == DialogResult.OK)
                {
                    txt.TxbSelectionFont = fontDialog1.Font;
                }
            }
        }
Exemple #2
0
        private void createNewrtfFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RtfEditor rtf = new RtfEditor()
            {
                MdiParent = this
            };

            rtf.Show();
            rtf.GetSetRtdFont   = new Font("Times New Roman", 12);
            tscbFontStyles.Text = rtf.RtdFontName;
            tscbFontSize.Text   = rtf.RtdFontSize.ToString();
        }
Exemple #3
0
        private void openrtfFilesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RtfEditor rtf = new RtfEditor()
            {
                MdiParent = this
            };

            if (rtf.OpenFile() == DialogResult.OK)
            {
                rtf.Show();
                tscbFontStyles.Text = rtf.RtdFontName;
                tscbFontSize.Text   = rtf.RtdFontSize.ToString();
            }
        }
Exemple #4
0
        private void bPodcherk_Click(object sender, EventArgs e)
        {
            Form tmp = this.ActiveMdiChild;

            if (tmp is RtfEditor)
            {
                RtfEditor rtf = (RtfEditor)tmp;
                rtf.Podcherk_Click();
            }
            else
            {
                TxtEditor txt = (TxtEditor)tmp;
                txt.Podcherk_Click();
            }
        }
Exemple #5
0
        private void tscbFontSize_SelectedIndexChanged(object sender, EventArgs e)
        {
            Form tmp = this.ActiveMdiChild;

            if (tmp is RtfEditor)
            {
                RtfEditor rtf = (RtfEditor)tmp;
                if (tscbFontStyles.SelectedIndex != -1 && tscbFontSize.SelectedIndex != -1)
                {
                    rtf.RtdSelectionFont = new Font(tscbFontStyles.SelectedItem.ToString(), int.Parse(tscbFontSize.SelectedItem.ToString()), rtf.RdtStyle);
                }
            }
            else
            {
                TxtEditor txt = (TxtEditor)tmp;
                if (tscbFontStyles.SelectedIndex != -1 && tscbFontSize.SelectedIndex != -1)
                {
                    txt.TxbSelectionFont = new Font(tscbFontStyles.SelectedItem.ToString(), int.Parse(tscbFontSize.SelectedItem.ToString()), txt.TxbStyle);
                }
            }
        }
Exemple #6
0
        private void colorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form tmp = this.ActiveMdiChild;

            if (tmp is RtfEditor)
            {
                RtfEditor rtf = (RtfEditor)tmp;
                colorDialog1.Color = rtf.GetSetRtdSelectionColor;
                if (colorDialog1.ShowDialog() == DialogResult.OK)
                {
                    rtf.GetSetRtdSelectionColor = colorDialog1.Color;
                }
            }
            else
            {
                TxtEditor txt = (TxtEditor)tmp;
                colorDialog1.Color = txt.GetSetTxtColor;
                if (colorDialog1.ShowDialog() == DialogResult.OK)
                {
                    txt.GetSetTxtColor = colorDialog1.Color;
                }
            }
        }