Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_espanol thread: Menu


Message #1 by "L.I. Gerardo Angeles Nava.mx" <jet_x15@y...> on Thu, 25 Jan 2001 12:57:59 -0800 (PST)
(espero no molestar a las personas de aspnet

con este mensaje pero me gustaria que alguien

que programe en C# me mandara un ejemplo

de como se haria el programa en esta herramienta)



Saludos a tod@s...,



Estoy incursionando en la programacion orientada

a objetos y me gustaria saber si estoy programando

como tal.



Me gustaria que alguien experimentado me de su

opinion.





Actualmente estoy desarrollando un menu en JavaScript,

si ya se no es una herramienta para programar

orientado a objetos, pero se puede simular.



Les envio parte de lo que sera el Menu y antes de

seguir

programando deseo saber si voy mal o bien.



El objetivo es hacer un archivo externo "menu.js"

en el cual se tendra la programacion de la clase

"Menu"

y en el documento web crear un objeto de tipo "Menu".



A través de una hoja de estilos se podra interactuar

con el menu para modificar colores, fuentes, etc.



Gracias!.



<!--

Autor	: Gerardo Angeles Nava

Fecha	: 19 de Enero, 2001

Versión : 1.01

-->

<html>

<head>

	<title>constructor</title>

	<style type="text/css">

		<!-- MENU -->

		.cssMenuNormal{color:black;background-color:silver;

border:none}

		.cssMenuActivo{color:white; background-color:teal;

border:groove}

		<!-- OPCION MENU -->

		.cssOpcionNormal{color:orange; background-color:blue

border:none}

		.cssOpcionActivo{color:blue; background-color:orange

border:groove}

	</style>

	<script language="JavaScript">	

		<!--						

		//1.-Estan mal los calculos del left y top de las

opciones!

		//2.-Cambiar el nombre de los objetos creados		

		// ******************  MENU

*********************************

		

		var menus = new Array()

		var numMenu = 0

		var maxWidth = 80



// ******************  FUNCIONES JavaScript

*********************************

		

		function activo(t){

			t.className = "cssMenuActivo"

		}

		

		function normal(t){

			t.className = "cssMenuNormal"

		}



// ******************  OBJETO MENU

*********************************

		

		function oMenuHor(opciones,l,t){		

			this.name		= "Menu" + numMenu



			this.color		= "black"

			this.bgColor 	= "silver"



			this.position	= "absolute"

			this.border		= "none"

			this.textAlign	= "center"

			this.left		= l

			this.top		= t

			this.height		= 28

			this.width		= mWidthMenuHor(opciones)

			this.makeCSS	= mCSSMenuHor(this)

			this.makeOptions= mOptionsMenuHor(opciones,l,t)

			this.closeTag   = mCloseMenuHor()

		}						

		

		// ******************  METODOS DEL OBJETO MENU

**************************

		

		function mCSSMenuHor(t){

			document.write("<style type=\"text/css\">")

			document.write("#" + t.name)

			document.write(" {")

			document.write("position : " + t.position + ";")

			document.write(" color : " + t.color + ";")

			document.write(" background-color : " + t.bgColor +

";")

			document.write(" border : " + t.border + ";")

			document.write(" text-align : " + t.textAlign +

";")

			document.write(" left : " + t.left + ";")

			document.write(" top : " + t.top + ";")

			document.write(" width : " + t.width + ";")

			document.write(" height : " + t.height + ";")

			document.write(" }")

			document.write("</style>")

			document.write("<div id=\"" + t.name + "\">")

		}

		

		function mWidthMenuHor(o){

			var oTmp = o.split(",")

			return (maxWidth*(oTmp.length)+1)

		}



		function mOptionsMenuHor(o,l,t){

			var opcionesMenu = o.split(",")

			for(i = 0; i <= (opcionesMenu.length - 1); i++){			

				if (i == 0)

					opcionesMenu[i] = new

oOpcMenuHor(opcionesMenu[i],0,0,maxWidth)

				else{

					opcionesMenu[i] = new

oOpcMenuHor(opcionesMenu[i],maxWidth*i,0,maxWidth)

				}

			}

		}

		function mCloseMenuHor(){

			document.write("</div>")

		}

		

// ******************  OBJETO OPCION menu

*********************************

				

		function oOpcMenuHor(nameOpcMenu,l,t,w){

			this.name		= nameOpcMenu			

			this.position	= "absolute"

			this.border		= "none"

			this.textAlign	= "center"

			this.left		= l

			this.top		= t

			this.width		= w

			this.height		= 25

			this.css 		= mCSSOpcMenuHor(this)

		}				



		// ******************  METODO OBJETO OPCION menu

*************************

		

		function mCSSOpcMenuHor(t){

			document.write("<style type=\"text/css\">")

			document.write("#" + t.name)

			document.write(" {")

			document.write("position : " + t.position + ";")

			document.write(" left : " + t.left + ";")

			document.write(" top : " + t.top + ";")

			document.write(" width : " + t.width + ";")

			document.write(" height : " + t.height + ";")

			document.write(" }")

			document.write("</style>")

			document.write("<div id=" + t.name + ">" + t.name +

"</div>")

			document.write("<div id=" + t.name + "

onmouseover=\"activo(this)\"

onmouseout=\"normal(this)\">" + t.name + "</div>")

		}



		function oSubMenuHor(){

		}				

		function oOpcSubMenuHor(){

		}				

		//-->

	</script>	

</head>



<body>

<script language="JavaScript">

	<!--

	var m = new

oMenuHor("File,Edit,Tools,View,Window,Project,Help",0,0)

	

	//-->

</script>

</body>

</html>







__________________________________________________

Do You Yahoo!?

Yahoo! Auctions - Buy the things you want at great prices. 

http://auctions.yahoo.com/

Message #2 by =?us-ascii?Q?Ezequiel_Espindola?= <eespindola@b...> on Thu, 25 Jan 2001 20:35:53 -0300
Yo diria que si te funciono es la unica manera que conozco de simular

objetos en Javascript. O sea, no es programacion orientada a objetos sino

que es programacion basada en objetos.

Esto es offtopic.. fijate si encontras en www.asplists.com alguna lista en

la que te puedan ayudar como aspclient.



Suerte!



Ezequiel Espindola



-----Original Message-----

From: L.I. Gerardo Angeles Nava.mx [mailto:jet_x15@y...]

Sent: Thursday, January 25, 2001 5:58 PM

To: ASP.Net en Espaqol

Subject: [aspx_espanol] Menu





(espero no molestar a las personas de aspnet

con este mensaje pero me gustaria que alguien

que programe en C# me mandara un ejemplo

de como se haria el programa en esta herramienta)



Saludos a tod@s...,



Estoy incursionando en la programacion orientada

a objetos y me gustaria saber si estoy programando

como tal.



Me gustaria que alguien experimentado me de su

opinion.





Actualmente estoy desarrollando un menu en JavaScript,

si ya se no es una herramienta para programar

orientado a objetos, pero se puede simular.



Les envio parte de lo que sera el Menu y antes de

seguir

programando deseo saber si voy mal o bien.



El objetivo es hacer un archivo externo "menu.js"

en el cual se tendra la programacion de la clase

"Menu"

y en el documento web crear un objeto de tipo "Menu".



A travis de una hoja de estilos se podra interactuar

con el menu para modificar colores, fuentes, etc.



Gracias!.



<!--

Autor	: Gerardo Angeles Nava

Fecha	: 19 de Enero, 2001

Versisn : 1.01

-->

<html>

<head>

	<title>constructor</title>

	<style type="text/css">

		<!-- MENU -->

		.cssMenuNormal{color:black;background-color:silver;

border:none}

		.cssMenuActivo{color:white; background-color:teal;

border:groove}

		<!-- OPCION MENU -->

		.cssOpcionNormal{color:orange; background-color:blue

border:none}

		.cssOpcionActivo{color:blue; background-color:orange

border:groove}

	</style>

	<script language="JavaScript">

		<!--

		//1.-Estan mal los calculos del left y top de las

opciones!

		//2.-Cambiar el nombre de los objetos creados

		// ******************  MENU

