View Issue Details

IDProjectCategoryView StatusLast Update
0027041LazarusLCLpublic2014-11-17 09:01
ReporterTorsten Bonde ChristiansenAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSOS XOS Version10.9.5
Product Version1.2.7 (SVN)Product Build46846 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0027041: TFileDialog.Handle is 0 on MAC (Carbon)
DescriptionOn MAC (Carbon) it is no possible to access the NavDialogRef if one need to create Mac specific code.

On Linux (Gtk2) and Windows (Win32/64) the .Handle of TFileDialog is set respectively.

Setting (Handle <> 0) has a single sideeffect: The callback function 'NavDialogCallback' sets FilterIndex directly (which in turn check for (Handle = 0).
Instead this callback should use TFileDialog.IntfFileTypeChanged. This is the same behaviour as Win32 & GTK widgetsets.
Steps To ReproduceN/A
Additional InformationI have created a small patch,which sets the handle correctly on TFileDialog and correctly calls IntfFileTypeChanged.
TagsNo tags attached.
Fixed in Revision46850
LazTarget1.4
WidgetsetCarbon
Attached Files
  • carbonwsdialogs.pp.patch (946 bytes)
    Index: lcl/interfaces/carbon/carbonwsdialogs.pp
    ===================================================================
    --- lcl/interfaces/carbon/carbonwsdialogs.pp	(revision 46846)
    +++ lcl/interfaces/carbon/carbonwsdialogs.pp	(working copy)
    @@ -279,8 +279,7 @@
           if CallBackParms = nil then Exit;
           PMenuSpec := NavMenuItemSpecPtr(CallBackParms^.eventData.eventDataParms.param);
           if PMenuSpec = nil then Exit;
    -      FileDialog.FilterIndex:= PMenuSpec^.menuType + 1;
    -      FileDialog.DoTypeChange;
    +      FileDialog.IntfFileTypeChanged(PMenuSpec^.menuType + 1);
         end;
       kNavCBSelectEntry:   // user has selected something
         begin
    @@ -414,6 +413,7 @@
     
         try
           // Display dialog
    +      FileDialog.Handle := THandle(PtrUInt(DialogRef));
           if OSError(NavDialogRun(DialogRef), Self, SShowModal, 'NavDialogRun') then Exit;
           
           if NavDialogGetUserAction(DialogRef) <> kNavUserActionCancel then // User OK?
    

Activities

Torsten Bonde Christiansen

2014-11-14 12:16

reporter  

carbonwsdialogs.pp.patch (946 bytes)
Index: lcl/interfaces/carbon/carbonwsdialogs.pp
===================================================================
--- lcl/interfaces/carbon/carbonwsdialogs.pp	(revision 46846)
+++ lcl/interfaces/carbon/carbonwsdialogs.pp	(working copy)
@@ -279,8 +279,7 @@
       if CallBackParms = nil then Exit;
       PMenuSpec := NavMenuItemSpecPtr(CallBackParms^.eventData.eventDataParms.param);
       if PMenuSpec = nil then Exit;
-      FileDialog.FilterIndex:= PMenuSpec^.menuType + 1;
-      FileDialog.DoTypeChange;
+      FileDialog.IntfFileTypeChanged(PMenuSpec^.menuType + 1);
     end;
   kNavCBSelectEntry:   // user has selected something
     begin
@@ -414,6 +413,7 @@
 
     try
       // Display dialog
+      FileDialog.Handle := THandle(PtrUInt(DialogRef));
       if OSError(NavDialogRun(DialogRef), Self, SShowModal, 'NavDialogRun') then Exit;
       
       if NavDialogGetUserAction(DialogRef) <> kNavUserActionCancel then // User OK?

Jesus Reyes

2014-11-15 05:51

developer   ~0079156

Thanks, Applied.
I think this can be merged to fixes if needed.

Torsten Bonde Christiansen

2014-11-17 09:00

reporter   ~0079183

Merging to fixes would be fantastic! Thanks.

Issue History

Date Modified Username Field Change
2014-11-14 12:16 Torsten Bonde Christiansen New Issue
2014-11-14 12:16 Torsten Bonde Christiansen File Added: carbonwsdialogs.pp.patch
2014-11-15 04:42 Jesus Reyes Assigned To => Jesus Reyes
2014-11-15 04:42 Jesus Reyes Status new => assigned
2014-11-15 05:51 Jesus Reyes Fixed in Revision => 46850
2014-11-15 05:51 Jesus Reyes LazTarget => 1.4
2014-11-15 05:51 Jesus Reyes Note Added: 0079156
2014-11-15 05:51 Jesus Reyes Status assigned => resolved
2014-11-15 05:51 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-11-15 05:51 Jesus Reyes Resolution open => fixed
2014-11-15 05:51 Jesus Reyes Target Version => 1.4
2014-11-17 09:00 Torsten Bonde Christiansen Note Added: 0079183
2014-11-17 09:01 Torsten Bonde Christiansen Status resolved => closed