Page 23 of 28

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

Posted: Mon Jul 02, 2012 4:14 pm
by Roberto Lopez
rathinagiri wrote:This is my small contribution to the contrib.js (for grid column alignment)
<...>
Usage:

oGrid1.justify( [ 'right', 'left', 'center', 'justify', 'right' ] );
Thanks!

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

Posted: Mon Jul 02, 2012 4:18 pm
by Roberto Lopez
rathinagiri wrote:Usage:

oGrid1.justify( [ 'right', 'left', 'center', 'justify', 'right' ] );
And...

Could be better, to be inline with the other methods, if you rename to setJustify.

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

Posted: Mon Jul 02, 2012 4:52 pm
by Rathinagiri
Ok, Roberto. I will rename.

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

Posted: Tue Jul 03, 2012 3:09 pm
by luisfrancisco62
ok

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

Posted: Tue Jul 03, 2012 8:06 pm
by dhaine_adp
Hi Roberto,

Thank you once again for leading HMG into another paradigm and setting a new standard together with HB. This one is truly very HMG. In short span of time a new library emerge as extension to HMG. I truly salute your programming abilities. Thanks for sharing the code with us here at HMG Forum.

Regards,

Danny

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

Posted: Wed Jul 04, 2012 1:32 am
by Roberto Lopez
dhaine_adp wrote:Hi Roberto,

Thank you once again for leading HMG into another paradigm and setting a new standard together with HB. This one is truly very HMG. In short span of time a new library emerge as extension to HMG. I truly salute your programming abilities. Thanks for sharing the code with us here at HMG Forum.

Regards,

Danny
Thnaks for yor kind words.

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

Posted: Wed Jul 04, 2012 3:16 am
by Roberto Lopez
HMGSCRIPT R28
- new: CheckBox, getValue() and setValue() methods. They accepts and return a string
('Yes' and 'No').

- new: textBox. setFocus() method added.

- changed: Append and Modify functions (aValues array). The dates must be specified as ANSI strings now. Logical fields can be specified as boolean or string ('Yes' or 'No'). The numeric fields
can be specified as numbers or strings.

- changed: Initial value for Checkbox can be boolean or string ('Yes' or 'No').

- fixed: variables scope in library internals.

- changed: Browse demo. It features an append window now. Edit and append, supports all column tyoes now.

- changed: TextBox. setAutoFocus() method eliminated.

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

Posted: Wed Jul 04, 2012 4:02 am
by Rathinagiri
That is nice!

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

Posted: Wed Jul 04, 2012 8:58 am
by bpd2000
dhaine_adp wrote:
Hi Roberto,

Thank you once again for leading HMG into another paradigm and setting a new standard together with HB. This one is truly very HMG. In short span of time a new library emerge as extension to HMG. I truly salute your programming abilities. Thanks for sharing the code with us here at HMG Forum.

Regards,

Danny
Long Live Roberto

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

Posted: Thu Jul 05, 2012 3:06 am
by pctoledo
Method setProperty for LABEL:

Code: Select all

//////////////////////////////////////////////////////////////////////////////////
// Label 
//////////////////////////////////////////////////////////////////////////////////

function Label( oParent , nRow , nCol , cValue )
{

	// Create the label on the fly, set its properties and append to the specified
	// parent window

	var cId = 'control' + (nControlCount).toString() ; nControlCount++ ;

	var control = document.createElement( "span" );
      
	control.className      = "label"    ;
	control.style.top      = nRow       ;
	control.style.left     = nCol       ;
	control.innerHTML      = cValue     ;
	control.id             = cId        ;
      
	document.getElementById( oParent.getId() ).appendChild( control )                ;

	this.getId = function ()
	{
		return cId;		
	}
	this.setProperty = function ( cPropertyName, PropertyValue )
	{

		if ( cPropertyName.toLowerCase() == 'row' )
		{
			document.getElementById(cId).style.top = PropertyValue ;
		}
		else if ( cPropertyName.toLowerCase() == 'col' )
		{
			document.getElementById(cId).style.left = PropertyValue ;
		}
		else if ( cPropertyName.toLowerCase() == 'fontname' )
		{
			document.getElementById(cId).style.fontFamily = PropertyValue ;
		}
		else if ( cPropertyName.toLowerCase() == 'fontcolor' ) 
		{
			document.getElementById(cId).style.color = PropertyValue ;
		}
		else if ( cPropertyName.toLowerCase() == 'fontsize' )
		{
			document.getElementById(cId).style.fontSize = PropertyValue ;
		}
		else if ( cPropertyName.toLowerCase() == 'bold' )
		{
			if (PropertyValue)
			{
				document.getElementById(cId).style.fontWeight = 'bold' ;
			}
			else
			{
				document.getElementById(cId).style.fontWeight = 'normal' ;
			}
		}
		else if ( cPropertyName.toLowerCase() == 'italic' )
		{
			if (PropertyValue)
			{
				document.getElementById(cId).style.fontStyle = 'italic' ;
			} 
			else 
			{
				document.getElementById(cId).style.fontStyle = 'normal' ;
			}
		}
		else if ( cPropertyName.toLowerCase() == 'underline' )
		{
			if (PropertyValue)
			{
				document.getElementById(cId).style.textDecoration = 'underline' ;
			} 
			else 
			{
				document.getElementById(cId).style.textDecoration = 'none' ;
			}
		}
		else if ( cPropertyName.toLowerCase() == 'strikeout' )
		{
			if (PropertyValue)
			{
				document.getElementById(cId).style.textDecoration = 'line-through' ;
			} 
			else 
			{
				document.getElementById(cId).style.textDecoration = 'none' ;
			}
		}
	}
}
sample of use:

Code: Select all

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

oLabelx = new Label( oWin , 100 , 260 , "This is a Label!" );
oLabelx.setProperty("fontcolor","red");
oLabelx.setProperty("fontsize","20");
oLabelx.setProperty("col",100);
Possible properties:
col - column position of a Label
sample: oLabelx.setProperty("col",100);

row - row position of a Label
sample: oLabelx.setProperty("row",240);

fontname - font name of Label
sample: oLabelx.setProperty("fontname","Arial");

fontcolor - font color of Label
sample: oLabelx.setProperty("fontcolor","red");

fontsize - font size of Label
sample: oLabelx.setProperty("fontsize","18");

bold - font bold property
sample: oLabelx.setProperty("bold",true);

italic - font italic property
sample: oLabelx.setProperty("italic",true);

underline - font underline property
sample: oLabelx.setProperty("underline",true);

strikeout - font strikeout property
sample: oLabelx.setProperty("strikeout",true);