IDA SDK

- Main Page
- Header Files
- Classes
- Modules

Functions
Functions: generic list choosers

## Detailed Description

These functions display a window that allows the user to select items.

## Functions
uint32 | choose (int flags, int x0, int y0, int x1, int y1, void *obj, int width, uint32(idaapi *sizer)(void *obj), char *(idaapi *getl)(void *obj, uint32 n, char *buf), const char *title, int icon, uint32 deflt=-1, chooser_cb_t *del=NULL, void(idaapi *ins)(void *obj)=NULL, chooser_cb_t *update=NULL, void(idaapi *edit)(void *obj, uint32 n)=NULL, void(idaapi *enter)(void *obj, uint32 n)=NULL, void(idaapi *destroy)(void *obj)=NULL, const char *const *popup_names=NULL, int(idaapi *get_icon)(void *obj, uint32 n)=NULL)
| Display a window with a list (1-column) and allow the user to select an item. More...
uint32 | choose (void *obj, int width, uint32(idaapi *sizer)(void *obj), char *(idaapi *getl)(void *obj, uint32 n, char *buf), const char *title, int icon=-1, uint32 deflt=-1, chooser_cb_t *del=NULL, void(idaapi *ins)(void *obj)=NULL, chooser_cb_t *update=NULL, void(idaapi *edit)(void *obj, uint32 n)=NULL, void(idaapi *enter)(void *obj, uint32 n)=NULL, void(idaapi *destroy)(void *obj)=NULL, const char *const *popup_names=NULL, int(idaapi *get_icon)(void *obj, uint32 n)=NULL)
| Convenience function: modal chooser. More...
uint32 | choose2 (int flags, int x0, int y0, int x1, int y1, void *obj, int ncol, const int *widths, uint32(idaapi *sizer)(void *obj), void(idaapi *getl)(void *obj, uint32 n, char *const *arrptr), const char *title, int icon, uint32 deflt=-1, chooser_cb_t *del=NULL, void(idaapi *ins)(void *obj)=NULL, chooser_cb_t *update=NULL, void(idaapi *edit)(void *obj, uint32 n)=NULL, void(idaapi *enter)(void *obj, uint32 n)=NULL, void(idaapi *destroy)(void *obj)=NULL, const char *const *popup_names=NULL, int(idaapi *get_icon)(void *obj, uint32 n)=NULL)
| Display a generic list chooser (n-column). More...
uint32 | choose2 (void *obj, int ncol, const int *widths, uint32(idaapi *sizer)(void *), void(idaapi *getl)(void *, uint32, char *const *), const char *title, int icon=-1, uint32 deflt=-1, chooser_cb_t *del=NULL, void(idaapi *ins)(void *)=NULL, chooser_cb_t *update=NULL, void(idaapi *edit)(void *, uint32)=NULL, void(idaapi *enter)(void *, uint32)=NULL, void(idaapi *destroy)(void *)=NULL, const char *const *popup_names=NULL, int(idaapi *get_icon)(void *obj, uint32 n)=NULL)
| Convenience function: modal chooser2. More...
uint32 | choose3 (const chooser_info_t *chi)
| Display a chooser with the benefit of additional callbacks. More...

## Function Documentation

uint32 choose | ( | int | flags,
|  | int | x0,
|  | int | y0,
|  | int | x1,
|  | int | y1,
|  | void * | obj,
|  | int | width,
|  | uint32(idaapi *)(void *obj) | sizer,
|  | char *(idaapi *)(void *obj, uint32 n, char *buf) | getl,
|  | const char * | title,
|  | int | icon,
|  | uint32 | deflt = `-1`,
|  | chooser_cb_t * | del = `NULL`,
|  | void(idaapi *)(void *obj) | ins = `NULL`,
|  | chooser_cb_t * | update = `NULL`,
|  | void(idaapi *)(void *obj, uint32 n) | edit = `NULL`,
|  | void(idaapi *)(void *obj, uint32 n) | enter = `NULL`,
|  | void(idaapi *)(void *obj) | destroy = `NULL`,
|  | const char *const * | popup_names = `NULL`,
|  | int(idaapi *)(void *obj, uint32 n) | get_icon = `NULL`
| ) |  |
| inline

Display a window with a list (1-column) and allow the user to select an item.

