示例#1
0
        public void Import(ConfigNode data)
        {
            CommonOptions opt = GEnv.Options;

            _fontName = data["font-name"];
            if (_fontName == null)
            {
                _fontName = opt.FontName;
            }
            _japaneseFontName = data["japanese-font-name"];
            if (_japaneseFontName == null)
            {
                _japaneseFontName = opt.JapaneseFontName;
            }
            _fontSize     = (float)GUtil.ParseInt(data["font-size"], 10);
            _useClearType = GUtil.ParseBool(data["clear-type"], false);
            ClearFont();

            unchecked {
                _forecolor = Color.FromArgb(GUtil.ParseHexInt(data["fore-color"], (int)0xFF000000));
                _bgcolor   = Color.FromArgb(GUtil.ParseHexInt(data["back-color"], (int)0xFFFFFFFF));
            }
            if (_esColorSet == null)
            {
                _esColorSet = (EscapesequenceColorSet)opt.ESColorSet.Clone();
            }
            _esColorSet.Load(data["color-sequence"]);
            ClearBrush();

            _backgroundImageFileName = data["image-file"];
            _imageLoadIsAttempted    = false;
            _imageStyle = (ImageStyle)EnumDescAttribute.For(typeof(ImageStyle)).FromName(data["bg-style"], ImageStyle.Center);
        }
示例#2
0
        public object Clone()
        {
            EscapesequenceColorSet newval = new EscapesequenceColorSet();

            for (int i = 0; i < _colors.Length; i++)
            {
                newval._colors[i] = _colors[i];
            }
            newval._isDefault = _isDefault;
            return(newval);
        }
示例#3
0
        private void Init(CommonOptions opt)
        {
            _fontName         = opt.FontName;
            _japaneseFontName = opt.JapaneseFontName;
            _fontSize         = opt.FontSize;
            _useClearType     = opt.UseClearType;
            _japaneseFont     = _font = null;
            _esColorSet       = (EscapesequenceColorSet)opt.ESColorSet.Clone();

            _forecolor = opt.TextColor;
            _bgcolor   = opt.BGColor;
            _bgbrush   = _brush = null;

            _backgroundImageFileName = opt.BackgroundImageFileName;
            _imageLoadIsAttempted    = false;
            _imageStyle = opt.ImageStyle;
        }
        public EditEscapeSequenceColor(Color back, Color fore, EscapesequenceColorSet cs)
        {
            //
            // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B
            //
            InitializeComponent();

            //
            // TODO: InitializeComponent �Ăяo���̌�ɁA�R���X�g���N�^ �R�[�h��lj����Ă��������B
            //
            _colorBoxes = new ColorButton[8];
            _backColor = back;
            _foreColor = fore;
            _esColorSet = (EscapesequenceColorSet)cs.Clone();
            int ti = 0;

            int y = 8;
            AddBackColorUI(y, ref ti);
            y += 24;

            for(int i=-1; i<8; i++) {
                AddUI(i, y, ref ti); //-1�̓f�t�H���g�F�ݒ�
                y += 24;
            }

            y += 8;
            _setDefaultButton = new Button();
            _setDefaultButton.Left = 106;
            _setDefaultButton.Width = 144;
            _setDefaultButton.Click += new EventHandler(OnSetDefault);
            _setDefaultButton.Text = GApp.Strings.GetString("Form.EditEscapesequenceColor._setDefaultButton");
            _setDefaultButton.Top = y;
            _setDefaultButton.TabIndex = ti++;
            _setDefaultButton.FlatStyle = FlatStyle.System;
            this.Controls.Add(_setDefaultButton);

            y += 32;
            _okButton.Text = GApp.Strings.GetString("Common.OK");
            _okButton.Top = y;
            _cancelButton.Text = GApp.Strings.GetString("Common.Cancel");
            _cancelButton.Top = y;
            this.Text = GApp.Strings.GetString("Form.EditEscapesequenceColor.Text");

            this.ClientSize = new Size(this.ClientSize.Width, y + 32);
        }
示例#5
0
        /// <summary>
        /// <ja>コピーして作成します。</ja>
        /// <en>Initializes with another instance.</en>
        /// </summary>
        public RenderProfile(RenderProfile src)
        {
#if !MACRODOC
            _fontName         = src._fontName;
            _japaneseFontName = src._japaneseFontName;
            _fontSize         = src._fontSize;
            _useClearType     = src._useClearType;
            _japaneseFont     = _font = null;

            _forecolor  = src._forecolor;
            _bgcolor    = src._bgcolor;
            _esColorSet = (EscapesequenceColorSet)src._esColorSet.Clone();
            _bgbrush    = _brush = null;

            _backgroundImageFileName = src._backgroundImageFileName;
            _imageLoadIsAttempted    = false;
            _imageStyle = src.ImageStyle;
#endif
        }
