home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20887 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.9 KB  |  65 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!uniwa!cujo!peter
  3. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  4. Subject: Re: Default buttons in dialogs
  5. Message-ID: <1993Jan7.150354.15491@cujo.curtin.edu.au>
  6. Organization: Curtin University of Technology
  7. References: <880840m.29.726366713@axe.acadiau.ca>
  8. Date: Thu, 7 Jan 1993 15:03:54 GMT
  9. Lines: 54
  10.  
  11. 880840m@axe.acadiau.ca (MICHAEL ALEXANDER MCKAY) writes:
  12.  
  13. >Whenever I make a dialog box with ResEdit, my "OK" buttons, which are always
  14. >the number 1 button, fail to show up in my app with the heavy outline around 
  15. >them. What am I doing wrong?
  16.  
  17. You're foolishly assuming that Apple figured this out for you.  Bad idea
  18. :)
  19.  
  20. It works, sort of, for Alerts, although even then it won't be redrawn if
  21. the alert is updated (eg, after a screen blanking).  I ignore that, that
  22. one is Apple's problem.
  23.  
  24. As for Dialogs, the normal solution (well, ok, the one I use :-) is to
  25. create a user item to draw the outline thusly:
  26.  
  27.   const
  28.     ok_item=1;
  29.   
  30.   procedure OutlineDefault1 (dp: dialogPtr; item: integer);
  31.     var
  32.       kind: integer;
  33.       h: handle;
  34.       r: rect;
  35.   begin
  36.     GetDItem(dp, ok_item, kind, h, r);
  37.     PenSize(3, 3);
  38.     InsetRect(r, -4, -4);
  39.     FrameRoundRect(r, 16, 16);
  40.   end;
  41.  
  42.   procedure SetUpDefaultOutline (dp: dialogPtr; user_item: integer);
  43.     var
  44.       kind: integer;
  45.       h: handle;
  46.       r: rect;
  47.   begin
  48.     GetDItem(dp, user_item, kind, h, r);
  49.     InsetRect(r, -10, -10);
  50.     SetDItem(dp, user_item, kind, handle(@OutlineDefault1), r);
  51.   end;
  52.  
  53. Call SetupDefaultOutline after creating the dialog and before
  54. ShowWindowing it.
  55.  
  56. Under System 7 there is a call to do it for you, but I can't seem to
  57. track it down.
  58.    Peter.
  59.  
  60.  
  61.  
  62. -- 
  63. _______________________________________________________________________
  64. Peter N Lewis <peter@ncrpda.curtin.edu.au>           Ph: +61 9 368 2055
  65.