Patch #1497 2006-09-17 23:10

jthedering

Added special Scintilla commands to the edit menu
Download
1497-Added_special.patch (14.4 KB)
Category
Application::FeatureAdd
Status
Accepted
Close date
2006-09-23 11:52
Assigned to
 
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp    (Revision 2976)
+++ src/src/main.cpp    (Arbeitskopie)
@@ -173,6 +173,30 @@
 int idEditEncodingUnicode16LE = XRCID("idEditEncodingUnicode16LE");
 int idEditEncodingUnicode32BE = XRCID("idEditEncodingUnicode32BE");
 int idEditEncodingUnicode32LE = XRCID("idEditEncodingUnicode32LE");
+int idEditSpecialCommands = XRCID("idEditSpecialCommands");
+int idEditSpecialCommandsMovement = XRCID("idEditSpecialCommandsMovement");
+int idEditParaUp = XRCID("idEditParaUp");
+int idEditParaUpExtend = XRCID("idEditParaUpExtend");
+int idEditParaDown = XRCID("idEditParaDown");
+int idEditParaDownExtend = XRCID("idEditParaDownExtend");
+int idEditWordPartLeft = XRCID("idEditWordPartLeft");
+int idEditWordPartLeftExtend = XRCID("idEditWordPartLeftExtend");
+int idEditWordPartRight = XRCID("idEditWordPartRight");
+int idEditWordPartRightExtend = XRCID("idEditWordPartRightExtend");
+int idEditSpecialCommandsZoom = XRCID("idEditSpecialCommandsZoom");
+int idEditZoomIn = XRCID("idEditZoomIn");
+int idEditZoomOut = XRCID("idEditZoomOut");
+int idEditZoomReset = XRCID("idEditZoomReset");
+int idEditSpecialCommandsLine = XRCID("idEditSpecialCommandsLine");
+int idEditLineCut = XRCID("idEditLineCut");
+int idEditLineDelete = XRCID("idEditLineDelete");
+int idEditLineDuplicate = XRCID("idEditLineDuplicate");
+int idEditLineTranspose = XRCID("idEditLineTranspose");
+int idEditLineCopy = XRCID("idEditLineCopy");
+int idEditLinePaste = XRCID("idEditLinePaste");
+int idEditSpecialCommandsCase = XRCID("idEditSpecialCommandsCase");
+int idEditUpperCase = XRCID("idEditUpperCase");
+int idEditLowerCase = XRCID("idEditLowerCase");
 int idEditSelectAll = XRCID("idEditSelectAll");
 int idEditCommentSelected = XRCID("idEditCommentSelected");
 int idEditUncommentSelected = XRCID("idEditUncommentSelected");
@@ -351,6 +375,25 @@
     EVT_MENU(idEditEncodingUnicode16LE,  MainFrame::OnEditEncoding)
     EVT_MENU(idEditEncodingUnicode32BE,  MainFrame::OnEditEncoding)
     EVT_MENU(idEditEncodingUnicode32LE,  MainFrame::OnEditEncoding)
+    EVT_MENU(idEditParaUp,  MainFrame::OnEditParaUp)
+    EVT_MENU(idEditParaUpExtend,  MainFrame::OnEditParaUpExtend)
+    EVT_MENU(idEditParaDown,  MainFrame::OnEditParaDown)
+    EVT_MENU(idEditParaDownExtend,  MainFrame::OnEditParaDownExtend)
+    EVT_MENU(idEditWordPartLeft,  MainFrame::OnEditWordPartLeft)
+    EVT_MENU(idEditWordPartLeftExtend,  MainFrame::OnEditWordPartLeftExtend)
+    EVT_MENU(idEditWordPartRight,  MainFrame::OnEditWordPartRight)
+    EVT_MENU(idEditWordPartRightExtend,  MainFrame::OnEditWordPartRightExtend)
+    EVT_MENU(idEditZoomIn,  MainFrame::OnEditZoomIn)
+    EVT_MENU(idEditZoomOut,  MainFrame::OnEditZoomOut)
+    EVT_MENU(idEditZoomReset,  MainFrame::OnEditZoomReset)
+    EVT_MENU(idEditLineCut,  MainFrame::OnEditLineCut)
+    EVT_MENU(idEditLineDelete,  MainFrame::OnEditLineDelete)
+    EVT_MENU(idEditLineDuplicate,  MainFrame::OnEditLineDuplicate)
+    EVT_MENU(idEditLineTranspose,  MainFrame::OnEditLineTranspose)
+    EVT_MENU(idEditLineCopy,  MainFrame::OnEditLineCopy)
+    EVT_MENU(idEditLinePaste,  MainFrame::OnEditLinePaste)
+    EVT_MENU(idEditUpperCase,  MainFrame::OnEditUpperCase)
+    EVT_MENU(idEditLowerCase,  MainFrame::OnEditLowerCase)
     EVT_MENU(idEditSelectAll,  MainFrame::OnEditSelectAll)
     EVT_MENU(idEditBookmarksToggle,  MainFrame::OnEditBookmarksToggle)
     EVT_MENU(idEditBookmarksNext,  MainFrame::OnEditBookmarksNext)
@@ -2302,6 +2345,168 @@
         ed->Paste();
 }
 
+void MainFrame::OnEditParaUp(wxCommandEvent& event)
+{
+    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
+    if (ed)
+    {
+        ed->GetControl()->ParaUp();
+    }
+}
+
+void MainFrame::OnEditParaUpExtend(wxCommandEvent& event)
+{
+    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
+    if (ed)
+    {
+        ed->GetControl()->ParaUpExtend();
+    }
+}
+
+void MainFrame::OnEditParaDown(wxCommandEvent& event)
+{
+    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
+    if (ed)
+    {
+        ed->GetControl()->ParaDown();
+    }
+}
+
+void MainFrame::OnEditParaDownExtend(wxCommandEvent& event)
+{
+    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
+    if (ed)
+    {
+        ed->GetControl()->ParaDownExtend();
+    }
+}
+
+void MainFrame::OnEditWordPartLeft(wxCommandEvent& event)
+{
+    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
+    if (ed)
+    {
+        ed->GetControl()->WordPartLeft();
+    }
+}
+
+void MainFrame::OnEditWordPartLeftExtend(wxCommandEvent& event)
+{
+    cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
+    if (ed)
+    {
+        ed->GetControl()->WordPartLeftExtend();
+    }
+}
+
+void MainFrame::OnEditWordPartRight(wxCommandEvent& event)
+{
+    cbEditor* ed = Manager::Get()
download for full patch...
jthedering 2006-09-17 23:21

In the wiki, section Keyboard Shortcuts, someone wrote "This is a list of shortcuts provided by the Code::Blocks' editor component. These shortcuts cannot be rebound."

I didn't like this as some of the shortcuts are unusable on non-english keyboards (e.g. the previous/next paragraph command) if they aren't rebindable, so adding them to the menu allows the user to use the keybinder for that, which will even overwrite Scintilla-predefined keys.

A second reason is that I think few people know about those special commands like "line cut/copy", although one can edit faster using them. If they are in the menu, people will at least be able to notice that they exist.