Click here to Skip to main content
Licence CPOL
First Posted 21 Aug 2006
Views 15,591
Downloads 0
Bookmarked 13 times

WebPage as MDI Background In TangramLite

By | 21 Aug 2006 | Article
WebPage as MDI Background and Interact with User

HTML Background:

Click "Create New Document" Button:

Navigate to some URL:

New Document:

Introduction

Generally, there is a bitmap of company Logo as the background of MDI window. Sometimes, you may need a dynamic picture or more interactive ability. Here I will tell you how do it using TangranLite framework.

Config Background for MDI

You may download TangramLite first. After you setup, you can see "OS:\Program Files\TangramLite\debug" directory on your disk. There are samples we prepare for you.

Open "TangramLiteD.exe.config" file. This the config file for "TangramLiteD.exe", actually, this is XML format. You may see two nodes:

<BackgroundType>html</BackgroundType>
<BackgroundFile>background.htm</BackgroundFile>

The first node specifies what type of background, here we want HTML. The second node specifies the filename of the HTML. But where is it located? You can find it here:

"OS:\Program Files\TangramUniverseDocument\Tangram Team\TangramLite\Background"

Now you can change it with your HTML page.

Interact with HTML

How can we interact with HTML? When we create a CHTMLView and navigate to a special HTML file, the webbrowser gets IDispatch interface of a COM object. Then we can write a script to invoke methods of the object through IDispatch. COM object's method can call native code. Open "C:\Program Files\TangramUniverseDocument\Tangram Team\TangramLite\Background\Background.htm" in Notepad or other editor to see source. We can find the script:

<!--
Sub Button1_onclick
 window.external.NewDocument
End Sub

Sub Button2_onclick
 window.external.opendoc
End Sub
-->

That means when you click Button1, it will invoke "NewDocument" method of theCOM object. We do an action in the method in fact. Open sample project "TangramLiteMainFrameD", there, you can find an interface "IApplication", it has a method "TangramLiteMainFrameD". We do NewDocument in the method implementation.

History

  • 21st August, 2006: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

wlwlxj

Web Developer

China China

Member

I've been programming since I was 21. Started with C++, looked at Java, keen on Visual Basic and Visual C++, thinking about .NET and C#.^_^.
My Email:wlwlxj@google.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 21 Aug 2006
Article Copyright 2006 by wlwlxj
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid