Relative measurments - JSClient - OS8
Aidan Dunn
aidan at freedomsoftware.co.nz
Tue Dec 13 18:59:19 EST 2016
Just a follow up on my current investigation.
I've gotten a few personal emails that have given me an idea on what could have been done.
I have been able to setup a method that alters the stylesheet live, increasing or decreasing the website's font-size via CSS. This uses Javascript to alter the stylesheets on the client (If you're interested in the javascript functions, feel free to ask).
I had a small attempt at using the same technique to add "em" based measurements to a button. I was able to alter the dimensions of the button based on the set font size. However there is a massive blocker in regards to how the JSClient creates the website layout.
The websites generated are completely absolutely positioned (static) meaning they don't flow like a normal website would, I suspect this is to make it compatible with Omnis Studio's design method of drag and drop positioning. This means that, yes the button size increases, but nothing moves around to accommodate this new size.
There is also the problem that every element on the page has a width / height specified. This means that you may alter the size of the button and it's control element (direct parent), however the containing elements such as subwindows are also statically positioned, so any increase in size is clipped out of sight. You would need to do some serious trial and error styling to get the system to behave.
Aidan
________________________________________
From: omnisdev-en [omnisdev-en-bounces at lists.omnis-dev.com] on behalf of Aidan Dunn [aidan at freedomsoftware.co.nz]
Sent: Tuesday, 13 December 2016 10:08 a.m.
To: omnisdev-en at lists.omnis-dev.com
Subject: Relative measurments - JSClient - OS8
Hi all,
Just to introduce myself, I am a new developer to Omnis Studio, brought on by Freedom Software here in New Zealand; been working with the platform off and on for the past year (I'm a full stack web developer by trade). Some of you may have met me at this recent Euromnis event.
And to my question...
I was wondering if anyone has had any experience in using non pixel based measurements for "objects" on a class/window with the JSClient?
Being a web developer I have had the luxury of multiple methods to describe the size of an element on the page. In particular I am referring to "em" and "rem" the web browsers can use to base dimensions on the size of font. Where this is not always the case, this is usually referred to 1 em being the width of an "m" on the page; with "em" being the current HTML element's font size and "rem" being the page's body element font size.
Recently the need to specify a font size in our application has come up, enabling users to change the size of their application's font to their needs at the time (through an options screen or such). Many of our clients also use either the browser's or operating system's ability to automatically scale fonts, etc to a percentage above or below 100%. This can cause a large issue for pixel based elements because they don't scale with the font and that leads to the text breaking outside the element or some such other disaster-ish behaviour.
I'd like the solution to be omnis-based as not everyone in our office is as savvy as I am with HTML, css, etc and being able to co-operatively work on the application is desirable.
Any help / advice regarding this would be appreciated.
Regards,
Aidan Dunn
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com
More information about the omnisdev-en
mailing list