ListUpdateSectionMenu
From TrillWiki
The listUpdateSectionMenu changes the default menu for a particular section. The default menu shows up for all items within that section and also if the user clicks on an empty area within the section (ie: if the section is near the bottom of the list).
Compatibility: 2.0 and higher
Contents |
Syntax
plugin_send(MYGUID, "listUpdateSectionMenu", list_entry_t *);
Note that all Trillian functions and notifications begin with a lower-case letter, despite the Wiki requirement that all pages start with a capital letter.
Parameters
ListUpdateSectionMenu utilitizes the list_entry_t structure.
struct list_entry_t
{
unsigned int struct_size;
int num_left_icons;
struct list_bmp_t *left_icons;
int num_right_icons;
struct list_bmp_t *right_icons;
struct list_font_t font;
int section_id;
int parent_id;
int previous_id;
int unique_id;
int group;
int section;
int drag_and_drop;
int inline_editing;
int selectable;
int expanded;
int auto_expand;
int no_group_icon;
int no_double_click;
int owner_drawn;
int no_section_margins;
int floating;
int floating_x;
int floating_y;
char *tooltip;
char *text;
char *edit_string;
char *real_name;
void *data;
struct menu_entry_t *menu_entry;
ttkCallback callback;
/* 2.0
*/
int inline_editing_quick;
/* 3.0
*/
int icon_mode;
int icon_width;
int icon_height;
char *icon_name;
char *panel;
};
- section_id
- The section ID to change the menu on.
- menu_entry
- The menu entry to use as the default menu for this section. If you want to remove the default menu, set this to NULL. See below for information on menu_entry_t.
Return Value
Negative value on error, 0 on success.
Remarks
Do not change section menus that you did not create. You will override any menu that is already there and may produce results that are confusing and not desired. The best way to provide a default choice for all items is to add a callback to each of the menus for the individual list entries.
Be sure to remove the menu (set it to NULL) when the plugin stops.
Additional Structures
menu_entry_t
struct menu_entry_t {
unsigned int struct_size;
int menu_id;
int sub_menu_id;
int type;
int timeout;
int disabled;
int num_copies;
char *icon;
char *text;
char *shortcut;
void *data;
HWND hwnd;
struct menu_entry_t *sub_menu;
struct menu_entry_t *next_menu;
ttkCallback callback;
};
- menu_id
- The menu ID which is returned to you.
- sub_menu_id
- Must be -1.
- type
- Specifies the type of menu it will be. There are four types that are currently supported: MENU_TEXT, MENU_POPUP, MENU_SEPARATOR or MENU_CALLBACK. A MENU_TEXT type is just a normal menu entry. A MENU_POPUP is one that provides sub menus. A MENU_SEPARATOR is a horizontal separator that can separate a menu into sections to make it easier on the eyes to read. Lastly, the MENU_CALLBACK is a place holder that can be replaced when a menu is shown, this is good for dynamic menu areas that may change often and the plugin can be able to show the most current state of the menu at the time it is drawn.
- timeout
- Can either be a number for the number of times it is shown before it is hidden, or can be infinite (right now infinite is the only one that works).
- disabled
- If you want it unclickable or not.
- num_copies
- Must be 0.
- icon
- A name of the icon to use from the skin for the menu.
- text
- The text to write within the menu.
- shortcut
- If there is a shortcut key, add it here, such as 'ctrl-t'.
- data
- Data returned through the callback.
- sub_menu
- If there are sub_menu's to this entry, add the top of the chain here.
- next_menu
- If there are menu's below this entry, add the next one down here.
- callback
- The callback where menu notifications are sent.