*********************************



		var menus = new Array()

		var numMenu = 0

		var maxWidth = 80



// ******************  FUNCIONES JavaScript

*********************************



		function activo(t){

			t.className = "cssMenuActivo"

		}



		function normal(t){

			t.className = "cssMenuNormal"

		}



// ******************  OBJETO MENU

*********************************



		function

uHor(opciones,l,t){		

			this.name		= "Menu" + numMenu



			this.color		= "black"

			this.bgColor 	= "silver"



			this.position	= "absolute"

			this.border		= "none"

			this.textAlign	= "center"

			this.left		= l

			this.top		= t

			this.height		= 28

			this.width		= mWidthMenuHor(opciones)

			this.makeCSS	= mCSSMenuHor(this)

			this.makeOptions= mOptionsMenuHor(opciones,l,t)

			this.closeTag   = mCloseMenuHor()

		}						

		

		// ******************  METODOS DEL OBJETO MENU

**************************

		

		function mCSSMenuHor(t){

			document.write("<style type=\"text/css\">")

			document.write("#" + t.name)

			document.write(" {")

			document.write("position : " + t.position + ";")

			document.write(" color : " + t.color + ";")

			document.write(" background-color : " + t.bgColor +

";")

			document.write(" border : " + t.border + ";")

			document.write(" text-align : " + t.textAlign +

";")

			document.write(" left : " + t.left + ";")

			document.write(" top : " + t.top + ";")

			document.write(" width : " + t.width + ";")

			document.write(" height : " + t.height + ";")

			document.write(" }")

			document.write("</style>")

			document.write("<div id=\"" + t.name + "\">")

		}

		

		function mWidthMenuHor(o){

			var oTmp = o.split(",")

			return (maxWidth*(oTmp.length)+1)

		}



		function mOptionsMenuHor(o,l,t){

			var opcionesMenu = o.split(",")

			for(i = 0; i <= (opcionesMenu.length - 1); i++){			

				if (i == 0)

					opcionesMenu[i] = new

oOpcMenuHor(opcionesMenu[i],0,0,maxWid

th)

				else{

					opcionesMenu[i] = new

oOpcMenuHor(opcionesMenu[i],maxWidth*i,0,maxWidth)

				}

			}

		}

		function mCloseMenuHor(){

			document.write("</div>")

		}



// ******************  OBJETO OPCION menu

*********************************



		function oOpcMenuHor(nameOpcMenu,l,t,w){

			this.name		= nameOpcMenu

			this.position	= "absolute"

			this.border		= "none"

			this.textAlign	= "center"

			this.left		= l

			this.top		= t

			this.width		= w

			this.height		= 25

			this.css 		= mCSSOpcMenuHor(this)

		}



		// ******************  METODO OBJETO OPCION menu

*************************



		function mCSSOpcMenuHor(t){

			document.write("<style type=\"text/css\">")

			document.write("#" + t.name)

			document.write(" {")

			document.write("position : " + t.position + ";")

			document.write(" left : " + t.left + ";")

			document.write(" top : " + t.top + ";")

			document.write(" width : " + t.width + ";")

			document.write(" height : " + t.height + ";")

			document.write(" }")

			document.write("</style>")

			document.write("<div id=" + t.name + ">" + t.name +

"</div>")

			document.write("<div id=" + t.name + "

onmouseover=\"activo(this)\"

onmouseout=\"normal(this)\">" + t.name + "</div>")

		}



		function oSubMenuHor(){

		}

		function oOpcSubMenuHor(){

		}

		//-->

	</script>

</head>



<body>

<script language="JavaScript">

	<!--

	var m = new

oMenuHor("File,Edit,Tools,View,Window,Project,Help",0,0)



	//-->

</script>

</body>

</html>







__________________________________________________

Do You Yahoo!?

Yahoo! Auctions - Buy the things you want at great prices.

http://auctions.yahoo.com/



---

Usted esta suscrito a aspx_espanol como:

eespindola@b...

Para darse de baja, envme un mensaje en blanco a

$subst('Email.Unsub')




  Return to Index