public override RenderElement GetPrimaryRenderElement() { if (_myTextRun == null) { var t_run = new CustomTextRun(this.Width, this.Height); t_run.TextDrawingTech = _textDrawingTech; t_run.TextColor = _textColor; t_run.BackColor = _backColor; t_run.Text = this.Text; t_run.PaddingLeft = this.PaddingLeft; t_run.PaddingTop = this.PaddingTop; t_run.SetVisible(this.Visible); t_run.SetLocation(this.Left, this.Top); t_run.SetController(this); t_run.TransparentForMouseEvents = this.TransparentForMouseEvents; // if (_font != null) { t_run.RequestFont = _font; } _myTextRun = t_run; } //----------- return(_myTextRun); }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (primElement == null) { //first time var element = new CustomRenderBox(rootgfx, this.Width, this.Height); element.SetLocation(this.Left, this.Top); element.BackColor = this.backColor; element.HasSpecificSize = true; //----------------------------- // create default layer for node content //----------------------------- uiNodeIcon = new ImageBox(16, 16);//create with default size SetupNodeIconBehaviour(uiNodeIcon); element.AddChild(uiNodeIcon); //----------------------------- myTextRun = new CustomTextRun(rootgfx, 10, 17); myTextRun.SetLocation(16, 0); myTextRun.Text = "Test01"; element.AddChild(myTextRun); //----------------------------- this.primElement = element; } return(primElement); }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (!this.HasReadyRenderElement) { //first time RenderElement baseRenderElement = base.GetPrimaryRenderElement(rootgfx); //1. add place holder first placeHolder = new CustomTextRun(rootgfx, this.Width - 4, this.Height - 4); placeHolder.Text = placeHolderText; placeHolder.SetLocation(1, 1); placeHolder.TextColor = Color.FromArgb(180, Color.LightGray); baseRenderElement.AddChild(placeHolder); //2. textbox myTextBox = new TextBox(this.Width - 4, this.Height - 4, multiline); myTextBox.BackgroundColor = Color.Transparent; myTextBox.SetLocation(2, 2); textEvListener = new Text.TextSurfaceEventListener(); myTextBox.TextEventListener = textEvListener; textEvListener.KeyDown += new EventHandler <Text.TextDomEventArgs>(textEvListener_KeyDown); baseRenderElement.AddChild(myTextBox); return(baseRenderElement); } else { return(base.GetPrimaryRenderElement(rootgfx)); } }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (!this.HasReadyRenderElement) { //first time RenderElement baseRenderElement = base.GetPrimaryRenderElement(rootgfx); //1. add place holder first placeHolder = new CustomTextRun(rootgfx, this.Width - 4, this.Height - 4); placeHolder.Text = placeHolderText; placeHolder.SetLocation(1, 1); placeHolder.TextColor = Color.FromArgb(180, Color.LightGray); baseRenderElement.AddChild(placeHolder); //2. textbox myTextBox = new TextBox(this.Width - 4, this.Height - 4, multiline); myTextBox.BackgroundColor = Color.Transparent; myTextBox.SetLocation(2, 2); textEvListener = new Text.TextSurfaceEventListener(); myTextBox.TextEventListener = textEvListener; textEvListener.KeyDown += new EventHandler<Text.TextDomEventArgs>(textEvListener_KeyDown); baseRenderElement.AddChild(myTextBox); return baseRenderElement; } else { return base.GetPrimaryRenderElement(rootgfx); } }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (_myTextRun == null) { var trun = new CustomTextRun(rootgfx, this.Width, this.Height); #if DEBUG trun.dbugBreak = this.dbugBreakOnRenderElement; #endif trun.SetLocation(this.Left, this.Top); trun.TextColor = _textColor; trun.Text = this.Text; trun.PaddingLeft = this.PaddingLeft; trun.PaddingTop = this.PaddingTop; trun.SetVisible(this.Visible); trun.SetController(this); // if (_font != null) { trun.RequestFont = _font; } _myTextRun = trun; } //----------- return(_myTextRun); }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (this.myTextRun == null) { var trun = new CustomTextRun(rootgfx, this.Width, this.Height); trun.SetLocation(this.Left, this.Top); trun.TextColor = this.textColor; trun.Text = this.Text; this.myTextRun = trun; } //----------- return(myTextRun); }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (this.myTextRun == null) { var trun = new CustomTextRun(rootgfx, this.Width, this.Height); trun.SetLocation(this.Left, this.Top); trun.TextColor = this.textColor; trun.Text = this.Text; this.myTextRun = trun; } //----------- return myTextRun; }
public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx) { if (primElement == null) { //first time var element = new CustomRenderBox(rootgfx, this.Width, this.Height); element.SetLocation(this.Left, this.Top); element.BackColor = this.backColor; element.HasSpecificSize = true; //----------------------------- // create default layer for node content //----------------------------- uiNodeIcon = new ImageBox(16, 16);//create with default size SetupNodeIconBehaviour(uiNodeIcon); element.AddChild(uiNodeIcon); //----------------------------- myTextRun = new CustomTextRun(rootgfx, 10, 17); myTextRun.SetLocation(16, 0); myTextRun.Text = "Test01"; element.AddChild(myTextRun); //----------------------------- this.primElement = element; } return primElement; }