コード例 #1
0
ファイル: EditBox.cs プロジェクト: sionhannuna/rcdeskpilot
        /// <summary>Creates a new edit box control</summary>
        public EditBox(Dialog parent)
            : base(parent)
        {
            controlType  = ControlType.EditBox;
            parentDialog = parent;

            border    = 5; // Default border
            spacing   = 4; // default spacing
            isCaretOn = true;

            textData = new System.Windows.Forms.RichTextBox();
            // Create the control
            textData.Visible    = true;
            textData.Font       = new System.Drawing.Font("Arial", 8.0f);
            textData.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
            textData.Multiline  = false;
            textData.Text       = string.Empty;
            textData.MaxLength  = ushort.MaxValue; // 65k characters should be plenty
            textData.WordWrap   = false;
            // Now create the control
            textData.CreateControl();

            isHidingCaret     = false;
            firstVisible      = 0;
            blinkTime         = NativeMethods.GetCaretBlinkTime() * 0.001f;
            lastBlink         = FrameworkTimer.GetAbsoluteTime();
            textColor         = new ColorValue(0.06f, 0.06f, 0.06f, 1.0f);
            selectedTextColor = new ColorValue(1.0f, 1.0f, 1.0f, 1.0f);
            selectedBackColor = new ColorValue(0.15f, 0.196f, 0.36f, 1.0f);
            caretColor        = new ColorValue(0, 0, 0, 1.0f);
            caretPosition     = textData.SelectionStart = 0;
            isInsertMode      = true;
            isMouseDragging   = false;
        }
コード例 #2
0
ファイル: dxmutgui.cs プロジェクト: JeremiahZhang/AKA
        protected System.Drawing.Rectangle textRect; // Bounding rectangle for the text

        #endregion Fields

        #region Constructors

        /// <summary>Creates a new edit box control</summary>
        public EditBox(Dialog parent)
            : base(parent)
        {
            controlType = ControlType.EditBox;
            parentDialog = parent;

            border = 5; // Default border
            spacing = 4; // default spacing
            isCaretOn = true;

            textData = new System.Windows.Forms.RichTextBox();
            // Create the control
            textData.Visible = true;
            textData.Font = new System.Drawing.Font("Arial", 8.0f);
            textData.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
            textData.Multiline = false;
            textData.Text = string.Empty;
            textData.MaxLength = ushort.MaxValue; // 65k characters should be plenty
            textData.WordWrap = false;
            // Now create the control
            textData.CreateControl();

            isHidingCaret = false;
            firstVisible = 0;
            blinkTime = NativeMethods.GetCaretBlinkTime() * 0.001f;
            lastBlink = FrameworkTimer.GetAbsoluteTime();
            textColor = new ColorValue(0.06f, 0.06f, 0.06f, 1.0f);
            selectedTextColor = new ColorValue(1.0f, 1.0f, 1.0f, 1.0f);
            selectedBackColor = new ColorValue(0.15f, 0.196f, 0.36f, 1.0f);
            caretColor = new ColorValue(0, 0, 0, 1.0f);
            caretPosition = textData.SelectionStart = 0;
            isInsertMode = true;
            isMouseDragging = false;
        }