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


Yang Ghua

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
^_^


DecSoft

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. :)



Ade Wale

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.

[img=Untitled.png]https://www.decsoftutils.com/_support/uploads/3622ae0255f7f27c28cf1c2bdd889450.png[/img]

Hope its help


Yang Ghua

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


Ade Wale

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.

[img=Untitled.png]https://www.decsoftutils.com/_support/uploads/589477d31e91127de6fdf8f29ce344c4.png[/img]

Hope its help.

AB rock!


DecSoft

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:

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:

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. ;)



Yang Ghua

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


DecSoft

Hello Joshua,

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!



Ade Wale
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.


Yang Ghua

[img=1.jpg]https://www.decsoftutils.com/_support/uploads/0063745a7895f71e6b1adb9bf61e1ab3.jpg[/img]

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

:)


DecSoft

Hello to all!

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

:)

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...



Yang Ghua

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


Guest

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=0B8JMDfYvfZChRDdpcTRVdlVuRVk

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.


DecSoft

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:

[list=1]

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

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

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

  • 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.



    Guest

    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.


    DecSoft

    Hello fakie,

    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.


    Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

    This website uses some useful cookies to store your preferences.

    I agree. Hide this note. Give me more information.