public override void Match(PreviewBaseShape matchShape) { PreviewFlood shape = (matchShape as PreviewFlood); PixelSize = shape.PixelSize; Layout(); }
private void PopulatePropList(PreviewBaseShape selectedShape = null) { comboBoxStringToEdit.Items.Clear(); foreach (PreviewBaseShape shape in Shape._strings) { Common.Controls.ComboBoxItem item = new Common.Controls.ComboBoxItem(shape.Name, shape); if (item.Text == null) { item.Text = shape.GetType().ToString(); item.Text = item.Text.Substring(item.Text.LastIndexOf('.') + 1); } comboBoxStringToEdit.Items.Add(item); } if (comboBoxStringToEdit.Items.Count > 0) { if (selectedShape != null) { foreach (Common.Controls.ComboBoxItem item in comboBoxStringToEdit.Items) { if ((item.Value as PreviewBaseShape) == selectedShape) { comboBoxStringToEdit.SelectedItem = item; return; } } } else { comboBoxStringToEdit.SelectedIndex = 0; } } }
public PreviewSingleSetupControl(PreviewBaseShape shape) : base(shape) { InitializeComponent(); propertyGrid.SelectedObject = Shape; Shape.OnPropertiesChanged += OnPropertiesChanged; }
public void FireOnPropertiesChanged(Object sender, PreviewBaseShape shape) { if (OnPropertiesChanged != null) { OnPropertiesChanged(sender, shape); } }
public override void Match(PreviewBaseShape matchShape) { PreviewMultiString shape = (matchShape as PreviewMultiString); PixelSize = shape.PixelSize; Layout(); }
public PreviewMegaTreeSetupControl(PreviewBaseShape shape) : base(shape) { InitializeComponent(); _tree = Shape as PreviewMegaTree; Setup(); Shape.OnPropertiesChanged += OnPropertiesChanged; }
public PreviewCustomSetupControl(PreviewBaseShape shape) : base(shape) { InitializeComponent(); foreach (PreviewBaseShape stringShape in Shape._strings) { stringShape.OnPropertiesChanged += OnPropertiesChanged; } }
public override void Match(PreviewBaseShape matchShape) { PreviewCustom shape = (matchShape as PreviewCustom); PixelSize = shape.PixelSize; // TODO Layout(); }
public override void Match(PreviewBaseShape matchShape) { //PreviewPolyLine shape = (matchShape as PreviewPolyLine); //PixelSize = shape.PixelSize; //_points[1].X = _points[0].X + (shape._points[1].X - shape._points[0].X); //_points[1].Y = _points[0].Y + (shape._points[1].Y - shape._points[0].Y); //Layout(); }
public void ShowSetupControl(PreviewBaseShape shape) { panelProperties.Controls.Clear(); Shapes.DisplayItemBaseControl setupControl = shape.GetSetupControl(); if (setupControl != null) { panelProperties.Controls.Add(setupControl); setupControl.Dock = DockStyle.Fill; } }
public override void Match(PreviewBaseShape matchShape) { PreviewEllipse shape = (matchShape as PreviewEllipse); PixelSize = shape.PixelSize; _bottomRight.X = TopLeft.X + (shape.BottomRight.X - shape.TopLeft.X); _bottomRight.Y = TopLeft.Y + (shape.BottomRight.Y - shape.TopLeft.Y); Layout(); }
public override void Match(PreviewBaseShape matchShape) { PreviewArch shape = (matchShape as PreviewArch); Width = shape.Width; Height = shape.Height; PixelSize = shape.PixelSize; Layout(); }
public override void Match(PreviewBaseShape matchShape) { PreviewIcicle shape = (matchShape as PreviewIcicle); PixelSize = shape.PixelSize; _points[1].X = _points[0].X + (shape._points[1].X - shape._points[0].X); _points[1].Y = _points[0].Y + (shape._points[1].Y - shape._points[0].Y); Layout(); }
public void SetStrings(List <PreviewBaseShape> strings) { _strings = new List <PreviewBaseShape>(); foreach (PreviewBaseShape line in strings) { PreviewBaseShape newLine = (PreviewLine)line.Clone(); _strings.Add(newLine); } _stringCount = _strings.Count(); }
public PreviewLineSetupControl(PreviewBaseShape shape) : base(shape) { InitializeComponent(); ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); ThemePropertyGridRenderer.PropertyGridRender(propertyGrid); propertyGrid.SelectedObject = Shape; Shape.OnPropertiesChanged += OnPropertiesChanged; }
protected void Dispose(bool disposing) { if (disposing) { if (_shape != null) { _shape.Dispose(); } } _shape = null; }
public PreviewMegaTreeSetupControl(PreviewBaseShape shape) : base(shape) { InitializeComponent(); ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); _tree = Shape as PreviewMegaTree; Setup(); Shape.OnPropertiesChanged += OnPropertiesChanged; }
public override void Match(PreviewBaseShape matchShape) { PreviewCane shape = (matchShape as PreviewCane); PixelSize = shape.PixelSize; _bottomRightPoint.X = TopLeft.X + (shape.BottomRight.X - shape.TopLeft.X); _bottomRightPoint.Y = TopLeft.Y + (shape.BottomRight.Y - shape.TopLeft.Y); //_archLeftPoint.X = shape.X; _archLeftPoint.Y = _bottomRightPoint.Y - (shape._bottomRightPoint.Y - shape._archLeftPoint.Y); Layout(); }
public PreviewCustomSetupControl(PreviewBaseShape shape) : base(shape) { InitializeComponent(); ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); comboBoxStringToEdit.ForeColor = ThemeColorTable.ForeColor; foreach (PreviewBaseShape stringShape in Shape._strings) { stringShape.OnPropertiesChanged += OnPropertiesChanged; } }
private void OnPropertiesChanged(object sender, PreviewBaseShape shape) { if (InvokeRequired) { BeginInvoke(new Action(propertyGrid.Refresh)); } else { propertyGrid.Refresh(); } }
public void ShowSetupControl(PreviewBaseShape shape) { panelProperties.Controls.Clear(); DisplayItemBaseControl setupControl = shape.GetSetupControl(); if (setupControl != null) { panelProperties.Controls.Add(setupControl); //setupControl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom; setupControl.Dock = DockStyle.Fill; } }
public override void Match(PreviewBaseShape matchShape) { PreviewStar shape = (matchShape as PreviewStar); PixelSize = shape.PixelSize; PointCount = shape.PointCount; InsideSize = shape.InsideSize; XYRotation = shape.XYRotation; _bottomRightPoint.X = _topLeftPoint.X + (shape._bottomRightPoint.X - shape._topLeftPoint.X); _bottomRightPoint.Y = _topLeftPoint.Y + (shape._bottomRightPoint.Y - shape._topLeftPoint.Y); Layout(); }
private void buttonOK_Click(object sender, EventArgs e) { if (connectStandardStrings && _shapes[0].StringType == PreviewBaseShape.StringTypes.Standard) { PreviewBaseShape shape = _shapes[0]; for (int i = 0; i < _shapes.Count; i++) { foreach (PreviewPixel pixel in _shapes[i]._pixels) { pixel.Node = _strings[0].Pixels[0].Node; pixel.NodeId = _strings[0].Pixels[0].NodeId; } } } else { // shapes with count==0 don't show up in combo box so keep separate index int comboidx = -1; for (int i = 0; i < _shapes.Count; i++) { //Console.WriteLine("i=" + i.ToString()); if (_shapes[i].Pixels.Count == 0) { continue; } comboidx++; Common.Controls.ComboBoxItem item = comboStrings.Items[comboidx] as Common.Controls.ComboBoxItem; PreviewSetElementString lightString = item.Value as PreviewSetElementString; PreviewBaseShape shape = _shapes[i]; for (int pixelNum = 0; pixelNum < lightString.Pixels.Count; pixelNum++) { //Console.WriteLine(" pixelNum=" + pixelNum.ToString()); // If this is a standard light string, assing ALL pixels to the first node if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { foreach (PreviewPixel pixel in shape._pixels) { //Console.WriteLine(" pixel:" + lightString.Pixels[0].Node.Id.ToString()); pixel.Node = _strings[i].Pixels[0].Node; pixel.NodeId = _strings[i].Pixels[0].NodeId; } } else { shape.Pixels[pixelNum] = lightString.Pixels[pixelNum]; } } } } DialogResult = System.Windows.Forms.DialogResult.OK; Close(); }
public override void Match(PreviewBaseShape matchShape) { PreviewPixelGrid shape = (matchShape as PreviewPixelGrid); PixelSize = shape.PixelSize; StringOrientation = shape.StringOrientation; _bottomRight.X = _topLeft.X + (shape._bottomRight.X - shape._topLeft.X); _bottomRight.Y = _topLeft.Y + (shape._bottomRight.Y - shape.TopRight.Y); Layout(); }
private void comboBoxStringToEdit_SelectedIndexChanged(object sender, EventArgs e) { Common.Controls.ComboBoxItem item = comboBoxStringToEdit.SelectedItem as Common.Controls.ComboBoxItem; if (item != null) { PreviewBaseShape shape = item.Value as PreviewBaseShape; if (shape != null) { ShowSetupControl(shape); } } }
public override void Match(PreviewBaseShape matchShape) { PreviewMegaTree shape = (matchShape as PreviewMegaTree); PixelSize = shape.PixelSize; TopHeight = shape.TopHeight; TopWidth = shape.TopWidth; BaseHeight = shape.BaseHeight; Degrees = shape.Degrees; BottomRight.X = _topLeft.X + (shape.BottomRight.X - shape._topLeft.X); BottomRight.Y = _topLeft.Y + (shape.BottomRight.Y - shape._topLeft.Y); Layout(); }
public override void Match(PreviewBaseShape matchShape) { PreviewTriangle shape = (matchShape as PreviewTriangle); PixelSize = shape.PixelSize; _point2.X = _point1.X + (shape._point2.X - shape._point1.X); _point2.Y = _point1.Y + (shape._point2.Y - shape._point1.Y); _point3.X = _point1.X + (shape._point3.X - shape._point1.X); _point3.Y = _point1.Y + (shape._point3.Y - shape._point1.Y); //_point1.X = _topLeft.X + (shape._bottomRight.X - shape._topLeft.X); //_bottomRight.Y = _topLeft.Y + (shape._bottomRight.Y - shape._topLeft.Y); Layout(); }
public override void Match(PreviewBaseShape matchShape) { PreviewStarBurst shape = (matchShape as PreviewStarBurst); PixelSize = shape.PixelSize; StringCount = shape.StringCount; InnerCircleSize = shape.InnerCircleSize; Direction = shape.Direction; XYRotation = shape.XYRotation; _topRight.X = _topLeft.X + (shape._topRight.X - shape._topLeft.X); _topRight.Y = _topLeft.Y + (shape._topRight.Y - shape._topLeft.Y); _bottomLeft.X = _topLeft.X + (shape._bottomLeft.X - shape._topLeft.X); _bottomLeft.Y = _topLeft.Y + (shape._bottomLeft.Y - shape._topLeft.Y); Layout(); }
public override void Match(PreviewBaseShape matchShape) { PreviewRectangle shape = (matchShape as PreviewRectangle); PixelSize = shape.PixelSize; _topRight.X = _topLeft.X + (shape._topRight.X - shape._topLeft.X); _topRight.Y = _topLeft.Y + (shape._topRight.Y - shape._topRight.Y); _bottomRight.X = _topLeft.X + (shape._bottomRight.X - shape._topLeft.X); _bottomRight.Y = _topLeft.Y + (shape._bottomRight.Y - shape._topRight.Y); _bottomLeft.X = _topLeft.X + (shape._bottomLeft.X - shape._topLeft.X); _bottomLeft.Y = _topLeft.Y + (shape._bottomLeft.Y - shape._topRight.Y); _topRight.X = _topLeft.X + (shape._topRight.X - shape._topLeft.X); _topRight.Y = _topLeft.Y + (shape._topRight.Y - shape._topRight.Y); Layout(); }
public PreviewCustomPropSetupControl(PreviewBaseShape shape) : base(shape) { InitializeComponent(); ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); ThemePropertyGridRenderer.PropertyGridRender(propertyGrid); buttonHelp.BackColor = Color.Transparent; buttonHelp.FlatStyle = FlatStyle.Flat; propertyGrid.SelectedObject = Shape; Shape.OnPropertiesChanged += OnPropertiesChanged; }
public override object Clone() { PreviewMegaTree newTree = (PreviewMegaTree)this.MemberwiseClone(); newTree._strings = new List <PreviewBaseShape>(); foreach (PreviewBaseShape line in _strings) { PreviewBaseShape newLine = (PreviewLine)line.Clone(); newTree._strings.Add(newLine); } newTree._topLeft = new PreviewPoint(_topLeft); newTree._bottomRight = new PreviewPoint(_bottomRight); return(newTree); }
public void FireOnPropertiesChanged(Object sender, PreviewBaseShape shape) { if (OnPropertiesChanged != null) OnPropertiesChanged(sender, shape); }
public override void Match(PreviewBaseShape matchShape) { PreviewStarBurst shape = (matchShape as PreviewStarBurst); PixelSize = shape.PixelSize; StringCount = shape.StringCount; InnerCircleSize = shape.InnerCircleSize; Direction = shape.Direction; XYRotation = shape.XYRotation; _topRight.X = _topLeft.X + (shape._topRight.X - shape._topLeft.X); _topRight.Y = _topLeft.Y + (shape._topRight.Y - shape._topLeft.Y); //_bottomLeft.X = _topLeft.X + (shape._bottomLeft.X - shape._topLeft.X); //_bottomLeft.Y = _topLeft.Y + (shape._bottomLeft.Y - shape._topLeft.Y); _bottomRight.X = _topLeft.X + (shape._bottomRight.X - shape._topLeft.X); _bottomRight.Y = _topLeft.Y + (shape._bottomRight.Y - shape._topLeft.Y); Layout(); }
public override void Match(PreviewBaseShape matchShape) { PreviewLine shape = (matchShape as PreviewLine); PixelSize = shape.PixelSize; _points[1].X = _points[0].X + (shape._points[1].X - shape._points[0].X); _points[1].Y = _points[0].Y + (shape._points[1].Y - shape._points[0].Y); Layout(); }
public abstract void Match(PreviewBaseShape matchShape);
public override void Match(PreviewBaseShape matchShape) { PreviewMegaTree shape = (matchShape as PreviewMegaTree); LightsPerString = shape.LightsPerString; StringCount = shape.StringCount; PixelSize = shape.PixelSize; TopHeight = shape.TopHeight; TopWidth = shape.TopWidth; BaseHeight = shape.BaseHeight; Degrees = shape.Degrees; _bottomRight.X = _topLeft.X + (shape._bottomRight.X - shape._topLeft.X); _bottomRight.Y = _topLeft.Y + (shape._bottomRight.Y - shape._topLeft.Y); Layout(); }
private void OnPropertiesChanged(object sender, PreviewBaseShape shape) { propertyGrid.Refresh(); }
private void OnPropertiesChanged(object sender, PreviewBaseShape shape) { }
private void OnPropertiesChanged(object sender, PreviewBaseShape shape) { PopulatePropList((comboBoxStringToEdit.SelectedItem as Common.Controls.ComboBoxItem).Value as PreviewBaseShape); }
public DisplayItemBaseControl(PreviewBaseShape shape) { _shape = shape; InitializeComponent(); }