multiple file selections in a wx.GenericDirCtrl widget??

I realize this is old but just for the sake of the archives/google, you can accomplish this by getting the underlying tree control via GetTreeCtrl, and then using SetStyle(wx.TR_MULTIPLE) or something similar. It seems to be working fine for me.

  • Mike
···

-----Original Message-----
From: Søren Skou Nielsen [mailto:Soren.Nielsen@mic.dtu.dk]
Sent: Monday, April 30, 2007 6:15 AM
To: wxpython-users@lists.wxwidgets.org
Subject:
[wxPython-users] multiple file selections in a wx.GenericDirCtrl widget??

Hi,

I’m trying to make a small program that plots certain data from some selected files… now the question is:

Is it possible to do multiple file selections in a wx.GenericDirCtrl widget?? I have not been able to find a way to do this… If not, is there another way to do it?

This will allow multiple selections

MyDirCrl = wx.GenericDirCtrl(parent, wx.ID_ANY)

dir_tree = MyDirCtrl.GetTreeCtrl()

dir_tree.SetWindowStyle(dir_tree.GetWindowStyle() | wx.TR_MULTIPLE)

There are some other things you need to be aware of though. The GenericDirCtrl does not have a GetSelections/GetPaths function so to make having multiple selections to be useful in this context you will have to implement a function to retrieve the multiple paths by working with the underlying TreeCtrl.

Also calling ShowHidden with this style active on MSW will raise errors about not being able to set focus on a multi-select tree (something along these lines anyway).

cody

···

On Jun 27, 2007, at 1:45 PM, Rooney, Mike ((ext. 324)) wrote:

I realize this is old but just for the sake of the archives/google, you can accomplish this by getting the underlying tree control via GetTreeCtrl, and then using SetStyle(wx.TR_MULTIPLE) or something similar. It seems to be working fine for me.

  • Mike

-----Original Message-----
From: Søren Skou Nielsen [mailto:Soren.Nielsen@mic.dtu.dk]
Sent: Monday, April 30, 2007 6:15 AM
To: wxpython-users@lists.wxwidgets.org
Subject: [wxPython-users] multiple file selections in a wx.GenericDirCtrl widget??

Hi,

I’m trying to make a small program that plots certain data from some selected files… now the question is:

Is it possible to do multiple file selections in a wx.GenericDirCtrl widget?? I have not been able to find a way to do this… If not, is there another way to do it?