comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » GUI size on different screens
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: GUI size on different screens [message #51576 is a reply to message #51512] Mon, 27 November 2006 14:43 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lory writes:

> 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?

I'm not sure there is a "correct" or "right" way to write
these programs. But there are certainly some ways that are
better than others. You seem to be discovering some of these. :-)

> 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.

Well, it's not as easy as the IDL marketing materials might
lead you to believe, certainly. But with some precautions,
I think IDL does a fairly decent job. And, to be fair, it IS
a hard job!

> 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?

I don't know how this works in UNIX, but on Windows I can set
a scroll X and Y size on my TLB for the screen resolution (I
use Get_Screen_Size() jiggered, of course, by appropriate fudge
factors to account for the task bar, window decorations and the like).
If the final widget application is less than that size, no scroll bars
appear. If it is larger, then I get scroll bars.

> 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.

To do size tinkering, I often get the geometry of a widget after
it has been created and filled, but before it is realized. Using
the geometry values, I can size other widgets, etc. Then, when the
widgets get realized, they are all the correct size, as if by magic.

(You don't know the meaning of "frustration" until you have tried
to size a status bar widget to the exact dimensions of the widgets
in the window along with it. After careful accounting of every XPAD,
YPAD, SPACE, etc., etc., there is still a fudge factor of 6--or
is it 4?--that never gets canceled out in the arithmetic. It drives
you absolutely MAD!!)

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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: objects, crashes, and negative memory oh my
Next Topic: IDLgrPlot Axis scaling bug?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:09:37 PDT 2025

Total time taken to generate the page: 0.00564 seconds