wxTreeCtrl navigation using joystick

Hi list!

I'm trying to implement treectrl navigation through joystick on my app.
At the moment it is catching the joystick actions and calling to
functions which are working nice, to expand or collapse items for
example or changing focus to different panels.

buy my question is: if there is any way to map buttons from the joystick
to work as if they were the keyboard arrows and the plus and minus keys
(+/-).

for the moment I'm fiddling around with the wxTreeCtrl functions to get
and set different items, but seems quite a pain or there are things I
don't know yet.

I'm using the CVS version of wxWidgets and wxPython.

oh, and I'm really new to wxWidgets, wxPython, and even Python!
(two months) so any recommended reading or tips will be of much help.

saludos,
Ramiro

···

--
rama <medialist@xicnet.com>

Hi all!

I managed to compile wxPython 2.5.1.5 on Windows XP with USE_SWIG=0. I
have problems with running activex samples, but I will leave this for
later.

I downloaded SWIG 1.3.20 and applied three patches:

swig.python-docstring.patch
swig.xmlout.patch
swig.python-prepend.patch

I compiled swig and have swig.exe.

Now when I try to install wxPython 2.5.1.5 with USE_SWIG=1, I get the
following

C:\python-workspace>python setup.py install FINAL=1 USE_SWIG=1
Preparing CORE...
swig -c++ -Wall -nodefault -python -keyword -new_repr -modern -I./src
-D__WXMSW__ -noruntime -DBUILDING_RENAMERS -xmlout
c:\docume~1\hh~1\locals~1\temp\tmpbic7x3.xml -Isrc -o
src\msw\gdi_wrap.cpp src\gdi.i
src\my_typemaps.i:298: Syntax error in input.
Traceback (most recent call last):
  File "setup.py", line 146, in ?
    USE_SWIG, swig_force, swig_args, swig_deps +
  File "C:\python-workspace\config.py", line 320, in run_swig
    spawn(cmd)
  File "C:\python-workspace\distutils\spawn.py", line 39, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
  File "C:\python-workspace\distutils\spawn.py", line 87, in _spawn_nt
    raise DistutilsExecError, \
distutils.errors.DistutilsExecError: command 'swig' failed with exit
status 1

Looking at my_typemaps.i line 298:

%fragment("SWIG_AsUnsignedLong","header", fragment="SWIG_AsLong") %{
SWIGSTATICINLINE(unsigned long)
SWIG_AsUnsignedLong(PyObject * obj)
{
  if (PyLong_Check(obj)) {
    return PyLong_AsUnsignedLong(obj);
  } else {
    long i = SWIG_AsLong(obj);
    if ( !PyErr_Occurred() && (i < 0)) {
      PyErr_SetString(PyExc_TypeError, "negative value received for
unsigned type");
    }
    return i;
  }
}
%}

I don't see any error. Of course, the error could have been introduced
earlier in the file.

Any idea what is going wrong?

Thanks,
Hatim

rama wrote:

Hi list!

I'm trying to implement treectrl navigation through joystick on my app.
At the moment it is catching the joystick actions and calling to
functions which are working nice, to expand or collapse items for
example or changing focus to different panels.

buy my question is: if there is any way to map buttons from the joystick
to work as if they were the keyboard arrows and the plus and minus keys
(+/-).

No, you'll probably have to do the work yourself. While technically you can synthesize and send other events, they are only sent to the wx portion of the controls, not to the native portion. (There is no way to convert from a wxEvent back to the native representation of the event.)

···

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

Hatim Khan wrote:

Hi all!

I managed to compile wxPython 2.5.1.5 on Windows XP with USE_SWIG=0. I
have problems with running activex samples, but I will leave this for
later.

I downloaded SWIG 1.3.20 and applied three patches:

[...]

Any idea what is going wrong?

Yep. I'm currently using SWIG from their CVS as of 20-Feb-2004. If you use CVS with a -D flag to get that version of the code, then apply my patches then you should be good to go.

···

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

Robin,

Thanks. I got SWIG from CVS as you suggested and I was able to compile
successfully.

However, I now have a problem with wx.CheckBox not showing in the demo.
In fact, I just wrote a simple C++ to test wxWidgets, and it does not
show it either. So this might be a question for the wxWidgets list. It
must be something I missed while compiling wxWidgets dll libraries.

Any thing that comes to your mind as a possible reason?

Thanks,
-H

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Monday, May 24, 2004 1:46 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] SWIG and wxPython 2.5.1.5

Hatim Khan wrote:

Hi all!

I managed to compile wxPython 2.5.1.5 on Windows XP with USE_SWIG=0. I

have problems with running activex samples, but I will leave this for
later.

I downloaded SWIG 1.3.20 and applied three patches:

[...]

Any idea what is going wrong?

Yep. I'm currently using SWIG from their CVS as of 20-Feb-2004. If you

use CVS with a -D flag to get that version of the code, then apply my
patches then you should be good to go.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Hatim Khan wrote:

Robin,

Thanks. I got SWIG from CVS as you suggested and I was able to compile
successfully.

However, I now have a problem with wx.CheckBox not showing in the demo.
In fact, I just wrote a simple C++ to test wxWidgets, and it does not
show it either. So this might be a question for the wxWidgets list. It
must be something I missed while compiling wxWidgets dll libraries.

Any thing that comes to your mind as a possible reason?

Are you using the 2.5.1.5 sources or are you using wxWidgets/wxPython from CVS? There was a similar problem with toggle buttons a couple weeks ago due to some changes in how the native widgets are created in wxMSW.

···

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

I am using the wxPythonWIN32-devel package link from wxpython.org which
should be the 2.5.1.5 source.

Thanks,
-H

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Tuesday, May 25, 2004 1:16 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] wx.CheckBox compiled from source code
wxPython 2.5.1.5

Hatim Khan wrote:

Robin,

Thanks. I got SWIG from CVS as you suggested and I was able to compile

successfully.

However, I now have a problem with wx.CheckBox not showing in the
demo. In fact, I just wrote a simple C++ to test wxWidgets, and it
does not show it either. So this might be a question for the wxWidgets

list. It must be something I missed while compiling wxWidgets dll
libraries.

Any thing that comes to your mind as a possible reason?

Are you using the 2.5.1.5 sources or are you using wxWidgets/wxPython
from CVS? There was a similar problem with toggle buttons a couple
weeks ago due to some changes in how the native widgets are created in
wxMSW.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Sorry, it is the wxPythonSrc link for 2.5.1.5 not the
wxPythonWIN32-devel

-H

···

-----Original Message-----
From: Hatim Khan [mailto:hkhan@mcfadyen.com]
Sent: Tuesday, May 25, 2004 1:42 PM
To: wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users] wx.CheckBox compiled from source code
wxPython 2.5.1.5

I am using the wxPythonWIN32-devel package link from wxpython.org which
should be the 2.5.1.5 source.

Thanks,
-H

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Tuesday, May 25, 2004 1:16 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] wx.CheckBox compiled from source code
wxPython 2.5.1.5

Hatim Khan wrote:

Robin,

Thanks. I got SWIG from CVS as you suggested and I was able to compile

successfully.

However, I now have a problem with wx.CheckBox not showing in the
demo. In fact, I just wrote a simple C++ to test wxWidgets, and it
does not show it either. So this might be a question for the wxWidgets

list. It must be something I missed while compiling wxWidgets dll
libraries.

Any thing that comes to your mind as a possible reason?

Are you using the 2.5.1.5 sources or are you using wxWidgets/wxPython
from CVS? There was a similar problem with toggle buttons a couple
weeks ago due to some changes in how the native widgets are created in
wxMSW.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Hatim Khan wrote:

Sorry, it is the wxPythonSrc link for 2.5.1.5 not the
wxPythonWIN32-devel

In that case I can't think of anything that would cause the checkboxes to not be shown. Sorry.

···

However, I now have a problem with wx.CheckBox not showing in the
demo. In fact, I just wrote a simple C++ to test wxWidgets, and it does not show it either. So this might be a question for the wxWidgets

list. It must be something I missed while compiling wxWidgets dll
libraries.

Any thing that comes to your mind as a possible reason?

Are you using the 2.5.1.5 sources or are you using wxWidgets/wxPython from CVS? There was a similar problem with toggle buttons a couple weeks ago due to some changes in how the native widgets are created in wxMSW.

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

Ok, after hours of VC++ 6.0 debugging. It turns out that I have to
explicitly call Show() on the checkbox.

I thought the parent window will call the Show() method on all its
children, correct?

Not sure what was going on. But as far as I can tell, the wxButton is
using the exstyle where WS_VISIBILE is set by default. The checkbox is
not yet upgraded to use the exstyle.

Regards,
-H

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Tuesday, May 25, 2004 2:30 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] wx.CheckBox compiled from source code
wxPython 2.5.1.5

Hatim Khan wrote:

Sorry, it is the wxPythonSrc link for 2.5.1.5 not the
wxPythonWIN32-devel

In that case I can't think of anything that would cause the checkboxes
to not be shown. Sorry.

However, I now have a problem with wx.CheckBox not showing in the
demo. In fact, I just wrote a simple C++ to test wxWidgets, and it
does not show it either. So this might be a question for the wxWidgets

list. It must be something I missed while compiling wxWidgets dll
libraries.

Any thing that comes to your mind as a possible reason?

Are you using the 2.5.1.5 sources or are you using wxWidgets/wxPython
from CVS? There was a similar problem with toggle buttons a couple
weeks ago due to some changes in how the native widgets are created in

wxMSW.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

oke, so I almost did it.

however shall this be considered a "feature request" ?

I mean the fact of having the possibility to map whatever method to call
for "action keys" as sometimes it might result a need.

maybe I'm not using the right words or my conceptual approach to it is
incorrect. apologies if so.

hasta la vista!
Ramiro

···

El lun, 24-05-2004 a las 14:46, Robin Dunn escribió:

rama wrote:
> Hi list!
>
> I'm trying to implement treectrl navigation through joystick on my app.
> At the moment it is catching the joystick actions and calling to
> functions which are working nice, to expand or collapse items for
> example or changing focus to different panels.
>
> buy my question is: if there is any way to map buttons from the joystick
> to work as if they were the keyboard arrows and the plus and minus keys
> (+/-).

No, you'll probably have to do the work yourself. While technically you
can synthesize and send other events, they are only sent to the wx
portion of the controls, not to the native portion. (There is no way to
  convert from a wxEvent back to the native representation of the event.)

--
rama <medialist@xicnet.com>

Hatim Khan wrote:

Ok, after hours of VC++ 6.0 debugging. It turns out that I have to
explicitly call Show() on the checkbox.

I thought the parent window will call the Show() method on all its
children, correct?

Not sure what was going on. But as far as I can tell, the wxButton is
using the exstyle where WS_VISIBILE is set by default. The checkbox is
not yet upgraded to use the exstyle.

Yes, there were a number of changes in this part of how the controls were constructed. I suppose it's possible that there was a slight mismatch between what got put into the soruce tarball and what I built the MSW binaries with. You could try getting a copy of src/msw/checkbox.cpp from CVS and merge the relevant changes into your copy. (Or just get a CVS version of everything.)

···

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

rama wrote:

···

El lun, 24-05-2004 a las 14:46, Robin Dunn escribió:

No, you'll probably have to do the work yourself. While technically you can synthesize and send other events, they are only sent to the wx portion of the controls, not to the native portion. (There is no way to convert from a wxEvent back to the native representation of the event.)

oke, so I almost did it.

however shall this be considered a "feature request" ?

It probably isn't possible with the current event system, and may not be possible at all on some platforms.

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