Exemple #1
0
        public Form1()
        {
            this.InitializeComponent();
            this.htDevice   = new HtmlDevice();
            this.htCompiler = HtEngine.GetCompiler();
            HtEngine.RegisterDevice(this.htDevice);
            HtEngine.DefaultFontSize   = 14;
            HtEngine.DefaultFontFace   = "Arial";
            this.pictureBox1.BackColor = Color.RoyalBlue;

            this.pictureBox1.MouseMove +=
                (sender, args) =>
            {
                this.pictureBox1.Cursor = this.htCompiler.GetLink(args.X, args.Y) == null
                                                  ? Cursors.Default
                                                  : Cursors.Hand;
            };

            this.pictureBox1.MouseClick += (sender, args) =>
            {
                string link = this.htCompiler.GetLink(args.X, args.Y);
                if (link != null)
                {
                    MessageBox.Show("Link clicked: " + link);
                }
            };
        }
Exemple #2
0
        public Form1()
        {
            this.InitializeComponent();
            this.htDevice = new HtmlDevice();
            this.htCompiler = HtEngine.GetCompiler();
            HtEngine.RegisterDevice(this.htDevice);
            HtEngine.DefaultFontSize = 14;
            HtEngine.DefaultFontFace = "Arial";
            this.pictureBox1.BackColor = Color.RoyalBlue;

            this.pictureBox1.MouseMove +=
                (sender, args) =>
                {
                    this.pictureBox1.Cursor = this.htCompiler.GetLink(args.X, args.Y) == null
                                                  ? Cursors.Default
                                                  : Cursors.Hand;
                };

            this.pictureBox1.MouseClick += (sender, args) =>
            {
                string link = this.htCompiler.GetLink(args.X, args.Y);
                if (link != null)
                    MessageBox.Show("Link clicked: " + link);
            };
        }
Exemple #3
0
 public void OnDestroy()
 {
     // we need to dispose compiler to prevent GC
     if (compiler != null)
     {
         compiler.Dispose();
         compiler = null;
     }
 }
        public HtmlTextField()
        {
            HtEngine.RegisterLogger(new Unity3DLogger());
            HtEngine.RegisterDevice(new Unity3DDevice());
            _compiler = HtEngine.GetCompiler();
            _text     = string.Empty;

            AddEventListenerObsolete(MouseEvent.MOUSE_DOWN, __mouseDown, true);
        }
 public override void Dispose()
 {
     // we need to dispose _compiler to prevent GC
     if (_compiler != null)
     {
         _compiler.Dispose();
         _compiler = null;
     }
 }
Exemple #6
0
 protected override void OnClosed(EventArgs e)
 {
     if (this.htCompiler != null)
     {
         this.htCompiler.Dispose();
         this.htCompiler = null;
     }
     base.OnClosed(e);
 }
Exemple #7
0
    //  private void OnGUI(){}


    void OnDestroy()
    {
        // we need to dispose compiler to prevent GC
        if (compiler != null)
        {
            compiler.Dispose();
            compiler = null;
        }

        CoroutineManage.Single.UnRegComponentUpdate(IUpdate);
    }
Exemple #8
0
    public void Awake()
    {
        Debug.Log("Initializing Demo");

        // our logger
        HtEngine.RegisterLogger(new HtmlLogger());
        // our device
        HtEngine.RegisterDevice(new HtmlDevice());
        // our compiler
        this.compiler = HtEngine.GetCompiler();
        // set up first html
        this.html = demo0;
    }
Exemple #9
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            HtmlDevice.Content       = Content;
            HtmlDevice.Context       = spriteBatch;
            HtEngine.DefaultFontFace = "Arial";
            HtEngine.DefaultFontSize = 14;
            HtEngine.RegisterDevice(new HtmlDevice());

            compiler = HtEngine.GetCompiler();
            compiler.Compile(demo, GraphicsDevice.Viewport.Width);
        }
Exemple #10
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            HtmlDevice.Content = Content;
            HtmlDevice.Context = spriteBatch;
            HtEngine.DefaultFontFace = "Arial";
            HtEngine.DefaultFontSize = 14;
            HtEngine.RegisterDevice(new HtmlDevice());

            compiler = HtEngine.GetCompiler();
            compiler.Compile(demo, GraphicsDevice.Viewport.Width);
        }
 internal override void OnRelease()
 {
     compiled.Dispose();
     compiled = null;
     base.OnRelease();
 }
 internal override void OnAcquire()
 {
     offsetApplied = false;
     compiled = HtEngine.GetCompiler();
     base.OnAcquire();
 }
Exemple #13
0
 internal override void OnRelease()
 {
     compiled.Dispose();
     compiled = null;
     base.OnRelease();
 }
Exemple #14
0
 internal override void OnAcquire()
 {
     offsetApplied = false;
     compiled      = HtEngine.GetCompiler();
     base.OnAcquire();
 }
Exemple #15
0
 void Start()
 {
     compiler = HtEngine.GetCompiler();
 }
Exemple #16
0
 protected override void OnClosed(EventArgs e)
 {
     if (this.htCompiler != null)
     {
         this.htCompiler.Dispose();
         this.htCompiler = null;
     }
     base.OnClosed(e);
 }