File: gtk-expander.ads

package info (click to toggle)
libgtkada2 2.8.1-6lenny3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,496 kB
  • ctags: 3,886
  • sloc: ada: 103,189; ansic: 45,411; perl: 5,500; sh: 2,812; makefile: 1,169; xml: 19
file content (205 lines) | stat: -rw-r--r-- 8,579 bytes parent folder | download | duplicates (2)
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
-----------------------------------------------------------------------
--              GtkAda - Ada95 binding for Gtk+/Gnome                --
--                                                                   --
--                Copyright (C) 2006 AdaCore                         --
--                                                                   --
-- This library is free software; you can redistribute it and/or     --
-- modify it under the terms of the GNU General Public               --
-- License as published by the Free Software Foundation; either      --
-- version 2 of the License, or (at your option) any later version.  --
--                                                                   --
-- This library is distributed in the hope that it will be useful,   --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
-- General Public License for more details.                          --
--                                                                   --
-- You should have received a copy of the GNU General Public         --
-- License along with this library; if not, write to the             --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
-- Boston, MA 02111-1307, USA.                                       --
--                                                                   --
-----------------------------------------------------------------------

--  <description>
--  A container which can hide its child.
--  </description>
--  <c_version>2.8.17</c_version>
--  <group>Layout containers</group>
--  <screenshot>gtk-expander</screenshot>

with Glib.Properties;
with Gtk.Bin;
with Gtk.Widget;

