1with agar.core.event; 2with agar.gui.widget.button; 3with agar.gui.widget.tlist; 4with agar.gui.window; 5 6package agar.gui.widget.ucombo is 7 8 use type c.unsigned; 9 10 type flags_t is new c.unsigned; 11 UCOMBO_HFILL : constant flags_t := 16#01#; 12 UCOMBO_VFILL : constant flags_t := 16#02#; 13 UCOMBO_EXPAND : constant flags_t := UCOMBO_HFILL or UCOMBO_VFILL; 14 15 type ucombo_t is limited private; 16 type ucombo_access_t is access all ucombo_t; 17 pragma convention (c, ucombo_access_t); 18 19 -- API 20 21 function allocate 22 (parent : widget_access_t; 23 flags : flags_t) return ucombo_access_t; 24 pragma import (c, allocate, "AG_UComboNew"); 25 26 function allocate_polled 27 (parent : widget_access_t; 28 flags : flags_t; 29 callback : agar.core.event.callback_t) return ucombo_access_t; 30 pragma inline (allocate_polled); 31 32 procedure size_hint 33 (ucombo : ucombo_access_t; 34 text : string; 35 items : natural); 36 pragma inline (size_hint); 37 38 procedure size_hint_pixels 39 (ucombo : ucombo_access_t; 40 width : natural; 41 height : natural); 42 pragma inline (size_hint_pixels); 43 44 -- selection 45 46 procedure combo_select 47 (ucombo : ucombo_access_t; 48 item : agar.gui.widget.tlist.item_access_t); 49 pragma import (c, combo_select, "AG_ComboSelect"); 50 51 -- 52 53 function widget (ucombo : ucombo_access_t) return widget_access_t; 54 pragma inline (widget); 55 56private 57 58 type ucombo_t is record 59 widget : aliased widget_t; 60 flags : flags_t; 61 button : agar.gui.widget.button.button_access_t; 62 list : agar.gui.widget.tlist.tlist_access_t; 63 panel : agar.gui.window.window_access_t; 64 w_saved : c.int; 65 h_saved : c.int; 66 w_pre_list : c.int; 67 h_pre_list : c.int; 68 end record; 69 pragma convention (c, ucombo_t); 70 71end agar.gui.widget.ucombo; 72