public override System.Windows.Forms.Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum) { PropInPlaceTextbox edit = null; if (mInPlaceCtrl == null) { edit = new PropInPlaceTextbox(false); edit.Visible = false; edit.Parent = mParentWnd; edit.Multiline = true; mInPlaceCtrl = edit; } else { edit = (PropInPlaceTextbox)mInPlaceCtrl; } NotifyInPlaceControlCreated(propEnum); edit.OwnerPropertyEnumerator = propEnum; edit.Font = propEnum.Property.Value.Font; MoveControl(valueRect, propEnum); if (edit.Focused == false) // are we already being editing ? If yes, don't touch the edit content { if (edit.Text != propEnum.Property.Value.DisplayString) { edit.Text = propEnum.Property.Value.DisplayString; } } return(base.ShowControl(valueRect, propEnum)); }
public override System.Windows.Forms.Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum) { PropInPlaceTextbox edit = null; if (mInPlaceCtrl == null) { edit = new PropInPlaceTextbox(false); edit.Visible = false; edit.Parent = mParentWnd; edit.Multiline = true; mInPlaceCtrl = edit; } else edit = (PropInPlaceTextbox)mInPlaceCtrl; NotifyInPlaceControlCreated(propEnum); edit.OwnerPropertyEnumerator = propEnum; edit.Font = propEnum.Property.Value.Font; MoveControl(valueRect, propEnum); if (edit.Focused == false) // are we already being editing ? If yes, don't touch the edit content { if (edit.Text != propEnum.Property.Value.DisplayString) edit.Text = propEnum.Property.Value.DisplayString; } return base.ShowControl(valueRect, propEnum); }
public PropInPlaceUnit() { _edit = new PropInPlaceTextbox(false); _edit.Parent = this; _edit.TabStop = false; SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | Utilities.DoubleBufferStyle | ControlStyles.Opaque | ControlStyles.ResizeRedraw, true); Cursor = Cursors.Arrow; }
public override Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum) { if (propEnum.Property.Value.ReadOnly) { PropInPlaceTextbox edit; if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceTextbox)) { edit = new PropInPlaceTextbox(false); edit.Visible = false; edit.Parent = mParentWnd; mInPlaceCtrl = edit; } else { edit = (PropInPlaceTextbox)mInPlaceCtrl; } NotifyInPlaceControlCreated(propEnum); edit.OwnerPropertyEnumerator = propEnum; edit.Font = propEnum.Property.Value.Font; // if (edit.Text != propEnum.Property.Value.DisplayString) // edit.Text = propEnum.Property.Value.DisplayString; } else { PropInPlaceDateTime dateTime; if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceDateTime)) { dateTime = new PropInPlaceDateTime(); dateTime.Visible = false; dateTime.Parent = mParentWnd; #if _DOTNET2 dateTime.AutoSize = false; #endif mInPlaceCtrl = dateTime; } else { dateTime = (PropInPlaceDateTime)mInPlaceCtrl; } dateTime.OwnerPropertyEnumerator = propEnum; dateTime.Font = propEnum.Property.Value.Font; // dateTime.Value = (DateTime)propEnum.Property.Value.GetValue(); } MoveControl(valueRect, propEnum); return(base.ShowControl(valueRect, propEnum)); }
public override Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum) { if (propEnum.Property.Value.ReadOnly) { PropInPlaceTextbox edit; if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceTextbox)) { edit = new PropInPlaceTextbox(false); edit.Visible = false; edit.Parent = mParentWnd; mInPlaceCtrl = edit; } else edit = (PropInPlaceTextbox)mInPlaceCtrl; NotifyInPlaceControlCreated(propEnum); edit.OwnerPropertyEnumerator = propEnum; edit.Font = propEnum.Property.Value.Font; // if (edit.Text != propEnum.Property.Value.DisplayString) // edit.Text = propEnum.Property.Value.DisplayString; } else { PropInPlaceDateTime dateTime; if ((mInPlaceCtrl == null) || !(mInPlaceCtrl is PropInPlaceDateTime)) { dateTime = new PropInPlaceDateTime(); dateTime.Visible = false; dateTime.Parent = mParentWnd; #if _DOTNET2 dateTime.AutoSize = false; #endif mInPlaceCtrl = dateTime; } else dateTime = (PropInPlaceDateTime)mInPlaceCtrl; dateTime.OwnerPropertyEnumerator = propEnum; dateTime.Font = propEnum.Property.Value.Font; // dateTime.Value = (DateTime)propEnum.Property.Value.GetValue(); } MoveControl(valueRect, propEnum); return base.ShowControl(valueRect, propEnum); }
public PropInPlaceList(bool editable) { if (editable) { _edit = new PropInPlaceTextbox(false); _edit.LostFocus += new EventHandler(OnChildLostFocus); _edit.Parent = this; _edit.TabStop = false; } SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | Utilities.DoubleBufferStyle | ControlStyles.Opaque | ControlStyles.ResizeRedraw, true); Cursor = Cursors.Arrow; }
public PropInPlaceButton(bool editable) { if (editable) { mEdit = new PropInPlaceTextbox(false); mEdit.Parent = this; mEdit.Text = Text; mEdit.TabStop = false; } SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | Utilities.DoubleBufferStyle | ControlStyles.Opaque | ControlStyles.ResizeRedraw, true); Cursor = Cursors.Arrow; }
public override System.Windows.Forms.Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum) { PropInPlaceTextbox edit; if (mInPlaceCtrl == null) { edit = new PropInPlaceTextbox(_password); edit.Visible = false; if (_password) { edit.PasswordChar = propEnum.Property.ParentGrid.DrawManager.PasswordChar; } edit.Parent = mParentWnd; mInPlaceCtrl = edit; } else { edit = (PropInPlaceTextbox)mInPlaceCtrl; } NotifyInPlaceControlCreated(propEnum); edit.OwnerPropertyEnumerator = propEnum; edit.Font = propEnum.Property.Value.Font; MoveControl(valueRect, propEnum); /* * if (edit.Focused == false) // are we already being editing ? If yes, don't touch the edit content * { * if (edit.PasswordChar != 0) * { * if (edit.Text != propEnum.Property.Value.GetStringValue()) * edit.Text = propEnum.Property.Value.GetStringValue(); * } * else * { * if (edit.Text != propEnum.Property.Value.DisplayString) * edit.Text = propEnum.Property.Value.DisplayString; * } * } */ return(base.ShowControl(valueRect, propEnum)); }
public PropInPlaceColorChooser(bool editable) { if (editable) { _edit = new PropInPlaceTextbox(false); _edit.Parent = this; _edit.Text = Text; _edit.TabStop = false; } _editorService = new EditorService(this); SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.Opaque | ControlStyles.ResizeRedraw, true); Cursor = Cursors.Arrow; }
public override System.Windows.Forms.Control ShowControl(Rectangle valueRect, PropertyEnumerator propEnum) { PropInPlaceTextbox edit; if (mInPlaceCtrl == null) { edit = new PropInPlaceTextbox(_password); edit.Visible = false; if (_password) edit.PasswordChar = propEnum.Property.ParentGrid.DrawManager.PasswordChar; edit.Parent = mParentWnd; mInPlaceCtrl = edit; } else edit = (PropInPlaceTextbox)mInPlaceCtrl; NotifyInPlaceControlCreated(propEnum); edit.OwnerPropertyEnumerator = propEnum; edit.Font = propEnum.Property.Value.Font; MoveControl(valueRect, propEnum); /* if (edit.Focused == false) // are we already being editing ? If yes, don't touch the edit content { if (edit.PasswordChar != 0) { if (edit.Text != propEnum.Property.Value.GetStringValue()) edit.Text = propEnum.Property.Value.GetStringValue(); } else { if (edit.Text != propEnum.Property.Value.DisplayString) edit.Text = propEnum.Property.Value.DisplayString; } } */ return base.ShowControl(valueRect, propEnum); }
public PropInPlaceUITypeEditor(UITypeEditor _editor, bool editable) { this._editor = _editor; if (editable) { _edit = new PropInPlaceTextbox(false); _edit.Parent = this; _edit.Text = Text; _edit.TabStop = false; } _editorService = new EditorService(this); SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | Utilities.DoubleBufferStyle | ControlStyles.Opaque | ControlStyles.ResizeRedraw, true); Cursor = Cursors.Arrow; }