【问题标题】:How do I create a "select folder OR file dialog window" in REALbasic?如何在 REALbasic 中创建“选择文件夹或文件对话窗口”?
【发布时间】:2008-09-19 07:27:12
【问题描述】:

你可以使用

SelectFolder() 获取文件夹

GetOpenFolderitem(filter as string) 获取文件

但是您可以选择文件夹或文件吗? (或为此选择多个文件)

【问题讨论】:

    标签: realbasic


    【解决方案1】:

    MonkeyBread 插件在 OpenDialogMBS 类中允许这样做。

    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)
    

    【讨论】:

      【解决方案2】:

      这是不可能通过任何内置 API 实现的。可能有一个插件可以做到这一点,但我认为操作系统不支持它。

      【讨论】:

        【解决方案3】:

        有点晚了,但它已包含在最新版本中。我会把它放在这里以防有人在这个问题上像我一样绊倒:

        RealBasic Multiple Selection: OpenDialog.MultiSelect

        【讨论】:

          【解决方案4】:

          假设您使用的是 .Net,我认为您需要创建自己的控件(或购买一个)。

          【讨论】:

          • 标签状态我正在使用 realbasic
          猜你喜欢
          • 1970-01-01
          • 2017-11-30
          • 1970-01-01
          • 1970-01-01
          • 2020-11-24
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多