Okay…think this works best so far in the DropObject event handler of the DesktopListBox:
If obj.FolderItemAvailable Then
Do
If obj.FolderItem.Name.Right(2) = ".v" or obj.FolderItem.Name.Right(4) = ".vhd" or obj.FolderItem.Name.Right(5) = ".vhdl" Then
Me.AddRow(obj.FolderItem.Name)
Me.RowTagAt(Me.LastAddedRowIndex) = obj.FolderItem
Sources.Add(obj.FolderItem)
End If
Loop Until Not obj.NextItem
End If
AcceptFileDrop on macOS just shows no effect, regardless what I put in. Some older threads report the same here.
Now onto Scintilla plugin and Verilog/VHDL syntax highlighting (o;
You may use obj.FolderItem.Name.EndsWith, more reliable.
So if your users drag only invalid files (possibly thinking they are valid), they get the highlighted rectangle and expect the drop to do something. Not the best approach, IMO.
It would also help if you were populating all of the fields necessary on macOS as well. To see what they are, try adding a FileTypeGroup to your project and then dragging the type(s) you are interested in onto the editor. It’ll ask the OS for the right values.
By “valid”, I meant the fact you can accept them. You said you decide which you accept later, which means the user may drop files (all that you won’t accept later) and still see the highlight telling it should work.
What is this highlight to which you refer? The user can drop several files at once and it’s the user who decides which files they want processed. The app will list which files were accepted, and they get a message for each which is not.
I was talking about the visual effect you’d get when a control/window shows the drag would be accepted.
However, I’m seeing this doesn’t happen on my current Mac; perhaps I had in mind a ten-years old behaviour (sorry).
Anyway, the current behaviour, as seen in other apps, is to show a “+” sign in a green circle added to the mouse pointer. That’s also a visual indication telling the drag is going to be accepted.
Right, but suppose the user drags/drops muiltiple files. If the app is (say) only wishing to process jpegs, and some are not jpegs, then how should/does it look?
You’re assuming jpegs are valid jpegs, and neither corrupt, nor malware. It is unsafe to assume a jpeg to be a valid image. Especially in Windows which seems to think everything should be executable, as distinct from data.
My app does not trust file suffixes - at the event layer it accepts any file dropped, but it then reads each file far enough to work out whether it really is one it should accept, or not. This is tedious and it requires a basic understanding of each file format down at the byte level. It’s also possible the file is corrupt.