News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Shift-Tab got broken :(

Started by rickg22, May 29, 2005, 12:08:51 AM

Previous topic - Next topic

rickg22

What happened? Yesterday it worked just fine for unindenting blocks.

mandrav

I mentioned it in another thread. It 's intercepted by the notebook now. We 'll have to come up with a solution...

Yiannis.
Be patient!
This bug will be fixed soon...

rickg22

So basically it's just a matter of the wxStyledTextControl getting the keyboard event because the notebook gets it first?

rickg22

I found some info about it!
http://lists.wxwidgets.org/archive/wx-dev/msg30909.html

QuoteBugs item #690274, was opened at 2003-02-20 12:53
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=109863&aid=690274&group_id=9863

Category: Generic
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Shift-TAB events can't be seen by controls

Initial Comment:
Controls on a window having the
wxTAB_TRAVERSAL style
that wanting to process Shift-TAB events can't do
so; they don't even get a KeyDown for the tab part
of the Shift-tab (though they do see the "shift".  
This is not consistent with the event handling
model that says that events start at the control
level and then work their way up the chain.  

Robin Dunn wrote in response to this problem:
 "The only way to get around it I know of is to not
  have a parent (or other ancestor) window with the
  wxTAB_TRAVERSAL style set,  but then you'd have
  to handle all of the tab traversal yourself.

  You may want to bring this up on wx-dev and/or
  enter a bug report about it, but I doubt that
  anything will be done in the short term (before
  2.5) because it would take major surgery to make
  any changes there."

So anyway, here's the bug report.
/Will Sadkin
Parlance Corporation
----
And then at SF:

QuoteDate: 2003-11-04 09:46
Sender: robind
Logged In: YES
user_id=53955

Probably related to this: If a window has wxWANTS_CHARS
style, it still can not receive KEY or CHAR events for
Shift-Tab.  For example, wxStyledTextCtrl uses wxWANTS_CHARS
but if it is in a container window and other controls are
present Shift-Tab always goes back to the other controls.
====================

So I think that a possible workaround is make cbEditor (which is a subclass of wxPanel) process the events, and if it gets a shift-tab, send it to the control... IF AND ONLY IF the control has wxWANTS_CHARS style.

rickg22

FIXED IT! :D

This was a hard one! :? . Using the control's ProcessEvent wouldn't work since the wxwidgets "shift-tab eating bug" occurs at this function. So I had to dig into the STC source code (Thank GOD for Open Source!) and found what I was looking for: wxStyledTextCtrl's SendMsg function (2328 is backtab).

The rest was just a matter of adding Shift-Tab to the accelerator keys (main.cpp). Ta-da!