Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Mar 29, 2017 4:12 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Button sizes/Text size
PostPosted: Sun Apr 13, 2008 2:15 pm 
Offline
User avatar

Joined: Wed Nov 15, 2006 3:50 pm
Posts: 2353
Location: England
On Linux, all the buttons that work fine on Mac and Windows (text size 0) are too small to hold the text under Linux (Ubuntu 7)

If I change the text and button size to suit one platform, it wlooks ridiculous on other platforms.
Is there a standard size of button and text under Linux (seems to default to much larger than I like...)

What does anyone else do to resolve resolution and font size issues like this?


Top
 Profile  
 
 Post subject: Re: Button sizes/Text size
PostPosted: Mon Apr 14, 2008 4:30 pm 
Offline

Joined: Fri Nov 16, 2007 10:18 pm
Posts: 195
Location: Portland, OR
I just put this in the form open event:
#If TargetLinux
ButtonName.TextFont = "FreeSans"
ButtonName.TextSize = 10
#EndIf


That is how I deal with font irregularities.

_________________
Windows: Win7 64bit sp1, Vista 32bit sp2, WinXP 32bit SP3
Linux: RH EL6
Mac: Died in 2011 and took 2 months to notice.

RealStudio: 2012r2


Top
 Profile  
 
 Post subject: Re: Button sizes/Text size
PostPosted: Tue Apr 15, 2008 6:28 am 
Offline

Joined: Thu Jan 26, 2006 8:38 am
Posts: 334
weird, i find linux in the middle, windows has the smallest font size, mac the largest, so i have the same problem with the Mac versions of my apps.

_________________
Faith is a cop-out. It is intellectual bankruptcy. If the only way you can accept an assertion is by faith, then you are conceding that it can't be taken on its own merits.


Top
 Profile  
 
 Post subject: Re: Button sizes/Text size
PostPosted: Wed Apr 15, 2009 7:08 pm 
Offline

Joined: Tue Nov 14, 2006 5:25 pm
Posts: 488
any other workaround to 'fix' that strange text behaviour on linux ?
i've so many buttons, editfield, statictext ... and so on ...


Top
 Profile  
 
 Post subject: Re: Button sizes/Text size
PostPosted: Mon Apr 27, 2009 4:02 am 
Offline

Joined: Mon Jan 22, 2007 9:47 am
Posts: 131
that's where subclassed controls come in handy... whenever we do a multi-platform-project, we never just use the built-in controls.

an example:
1. new project
2. add class 'MyPushButton', set super to: PushButton
3. edit 'MyPushButton':
- AddEventDefinition 'OnOpen'
- edit the Open-Event-handler:
#if TargetWin32 then
me.Height = 20
#endif
#if TargetLinux then
me.Height = 30
#endif
#if TargetMacOS then
me.Height = 24
#endif
OnOpen

4. Add 'MyPushButton' to your window (you find it in 'ProjectControls', not in 'BuiltIn-Controls')

Now all 'MyPushButtons' will auto-magically have the height you desire.
anything you want on the 'Open-Event', you place in you 'OnOpen'-Event-handler

If you want to change the look&feel, all you need to edit is the Class 'MyPushButton' - and all your 'MyPushButtons' will be fine.

This example only shows the how to set a custom 'Height'. You would of course add/change fonts and what-ever behavior you want/need...
another nice thing: if somewhen a behavior of a control should be broken in RB - or if you want to add something to all your 'MyPushButtons' (e.g.: mouse-cursor), you can "easily" work around it in your own class...

Quote:
any other workaround to 'fix' that strange text behaviour on linux ?
i've so many buttons, editfield, statictext ... and so on ...

If you decide to write your own 'MyPushButton': with a bit of luck, it might work to change your existing Buttons quite fast with a "Search All & Replace"...


Top
 Profile  
 
 Post subject: Re: Button sizes/Text size
PostPosted: Tue Jul 10, 2012 1:29 pm 
Offline

Joined: Sun Nov 18, 2007 11:19 am
Posts: 140
Location: New Brunswick, Canada
Hate to "reopen" this thread but it fits exactly what I'm wondering about. Is this still the preferred, although bad, way of adjusting for OS difference in font size? I have no problem manually adjusting the font size for each control to a set size that works for an OS but I also realize this isn't a good method since some people could be using smaller or larger fonts for vision issue reasons.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group