コード例 #1
0
ファイル: ListView.cs プロジェクト: luislasonbra/PixelFarm
        public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
        {
            if (primElement == null)
            {
                //1.
                var element = new CustomContainerRenderBox(rootgfx, this.Width, this.Height);
                element.SetLocation(this.Left, this.Top);
                element.BackColor = this.backColor;
                element.SetController(this);
                //
                listItemText = new CustomTextRun(rootgfx, 200, this.Height);
                if (font != null)
                {
                    listItemText.RequestFont = font;
                    //TODO: review how to find
                    int blankLineHeight = (int)rootgfx.TextServices.MeasureBlankLineHeight(font);
                    listItemText.SetHeight(blankLineHeight);
                    element.SetHeight(blankLineHeight);
                }


                element.AddChild(listItemText);
                listItemText.TransparentForAllEvents = true;
                if (this.itemText != null)
                {
                    listItemText.NeedClipArea = true;
                    listItemText.Text         = this.itemText;
                }

                element.NeedClipArea = true;
                this.primElement     = element;
            }
            return(primElement);
        }
コード例 #2
0
ファイル: ListView.cs プロジェクト: lingliy/HtmlRenderer
        public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
        {
            if (primElement == null)
            {
                //1.
                var element = new CustomContainerRenderBox(rootgfx, this.Width, this.Height);
                element.SetLocation(this.Left, this.Top);
                element.BackColor = this.backColor;
                element.SetController(this);

                listItemText = new CustomTextRun(rootgfx, 200, this.Height);
                element.AddChild(listItemText);
                listItemText.TransparentForAllEvents = true;
                if (this.itemText != null)
                {
                    listItemText.Text = this.itemText;
                }

                this.primElement = element;
            }
            return(primElement);
        }
コード例 #3
0
ファイル: ListView.cs プロジェクト: prepare/HTML-Renderer
        public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
        {
            if (primElement == null)
            {
                //1.
                var element = new CustomContainerRenderBox(rootgfx, this.Width, this.Height);
                element.SetLocation(this.Left, this.Top);
                element.BackColor = this.backColor;
                element.SetController(this);

                listItemText = new CustomTextRun(rootgfx, 200, this.Height);
                element.AddChild(listItemText);
                listItemText.TransparentForAllEvents = true;
                if (this.itemText != null)
                {
                    listItemText.Text = this.itemText;
                }

                this.primElement = element;
            }
            return primElement;
        }