Hi Vidyashankar,
Thank you for this! It looks to fix the issue that was posted on the wiki.
However, I am '-1' on applying it. I wish I had looked at this P3
before, because I don't agree with the wiki that this is or was a problem.
What I see happen with a Windows build with current code before your
patch (win XP, CVS HEAD) is that the wxTreeCtrl is absorbing the
event. However, IF I first use tab to tab between the controls so
that focus is on the panel rather than on the wxTreeCtrl, THEN
<enter> does behave exactly as I would expect and if focus is on the
OK button, <enter> does close the dialog.
A normal wxTreeCtrl is supposed to absorb <enter> events and use
them to open and close subtrees. It happens that at the moment we
have only one level in our tree so there is no subtree to open or
close. I can imagine in the future we will need to have sub trees.
For example under tracks we might have "labels, spectrograms,
envelopes, waves", and under bindings we might have "keyboard,
mouse". When we do that we will want <enter> to open and close the
subtree and this patch would prevent that. If we get more elaborate
and pass <enter> to the panel only when there is no subtree to open
or close I think we're behaving in a rather too non standard way, so
I don't feel it is a good idea to do that.
Vidyashankar - I looked at your code, and in coding terms it looks
fine. The problem is really ours, that there are different opinions on
what needs fixing now and how. Your code looks fine. It's following
guidelines about formatting etc and it is clear what its intention is.
I did wonder about the magic constant 801 - if we'd decided to go with
this patch or a modified version that would need at the least a comment.
> This is my first patch
Congratulations on getting this far. If it weren't for the issue above
it would have been an excellent choice of first bug. If you're
interested in tackling one of the other issues on the release checklist,
please say which one. We can then make sure the problem is better
understood and that there is general agreement about what needs to
happen, and hopefully avoid effort going into code that is then not used.
--James.
Vidyashankar Vellal wrote:
> Hi
>
> The patch has been attached. The patch was made against the CVS HEAD
> (1.3.10). The details are as follows:
>
> Problem:
> When a tab of the wxTreebook is selected, OK button does not respond
> to Enter. This is because key events (wxKeyEvent) are not propogated
> along the parent chain. Hence, when the wxTreeCtrl (present in
> wxTreebook) captures the event, nothing happens.
>
> Solution:
> 1) I have created an event handler and pushed it to the tree control
> present in mCategories (which is the wxTreebook). This event handler
> captures the press of enter button. It then creates an instance of a
> custom event (see point 2) and processes it. This custom event
> (unlike wxKeyEvent) can propogate up the parent chain and is
> eventually handled by PrefsDialog. When it is handled by PrefsDialog
> it calls the same function as when OK button is pressed (i.e.
> PrefsDialog::OnOK)
> 2) The custom event is derived from wxCommandEvent (which helps it to
> propogate up the parent chain). The event declarations and macro
> definitions are present in the code along with comments.
>
> I have tested the patch on both Linux and Windows and it is working as
> expected. I dont have a Mac, so havent tested on that. I expect it to
> work on Mac too since there is no platform dependent code change.
>
> This is my first patch. In case I did anything wrong, please tell me
> so that I can correct my mistakes next time.
> I have added comments wherever appropriate. In case you feel it was
> too much/too less, please do tell me.
>
> Thanks
> Vidyashankar
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.
http://p.sf.net/sfu/bobj-july> ------------------------------------------------------------------------
>
> _______________________________________________
> audacity-devel mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/audacity-devel>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel