Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A patch for Code::Blocks to make cut copy paste shortcuts work for wxSmith
Index: src/plugins/contrib/wxSmith/wxwidgets/wxsitemeditor.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxsitemeditor.cpp (revision 10323)
+++ src/plugins/contrib/wxSmith/wxwidgets/wxsitemeditor.cpp (working copy)
@@ -72,6 +72,9 @@
InitializeResourceData();
InitializeVisualStuff();
m_AllEditors.insert(this);
+ Connect(wxID_COPY, (wxObjectEventFunction)&wxsItemEditor::Copy);
+ Connect(wxID_PASTE, (wxObjectEventFunction)&wxsItemEditor::Paste);
+ Connect(wxID_CUT, (wxObjectEventFunction)&wxsItemEditor::Cut);
}
wxsItemEditor::~wxsItemEditor()
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 10323)
+++ src/src/main.cpp (working copy)
@@ -174,9 +174,12 @@
int idEditUndo = XRCID("idEditUndo");
int idEditRedo = XRCID("idEditRedo");
int idEditClearHistory = XRCID("idEditClearHistory");
-int idEditCopy = XRCID("idEditCopy");
-int idEditCut = XRCID("idEditCut");
-int idEditPaste = XRCID("idEditPaste");
+//int idEditCopy = XRCID("idEditCopy");
+//int idEditCut = XRCID("idEditCut");
+//int idEditPaste = XRCID("idEditPaste");
+int idEditCopy = XRCID("wxID_COPY");
+int idEditCut = XRCID("wxID_CUT");
+int idEditPaste = XRCID("wxID_PASTE");
int idEditSwapHeaderSource = XRCID("idEditSwapHeaderSource");
int idEditGotoMatchingBrace = XRCID("idEditGotoMatchingBrace");
int idEditHighlightMode = XRCID("idEditHighlightMode");
Index: src/src/resources/main_menu.xrc
===================================================================
--- src/src/resources/main_menu.xrc (revision 10323)
+++ src/src/resources/main_menu.xrc (working copy)
@@ -171,17 +171,17 @@
<bitmap>images\16x16\history_clear.png</bitmap>
</object>
<object class="separator"/>
- <object class="wxMenuItem" name="idEditCut">
+ <object class="wxMenuItem" name="wxID_CUT">
<label>Cu&amp;t</label>
<bitmap>images\16x16\editcut.png</bitmap>
<help>Copy selected text to clipboard and erase it</help>
</object>
- <object class="wxMenuItem" name="idEditCopy">
+ <object class="wxMenuItem" name="wxID_COPY">
<label>&amp;Copy</label>
<bitmap>images\16x16\editcopy.png</bitmap>
<help>Copy selected text to clipboard</help>
</object>
- <object class="wxMenuItem" name="idEditPaste">
+ <object class="wxMenuItem" name="wxID_PASTE">
<label>&amp;Paste</label>
<bitmap>images\16x16\editpaste.png</bitmap>
<help>Paste text from clipboard</help>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.