Click here to Skip to main content
15,894,630 members
Articles / Web Development / HTML

ABC to Handling Visual Objects using Javascript

Rate me:
Please Sign up or sign in to vote.
4.36/5 (4 votes)
13 Jul 2007CPOL3 min read 28.6K   165   21  
This article shows how to create, move, delete and select current visual objects inside a display
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title></title>
<!--	<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
	<meta name=ProgId content=VisualStudio.HTML>
	<meta name=Originator content="Microsoft Visual Studio .NET 7.1">	-->

		<script language="javascript" src="GCZones.js">
		</script>
		<script language="javascript" src="GCDocument.js">
		</script>
		<script language="javascript" src="GCContextMenu.js">
		</script>
		<script language="javascript" src="GCDisplay.js">
		</script>
		
		<script language="javascript">

/******************************************************
*	initializari CM display
******************************************************/
//debugger
		var optMenuDisplay = new Array(); 
		optMenuDisplay[0] = new MenuItem("Create zone", "CreateZone();", "images\\create.gif"); 
		optMenuDisplay[1] = new MenuItem("Change display", "ChangeDisplay();", "images\\check2.gif"); 
		optMenuDisplay[2] = new MenuItem("hr", "hr"); 
		optMenuDisplay[3] = new MenuItem("About", "About();"); 
	
		var cmDisplay = new ContextMenu(optMenuDisplay); 
		cmDisplay.Create(); 
/******************************************************
*	initializari CM zone
******************************************************/
		var optMenuZone = new Array(); 
		optMenuZone[0] = new MenuItem("Delete zone", "DeleteZone();", "images\\delete.gif"); 
		optMenuZone[1] = new MenuItem("hr", "hr"); 
		optMenuZone[2] = new MenuItem("Dock left", "DockLeft();", "images\\dockLeft.ico"); 
		optMenuZone[3] = new MenuItem("Dock bottom", "DockBottom();", "images\\dockBottom.ico"); 
		optMenuZone[4] = new MenuItem("Dock right", "DockRight();", "images\\dockRight.ico"); 
		optMenuZone[5] = new MenuItem("Dock top", "DockTop();", "images\\dockTop.ico"); 
		optMenuZone[6] = new MenuItem("Dock fill", "DockFill();", "images\\dockFill.ico"); 
		optMenuZone[7] = new MenuItem("hr", "hr"); 
		optMenuZone[8] = new MenuItem("Properties", "Properties();"); 
	
		var cmZone = new ContextMenu(optMenuZone); 
		cmZone.Create(); 

/******************************************************
*	setari document 
******************************************************/
		document.onclick = OnClickDoc; 
		document.onmousemove = MouseMoveDoc; 
		document.onmouseup = ZoneMouseUp; 
		
		CreateDisplay(); 

/******************************************************
*	functii meniu display  
******************************************************/
		function About()
		{
			window.showModalDialog("about.html"); 
		}
		</script>
		<link href="styleDisplay.css" type="text/css" rel="stylesheet">
		<link href="styleCM.css" rel="stylesheet" type="text/css">
		<link href="styleZone.css" rel="stylesheet" type="text/css">

</head>
<body>



</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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


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

Comments and Discussions