HMGScript Ready reckoner


FORM: 
-----

Element: DIV 

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	Form( cCaption , nWidth , nHeight )

Methods:

	- release( cValue )
	- getId()

Example:

	oWin = new Form ( "Window Demo", 600 , 300 );

	oWin.release()
Home
------------------------------------------------------------------------------------------------

BUTTON:
 
-------

Element: INPUT (Type: BUTTON)

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	Button( oParent , nRow , nCol , cCaption , cOnClick [,nWidth] )

Methods:

	- setValue( cValue )
	- getValue()
	- enable()
	- disable()
	- getId()

Example:

	oBtn = new Button( oForm , 
		50 , 240 , 
		"Set Btn Value" , 
		"oBtn.setValue('New Value')" );  
Home
------------------------------------------------------------------------------------------------

LABEL:
 
------

Element: SPAN

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	Label( oParent , nRow , nCol , cValue )

Methods:

	- getId()
Home
------------------------------------------------------------------------------------------------

TEXTBOX:
 
--------

Element: INPUT (Type: TEXT/PASSWORD)

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	TextBox( oParent , nRow , nCol , cValue , bPassword )

Methods:

	- setValue( cValue )
	- setFocus()
	- enable()
	- disable()
	- getValue()
	- setJustify( cAlign )
	- getId()
	- setAsNumber(nValue)
	- getAsNumber()
	- setNumericMask ( nIintDigits , nDecimals , cDecimalSeparator , 
                     cGgroupSeparator , bAllowNegative, bLeftToRight, 
                     cCurrencySymbol )

	- setStringMask ( cMask )

		# digit
		A alphabetic
		U uppercase 
		L lowercase 
		C capitalize 
		? any character 
		\ escape

Notes:

	Possible values for cAlign: 'right', 'left', 'center' and 'justify'.

Example:

	oText = new TextBox( oForm , 130, 230, "TextBox!" );

	alert( oText.getValue() );
Home
------------------------------------------------------------------------------------------------

EDITBOX:
 
--------

Element: INPUT (Type: TEXTAREA)

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	EditBox( oParent , nRow , nCol , cValue )

Methods:

	- setValue( cValue )
	- getValue()
	- getId()

Example:

	oEdit = new EditBox( oForm , 130, 230, "TextBox!" );

	alert( oEdit.getValue() );
Home
------------------------------------------------------------------------------------------------

CHECKBOX:
 
---------

Element: INPUT (Type: CHECKBOX)

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	CheckBox( oParent , nRow , nCol , xChecked )

Notes:

	xChecked parameter can be boolean (true or false) or string ('Yes' or 'No')

Methods:

	- check()
	- unCheck()
	- isChecked()
	- getValue()
	- setValue( cValue )
	- getId()

Example:

	oCheck = new CheckBox( oForm , 140 , 280 , true );

	alert(oCheck.isChecked())
	oCheck.check()
	oCheck.unCheck()
Home
------------------------------------------------------------------------------------------------

COMBOBOX:
 
---------

Element: SELECT 

You can use all the properties, events and methods availables for them via DOM.

Syntax:

	ComboBox( oParent , nRow , nCol , aOptions , aValues [, nSelectedIndex] )

Methods:

	- getValue( nIndex )
	- setValue( nIndex , cValue )
	- setSelectedIndex ( nIndex )
	- getSelectedIndex()
	- getId()

Example:

	oCombo = new ComboBox( oForm , 140 , 270 , 
		[ 'one' , 'two' , 'three' ] , 
		[ 'value one' , 'value two' , 'value three' ] , 0 );

	alert ( oCombo.getSelectedIndex() );
Home
------------------------------------------------------------------------------------------------

IMAGE:
 
------

Element: IMAGE

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	Image( oParent , nRow , nCol , cSrc )

Methods:

	- getId()
Home
------------------------------------------------------------------------------------------------

PANEL:
 
------

Element: DIV 

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	Panel( oParent , nRow , nCol , nWidth , nHeight , cValue )

Methods:

	- getId()
Home
------------------------------------------------------------------------------------------------

BROWSE:
-------

Elements: DIV/TABLE

Creates an HTML table inside a scrollable DIV, loaded with the specified dbf query.

Syntax:

	Browse( oParent , nRow , nCol , nWidth , nHeight , cFile , nInnerWidth [, cFilter] )

Methods:

	- refresh()
	- getSelectedRows()
	- getRowCount()
	- select()
	- unSelect()
	- getCell(nRow,nCount)
	- getSelectedRowCount()
	- setFilter( cFilter )
	- clearFilter()
	- getId()

	
Example:

    oBrowse = new Browse( oWin , 
     	050 , 050 , 510 , 340 , 'test.dbf' , 1800 ); 
Home
------------------------------------------------------------------------------------------------

GRID:
-----

Elements: DIV/TABLE

Creates an HTML table inside a scrollable DIV.

Syntax:

	Grid( oParent, nRow, nCol, nWidth, nHeight, aHeaders, nInnerWidth )

Methods:

	- addRow(aRow)
	- getSelectedRows()
	- getRowCount()
	- select()
	- unSelect()
	- getCell(nRow,nCount)
	- setCell(nRow,nCount,cValue)
	- getSelectedRowCount()
	- deleteRow(nRow)
	- setJustify(aAlign)
	- getId()

Notes:

	Possible values for aAlign array: 'right', 'left', 'center' and 'justify'.

Example:

	oGrid = new Grid( oWin, 40, 020, 480, 190, 
		[ 'One' , 'Two' , 'Three' ], 550 );

	oGrid.addRow ( [ 'cell  1.1' , 'cell  1.2' , 'Cell  1.3' ] );
