This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Various fixes from Thomas Wegner
authorChris Nandor <pudge@pobox.com>
Fri, 1 Mar 2002 17:32:02 +0000 (17:32 +0000)
committerChris Nandor <pudge@pobox.com>
Fri, 1 Mar 2002 17:32:02 +0000 (17:32 +0000)
p4raw-id: //depot/maint-5.6/macperl@14932

macos/macperl/MPAppleEvents.c
macos/macperl/MPPreferences.c

index ffae9d4..8a6cd5a 100644 (file)
@@ -9,6 +9,9 @@ Apple Developer Support UK
 Language       :       MPW C
 
 $Log: MPAppleEvents.c,v $
+Revision 1.6  2002/03/01 04:24:59  pudge
+Various bugfixes from Thomas Wegner
+
 Revision 1.5  2002/02/04 07:46:28  neeri
 Empty path is ENOENT (MacPerl Bug #512351)
 
@@ -1790,7 +1793,7 @@ pascal OSErr GetApplicationProperty(const AEDesc *theObjToken, AEDesc *dataDesc)
                scrap = TEScrapHandle();
                HLock(scrap);
                theErr = AEStream_WriteDesc(&aes, typeChar, *scrap, GetHandleSize(scrap));
-               HLock(scrap);
+               HUnlock(scrap);
                if (theErr || (theErr = AEStream_CloseList(&aes)))
                        goto abortClipboard;
                theErr = AEStream_Close(&aes, dataDesc);
index 82cc6cd..adabb60 100644 (file)
@@ -9,6 +9,9 @@ Apple Developer Support UK
 Language       :       MPW C
 
 $Log: MPPreferences.c,v $
+Revision 1.11  2002/03/01 04:24:59  pudge
+Various bugfixes from Thomas Wegner
+
 Revision 1.10  2002/01/23 05:47:48  pudge
 Fix prefs file name
 
@@ -421,6 +424,9 @@ pascal Boolean PrefLibFilter(DialogPtr dlg, EventRecord * ev, short * item)
                cell = ev->where;
                GlobalToLocal(&cell);
                GetDialogItem(dlg, pld_List, &kind, &h, &r);
+               // add scroll bar width to list rectangle
+               r.right = r.right + 15;
+               
                if (PtInRect(cell, &r)) {
                        if (LClick(cell, ev->modifiers, PathList))
                                for (SetPt(&cell, 0, 0); LGetSelect(true, &cell, PathList); ++cell.v) {
@@ -531,13 +537,15 @@ static short PrefsLibDialog(DialogPtr prefs, short resFile)
                case pld_Remove:
                        SetPt(&cell, 0, 0);
                        
-                       if (LGetSelect(true, &cell, PathList) && AppAlert(PrefLibDelID) == 1)
+                       if (LGetSelect(true, &cell, PathList) && AppAlert(PrefLibDelID) == 1) {
+                               // make sure the list gets redrawn correctly
+                               InvalRect(&((**PathList).rView));
                                do {
                                        LDelRow(1, cell.v, PathList);
                                                
                                        --PathCount;
                                } while (LGetSelect(true, &cell, PathList));
-                               
+                       }
                        break;
                case pld_Add:
                        GetIndString(msg, PrefDialog, pd_AddPath);
@@ -616,8 +624,12 @@ static int PrefsEnvEdit(StringPtr env)
        Str255          contents;
        Str63                   msg;
        char                    data[256];
+       GrafPtr         savePort;
+       
+       GetPort(&savePort);
        
        envEdit = GetNewAppDialog(PrefEnvAddID);
+       SetPort(envEdit);
        
        equals = PLstrchr(env, '=');
        *equals= *env - (equals - (Ptr) env);
@@ -694,6 +706,8 @@ failed:
                
        DisposeDialog(envEdit);
        
+       SetPort(savePort);
+       
        return result;
 }
 
@@ -736,6 +750,9 @@ pascal Boolean PrefEnvFilter(DialogPtr dlg, EventRecord * ev, short * item)
                cell = ev->where;
                GlobalToLocal(&cell);
                GetDialogItem(dlg, pld_List, &kind, &h, &r);
+               // add scroll bar width to list rectangle
+               r.right = r.right + 15;
+               
                if (PtInRect(cell, &r)) {
                        if (LClick(cell, ev->modifiers, PathList))
                                for (SetPt(&cell, 0, 0); LGetSelect(true, &cell, PathList); ++cell.v) {
@@ -827,13 +844,15 @@ static short PrefsEnvDialog(DialogPtr prefs, short resFile)
                case ped_Remove:
                        SetPt(&cell, 0, 0);
                        
-                       if (LGetSelect(true, &cell, PathList) && AppAlert(PrefEnvDelID) == 1)
+                       if (LGetSelect(true, &cell, PathList) && AppAlert(PrefEnvDelID) == 1) {
+                               // make sure the list gets redrawn correctly
+                               InvalRect(&((**PathList).rView));
                                do {
                                        LDelRow(1, cell.v, PathList);
                                                
                                        --PathCount;
                                } while (LGetSelect(true, &cell, PathList));
-                               
+                       }
                        break;
                case ped_Add:
                        PLstrcpy(contents, "\p=");
@@ -1044,13 +1063,17 @@ pascal void DoPrefDialog()
        Handle          h;
        DialogPtr       prefs;
        Rect                    bounds;
+       GrafPtr         savePort;
+       
+       GetPort(&savePort);
        
-       resFile         = CurResFile();
+       resFile = CurResFile();
        
        OpenPreferences();
-
+       
        prefs = GetNewAppDialog(PrefDialog);
-
+       SetPort(prefs);
+       
        GetDialogItem(prefs, pd_LibIcon, &kind, &h, &bounds);
        SetDialogItem(prefs, pd_LibIcon, kind, (Handle) &uDrawPrefIcon, &bounds);
 
@@ -1111,6 +1134,8 @@ pascal void DoPrefDialog()
                DisposeHandle(gCachedLibraries);
                gCachedLibraries = nil;
        }
+
+       SetPort(savePort);
 }
 
 static ListHandle FontList;
@@ -1306,8 +1331,12 @@ pascal Boolean DoFormatDialog(DocFormat * form, Boolean * defaultFormat)
        Rect                    dbounds;
        Str255          contents;
        MenuHandle      fonts;
-       
+       GrafPtr         savePort;
+
+       GetPort(&savePort);
+
        format = GetNewAppDialog(FormatDialog);
+       SetPort(format);
 
        GetDialogItem(format, fd_Separator, &kind, &h, &bounds);
        SetDialogItem(format, fd_Separator, kind, (Handle) &uSeparator, &bounds);
@@ -1433,5 +1462,7 @@ pascal Boolean DoFormatDialog(DocFormat * form, Boolean * defaultFormat)
        DisposeDialog(format);
        DisposeMenu(fonts);
        
+       SetPort(savePort);
+       
        return (item == fd_OK);
 }