In working through a number of example stacks, I've noticed that the baseline for the text displayed in a standard Mac "jellybean" pushbutton is always 2 to 3 pixels too high. Is it possible to set the baseline property in a standard pushbutton?
Also, is there any concept of the "System" and "SmallSystem" fonts so that our UI designs adhere to the themes and component sizes set by users?
Thanks,
Tim
Can I set the font baseline in a standard pushbutton?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9
- Joined: Thu Feb 04, 2010 7:12 pm
Can I set the font baseline in a standard pushbutton?
--
Tim
Tim Jones
President / CTO
TOLIS Group, Inc.
http://www.tolisgroup.com
http://ww2.productionbackup.com
Tim
Tim Jones
President / CTO
TOLIS Group, Inc.
http://www.tolisgroup.com
http://ww2.productionbackup.com
Re: Can I set the font baseline in a standard pushbutton?
Hi TIm,
You can't set the baseline, but you can set the textHeight. Sometimes, this might help you out.
You can't change the font size of all objects at once using a System or SmallSystem textfont or textsize. There isn't even a direct way to find out the current user settings for fonts.
However, it should be possible to read the Windows registry and to find out to what value the user has set these display settings.
Best regards,
Mark
You can't set the baseline, but you can set the textHeight. Sometimes, this might help you out.
You can't change the font size of all objects at once using a System or SmallSystem textfont or textsize. There isn't even a direct way to find out the current user settings for fonts.
However, it should be possible to read the Windows registry and to find out to what value the user has set these display settings.
Best regards,
Mark
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Can I set the font baseline in a standard pushbutton?
Tim,
you can set the margins of a button, this has an effect on the position of the text. The default margins of a new button are 4, that is 4 pixels left, right, top, bottom.
You can adjust the margins individually. When a new button is created (placed on a card) a newButton message is send to this button.
You could trap this message in the stack script or card script or in a library that you "start using myLibrary" or a plug-in, which is basically a library that you can start when Rev starts up.
The script would be for example
There is not a global setting for this but you can tweak your button/object quite a bit with the properties.
regards
Bernd
you can set the margins of a button, this has an effect on the position of the text. The default margins of a new button are 4, that is 4 pixels left, right, top, bottom.
You can adjust the margins individually. When a new button is created (placed on a card) a newButton message is send to this button.
You could trap this message in the stack script or card script or in a library that you "start using myLibrary" or a plug-in, which is basically a library that you can start when Rev starts up.
The script would be for example
Code: Select all
on newButton
set the bottomMargin of the target to 2
-- you can pass the message if some other handler needs this message
-- pass newButton -- unblock this
end newButton
regards
Bernd