From: The D. <the...@bl...> - 2005-06-26 15:38:26
|
Hello, I've decided to try to use wx.wxEVT_LEFT_DCLICK and such to make specific mouse events for fast access to several things via a small number of controls, so that this access depends on motor memory as well as visual memory, this being very fast and easy to use. I've managed to make a single button (or even a static text label) be a control for this, so it's very versatile, but there is a major drawback: the window (control) must be assigned to a variable, and that means the event handlers proliferate in horrible tiers of duplication. With spin controls, it doesn't matter how many there are, or how many parent controls they're placed on, they're all captured by wx.wxEVT_COMMAND_SPINCTRL_UPDATED, but obviously I can't assign all my custom clickable controls to 'CC' to capture with CC:ConnectEvent(-1,wx.wxEVT_LEFT_DCLICK,DoStuff). Is there a way to group these assigned controls so a single event handler passes the flow to a single function which filters the controls by ID as usual? I've thought of making tables indexed by ID so that for loops can reduce the sixe of the source code, but this doesn't really solve the problem. |