public XMLElement_TextNode(XmlNode xmlNode, XMLEditor xmlEditor) : base(xmlNode, xmlEditor) { if (XMLElement_TextNode._drawFont == null) { XMLElement_TextNode._drawFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); XMLElement_TextNode._drawFormat.FormatFlags = (XMLElement_TextNode._drawFormat.FormatFlags | StringFormatFlags.MeasureTrailingSpaces); XMLElement_TextNode._drawFormat.Trimming = StringTrimming.None; XMLElement_TextNode._drawFont = new Font("Courier New", 10f, GraphicsUnit.Point); XMLElement_TextNode._breiteProBuchstabe = ToolboxUsercontrols.MeasureDisplayStringWidth(xmlEditor.ZeichnungsSteuerelement.CreateGraphics(), "W", XMLElement_TextNode._drawFont, XMLElement_TextNode._drawFormat); XMLElement_TextNode._hoeheProBuchstabe = XMLElement_TextNode._drawFont.Height; } this.FarbenSetzen(); }
public XMLElement_StandardNode(XmlNode xmlNode, XMLEditor xmlEditor) : base(xmlNode, xmlEditor) { if (XMLElement_StandardNode._drawFontNodeName == null) { XMLElement_StandardNode._drawFormat = (StringFormat)StringFormat.GenericTypographic.Clone(); XMLElement_StandardNode._drawFormat.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces; XMLElement_StandardNode._drawFormat.Trimming = StringTrimming.None; XMLElement_StandardNode._drawFontNodeName = new Font("Arial", 10f, GraphicsUnit.Point); XMLElement_StandardNode._hoeheProBuchstabeNodeName = XMLElement_StandardNode._drawFontNodeName.Height; XMLElement_StandardNode._drawFontAttribute = new Font("Courier New", 8f, GraphicsUnit.Point); XMLElement_StandardNode._breiteProBuchstabeAttribute = ToolboxUsercontrols.MeasureDisplayStringWidth(xmlEditor.ZeichnungsSteuerelement.CreateGraphics(), "W", XMLElement_StandardNode._drawFontAttribute, XMLElement_StandardNode._drawFormat); XMLElement_StandardNode._hoeheProBuchstabeAttribut = XMLElement_StandardNode._drawFontAttribute.Height; } this._ankerEinzugY = XMLElement_StandardNode._hoeheProBuchstabeNodeName / 2 + 2; }
protected override void NodeZeichnenStart( XMLPaintArten paintArt, int offSetX, int offSetY, PaintEventArgs e) { if (paintArt == XMLPaintArten.Vorberechnen && this._xmlEditor.CursorOptimiert.StartPos.AktNode == this._xmlNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorVorDemNode) { this._cursorStrichPos = new Point(this._paintPos.PosX + 1, this._paintPos.PosY); } int num = (int)ToolboxUsercontrols.MeasureDisplayStringWidth(e.Graphics, this._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, XMLElement_StandardNode._drawFormat); if (paintArt != XMLPaintArten.Vorberechnen) { this.FarbenSetzen(paintArt); this.zeichneRahmenNachGroesse(this._paintPos.PosX, this._paintPos.PosY, this._rahmenBreite, this._rahmenHoehe, 3, this._farbeRahmenHintergrund, this._farbeRahmenRand, e); } using (SolidBrush solidBrush1 = new SolidBrush(this._farbeNodeNameSchrift)) { this._paintPos.PosX += 4; if (paintArt != XMLPaintArten.Vorberechnen) { e.Graphics.DrawString(this._xmlNode.Name, XMLElement_StandardNode._drawFontNodeName, (Brush)solidBrush1, (float)this._paintPos.PosX, (float)(this._paintPos.PosY + 2), XMLElement_StandardNode._drawFormat); } this._paintPos.PosX += num + 4; this.AttributeZeichnen(paintArt, e); this._rahmenBreite = this._paintPos.PosX - this._startX; this._rahmenHoehe = XMLElement_StandardNode._hoeheProBuchstabeNodeName + 2 + 2; ++this._paintPos.PosX; if (this._xmlEditor.Regelwerk.IstSchliessendesTagSichtbar(this._xmlNode)) { if ((uint)paintArt > 0U) { using (SolidBrush solidBrush2 = new SolidBrush(this._farbePfeil)) { int posX = this._paintPos.PosX; int y = this._paintPos.PosY + this._ankerEinzugY; Point[] points = new Point[3] { new Point(posX, y - 7), new Point(posX + 7, y), new Point(posX, y + 7) }; e.Graphics.FillPolygon((Brush)solidBrush2, points); this._pfeilBereichLinks = new Rectangle(posX, y - 7, 7, 14); } } this._paintPos.PosX += 7; } else { this._pfeilBereichLinks = new Rectangle(0, 0, 0, 0); } if (paintArt == XMLPaintArten.Vorberechnen && this._xmlEditor.CursorOptimiert.StartPos.AktNode == this._xmlNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorInDemLeeremNode) { this._cursorStrichPos = new Point(this._paintPos.PosX - 1, this._paintPos.PosY); } this._paintPos.HoeheAktZeile = Math.Max(this._paintPos.HoeheAktZeile, this._rahmenHoehe); if (paintArt == XMLPaintArten.Vorberechnen) { this._tagBereichLinks = new Rectangle(this._startX, this._startY, this._paintPos.PosX - this._startX, this._rahmenHoehe); this._klickBereiche.Add(this._tagBereichLinks); if (!this._xmlEditor.Regelwerk.IstSchliessendesTagSichtbar(this._xmlNode) && this._xmlEditor.CursorOptimiert.StartPos.AktNode == this._xmlNode && this._xmlEditor.CursorOptimiert.StartPos.PosAmNode == XMLCursorPositionen.CursorHinterDemNode) { this._cursorStrichPos = new Point(this._paintPos.PosX - 1, this._paintPos.PosY); } } this._paintPos.BisherMaxX = Math.Max(this._paintPos.BisherMaxX, this._paintPos.PosX); } }