Page 26 of 28

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sun Jul 08, 2012 10:17 pm
by Roberto Lopez
HMGSCRIPT R31

EDIT: Download link updated to hmgscript.r31b.

- new: setOrder( cOrder ) method for Browse class.

- new: setFilter( cFilter ) method for Browse class.

- changed: Optimized Browse.

- changed: Paged Browse demo.
HMGSCRIPT REFERENCE (R31) - Roberto Lopez (http://www.hmgforum.com)

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()

------------------------------------------------------------------------------------------------

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')" );

------------------------------------------------------------------------------------------------

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()

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------

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()

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------

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()

------------------------------------------------------------------------------------------------

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()

------------------------------------------------------------------------------------------------

APPEND

Appends a record.

Syntax:

Append( cTable , aColumns , aValues )

Notes:

aValues array. The dates must be specified as ANSI strings.
Logical fields can be specified as boolean or strings ('Yes' or 'No').
The numeric fields can be specified as numbers or strings.

------------------------------------------------------------------------------------------------

DELETE

Delete records matching the cForExpr.

Syntax:

Delete( cTable , cForExpr )

------------------------------------------------------------------------------------------------

MODIFY

Modifies records matching the cForExpr.

Syntax:

Modify( cTable , aColumns , aValues , cForExpr )

Notes:

aValues array. The dates must be specified as ANSI strings.
Logical fields can be specified as boolean or strings ('Yes' or 'No').
The numeric fields can be specified as numbers or strings.

------------------------------------------------------------------------------------------------

LOGIN

Syntax:

Login( cUser , cPassword )

------------------------------------------------------------------------------------------------

LOGOUT

Syntax:

Logout()

------------------------------------------------------------------------------------------------

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, cDbfFile, aColumns,
aHeaders , cForExpr , cOrder , nInnerWidth [,nPageSize] )

Methods:

- refresh()
- getSelectedRows()
- getRowCount()
- select()
- unSelect()
- getCell(nRow,nCount)
- getSelectedRowCount()
- getPageSize()
- loadPage( nPage )
- recordCount()
- setOrder( cOrder )
- setFilter( cFilter )
- getId()


Example:

oBrowse = new Browse( oParent , 050 , 050 , 550 , 300 ,
'test' , [ 'code' , 'first' , 'last' , 'birth' , 'married' ] ,
[ 'Code' , 'First' , 'last' , 'Birth' , 'Married' ] ,
'code < 100' ,
'code' , 700 );

oBrowse.refresh()

------------------------------------------------------------------------------------------------

QUERY

Returns a recordset from a server table as an array.

Syntax:

Query ( cDbf, aColumns, cForExpr, cOrder )

Example:

aRecordSet = Query ( 'test' ,
[ 'code' , 'first' , 'last' , 'birth' , 'married' ] ,
'code<=10' , '' );

------------------------------------------------------------------------------------------------

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' ] );

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------

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() );

------------------------------------------------------------------------------------------------
Enjoy!

EDIT: Download link updated to hmgscript.r31b.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sun Jul 08, 2012 10:31 pm
by esgici
Thanks Roberto :)

Best Regards

--

Esgici

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sun Jul 08, 2012 10:38 pm
by Roberto Lopez
Hi All,

After R31 release, I'll play pause on development to think on future directions and to learn more about JavaScript.

I'm really happy with the work done.

Ten years after the initial release of MiniGUI library, that allowed us to go to the GUI world, we are going to the web.

The spirit is the same:

- Easy to learn.
- Easy to write.
- Easy to maintain
- Powerful.

This is the xBase spirit.

There is a lot of work to do yet, but, we are ready to create applications and deploy them everywhere, on any device, without care about what OS it uses.

The main library, is extremely easy to expand to satisfy your needs (if required) so, if something is missing for you, you can add it.

Thanks to all for your support.

Enjoy!

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sun Jul 08, 2012 10:39 pm
by Roberto Lopez
esgici wrote:Thanks Roberto :)

Best Regards

--

Esgici
Thanks to you for your support!

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sun Jul 08, 2012 10:51 pm
by esgici
Hello Roberto

In fact I can't support sufficiently :(

But what I'm stand to you, as always :D

Best regards.

--

Esgici

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Mon Jul 09, 2012 5:38 am
by bpd2000
Roberto Lopez wrote:

The spirit is the same:
- Easy to learn.
- Easy to write.
- Easy to maintain
- Powerful.
HMG is easy to understan and use, The same principal is continue in HMGSCRIPT
I salute you for your contribution and principal

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Mon Jul 09, 2012 9:27 am
by luisfrancisco62
FELCITACIONES desde COLOMBIA

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Mon Jul 09, 2012 1:19 pm
by luisvasquezcl
Estimado Roberto,
te informo que en esta versión los metodos getValue no funcionan en CoolNovo version 2.0.2.26 (Chrome) pero en Firefox funcionan correctamente.
Probé la versión r31b.

Saludos cordiales,
Luis Vasquez.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Mon Jul 09, 2012 1:25 pm
by luisvasquezcl
Mirando la consola de javascript de coolnovo, me indica que el error corresponde a que el servidor no responde. No se está ejecutando el uhttp.exe porque no quiero probar el browse sino el resto de los controles.
El ejemplo de Checkbox y Textbox al leer el valor del control ( getValue ) dependen de que uhttp.exe esté funcionando?.
Pienso que no debería ser así, es correcto esto?
Saludos cordiales,
Luis Vasquez.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Mon Jul 09, 2012 2:02 pm
by Roberto Lopez
luisvasquezcl wrote:Estimado Roberto,
te informo que en esta versión los metodos getValue no funcionan en CoolNovo version 2.0.2.26 (Chrome) pero en Firefox funcionan correctamente.
Probé la versión r31b.

Saludos cordiales,
Luis Vasquez.
Aquí todo funciona perfectamente y tengo mi Chrome actualizado:
Image1.png
Image1.png (37.3 KiB) Viewed 13193 times