How to create a "Select Folder or File" dialog box in REALbasic?

you can use

SelectFolder () to get the folder

or

GetOpenFolderitem (filter as string) for receiving files

but can you choose a folder or file? (or, if you want, select multiple files)

+3
source share
4 answers

The MonkeyBread plugin allows this in the OpenDialogMBS class.

http://www.monkeybreadsoftware.net/pluginhelp/navigation-opendialogmbs.shtml

OpenDialogMBS.AllowFolderSelection as Boolean
property, Navigation, MBS Util Plugin (OpenDialog), class OpenDialogMBS, Plugin version: 7.5, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Whether folders can be selected.
Example: 
dim o as OpenDialogMBS
dim i,c as integer
dim f as FolderItem

o=new OpenDialogMBS
o.ShowHiddenFiles=true
o.PromptText="Select one or more files/folders:"
o.MultipleSelection=false
o.ActionButtonLabel="Open files/folders"
o.CancelButtonLabel="no, thanks."
o.WindowTitle="This is a window title."
o.ClientName="Client Name?"
o.AllowFolderSelection=true
o.ShowDialog

c=o.FileCount
if c>0 then
  for i=0 to c-1
    f=o.Files(i)

    FileList.List.AddRow f.AbsolutePath
  next
end if


Notes: 
Default is false.
Setting this to true on Windows or Linux has no effect there.
(Read and Write property)
+5
source

This is not possible using any of the built-in APIs. There may be a plugin for this, but I don't think OS support is for it.

0
source
0

Assuming you are using .Net, I think you will need to create your own control (or buy it).

-3
source

Source: https://habr.com/ru/post/1697192/


All Articles