private void Element_DataChanged(object sender, ElementControlEventArgs e) { var el = new CardElement(); switch (e.Type) { case 0: var cb = new CardBackground(); cb.layer = e.Layer; cb.x = (int)e.Locate.X; cb.y = (int)e.Locate.Y; cb.bgPath = e.Path; card.Set(e.Layer, cb); break; case 1: var cf = new CardFram(); cf.layer = e.Layer; cf.x = (int)e.Locate.X; cf.y = (int)e.Locate.Y; cf.bgPath = e.Path; card.Set(e.Layer, cf); break; case 2: var ci = new CardImage(); ci.layer = e.Layer; ci.x = (int)e.Locate.X; ci.y = (int)e.Locate.Y; ci.bgPath = e.Path; ci.Width = elements[e.Layer].pictureWidth.Value; ci.Height = elements[e.Layer].pictureHeight.Value; card.Set(e.Layer, ci); break; case 3: var cn = new CardImgNum(); cn.layer = e.Layer; cn.x = (int)e.Locate.X; cn.y = (int)e.Locate.Y; cn.bgPath = e.Path; cn.num = e.Num; card.Set(e.Layer, cn); break; case 4: var ct = new CardText(); ct.layer = e.Layer; ct.x = (int)e.Locate.X; ct.y = (int)e.Locate.Y; ct.bgPath = e.Path; ct.Text = e.Text; card.Set(e.Layer, ct); break; } Render(); }
private void DeletElement_Click(object sender, ElementControlEventArgs e) { RemoveElement(e.Layer); if (currentEl >= elements.Count) { currentEl = elements.Count - 1; } else { currentEl = currentEl; } }
private void Element_Click(object sender, ElementControlEventArgs e) { if (currentEl == e.Layer) { return; } //elements[currentEl].Selted = false; currentEl = e.Layer; //elements[currentEl].Selted = true; ShowElements(); }
private void FontButton_Click(object sender, ElementControlEventArgs e) { ColorFontDialog CF = new ColorFontDialog(true, true, true); CF.Owner = this; CF.Font = fonts[e.Layer]; CF.FontSizes = new int[] { 20, 30, 40, 50, 60 }; if (CF.ShowDialog() == true) { FontInfo font = CF.Font; if (font != null) { fonts[e.Layer] = CF.Font; Render(); } } }
private void LayerDown_Click(object sender, ElementControlEventArgs e) { SwapElement(e.Layer, e.Layer + 1); }
protected virtual void OnDeletElementClick(ElementControlEventArgs e) { DeletElementClick(this, e); }
protected virtual void OnLayerDownClick(ElementControlEventArgs e) { LayerDownClick(this, e); }
protected virtual void OnTopClick(ElementControlEventArgs e) { TopClick(this, e); }
protected virtual void OnFontButtonClick(ElementControlEventArgs e) { FontButtonClick(this, e); }
protected virtual void OnDataChanged(ElementControlEventArgs e) { DataChanged(this, e); }