Same card for two size of controls: phone or tablet
Posted: Mon Oct 19, 2020 9:40 am
Hi all.
I am trying to find how the best way to handle the fact that my standalone will be used both on cellular and tablet screen size.
In fact, for a better user experience, some buttons and controls are sized differently, may be with different size icons, image etc.
First method
In the beginning, my method was to use 2 cards in the same stack:
1) "PhoneCard"
2) "TabletCard"
Most of the scripts, when possibile, where on the stack and I used a lot of behaviour for the controls inside the two cards.
In the preopenstack I decided wich one to use, according to the screenSize, putting their name in a global.
So, a tipical message would be:
While this worked, the growing complexity of the standalone, made me thinking that it would have been easier, particularly on debugging, to have only 1 card, and showing/resizing grouped controls according to the screen size. I could do this because I was able to group the different size controls in only 4/5 groups.
Second method:
- 1 card only
- 4/5 groups made in two sizes (for phone and tablet) and named differently, for example:
On Preopenstack I set a global and show/hide the needed groups:
A typical message would then be:
The first method forced me to duplicate EVERY control script in the two cards, NOT only those with different sizes. This would make the standalone more prone to script errors and generally having less control of what was going on.
The second method works fine, up to now, but the problem is the message path: if I forget to detail every control name (of the 4/5 groups) with a "...of group "ScoreGroupTablet", sometime the message is sent to the hidden group (if I am on phone and the message is sent to the Tablet hidden group).
This because, of course, controls inside the different size groups are named the same.
HOW to solve it:
A) Delete (in the preopenstack) the unwanted size groups:
This would work once the standalone is installed on the device, but it would be a problem on the developing environment
B) Find a way (in the preopenstack) to remove from the message path the unwanted size group.
Is this possible? And how?
Thanks and sorry for the long post
Trevix
I am trying to find how the best way to handle the fact that my standalone will be used both on cellular and tablet screen size.
In fact, for a better user experience, some buttons and controls are sized differently, may be with different size icons, image etc.
First method
In the beginning, my method was to use 2 cards in the same stack:
1) "PhoneCard"
2) "TabletCard"
Most of the scripts, when possibile, where on the stack and I used a lot of behaviour for the controls inside the two cards.
In the preopenstack I decided wich one to use, according to the screenSize, putting their name in a global.
Code: Select all
put "PhoneCard" into gCurrentCard
Code: Select all
put "abc" into fld "TextField" of gCurrentCard
Second method:
- 1 card only
- 4/5 groups made in two sizes (for phone and tablet) and named differently, for example:
On Preopenstack I set a global and show/hide the needed groups:
Code: Select all
put "phone" into gMachine
Show group "ScoreGroupPhone"
Hide group "ScoreGroupTablet"
Code: Select all
Put "123" into field "Score" of group ("ScoreGroup" & gMachine)
The second method works fine, up to now, but the problem is the message path: if I forget to detail every control name (of the 4/5 groups) with a "...of group "ScoreGroupTablet", sometime the message is sent to the hidden group (if I am on phone and the message is sent to the Tablet hidden group).
This because, of course, controls inside the different size groups are named the same.
HOW to solve it:
A) Delete (in the preopenstack) the unwanted size groups:
This would work once the standalone is installed on the device, but it would be a problem on the developing environment
B) Find a way (in the preopenstack) to remove from the message path the unwanted size group.
Is this possible? And how?
Thanks and sorry for the long post
Trevix