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

Moderator: Rathinagiri

User avatar
Roberto Lopez
HMG Founder
Posts: 3900
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 136 times

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

Post by Roberto Lopez » Mon Jul 02, 2012 4:14 pm

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: 3900
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 136 times

Post by Roberto Lopez » Mon Jul 02, 2012 4:18 pm

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: 5173
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 136 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Mon Jul 02, 2012 4:52 pm

Ok, Roberto. I will rename.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.


User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines
Been thanked: 1 time

Post by dhaine_adp » Tue Jul 03, 2012 8:06 pm

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: 3900
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 136 times

Post by Roberto Lopez » Wed Jul 04, 2012 1:32 am

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: 3900
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 136 times

Post by Roberto Lopez » Wed Jul 04, 2012 3:16 am

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 155 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Rathinagiri
Posts: 5173
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 136 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Wed Jul 04, 2012 4:02 am

That is nice!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
bpd2000
Posts: 953
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 127 times
Been thanked: 43 times

Post by bpd2000 » Wed Jul 04, 2012 8:58 am

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: 116
Joined: Wed Aug 25, 2010 10:45 am
Location: Araçatuba - SP - Brazil
Has thanked: 3 times
Been thanked: 5 times
Contact:

Post by pctoledo » Thu Jul 05, 2012 3:06 am

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