Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!amdahl!cerebus!dalea From: dalea@cerebus.UUCP (Dale M. Arends X5706) Newsgroups: comp.sys.mac.programmer Subject: Re: How do you highlight a default button? Message-ID: <654@cerebus.UUCP> Date: 31 Mar 88 18:03:15 GMT References: <618@unioncs.UUCP> Reply-To: dalea@cerebus.UUCP (Dale M. Arends X5706) Followup-To: comp.sys.mac.programmer Distribution: na Organization: Fujitsu America, Inc. Lines: 29 Keywords: DLOG ALRT default button Summary: Do it yourself, if needed Hilighting the default button in an alert box is automatically done for you if the button is the first item in the DITL list. To hilight a default button in a Dialog box, you will have to do the hilighting yourself. The simplest way is to use GetDItem (...) to get the Rect that the button is positioned at; InSet that rect about negative 5 (-5) pixels (that actually makes it larger); set the pen width to 3 pixels and draw a roundRect. This will draw the heavy border around the button. Reset the pen width and the box, and you're done. A few points: make the DLOG invisible in the resource and put the hilighting routine immediately after the call to retrieve the DLOG. Then use ShowWindow to draw the dialog before calling ModalDialog. Otherwise, the drawing of the hilighting will be out of sync with the appearing of the window. Also: unless this is for your own use only, please make the default button be the least disasterous option to data already saved unless the dialog is confirmation for updating saved data. I'm sorry I don't have actual code segments here at work. If you have problems and need help, email to me at the address below. -- -- Dale M. Arends (Fujitsu America Inc., San Jose, Calif.) {...}!amdahl!cerebus!dalea The opinions expressed herein do not necessarily reflect those of my employer. They are entirely my own if they make sense and I disavow them if they don't.