Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Mac multiple select (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: RB thread "paused" whenever a GUI action such as window dragging or resize occurs
Next thread: Maxi Toolbar


FW: Special Valentine's Offer for Valentina - Beat the Price Increase!   -   Lynn Fredricks
  Mac multiple select   -   RBNUBE
   Re: Mac multiple select   -   E. Tejkowski
    RE: Mac multiple select   -   RBNUBE
     Re: Mac multiple select   -   E. Tejkowski
   Re: Mac multiple select   -   Lennox Jacob
    Re: Mac multiple select   -   Christian Schmitz
    RE: Mac multiple select   -   RBNUBE
     Re: Mac multiple select   -   E. Tejkowski

Mac multiple select
Date: 02.08.07 03:31 (Wed, 1 Aug 2007 22:31:47 -0400)
From: RBNUBE
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Mac multiple select
Date: 02.08.07 06:21 (Thu, 2 Aug 2007 00:21:04 -0500)
From: E. Tejkowski

On Aug 1, 2007, at 9:31 PM, RBNUBE wrote:

> I've been looking for Mac declares that will allow you to select
> more than
> one file using something like GetOpenFolderItem. I only see people
> saying
> that it can be done, or that it's been covered 'multiple times,'
> but no one
> seems to provide the declares to do it.

My guess is that the reason you haven't seen this yet is because it's
a HUGE pain in the butt to code. This is an example of something that
REALbasic BADLY needs (and has needed for years - Nav Services
predates Mac OS X! ), because the average RB user will be either
unwilling or unable to weed through the hairy documentation required
to make this happen. It's not just a couple of declares. It requires
several declares, a callback, and some other ugliness.

> Anyone care to share?
> (Already have Windows covered, just need Mac.)

Indeed. I have posted an example here (Multiple File Selection) that
shows how to select multiple audio files:

http://www.sonicamigos.com/etejkowski/code.html

You can customize this code to do all sorts of things (preview,
change the dlog's title, etc…), but you will have to read Apple's
Navigation Services documentation to figure it out.

Good luck,
Erick

P.S. Thanks to Charles Yeomans for the Core classes accompanying this
demo.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

RE: Mac multiple select
Date: 02.08.07 06:31 (Thu, 2 Aug 2007 01:31:37 -0400)
From: RBNUBE
Wow...there is a lot of stuff in your example. Does this example have
functions other than those necessary to select multiple files?

And thanks...much appreciated.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Mac multiple select
Date: 02.08.07 07:05 (Thu, 2 Aug 2007 01:05:37 -0500)
From: E. Tejkowski
There are probably classes in the CORE classes that are not being
used. I just toss that whole folder into my projects for ease of use
(again, thanks to Charles).

Otherwise, everything in the SANav class and module gets used by the
demo IIRC.

Erick

On Aug 2, 2007, at 12:31 AM, RBNUBE wrote:

> Wow...there is a lot of stuff in your example. Does this example have
> functions other than those necessary to select multiple files?
>
> And thanks...much appreciated.
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Mac multiple select
Date: 02.08.07 15:04 (Thu, 2 Aug 2007 07:04:03 -0700 (PDT))
From: Lennox Jacob
Hi RBNUBE,

RBNUBE <<email address removed>> wrote: I've been looking for Mac declares that will allow you to select more than
one file using something like GetOpenFolderItem. I only see people saying
that it can be done, or that it's been covered 'multiple times,' but no one
seems to provide the declares to do it.
Anyone care to share?
(Already have Windows covered, just need Mac.)

So that I can understand and configure Erick's project would you mind sharing your Windows project too?

Thanks.

Lennox

---------------------------------
Building a website is a piece of cake.
Yahoo! Small Business gives you all the tools to get online.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Mac multiple select
Date: 02.08.07 15:12 (Thu, 2 Aug 2007 16:12:00 +0200)
From: Christian Schmitz
Lennox Jacob <<email address removed>> wrote:

> Hi RBNUBE,
>
> RBNUBE <<email address removed>> wrote: I've been looking for Mac
> declares that will allow you to select more than one file using something
> like GetOpenFolderItem.

Ever tried my OpenDialogMBS class?

Gruß
Christian

-

RE: Mac multiple select
Date: 03.08.07 01:28 (Thu, 2 Aug 2007 20:28:39 -0400)
From: RBNUBE
> So that I can understand and configure Erick's
> project would you mind sharing your Windows project too?

I haven't had time to deal with Erick's example. If you look through the
demo, you will see that there is only a small bit of code in the PushButton.
I think that's all you need, plus any of the pertinent classes, modules,
etc.

As far as Windows, I use this:

New Property:
filter as String

New Property:
ParentWindow as Window

New Method:
GetMultiOpenDialog, title as String, filter() as String, parentWindow as
Window, Return Type is FolderItem()

#if TargetWin32 then
Declare Function GetOpenFileNameA lib "comdlg32" (lpofn as Ptr) as
Boolean
Declare Function CommDlgExtendedError lib "comdlg32" as Integer
Declare Function GetModuleHandleA lib "kernel32" (name as Integer) as
Integer

dim OpenFileStruct as new MemoryBlock(73)
dim FilterString as MemoryBlock
dim fileOutBuffer as new MemoryBlock(2048)
dim titleCString as MemoryBlock = title + chr(0)
dim results(-1) as Folderitem
dim pos as integer
dim s as string
dim path as String
dim error as integer, exc as RuntimeException

OpenFileStruct.long(0) = 76 // Struct Size

if ParentWindow <> nil then
OpenFileStruct.Long(4) = parentWindow.WinHWND // Owning window
end if

OpenFileStruct.long(8) = GetModuleHandleA(0)

FilterString = Join(filter,chr(0)) + chr(0)
OpenFileStruct.Ptr(12) = FilterString

OpenFileStruct.long(16) = 0 //NULL -- lpstrCustomFilter
OpenFileStruct.long(20) = 0 // Ignored because of above --
nMaxCustFilter
OpenFileStruct.long(24) = 0 // Ignored because of above -- nFilterIndex
OpenFileStruct.ptr(28) = fileOutBuffer
OpenFileStruct.long(32) = 2048
OpenFileStruct.long(36) = 0
OpenFileStruct.long(40) = 0
OpenFileStruct.long(44) = 0
OpenFileStruct.Ptr(48) = titleCString
OpenFileStruct.Long(52) = &h81200

if GetOpenFileNameA(OpenFileStruct) then
// Try to get the results
// scan the fileOutBuf
path = fileOutBuffer.CString(0)
while fileOutBuffer.byte(pos) <> 0 // scan for another null character
s = fileOutBuffer.CString(pos)
pos = pos + lenb(s) + 1
results.append GetFolderItem(path+"\"+s,
FolderItem.PathTypeAbsolute)
wend

If UBound(results) = 0 And Len(path) > 1 Then
results.Append GetFolderItem(path, FolderItem.PathTypeAbsolute)
End if

// the first file is the current directory. We can remove it
results.remove 0

return Results
else
error = CommDlgExtendedError()
if error = 0 then
// Just pressed cancel...
return Results
else
exc = new RuntimeException
exc.ErrorNumber = error
raise exc
end if
end if
#else // not win32
raise new RuntimeException
#endif

PushButton Action:
dim f() as FolderItem
dim i as integer

f = GetMultiOpenDialog("Hello World!", Array("All Files","*.*"), self)

for i = 0 to ubound(f)
msgBox "You selected " + f(i).AbsolutePath
next

ParentWindow = Window1

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Mac multiple select
Date: 03.08.07 04:23 (Thu, 2 Aug 2007 22:23:26 -0500)
From: E. Tejkowski
On Aug 2, 2007, at 7:28 PM, RBNUBE wrote:
>>
> I haven't had time to deal with Erick's example. If you look
> through the
> demo, you will see that there is only a small bit of code in the
> PushButton.
> I think that's all you need, plus any of the pertinent classes,
> modules,
> etc.

This is correct… all you need is the code in the PushButton, but you
can look in the class and module and customize if you need to.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>