~ubuntu-branches/ubuntu/intrepid/libgtkada2/intrepid

« back to all changes in this revision

Viewing changes to src/gtk-notebook.ads

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-08-11 09:46:51 UTC
  • mfrom: (6.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20080811094651-9mjd6acwa98ffw5c
Tags: 2.12.0-2ubuntu1
Add lpia to supported architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
3
3
--                                                                   --
4
4
--   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --
 
5
--                Copyright (C) 2000-2007 AdaCore                    --
5
6
--                                                                   --
6
7
-- This library is free software; you can redistribute it and/or     --
7
8
-- modify it under the terms of the GNU General Public               --
32
32
--  You can hide some of the pages of the notebook by simply calling Hide on
33
33
--  the widget that is contained in the page (or returned from Get_Nth_Page).
34
34
--  </description>
 
35
--  <c_version>2.10.9</c_version>
35
36
--  <group>Layout containers</group>
36
37
--  <testgtk>create_notebook.adb</testgtk>
37
38
--  <screenshot>gtk-notebook</screenshot>
159
159
   --  Remove a page from the notebook.
160
160
   --  The first position in the list of pages is 0.
161
161
 
 
162
   ------------------------
 
163
   -- Tabs drag and drop --
 
164
   ------------------------
 
165
 
 
166
   type Gtk_Notebook_Window_Creation_Func is access
 
167
     function (Source : System.Address; --  Gtk_Notebook
 
168
               Page   : System.Address; --  Gtk_Widget
 
169
               X      : System.Address; --  Gint
 
170
               Y      : System.Address; --  Gint
 
171
               Data   : System.Address) return Gtk_Notebook;
 
172
   pragma Convention (C, Gtk_Notebook_Window_Creation_Func);
 
173
 
 
174
   procedure Set_Window_Creation_Hook
 
175
     (Func     : Gtk_Notebook_Window_Creation_Func;
 
176
      Data     : System.Address;
 
177
      Destroy  : Glib.G_Destroy_Notify_Address);
 
178
   --  Install a global function used to create a window when a detached tab
 
179
   --  is dropped in an empty area.
 
180
 
 
181
   procedure Set_Group_Id
 
182
     (Notebook : access Gtk_Notebook_Record; Group_Id : Gint);
 
183
   --  Set a group identificator for Notebook. Notebooks sharing
 
184
   --  the same group identificator will be able to exchange tabs
 
185
   --  via drag and drop. A notebook with group identificator -1 will
 
186
   --  not be able to exchange tabs with any other notebook.
 
187
 
 
188
   function Get_Group_Id (Notebook : access Gtk_Notebook_Record) return Gint;
 
189
   --  Gets the current group identificator for Notebook or -1 if not set.
 
190
 
162
191
   --------------------------------------------
163
192
   -- Modifying and getting the current page --
164
193
   --------------------------------------------
371
400
      Position : Gint);
372
401
   --  Change the position of the page that contains Child.
373
402
 
 
403
   function Get_Tab_Reorderable
 
404
     (Notebook : access Gtk_Notebook_Record;
 
405
      Child    : access Gtk.Widget.Gtk_Widget_Record'Class;
 
406
      Position : Gint)
 
407
      return Boolean;
 
408
   --  Get whether the tab can be reordered via drag and drop or not.
 
409
 
 
410
   procedure Set_Tab_Reorderable
 
411
     (Notebook    : access Gtk_Notebook_Record;
 
412
      Child       : access Gtk.Widget.Gtk_Widget_Record'Class;
 
413
      Reorderable : Boolean := True);
 
414
   --  Set whether the notebook tab can be reordered.
 
415
 
 
416
   function Get_Tab_Detachable
 
417
     (Notebook : access Gtk_Notebook_Record;
 
418
      Child    : access Gtk.Widget.Gtk_Widget_Record'Class;
 
419
      Position : Gint)
 
420
      return Boolean;
 
421
   --  Return whether the tab contents can be detached from Notebook.
 
422
 
 
423
   procedure Set_Tab_Detachable
 
424
     (Notebook   : access Gtk_Notebook_Record;
 
425
      Child      : access Gtk.Widget.Gtk_Widget_Record'Class;
 
426
      Detachable : Boolean := True);
 
427
   --  Set whether the tab can be detached from Notebook to another
 
428
   --  notebook or widget.
 
429
   --
 
430
   --  Note that 2 notebooks must share a common group identificator
 
431
   --  (see Set_Group_Id) to allow automatic tabs interchange between them.
 
432
   --
 
433
   --  If you want a widget to interact with a notebook through DnD
 
434
   --  (i.e.: accept dragged tabs from it) it must be set as a drop
 
435
   --  destination and accept the target "GTK_NOTEBOOK_TAB". The notebook
 
436
   --  will fill the selection with a Gtk_Widget pointing to the child
 
437
   --  widget that corresponds to the dropped tab.
 
438
   --
 
439
   --  If you want a notebook to accept drags from other widgets,
 
440
   --  you will have to set your own DnD code to do it.
 
441
 
374
442
   --------------------
375
443
   -- GValue support --
376
444
   --------------------
473
541
   --  Name: Homogeneous_Property
474
542
   --  Type: Boolean
475
543
   --  See:  Set_Homogeneous_Tabs / -
 
544
   --
 
545
   --  <properties>
 
546
   --  Name:  Group_Id_Property
 
547
   --  Type:  Int
 
548
   --  See: Set_Group_Id / Get_Group_Id
476
549
   --  </properties>
477
550
 
478
551
   Page_Property         : constant Glib.Properties.Property_Int;
