[comp.sys.mac.hypercard] Show/Hide menubar question

jdevoto@Apple.COM (Jeanne A. E. DeVoto) (10/12/90)

In article <1990Oct11.193221.13578@midway.uchicago.edu>
chh9@quads.uchicago.edu (Conrad Halton Halling) writes:
>                                [...] Is there a way to determine when the
>screen is larger than the standard SE size so I can hide the menubar on an
>SE but not on a Mac II?

There are a couple of ways to do this. First of all, the function
"the screenRect" returns the rect of the main monitor (the one with
the menubar on it), and you can check whether this is the SE/Plus
screen rect (0,0,512,342). The second method is to check the position
of the card window to see whether part is obscured by the menu bar;
for instance,

  on openStack
    if the top of card window < 20 then hide menubar
  end openStack

The latter method is probably preferable, since with HyperCard 2.0,
it's possible to have card sizes larger than the Plus/SE monitor,
and stacks remember their last screen positions (so a stack might
show up even on a large monitor with part of the card window hidden
under the menu bar).

You can also get fancy: compare the size of card window to the
screenRect, and move the window down (instead of hiding the menu
bar) if there's room.
-- 
========= jeanne a. e. devoto ========================================
 jdevoto@apple.com     |  You may not distribute this article under a
 jdevoto@well.sf.ca.us |  compilation copyright without my permission.
______________________________________________________________________
 Apple Computer and I are not authorized      |        CI$: 72411,165
 to speak for each other.                     |

ftdkl@acad3.fai.alaska.edu (LaSota Daniel K) (10/12/90)

In article <1990Oct11.193221.13578@midway.uchicago.edu>, chh9@quads.uchicago.edu (Conrad Halton Halling) writes...
>I have made a stack in which I hide the menubar in order to fit more things
>onto each card when using the stack on an SE.  On a Mac II, it isn't 
>necessary to hide the menubar (and in fact it looks a little strange since
>the card is centered in the screen).  Is there a way to determine when the
>screen is larger than the standard SE size so I can hide the menubar on an
>SE but not on a Mac II?
> 
>If I were working in C, I know that I just need to get screenbits.bounds
>to determine the size of the screen.  Perhaps determining the size of the
>screen for HyperCard can be done only using an XFCN?
> 
>I've seen this question discussed here before, but I can't remember the
>answer, and I can't find a clue in the help stacks.  Since this is such a
>trivial question, please just e-mail any help you can provide.  Thanks. :-)
> 
> 
>--
>Conrad Halling
>chh9@midway.uchicago.edu

You can use the screenRect function:
as in:
put the screenrect
This will return four integers separated by commas
These are the dimensions of the screen in which Hypercard's menu is drawn.
If there is more than one monitor screenRect will return the dimensions
of the monitor that the cardWindow is most in as offsets from 0,0
(close to the Apple in the menubar)

Dan LaSota
ftdkl@acad3.fai.alaska.edu                 

gandalf@apple.com (Martin Gannholm) (10/12/90)

In article <45586@apple.Apple.COM> jdevoto@Apple.COM (Jeanne A. E. DeVoto) 
writes:
> In article <1990Oct11.193221.13578@midway.uchicago.edu>
> chh9@quads.uchicago.edu (Conrad Halton Halling) writes:
> >                                [...] Is there a way to determine when 
the
> >screen is larger than the standard SE size so I can hide the menubar on 
an
> >SE but not on a Mac II?
> 
> There are a couple of ways to do this. First of all, the function
> "the screenRect" returns the rect of the main monitor (the one with
> the menubar on it), and you can check whether this is the SE/Plus
> screen rect (0,0,512,342).

HyperCard 1.x will always return the coordinates of the main screen when 
the screenRect function is called. HyperCard 2.0 returns the rect of the 
screen where the card window lies (or in overlapping situations, the one 
containing the largest area of the card window). This obviously only 
happens on machines with multiple monitors.

You can use this to check if you're on the main screen or not (item 1 to 2 
of the screenRect is only "0,0" on the main monitor). Note that the 
coordinates returned can be negative for when the screen is to the left 
and/or above the main screen. If you're not on the main screen you don't 
need to account for the 20-pixel menuBar (more under script systems, e.g. 
KanjiTalk).

Martin Gannholm
Apple Computer

Exclaimer!!!   I typed this myself = I speak for myself...