From fbdef14a42388934067427854b6f5559bef31e8d Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Mon, 1 May 2017 22:56:51 +1000 Subject: Draw method implemented for Groups, Menus, although Menus are now no longer abstract even though they should be --- src/fltk-widgets-menus.ads | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/fltk-widgets-menus.ads') diff --git a/src/fltk-widgets-menus.ads b/src/fltk-widgets-menus.ads index d01f02e..c745273 100644 --- a/src/fltk-widgets-menus.ads +++ b/src/fltk-widgets-menus.ads @@ -8,7 +8,11 @@ private with System; package FLTK.Widgets.Menus is - type Menu is abstract new Widget with private; + -- still abstract, really, because if the Draw procedure isn't + -- overridden it'll call the abstract C++ method + type Menu is new Widget with private; + + type Menu_Cursor (Data : access Menu'Class) is limited null record with Implicit_Dereference => Data; @@ -34,7 +38,7 @@ package FLTK.Widgets.Menus is function Create (X, Y, W, H : in Integer; Text : in String) - return Menu is abstract; + return Menu; procedure Add @@ -72,7 +76,16 @@ package FLTK.Widgets.Menus is private - type Menu is abstract new Widget with null record; + -- must be overridden in any derived types + procedure Draw + (This : in out Menu); + + + type Menu is new Widget with null record; + + + overriding procedure Finalize + (This : in out Menu); type Menu_Item is tagged limited @@ -93,5 +106,8 @@ private Flag_Divider : constant Menu_Flag := 2#10000000#; + package Menu_Convert is new System.Address_To_Access_Conversions (Menu'Class); + + end FLTK.Widgets.Menus; -- cgit