Re: GUI size on different screens [message #51455] |
Sat, 25 November 2006 09:58  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
lory writes:
> How can I find which font and which character size are used by default
> (before changing it)?
You can't. :-(
(I put this out more as a challenge than as a statement of fact.
But, I have never discovered how to do it reliably.)
> My code should run under different OS, with
> different "system" font, and I would change only the size of the
> characters.
If you want your code to run under different operating systems,
leave fonts ALONE! Don't muck with them. Let the users use the
fonts they want to use. You are going down a path here that leads
to complete ruin and frustration!
> Another question: I do not fully understand the string you assigned to
> default_font, could you explain all the modifiers? The description of
> default_font in the IDL help is very short ...
This explanation will help only for users with a particular operating
system and for users who have this particular font installed. (Some
will and some, for whatever inexplicable reason, will not.) Take
everything you learn with a grain of salt, and IGNORE ALL ADVICE.
Leave fonts ALONE!
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
Re: GUI size on different screens [message #51495 is a reply to message #51471] |
Fri, 24 November 2006 01:40   |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
Lory,
While not a perfect solution, you can change the font size for all the
label widgets, text widgets etc. This can save a lot of space depending
on what sort of widgets you have (obviously it has no effect if it's
mostly draw widgets).
Something like:
widget_control,default_font='-adobe-courier-*-r-*--8-*
near the start of your code, assuming you're not explicitly giving fonts
to each widget. This will affect the size of most things (most widgets
have text on them in some form).
On linux, you can use "xfontsel" to see the different fonts available,
the example I gave above isn't very pleasing on the eye. Presumably a
similar thing exists on windows... something called "charmap" seems
familiar from distant memories but I really don't know.
Not ideal, but much quicker that re-writing all your code.
Thanks,
Allan
lory wrote:
> Hi,
> I developed a software in IDL with a large number of GUIs. The screen
> resolution of my PC is 1600x1200 and the GUIs are correctly sized for
> this kind of screen. I did not use explicit sizing of the widgets,
> since I need to use both linux and windows systems. Now, I installed my
> software on a laptop with a 1024x768 pixels screen and ... the software
> is totally useless since the GUIs are too large and go off the screen !
> Is there any simple solution to this problem? There is any way to
> resize characters, buttons and so on accordingly with the screen size?
> Please, I don't want to rewrite all the code to fit the 1024x768 pixels
> ! It's a lot of code !
>
> thanks
>
> lory
>
|
|
|
Re: GUI size on different screens [message #51503 is a reply to message #51495] |
Thu, 23 November 2006 18:31   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
lory writes:
> I developed a software in IDL with a large number of GUIs. The screen
> resolution of my PC is 1600x1200 and the GUIs are correctly sized for
> this kind of screen. I did not use explicit sizing of the widgets,
> since I need to use both linux and windows systems. Now, I installed my
> software on a laptop with a 1024x768 pixels screen and ... the software
> is totally useless since the GUIs are too large and go off the screen !
> Is there any simple solution to this problem? There is any way to
> resize characters, buttons and so on accordingly with the screen size?
> Please, I don't want to rewrite all the code to fit the 1024x768 pixels
> ! It's a lot of code !
You could always put scroll bars on your TLB. You won't
be able to see all the internal widgets, probably, but
you will be able to scroll to them and use them.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
Re: GUI size on different screens [message #51581 is a reply to message #51471] |
Mon, 27 November 2006 13:56  |
Mike[2]
Messages: 99 Registered: December 2005
|
Member |
|
|
lory wrote:
> thank you all for the sugestions !
> I used both the scroll bars and a font size depending on the screen
> resolution and now it is not too bad also on the lower resolution screen
One more suggestion that I haven't seen yet: when I really want to save
a few pixels, I set xpad=0 and ypad=0 in my calls to widget creation
functions. This packs them tighter, especially when I'm using many
nested widget_base's.
Mike
|
|
|
Re: GUI size on different screens [message #51584 is a reply to message #51455] |
Mon, 27 November 2006 12:12  |
lory
Messages: 6 Registered: November 2006
|
Junior Member |
|
|
Ok, I see that it is not the "correct" way... but how should I do to
develop programs in the "right" way with the goal that they could be
used under PC with different configuration?
When I started this project, I tried not using explicit sizing of
widgets because I realized that this can be a problem when the software
must be used under different OS and I want that my software could run
under both Windows and Linux (and something else ...). Very soon I
realized that it is not possible to write an IDL program really working
at the same way under different OS. Then when the program start, first
check which OS is running and then set some OS-dependent parameters to
manage OS-dependent feature. I would like to do something similar for
the screen resolution
I undestand that if I wrote the software optimizing it, for example,
for 1024x768, it would run even with resolution higher than that, but
it would not exploit the capabilities of high resolution screen
...Instead, I would like a software optimized for 1600x1200, but usable
with 1024x768, 1280x1024 etc. Scroll bars are a good suggestion, but is
there a way to know if the widget need a scroll bar? is there a way to
put a scroll bar only if the natural size of the widget is greater of
the screen size?
For example: I have GUIs that in high resolution take more or less 2/3
of the screen but in low resolution go off the screen. I want put a
scoll bar in the second case, but I don't want resize the GUIs in the
first case and I don't want check by hand every screen configuration to
decide if a scroll bar is required or not. I could do that in automatic
if I know the GUI size before realizing it, by comparing its natural
size with the screen size, but I don't know if it is possible.
thanks
Lory
David Fanning ha scritto:
> lory writes:
>
>> How can I find which font and which character size are used by default
>> (before changing it)?
>
> You can't. :-(
>
> (I put this out more as a challenge than as a statement of fact.
> But, I have never discovered how to do it reliably.)
>
>> My code should run under different OS, with
>> different "system" font, and I would change only the size of the
>> characters.
>
> If you want your code to run under different operating systems,
> leave fonts ALONE! Don't muck with them. Let the users use the
> fonts they want to use. You are going down a path here that leads
> to complete ruin and frustration!
>
>> Another question: I do not fully understand the string you assigned to
>> default_font, could you explain all the modifiers? The description of
>> default_font in the IDL help is very short ...
>
> This explanation will help only for users with a particular operating
> system and for users who have this particular font installed. (Some
> will and some, for whatever inexplicable reason, will not.) Take
> everything you learn with a grain of salt, and IGNORE ALL ADVICE.
> Leave fonts ALONE!
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|