diff options
author | Jed Barber <jjbarber@y7mail.com> | 2016-09-16 04:10:49 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2016-09-16 04:10:49 +1000 |
commit | 395e2de5b0d834091637820fc04d731721c771b7 (patch) | |
tree | 64492fca38997578914ac24cd262598af966c241 /src/editors.adb | |
parent | bfcc3811a3ce55cafa6f7809d0d92c87238ea032 (diff) |
Adapad menus and callbacks now present in skeleton form, also Text_Buffers have callbacks too
Diffstat (limited to 'src/editors.adb')
-rw-r--r-- | src/editors.adb | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/src/editors.adb b/src/editors.adb index 9400016..42b89ed 100644 --- a/src/editors.adb +++ b/src/editors.adb @@ -1,5 +1,9 @@ +with FLTK.Enums; +use FLTK.Enums; + + package body Editors is @@ -7,13 +11,20 @@ package body Editors is (X, Y, W, H : in Integer; Label_Text : in String) return Editor_Window is + + Width, Height : Integer; + begin + if W < 300 then Width := 300; else Width := W; end if; + if H < 60 then Height := 60; else Height := H; end if; + return This : Editor_Window := - (Double_Window'(Create (X, Y, W, H, Label_Text)) with - Editor => Text_Editor'(Create (0, 30, 640, 370, "")), - Bar => Menu_Bar'(Create (0, 0, 640, 30, ""))) do + (Double_Window'(Create (X, Y, Width, Height, Label_Text)) with + Editor => Text_Editor'(Create (0, 30, Width, Height - 30, "")), + Bar => Menu_Bar'(Create (0, 0, Width, 30, ""))) do This.Add (This.Editor); This.Add (This.Bar); + This.Editor.Set_Text_Font (Courier); end return; end Create; @@ -58,5 +69,41 @@ package body Editors is end Get_Menu; + + + procedure Cut + (This : in out Editor_Window) is + begin + This.Editor.Cut; + end Cut; + + + + + procedure Copy + (This : in out Editor_Window) is + begin + This.Editor.Copy; + end Copy; + + + + + procedure Paste + (This : in out Editor_Window) is + begin + This.Editor.Paste; + end Paste; + + + + + procedure Delete + (This : in out Editor_Window) is + begin + This.Editor.Delete; + end Delete; + + end Editors; |