- added amb1050 - topmenu info strings (similar to menus)

- added removal detection to topmenus

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401640
This commit is contained in:
David Anderson
2007-10-22 06:56:17 +00:00
parent c6eaccde0b
commit 2e333caf77
5 changed files with 151 additions and 14 deletions
+24 -1
View File
@@ -79,6 +79,14 @@ enum TopMenuAction
* ITEMDRAW_DEFAULT.
*/
TopMenuAction_DrawOption = 3,
/**
* Called when an object is being removed from the menu.
* This can be used to clean up data stored in the info string.
*
* INPUT : TopMenu Handle, object ID.
*/
TopMenuAction_RemoveObject = 4,
};
/**
@@ -175,6 +183,7 @@ native bool:LoadTopMenuConfig(Handle:topmenu, const String:file[], String:error[
* @param parent Parent object ID, or INVALID_TOPMENUOBJECT for none.
* Items must have a category parent.
* Categories must not have a parent.
* @param info_string Arbitrary storage (max 255 bytes).
* @return A new TopMenuObject ID, or INVALID_TOPMENUOBJECT on
* failure.
* @error Invalid TopMenu Handle.
@@ -185,7 +194,21 @@ native TopMenuObject:AddToTopMenu(Handle:topmenu,
TopMenuHandler:handler,
TopMenuObject:parent,
const String:cmdname[]="",
flags=0);
flags=0,
const String:info_string[]="");
/**
* Retrieves the info string of a top menu item.
*
* @param topmenu TopMenu Handle.
* @param object TopMenuObject ID.
* @param buffer Buffer to store info string.
* @param maxlength Maximum size of info string.
* @return Number of bytes written, not including the
* null terminator.
* @error Invalid TopMenu Handle or TopMenuObject ID.
*/
native GetTopMenuInfoString(Handle:topmenu, TopMenuObject:parent, String:buffer[], maxlength);
/**
* Removes an object from a TopMenu.