From 106316bcedec72c5380a7544c27be6a5c117e57a Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 15 Jan 2025 23:52:50 +1300 Subject: Filled holes in Fl_Menu_ and Fl_Menu_Item bound APIs, fixed a few irritating bugs, damn the treacherous C++ API --- doc/fl_menu_.html | 221 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 192 insertions(+), 29 deletions(-) (limited to 'doc/fl_menu_.html') diff --git a/doc/fl_menu_.html b/doc/fl_menu_.html index 5f93e0f..5099d2e 100644 --- a/doc/fl_menu_.html +++ b/doc/fl_menu_.html @@ -26,6 +26,11 @@ +

Note:

+This Menu type should really be abstract but cannot be for technical binding reasons. +If you try to use it directly you will get issues with the draw and handle methods. +Either extend it and override those subprograms or use types already extended from it.

+ @@ -60,6 +65,18 @@ +
+ + + + + + + +
Errors
NULLNo_Reference_Error
+ + + @@ -126,6 +143,22 @@ function Create + + + + + @@ -136,6 +169,14 @@ procedure Add Action : in Widget_Callback := null; Shortcut : in Key_Combo := No_Key; Flags : in Menu_Flag := Flag_Normal); + +function Add + (This : in out Menu; + Text : in String; + Action : in Widget_Callback := null; + Shortcut : in Key_Combo := No_Key; + Flags : in Menu_Flag := Flag_Normal) + return Index; @@ -144,14 +185,22 @@ procedure Add int add(const char *a, const char *b, Fl_Callback *c, void *d=0, int e=0); - - - - - @@ -168,14 +217,22 @@ procedure Clear - + - + @@ -215,7 +272,7 @@ void down_color(unsigned c); - + + + + + + - + @@ -335,11 +417,28 @@ procedure Insert int insert(int index, const char *a, const char *b, Fl_Callback *c, void *d=0, int e=0); - + - + - + @@ -376,7 +484,7 @@ function Iterate - + - + - + + - + - @@ -428,11 +550,15 @@ function Chosen - + - + - + - + - + - + @@ -501,14 +641,22 @@ function Number_Of_Items - + - + @@ -526,7 +674,12 @@ function Chosen_Label - + @@ -614,6 +767,11 @@ int value(const Fl_Menu_Item *); procedure Set_Chosen (This : in out Menu; Item : in FLTK.Menu_Items.Menu_Item); + +function Set_Chosen + (This : in out Menu; + Item : in FLTK.Menu_Items.Menu_Item) + return Boolean; @@ -625,6 +783,11 @@ int value(int i); procedure Set_Chosen (This : in out Menu; Place : in Index); + +function Set_Chosen + (This : in out Menu; + Place : in Index) + return Boolean; -- cgit
Protected Attributes
+int add(const char *);
+
+procedure Add
+       (This : in out Menu;
+        Text : in     String);
+
+function Add
+       (This : in out Menu;
+        Text : in     String)
+    return Index;
+
 int add(const char *, int shortcut, Fl_Callback *,
     void *=0, int=0);
 
 
-int add(const char *);
+procedure Add
+       (This     : in out Menu;
+        Text     : in     String;
+        Action   : in     Widget_Callback := null;
+        Shortcut : in     String;
+        Flags    : in     Menu_Flag := Flag_Normal);
+
+function Add
+       (This     : in out Menu;
+        Text     : in     String;
+        Action   : in     Widget_Callback := null;
+        Shortcut : in     String;
+        Flags    : in     Menu_Flag := Flag_Normal)
+    return Index;
 
 
 int clear_submenu(int index);
 
 
+procedure Clear_Submenu
+       (This  : in out Menu;
+        Place : in     Index);
+
 void copy(const Fl_Menu_Item *m, void *user_data=0);
 
 
+procedure Set_Items
+       (This  : in out Menu;
+        Items : in     FLTK.Menu_Items.Menu_Item_Array);
+
See draw method in Fl_Menu_ItemSee draw method in Fl_Menu_Item.
 procedure Draw_Item
        (This       : in out Menu;
@@ -285,6 +342,22 @@ function Find_Item
 
See find_shortcut in Fl_Menu_Item.
+function Find_Shortcut
+       (This        : in Menu;
+        Require_Alt : in Boolean := False)
+    return access FLTK.Menu_Items.Menu_Item'Class;
+
+function Find_Shortcut
+       (This        : in     Menu;
+        Place       :    out Extended_Index;
+        Require_Alt : in     Boolean := False)
+    return access FLTK.Menu_Items.Menu_Item'Class;
+
 void global();
@@ -296,7 +369,7 @@ procedure Make_Global
   
 Check index values against the size method manually.
 function Has_Item
        (This  : in Menu;
@@ -327,6 +400,15 @@ procedure Insert
         Action   : in     Widget_Callback := null;
         Shortcut : in     Key_Combo := No_Key;
         Flags    : in     Menu_Flag := Flag_Normal);
+
+function Insert
+       (This     : in out Menu;
+        Place    : in     Index;
+        Text     : in     String;
+        Action   : in     Widget_Callback := null;
+        Shortcut : in     Key_Combo := No_Key;
+        Flags    : in     Menu_Flag := Flag_Normal)
+    return Index;
 
 
+procedure Insert
+       (This     : in out Menu;
+        Place    : in     Index;
+        Text     : in     String;
+        Action   : in     Widget_Callback := null;
+        Shortcut : in     String;
+        Flags    : in     Menu_Flag := Flag_Normal);
+
+function Insert
+       (This     : in out Menu;
+        Place    : in     Index;
+        Text     : in     String;
+        Action   : in     Widget_Callback := null;
+        Shortcut : in     String;
+        Flags    : in     Menu_Flag := Flag_Normal)
+    return Index;
+
 Use the menu method to access the menu item array and index it directly.
 function Item
        (This  : in Menu;
@@ -363,7 +462,16 @@ function Item
 int item_pathname(char *name, int namelen,
     const Fl_Menu_Item *finditem=0) const;
 
 
+function Item_Pathname
+       (This : in Menu)
+    return String;
+
+function Item_Pathname
+       (This : in Menu;
+        Item : in FLTK.Menu_Items.Menu_Item)
+    return String;
+
See measure method in Fl_Menu_ItemSee measure method in Fl_Menu_Item.
 procedure Measure_Item
        (This : in     Menu;
@@ -389,28 +497,42 @@ procedure Measure_Item
 
 const Fl_Menu_Item * menu() const;
 
Use iterators insteadUse Item or Iterate as necessary to access specific items or walk the array.
 void menu(const Fl_Menu_Item *m);
 
 
+procedure Use_Same_Items
+       (This  : in out Menu;
+        Donor : in     Menu'Class);
+
-void mode(int i, int fl);
+int mode(int i) const;
+
+function Get_Flags
+       (This  : in Menu
+        Place : in Index)
+    return Menu_Flag;
 
See Set_Flags procedure in FLTK.Menu_Items
-int mode(int i) const;
+void mode(int i, int fl);
+
+procedure Set_Flags
+       (This  : in out Menu;
+        Place : in     Index;
+        Flags : in     Menu_Flag);
 
See Get_Flags function in FLTK.Menu_Items
 const Fl_Menu_Item * picked(const Fl_Menu_Item *);
 
 
+procedure Picked
+       (This : in out Menu;
+        Item : in out FLTK.Menu_Items.Menu_Item);
+
See popup method in Fl_Menu_ItemSee popup method in Fl_Menu_Item.
 function Popup
        (This    : in Menu;
@@ -444,7 +570,7 @@ function Popup
   
See pulldown method in Fl_Menu_ItemSee pulldown method in Fl_Menu_Item.
 function Pulldown
        (This       : in Menu;
@@ -469,21 +595,35 @@ procedure Remove
 
 void replace(int, const char *);
 
See Set_Label procedure in FLTK.Menu_Items
+procedure Set_Label
+       (This  : in out Menu;
+        Place : in     Index;
+        Text  : in     String);
+
 void setonly(Fl_Menu_Item *item);
 
See Set_Only procedure in FLTK.Menu_Items
+procedure Set_Only
+       (This : in out Menu;
+        Item : in out Menu_Item);
+
 void shortcut(int i, int s);
 
See Set_Shortcut procedure in FLTK.Menu_Items
+procedure Set_Shortcut
+       (This  : in out Menu;
+        Place : in     Index;
+        Press : in     Key_Combo);
+
 void size(int W, int H);
 
 
+procedure Resize
+       (This : in out Menu;
+        W, H : in     Integer);
+
 const Fl_Menu_Item * test_shortcut();
 
 
+function Test_Shortcut
+       (This : in out Menu)
+    return access FLTK.Menu_Items.Menu_Item'Class;
+
 const char * text(int i) const;
 
See Get_Label function in FLTK.Menu_Items
+function Get_Label
+       (This  : in Menu;
+        Place : in Index)
+    return String;
+