Quick (I hope) question about max. window size 
Author Message
 Quick (I hope) question about max. window size

Hi-

I'm working on a simple graphics program. It lets the user choose an
image file (like a JPEG) and then opens a window displaying that image.
But if the image is larger than the screen, I want to scale it so that
the window containing it doesn't go off the screen. (Most image editing
programs - PhotoShop, Graphic Converter, etc. - do this automatically.)

I'm assuming the way to do this is to get the monitor size from the
Screen function, use DrawPicture's "Source" and "Dest" parameters to
scale the picture, and then adjust the window's width and height to fit
the picture.

What I'm concerned about is this:

1) how many pixels should I allow for the menubar?

2) how many pixels should I allow for my window's titlebar?

3) how many pixels should I allow for my window's left, right, and
bottom edges?

4) I notice RB's "default" window placement leaves a little bit of a gap
between the edge of the screen and the default window's left edge, and
the bottom of the menubar and the window's top edge. How many pixels is
that?

Please note: I'd like to compile the program for Mac Classic, Mac OS X,
AND Windows, if possible. (Does "Screen" work in Windows?) So some sort
of maximum figure that would keep my window "safe" in all three systems
would be perfect. Something like, "Allow x pixels for width and y pixels
for height, and you'll be covered."

Thanks for your help! (I sure do appreciate this group!)

Chip

P.S. Is this type of information available somewhere besides the minds
of the gentle folk who help out in this group? I couldn't find anything
in the docs or in Matt's or Erick's books. Thanks again!



Thu, 29 Apr 2004 06:49:28 GMT  
 Quick (I hope) question about max. window size

Quote:

> 1) how many pixels should I allow for the menubar?

It varies, though on the Mac I think you can declare a call to
GetMBarHeight or some such...

Quote:
> 2) how many pixels should I allow for my window's titlebar?

That varies too, and unfortunately I don't know a formula for it.
Experiment.

Quote:
> 3) how many pixels should I allow for my window's left, right, and
> bottom edges?

See last answer; it applies here too.

Quote:
> 4) I notice RB's "default" window placement leaves a little bit of a gap
> between the edge of the screen and the default window's left edge, and
> the bottom of the menubar and the window's top edge. How many pixels is
> that?

Ah, here you don't have to experiment; just measure it.  Get Magnifier
or DeltaXY, or just take a screen shot and measure it in a paint
program.

Quote:
> Please note: I'd like to compile the program for Mac Classic, Mac OS X,
> AND Windows, if possible. (Does "Screen" work in Windows?)

Yes, it does.

Quote:
> So some sort
> of maximum figure that would keep my window "safe" in all three systems
> would be perfect. Something like, "Allow x pixels for width and y pixels
> for height, and you'll be covered."

You can't ship an app for a system you've never tested it on anyway.
So why not just try it -- in the time it took you to post this, and get
a response, you could get the answer yourself.

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Thu, 29 Apr 2004 08:51:49 GMT  
 Quick (I hope) question about max. window size

[..]

Quote:
> What I'm concerned about is this:

> 1) how many pixels should I allow for the menubar?

> 2) how many pixels should I allow for my window's titlebar?

> 3) how many pixels should I allow for my window's left, right, and
> bottom edges?

> 4) I notice RB's "default" window placement leaves a little bit of a gap
> between the edge of the screen and the default window's left edge, and
> the bottom of the menubar and the window's top edge. How many pixels is
> that?

> Please note: I'd like to compile the program for Mac Classic, Mac OS X,
> AND Windows, if possible. (Does "Screen" work in Windows?) So some sort
> of maximum figure that would keep my window "safe" in all three systems
> would be perfect. Something like, "Allow x pixels for width and y pixels
> for height, and you'll be covered."

I just made two plugins to deal with these issues. One is a global
method that returns menu bar height. The other gets the structure
(outside) measurements of the window with Appearance Manager. 68k, PPC,
MacOS 7.6.1 (+ Appearance Manager) thru Carbon. If I had a Windows
setup, I'd make it work for that, too, but alas I don't.

Wanna beta test? Send me an email. :-)

--
"In a world full of lies/That tug at the truth
 I'm taking no sides/Now I recognize you..." -DS



Thu, 06 May 2004 09:43:14 GMT  
 Quick (I hope) question about max. window size

Quote:


> [..]
> > What I'm concerned about is this:

> > 1) how many pixels should I allow for the menubar?

> > 2) how many pixels should I allow for my window's titlebar?

> > 3) how many pixels should I allow for my window's left, right, and
> > bottom edges?

> > 4) I notice RB's "default" window placement leaves a little bit of a gap
> > between the edge of the screen and the default window's left edge, and
> > the bottom of the menubar and the window's top edge. How many pixels is
> > that?

> > Please note: I'd like to compile the program for Mac Classic, Mac OS X,
> > AND Windows, if possible. (Does "Screen" work in Windows?) So some sort
> > of maximum figure that would keep my window "safe" in all three systems
> > would be perfect. Something like, "Allow x pixels for width and y pixels
> > for height, and you'll be covered."

> I just made two plugins to deal with these issues. One is a global
> method that returns menu bar height. The other gets the structure
> (outside) measurements of the window with Appearance Manager. 68k, PPC,
> MacOS 7.6.1 (+ Appearance Manager) thru Carbon. If I had a Windows
> setup, I'd make it work for that, too, but alas I don't.

> Wanna beta test? Send me an email. :-)

> --
> "In a world full of lies/That tug at the truth
>  I'm taking no sides/Now I recognize you..." -DS

I have only your old adresse... Can you show me the newer?


Thu, 06 May 2004 19:58:56 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Quick Question for MAX+PLUS example (rs flip flop)

2. Default max window size

3. Win2K/JS/TCL/Apache Question: Max Textarea Value Size

4. Quick Byte Add/Subtract up to max/min

5. max array size

6. Win32 : max size of CSTRING - ?

7. max size of an image in a report

8. How to change (Restore,Move,Size,Min,Max)

9. Max size of DBase files in CW20

10. Max size of a CDX index key

11. max size of DBF files.

12. Max file size DBF/NTX?

 

 
Powered by phpBB® Forum Software