Parameters

  flags | Generic chooser flags
  x0,y0,x1,y1 | screen position x0=-1 for autoposition set x0=-2 if you need to use the chooser before opening the database
  obj | object to show
  width | max width of lines
  sizer | number of items
  getl | description of n-th item (1..n) 0-th item if header line 'buf' cannot be larger than MAXSTR
  title | menu title (includes ptr to help). may have chooser title prefixes (see above)
  icon | number of the default icon to display
  deflt | item number to focus (1-based) -1 if a non-modal chooser was already open, do not change selection otherwise focus on the first item
  del | callback for "Delete" (may be NULL) supports multi-selection scenario too returns: 1-ok, 0-failed
  ins | callback for "New" (may be NULL)
  update | callback for "Update"(may be NULL) update the whole list returns the new location of item 'n'
  edit | callback for "Edit" (may be NULL)
  enter | callback for non-modal "Enter" (may be NULL)
  destroy | callback to call when the window is closed (may be NULL)
  popup_names | default: insert, delete, edit, refresh
  get_icon | callback for get_icon (may be NULL)

Return values

  -1 | the chooser was already open and is now active (only for non-modal choosers)
  0 | the chooser was created but the user refused to choose anything
  else | index of the selected item (1-based)

uint32 choose | ( | void * | obj,
|  | int | width,
|  | uint32(idaapi *)(void *obj) | sizer,
|  | char *(idaapi *)(void *obj, uint32 n, char *buf) | getl,
|  | const char * | title,
|  | int | icon = `-1`,
|  | uint32 | deflt = `-1`,
|  | chooser_cb_t * | del = `NULL`,
|  | void(idaapi *)(void *obj) | ins = `NULL`,
|  | chooser_cb_t * | update = `NULL`,
|  | void(idaapi *)(void *obj, uint32 n) | edit = `NULL`,
|  | void(idaapi *)(void *obj, uint32 n) | enter = `NULL`,
|  | void(idaapi *)(void *obj) | destroy = `NULL`,
|  | const char *const * | popup_names = `NULL`,
|  | int(idaapi *)(void *obj, uint32 n) | get_icon = `NULL`
| ) |  |
| inline

Convenience function: modal chooser.

see choose(), CH_MODAL

uint32 choose2 | ( | int | flags,
|  | int | x0,
|  | int | y0,
|  | int | x1,
|  | int | y1,
|  | void * | obj,
|  | int | ncol,
|  | const int * | widths,
|  | uint32(idaapi *)(void *obj) | sizer,
|  | void(idaapi *)(void *obj, uint32 n, char *const *arrptr) | getl,
|  | const char * | title,
|  | int | icon,
|  | uint32 | deflt = `-1`,
|  | chooser_cb_t * | del = `NULL`,
|  | void(idaapi *)(void *obj) | ins = `NULL`,
|  | chooser_cb_t * | update = `NULL`,
|  | void(idaapi *)(void *obj, uint32 n) | edit = `NULL`,
|  | void(idaapi *)(void *obj, uint32 n) | enter = `NULL`,
|  | void(idaapi *)(void *obj) | destroy = `NULL`,
|  | const char *const * | popup_names = `NULL`,
|  | int(idaapi *)(void *obj, uint32 n) | get_icon = `NULL`
| ) |  |
| inline

Display a generic list chooser (n-column).

See choose() above for the description of the undescribed parameters

Parameters

  ncol | number of columns
  widths | widths of columns (may be NULL) low 16 bits of each value hold the column width high 16 bits are flags (see Chooser column flags)

uint32 choose2 | ( | void * | obj,
|  | int | ncol,
|  | const int * | widths,
|  | uint32(idaapi *)(void *) | sizer,
|  | void(idaapi *)(void *, uint32, char *const *) | getl,
|  | const char * | title,
|  | int | icon = `-1`,
|  | uint32 | deflt = `-1`,
|  | chooser_cb_t * | del = `NULL`,
|  | void(idaapi *)(void *) | ins = `NULL`,
|  | chooser_cb_t * | update = `NULL`,
|  | void(idaapi *)(void *, uint32) | edit = `NULL`,
|  | void(idaapi *)(void *, uint32) | enter = `NULL`,
|  | void(idaapi *)(void *) | destroy = `NULL`,
|  | const char *const * | popup_names = `NULL`,
|  | int(idaapi *)(void *obj, uint32 n) | get_icon = `NULL`
| ) |  |
| inline

Convenience function: modal chooser2.

see choose2(), CH_MODAL

uint32 choose3 | ( | const chooser_info_t * | chi | ) |
| inline

Display a chooser with the benefit of additional callbacks.

Invoke the chooser with a chooser_info_t structure (ui_choose_info).

see choose(), choose2()

Return values

  0 | no chosen item (may be ESC or header line)
  >0 | number of chosen item
  -1 | chooser already exists (non-modal windows)