Button Border

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Button Border

Post by charms » Tue Apr 01, 2014 8:10 pm

Hi there,

I'm using LiveCode 6.6.0 with Mac OS X.

I try to do a simple task. I want to set the borderColor of a button. However the borderColor has the same color as the text color. The Border Color that is set in Colors & Patterns is not taken. I can also not set it in the code "set the borderColor of me to "black"".

I have spent hours on this without finding a solution. Everything works fine with a rectangle. Just with a button it's not working. Is this be a bug? Or am I doing something wrong?

Kind regards,
Chris

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Button Border

Post by LCNeil » Tue Apr 01, 2014 8:32 pm

Hi Chris,

A border color will not be applied to a button if its "threeD" property is set to true. The following is taken from the LiveCode borderColor dictionary entry-
* The borderColor of a button determines the color of the border around the button. If the button's style is "checkbox" or "radioButton", the borderColor has no effect. If the button is a button menu, the borderColor has no effect unless the button's menuMode property is set to "comboBox" or "popup". If the button's threeD property is set to true, the borderColor has no effect regardless of the button's style.
I hope this is of some assistance

Kind Regards,

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
-- 

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Re: Button Border

Post by charms » Tue Apr 01, 2014 10:50 pm

Hi Neil,

I have been reading about borderColor in the dictionary. However disabling ThreeD didn't solve my issue.

I have found out that the borderColor issue does only occur when I choose the Rounded Rectangle with Drop Shadow. When I choose Square Button for example then your mentioned behaviour is working. What is the special thing with the Rounded Rectangle?

Also what I don't quite get is "Hilited Text" in "Colors & Patterns". I would assume that when I choose a color for "Hilited Text" I choose the color of the label of the button. Instead it changes the hilite color of the background of the button. I somehow seem to have difficulties to understand the logic behind the buttons.

How can I change the color of the label of the button over property inspector?

I have attached a test stack.

Kind regards,
Chris
Attachments
buttontest.livecode.zip
(3.9 KiB) Downloaded 291 times

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Button Border

Post by LCNeil » Tue Apr 01, 2014 11:20 pm

Hi Chris,

Yes that would indeed explain why the borderColor was not working for you. This seems to be the way LiveCode has implemented this property for rounded rectangles buttons for some time (possibly from the beginning) as I can go as far back as LiveCode 5.5.3 and it is present.

WIth that being said, there is a great workaround discussed in this forum post and it involves using graphic effects-

http://ftp.runrev.com/forums/viewtopic. ... 22&p=78904

The hilited text property can be confusing as it relates to the full hilite color of a button (as you have mentioned). A method to change the text color when a button is pressed is via script e.g.

Code: Select all

on mouseDown
set the foregroundColor of me to "white"
end mouseDown

on mouseUp
set the foregroundColor of me to "black"
end mouseUP
Kind Regards,

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
-- 

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Re: Button Border

Post by charms » Tue Apr 01, 2014 11:51 pm

Hi Neil,

Ok, understand. Just a little rough around the edges as one would expect similar functionality with all the buttons. But I assume this will be cleaned up somewhen when you're not developing 3 streams in parallel :shock:

The workaround is neat. This guy must have had LiveCode in his Cornflakes :lol:

Works.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3975
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Button Border

Post by bn » Wed Apr 02, 2014 10:37 pm

Hi Chris,
This guy must have had LiveCode in his Cornflakes :lol:
since you are located in Switzerland: to be more exact it was in my muesli... :)

Kind regards
Bernd

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Location: Singapore
Contact:

Re: Button Border

Post by charms » Tue Apr 08, 2014 5:15 pm

Hi Bernd,

I knew it must have been a Birchermüesli with a pinch of LiveCode. How else would you have these fantastic ideas :lol:

I'm sure you're smuggling tons of this stuff over the border.

Greets to Bochum.

Kind regards,
Chris

Post Reply

Return to “idea2app and Coding School”