summaryrefslogtreecommitdiff
path: root/src/fltk-labels.ads
blob: 5e13a2e1373416720f5d4ee6fea2231505c65db5 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155


--  Programmed by Jedidiah Barber
--  Released into the public domain


with

    FLTK.Images;

private with

    Interfaces.C.Strings;


package FLTK.Labels is


    type Label is new Wrapper with private;

    type Label_Reference (Data : not null access Label'Class) is limited null record
        with Implicit_Dereference => Data;




    package Forge is

        function Create
               (Value    : in     String;
                Font     : in     Font_Kind               := Helvetica;
                Size     : in     Font_Size               := Normal_Size;
                Hue      : in     Color                   := Foreground_Color;
                Kind     : in     Label_Kind              := Normal_Label;
                Place    : in     Alignment               := Align_Center;
                Active   : access FLTK.Images.Image'Class := null;
                Inactive : access FLTK.Images.Image'Class := null)
            return Label;

    end Forge;




    function Get_Value
           (This : in Label)
        return String;

    procedure Set_Value
           (This : in out Label;
            Text : in     String);

    function Get_Font
           (This : in Label)
        return Font_Kind;

    procedure Set_Font
           (This : in out Label;
            Font : in     Font_Kind);

    function Get_Size
           (This : in Label)
        return Font_Size;

    procedure Set_Size
           (This : in out Label;
            Size : in     Font_Size);

    function Get_Color
           (This : in Label)
        return Color;

    procedure Set_Color
           (This : in out Label;
            Hue  : in     Color);

    function Get_Kind
           (This : in Label)
        return Label_Kind;

    procedure Set_Kind
           (This : in out Label;
            Kind : in     Label_Kind);

    function Get_Alignment
           (This : in Label)
        return Alignment;

    procedure Set_Alignment
           (This  : in out Label;
            Place : in     Alignment);

    function Get_Active
           (This : in Label)
        return access FLTK.Images.Image'Class;

    procedure Set_Active
           (This : in out Label;
            Pic  : access FLTK.Images.Image'Class);

    function Get_Inactive
           (This : in Label)
        return access FLTK.Images.Image'Class;

    procedure Set_Inactive
           (This : in out Label;
            Pic  : access FLTK.Images.Image'Class);




    procedure Draw
           (This       : in out Label;
            X, Y, W, H : in     Integer;
            Place      : in     Alignment);

    procedure Measure
           (This : in     Label;
            W, H :    out Integer);


private


    type Label is new Wrapper with record
        My_Active   : access FLTK.Images.Image'Class;
        My_Inactive : access FLTK.Images.Image'Class;
        My_Text     : Interfaces.C.Strings.chars_ptr;
    end record;

    overriding procedure Finalize
           (This : in out Label);


    pragma Inline (Get_Value);
    pragma Inline (Get_Font);
    pragma Inline (Set_Font);
    pragma Inline (Get_Size);
    pragma Inline (Set_Size);
    pragma Inline (Get_Color);
    pragma Inline (Set_Color);
    pragma Inline (Get_Kind);
    pragma Inline (Set_Kind);
    pragma Inline (Get_Alignment);
    pragma Inline (Set_Alignment);
    pragma Inline (Get_Active);
    pragma Inline (Get_Inactive);

    pragma Inline (Draw);
    pragma Inline (Measure);


end FLTK.Labels;