Path: utzoo!attcan!uunet!decwrl!adobe!hawley From: hawley@adobe.COM (Steve Hawley) Newsgroups: comp.sys.mac.programmer Subject: Re: Query: Double lines on default button...How? Message-ID: <3486@adobe.UUCP> Date: 3 Jul 90 15:19:16 GMT References: <9883@odin.corp.sgi.com> Reply-To: hawley@adobe.UUCP (Steve Hawley) Organization: Adobe Systems Incorporated, Mountain View Lines: 34 In article <9883@odin.corp.sgi.com> myoung@joker.sgi.com (Mark Young) writes: >that describes how to make a button with the double lines that indicates >the default selection. I found a comment indicating that item #1 was the >default selection, but my "ok" button, which is item #1 doesn't appear with >the telltale double lines? > >any clues? Bad news: The bold outline does NOT get drawn for you. You must do that yourself. Inside Macintosh Volume I has some code to do that. It boils down to getting the bounding rect of the item, InsetRect(&boundingRect, -4, -4), PenSize(2, 2), and then calling FrameRoundRect(...) to draw it. The bad news is that you have to do the updates yourself. This can be a real pain in modeless dialog boxes, in particular. Since this is likely to be something you'll want to do fairly often, you may want to write a function like "EmboldenButton()" that takes a ControlHandle as an argument and does all the nitty-gritty. The reason for using a ControlHandle instead of a handle to a dialog item is that you can always get a ControlHandle from a dialog item, but not the reverse. Remember, you may want to call this from another section of your code, say for use in a plain window not a dialog box. To get around the update problem in dialog boxes, you may wish to define the bold outline as a user item that draws itself around item #1. Some people implement this as a separate control definition as well. Happy Trails. Steve Hawley hawley@adobe.com -- "A blow on the head is... ...worth two in the bush." -Basil Fawlty