IDAPython 8.4
Loading...
Searching...
No Matches
simplecustviewer_t Class Reference

The base class for implementing simple custom viewers.

Inheritance diagram for simplecustviewer_t:

Classes

class  UI_Hooks_Trampoline
 

Public Member Functions

 __init__ (self)
 
 OnPopup (self, form, popup_handle)
 Context menu popup is about to be shown.
 
 Create (self, title)
 Creates the custom view.
 
 Close (self)
 Destroys the view.
 
 Show (self)
 Shows an already created view.
 
 Refresh (self)
 
 RefreshCurrent (self)
 Refreshes the current line only.
 
 Count (self)
 Returns the number of lines in the view.
 
 GetSelection (self)
 Returns the selected range or None.
 
 ClearLines (self)
 Clears all the lines.
 
 AddLine (self, line, fgcolor=None, bgcolor=None)
 Adds a colored line to the view.
 
 InsertLine (self, lineno, line, fgcolor=None, bgcolor=None)
 Inserts a line in the given position.
 
 EditLine (self, lineno, line, fgcolor=None, bgcolor=None)
 Edits an existing line.
 
 PatchLine (self, lineno, offs, value)
 Patches an existing line character at the given offset.
 
 DelLine (self, lineno)
 Deletes an existing line.
 
 GetLine (self, lineno)
 Returns a line.
 
 GetCurrentWord (self, mouse=0)
 Returns the current word.
 
 GetCurrentLine (self, mouse=0, notags=0)
 Returns the current line.
 
 GetPos (self, mouse=0)
 Returns the current cursor or mouse position.
 
 GetLineNo (self, mouse=0)
 Calls GetPos() and returns the current line number or -1 on failure.
 
 Jump (self, lineno, x=0, y=0)
 
 IsFocused (self)
 Returns True if the current view is the focused view.
 
 GetWidget (self)
 Return the TWidget underlying this view.
 

Public Attributes

 ui_hooks_trampoline = self.UI_Hooks_Trampoline(self)
 
 title = title
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)

Member Function Documentation

◆ AddLine()

AddLine ( self,
line,
fgcolor = None,
bgcolor = None )
Returns
: Boolean

◆ ClearLines()

ClearLines ( self)

◆ Close()

Close ( self)

One has to call Create() afterwards. Show() can be called and it will call Create() internally.

Returns
: Boolean

◆ Count()

Count ( self)

◆ Create()

Create ( self,
title )

This should be the first method called after instantiation

Parameters
titleThe title of the view
Returns
: Boolean whether it succeeds or fails. It may fail if a window with the same title is already open. In this case better close existing windows

◆ DelLine()

DelLine ( self,
lineno )
Returns
: Boolean

◆ EditLine()

EditLine ( self,
lineno,
line,
fgcolor = None,
bgcolor = None )
Returns
: Boolean

◆ GetCurrentLine()

GetCurrentLine ( self,
mouse = 0,
notags = 0 )
Parameters
mouseCurrent line at mouse pos
notagsIf True then tag_remove() will be called before returning the line
Returns
: Returns the current line (colored or uncolored) or None on failure

◆ GetCurrentWord()

GetCurrentWord ( self,
mouse = 0 )
Parameters
mouseUse mouse position or cursor position
Returns
: None if failed or a String containing the current word at mouse or cursor

◆ GetLine()

GetLine ( self,
lineno )
Parameters
linenoThe line number
Returns
: Returns a tuple (colored_line, fgcolor, bgcolor) or None

◆ GetLineNo()

GetLineNo ( self,
mouse = 0 )

◆ GetPos()

GetPos ( self,
mouse = 0 )
Parameters
mousereturn mouse position
Returns
: Returns a tuple (lineno, x, y)

◆ GetSelection()

GetSelection ( self)
Returns
: - tuple(x1, y1, x2, y2)
  • None if no selection

◆ GetWidget()

GetWidget ( self)
Returns
: The TWidget underlying this view, or None.

◆ InsertLine()

InsertLine ( self,
lineno,
line,
fgcolor = None,
bgcolor = None )
Returns
: Boolean

◆ IsFocused()

IsFocused ( self)

◆ Jump()

Jump ( self,
lineno,
x = 0,
y = 0 )

◆ OnPopup()

OnPopup ( self,
form,
popup_handle )

Create items dynamically if you wish

Returns
: Boolean. True if you handled the event

◆ PatchLine()

PatchLine ( self,
lineno,
offs,
value )

This is a low level function. You must know what you're doing

◆ Refresh()

Refresh ( self)

◆ RefreshCurrent()

RefreshCurrent ( self)

◆ Show()

Show ( self)

It the view was closed, then it will call Create() for you

Returns
: Boolean

Member Data Documentation

◆ title

title = title

◆ ui_hooks_trampoline

ui_hooks_trampoline = self.UI_Hooks_Trampoline(self)

The documentation for this class was generated from the following file: