summaryrefslogtreecommitdiff
path: root/src/windows-editor.ads
blob: a9d0041cfcdd5d3d1f810357cb55316d11a80731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125


with

    FLTK.Widgets.Menus,
    FLTK.Text_Buffers,
    FLTK.Widgets.Groups.Text_Displays;

private with

    FLTK.Widgets.Groups.Text_Displays.Text_Editors,
    FLTK.Widgets.Menus.Menu_Bars,
    FLTK.Widgets.Menus.Menu_Buttons;


package Windows.Editor is


    type Editor_Window is new Window with private;


    type Wrap_Mode is new FLTK.Widgets.Groups.Text_Displays.Wrap_Mode;


    Min_Editor_Height : Integer := 60;
    Min_Editor_Width  : Integer := 300;


    function Create
           (X, Y, W, H : in Integer;
            Label_Text : in String)
        return Editor_Window;


    function Create
           (W, H : in Integer)
        return Editor_Window;


    function Get_Buffer
           (This : in Editor_Window)
        return FLTK.Text_Buffers.Text_Buffer_Reference;


    procedure Set_Buffer
           (This : in out Editor_Window;
            Buff : in out FLTK.Text_Buffers.Text_Buffer);


    function Get_Menu_Bar
           (This : in out Editor_Window)
        return FLTK.Widgets.Menus.Menu_Reference;


    function Get_Rightclick_Menu
           (This : in out Editor_Window)
        return FLTK.Widgets.Menus.Menu_Reference;


    procedure Undo
           (This : in out Editor_Window);


    procedure Cut
           (This : in out Editor_Window);


    procedure Copy
           (This : in out Editor_Window);


    procedure Paste
           (This : in out Editor_Window);


    procedure Delete
           (This : in out Editor_Window);


    function Get_Insert_Position
           (This : in Editor_Window)
        return Natural;


    procedure Set_Insert_Position
           (This : in out Editor_Window;
            Pos  : in     Natural);


    procedure Show_Insert_Position
           (This : in out Editor_Window);


    procedure Next_Word
           (This : in out Editor_Window);


    procedure Previous_Word
           (This : in out Editor_Window);


    procedure Set_Wrap_Mode
           (This   : in out Editor_Window;
            Mode   : in     Wrap_Mode;
            Margin : in     Natural := 0);


    procedure Set_Linenumber_Width
           (This  : in out Editor_Window;
            Width : in     Natural);


private


    type Editor_Window is new Window with
        record
            Bar    : aliased FLTK.Widgets.Menus.Menu_Bars.Menu_Bar;
            Popup  : aliased FLTK.Widgets.Menus.Menu_Buttons.Menu_Button;
            Editor : FLTK.Widgets.Groups.Text_Displays.Text_Editors.Text_Editor;
        end record;


end Windows.Editor;