Experiments for future HMGSCRIPT versions...

Moderator: Rathinagiri

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

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

Roberto


(Veritas Filia Temporis)
User avatar
serge_girard
Posts: 3158
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Experiments for future HMGSCRIPT versions...

Post by serge_girard »

This would be great !

Serge
There's nothing you can do that can't be done...
Post Reply