Exemplo n.º 1
0
        /// <summary>
        /// 表示項目の変更をされた
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void objLBItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            int             idx     = objLBItem.SelectedIndex;
            DisplayItemItem strKind = (DisplayItemItem)objLBItem.Items[idx];

            m_correntDItem = m_currentPS.DisplayItems[strKind.Key];

            if (m_correntDItem.BackgroundColorState == DisplayItemColorState.Normal &&
                m_correntDItem.FrontColorState == DisplayItemColorState.Normal)
            {
                ColorCB_BackFrontEnabl(m_correntDItem.boldfaceValid);
            }
            else if (m_correntDItem.BackgroundColorState != DisplayItemColorState.Normal &&
                     m_correntDItem.FrontColorState == DisplayItemColorState.Normal)
            {
                ColorCB_FrontEnablOnly(m_correntDItem.boldfaceValid);
            }
            else if (m_correntDItem.BackgroundColorState == DisplayItemColorState.Normal &&
                     m_correntDItem.FrontColorState != DisplayItemColorState.Normal)
            {
                ColorCB_BackEnablOnly(m_correntDItem.boldfaceValid);
            }

            objCBFront.Refresh();
            objCBBackground.Refresh();
            objPBSampleText.Refresh();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 出力の表示コンボボックスの項目変更
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void objCBPrintSetting_SelectedIndexChanged(object sender, EventArgs e)
        {
            DisplayItemItem dii = (DisplayItemItem)objCBPrintSetting.SelectedItem;

            m_currentOptItem = m_outputItems[dii.Key];
            m_currentOptName = dii.Key;
            m_currentPS      = m_FontAndColor.PrintSettings[dii.Key];

            // リストの作り直し
            objLBItem.Items.Clear();
            foreach (var v in m_currentOptItem)
            {
                objLBItem.Items.Add(new DisplayItemItem(v.Key, v.Value));
            }

            // フォント名のセット
            bool isFind = false;
            int  idxMeiryoUI = 0, i = 0;

            foreach (string fnt in objCBFontKind.Items)
            {
                if (fnt == "Meiryo UI")
                {
                    idxMeiryoUI = i;
                }
                if (fnt == m_currentPS.FontName)
                {
                    isFind = true;
                    objCBFontKind.SelectedIndex = i;
                    break;
                }
                else if (fnt == "MS ゴシック")
                {
                    isFind = true;
                    objCBFontKind.SelectedIndex = i;
                    break;
                }

                ++i;
            }
            if (!isFind)
            {
                objCBFontKind.SelectedIndex = idxMeiryoUI;
            }
            // フォントサイズのセット
            objCBFontSize.Text = m_currentPS.FontSize + "";
            //
            objLBItem.SelectedIndex = 0;
        }
Exemplo n.º 3
0
        /// <summary>
        /// サンプルテキストの表示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void objPBSampleText_Paint(object sender, PaintEventArgs e)
        {
            Brush bgTxtColor = Brushes.White;
            Brush frTxtColor = Brushes.Black;
            int   type       = 0;
            int   idx        = objLBItem.SelectedIndex;

            if (idx < 0)
            {
                return;
            }
            DisplayItemItem strKind   = (DisplayItemItem)objLBItem.Items[idx];
            string          sampleTxt = "ij = I::oO(0xB81l)";
            var             g         = e.Graphics;
            Rectangle       r         = objPBSampleText.ClientRectangle;

            r.Width  -= 1;
            r.Height -= 1;
            //----------------------
            // 枠の色
            //----------------------
            Pen pen = new Pen(Color.Gray, 1);

            switch (strKind.Key)
            {
            // 前景のみ
            case "CompileError":
            case "SyntaxError":
                type       = 1;
                frTxtColor = new SolidBrush(m_correntDItem.FrontColor);
                break;

            // 背景のみ
            case "SelectedText":
            case "TextNotSelectedActive":
            case "IndicatorMargin":
                bgTxtColor = new SolidBrush(m_correntDItem.BackgroundColor);
                break;

            default:
                type       = 0;
                bgTxtColor = new SolidBrush(m_correntDItem.BackgroundColor);
                frTxtColor = new SolidBrush(m_correntDItem.FrontColor);
                break;
            }

            //----------------------
            // 背景色
            //----------------------
            g.FillRectangle(bgTxtColor, objPBSampleText.ClientRectangle);
            g.DrawRectangle(pen, r);
            //----------------------
            // 文字
            //----------------------
            //Fontを作成
            Font fnt = new Font(m_currentPS.FontName, m_currentPS.FontSize);
            //StringFormatを作成
            StringFormat sf = new StringFormat();

            sf.LineAlignment = StringAlignment.Center;
            sf.Alignment     = StringAlignment.Center;
            r.X      = -100;
            r.Y      = 0;
            r.Width  = 431;
            r.Height = 54;
            //文字を書く
            switch (type)
            {
            case 0:
                g.DrawString(sampleTxt, fnt, frTxtColor, r, sf);
                break;

            case 1:
                UtilLine.DrawTextWaveLine(g, new Pen(frTxtColor, 1), sampleTxt, fnt, Brushes.Black, r, sf);
                break;

            case 2:
                UtilLine.DrawTextWaveLine(g, new Pen(frTxtColor, 1), sampleTxt, fnt, Brushes.Black, r, sf);
                break;
            }

            //g.MeasureString
            //リソースを解放する
            fnt.Dispose();
        }
Exemplo n.º 4
0
        private void objLBItemAdd(string txt, string key)
        {
            DisplayItemItem item = new DisplayItemItem(txt, key);

            objLBItem.Items.Add(item);
        }