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

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

Ok, Roberto. I will rename.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
luisfrancisco62
Posts: 66
Joined: Thu Mar 18, 2010 12:16 am
Location: Colombia
Contact:

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

Post by luisfrancisco62 »

ok
User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines

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

Post 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
Regards,

Danny
Manila, Philippines
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

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

Post 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.
Attachments
hmgscript.r28.zip
(1.43 MiB) Downloaded 349 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

That is nice!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

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

Post 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
BPD
Convert Dream into Reality through HMG
User avatar
pctoledo
Posts: 123
Joined: Wed Aug 25, 2010 10:45 am
Location: Araçatuba - SP - Brazil
Contact:

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

Post 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);
Regards/Saludos,

Toledo

Clipper On Line
Post Reply