wilson@ucbarpa.Berkeley.EDU (James E. Wilson) (07/19/89)
In article <23679@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes: >BTW: Does anyone know of any bugs in the MacTutor PopUpMenu CDEF? > I'm using it in my programs, but I can't stop wondering if > it contains bugs. So far, I haven't found anything wrong with it. > 1) Suppose the user has color menus which draw white text on a non-white menu background. DrawPopBox uses the item name color when it draws the currently selected menu item into the popup box. This is drawn against the default window content color. In this case, the result is a white-on-white display which is rather difficult to read. My solution was to use the menu title color instead of the item name color. A similar problem can occur if the user has a non-white menu bar with white menu titles. In this case, the popup menu title will be invisible since it is always printed against the default window content color. This problem is probably rare enough to ignore. And if you want to be really thorough, you should consider what happens if the user has a non-white window content color. Ah, working with color is so much fun! 2) The doCalcCRgns procedure clears the high byte of its input parameter. This is incorrect, it should only clear the high bit. You should also add code to handle the two new messages proposed for System 7.0, calcCntlRgn and calcThumbRgn, so that it will still run when 7.0 comes out. (See technote 212). 3) As for aesthetics, I think that it looks much nicer if you make the title box one or two characters wider than the title string. Otherwise, the whole thing looks rather cramped. (Must modify GetTitleRect and GetBoxRect.) Jim Wilson wilson@ernie.Berkeley.EDU ...!ucbvax!ucbernie!wilson