Click here to Skip to main content
15,868,141 members
Articles / Desktop Programming / ATL

Create a Universal Document Template which supports Dynamic Frame Window Layout

Rate me:
Please Sign up or sign in to vote.
3.00/5 (8 votes)
14 Dec 20024 min read 49.2K   668   24  
Introduce a programming technology to design a very complex, rich document type.
<HTML>
	<HEAD>
		<META name="VI60_defaultClientScript" content="VBScript">
		<TITLE></TITLE>
		<SCRIPT ID="clientEventHandlersVBS" LANGUAGE="vbscript">
<!--
dim curlab,wndidtp

wndidtp=" "

set curlab = nothing

sub showpage(this,pag)
	dim a ,b
	set a = d1.all.tags("table")

	if not curlab is nothing then
	  if curlab is this then
		exit sub
	  end if
	  curlab.className = "tabnosel"
	end if

	this.className = "tabsel"
	set curlab = this
	for each b in a
		if b.classname="tabpage" then
			if b is pag then
				'b.style.zIndex = 1
				b.style.display=""
			else
				'b.style.zIndex=-1
				b.style.display="none"
			end if
		end if
	next
end sub

Sub init
	dim a ,b
	set a = d1.all.tags("table")
	'msgbox a.length
	pp.style.display = ""

	for each b in a 
		if b.classname="tabpage" then
			b.style.position="absolute"
			b.style.top =pp.offsetTop 
			b.style.left =pp.offsetleft
			b.style.width =pp.style.width 
			b.style.height =pp.style.height 
		end if
	next
	'pl0.style.position="absolute"
	'pl1.style.position="absolute"
	'pl2.style.position="absolute"
	'showpage td1,tb1
End Sub

sub showtext(pl)
	strabout = "about:" & Space(50) &  "<html><head><title></title></head><body><table id="&pl.id&">" & pl.innerhtml & "</table></body></html>" & _
		"<script language=jscript>function wnd_onmousedown(o){}function wnd_onmouseup(o){} function showtext(o){window.close();}</" & "script>"
	showModalDialog  strabout ,,"dialogheight:" & pl.h & "px;dialogwidth:" & pl.w & "px;status:no;help:no"
	exit sub
	if pl.style.display="none" then
		pl.style.display=""
	else
		pl.style.display="none"
	end if
end sub

sub displayboard
	dd0.style.display="none"
	dd1.style.display=""
	init
end sub
sub SetDocTitle(strTitle)
	window.external.DocTitle = strTitle
end sub
sub SetDocCls(strComClsID)
	window.external.DocComClsID=strComClsID
end sub

Sub ttpl0_onmousemove
	'ttpl0.innerText = window.event.x & "," & window.event.y 
End Sub

dim dx,dy,ox,oy,md,plx
set plx = nothing
Sub wnd_onmousedown(pl)
	'pl0.style.position="absolute"
	'msgbox pl0.style.left
	if not plx is nothing then
		plx.style.zindex = 1
		pl.style.zindex = 2
	end if
	set plx=pl
	dx = window.event.x + document.body.scrollleft
	dy = window.event.y + document.body.scrolltop
	ox = plx.offsetLeft 
	oy = plx.offsetTop
	md = 1 
End Sub

Sub wnd_onmouseup
	md = 0 
	'set plx = nothing
End Sub

Sub document_onmousemove
	if window.event.button = 1 and md = 1 and not plx is nothing then
		plx.style.left = ox - dx + window.event.x + document.body.scrollleft
		plx.style.top = oy - dy + window.event.y + document.body.scrolltop
	end if
	'	ttpl0.innerText ="dsfdsgfdg"
End Sub

dim cnt
sub showtooltip(obj)
	if obj.showtip=0 then
		obj.showtip=1
		obj.timerid= setInterval( "opentooltip " & obj.id & "," & window.event.x & "," & window.event.y,500)
	elseif obj.showtip=1 then
		clearInterval obj.timerid
		obj.timerid= setInterval( "opentooltip " & obj.id & "," & window.event.x & "," & window.event.y,500)
	end if
end sub

'dim ttip,tid
sub opentooltip(obj,x,y)
	
	obj.showtip=2
	tipwnd.style.left = x + 8 + document.body.scrollleft
	
	tipwnd.style.top  = y + 8 + document.body.scrolltop
	tipwndtext.innerText = obj.tooltip
	tipwnd.style.display=""
	clearInterval obj.timerid
end sub

sub canceltooltip(obj)
	tipwnd.style.display="none"
	obj.showtip=0
	clearInterval obj.timerid
end sub
Sub window_onload
	tipwnd.style.display="none"
	tipwnd.style.position="absolute"

End Sub

-->
		</SCRIPT>
		<style>
INPUT
{
    BORDER-RIGHT: #08246b 1px solid;
    BORDER-TOP: #08246b 1px solid;
    FONT-SIZE: 12px;
    BORDER-LEFT: #08246b 1px solid;
    BORDER-BOTTOM: #08246b 1px solid;
    HEIGHT: 18px
}
.none{
}
.tabsel{
		BORDER-LEFT: silver 1px solid; 
		BORDER-RIGHT: black 1px solid; 
		BORDER-TOP: silver 1px solid;
		CURSOR: default;
		TEXT-ALIGN: center;
		BACKGROUND-COLOR: lightcyan;
		FONT-SIZE: 12px;
		height:22px
		}
.tabnosel{
		BORDER-BOTTOM: silver 1px solid; 
		BORDER-LEFT: silver 1px solid; 
		BORDER-RIGHT: black 1px solid; 
		BORDER-TOP: silver 1px solid;
		CURSOR: default;
		TEXT-ALIGN: center;
		BACKGROUND-COLOR: lightsteelblue;
		FONT-SIZE: 12px;
		height:22px
		}
.ttcap{
		BORDER-BOTTOM: silver 1px solid; 
		BORDER-LEFT: silver 1px solid; 
		BORDER-RIGHT: black 1px solid; 
		BORDER-TOP: silver 1px solid;
		CURSOR: default;
		TEXT-ALIGN: left;
		BACKGROUND-COLOR: lightsteelblue;
		FONT-SIZE: 12px;
		height:20px
		}
.tooltip{
		BORDER-BOTTOM: 1px solid; 
		BORDER-LEFT: 1px solid; 
		BORDER-RIGHT: 1px solid; 
		BORDER-TOP: 1px solid;
		padding-left:2px;
		padding-right:2px;
		CURSOR: default;
		TEXT-ALIGN: left;
		BACKGROUND-COLOR: #ffffe1;
		FONT-SIZE: 12px;
		height:1;
		LINE-HEIGHT: 1.4;
		}
.tabpage{
		BORDER-LEFT: silver 1px solid; 
		BORDER-RIGHT: black 1px solid; 
		BORDER-BOTTOM: black 1px solid;
		BACKGROUND-COLOR: lightcyan;
		FONT-SIZE: 12px;
		width:400
		}
.intabpage{
		FONT-SIZE: 12px;
		width:100%
		}
.txtdlg{
		BORDER-LEFT: silver 1px solid; 
		BORDER-RIGHT: black 1px solid; 
		BORDER-BOTTOM: black 1px solid;
		BORDER-TOP: silver 1px solid;
		BACKGROUND-COLOR: lightcyan;
		FONT-SIZE: 12px;
		width:600
		}

</style>
	</HEAD>
	<BODY background="CIRCUIT.JPG">
		<div id="dd0" align="center" title="Welcome to the world of the Tangram"><font onclick="displayboard" color="blue" style="CURSOR: hand"><u>DESIGN</u></font></div>
		<div id="dd1" style="DISPLAY: none">
			<!--table border="0" cellPadding="0" cellSpacing="0" width="400">
				<tr>
					<td id="td1" onclick="javascript:showpage(this,tb1);" class="tabnosel" width="20%" title="Create Splitter Window">
					Splitter
					<td id="td2" onclick="javascript:showpage(this,tb2);" class="tabnosel" width="20%" title="Create Tab Window">
					TABWnd
					<td id="td3" onclick="javascript:showpage(this,tb3);" class="tabnosel" title="Create COM Window" width="20%">COM 
						Wnd 
					</td>
				</tr>
			</table-->
			<table id="pp" width="400" height="100" style="DISPLAY: none; HEIGHT: 100px">
				<tr>
					<td></td>
				</tr>
			</table>
			<div id="d1">
				<TABLE id="tb1" width="500" class="tabpage">
					<tr>
						<td colspan=4 id="td1" onclick="javascript://showpage(this,tb1);" class="tabnosel" width="20%" title="Create Splitter Window">
						Splitter
					<TR>
						<TD><Table border="0" cellpadding="0" cellspacing="0" class="intabpage">
								<TR>
									<TD>Rows:</TD>
									<TD><INPUT id="RowCount" size="12" title='Spliter window rows count' style="WIDTH: 68px" height="0"></TD>
									<TD>Columns:</TD>
									<TD width=60%><INPUT id="ColCount" size="12" title='Spliter window columns count' style="WIDTH: 68px" height="0"></TD>
								<TR>
									<TD colspan=4 align=right><INPUT name="buttonSplitter" onclick='javascript:window.external.CreateSplitter(RowCount.value, ColCount.value, "", 0)' type="button" value="CreateSplitter">
										<!--INPUT id="DeleteSplitter" name="DeleteSplitter" onclick="javascript:window.external.DeleteSplitter()" type="button" value="delete splitter"--></TD>
								</TR>
							</Table>
					<tr>
						<td colspan=4 id="td2" onclick="javascript://showpage(this,tb2);" class="tabnosel" width="20%" title="Create Tab Window">
					TABWnd
					<TR>
						<TD><Table border="0" cellpadding="0" cellspacing="0" class="intabpage">
								<!--TR>
									<TD>TabClsID:</TD>
									<TD><INPUT id="Text6" name="txtTabWndClsID" size="13" style="WIDTH: 140px" height="0" width="140"></TD>
									<TD><!--object name:></TD>
									<TD><!--INPUT name=txtTabWndObjName size="14"></TD-->
								<TR>
									<TD>TabTitle:</TD>
									<TD><INPUT id="Text8" name="txtTabWndCaption" style="WIDTH: 140px" width="140" title='Fill caption of tabpage'></TD>
									<TD>TabIconIndex:</TD>
									<TD width="20%"><INPUT title='Index of added tabpage' value="0" id="TabImageIndex" size="3" style="LEFT: 286px; WIDTH: 22px; TOP: 21px" name="TabImageIndex" height="0"></TD>
								<TR>
									<TD colspan="4" align=right><INPUT name="CreateTabWnd" onclick='javascript:window.external.CreateTabWnd("", txtTabWndCaption.value, "")' type="button" value="CreateTabWnd" style="WIDTH: 96px" height="0">
										<INPUT id="AddPage" name="AddPage" onclick="javascript:window.external.AddPage(0, txtTabWndCaption.value, TabImageIndex.value)" type="button" value="Add Page" style="WIDTH: 74px" height="0">
										<!--INPUT id="DeletePage" name="DeletePage" onclick="javascript:window.external.DeleteTabPage(TabImageIndex.value)" type="button" value="delete page" style="WIDTH: 85px" height="0">
										<INPUT id="DeleteTabWnd" name="DeleteTabWnd" onclick="javascript:window.external.DeleteTabWnd()" type="button" value="delete tabwnd"--></TD>
								</TR>
							</Table>
					<tr>
						<td colspan=4 id="td3" onclick="javascript://showpage(this,tb3);" class="tabnosel" title="Create COM Window" width="20%">COM 
						Wnd 
					<TR>
						<TD><Table border="0" cellpadding="0" cellspacing="0" class="intabpage">
								<TR>
									<TD>COMWndID:</TD>
									<TD><INPUT id="txtWndClsID" name="txtWndClsID" title='COM Window ClSID,
include ActiveX Object ProgID and Tangram Component ID,
for example ListView Control ProgID is "mscomctllib.listviewctrl",
Tangram Component ID is Component Library name and MFC Component Class Name,
for example "TangramDlllib1.CYourView", 
if the MFC Component Class builed in Application Framework,the Component ID is MFC Component Class Name only .
'></TD>
									<TD>Object Name:
									<TD width=30%>
									<INPUT id="txtWndObjName" name="txtWndObjName" style="WIDTH: 47px;    
      HEIGHT: 18px" size="7" title="Please input a unique name."></TD>
								<TR>
									<TD colspan=4 align=right><INPUT onclick='javascript:window.external.CreateActiveItem(txtWndClsID.value, txtWndObjName.value)' type="button" value="Create COM Window" name="CreateCOMWnd" style="WIDTH: 150px; HEIGHT: 18px" size="15"></TD>
								</TR>
							</Table>
				</TABLE>
			</div>
		</div>
		<TABLE id="tipwnd" border="0" cellPadding="0" cellSpacing="0" class="tooltip" borderColor="black">
			<TR>
				<TD id="tipwndtext"></TD>
			</TR>
		</TABLE>
	</BODY>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions