Messages of menubutton control
[MenuButton control]

Defines


Define Documentation

#define MBM_ADDITEM   0xF200

Sends to the control to add an item to the menu list.

 MBM_ADDITEM
 int pos;
 MENUBUTTONITEM newitem;

 wParam = (WPARAM)pos;
 lParam = (LPARAM)&newitem;
Parameters:
pos The position at which to add the item. If the control was created with the style of MBS_SORT, this parameter will be ignored. If this parameter is less than 0, the new item will be append to the tail of the menu list.
newitem Pointer to the menubutton item info structure.
Returns:
The position at which the item has been added, i.e., the index of the added item if success. Otherwise, the following error code will be returned:
  • MB_ERR_SPACE
    No memory can be allocated for new item.

Definition at line 181 of file menubutton.h.

#define MBM_DELITEM   0xF201

Sends to the control to delete an item in the menu list.

 MBM_DELETEITEM
 int del;

 wParam = (WPARAM)del;
 lParam = 0;
Parameters:
del The index of the item to be deleted.
Returns:
MB_OKAY if success, else MB_INV_ITEM to indicate valid index.

Definition at line 199 of file menubutton.h.

#define MBM_GETCURITEM   0xF206

Sends to get the index of the current selected item.

 MBM_GETCURITEM

 wParam = 0;
 lParam = 0;
Returns:
The index of the current selected item. If there is no seleted item, MB_INV_ITEM will be returned.

Definition at line 275 of file menubutton.h.

#define MBM_GETITEMDATA   0xF204

Sends to the control to retrive the data of a specific item.

 MBM_GETITEMDATA
 int index;
 PMENUBUTTONITEM pmbi;

 wParam = (WPARAM)index;
 lParam = (LPARAM)pmbi;
Parameters:
index The index of the specific item.
pmbi Pointer to the MENUBUTTONITEM structure for storing the menubutton item data.
Returns:
MB_OKAY if success, otherwise MB_INV_ITEM to indicate invalid index.

Definition at line 259 of file menubutton.h.

#define MBM_RESETCTRL   0xF202

Sends to the control to remove all items in the menu list.

 MBM_RESETCTRL

 wParam = 0;
 lParam = 0;
Returns:
Always be zero.

Definition at line 214 of file menubutton.h.

#define MBM_SETCURITEM   0xF207

Sends to set the current selected item based on index.

 MBM_SETCURITEM
 int cur;

 wParam = (WPARAM)cur;
 lParam = 0;
Parameters:
cur The index to be the current item.
Returns:
The index of the old selected item.

Definition at line 293 of file menubutton.h.

#define MBM_SETITEMDATA   0xF203

Sends to the control to set the data of a specific item.

 MBM_SETITEMDATA
 int index;
 PMENUBUTTONITEM pmbi;

 wParam = (WPARAM)index;
 lParam = (LPARAM)pmbi;
Parameters:
index The index of the item to be altered.
pmbi Pointer to the MENUBUTTONITEM structure that stores the new menubutton item data.
Returns:
MB_OKAY if success, otherwise will be one of the following error codes:
  • MB_INV_ITEM
    Indicate that the index you passed is valid.
  • MB_ERR_SPACE
    No memory can be allocated for new item data.

Definition at line 238 of file menubutton.h.

#define MBM_SETSTRCMPFUNC   0xF208

Sets the STRCMP function used to sort items.

An application sends a MBM_SETSTRCMPFUNC message to set a new STRCMP function to sort items in the menubutton.

Note that you should send this message before adding any item to the menubutton control.

 static int my_strcmp (const char* s1, const char* s2, size_t n)
 {
      ...
      return 0;
 }

 MBM_SETSTRCMPFUNC

 wParam = 0;
 lParam = (LPARAM) my_strcmp;
Parameters:
my_strcmp Your own function to compare two strings.
Returns:
One of the following values:
  • MB_OKAY
    Success
  • MB_ERR
    Not an empty menubutton

Definition at line 324 of file menubutton.h.

Generated on Thu Apr 7 16:01:46 2011 for MiniGUI V3.0.12 API Reference by  doxygen 1.6.3