|
From: Seth D. <set...@us...> - 2004-12-09 16:32:01
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31200 Modified Files: dialogs.c Log Message: Fixed bug on Carbon builds, where fields in dialogs (like in dialog.ask or the find window) would not have their text selected. Explicit casting from DialogPtr to WindowPtr is a no-no, use the Carbon casting function GetDialogWindow. There are probably other areas that need the same fix. Index: dialogs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/dialogs.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dialogs.c 30 Oct 2004 23:07:30 -0000 1.4 --- dialogs.c 9 Dec 2004 16:31:50 -0000 1.5 *************** *** 1310,1322 **** #if TARGET_API_MAC_CARBON == 1 WindowClass wclass; ! err = GetWindowClass ((WindowRef) pdialog, &wclass); if (err==noErr) { if (wclass == kModalWindowClass) { // it's a dialog ! return (dialogsetselect (pdialog, 0, infinity)); } else if (wclass == kDocumentWindowClass) { // it's not a dialog, it's an olde-tyme window. The Find window, for example. ! return (dialogsetselect (GetDialogFromWindow((WindowRef) pdialog), 0, infinity)); } --- 1310,1326 ---- #if TARGET_API_MAC_CARBON == 1 WindowClass wclass; ! ! /* 12/9/2004 smd: use carbon's casting function, as "(WindowRef)pdialog" doesn't work */ ! WindowPtr pwin = GetDialogWindow (pdialog); ! ! err = GetWindowClass (pwin, &wclass); if (err==noErr) { if (wclass == kModalWindowClass) { // it's a dialog ! return (dialogsetselect (pdialog, 0, infinity)); } else if (wclass == kDocumentWindowClass) { // it's not a dialog, it's an olde-tyme window. The Find window, for example. ! return (dialogsetselect (GetDialogFromWindow (pwin), 0, infinity)); } |