Module pywraps :: Class Choose2
[frames] | no frames]

Class Choose2

object --+
         |
        Choose2

Choose2 wrapper class. Some constants are defined in this class. Please refer to kernwin.hpp for more information.

Instance Methods
 
__init__(self, title, cols, flags=0, popup_names=None, icon=-1, x1=-1, y1=-1, x2=-1, y2=-1, deflt=-1)
Constructs a chooser window.
 
Show(self, modal=False)
Activates or creates a chooser window
 
Activate(self)
Activates a visible chooser
 
Refresh(self)
Causes the refresh callback to trigger
 
Close(self)
Closes the chooser
 
AddCommand(self, caption, flags=_idaapi.CHOOSER_POPUP_MENU, menu_index=-1, icon=-1)
Adds a new chooser command Save the returned value and later use it in the OnCommand handler
 
OnClose(self)
Called when the window is being closed.
 
OnGetLine(self, n)
Called when the chooser window requires lines.
 
OnGetSize(self)
Returns the element count.
 
OnEditLine(self, n)
Called when an item is being edited.
 
OnInsertLine(self)
Called when 'Insert' is selected either via the hotkey or popup menu.
 
OnSelectLine(self, n)
Called when the line selection changes
 
OnDeleteLine(self, n)
Called when a line is about to be deleted
 
OnRefresh(self, n)
Called when the 'Refresh' is selected
 
OnCommand(self, n, cmd_id)
Return int ; check add_chooser_command()
 
OnGetIcon(self, n)
Return icon number for a given item (or -1 if no icon is avail)
 
OnGetLineAttr(self, n)
Return list [bgcolor, flags=CHITEM_XXXX] or None; check chooser_item_attrs_t

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  CH_MODAL = 0x01
  CH_MULTI = 0x02
  CH_MULTI_EDIT = 0x04
  CH_NOBTNS = 0x08
  CH_ATTRS = 0x10
  CH_BUILTIN_MASK = 0xF80000
  CHCOL_PLAIN = 0x00000000
  CHCOL_PATH = 0x00010000
  CHCOL_HEX = 0x00020000
  CHCOL_DEC = 0x00030000
  CHCOL_FORMAT = 0x00070000
Properties

Inherited from object: __class__

Method Details

__init__(self, title, cols, flags=0, popup_names=None, icon=-1, x1=-1, y1=-1, x2=-1, y2=-1, deflt=-1)
(Constructor)

 

Constructs a chooser window.

Parameters:
  • title - The chooser title
  • cols - a list of colums; each list item is a list of two items example: [ ["Address", 10 | Choose2.CHCOL_HEX], ["Name", 30 | CHCOL_PLAIN] ]
  • flags - One of CH_XXXX constants
  • deflt - Default starting item
  • popup_names - list of new captions to replace this list ["Insert", "Delete", "Edit", "Refresh"]
  • icon - Icon index (the icon should exist in ida resources)
  • x1, y1, x2, y2 - The default location
Overrides: object.__init__

AddCommand(self, caption, flags=_idaapi.CHOOSER_POPUP_MENU, menu_index=-1, icon=-1)

 

Adds a new chooser command Save the returned value and later use it in the OnCommand handler

Returns:
Returns a negative value on failure or the command index

OnClose(self)

 

Called when the window is being closed. This callback is mandatory.

Returns:
nothing

OnGetLine(self, n)

 

Called when the chooser window requires lines. This callback is mandatory.

Returns:
The user should return a list with ncols elements. example: a list [col1, col2, col3, ...] describing the n-th line

OnGetSize(self)

 

Returns the element count. This callback is mandatory.

Returns:
Number of elements

OnEditLine(self, n)

 

Called when an item is being edited.

Parameters:
  • n - Line number (zero based)
Returns:
Nothing

OnInsertLine(self)

 

Called when 'Insert' is selected either via the hotkey or popup menu.

Returns:
Nothing

OnRefresh(self, n)

 

Called when the 'Refresh' is selected

Returns:
Return the number of elements