IDAPython 8.4
|
Chooser wrapper class. More...
Classes | |
class | UI_Hooks_Trampoline |
Public Member Functions | |
__init__ (self, title, cols, flags=0, popup_names=None, icon=-1, x1=-1, y1=-1, x2=-1, y2=-1, deflt=None, embedded=False, width=None, height=None, forbidden_cb=0, flags2=0) | |
Constructs a chooser window. | |
Embedded (self, create_chobj=False) | |
Creates an embedded chooser (as opposed to Show()) | |
GetEmbSelection (self) | |
Deprecated. | |
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. | |
GetWidget (self) | |
Return the TWidget underlying this view. | |
adjust_last_item (self, n) | |
Helper for OnDeleteLine() and OnRefresh() callbacks. | |
AddCommand (self, caption, flags=_ida_kernwin.CHOOSER_POPUP_MENU, menu_index=-1, icon=-1, emb=None, shortcut=None) | |
OnPopup (self, widget, popup_handle) | |
OnInit (self) | |
Initialize the chooser and populate it. | |
OnGetSize (self) | |
Get the number of elements in the chooser. | |
OnGetLine (self, n) | |
Get data for an element. | |
OnGetIcon (self, n) | |
Get an icon to associate with the first cell of an element. | |
OnGetLineAttr (self, n) | |
Get attributes for an element. | |
OnInsertLine (self, sel) | |
User asked to insert an element. | |
OnDeleteLine (self, sel) | |
User deleted an element. | |
OnEditLine (self, sel) | |
User asked to edit an element. | |
OnSelectLine (self, sel) | |
User pressed the enter key, or double-clicked a selection. | |
OnSelectionChange (self, sel) | |
Selection changed. | |
OnRefresh (self, sel) | |
The chooser needs to be refreshed. | |
OnClose (self) | |
The chooser window is closed. | |
OnGetEA (self, n) | |
Get the address of an element. | |
OnGetDirTree (self) | |
Get the dirtree_t that will be used to present a tree-like structure to the user (see CH_HAS_DIRTREE) | |
OnIndexToInode (self, n) | |
Map an element index to a dirtree_t inode. | |
OnIndexToDiffpos (self, n) | |
Map an element index to a diffpos_t. | |
OnLazyLoadDir (self, path) | |
Callback for lazy-loaded, dirtree-based choosers; the function will be called when a folder is expanded and it has not been loaded before. | |
Public Attributes | |
title = title | |
flags = flags | |
flags2 = flags2 | |
cols = cols | |
deflt = deflt | |
popup_names = popup_names | |
icon = icon | |
x1 = x1 | |
y1 = y1 | |
x2 = x2 | |
y2 = y2 | |
embedded = embedded | |
width = width | |
height = height | |
forbidden_cb = forbidden_cb | |
ui_hooks_trampoline = None | |
Static Public Attributes | |
CH_MODAL = _ida_kernwin.CH_MODAL | |
CH_MULTI = _ida_kernwin.CH_MULTI | |
CH_NOBTNS = _ida_kernwin.CH_NOBTNS | |
CH_ATTRS = _ida_kernwin.CH_ATTRS | |
CH_NOIDB = _ida_kernwin.CH_NOIDB | |
CH_FORCE_DEFAULT = _ida_kernwin.CH_FORCE_DEFAULT | |
CH_CAN_INS = _ida_kernwin.CH_CAN_INS | |
CH_CAN_DEL = _ida_kernwin.CH_CAN_DEL | |
CH_CAN_EDIT = _ida_kernwin.CH_CAN_EDIT | |
CH_CAN_REFRESH = _ida_kernwin.CH_CAN_REFRESH | |
CH_QFLT = _ida_kernwin.CH_QFLT | |
CH_QFTYP_SHIFT = _ida_kernwin.CH_QFTYP_SHIFT | |
CH_QFTYP_DEFAULT = _ida_kernwin.CH_QFTYP_DEFAULT | |
CH_QFTYP_NORMAL = _ida_kernwin.CH_QFTYP_NORMAL | |
CH_QFTYP_WHOLE_WORDS = _ida_kernwin.CH_QFTYP_WHOLE_WORDS | |
CH_QFTYP_REGEX = _ida_kernwin.CH_QFTYP_REGEX | |
CH_QFTYP_FUZZY = _ida_kernwin.CH_QFTYP_FUZZY | |
CH_QFTYP_MASK = _ida_kernwin.CH_QFTYP_MASK | |
CH_NO_STATUS_BAR = _ida_kernwin.CH_NO_STATUS_BAR | |
CH_RESTORE = _ida_kernwin.CH_RESTORE | |
CH_RENAME_IS_EDIT = _ida_kernwin.CH_RENAME_IS_EDIT | |
CH_BUILTIN_SHIFT = _ida_kernwin.CH_BUILTIN_SHIFT | |
CH_BUILTIN_MASK = _ida_kernwin.CH_BUILTIN_MASK | |
CH_HAS_DIRTREE = _ida_kernwin.CH_HAS_DIRTREE | |
CH_HAS_DIFF = _ida_kernwin.CH_HAS_DIFF | |
CHCOL_PLAIN = _ida_kernwin.CHCOL_PLAIN | |
CHCOL_PATH = _ida_kernwin.CHCOL_PATH | |
CHCOL_HEX = _ida_kernwin.CHCOL_HEX | |
CHCOL_DEC = _ida_kernwin.CHCOL_DEC | |
CHCOL_EA = _ida_kernwin.CHCOL_EA | |
CHCOL_FNAME = _ida_kernwin.CHCOL_FNAME | |
CHCOL_FORMAT = _ida_kernwin.CHCOL_FORMAT | |
CHCOL_DEFHIDDEN = _ida_kernwin.CHCOL_DEFHIDDEN | |
CHCOL_DRAGHINT = _ida_kernwin.CHCOL_DRAGHINT | |
CHCOL_INODENAME = _ida_kernwin.CHCOL_INODENAME | |
int | NO_SELECTION = -1 |
int | EMPTY_CHOOSER = -2 |
int | ALREADY_EXISTS = -3 |
int | NO_ATTR = -4 |
int | NOTHING_CHANGED = 0 |
int | ALL_CHANGED = 1 |
int | SELECTION_CHANGED = 2 |
Protected Attributes | |
_quick_commands = quick_widget_commands_t(_qccb) | |
Some constants are defined in this class. Please refer to kernwin.hpp for more information.
__init__ | ( | self, | |
title, | |||
cols, | |||
flags = 0, | |||
popup_names = None, | |||
icon = -1, | |||
x1 = -1, | |||
y1 = -1, | |||
x2 = -1, | |||
y2 = -1, | |||
deflt = None, | |||
embedded = False, | |||
width = None, | |||
height = None, | |||
forbidden_cb = 0, | |||
flags2 = 0 ) |
title | The chooser title |
cols | a list of colums; each list item is a list of two items example: [ ["Address", 10 | Choose.CHCOL_HEX], ["Name", 30 | Choose.CHCOL_PLAIN] ] |
flags | One of CH_XXXX constants |
flags2 | One of CH2_XXXX constants |
deflt | The index of the default item (0-based) for single selection choosers or the list of indexes for multi selection chooser |
popup_names | List of new captions to replace this list ["Insert", "Delete", "Edit", "Refresh"] |
icon | Icon index (the icon should exist in ida resources or an index to a custom loaded icon) |
x1,y1,x2,y2 | The default location (for txt-version) |
embedded | Create as embedded chooser |
width | Embedded chooser width |
height | Embedded chooser height |
forbidden_cb | Explicitly forbidden callbacks |
Activate | ( | self | ) |
AddCommand | ( | self, | |
caption, | |||
flags = _ida_kernwin.CHOOSER_POPUP_MENU, | |||
menu_index = -1, | |||
icon = -1, | |||
emb = None, | |||
shortcut = None ) |
adjust_last_item | ( | self, | |
n ) |
They can be finished by the following line: return [Choose.ALL_CHANGED] + self.adjust_last_item(n)
line | number of the remaining select item |
Close | ( | self | ) |
Embedded | ( | self, | |
create_chobj = False ) |
GetEmbSelection | ( | self | ) |
For embedded choosers, the selection is available through 'Form.EmbeddedChooserControl.selection'
GetWidget | ( | self | ) |
OnClose | ( | self | ) |
OnDeleteLine | ( | self, | |
sel ) |
sel | the current selection |
OnEditLine | ( | self, | |
sel ) |
sel | the current selection |
OnGetDirTree | ( | self | ) |
OnGetEA | ( | self, | |
n ) |
When this function returns valid addresses:
CHCOL_FNAME
flag, rows will be colored according to the attributes of the functions who own those addresses (extern, library function, Lumina, ... - similar to what the "Functions" widget does)<Enter>
(<Shift+Enter>
if the chooser is modal), IDA will jump to that address (through jumpto()) n | element number (0-based) |
OnGetIcon | ( | self, | |
n ) |
n | index of the element |
OnGetLine | ( | self, | |
n ) |
This callback is mandatory
n | the index to fetch data for |
OnGetLineAttr | ( | self, | |
n ) |
n | index of the element |
OnGetSize | ( | self | ) |
This callback is mandatory
OnIndexToDiffpos | ( | self, | |
n ) |
This callback is mandatory if CH_HAS_DIFF is specified
n | index of the element |
OnIndexToInode | ( | self, | |
n ) |
This callback is mandatory if CH_HAS_DIRTREE is specified
n | index of the element |
OnInit | ( | self | ) |
This callback is optional
OnInsertLine | ( | self, | |
sel ) |
sel | the current selection |
OnLazyLoadDir | ( | self, | |
path ) |
The implementation should use the given dirtree's link() or mkdir() methods to add the folder contents.
path | an absolute dirtree path to the directory that is being expanded |
OnPopup | ( | self, | |
widget, | |||
popup_handle ) |
OnRefresh | ( | self, | |
sel ) |
It returns the new positions of the selected items.
sel | the current selection |
OnSelectionChange | ( | self, | |
sel ) |
sel | the new selection |
OnSelectLine | ( | self, | |
sel ) |
sel | the current selection |
Refresh | ( | self | ) |
Show | ( | self, | |
modal = False ) |
modal | Display as modal dialog |
|
protected |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
cols = cols |
deflt = deflt |
embedded = embedded |
|
static |
flags = flags |
flags2 = flags2 |
forbidden_cb = forbidden_cb |
height = height |
icon = icon |
|
static |
|
static |
|
static |
popup_names = popup_names |
|
static |
title = title |
ui_hooks_trampoline = None |
width = width |
x1 = x1 |
x2 = x2 |
y1 = y1 |
y2 = y2 |