Module ida_kernwin :: Class Choose
[frames] | no frames]

Class Choose

object --+
         |
        Choose

Chooser wrapper class.

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

Nested Classes
  UI_Hooks_Trampoline
Instance Methods
 
Activate(self)
Activates a visible chooser
 
AddCommand(self, caption, flags=4, menu_index=-1, icon=-1, emb=None, shortcut=None)
 
Close(self)
Closes the chooser
 
Embedded(self, create_chobj=False)
Creates an embedded chooser (as opposed to Show())
 
GetEmbSelection(self)
Deprecated.
 
GetWidget(self)
Return the TWidget underlying this view.
 
OnPopup(self, widget, popup_handle)
 
Refresh(self)
Causes the refresh callback to trigger
 
Show(self, modal=False)
Activates or creates a chooser window
 
__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)
Constructs a chooser window.
 
adjust_last_item(self, n)
Helper for OnDeleteLine() and OnRefresh() callbacks.

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

Class Variables
  ALL_CHANGED = 1
  ALREADY_EXISTS = -3
  CHCOL_DEC = 196608
  CHCOL_EA = 262144
  CHCOL_FNAME = 327680
  CHCOL_FORMAT = 458752
  CHCOL_HEX = 131072
  CHCOL_PATH = 65536
  CHCOL_PLAIN = 0
  CHOOSE_HAVE_DEL = 16
  CHOOSE_HAVE_EDIT = 32
  CHOOSE_HAVE_ENTER = 64
  CHOOSE_HAVE_GETATTR = 4
  CHOOSE_HAVE_GETICON = 2
  CHOOSE_HAVE_INIT = 1
  CHOOSE_HAVE_INS = 8
  CHOOSE_HAVE_ONCLOSE = 512
  CHOOSE_HAVE_REFRESH = 128
  CHOOSE_HAVE_SELECT = 256
  CH_ATTRS = 32
  CH_BUILTIN_MASK = 33030144
  CH_BUILTIN_SHIFT = 19
  CH_CAN_DEL = 512
  CH_CAN_EDIT = 1024
  CH_CAN_INS = 256
  CH_CAN_REFRESH = 2048
  CH_FORCE_DEFAULT = 128
  CH_MODAL = 1
  CH_MULTI = 4
  CH_NOBTNS = 16
  CH_NOIDB = 64
  CH_NO_STATUS_BAR = 65536
  CH_QFLT = 4096
  CH_QFTYP_DEFAULT = 0
  CH_QFTYP_FUZZY = 32768
  CH_QFTYP_MASK = 57344
  CH_QFTYP_NORMAL = 8192
  CH_QFTYP_REGEX = 24576
  CH_QFTYP_SHIFT = 13
  CH_QFTYP_WHOLE_WORDS = 16384
  CH_RESTORE = 131072
  EMPTY_CHOOSER = -2
  NOTHING_CHANGED = 0
  NO_ATTR = -4
  NO_SELECTION = -1
  SELECTION_CHANGED = 2
Properties

Inherited from object: __class__

Method Details

Embedded(self, create_chobj=False)

 

Creates an embedded chooser (as opposed to Show())

Returns:
Returns 0 on success or NO_ATTR

GetEmbSelection(self)

 

Deprecated. For embedded choosers, the selection is available through 'Form.EmbeddedChooserControl.selection'

GetWidget(self)

 

Return the TWidget underlying this view.

Returns:
The TWidget underlying this view, or None.

Show(self, modal=False)

 

Activates or creates a chooser window

Parameters:
  • modal - Display as modal dialog
Returns:
For all choosers it will return NO_ATTR if some mandatory attribute is missing. The mandatory attributes are: flags, title, cols, OnGetSize(), OnGetLine(); For modal choosers it will return the selected item index (0-based), or NO_SELECTION if no selection, or EMPTY_CHOOSER if the OnRefresh() callback returns EMPTY_CHOOSER; For non-modal choosers it will return 0 or ALREADY_EXISTS if the chooser was already open and is active now;

__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)
(Constructor)

 
Constructs a chooser window.
@param title: The chooser title
@param 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] ]
@param flags: One of CH_XXXX constants
@param deflt: The index of the default item (0-based) for single
    selection choosers or the list of indexes for multi selection
    chooser
@param popup_names: List of new captions to replace this list
    ["Insert", "Delete", "Edit", "Refresh"]
@param icon: Icon index (the icon should exist in ida resources or
    an index to a custom loaded icon)
@param x1, y1, x2, y2: The default location (for txt-version)
@param embedded: Create as embedded chooser
@param width: Embedded chooser width
@param height: Embedded chooser height
@param forbidden_cb: Explicitly forbidden callbacks

Overrides: object.__init__

adjust_last_item(self, n)

 

Helper for OnDeleteLine() and OnRefresh() callbacks. They can be finished by the following line: return [Choose.ALL_CHANGED] + self.adjust_last_item(n)

Returns:
list of selected lines numbers (one element or empty)