How to Colour a Tab button

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

How to Colour a Tab button

Post by Traxgeek » Thu Jan 24, 2013 4:30 pm

Hi,

I'm using a tab control on a card.

The tab control has 4 tabs and I'm using the control to show/hide one of 4 groups of controls.

So far, so good, BUT (again :oops: ) How do I colour my Tab. Or even just set it's background to transparent / not opaque ?

There appears to be no 'Opaque' property for a tab button - so I can't see how to make it transparent.

Also, if I go to 'Colors and Patterns' and select/change the Tab's Fill color - nothing happens EXCEPT for a thin line of the selected colour appearing at the top right border of the recalcitrant Tab button !
The 'Text' color works...
But that seems to be about it... I can't change the highlighted text, border color, bevel or shadow colours. Well, I can change them in the Property Inspector for the Tab button in the IDE byt little (if anything) happens on the card.

To be frank, at this stage I'd be perfectly happy with just a transparent Tab button (so that it 'picks up' the cards background colour...

Sorry, I'm lost... What am I missing please ? Maybe someone can give me a boot in the right direction please ?

TIA

Regards.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to Colour a Tab button

Post by Klaus » Thu Jan 24, 2013 4:35 pm

Hi Traxgeek,

the actual TABS (on top of the TABBED button) are, like most other UI elements,
supplied by the underlying OS and so you cannot modify them*, or only to a certain extent.

* like "progress bars", "default"/"checkbox"/"radio" buttons etc.

Fazit: You need to create your own controls to get this "feature"! 8)


Best

Klaus

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: How to Colour a Tab button

Post by Traxgeek » Thu Jan 24, 2013 5:58 pm

hmmm... OK.
Thanks Klaus... saves me messing about trying to achieve what can't be done !

Regards.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: How to Colour a Tab button

Post by magice » Thu Jan 24, 2013 7:28 pm

You might have some luck using the blending tab of the property inspector. I needed tabs to change color on focus, I used blending to make the tab menu semi transparent, then used colored rectangle graphics behind the tabs as the cards changed.

doc
Posts: 148
Joined: Fri Jun 09, 2006 4:30 pm
Location: Oklahoma, USA

Re: How to Colour a Tab button

Post by doc » Thu Jan 24, 2013 7:56 pm

Traxgeek ,
If you really need colored tabs and don't mind some extra work, you can simulate them easy enough using transparent buttons with hidden button images of your own design and with the benefit that you can place the "tabs" anywhere you want them (top, botton, or either side). I've included a sample stack to give you a head start of one way it might be done, depending on your needs.

Building your own custom controls (or simulating them) is one of the most powerful and fun things about using LiveCode.

HTH,
-Doc-
Attachments
color_tabs.zip
(5.03 KiB) Downloaded 260 times

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: How to Colour a Tab button

Post by shaosean » Fri Jan 25, 2013 8:40 am

Klaus wrote:the actual TABS (on top of the TABBED button) are, like most other UI elements,
supplied by the underlying OS
Actually, Rev uses emulated UI elements.. http://docs.runrev.com/Property/lookAndFeel

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: How to Colour a Tab button

Post by Traxgeek » Fri Jan 25, 2013 10:56 am

Wow !

I'm still definitely in the 'beginner' category BUT, although the curve is steep, I am learning fast...

Thanks magice, I'll 'play' with the semi transparent/coloured rectangles behind idea - seems easiest to start with - and then, as my confidence grows and I've handled the nav. and basic functionality of my app., I'll come back and play with Doc's sample stack (thanks a million Doc).

So, thansk all. Much appreciated...

Regards.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to Colour a Tab button

Post by Mark » Fri Jan 25, 2013 2:16 pm

Hi,

A long time ago, I made a very simple example, which you can find on RevOnline.

Kind regards,

Mark
Last edited by Mark on Sat Jan 26, 2013 11:20 am, edited 1 time in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

doc
Posts: 148
Joined: Fri Jun 09, 2006 4:30 pm
Location: Oklahoma, USA

Re: How to Colour a Tab button

Post by doc » Fri Jan 25, 2013 10:11 pm

Welcome!
I think that you will find as you gain experience, when it comes to custom interface design, LiveCode is really hard to beat
...don't have a certain feature or look? Just roll your own. :)

-Doc-

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: How to Colour a Tab button

Post by Traxgeek » Sat Jan 26, 2013 11:11 am

Aha - magice, the Belnding idea is quick and simple...

I settled on 'notSrcCopy' method and a 'Level' of 70%... and then 'struggled' (not important at this stage) with exactly how a selected text colour became some totally (what appeard to me - obviously not !) random text colour on my tab. With some hour or two of messing about though I have the colour scheme I need BUT do also need to spend some time on the 'logic' of bitwise colour mapping...

All-in-all delighted tho. :D

Mark / Doc, I downloaded your tab control codes... the light is dawning - love it ! It's been (just!) some 4 weeks, but, with the help I've received here on the forum, I'm (already) begining to appreciate LiveCode - and after 15+ years of VB, C, Ruby, Lua and Java that's gotta be asaying something even if the learning curve continues to be pretty steep !

So, this weekend it's on to some skinning and then deploying the working structure of my app (albeit very unfinished) to an iPad/iPhone 3GS and an Transformer Infinity - Onwards and upwards !!!

Thanks to all.

Have a great weekend !
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: How to Colour a Tab button

Post by magice » Sat Jan 26, 2013 5:57 pm

Traxgeek wrote:Aha - magice, the Belnding idea is quick and simple...

I settled on 'notSrcCopy' method and a 'Level' of 70%... and then 'struggled' (not important at this stage) with exactly how a selected text colour became some totally (what appeard to me - obviously not !) random text colour on my tab.
You can always add a text label on top of the tab as well.

doc
Posts: 148
Joined: Fri Jun 09, 2006 4:30 pm
Location: Oklahoma, USA

Re: How to Colour a Tab button

Post by doc » Sat Jan 26, 2013 11:52 pm

Traxgeek,
If you really want to see the ultimate when it comes to building custom controls and/or skinning goes with LIveCode applications, you'll need to pay a visit to the Tactile Media web site. Be sure to allow plenty of time for browsing and keep a towel on hand for the inevitable drooling over such cool creations.

http://www.tactilemedia.com

Scott Rossi does custom UI's like nobody else I've ever seen, both with or without using LiveCode. I only dream of having that kind of talent. :mrgreen:

-Doc-

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”