Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Release 13.12, RC1-RC2 has arrived
dmoore:
--- Quote from: ollydbg on December 24, 2013, 06:02:39 am ---My guess:
I'm not sure under Windows, if a key press is an accelerated key set in the mainframe, then the key press event was translated to some menu item click event.
--- End quote ---
Ok, that sounds the same as under Linux. But IMO, this behavior stinks because it means you can't use those accelerators for anything but the active editor in C::B.
ollydbg:
--- Quote from: dmoore on December 24, 2013, 06:47:50 am ---
--- Quote from: ollydbg on December 24, 2013, 06:02:39 am ---My guess:
I'm not sure under Windows, if a key press is an accelerated key set in the mainframe, then the key press event was translated to some menu item click event.
--- End quote ---
Ok, that sounds the same as under Linux. But IMO, this behavior stinks because it means you can't use those accelerators for anything but the active editor in C::B.
--- End quote ---
Yes, see: Re: wxAcceleratorTable - what I am doing wrong? EDIT: also http://wiki.wxwidgets.org/Catching_key_events_globally#Accelerator_table
We can:
disable the "global" accelerated key table
Or
enable the accelerated key table (and its menu item) only when editor is active
Or
Change the way we did in:
--- Code: ---void MainFrame::OnEditCut(cb_unused wxCommandEvent& event)
{
EditorBase* ed = Manager::Get()->GetEditorManager()->GetActiveEditor();
if (ed)
ed->Cut();
}
--- End code ---
ollydbg:
--- Quote from: Alpha on December 14, 2013, 11:01:41 pm ---Unfortunately, it looks like the duplicating enum problem has reappeared at some point. Each time I refresh the CC listing, all enums, except the last one, are duplicated.
(Sorry, I am quite busy right now, and will be unable to look into it for some time.)
(Code::Blocks rev. 9487)
--- End quote ---
I can reproduce the bug by a very simple code:
A project only have one cpp file. the cpp file contains below contents.
--- Code: ---class Y
{
enum ABC
{
ebABC1,
ebABC2,
ebABC3,
ebABC4,
ebABC5,
ebABC6
};
};
--- End code ---
Now, delete "C" in "ebABC3", then enter "C" again, see the screen shot:
Look, only the enumerator before the caret get duplicated.
Reason: I guess the duplicated enumerator are produced by CC try to parse a local block of the code, in this case, from the class definition start to the caret, which is:
--- Code: ---class Y
{
enum ABC
{
ebABC1,
ebABC2,
ebABC
--- End code ---
So, you see, the "ebABC1" and "ebABC2" were found as some kind of enumerators which are marked as temporary. (just like the function local variables), I don't know how to fix this bug, maybe, we can still simply remove the tokens which has the same name and same Tokenkind?
I'm not sure why in your case, you have many duplications, not twice, but several times.
ollydbg:
--- Quote from: dmoore on December 24, 2013, 06:47:50 am ---
--- Quote from: ollydbg on December 24, 2013, 06:02:39 am ---My guess:
I'm not sure under Windows, if a key press is an accelerated key set in the mainframe, then the key press event was translated to some menu item click event.
--- End quote ---
Ok, that sounds the same as under Linux. But IMO, this behavior stinks because it means you can't use those accelerators for anything but the active editor in C::B.
--- End quote ---
Some information: #11320 (Accelerators take precedence over wxTextCtrl shortcuts) – wxWidgets, it looks like OBF has already reported this bug?
dmoore:
--- Quote from: ollydbg on December 25, 2013, 04:14:19 am ---Some information: #11320 (Accelerators take precedence over wxTextCtrl shortcuts) – wxWidgets, it looks like OBF has already reported this bug?
--- End quote ---
So forget about my patch for release given where we are at now. But I still want to apply either my patch or something better in trunk. Clearly the wxWidgets crew aren't going to fix this without a patch that works for Mac/Linux/Windows, which could be a very long time in coming, so I think we need to workaround their bug. The question is whether there is a better approach than just removing the accelerators? (Maybe some people like that Ctrl-C/V/X/A always apply to the active editor? But they can always use the keybinder to get that behavior back) Some time back, I had played around the idea suggested in the wxWidgets trac ticket of finding the focused widget and vetoing the accelerator if it's a text-like control that has the focus, but I never did figure out how to do that correctly.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version