From 50ebd224ee7dbed4494d43fd63cdc794380a9a36 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sat, 10 Jun 2017 22:53:19 +1000 Subject: The rest of the static keybinding procedures added to Text_Editor package --- src/c_fl_text_editor.cpp | 135 ++++++- src/c_fl_text_editor.h | 40 ++- ...k-widgets-groups-text_displays-text_editors.adb | 388 +++++++++++++++++++-- ...k-widgets-groups-text_displays-text_editors.ads | 148 +++++++- 4 files changed, 664 insertions(+), 47 deletions(-) diff --git a/src/c_fl_text_editor.cpp b/src/c_fl_text_editor.cpp index 282da77..b023981 100644 --- a/src/c_fl_text_editor.cpp +++ b/src/c_fl_text_editor.cpp @@ -70,6 +70,13 @@ void free_fl_text_editor(TEXTEDITOR te) { +void fl_text_editor_default(TEXTEDITOR te, int k) { + Fl_Text_Editor::kf_default(k, reinterpret_cast(te)); +} + + + + void fl_text_editor_undo(TEXTEDITOR te) { Fl_Text_Editor::kf_undo(0, reinterpret_cast(te)); } @@ -90,6 +97,10 @@ void fl_text_editor_delete(TEXTEDITOR te) { Fl_Text_Editor::kf_delete(0, reinterpret_cast(te)); } +void fl_text_editor_select_all(TEXTEDITOR te) { + Fl_Text_Editor::kf_select_all(0, reinterpret_cast(te)); +} + @@ -97,6 +108,21 @@ void fl_text_editor_backspace(TEXTEDITOR te) { Fl_Text_Editor::kf_backspace(0, reinterpret_cast(te)); } +void fl_text_editor_insert(TEXTEDITOR te) { + Fl_Text_Editor::kf_insert(0, reinterpret_cast(te)); +} + +void fl_text_editor_enter(TEXTEDITOR te) { + Fl_Text_Editor::kf_enter(0, reinterpret_cast(te)); +} + +void fl_text_editor_ignore(TEXTEDITOR te) { + Fl_Text_Editor::kf_ignore(0, reinterpret_cast(te)); +} + + + + void fl_text_editor_home(TEXTEDITOR te) { Fl_Text_Editor::kf_home(0, reinterpret_cast(te)); } @@ -105,10 +131,6 @@ void fl_text_editor_end(TEXTEDITOR te) { Fl_Text_Editor::kf_end(0, reinterpret_cast(te)); } -void fl_text_editor_insert(TEXTEDITOR te) { - Fl_Text_Editor::kf_insert(0, reinterpret_cast(te)); -} - void fl_text_editor_page_down(TEXTEDITOR te) { Fl_Text_Editor::kf_page_down(0, reinterpret_cast(te)); } @@ -136,6 +158,111 @@ void fl_text_editor_up(TEXTEDITOR te) { +void fl_text_editor_shift_home(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_Home, reinterpret_cast(te)); +} + +void fl_text_editor_shift_end(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_End, reinterpret_cast(te)); +} + +void fl_text_editor_shift_page_down(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_Page_Down, reinterpret_cast(te)); +} + +void fl_text_editor_shift_page_up(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_Page_Up, reinterpret_cast(te)); +} + +void fl_text_editor_shift_down(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_Down, reinterpret_cast(te)); +} + +void fl_text_editor_shift_left(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_Left, reinterpret_cast(te)); +} + +void fl_text_editor_shift_right(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_Right, reinterpret_cast(te)); +} + +void fl_text_editor_shift_up(TEXTEDITOR te) { + Fl_Text_Editor::kf_shift_move(FL_Up, reinterpret_cast(te)); +} + + + + +void fl_text_editor_ctrl_home(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_Home, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_end(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_End, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_page_down(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_Page_Down, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_page_up(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_Page_Up, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_down(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_Down, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_left(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_Left, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_right(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_Right, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_up(TEXTEDITOR te) { + Fl_Text_Editor::kf_ctrl_move(FL_Up, reinterpret_cast(te)); +} + + + + +void fl_text_editor_ctrl_shift_home(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_Home, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_shift_end(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_End, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_shift_page_down(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_Page_Down, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_shift_page_up(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_Page_Up, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_shift_down(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_Down, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_shift_left(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_Left, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_shift_right(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_Right, reinterpret_cast(te)); +} + +void fl_text_editor_ctrl_shift_up(TEXTEDITOR te) { + Fl_Text_Editor::kf_c_s_move(FL_Up, reinterpret_cast(te)); +} + + + + void fl_text_editor_remove_key_binding(TEXTEDITOR te, unsigned int k, unsigned long m) { reinterpret_cast(te)->remove_key_binding(k, m); } diff --git a/src/c_fl_text_editor.h b/src/c_fl_text_editor.h index dce890e..e827428 100644 --- a/src/c_fl_text_editor.h +++ b/src/c_fl_text_editor.h @@ -23,17 +23,25 @@ extern "C" void free_fl_text_editor(TEXTEDITOR te); +extern "C" void fl_text_editor_default(TEXTEDITOR te, int k); + + extern "C" void fl_text_editor_undo(TEXTEDITOR te); extern "C" void fl_text_editor_cut(TEXTEDITOR te); extern "C" void fl_text_editor_copy(TEXTEDITOR te); extern "C" void fl_text_editor_paste(TEXTEDITOR te); extern "C" void fl_text_editor_delete(TEXTEDITOR te); +extern "C" void fl_text_editor_select_all(TEXTEDITOR te); extern "C" void fl_text_editor_backspace(TEXTEDITOR te); +extern "C" void fl_text_editor_insert(TEXTEDITOR te); +extern "C" void fl_text_editor_enter(TEXTEDITOR te); +extern "C" void fl_text_editor_ignore(TEXTEDITOR te); + + extern "C" void fl_text_editor_home(TEXTEDITOR te); extern "C" void fl_text_editor_end(TEXTEDITOR te); -extern "C" void fl_text_editor_insert(TEXTEDITOR te); extern "C" void fl_text_editor_page_down(TEXTEDITOR te); extern "C" void fl_text_editor_page_up(TEXTEDITOR te); extern "C" void fl_text_editor_down(TEXTEDITOR te); @@ -42,6 +50,36 @@ extern "C" void fl_text_editor_right(TEXTEDITOR te); extern "C" void fl_text_editor_up(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_home(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_end(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_page_down(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_page_up(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_down(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_left(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_right(TEXTEDITOR te); +extern "C" void fl_text_editor_shift_up(TEXTEDITOR te); + + +extern "C" void fl_text_editor_ctrl_home(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_end(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_page_down(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_page_up(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_down(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_left(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_right(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_up(TEXTEDITOR te); + + +extern "C" void fl_text_editor_ctrl_shift_home(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_shift_end(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_shift_page_down(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_shift_page_up(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_shift_down(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_shift_left(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_shift_right(TEXTEDITOR te); +extern "C" void fl_text_editor_ctrl_shift_up(TEXTEDITOR te); + + extern "C" void fl_text_editor_remove_key_binding(TEXTEDITOR te, unsigned int k, unsigned long m); diff --git a/src/fltk-widgets-groups-text_displays-text_editors.adb b/src/fltk-widgets-groups-text_displays-text_editors.adb index dc47d72..73744ca 100644 --- a/src/fltk-widgets-groups-text_displays-text_editors.adb +++ b/src/fltk-widgets-groups-text_displays-text_editors.adb @@ -32,6 +32,14 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is + procedure fl_text_editor_default + (TE : in System.Address; + K : in Interfaces.C.int); + pragma Import (C, fl_text_editor_default, "fl_text_editor_default"); + + + + procedure fl_text_editor_undo (TE : in System.Address); pragma Import (C, fl_text_editor_undo, "fl_text_editor_undo"); @@ -52,12 +60,32 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is (TE : in System.Address); pragma Import (C, fl_text_editor_delete, "fl_text_editor_delete"); + procedure fl_text_editor_select_all + (TE : in System.Address); + pragma Import (C, fl_text_editor_select_all, "fl_text_editor_select_all"); + + procedure fl_text_editor_backspace (TE : in System.Address); pragma Import (C, fl_text_editor_backspace, "fl_text_editor_backspace"); + procedure fl_text_editor_insert + (TE : in System.Address); + pragma Import (C, fl_text_editor_insert, "fl_text_editor_insert"); + + procedure fl_text_editor_enter + (TE : in System.Address); + pragma Import (C, fl_text_editor_enter, "fl_text_editor_enter"); + + procedure fl_text_editor_ignore + (TE : in System.Address); + pragma Import (C, fl_text_editor_ignore, "fl_text_editor_ignore"); + + + + procedure fl_text_editor_home (TE : in System.Address); pragma Import (C, fl_text_editor_home, "fl_text_editor_home"); @@ -66,10 +94,6 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is (TE : in System.Address); pragma Import (C, fl_text_editor_end, "fl_text_editor_end"); - procedure fl_text_editor_insert - (TE : in System.Address); - pragma Import (C, fl_text_editor_insert, "fl_text_editor_insert"); - procedure fl_text_editor_page_down (TE : in System.Address); pragma Import (C, fl_text_editor_page_down, "fl_text_editor_page_down"); @@ -97,6 +121,111 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is + procedure fl_text_editor_shift_home + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_home, "fl_text_editor_shift_home"); + + procedure fl_text_editor_shift_end + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_end, "fl_text_editor_shift_end"); + + procedure fl_text_editor_shift_page_down + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_page_down, "fl_text_editor_shift_page_down"); + + procedure fl_text_editor_shift_page_up + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_page_up, "fl_text_editor_shift_page_up"); + + procedure fl_text_editor_shift_down + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_down, "fl_text_editor_shift_down"); + + procedure fl_text_editor_shift_left + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_left, "fl_text_editor_shift_left"); + + procedure fl_text_editor_shift_right + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_right, "fl_text_editor_shift_right"); + + procedure fl_text_editor_shift_up + (TE : in System.Address); + pragma Import (C, fl_text_editor_shift_up, "fl_text_editor_shift_up"); + + + + + procedure fl_text_editor_ctrl_home + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_home, "fl_text_editor_ctrl_home"); + + procedure fl_text_editor_ctrl_end + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_end, "fl_text_editor_ctrl_end"); + + procedure fl_text_editor_ctrl_page_down + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_page_down, "fl_text_editor_ctrl_page_down"); + + procedure fl_text_editor_ctrl_page_up + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_page_up, "fl_text_editor_ctrl_page_up"); + + procedure fl_text_editor_ctrl_down + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_down, "fl_text_editor_ctrl_down"); + + procedure fl_text_editor_ctrl_left + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_left, "fl_text_editor_ctrl_left"); + + procedure fl_text_editor_ctrl_right + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_right, "fl_text_editor_ctrl_right"); + + procedure fl_text_editor_ctrl_up + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_up, "fl_text_editor_ctrl_up"); + + + + + procedure fl_text_editor_ctrl_shift_home + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_home, "fl_text_editor_ctrl_shift_home"); + + procedure fl_text_editor_ctrl_shift_end + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_end, "fl_text_editor_ctrl_shift_end"); + + procedure fl_text_editor_ctrl_shift_page_down + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_page_down, "fl_text_editor_ctrl_shift_page_down"); + + procedure fl_text_editor_ctrl_shift_page_up + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_page_up, "fl_text_editor_ctrl_shift_page_up"); + + procedure fl_text_editor_ctrl_shift_down + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_down, "fl_text_editor_ctrl_shift_down"); + + procedure fl_text_editor_ctrl_shift_left + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_left, "fl_text_editor_ctrl_shift_left"); + + procedure fl_text_editor_ctrl_shift_right + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_right, "fl_text_editor_ctrl_shift_right"); + + procedure fl_text_editor_ctrl_shift_up + (TE : in System.Address); + pragma Import (C, fl_text_editor_ctrl_shift_up, "fl_text_editor_ctrl_shift_up"); + + + + procedure fl_text_editor_remove_key_binding (TE : in System.Address; K : in Interfaces.C.unsigned; @@ -185,108 +314,143 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is + procedure Default + (This : in out Text_Editor'Class; + Key : in Shortcut_Key) is + begin + fl_text_editor_default + (This.Void_Ptr, + Character'Pos (Key.Keypress)); + end Default; + + + + procedure Undo - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_undo (This.Void_Ptr); end Undo; procedure Cut - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_cut (This.Void_Ptr); end Cut; procedure Copy - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_copy (This.Void_Ptr); end Copy; procedure Paste - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_paste (This.Void_Ptr); end Paste; procedure Delete - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_delete (This.Void_Ptr); end Delete; + procedure Select_All + (This : in out Text_Editor'Class) is + begin + fl_text_editor_select_all (This.Void_Ptr); + end Select_All; + + procedure Backspace_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_backspace (This.Void_Ptr); end Backspace_Key; + procedure Insert_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_insert (This.Void_Ptr); + end Insert_Key; + + + procedure Enter_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_enter (This.Void_Ptr); + end Enter_Key; + + + procedure Ignore_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ignore (This.Void_Ptr); + end Ignore_Key; + + + + procedure Home_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_home (This.Void_Ptr); end Home_Key; procedure End_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_end (This.Void_Ptr); end End_Key; - procedure Insert_Key - (This : in out Text_Editor) is - begin - fl_text_editor_insert (This.Void_Ptr); - end Insert_Key; - - procedure Page_Down_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_page_down (This.Void_Ptr); end Page_Down_Key; procedure Page_Up_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_page_up (This.Void_Ptr); end Page_Up_Key; procedure Down_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_down (This.Void_Ptr); end Down_Key; procedure Left_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_left (This.Void_Ptr); end Left_Key; procedure Right_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_right (This.Void_Ptr); end Right_Key; procedure Up_Key - (This : in out Text_Editor) is + (This : in out Text_Editor'Class) is begin fl_text_editor_up (This.Void_Ptr); end Up_Key; @@ -294,6 +458,180 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is + procedure Shift_Home_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_home (This.Void_Ptr); + end Shift_Home_Key; + + + procedure Shift_End_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_end (This.Void_Ptr); + end Shift_End_Key; + + + procedure Shift_Page_Down_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_page_down (This.Void_Ptr); + end Shift_Page_Down_Key; + + + procedure Shift_Page_Up_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_page_up (This.Void_Ptr); + end Shift_Page_Up_Key; + + + procedure Shift_Down_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_down (This.Void_Ptr); + end Shift_Down_Key; + + + procedure Shift_Left_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_left (This.Void_Ptr); + end Shift_Left_Key; + + + procedure Shift_Right_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_right (This.Void_Ptr); + end Shift_Right_Key; + + + procedure Shift_Up_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_shift_up (This.Void_Ptr); + end Shift_Up_Key; + + + + + procedure Ctrl_Home_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_home (This.Void_Ptr); + end Ctrl_Home_Key; + + + procedure Ctrl_End_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_end (This.Void_Ptr); + end Ctrl_End_Key; + + + procedure Ctrl_Page_Down_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_page_down (This.Void_Ptr); + end Ctrl_Page_Down_Key; + + + procedure Ctrl_Page_Up_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_page_up (This.Void_Ptr); + end Ctrl_Page_Up_Key; + + + procedure Ctrl_Down_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_down (This.Void_Ptr); + end Ctrl_Down_Key; + + + procedure Ctrl_Left_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_left (This.Void_Ptr); + end Ctrl_Left_Key; + + + procedure Ctrl_Right_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_right (This.Void_Ptr); + end Ctrl_Right_Key; + + + procedure Ctrl_Up_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_up (This.Void_Ptr); + end Ctrl_Up_Key; + + + + + procedure Ctrl_Shift_Home_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_home (This.Void_Ptr); + end Ctrl_Shift_Home_Key; + + + procedure Ctrl_Shift_End_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_end (This.Void_Ptr); + end Ctrl_Shift_End_Key; + + + procedure Ctrl_Shift_Page_Down_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_page_down (This.Void_Ptr); + end Ctrl_Shift_Page_Down_Key; + + + procedure Ctrl_Shift_Page_Up_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_page_up (This.Void_Ptr); + end Ctrl_Shift_Page_Up_Key; + + + procedure Ctrl_Shift_Down_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_down (This.Void_Ptr); + end Ctrl_Shift_Down_Key; + + + procedure Ctrl_Shift_Left_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_left (This.Void_Ptr); + end Ctrl_Shift_Left_Key; + + + procedure Ctrl_Shift_Right_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_right (This.Void_Ptr); + end Ctrl_Shift_Right_Key; + + + procedure Ctrl_Shift_Up_Key + (This : in out Text_Editor'Class) is + begin + fl_text_editor_ctrl_shift_up (This.Void_Ptr); + end Ctrl_Shift_Up_Key; + + + + procedure Remove_Key_Binding (This : in out Text_Editor; Key : in Shortcut_Key) diff --git a/src/fltk-widgets-groups-text_displays-text_editors.ads b/src/fltk-widgets-groups-text_displays-text_editors.ads index 8eafe25..1e9aeb6 100644 --- a/src/fltk-widgets-groups-text_displays-text_editors.ads +++ b/src/fltk-widgets-groups-text_displays-text_editors.ads @@ -8,6 +8,20 @@ package FLTK.Widgets.Groups.Text_Displays.Text_Editors is type Insert_Mode is (Before, After); -- type Tab_Navigation is (Insert_Char, Widget_Focus); + type Key_Func is access procedure + (This : in out Text_Editor'Class); + + type Default_Key_Func is access procedure + (This : in out Text_Editor'Class; + Key : in Shortcut_Key); + + type Key_Binding is record + Key : Shortcut_Key; + Func : Key_Func; + end record; + + type Key_Binding_List is array (Positive) of Key_Binding; + @@ -19,53 +33,153 @@ package FLTK.Widgets.Groups.Text_Displays.Text_Editors is + procedure Default + (This : in out Text_Editor'Class; + Key : in Shortcut_Key); + + + + procedure Undo - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Cut - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Copy - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Paste - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Delete - (This : in out Text_Editor); + (This : in out Text_Editor'Class); + + procedure Select_All + (This : in out Text_Editor'Class); procedure Backspace_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); + + procedure Insert_Key + (This : in out Text_Editor'Class); + + procedure Enter_Key + (This : in out Text_Editor'Class); + + procedure Ignore_Key + (This : in out Text_Editor'Class); + + + procedure Home_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure End_Key - (This : in out Text_Editor); - - procedure Insert_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Page_Down_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Page_Up_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Down_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Left_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Right_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); procedure Up_Key - (This : in out Text_Editor); + (This : in out Text_Editor'Class); + + + + + procedure Shift_Home_Key + (This : in out Text_Editor'Class); + + procedure Shift_End_Key + (This : in out Text_Editor'Class); + + procedure Shift_Page_Down_Key + (This : in out Text_Editor'Class); + + procedure Shift_Page_Up_Key + (This : in out Text_Editor'Class); + + procedure Shift_Down_Key + (This : in out Text_Editor'Class); + + procedure Shift_Left_Key + (This : in out Text_Editor'Class); + + procedure Shift_Right_Key + (This : in out Text_Editor'Class); + + procedure Shift_Up_Key + (This : in out Text_Editor'Class); + + + + + procedure Ctrl_Home_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_End_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Page_Down_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Page_Up_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Down_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Left_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Right_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Up_Key + (This : in out Text_Editor'Class); + + + + + procedure Ctrl_Shift_Home_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Shift_End_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Shift_Page_Down_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Shift_Page_Up_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Shift_Down_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Shift_Left_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Shift_Right_Key + (This : in out Text_Editor'Class); + + procedure Ctrl_Shift_Up_Key + (This : in out Text_Editor'Class); -- cgit