package Gtk.Expander is

   type Gtk_Expander_Record is new Gtk.Bin.Gtk_Bin_Record with null record;
   type Gtk_Expander is access all Gtk_Expander_Record'Class;

   procedure Gtk_New (Expander : out Gtk_Expander; Label : String);
   procedure Initialize
     (Expander : access Gtk_Expander_Record'Class; Label  : String);
   --  Creates or initializes a new expander, using Label as the text of the
   --  label.

   procedure Gtk_New_With_Mnemonic
     (Expander : out Gtk_Expander; Label : String);
   procedure Initialize_With_Mnemonic
     (Expander : access Gtk_Expander_Record'Class; Label  : String);
   --  Creates or initializes a new expander, using Label as the text of the
   --  label.
   --  If characters in Label are preceded by an underscore, they are
   --  underlined. If you need a literal underscore character in a label, use
   --  '__' (two underscores). The first underlined character represents a
   --  keyboard accelerator called a mnemonic.
   --  Pressing Alt and that key activates the button.

   function Get_Type return Glib.GType;
   --  Returns the internal value used for an expander

   procedure Set_Expanded
     (Expander : access Gtk_Expander_Record; Expanded : Boolean);
   function Get_Expanded
     (Expander : access Gtk_Expander_Record) return Boolean;
   --  Sets the state of the expander. Set to True, if you want
   --  the child widget to be revealed, and False if you want the
   --  child widget to be hidden.

   procedure Set_Label
     (Expander : access Gtk_Expander_Record; Label : String);
   function Get_Label
     (Expander : access Gtk_Expander_Record) return String;
   --  Sets the text of the label of the expander to Label.

   procedure Set_Label_Widget
     (Expander     : access Gtk_Expander_Record;
      Label_Widget : access Gtk.Widget.Gtk_Widget_Record'Class);
   function Get_Label_Widget
     (Expander : access Gtk_Expander_Record) return Gtk.Widget.Gtk_Widget;
   --  Set the label widget for the expander. This is the widget
   --  that will appear embedded alongside the expander arrow.

   procedure Set_Spacing
     (Expander : access Gtk_Expander_Record; Spacing  : Gint);
   function Get_Spacing
     (Expander : access Gtk_Expander_Record) return Gint;
   --  Sets the spacing field of Expander, which is the number of pixels to
   --  place between expander and the child.

   procedure Set_Use_Markup
     (Expander : access Gtk_Expander_Record; Use_Markup : Boolean);
   function Get_Use_Markup
     (Expander : access Gtk_Expander_Record) return Boolean;
   --  Sets whether the text of the label contains markup in Pango's text
   --  markup language. See Gtk.Label.Set_Markup.

   procedure Set_Use_Underline
     (Expander : access Gtk_Expander_Record; Use_Underline : Boolean);
   function Get_Use_Underline
     (Expander : access Gtk_Expander_Record) return Boolean;
   --  If true, an underline in the text of the expander label indicates
   --  the next character should be used for the mnemonic accelerator key.

   ----------------
   -- Properties --
   ----------------
   --  The following properties are defined for this widget. See
   --  Glib.Properties for more information on properties.

   --  <properties>
   --  Name:  Expanded_Property
   --  Type:  Boolean
   --  Descr: Whether the expander has been opened to reveal the child widget
   --
   --  Name:  Label_Property
   --  Type:  String
   --  Descr: Text of the expander's label
   --
   --  Name:  Label_Widget_Property
   --  Type:  Object
   --  Descr: A widget to display in place of the usual expander label
   --
   --  Name:  Spacing_Property
   --  Type:  Int
   --  Descr: Space to put between the label and the child
   --
   --  Name:  Use_Markup_Property
   --  Type:  Boolean
   --  Descr: The text of the label includes XML markup. See pango_parse_markup
   --
   --  Name:  Use_Underline_Property
   --  Type:  Boolean
   --  Descr: If set, an underline in the text indicates the next character
   --         should be used for the mnemonic accelerator key
   --  </properties>

   Expanded_Property      : constant Glib.Properties.Property_Boolean;
   Label_Property         : constant Glib.Properties.Property_String;
   Label_Widget_Property  : constant Glib.Properties.Property_Object;
   Spacing_Property       : constant Glib.Properties.Property_Int;
   Use_Markup_Property    : constant Glib.Properties.Property_Boolean;
   Use_Underline_Property : constant Glib.Properties.Property_Boolean;

   ----------------------
   -- Style Properties --
   ----------------------
   --  The following properties can be changed through the gtk theme and
   --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property

   --  <style_properties>
   --  Name:  Expander_Size_Property
   --  Type:  Int
   --  Descr: Size of the expander arrow
   --
   --  Name:  Expander_Spacing_Property
   --  Type:  Int
   --  Descr: Spacing around expander arrow
   --  </style_properties>

   Expander_Size_Property    : constant Glib.Properties.Property_Int;
   Expander_Spacing_Property : constant Glib.Properties.Property_Int;

   -------------
   -- Signals --
   -------------

   --  <signals>
   --  The following new signals are defined for this widget:
   --
   --  - "activate"
   --    procedure Handler (Expander : access Gtk_Expander_Record'Class);
   --    Send this signal if you want to toggle the state of the expander, as
   --    if the user had clicked on it. This is mostly useful when associated
   --    with a keybinding
   --
   --  - "notify::expanded"
   --    This is the general "notify" signal, but will only call the handler
   --    when the "expanded property changes. This can be used to monitor state
   --    changes for the expander
   --
   --  </signals>

   Signal_Activate : constant String := "activate";

private
   pragma Import (C, Get_Type, "gtk_expander_get_type");

   Expanded_Property : constant Glib.Properties.Property_Boolean :=
     Glib.Properties.Build ("expanded");
   Label_Property : constant Glib.Properties.Property_String :=
     Glib.Properties.Build ("label");
   Label_Widget_Property : constant Glib.Properties.Property_Object :=
     Glib.Properties.Build ("label-widget");
   Spacing_Property : constant Glib.Properties.Property_Int :=
     Glib.Properties.Build ("spacing");
   Use_Markup_Property : constant Glib.Properties.Property_Boolean :=
     Glib.Properties.Build ("use-markup");
   Use_Underline_Property : constant Glib.Properties.Property_Boolean :=
     Glib.Properties.Build ("use-underline");

   Expander_Size_Property : constant Glib.Properties.Property_Int :=
     Glib.Properties.Build ("expander-size");
   Expander_Spacing_Property : constant Glib.Properties.Property_Int :=
     Glib.Properties.Build ("expander-spacing");

end Gtk.Expander;