private void FullCopy(TableLine duplicate) { #region full copy // copy text for (var i = 0; i < duplicate.Text.Length; i++) { mCells[i].Text = duplicate.Text[i].Text; } // copy visible IsVisible = duplicate.IsVisible; // copy position //X = duplicate.X; //Y = duplicate.Y; Move(duplicate.X, duplicate.Y); HotKeycode = duplicate.HotKeycode; //State = duplicate.State; OnHide = duplicate.OnHide; OnShow = duplicate.OnShow; OnPaint = duplicate.OnPaint; OnPress = duplicate.OnPress; OnRelease = duplicate.OnRelease; mName = duplicate.mName; #endregion }
public List(IWidget parent, int countLines, int x, int y, int firstWidth = 200) : base(parent) { mCountOfVisibleLines = countLines; var line = new TableLine(this, 22); Resize(320, 0); //Width = 320; line.AddColumn(firstWidth, null, Align.Left, 21, Palette.White, new GfxPoint(4, 4)); line.AddColumn(Width - firstWidth, null, Align.Left, 21, Palette.White, new GfxPoint(4, 4)); SetBackground(Palette.LightSkyBlue, new Color(0x121212FF));//Palette.TextArea.Background); SetBorder(1, Palette.DarkGray); AddLine(line); for (var i = 0; i < countLines - 1; i++) { AddLine(new TableLine(line)); } base.Move(x, y); OnIndexChange += s => { ActiveLine = GetLineById(mCountOfVisibleLines - (mDataIndex % mCountOfVisibleLines) - 1); }; Init(); }
public TableLine(TableLine duplicate, bool isFullCopy = true) : base(duplicate.Parent, 0, duplicate.Height) { foreach (var child in duplicate.Text) { AddColumn(child.Width, child.FontName, child.TextAlign, child.FontSize, child.FontColor, child.TextOffset); } if (!isFullCopy) { return; } FullCopy(duplicate); }