From: The D. <the...@bl...> - 2005-08-02 11:36:56
|
John Labenski <jla...@gm...> wrote: (01/08/2005 04:55) >I guess I don't have the same problem, I took your sample code and >added buttons to them as a further test. (note that the wxID_OK/CANCEL >will automatically close the dialog and returns that window id from >ShowModal) I find that when I press the toolbar tool the dialog pops >up, the dialog has the focus (the titlebar is colored) and if I press >enter (don't even click on the dialog) the dialog closes since it has >focus and the enter key goes to the button which has the focus. > >BANK=wx.wxDialog(PANEL,-1,"",wx.wxPoint(-1,-1),wx.wxSize(426,266)) >CNFG=wx.wxDialog(PANEL,-1,"",wx.wxPoint(-1,-1),wx.wxSize(426,266)) >do > wx.wxButton(BANK, wx.wxID_OK, "Ok") > wx.wxButton(CNFG, wx.wxID_OK, "Ok") >end > >I'm using XP, what are you using? > That was interesting. The second dialog still showed the failure to respond to the first click, but the use of Enter, as that button has focus, works as it should, as you said. :) I don't know the reason for this, but it definitely seems related to the OS. I'm using 98-Lite, by Shane Brooks. Meaning it's a W95 shell on a W98 SE core. Some things hate that and won't run at all, especially if they have special dependencies on the W98 shell files. If I can find an old Ghost image of either W95 or W98 SE in pure state, I'll test again. For now, I'm happy with doing BANK:Show(1) FRAME:Enable(nil) on calling the dialog, and FRAME:Enable(1) BANK:Show(nil) FRAME:SetFocus(1) on closing it. (I just hide it, in fact.) So long as I get the frame re-enabled before hiding the dialog, there is a clean transfer of focus back to the frame. Btw, why did you use do and end? I realised when I saw it, that it could be a neat way to declare local variables in the do ... end without leaving them around as they would be if declared outside that, but in this case I can't see what the do ... end would add here. >I think the perfect solution is to create a Wiki on the web page. I >think SF provides the means and that way it'll be very easy for you >and others to contibute and update/polish/add code or whatever since >it'll be user editable and you'll have full control. For example see >here, >http://wiki.wxwidgets.org/wiki.pl?Table_Of_Contents > >I don't know how to set it up, but I know someone who does so I'll >have ask about it. > Agreed. :) I like that far better. I do make mistakes, like the order of that FRAME:Enable(1) BANK:Show(nil) FRAME:SetFocus(1) sequence, and going back to fis stuff like that will be useful. /me hopes that someone might also know how to make a MIDI I/O library for wxLua. :) I'll finish the Thinger and release it during the next few days, as I'll be listening to a test match for much of that time and will have time to do it. Is there a way to make uploaded binaries available to people who didn't get the original email? Meaning: does the mailing list archive attachments? That Thinger has a few bitmaps, one of which is too big to make into XML text conveniently. |