changing wx.DirDialog behaviour on WinXP

Hello,

(I sent this also to comp.soft-sys.wxwindows).

The problem is, that I want to see the focus
immediatly after opening the wx.DirDialog
in the directory list control (and not on the
OK Button or in the Edit field).

But there is obviously no way to implement this
in wxPython, without changing the wxWidgets code,
isn't it?

The changed (and working) code would lie in the BrowseallbackProc:

#ifndef __WXWINCE__
            SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
=> HWND treecontrol;
=> treecontrol = FindWindowEx(hwnd, NULL, WC_TREEVIEW, NULL);
=> SetFocus (treecontrol);
#endif

Are there other ways conceivable (without creating a new one or use
python win32 extensions), to achieve this?

···

--
Franz Steinhäusler
http://drpython.sourceforge.net/
http://mitglied.lycos.de/drpython/

Franz Steinhäusler wrote:

Hello,

(I sent this also to comp.soft-sys.wxwindows).

The problem is, that I want to see the focus
immediatly after opening the wx.DirDialog in the directory list control (and not on the
OK Button or in the Edit field).

But there is obviously no way to implement this
in wxPython, without changing the wxWidgets code,
isn't it?

Correct.

The changed (and working) code would lie in the BrowseallbackProc:

#ifndef __WXWINCE__
            SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData);
=> HWND treecontrol;
=> treecontrol = FindWindowEx(hwnd, NULL, WC_TREEVIEW, NULL);
=> SetFocus (treecontrol);
#endif

Are there other ways conceivable (without creating a new one or use
python win32 extensions), to achieve this?

You could probably do the same as above using the win32 modules that come with PyWin32. Instead of hooking BrowseallbackProc I think that it makes sense to do it from a wx.CallAfter function, so the dialog is sure to have been displayed an initialized by the time it happens.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!