Experiments for future HMGSCRIPT versions...

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 3991
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 85 times
Been thanked: 184 times

Experiments for future HMGSCRIPT versions...

Post by Roberto Lopez »

Hi All,

Instead of using pixels to define position and (in some cases) size of GUI objects, we could use relative units, as seen on this table (from w3schools: http://www.w3schools.com/cssref/css_units.asp):
Unit Description
em Relative to the font-size of the element (2em means 2 times the size of the current font) Try it
ex Relative to the x-height of the current font (rarely used) Try it
ch Relative to width of the "0" (zero)
rem Relative to font-size of the root element
vw Relative to 1% of the width of the viewport
vh Relative to 1% of the height of the viewport
vmin Relative to 1% of viewport's smaller dimension
vmax Relative to 1% of viewport's larger dimension
px pixels (1px = 1/96th of 1in)
Meaning that we could make our GUIs automatically adjust to screen sizes or similar criteria.

This, eventually, could allow us to use an unique interface for mobile and desktop (this idea must be tested and adjusted)

For this, the library should be modified to accept string as coordinates and sizes, in such way to work like that:

Code: Select all

	oMain = new Form( "HMGSCRIPT Main Demo (Desktop Style)", '90%' , '90%' );
To be tested...


(Veritas Filia Temporis)

User avatar
Posts: 2771
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
Location: Belgium
Has thanked: 1067 times
Been thanked: 193 times

Post by serge_girard »

This would be great !

Serge Now Is The Happiest Time Of Your Life !

Post Reply