private static Rectangle getFieldBounds(FieldControl field, LayoutControl card) { var fieldBounds = field.Bounds; fieldBounds.Offset(card.Location); return(fieldBounds); }
internal void SetCard(LayoutControl card, int rowHandle, object dataSource) { Card = card; RowHandle = rowHandle; CardBounds = card?.Bounds; RowDataSource = dataSource; }
public virtual void CopyFrom(LayoutControl other) { Font = other.Font; Size = other.Size; HighlightOptions = other.HighlightOptions.Clone(); using (var thisEnumerator = Fields.GetEnumerator()) using (var otherEnumerator = other.Fields.GetEnumerator()) while (thisEnumerator.MoveNext() && otherEnumerator.MoveNext()) { thisEnumerator.Current.CopyFrom(otherEnumerator.Current); } }
private void cardInvalidated(LayoutControl layoutControl, FieldControl fieldControl) { Rectangle rect; if (fieldControl != null) { rect = fieldControl.Bounds; rect.Offset(layoutControl.Location); } else { rect = layoutControl.Bounds; } Invalidate(rect); }
private void paintButtons(PaintEventArgs e, FieldControl field, LayoutControl card) { var fieldBounds = getFieldBounds(field, card); var buttons = card.GetFieldButtons(field, SearchOptions, SortOptions).ToList(); buttons.LayOutIn(fieldBounds); foreach (var button in buttons) { if (button.Size == Size.Empty || button.Icon == null) { continue; } e.Graphics.DrawImage(button.Icon, button.Location); } }
private static void probeCardCreating(object view, LayoutControl probeCard) { var card = (DeckListLayout)probeCard; card.ScaleDpi(); foreach (var field in card.Fields) { field.Image = ((Bitmap)field.Image)?.HalfResizeDpi(); for (int i = 0; i < field.CustomButtons.Count; i++) { var button = field.CustomButtons[i]; button.Icon = button.Icon?.ResizeDpi(); } } card.ImageDeckBox = Resources.deckbox.ResizeDpi(); card.ImageDeckBoxOpened = Resources.deckbox_opened.ResizeDpi(); }
private void paintFieldData(PaintEventArgs e, LayoutControl card, FieldControl field, Rectangle fieldArea, int rowHandle) { if (CustomDrawField != null) { var customFieldArgs = new CustomDrawArgs { RowHandle = rowHandle, Graphics = e.Graphics, Bounds = fieldArea, FieldName = field.FieldName, Handled = false, Font = field.Font, ForeColor = field.ForeColor, DisplayText = field.DataText, HAlignment = field.HorizontalAlignment, Selection = _selection }; CustomDrawField.Invoke(this, customFieldArgs); if (!customFieldArgs.Handled) { field.PaintSelf( e.Graphics, card.Location, card.HighlightOptions, _selection, SelectionOptions); } } else { field.PaintSelf( e.Graphics, card.Location, card.HighlightOptions, _selection, SelectionOptions); } }
public bool IsButtonVisible(LayoutControl card, FieldControl field) => Allow && card.ShowSortButton(field);
private void invalidateField(FieldControl field, LayoutControl card) { Invalidate(new Rectangle(field.Location.Plus(card.Location), field.Size)); }