#1 2016-09-22 10:28:22

reg4app
Member
Registered: 2016-05-16
Posts: 147

How to maintain a control size even if the app scale option is true

I want to lock up some controls' size,so they would not change the size with the browsers or devices!
I guess this is a simple question,David will answer it without a second
^_^


Joshua.Y

Offline

#2 2016-09-22 10:36:39

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to maintain a control size even if the app scale option is true

Hello Joshua,

You can set the controls's size using CSS or the "SetStyle" action, then the size is not scaled anymore even if the app's scale option is checked. Try it and tell if that can help you Joshua. smile

Offline

#3 2016-09-22 14:20:02

edunt
Member
Registered: 2015-12-21
Posts: 258

Re: How to maintain a control size even if the app scale option is true

Hi reg4app,

Yes, it is possible to lock any controls you have on the form.

Drag and drop the control
Select the control you want to lock on the form
Right click on the control and click lock selected

Have a look at the image.

Untitled.png

Hope its help

Offline

#4 2016-09-23 05:15:03

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to maintain a control size even if the app scale option is true

Thanks edunt,but i did as you said,the control still change it's size... at runtime

now i can get this done by in view show event

SetStyle "Container3" "width" "256px"
SetStyle "Container3" "position" "absolute"

Joshua.Y

Offline

#5 2016-09-23 15:02:36

edunt
Member
Registered: 2015-12-21
Posts: 258

Re: How to maintain a control size even if the app scale option is true

Hi reg4app,

There is no need to set the container3 in the coding area. To get absolute position of the control always use container on the form (as the foundation) before drag and drop other controls.

The useful of the container, it will ensure the controls stayed fixed as position.

Untitled.png

Hope its help.

AB rock!

Offline

#6 2016-09-24 18:58:42

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to maintain a control size even if the app scale option is true

Hello to all,

In fact we can use the "SetStyle" action when wanted that a control do not scale (and when the app's scale option is set to true), for example, the below code set an specific button width and height:

SetStyle "Button1" "width" "100px"
SetStyle "Button1" "height" "40px"

Additionally we can also let the control to scale again, we can simply use the same "SetStyle" action but leave blank the width and height values, something like in the below code:

SetStyle "Button1" "width" ""
SetStyle "Button1" "height" ""

This have this explanation: the app's stylesheet applies the appropiate style to the control, but, using the "SetStyle" action we overwrite whatever style set by the stylesheet. If we delete the "inline" style by leave the arguments empty (like the above width and height values) then the stylesheet defined style is applies again.

Hope this can help to someone. wink

Offline

#7 2016-09-26 10:26:33

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to maintain a control size even if the app scale option is true

hi David,this container only work with no any other controls(like Input,and so on) outside the container...
why??


Joshua.Y

Offline

#8 2016-09-26 10:44:48

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to maintain a control size even if the app scale option is true

Hello Joshua,

reg4app wrote:

hi David,this container only work with no any other controls(like Input,and so on) outside the container...
why??

Sorry, I can't understand very well the question. Please can you explain a little more? Thanks!

Offline

#9 2016-09-26 12:18:56

edunt
Member
Registered: 2015-12-21
Posts: 258

Re: How to maintain a control size even if the app scale option is true

reg4app wrote:

hi David,this container only work with no any other controls(like Input,and so on) outside the container...
why??

Hi reg4app,

It does work with other control. Since I discover the container I have been using it as foundation on the form, if I want to lock all the controls.

Can you share the screenshot of what you are doing so that we will understand better.

Offline

#10 2016-09-28 03:30:28

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to maintain a control size even if the app scale option is true

1.jpg


Input1 position seems not change ,but it's size is changing with the browser

smile


Joshua.Y

Offline

#11 2016-09-28 09:45:45

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to maintain a control size even if the app scale option is true

Hello to all!

reg4app wrote:

Input1 position seems not change ,but it's size is changing with the browser

smile

Here in my test using the "SetStyle", no matter if the controls is inside of a container or not: they stay in the set width and height... of course I am set the width and height of the control, not the top and left...

Offline

#12 2016-09-29 11:26:12

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to maintain a control size even if the app scale option is true

that is just my misunderstanding,I think there is no need to set the width and height,just put in contain...


Joshua.Y

Offline

#13 2016-10-28 23:45:52

fakie
Banned
Registered: 2016-10-28
Posts: 36

Re: How to maintain a control size even if the app scale option is true

Hi there!

I am also suffering with resizing issues. Basically when my android keyboard is displayed, the text all get squeezed very small.
I'm attaching an example - can't seem to find the attachment button - here is a link.
https://drive.google.com/open?id=0B8JMD … TRVdlVuRVk

I you make and run this example in a browser - and you make the screen smaller or bigger, then all the buttons and entries become bigger or smaller.
I would rather that the top region and bottom region stay the same - and the middle region - where you typically have a list box - grow or shrink as you resize.

Hope you guys understand?
English not my first language.


This is my favourite quote.

Offline

#14 2016-10-28 23:55:37

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to maintain a control size even if the app scale option is true

Hello fakie,

Thanks for join in our forum. Hope App Builder can be useful for you and then consider to buy one or more licenses in order to support the project. Now please, when you said, "I would rather that the top region and bottom region stay the same - and the middle region - where you typically have a list box - grow or shrink as you resize.", where is the "top" and "bottom" regions in your app?

In order to avoid a control to be scaled, we can use the "SetStyle" action: once we set the width or the height of a control they are no more scaled, except if we place again this properties to "empty" values. This is because when we assign a new style to a control the app's main CSS style are overwriten, and, when we "empty" that style, the app's main CSS be applied again.

If the same way you can use your own CSS files or the app's Inline CSS option: all of them: the SetStyle action, the app's CSS files and the Inline CSS option can overwrite the app's main CSS style. Remember that the "C" of "CSS" means "Cascading" and here is how the styles are applied:

  1. The first style in precedence is what we can apply using the SetStyle action.

  2. The second style in precedence is the app's CSS files what we can add into our application from the app's files' manager.

  3. The third style in precedence is what we can place in the app's Inline CSS option.

  4. The four style which are applied is the app's main CSS, which is prepared when compile the app by App Builder.

Hope this information can be useful for you and others fakie.

Offline

#15 2016-11-02 23:23:28

fakie
Banned
Registered: 2016-10-28
Posts: 36

Re: How to maintain a control size even if the app scale option is true

I found my problem

Rather than typing 40 in max-width and max-height, I needed to type 40px. *Under the style tab for the control)

Once I got that sorted - things started to look nicer.

I still have the squeeze effect, but sure if I play around a bit more I'll sort it out.


This is my favourite quote.

Offline

#16 2016-11-02 23:25:50

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to maintain a control size even if the app scale option is true

Hello fakie,

fakie wrote:

I found my problem

Rather than typing 40 in max-width and max-height, I needed to type 40px. *Under the style tab for the control)

Once I got that sorted - things started to look nicer.

I still have the squeeze effect, but sure if I play around a bit more I'll sort it out.

Yes; the appropiate unit must be used in this kind of values. Take a look here for more information.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.