home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!uniwa!cujo!peter
- From: peter@cujo.curtin.edu.au (Peter N Lewis)
- Subject: Re: Default buttons in dialogs
- Message-ID: <1993Jan7.150354.15491@cujo.curtin.edu.au>
- Organization: Curtin University of Technology
- References: <880840m.29.726366713@axe.acadiau.ca>
- Date: Thu, 7 Jan 1993 15:03:54 GMT
- Lines: 54
-
- 880840m@axe.acadiau.ca (MICHAEL ALEXANDER MCKAY) writes:
-
- >Whenever I make a dialog box with ResEdit, my "OK" buttons, which are always
- >the number 1 button, fail to show up in my app with the heavy outline around
- >them. What am I doing wrong?
-
- You're foolishly assuming that Apple figured this out for you. Bad idea
- :)
-
- It works, sort of, for Alerts, although even then it won't be redrawn if
- the alert is updated (eg, after a screen blanking). I ignore that, that
- one is Apple's problem.
-
- As for Dialogs, the normal solution (well, ok, the one I use :-) is to
- create a user item to draw the outline thusly:
-
- const
- ok_item=1;
-
- procedure OutlineDefault1 (dp: dialogPtr; item: integer);
- var
- kind: integer;
- h: handle;
- r: rect;
- begin
- GetDItem(dp, ok_item, kind, h, r);
- PenSize(3, 3);
- InsetRect(r, -4, -4);
- FrameRoundRect(r, 16, 16);
- end;
-
- procedure SetUpDefaultOutline (dp: dialogPtr; user_item: integer);
- var
- kind: integer;
- h: handle;
- r: rect;
- begin
- GetDItem(dp, user_item, kind, h, r);
- InsetRect(r, -10, -10);
- SetDItem(dp, user_item, kind, handle(@OutlineDefault1), r);
- end;
-
- Call SetupDefaultOutline after creating the dialog and before
- ShowWindowing it.
-
- Under System 7 there is a call to do it for you, but I can't seem to
- track it down.
- Peter.
-
-
-
- --
- _______________________________________________________________________
- Peter N Lewis <peter@ncrpda.curtin.edu.au> Ph: +61 9 368 2055
-