Пример #1
0
        public LetterFormatForm(char letter, int buttonNr, PBDQConfig inPbdqConf)
        {
            logger.ConditionalDebug("CTOR LetterFormatForm");

            InitializeComponent();
            pbdqConf = inPbdqConf;
            CharFormatting cf = pbdqConf.GetCfForPBDQLetter(letter);

            if (!HilightForm.CanOperate())
            {
                // We are not in Word
                btnCouleur.Width = btnCouleur.Width * 2;
                btnSurl.Visible  = false;
                btnSurl.Enabled  = false;
            }
            mcd = new MyColorDialog();
            mcd.CustomColors = StaticColorizControls.customColors;
            mcd.AnyColor     = true;
            mcd.FullOpen     = true;
            colorSet         = true; // Si le bouton "valider" est cliqué, la couleur doit être la couleur mise.
            inCF             = cf;
            theColor         = cf.color;
            mcd.Color        = theColor;
            hilightSet       = cf.changeHilight;
            theHilightColor  = cf.hilightColor;
            bold             = cf.bold;
            italic           = cf.italic;
            underscore       = cf.underline;
            theButtonNr      = buttonNr;

            bHandler = new FormatButtonHandler2(pbxBold, Properties.Resources.Bold, Properties.Resources.BoldSet,
                                                Properties.Resources.BoldPressed, Properties.Resources.BoldSetMouseOn1, SetBold, UnsetBold, bold);
            iHandler = new FormatButtonHandler2(pbxItalic, Properties.Resources.Italic, Properties.Resources.ItalicSet,
                                                Properties.Resources.ItalicPressed, Properties.Resources.ItalicSetOver, SetItalic, UnsetItalic, italic);
            uHandler = new FormatButtonHandler2(pbxUnderscore, Properties.Resources.Underscore, Properties.Resources.UnderscoreSet,
                                                Properties.Resources.UnderscorePressed, Properties.Resources.UnderscoreSetOver, SetUnderscore, UnsetUnderscore, underscore);

            btnCouleur.BackColor = theColor;
            btnSurl.BackColor    = theHilightColor;
            StringBuilder sb = new StringBuilder();
            char          c  = pbdqConf.GetLetterForButtonNr(theButtonNr);

            if (c != ' ')
            {
                sb.Append(pbdqConf.GetLetterForButtonNr(theButtonNr));
            }
            txbLetter.Text = sb.ToString();
        }
Пример #2
0
        private void InitCtor(CharFormatting cf, string theSon,
                              string displayText, SetCharFormResult inCharFormResult)
        {
            logger.ConditionalDebug("InitCtor");

            InitializeComponent();
            if (!HilightForm.CanOperate())
            {
                // We are not in Word
                btnCouleur.Width = 114;
                btnSurl.Visible  = false;
                btnSurl.Enabled  = false;
            }
            mcd = new MyColorDialog();
            mcd.CustomColors = StaticColorizControls.customColors;
            mcd.AnyColor     = true;
            mcd.FullOpen     = true;
            mcd.Color        = cf.color;
            colorSet         = true; // Si le bouton "valider" est cliqué, la couleur doit être la couleur mise.
            inCF             = cf;
            theColor         = cf.color;
            hilightSet       = cf.changeHilight;
            theHilightColor  = cf.hilightColor;
            bold             = cf.bold;
            italic           = cf.italic;
            underscore       = cf.underline;
            son = theSon;

            bHandler = new FormatButtonHandler2(pbxBold, Properties.Resources.Bold, Properties.Resources.BoldSet,
                                                Properties.Resources.BoldPressed, Properties.Resources.BoldSetMouseOn1, SetBold, UnsetBold, bold);
            iHandler = new FormatButtonHandler2(pbxItalic, Properties.Resources.Italic, Properties.Resources.ItalicSet,
                                                Properties.Resources.ItalicPressed, Properties.Resources.ItalicSetOver, SetItalic, UnsetItalic, italic);
            uHandler = new FormatButtonHandler2(pbxUnderscore, Properties.Resources.Underscore, Properties.Resources.UnderscoreSet,
                                                Properties.Resources.UnderscorePressed, Properties.Resources.UnderscoreSetOver, SetUnderscore, UnsetUnderscore, underscore);

            btnCouleur.BackColor = theColor;
            btnSurl.BackColor    = theHilightColor;
            this.Text            = displayText;
            charFormResult       = inCharFormResult;
        }