Home
------------------------------------------------------------------------------------------------

RADIOGROUP:
 
-----------

Element: INPUT (Type: RADIO)

You can use all the properties, events and methods availables for them via DOM.

Syntax:

	RadioGroup( oParent , nRow , nCol , aOptions , nSelectedIndex )

Methods:

	- setSelectedIndex ( nIndex )
	- getSelectedIndex()
	- getId( nIndex )

Example:

	oRadio = new RadioGroup( oForm , 140 , 270 , 
		[ 'one' , 'two' , 'three' ] , 
		1 );

	alert ( oRadio.getSelectedIndex() );
Home
------------------------------------------------------------------------------------------------

LISTBOX: 
--------

Element: SELECT 

You can use all the properties, events and methods availables for them via DOM.

Syntax:

	ListBox( oParent , nRow , nCol , aOptions , aValues , nSize [, nSelectedIndex] )

Methods:

	- getValue( nIndex )
	- setValue( nIndex , cValue )
	- setSelectedIndex ( nIndex )
	- getSelectedIndex()
	- getId()

Example:

	oList = new ListBox( oForm , 140 , 270 , 
		[ 'one' , 'two' , 'three' ] , 
		[ 'value one' , 'value two' , 'value three' ] , 3 , 1 );

	alert ( oList.getSelectedIndex() );
Home
------------------------------------------------------------------------------------------------

SPINNER:
 
--------

Element: INPUT (Type: number)

You can use all the properties, events and methods availables for them via DOM.

Syntax:

	Spinner( oParent , nRow , nCol , nValue )

Methods:

	- getValue( nIndex )
	- setValue( nIndex , cValue )
	- setMin( nValue )
	- setMax( nValue )
	- setStep( nValue )
	- getId()

Example:

   oSpinner = new Spinner( oWin , 130, 230, 5 );

   oSpinner.setMin(1);
   oSpinner.setMax(10);
   oSpinner.setStep(0.5);

   alert( oSpinner.getValue() );
Home
------------------------------------------------------------------------------------------------

SLIDER: 
-------

Element: INPUT (Type: range)

You can use all the properties, events and methods availables for them via DOM.

Syntax:

	Slider( oParent , nRow , nCol , nValue )

Methods:

	- getValue( nIndex )
	- setValue( nIndex , cValue )
	- setMin( nValue )
	- setMax( nValue )
	- setStep( nValue )
	- getId()

Example:

   oSlider = new Slider( oWin , 130, 230, 5 );

   oSlider.setMin(1);
   oSlider.setMax(100);
   oSlider.setStep(50);

   alert( oSlider.getValue() );
Home
------------------------------------------------------------------------------------------------

DATEPICKER:
 
-----------

Element: INPUT (Type: DATE)

You can use all the properties, events and methods availables for it via DOM.

Syntax:

	DatePicker( oParent , nRow , nCol , dValue )

Methods:

	- setValue( cValue )
	- getValue()
	- getId()

Example:

	oDate = new DatePicker( oForm , 130, 230, "2012-12-31" );

	alert( oDate.getValue() );
Home
------------------------------------------------------------------------------------------------

SQLCONNECTION
-------------

Syntax:

	SqlConnection( cHostName , cUser , cPassword , cDataBase )


Example:

	oConn = new SqlConnection( 'localhost' , 'root' , 'pass' , 'test' )

Home
------------------------------------------------------------------------------------------------

SQLEXEC
-------
	
Syntax:

	<nAffectedRows> = SqlExec ( oConnection , cSqlCommand )

Example:

	oConn = new SqlConnection( 'localhost' , 'root' , 'pass' , 'test' )

	nAffectedRows = SqlExec ( oConn , 'DELETE FROM TEST WHERE code=123' )

Home
------------------------------------------------------------------------------------------------

SQLBROWSE
---------
	
Syntax:


	SqlBrowse( oParent , nRow , nCol , nWidth , nHeight , oConnection , cQuery, nInnerWidth )


Methods:


	- setQuery()
	- getSelectedRows()
	- getRowCount()
	- getCell(nRow,nCount)
	- select()
	- unSelect()
	- refresh()
	- getId()
	- getSelectedRowCount()


Example:

	oForm = new Form( "SQLBrowse Test", 590 , 480 );

	oConn = new SqlConnection( 'localhost' , 'root', 'vertrigo' , 'test' );

	oBrowse = new SqlBrowse( oForm , 050 , 050 , 510 , 340 , oConn ,  
   	'select * from country', 493 );

Home
------------------------------------------------------------------------------------------------

SQLQUERY
--------
	
Syntax:

	SqlQuery( oConnection , cQuery )


Description:


	Returns an array containing the query result.


Example:


	oConn = new SqlConnection( 'localhost' , 'root', 'vertrigo' , 'test' );

	aQuery = SqlQuery( oConn , 'select * from country' );

	for ( i = 0 ; i < aQuery.length ; i++ )
	{

		field1    = aQuery [i] [0];
		field2    = aQuery [i] [1];
		field3    = aQuery [i] [2];

		alert( field1 + ' ' + field2 + ' ' + field3 );

	}

Home
------------------------------------------------------------------------------------------------

SQLREPORT
---------
	
Syntax:

	SqlReport( oConnection , cQuery , cTitle )


Description:

	Creates a PDF report based on the specified query.


Example:

	oConn = new SqlConnection( 'localhost' , 'root', 'vertrigo' , 'test' );

	n = SqlReport( oConn , 'select * from country' , 'COUNTRIES REPORT' );

Home
------------------------------------------------------------------------------------------------