Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Release 13.12, RC1-RC2 has arrived

<< < (9/12) > >>

MortenMacFly:

--- Quote from: stanley82521 on December 22, 2013, 04:54:49 pm ---Hi, the problem stated here hasn't been solved yet:
http://forums.codeblocks.org/index.php/topic,18015.msg123151.html

--- End quote ---
...fixed in SVN head. Thanks for the report!

dmoore:
It would probably be a good idea to apply this, but I don't have a windows box to test it on ATM.


--- Code: ---Index: src/src/resources/main_menu.xrc
===================================================================
--- src/src/resources/main_menu.xrc (revision 9395)
+++ src/src/resources/main_menu.xrc (working copy)
@@ -174,19 +174,16 @@
       <object class="wxMenuItem" name="idEditCut">
         <label>Cu&amp;t</label>
         <bitmap>images\16x16\editcut.png</bitmap>
-        <accel>Ctrl-X</accel>
         <help>Copy selected text to clipboard and erase it</help>
       </object>
       <object class="wxMenuItem" name="idEditCopy">
         <label>&amp;Copy</label>
         <bitmap>images\16x16\editcopy.png</bitmap>
-        <accel>Ctrl-C</accel>
         <help>Copy selected text to clipboard</help>
       </object>
       <object class="wxMenuItem" name="idEditPaste">
         <label>&amp;Paste</label>
         <bitmap>images\16x16\editpaste.png</bitmap>
-        <accel>Ctrl-V</accel>
         <help>Paste text from clipboard</help>
       </object>
       <object class="separator"/>
@@ -457,7 +454,6 @@
       <object class="separator"/>
       <object class="wxMenuItem" name="idEditSelectAll">
         <label>Select &amp;all</label>
-        <accel>Ctrl-A</accel>
         <help>Selects the entire text range</help>
       </object>
       <object class="wxMenuItem" name="idEditSelectNext">

--- End code ---

It appears that setting those cut/copy/paste accelerators on Linux prevents use of Ctrl+C/V/X in non-editor widgets of the main C::B window. EDIT: Ctrl+A for Select All is also a problem. (Note for this to have a noticeable effect you might need to remove the keybindings for edit->copy/paste/cut/select all)

ollydbg:
I just test it under windows, I remove the <accel>Ctrl-X</accel> from main_menu.xrc, and the result C::B is: If the cbEditor is still the focus window, then Ctrl+X still cut some text in the editor.

BTW: I'm not fully understand how the key-strike to event handler works. ???

dmoore:

--- Quote from: ollydbg on December 24, 2013, 05:44:02 am ---I just test it under windows, I remove the <accel>Ctrl-X</accel> from main_menu.xrc, and the result C::B is: If the cbEditor is still the focus window, then Ctrl+X still cut some text in the editor.

--- End quote ---

(Did you make sure to run update.bat and clear out anything in related to those shortcuts in the keybinder plugin?)

The behavior you see is as it should be. You should also be able to use Ctrl-C/X/V/A in other text entry widgets (e.g. in the symbol browser search box). If I recall correctly, you could always do this on windows because I think it was just a linux issue but I could be wrong.


--- Quote ---BTW: I'm not fully understand how the key-strike to event handler works. ???

--- End quote ---

To be honest, I don't completely either. All I know is that setting accelerators for actions that have system/toolkit default handlers creates problems on Linux, because the accelerators override the system defaults no matter what widget has the focus.

ollydbg:

--- Quote from: dmoore on December 24, 2013, 05:50:42 am ---
--- Quote from: ollydbg on December 24, 2013, 05:44:02 am ---I just test it under windows, I remove the <accel>Ctrl-X</accel> from main_menu.xrc, and the result C::B is: If the cbEditor is still the focus window, then Ctrl+X still cut some text in the editor.

--- End quote ---

(Did you make sure to run update.bat and clear out anything in related to those shortcuts in the keybinder plugin?)

--- End quote ---
I just build Codeblocks.cbp, and no other contributed plugins were build, so no keybinder.
I have run update.bat before, I don't think it is necessary here, because in the build log:

--- Code: ----------------- Build: src in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler)---------------

Target is up to date.
[ 25.0%] Running target post-build steps
[ 50.0%] cmd /c if not exist devel\share\CodeBlocks mkdir devel\share\CodeBlocks
[ 75.0%] zip -jq9 devel\share\CodeBlocks\resources.zip src\resources\*.xrc
[100.0%] zip -jq9 devel\share\CodeBlocks\start_here.zip src\resources\start_here\*.html src\resources\start_here\*.png
cmd /c "cd src\resources & zip -0 -q ..\..\devel\share\CodeBlocks\resources.zip images\*.png images\16x16\*.png"

--- End code ---

So, the xrc files was compressed to devel folders. Then I just start C::B by click the "run" or "start debug" toolbar button, this is the C::B in devel folder.

Also, there is no accelerator key shown in the menu item.


--- Quote ---The behavior you see is as it should be. You should also be able to use Ctrl-C/X/V/A in other text entry widgets (e.g. in the symbol browser search box). If I recall correctly, you could always do this on windows because I think it was just a linux issue but I could be wrong.

--- End quote ---
I don't tried Ctrl-C/V/A, I think they are the same as Ctrl-X.


--- Quote ---
--- Quote ---BTW: I'm not fully understand how the key-strike to event handler works. ???

--- End quote ---
To be honest, I don't completely either. All I know is that setting accelerators for actions that have system/toolkit default handlers creates problems on Linux, because the accelerators override the system defaults no matter what widget has the focus.

--- End quote ---

When you have CTRL+X in xrc file, then the cut event goes through:

--- Code: ---void MainFrame::OnEditCut(cb_unused wxCommandEvent& event)
{
    EditorBase* ed = Manager::Get()->GetEditorManager()->GetActiveEditor();
    if (ed)
        ed->Cut();
}

--- End code ---
But if it was not in xrc, it goes through wxScintilla::OnKeyDown () : (see the bt)

--- Code: ---[debug]#0  Editor::Cut (this=0x5216b50) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:4253
[debug]#1  0x0117c66f in Editor::WndProc (this=0x5216b50, iMessage=2177, wParam=0, lParam=0) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:7409
[debug]#2  0x01187a90 in ScintillaBase::WndProc (this=0x5216b50, iMessage=2177, wParam=0, lParam=0) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\ScintillaBase.cxx:1024
[debug]#3  0x010dd194 in ScintillaWX::WndProc (this=0x5216b50, iMessage=2177, wParam=0, lParam=0) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\ScintillaWX.cpp:898
[debug]#4  0x01174b24 in Editor::KeyDownWithModifiers (this=0x5216b50, key=88, modifiers=2, consumed=0x8c4f598) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:5741
[debug]#5  0x01174bd6 in Editor::KeyDown (this=0x5216b50, key=88, shift=false, ctrl=true, alt=false, consumed=0x8c4f598) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:5752
[debug]#6  0x010de06f in ScintillaWX::DoKeyDown (this=0x5216b50, evt=..., consumed=0x8c4f598) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\ScintillaWX.cpp:1237
[debug]#7  0x010d88aa in wxScintilla::OnKeyDown (this=0x8c4f428, evt=...) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\wxscintilla.cpp:5365
[debug]#8  0x627015f1 in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#9  0x6276a07e in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#10 0x6276a14a in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#11 0x6276a545 in wxEvtHandler::ProcessEvent(wxEvent&) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#12 0x627a3c2c in wxWindow::HandleKeyDown(unsigned int, long) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#13 0x627a5bc3 in wxWindow::MSWWindowProc(unsigned int, unsigned int, long) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#14 0x627a0cee in wxWndProc(HWND__*, unsigned int, unsigned int, long)@16 () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#15 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#16 0x0011068e in ?? ()
[debug]#17 0x7e418816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#18 0x627a0ca0 in wxWindow::AssociateHandle(void*) () from E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#19 0x7e4189cd in USER32!GetWindowLongW () from C:\WINDOWS\system32\user32.dll
[debug]#20 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:

--- End code ---

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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version