If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Hello everyone,
I have a wxScrolledWindow populated with wxStaticBitmaps and the selected bitmap is painted with a blue edge. The user can select a bitmap by clicking on it and I want to achieve that pressing the delete key deletes the bitmap. Now, in the bitmaps ctor i use
ScrollerBitmap::onKeyUp is hit when the user hits the delete key, but I want it to only fire once. The problem is: wxEVT_KEY_UP does not work, nothing happens.
What could be wrong?
thanx!
as i understand it the mouse down event also fires as long as the key is pressed? i guess that would be trouble since i want to delete the item that triggers the deletion?
i do not understand why it should be better to bind inside the mouse click handler?
Those 2 events are independent - you can click the mouse, press the key or do both at the same time.
But it shouldn't matter anyway - you don't need the "Del" key binding without the selection, right? So do just that in your program. And then when you delete what you don't want - unbind the event. Accidents can happen and it is better not to allow user to make the mistake than catch it.