It is currently Fri May 26, 2017 12:21 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to use correctely GW_NEW_THEME_CUSTO ( ... )
Unread postPosted: Wed Dec 07, 2016 5:40 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 837
Location: France
Hello Nicolas

I would like to use mycusto = GW_NEW_THEME_CUSTO ("style='font-size:80% ; width:20%'")
and GW_USE_THEME_CUSTO ( mycusto ) in order to size all my page controls instead of one by one but it seems to don't work...

How to achieve my goal with those 2 commands?

Does GW_USE_THEME_CUSTO_ONCE have priority over GW_USE_THEME_CUSTO in a page?

Cheers

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
 Post subject: Re: How to use correctely GW_NEW_THEME_CUSTO ( ... )
Unread postPosted: Wed Dec 07, 2016 6:58 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5518
Location: Paris, France
Hi Gilles,

The correct way is what you wrote:
Code:
mycusto = GW_NEW_THEME_CUSTO("style='font-size:80% ; width:20%'")
GW_USE_THEME_CUSTO(mycusto)

But any usage of GW_USE_THEME_CUSTO_ONCE() will reset the GW_USE_THEME_CUSTO().

The internal GW mechanism for THEME_CUSTOs uses a token: GW_USE_THEME_CUSTO() sets the token to -1 (infinite), and in this case any GW_ADD_CONTROL will not reset the token, the CUSTO will be still there for the next GW_ADD_CONTROL.

But if you use GW_USE_THEME_CUSTO_ONCE() the CUSTO token is set to 1: the next GW_ADD_CONTROL after that will consume the token, then the second to next GW_ADD_CONTROL will have no CUSTO.

You need 2 things: 1. integrate the CUSTO of mycusto in your GW_USE_THEME_CUSTO_ONCE() ; and 2. repeat the GW_USE_THEME_CUSTO(mycusto) after you are finished using your last GW_USE_THEME_CUSTO_ONCE().

Also note that some controls do not support well the CUSTO (in fact the CSS "style") you are trying to use, that is typically the case of SLIDER, CHECKBOX, RADIO-button and FLIPSWITCH.
The reason is that these controls are composed of different jQM elements (a fieldcontain div, a label, the control itself).

Again I would not consider this solution to reduce the size of all controls by CSS as a good way of making your page adaptive.
I am working on bringing better adaptiveness and responsiveness to GW, but I understand you want to explore solutions on your side.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: How to use correctely GW_NEW_THEME_CUSTO ( ... )
Unread postPosted: Thu Dec 08, 2016 6:31 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 837
Location: France
Hi Nicolas,
anyway as I do not get any good with CSS style management, I can not wait to test the fruit of your work ;)

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred