The methods event.GetX() and event.GetY() are returning correct values
for a mouse event position on a wxListCtrl event (the upper left
corner of the menu appears on the mouse position), but not for a mouse
event position on wxListBox event (the upper left corner of the menu
appears about 60 pixels higher than the mouse position, and slightly
shifted to the left of the pointer).
The fragment of code I'm using to catch the event and pop up the menu
on both cases (k meaning a wxListCtrl or a wxListBox) is listed below,
and I'm using RolColSizer to place both on wxNotebook pages.
Am I missing something or is that the expected behaviour?
The methods event.GetX() and event.GetY() are returning correct values
for a mouse event position on a wxListCtrl event (the upper left
corner of the menu appears on the mouse position), but not for a mouse
event position on wxListBox event (the upper left corner of the menu
appears about 60 pixels higher than the mouse position, and slightly
shifted to the left of the pointer).
The fragment of code I'm using to catch the event and pop up the menu
on both cases (k meaning a wxListCtrl or a wxListBox) is listed below,
and I'm using RolColSizer to place both on wxNotebook pages.
Am I missing something or is that the expected behaviour?
Platform and version?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
In Thursday, December 18, 2003, 5:44:39 PM, Robin wrote:
E. A. Tacao wrote:
Hello,
The methods event.GetX() and event.GetY() are returning correct values
for a mouse event position on a wxListCtrl event (the upper left
corner of the menu appears on the mouse position), but not for a mouse
event position on wxListBox event (the upper left corner of the menu
appears about 60 pixels higher than the mouse position, and slightly
shifted to the left of the pointer).
The fragment of code I'm using to catch the event and pop up the menu
on both cases (k meaning a wxListCtrl or a wxListBox) is listed below,
and I'm using RolColSizer to place both on wxNotebook pages.
Am I missing something or is that the expected behaviour?
In Thursday, December 18, 2003, 5:44:39 PM, Robin wrote:
> E. A. Tacao wrote:
Hello,
The methods event.GetX() and event.GetY() are returning correct values
for a mouse event position on a wxListCtrl event (the upper left
corner of the menu appears on the mouse position), but not for a mouse
event position on wxListBox event (the upper left corner of the menu
appears about 60 pixels higher than the mouse position, and slightly
shifted to the left of the pointer).
The fragment of code I'm using to catch the event and pop up the menu
on both cases (k meaning a wxListCtrl or a wxListBox) is listed below,
and I'm using RolColSizer to place both on wxNotebook pages.
Am I missing something or is that the expected behaviour?
> Platform and version?
Win XP, Python 2.2.2, wxPython 2.4.1.2.
Does it still behave that way with 2.4.2.4? Can you create a small sample that shows the problem for me to try it out with?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
In Saturday, December 20, 2003, 4:01:29 PM, Robin wrote:
E. A. Tacão wrote:
In Thursday, December 18, 2003, 5:44:39 PM, Robin wrote:
> E. A. Tacao wrote:
Hello,
The methods event.GetX() and event.GetY() are returning correct values
for a mouse event position on a wxListCtrl event (the upper left
corner of the menu appears on the mouse position), but not for a mouse
event position on wxListBox event (the upper left corner of the menu
appears about 60 pixels higher than the mouse position, and slightly
shifted to the left of the pointer).
The fragment of code I'm using to catch the event and pop up the menu
on both cases (k meaning a wxListCtrl or a wxListBox) is listed below,
and I'm using RolColSizer to place both on wxNotebook pages.
Am I missing something or is that the expected behaviour?
> Platform and version?
Win XP, Python 2.2.2, wxPython 2.4.1.2.
Does it still behave that way with 2.4.2.4?
Yes.
Can you create a small sample that shows the problem for me to try
it out with?
Yes, please see the attached file. It's made mainly from code of the
demo files and it reproduces the problem here. For the wxListBox it
seems that the GetX call is not taking into account the width of the
inner border of the page, neither the height of the upper widget (a
wxStaticText).
In Saturday, December 20, 2003, 4:01:29 PM, Robin wrote:
> E. A. Tacão wrote:
In Thursday, December 18, 2003, 5:44:39 PM, Robin wrote:
E. A. Tacao wrote:
Hello,
The methods event.GetX() and event.GetY() are returning correct values
for a mouse event position on a wxListCtrl event (the upper left
corner of the menu appears on the mouse position), but not for a mouse
event position on wxListBox event (the upper left corner of the menu
appears about 60 pixels higher than the mouse position, and slightly
shifted to the left of the pointer).
The fragment of code I'm using to catch the event and pop up the menu
on both cases (k meaning a wxListCtrl or a wxListBox) is listed below,
and I'm using RolColSizer to place both on wxNotebook pages.
Am I missing something or is that the expected behaviour?
Platform and version?
Win XP, Python 2.2.2, wxPython 2.4.1.2.
> Does it still behave that way with 2.4.2.4?
Yes.
> Can you create a small sample that shows the problem for me to try
> it out with?
Yes, please see the attached file. It's made mainly from code of the
demo files and it reproduces the problem here. For the wxListBox it
seems that the GetX call is not taking into account the width of the
inner border of the page, neither the height of the upper widget (a
wxStaticText).
Actually, I think it is a bug that it is not also behaving like this with the wxListCtrl, because you make the same mistake with both of them. You age getting the mouse (x,y) relative to the the listbox or the listctrl, but using the (x,y) relative to the panel.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!