Bug #46210 Query Browser doesn't recognize usual key binding (Ctrl+F4) to close tab windows
Submitted: 15 Jul 2009 17:03 Modified: 6 Feb 2013 20:19
Reporter: Justin Grant Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:QB 1.2.17, WB 5.2.10 OS:Windows
Assigned to: CPU Architecture:Any
Tags: Contribution, key bindings, MDI

[15 Jul 2009 17:03] Justin Grant
Description:
Windows has a standard set of key bindings for MDI apps (MDI = Multiple Document Interface = apps like MySQL Query Browser or Firefox that open multiple documents in tabs or panes) 

Ctrl+F4 is the key binding in Windows that's used to close a document in a multi-document application, but the Query Browser only responds to Ctrl+W.

How to repeat:
Open MySQL Query Browser and connect to a database
Create a new tab
Press Ctrl+F4 

Expected:
Tab closes

Actual:
Nothing happens

Try the same thing in Firefox and the tab will close as expected.

Suggested fix:
A one-line change to line #671 in \query-browser\source\windows\Main.pas

Existing Code:
              if (Key = Ord('W')) then
              begin
                // Close tab
                MainTabHeaderFrame.DeleteTab(MainTabHeaderFrame.SelectedTab);
                Key := 0;
              end;

Suggestion:
              if (Key = Ord('W')) or (Key = VK_F4) then
              begin
                // Close tab
                MainTabHeaderFrame.DeleteTab(MainTabHeaderFrame.SelectedTab);
                Key := 0;
              end;
[15 Jul 2009 17:12] Valeriy Kravchuk
Thank you for the problem report.
[2 Sep 2009 19:13] Liz Drachnik
Hello Justin

In order for us to continue the process of reviewing your contribution to MySQL - We need
you to review and sign the Sun|MySQL contributor agreement (the "SCA")

The process is explained here: 
http://forge.mysql.com/wiki/Sun_Contributor_Agreement

Getting a signed/approved SCA on file will help us facilitate your contribution-- this
one, and others in the future.

Thank you !
[2 Oct 2009 23:01] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[3 Dec 2009 10:30] Valeriy Kravchuk
SQL Editor tabs in recent WB 5.2.10, for example, are still affected by the same problem.
[18 Jan 2010 16:21] Sebastien Caisse
Same with 5.2.11
[11 Aug 2010 15:47] Orlando Colamatteo
I agree. On Windows Ctrl+F4 should close a tab. Ctrl+W is an OK alternate, but not standard for Windows platforms.
[6 Feb 2013 20:19] Alfredo Kojima
Closing old bug, this was fixed in 5.2.46