I have scrolledpanel and I have spinctrl and choice widgets in it.When I click on a choice widget, I can’t scroll the panel with the mouse wheel anymore. Mouse wheel begins to change the choice selection. Same thing happens when I use SP_ARROW_KEYS style in a spinctrl
How can I use the scroll functionality of mouse wheel in the scrolled panel If I click the mouse to another place in the panel window:
I think what's happening is that once you click on the choice, it now has
the focus and can be driven conveniently with the mousehweel. So you would
have to bind the scrolledpanel wx.EVT_LEFT_DOWN event and then call
SetFocus() on the scrolledpanel to bring the focus back there after
clicking in it elsewhere. In fact, I think you can even just bind
wx.EVT_ENTER_WINDOW in the scrolledpanel and so the user doesn't have to
click, but merely moving the cursor back into the scrolledpanel restores
the focus to it.
···
On Mon, Jan 20, 2014 at 5:32 PM, <ercanal@gmail.com> wrote:
Hi,
I have scrolledpanel and I have spinctrl and choice widgets in it.When I
click on a choice widget, I can't scroll the panel with the mouse wheel
anymore. Mouse wheel begins to change the choice selection. Same thing
happens when I use SP_ARROW_KEYS style in a spinctrl
How can I use the scroll functionality of mouse wheel in the scrolled
panel If I click the mouse to another place in the panel window:
I used EVT_ENTER_WINDOW to change focus but giving focus back to scrolledpanel does not work because it passes the focus back to its child which we want to kill focus ( Thanks to Robin Dunn for a previous reply in this mailling list). So I gave focus to staticBox so scroll functionality works as expected.
I have scrolledpanel and I have spinctrl and choice widgets in it.When I click on a choice widget, I can’t scroll the panel with the mouse wheel anymore. Mouse wheel begins to change the choice selection. Same thing happens when I use SP_ARROW_KEYS style in a spinctrl
How can I use the scroll functionality of mouse wheel in the scrolled panel If I click the mouse to another place in the panel window:
I think what’s happening is that once you click on the choice, it now has the focus and can be driven conveniently with the mousehweel. So you would have to bind the scrolledpanel wx.EVT_LEFT_DOWN event and then call SetFocus() on the scrolledpanel to bring the focus back there after clicking in it elsewhere. In fact, I think you can even just bind wx.EVT_ENTER_WINDOW in the scrolledpanel and so the user doesn’t have to click, but merely moving the cursor back into the scrolledpanel restores the focus to it.