485
558
   Scrollable_Property   : constant Glib.Properties.Property_Boolean;
486
559
   Enable_Popup_Property : constant Glib.Properties.Property_Boolean;
487
560
   Homogeneous_Property  : constant Glib.Properties.Property_Boolean;
 
561
   Group_Id_Property : constant Glib.Properties.Property_Int;
488
562
 
489
563
   ----------------------
490
564
   -- Child Properties --
517
591
   --  Type:  Enum
518
592
   --  Descr: A Gtk_Pack_Type indicating whether the child is packed with
519
593
   --  reference to the start or end of the parent
 
594
   --
 
595
   --  Name:  Detachable_Property
 
596
   --  Type:  Boolean
 
597
   --  See:   Set_Tab_Detachable / Get_Tab_Detachable
 
598
   --
 
599
   --  Name:  Reorderable_Property
 
600
   --  Type:  Boolean
 
601
   --  See:   Set_Tab_Reorderable / Get_Tab_Reorderable
520
602
   --  </child_properties>
521
603
 
522
604
   Menu_Label_Property : constant Glib.Properties.Property_String;
525
607
   Tab_Fill_Property   : constant Glib.Properties.Property_Boolean;
526
608
   Tab_Label_Property  : constant Glib.Properties.Property_String;
527
609
   Tab_Pack_Property   : constant Gtk.Enums.Property_Pack_Type;
 
610
   Detachable_Property : constant Glib.Properties.Property_Boolean;
 
611
   Reorderable_Property : constant Glib.Properties.Property_Boolean;
528
612
 
529
613
   ----------------------
530
614
   -- Style Properties --
550
634
   --  Type:  Boolean
551
635
   --  Descr: Display a second forward arrow button on the opposite end of the
552
636
   --         tab area
 
637
   --
 
638
   --  Name:  Tab_Curvature_Property
 
639
   --  Type:  Int
 
640
   --  Descr: Size of tab curvature
 
641
   --
 
642
   --  Name:  Tab_Overlap_Property
 
643
   --  Type:  Int
 
644
   --  Descr: Size of tab overlap area
553
645
   --  </style_properties>
554
646
 
555
647
   Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean;
558
650
     Glib.Properties.Property_Boolean;
559
651
   Has_Secondary_Forward_Stepper_Property  : constant
560
652
     Glib.Properties.Property_Boolean;
 
653
   Tab_Curvature_Property : constant Glib.Properties.Property_Int;
 
654
   Tab_Overlap_Property : constant Glib.Properties.Property_Int;
561
655
 
562
656
   -------------
563
657
   -- Signals --
610
704
   --
611
705
   --  </signals>
612
706
 
613
 
   Signal_Switch_Page         : constant String := "switch_page";
614
 
   Signal_Select_Page         : constant String := "select_page";
615
 
   Signal_Focus_Tab           : constant String := "focus_tab";
616
 
   Signal_Move_Focus_Out      : constant String := "move_focus_out";
617
 
   Signal_Change_Current_Page : constant String := "change_current_page";
 
707
   Signal_Switch_Page         : constant Glib.Signal_Name := "switch_page";
 
708
   Signal_Select_Page         : constant Glib.Signal_Name := "select_page";
 
709
   Signal_Focus_Tab           : constant Glib.Signal_Name := "focus_tab";
 
710
   Signal_Move_Focus_Out      : constant Glib.Signal_Name := "move_focus_out";
 
711
   Signal_Change_Current_Page : constant Glib.Signal_Name :=
 
712
                                  "change_current_page";
618
713
 
619
714
private
620
715
   type Gtk_Notebook_Record is new Gtk.Container.Gtk_Container_Record
640
735
   Enable_Popup_Property   : constant Glib.Properties.Property_Boolean :=
641
736
     Glib.Properties.Build ("enable-popup");
642
737
   Homogeneous_Property  : constant Glib.Properties.Property_Boolean :=
643
 
     Glib.Properties.Build ("homgeneous");
 
738
     Glib.Properties.Build ("homogeneous");
 
739
   Group_Id_Property : constant Glib.Properties.Property_Int :=
 
740
     Glib.Properties.Build ("group-id");
644
741
 
645
742
   Menu_Label_Property : constant Glib.Properties.Property_String :=
646
743
     Glib.Properties.Build ("menu-label");
654
751
     Glib.Properties.Build ("tab-label");
655
752
   Tab_Pack_Property : constant Gtk.Enums.Property_Pack_Type :=
656
753
     Gtk.Enums.Build ("tab-pack");
657
 
 
 
754
   Detachable_Property : constant Glib.Properties.Property_Boolean :=
 
755
     Glib.Properties.Build ("detachable");
 
756
   Reorderable_Property : constant Glib.Properties.Property_Boolean :=
 
757
     Glib.Properties.Build ("reorderable");
658
758
 
659
759
   Has_Backward_Stepper_Property : constant Glib.Properties.Property_Boolean :=
660
760
     Glib.Properties.Build ("has-backward-stepper");
666
766
   Has_Secondary_Forward_Stepper_Property : constant
667
767
     Glib.Properties.Property_Boolean :=
668
768
     Glib.Properties.Build ("has-secondary-forward-stepper");
 
769
   Tab_Curvature_Property : constant Glib.Properties.Property_Int :=
 
770
     Glib.Properties.Build ("tab-curvature");
 
771
   Tab_Overlap_Property : constant Glib.Properties.Property_Int :=
 
772
     Glib.Properties.Build ("tab-overlap");
 
773
 
669
774
end Gtk.Notebook;