
HOW TO CONTRIBUTE - Roberto lopez (www.hmgforum.com)
----------------------------------------------------


Contribution are welcome, but, please do it without change the core library source file
(hmgscript.js). Do it in a separate file (ie: contrib.js).

As an example I've enhanced the button class with 'enanle()' and 'disable()' methods.

The file 'www/lib/contrib.js' will contain the following:


///////////////// Start of contrib.js File //////////////////////////////////////

Button.prototype.disable = function()
{
	document.getElementById( this.getId() ).disabled = true;
}

Button.prototype.enable = function()
{
	document.getElementById( this.getId() ).disabled = false;
}

/////////////////// End of contrib.js File //////////////////////////////////////


Then in index.html head section, you'll need to include a reference to contrib.js:


   <head>
      <title></title>
      <link rel="stylesheet" type="text/css" href="themes/hmgs.xp.css">
      <script type="text/javascript" src="lib/hmgscript.js"></script>
      <script type="text/javascript" src="lib/contrib.js"></script>
      <script type="text/javascript" src="app/demo.js"></script>
   </head>


Finally, to test it, I'll modified the Button demo as follows:


function test_1() 
{
   oWin = new Form( "Button Demo", 600 , 300 );

   oBtn1 = new Button( oWin , 50 , 240 , 
	"Set Btn Value" , "oBtn1.setValue('New Value')" );  

   oBtn2 = new Button( oWin , 130 , 240 , 
	"Disable oBtn1" , "oBtn1.disable()" );  

   oBtn3 = new Button( oWin , 170 , 240 , 
	"Enable oBtn1" , "oBtn1.enable()" );  

   oBtn2 = new Button( oWin , 240 , 248 , "Close" , "oWin.release()" );  
}


