#1 2016-01-23 23:25:08

Basseman
Member
Registered: 2016-01-23
Posts: 7

How do i change color of a button ?

Hi David and congrats to an awsome program..
As the topic says, how do i change the color of an pushbutton as you have done in some of the sample files ?
I can't seem to find it anywhere..
And btw, when i change the text color to something else than default it doesn't update to to right color in the editor..
And i only got Swipe Right and Swipe Left...
Where is Swipe Up & Down

Cheers

Last edited by Basseman (2016-01-23 23:52:09)

Offline

#2 2016-01-23 23:48:40

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

Re: How do i change color of a button ?

Hi,
You can use the object inspector once select the application:

uLWLbP6.png

Also you can use the app's options dialog under the Style tab.

Last edited by edunt (2016-01-23 23:51:47)

Offline

#3 2016-01-23 23:49:00

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

Re: How do i change color of a button ?

Hello Basseman,

Thanks for your kindly words. In designtime we can change the Push buttons apparence using their "Kind" variable or property. In runtime we need to use the appropiate CSS class in order to do it. For example, supose we have a "Button1" with the "Kind" variable set to "default". Then, in runtime, we can write something like this:

// Remove the default kind/button class
RemoveClass "Button1" "btn-default"

// Add the class we wanted to use now
AddClass "Button1" "btn-primary"

As you can see, the values for the "Kind" variable is the same for the classes, but prefixed by "btn-". About the button text color and the designtime editor, maybe we can enhance the editor in the future, but currently they are not reflect that possible of changes, remember, only in designtime, in runtime the changes you made appear like you expected.

Offline

#4 2016-01-23 23:55:27

Basseman
Member
Registered: 2016-01-23
Posts: 7

Re: How do i change color of a button ?

Hi again..
Sorry but i didn't understand any of you...
I just want to change the color of an pusbutton... Not at runtime..
Am i forced to the diffrent colors of "Kind" ?
And why am i missing the Swipe Up & Down ?

Cheers

Last edited by Basseman (2016-01-24 00:00:32)

Offline

#5 2016-01-24 00:04:56

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

Re: How do i change color of a button ?

Hello,

Basseman wrote:

I just want to change the color of an pusbutton... Not at runtime..

Sorry. We can change it at runtime and also at designtime: just select the button in the designer and look at the properties inspector, search for the "Kind" property and just choose of their possible values from the list.

SLkuCBF.gif

Basseman wrote:

Am i forced to the diffrent colors of "Kind" ?

No. Of course not. But it's a good practice and a very good approach if you plain to use the included app themes, for example, just to do not break the Bootstrap CSS framework used in the application. But you can use the CSS you wanted to customize the buttons and any other element.

Basseman wrote:

And why am i missing the Swipe Up & Down ?

Sorry, now am I whow don't understand your last question.

Offline

#6 2016-01-24 00:09:43

Basseman
Member
Registered: 2016-01-23
Posts: 7

Re: How do i change color of a button ?

I mean this:

App views events

All the app views exposes some events which you can use in order to prepare your desired behaviour when an app view is show, clicked (or tap), double clicked (or double tap), etc. Below you can found the description of all the available app events. You can also take a look at the App events and control events.
Show
Click
DblClick
SwipeUp
SwipeDown
SwipeLeft
SwipeRight

Offline

#7 2016-01-24 00:11:04

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

Re: How do i change color of a button ?

Hello,

You quote above a part of the program's help file. But what is your question Basseman?

Offline

#8 2016-01-24 00:13:35

Basseman
Member
Registered: 2016-01-23
Posts: 7

Re: How do i change color of a button ?

The question is..
I can't find Swipe Up & Down, they are not in the same place as Swipe Right & Left

Offline

#9 2016-01-24 00:14:24

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

Re: How do i change color of a button ?

Hello,

At this time only Swipe Right and Left are supported out of the box.

Offline

#10 2016-01-24 00:17:27

Basseman
Member
Registered: 2016-01-23
Posts: 7

Re: How do i change color of a button ?

Aha, got confused when they were mentioned in the Help file..
Any plans on including them ?

Thanks for the help !!

Offline

#11 2016-01-24 00:23:00

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

Re: How do i change color of a button ?

Hello Basseman,

Why you need them? In fact Swipe Up and Left are available out of the box in AngularJS, then also in App Builder's apps. In order to add Swipe Up and Down we need to use certain thirdparty library, but, certainly, I am not planned to add it right now, at least I need to study it before.

Since App Builder can be extended with Javascript you can use a library like HammerJS, if you like to be that and may more events in your applications. About the help file, you have reason they mention the Swipe Up and Down events. Considerer that a mistake fixed in the next program release.

Offline

#12 2016-01-24 00:26:13

Basseman
Member
Registered: 2016-01-23
Posts: 7

Re: How do i change color of a button ?

Ok, then i understand..
How can i use this: http://www.cssportal.com/css3-button-generator/
to design my own button and include it in AppBuilder ?

Thanks

Offline

#13 2016-01-24 00:34:22

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

Re: How do i change color of a button ?

Hello Basseman,

Since the service you mention provide you with certain CSS code associated to a class, you simply can copy such CSS code and put it in a CSS file to be included with your application, or just use the app's Inline CSS option to copy the CSS code the service provide to you. After that, just use the Classes property of the buttons and specify the CSS class used in the refered CSS code.

I prepare an application sample for you, download it from here.

P.S. Please, open new forum's threads for different questions, so we don't mix various things in the same thread, possible forum searchs are more accurates, etc. Thanks.

Offline

#14 2016-01-24 00:41:19

Basseman
Member
Registered: 2016-01-23
Posts: 7

Re: How do i change color of a button ?

Ok, thanks alot.. One last question... Where should i put the css file to be included in my application and is it possible to add more than one css to the Inline Css option ?

Offline

#15 2016-01-24 00:45:29

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

Re: How do i change color of a button ?

Hello,

No problem. You can add whatever CSS files you need from the app file's manager. Take a look at the Menu - App - File's manager. On the other hand the Inline CSS option has no limits. The code you put here is copied by App Builder and placed in the appropiate app's CSS file to be available in runtime.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.