Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cs.utexas.edu!rutgers!psuvax1!psuvm!barilvm!bguvm.bitnet!reshef1 From: RESHEF1@BGUVM.BITNET (Eran Reshef) Newsgroups: comp.sys.mac.programmer Subject: Re: dialogs with ModalDialog() Message-ID: <706RESHEF1@BGUVM> Date: 7 Aug 90 15:27:11 GMT References: <37353@shemp.CS.UCLA.EDU> Distribution: usa Organization: Ben-Gurion University, Beer-Sheva, Israel Lines: 53 In article <37353@shemp.CS.UCLA.EDU>, trajmar@oahu.cs.ucla.edu (Peter Trajmar) says: > >I have two questions about dialogs (using ModalDialog()). > >1) How can I dim a static text item? I know I can make it a control > [ ... MORE ... ] Why would you want to use a control? Why not putting a user item over the static text item, and set the routine which draws the user item to do the following: procedure dim_text (dlg: WindowPtr; Item : INTEGER); VAR the_rect : Rect; the_handle: handle; the_type: INTEGER; save_state: PenState; BEGIN GetDItem (dlg,item,the_type,the_handle,the_type); GetPenState (save_state); PenMode (patBic); PenPat(gray); PaintRect (the_rect); SetPenState (save_state); END; Make sure that the user item is getting drawn AFTER the static text! >2) Is there a good way to right align the text in an editText item? > [ ... MORE ....] This seems too easy, and maybe I am wrong, but why not doing this : with DialogPeek (the_dialog)^.textH^^ do begin just:=teJustRight; destRect:=the_rect; { the item rect } viewRect:=the_rect; END; { of WITH } Note that you will have to call this code whenever the user selects a new TE or types in it. ------- Eran Reshef, Micro Department, Computation Center, Ben-Gurion University of the Negev, Beer - Sheva, Israel. Bitnet : RESHEF1@BGUVM.BITNET "Vanity of vanities, all is vanity"