ClipX – Software Development Kit

ClipXMenuHandler Interface

Member Functions:

void insertMenuItem(int flags, int cmd, const char *str);

Call this function to insert a menu item at the top of this menu.

int flags

A flag that controls the bahavior and aspect of this menu item, this may be a combinations of the following values :

MF_STRING – This is the default parameter, the item is a simple string.
MF_CHECKED –
The item should have a checkbox associated with it
MF_GRAYED –
The item should be grayed out and unselectable
MF_DISABLED –
The item should be disabled and no selectable, but otherwise look normal
MF_OWNERDRAW –
The item is drawn using ClipXPopupModifier custom drawing callbacks
MF_SEPARATOR –
The item is a separator (cmd and str parameters are ignored)

int cmd

The command identifier for your menu item. This value will be passed to ClipXPopupModifer::onCommand when the user selects this item.

const char *str

The UTF8 string associated with this menu item.

ClipXMenuHandler *insertPopupMenu(const char *str);

Call this function to insert a sub popup menu at the top of this menu.

const char *str

The UTF8 string associated with this menu sub-popup.

returned value (ClipXMenuHandler *):

A pointer to a new ClipXMenuHandler interface associated with your menu sub-popup (you should not delete this pointer, ClipX deletes it on its own when it is no longer needed).

void addMenuItem(int flags, int cmd, const char *str);

Call this function to insert a menu item at the bottom of this menu.

int flags

A flag that controls the bahavior and aspect of this menu item, this may be a combinations of the following values :

MF_STRING – This is the default parameter, the item is a simple string.
MF_CHECKED –
The item should have a checkbox associated with it
MF_GRAYED –
The item should be grayed out and unselectable
MF_DISABLED –
The item should be disabled and no selectable, but otherwise look normal
MF_OWNERDRAW –
The item is drawn using ClipXPopupModifier custom drawing callbacks
MF_SEPARATOR –
The item is a separator (cmd and str parameters are ignored)

int cmd

The command identifier for your menu item. This value will be passed to ClipXPopupModifer::onCommand when the user selects this item.

const char *str

The UTF8 string associated with this menu item.

ClipXMenuHandler *addPopupMenu(const char *str);

Call this function to insert a sub popup menu at the bottom of this menu.

const char *str

The UTF8 string associated with this menu sub-popup.

returned value (ClipXMenuHandler *):

A pointer to a new ClipXMenuHandler interface associated with your menu sub-popup (you should not delete this pointer, ClipX deletes it on its own when it is no longer needed).

void updateMenuItem(int newflag, int cmd, const char *new_str)

Call this function to change a previously added menu item.

Parameters are identifcal to addMenuItem

void deleteMenuItem(int cmd)

Delete a previously added menu item.

int cmd:

The command identifier for the item to delete.

void deletePopupMenu(ClipXMenuHandler *menu)

Delete a previously added sub popup menu.

ClipXMenuHandler *menu:

The ClipXMenuHandler for the menu to delete.



Back to documentation index