I’m on Mac OS 12.4 Xojo 2022.R1.1 on an Intel Mac
But this needs to work back to High Sierra and Windows 7-11
I am creating a custom file type and Saving the file. If I double click on the data file the app opens and opens the datafile just fine.
If however if I try to open the app with the Open Dialog class I can’t select the file… It is greyed out! How can if fix this besides allowing the file one to per any file and then checking if it is a .PLC after?
The Save and Open methods are show below… Both use the same File Set Filter!
Here is the save method:
Public Function Save(File as FolderItem = Nil) As Boolean
If File Is NIL then
Dim dlg As New SaveAsDialog
dlg.InitialDirectory = App.Prefs.PLCFolder
dlg.PromptText = "Save Fermentation Data"
If Not (theData.DataFile Is NIL) then
dlg.SuggestedFileName = theData.DataFile.Name
dlg.Title = "Save Fermentation As"
Else
dlg.SuggestedFileName = theData.Title
dlg.Title = "Save Fermentation"
End if
dlg.Filter = PLCFileSet.PLCSaved
File = dlg.ShowModal
If File Is Nil Then
Return False
ElseIf File.Exists then
File.Delete
End if
End if
theData.Save(File)
Return True
End Function
Here is the Open Method:
Sub Action() Handles Action
Dim dlg As OpenDialog
dlg = New OpenDialog
dlg.InitialFolder = App.Prefs.PLCFolder
dlg.Filter = PLCFileSet.PLCSaved
dlg.ActionButtonCaption = "Select PLC File"
dlg.CancelButtonCaption = "Cancel"
dlg.SuggestedFileName = ""
dlg.Title = "Select Saved PLC Data (.PLC) File(s)"
dlg.PromptText = "Select Select Processed PLC File"
dlg.MultiSelect = False
Dim F as FolderItem = dlg.ShowModal
If F is NIL Then Return
AcceptFile(F)
End Sub