示例#6
0
        /// <summary>
        /// <ja>�R�s�[���č쐬���܂��B</ja>
        /// <en>Initializes with another instance.</en>
        /// </summary>
        public RenderProfile(RenderProfile src)
        {
            #if !MACRODOC
            _fontName = src._fontName;
            _japaneseFontName = src._japaneseFontName;
            _fontSize = src._fontSize;
            _useClearType = src._useClearType;
            _japaneseFont = _font = null;

            _forecolor = src._forecolor;
            _bgcolor = src._bgcolor;
            _esColorSet = (EscapesequenceColorSet)src._esColorSet.Clone();
            _bgbrush = _brush = null;

            _backgroundImageFileName = src._backgroundImageFileName;
            _imageLoadIsAttempted = false;
            _imageStyle = src.ImageStyle;
            #endif
        }
示例#7
0
 public object Clone()
 {
     EscapesequenceColorSet newval = new EscapesequenceColorSet();
     for(int i=0; i<_colors.Length; i++)
         newval._colors[i] = _colors[i];
     newval._isDefault = _isDefault;
     return newval;
 }
示例#8
0
        private void Init(CommonOptions opt)
        {
            //�N���̍������̂��߁A�t�H���g�̍쐬�͒x���]��
            _fontName = opt.FontName;
            _japaneseFontName = opt.JapaneseFontName;
            _fontSize = opt.FontSize;
            _useClearType = opt.UseClearType;
            _japaneseFont = _font = null;
            _esColorSet = (EscapesequenceColorSet)opt.ESColorSet.Clone();

            _forecolor = opt.TextColor;
            _bgcolor = opt.BGColor;
            _bgbrush = _brush = null;

            _backgroundImageFileName = opt.BackgroundImageFileName;
            _imageLoadIsAttempted = false;
            _imageStyle = opt.ImageStyle;
        }
示例#9
0
        public void Import(ConfigNode data)
        {
            CommonOptions opt = GEnv.Options;
            _fontName = data["font-name"];
            if(_fontName==null) _fontName = opt.FontName;
            _japaneseFontName = data["japanese-font-name"];
            if(_japaneseFontName==null) _japaneseFontName = opt.JapaneseFontName;
            _fontSize = (float)GUtil.ParseInt(data["font-size"], 10);
            _useClearType = GUtil.ParseBool(data["clear-type"], false);
            ClearFont();

            unchecked {
                _forecolor = Color.FromArgb(GUtil.ParseHexInt(data["fore-color"], (int)0xFF000000));
                _bgcolor   = Color.FromArgb(GUtil.ParseHexInt(data["back-color"], (int)0xFFFFFFFF));
            }
            if(_esColorSet==null) _esColorSet = (EscapesequenceColorSet)opt.ESColorSet.Clone();
            _esColorSet.Load(data["color-sequence"]);
            ClearBrush();

            _backgroundImageFileName = data["image-file"];
            _imageLoadIsAttempted = false;
            _imageStyle = (ImageStyle)EnumDescAttribute.For(typeof(ImageStyle)).FromName(data["bg-style"], ImageStyle.Center);
        }
示例#10
0
 private void OnEditColorEscapeSequence(object sender, EventArgs args)
 {
     EditEscapeSequenceColor dlg = new EditEscapeSequenceColor(_fontSample.BackColor, _fontSample.ForeColor, _ESColorSet);
     if(GCUtil.ShowModalDialog(FindForm(), dlg)==DialogResult.OK) {
         _ESColorSet = dlg.Result;
         _bgColorBox.SelectedColor = dlg.GBackColor;
         _textColorBox.SelectedColor = dlg.GForeColor;
         _fontSample.ForeColor = dlg.GForeColor;
         _fontSample.BackColor = dlg.GBackColor;
         _fontSample.Invalidate();
         _bgColorBox.Invalidate();
         _textColorBox.Invalidate();
     }
 }
示例#11
0
        public override void InitUI(ContainerOptions options)
        {
            AdjustFontDescription(options.Font, options.JapaneseFont);
            _fontSample.Font = options.Font;
            _fontSample.BackColor = options.BGColor;
            _fontSample.ForeColor = options.TextColor;
            _fontSample.ClearType = options.UseClearType;
            _fontSample.Invalidate(true);
            _backgroundImageBox.Text = options.BackgroundImageFileName;
            _imageStyleBox.SelectedIndex = (int)options.ImageStyle;
            _bgColorBox.SelectedColor = options.BGColor;
            _textColorBox.SelectedColor =  options.TextColor;
            _caretStyleBox.SelectedIndex = CaretTypeToIndex(options.CaretType);
            _caretSpecifyColor.Checked = !options.CaretColor.IsEmpty;
            _caretBlink.Checked = (options.CaretType & CaretType.Blink)==CaretType.Blink;
            _caretColorBox.SelectedColor =  options.CaretColor;

            _ESColorSet = options.ESColorSet;
            _defaultFileDir = options.DefaultFileDir;
            _useClearType = options.UseClearType;
            _font = options.Font;
            _japaneseFont = options.JapaneseFont;
        }
示例#12
0
 public CommonOptions()
 {
     _esColorSet = new EscapesequenceColorSet();
     if(_configAttributes==null) InitConfigAttributes();
 }