Ejemplo n.º 1
0
        public virtual void Create(int width, int height, TColor clearColor, string htmlDocument)
        {
            Canvas    = GfxFactory.Create <IGfxCanvas>();
            GfxServer = GfxFactory.Create <IGfxServer>();
            GfxServer.Initialize(width, height, clearColor);

            Width  = width;
            Height = height;

            var domFactory = new TDomFactory();

            Document = domFactory.Create <IDocument>();
            Document.Parse(htmlDocument);

            // Create the canvas. Need a canvas for the screen. For example,
            // the screen render the mouse cursor. Because it render something,
            // we need a Canvas.
            // As you can see, this is a hack, because, normally, every
            // control create it's own canvas in TControl::Create(). But
            // we skip the base class initialization, so need to create the
            // canvas by hand.

            //Canvas = new TCanvas(this);

            //SetBounds(Rect.left, Rect.top, Rect.right, Rect.bottom);#
        }
Ejemplo n.º 2
0
        public override void Create(int width, int height, Color clearColor, string htmlDocument)
        {
            Canvas    = GfxFactory.Create <IGfxCanvas>();
            GfxServer = GfxFactory.Create <IGfxServer>();
            GfxServer.Initialize(width, height, clearColor);

            base.Create(width, height, clearColor, htmlDocument);
        }
Ejemplo n.º 3
0
        public void Paint()
        {
            GfxServer.Begin();

            Document.Body.Paint();

            GfxServer.End();
        }