예제 #1
0
 public void UpdateEditorBounds()
 {
     if (CurrentEditor != null)
     {
         EditorContext context = new EditorContext();
         context.Owner = CurrentEditorOwner;
         context.CurrentNode = CurrentNode;
         context.Editor = CurrentEditor;
         context.DrawContext = _measureContext;
         SetEditorBounds(context);
     }
 }
예제 #2
0
 private void SetEditorBounds(EditorContext context)
 {
     foreach (NodeControlInfo info in GetNodeControls(context.CurrentNode))
        {
     if (context.Owner == info.Control && info.Control is EditableControl)
     {
      Point p = info.Bounds.Location;
      p.X += info.Control.LeftMargin;
      p.X -= OffsetX;
      p.Y -= (_rowLayout.GetRowBounds(FirstVisibleRow).Y - ColumnHeaderHeight);
      int width = DisplayRectangle.Width - p.X;
      if (UseColumns && info.Control.ParentColumn != null && Columns.Contains(info.Control.ParentColumn))
      {
       Rectangle rect = GetColumnBounds(info.Control.ParentColumn.Index);
       width = rect.Right - OffsetX - p.X;
      }
      context.Bounds = new Rectangle(p.X, p.Y, width, info.Bounds.Height);
      ((EditableControl)info.Control).SetEditorBounds(context);
      return;
     }
        }
 }
 protected override Size CalculateEditorSize(EditorContext context) {
     return Parent.UseColumns ? context.Bounds.Size : new Size(EditorWidth, context.Bounds.Height);
 }
예제 #4
0
 protected override Size CalculateEditorSize(EditorContext context)
 {
     throw new Exception("The method or operation is not implemented.");
 }
예제 #5
0
 public void UpdateEditorBounds()
 {
     if (_currentEditor != null)
     {
         EditorContext context = new EditorContext();
         context.Owner = _currentEditorOwner;
         context.CurrentNode = CurrentNode;
         context.Editor = _currentEditor;
         SetEditorBounds(context);
     }
 }
예제 #6
0
        public void DisplayEditor(Control control, EditableControl owner)
        {
            if (control == null || owner == null)
                throw new ArgumentNullException();

            if (CurrentNode != null)
            {
                DisposeEditor();
                EditorContext context = new EditorContext();
                context.Owner = owner;
                context.CurrentNode = CurrentNode;
                context.Editor = control;

                SetEditorBounds(context);

                _currentEditor = control;
                _currentEditorOwner = owner;
                UpdateView();
                control.Parent = this;
                control.Focus();
                owner.UpdateEditor(control);
            }
        }
예제 #7
0
 private void SetEditorBounds(EditorContext context)
 {
     foreach (NodeControlInfo info in GetNodeControls(context.CurrentNode))
     {
         if (context.Owner == info.Control && info.Control is EditableControl)
         {
             Point p = ToViewLocation(info.Bounds.Location);
             int width = DisplayRectangle.Width - p.X;
             if (UseColumns && info.Control.Column < Columns.Count)
             {
                 Rectangle rect = GetColumnBounds(info.Control.Column);
                 width = rect.Right - OffsetX - p.X;
             }
             context.Bounds = new Rectangle(p.X, p.Y, width, info.Bounds.Height);
             ((EditableControl)info.Control).SetEditorBounds(context);
             return;
         }
     }
 }
예제 #8
0
		public void UpdateEditorBounds()
		{
			if (_currentEditor != null)
			{
				EditorContext context = new EditorContext
				{
				    Owner = this._currentEditorOwner, 
                    CurrentNode = this.CurrentNode, 
                    Editor = this._currentEditor, 
                    DrawContext = this._measureContext
				};

			    SetEditorBounds(context);
			}
		}