#1 2015-05-27 23:09:44

impulsmedia
Member
Registered: 2015-04-21
Posts: 64

examples how to use SetStyle action

Hello David,

may be this is a bit boring for you and beside your main work ... but do you think it ist possible to create a small sample which shows some main examples how to use SetStyle? I try hard to work it out  i.e. changing the position and size of a object with CCS in runtime (!) , also border attributes etc. I was susccesfull to move  a textarea with marginTOP etc. but I´m to stupid to change the size of the textarea ...
many thanks for your work and help!

By the way: please check the If action, I think there are some bugs in the dropdown list of the second operators ...

Walter

Offline

#2 2015-05-27 23:49:51

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

Re: examples how to use SetStyle action

Hello Walter,

Take a look at the bellow code, which change the top, left, width and height of a Textarea control.

SetStyle "Textarea1" "top" "1px"
SetStyle "Textarea1" "left" "1px"
SetStyle "Textarea1" "width" "300px"
SetStyle "Textarea1" "height" "300px"

As you can see we need to specify a measure, in this case "pixels". If you plain to establish lot of CSS properties maybe another possible approach is to use a Cascading Style Sheet file, a CSS file which you can include in the app files/styles, and which are included and linked by App Builder automatically. The SetStyle action expect a CSS property name, just like if you defined it in a CSS file, and the appropiate value, including a measure when needed.

Just take in count that every app control have an ID, which is the same that their name. Then, for example, to establish a CSS properties for a "Textarea1" control, we must use the ID "#Textarea1" in our CSS file. Maybe you can take a look at the Responsive apps tutorial included in the program help. Such tutorial indicates various ways to use CSS styles, and how we can get beneficts defining CSS "media queries" in our CSS styles.

About the "If" action's editor error, can you explain a little more? Just yesterday I fix an error which cause that the operator description are added to the action argument, but I don't know if you refer to this problem or another one.

Online

#3 2015-05-28 10:33:41

impulsmedia
Member
Registered: 2015-04-21
Posts: 64

Re: examples how to use SetStyle action

Hello David,
thanks a lot. This was exaktly, what I did, but there must have been an error in my code ... I set up a new test.app and now it works. Thanks!
Concerning IF-operator: Seems the dropdown-list and the result in the field are not the same. Example: select "=! (not equal) in the dropdown list results a ">" in the field second operator. I tested them, they all are different exept the first ...
My OS is 8.1

I´m getting more and more happy with Appbuilder! When to register? Now? Want to support your work !

Walter

Offline

#4 2015-05-28 10:42:31

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

Re: examples how to use SetStyle action

Hello Walter,

Thanks for your comments. Download the latest release of the program: between other things you can view fixed the "If" action's editor error. About to register App Builder you can do it from their website using the provided Paypal form. You can choose from the three different available licenses.

Personal licenses allows you to use App Builder in your personal computers and distribute the produced apps without cost and ad free. Commercial licenses allows you to use App Builder in all your personal computers and sell the produced apps and include ads. Corporate licenses allows you to use App Builder in your personal and business computers and to sell the produced apps and include ads.

If you have any doubt or question don't hesitate to contact me.

Thanks again Walter!

Online

#5 2015-05-28 21:26:35

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

Re: examples how to use SetStyle action

Hello again,

I can imagine that maybe you try to use the CSS properties as is shown into the control's object inspector. That is, for example, maybe you are trying to use the "SetStyle" action like:

SetStyle "HtmlContent1" "BorderLeft" "4px solid red"

The above action doesn't produce the expected results. In fact the designtime CSS properties have such kind of names because, for example, they cannot contains the "-" character.

In runtime, we need to specify a real and valid CSS property name like:

SetStyle "HtmlContent1" "border-left" "4px solid red"

A good CSS properties reference can be found here at W3 Schools.

Online

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.