Pro.UI — User-interface API for views, dialogs and workspaces

Overview

The Pro.UI module contains the user-interface API to create views, dialogs and workspaces.

Common Dialogs

Common dialogs are a simple way to interact with the user for basic operations.

This is simple message box:

from Pro.UI import *

proContext().msgBox(MBIconInfo, "Hello, world!")

Note

Before Cerbero Suite 5.0 and Cerbero Engine 2.0 the icons for the ProContext.msgBox() method were defined in the Pro.Core module.

The following code asks the user which file to open:

from Pro.UI import *

fname = proContext().getOpenFileName("Select a file...")
if fname:
    print(fname)

Retrieving the location where to save a file is almost identical:

from Pro.UI import *

fname = proContext().getSaveFileName("Save as...")
if fname:
    print(fname)

The following code asks the user to select a folder:

from Pro.UI import *

fname = proContext().getExistingDirectory("Select a folder...")
if fname:
    print(fname)

Asking for a text value:

from Pro.UI import *

text = ProInput.askText("Insert a text value...")
if text:
    print(text)

Hint

Many methods of the ProInput class support history keys. When a key is specified, a history of the last inserted values is automatically created.

Asking for a numeric value:

from Pro.UI import *

i = ProInput.askValue("Insert a number between 1 and 100", "", 1, 100)
if i != None:
    print(i)

Asking for an item in a list of values:

from Pro.Core import NTStringList
from Pro.UI import *

items = NTStringList()
for item in ("a", "b", "c"):
    items.append(item)

i = ProInput.askList(items, "Choose an item...")
if i != -1:
    print(items.at(i))

Sometimes it’s necessary to retrieve aggregate information from the user such as a list of parameters or settings. For these cases ProContext.askParams() can be used as explained in the next paragraph.

See also ProContext and ProInput.

Parameters & Settings

When aggregate information such as parameters or settings have to be retrieved from the user, ProContext.askParams() can be used. This method creates a property editor dialog which supports various type of fields.

An example:

from Pro.Core import *
from Pro.UI import *

# the schema of the property editor
xml = """
<peditor title="Settings">
  <section label="General">
    <property id="0" label="Name" type="edit" value="object" />
    <property id="1" label="Size" type="static" value="(0,0)">
        <property id="2" label="Width" type="integer" value="0" signed="false" radix="10" align="0" maxbits="16" />
        <property id="3" label="Height" type="integer" value="0" signed="false" radix="10" align="0" maxbits="16" />
    </property>
  </section>

  <section label="Options">
    <property id="4" label="Word wrap" type="check" value="false" />
    <property id="5" label="Syntax" type="combo" value="1">
      <list>
        <i>JavaScript</i>
        <i>C++</i>
        <i>Pascal</i>
      </list>
    </property>
  </section>

  <section label="Files">
    <property id="6" label="Open file" type="open-file" value="C:\\test.txt" />
    <property id="7" label="Save file" type="save-file" value="C:\\test2.txt" />
    <property id="8" label="Select directory" type="open-directory" value="C:\\temp" />
  </section>

  <section label="Content">
    <property id="9" label="Text" type="text">
        <value>This \tis a\nsample text</value>
    </property>
  </section>

  <section id="20" label="Numbers">
    <property id="10" label="Base address" type="integer" value="401000" signed="false" radix="16" align="8" />
    <property id="11" label="Char" type="integer" value="127" signed="true" radix="10" align="0" maxbits="8" />
  </section>

</peditor>"""

def updateSize(pe):
    sz = "(" + str(pe.getValue(2)) + "," + str(pe.getValue(3)) + ")"
    pe.setValue(1, sz)

# the callback for the property editor
def paramsCallback(pe, id, userdata):
    print("changed: " + str(id) + " value: " + str(pe.getValue(id)))
    if id == ProPropertyEditor.Notification_Init:
        updateSize(pe)
    elif id == 2 or id == 3:
        updateSize(pe)
        pe.setValue(0, "test2")
        pe.setValue(5, 2)
        pe.setValue(10, 0x2000)
    elif id == 4:
        b = not pe.isVisible(20)
        pe.setVisible(20, b)
        # set or clear some errors to demonstrate how it works
        if not b:
            errors = NTIntList()
            for e in (6, 7):
                errors.append(e)
            pe.setErrors(errors)
        else:
            pe.clearErrors()
    return True

# show a property editor dialog
params = proContext().askParams(xml, "Test", paramsCallback, None)
# print out the returned values
it = params.iterator()
while it.hasNext():
    it.next()
    print("key:", str(it.key()), "value:", str(it.value()))

If a key is passed to ProContext.askParams(), the state of the property dialog is automatically saved and restored, with the exception of multi-line text fields.

See also ProContext.askParams() and ProPropertyEditor.

Simple Views

When presenting basic data like text or hex data to the user, it is not always necessary to use callbacks.

In the following example some hex data is shown to the user in a hex view:

from Pro.Core import *
from Pro.UI import *

c = NTContainer()
c.setData(b"Hello, world!")

ctx = proContext()
hv = ctx.createView(ProView.Type_Hex, "Title")
hv.setData(c)
ctx.addView(hv)

The same is true when the data is returned from ScanProvider._scanViewData() or ScanProvider._formatViewData(). For instance, to show a structure to the user it’s sufficient to set it in ScanViewData.data and call ScanViewData.setViews() with SCANVIEW_TABLE:

def _scanViewData(self, xml, dnode, sdata):
   if sdata.type == CT_MetaData:
       s = self.obj.SomeStructure()
       sdata.data.setData(s)
       sdata.setViews(SCANVIEW_TABLE)
       return True
   return False

The same procedure is applicable to text and hex data.

Whenever the view that has to be presented to the user is not trivial, a custom view is the solution!

Custom Views

Custom views are views created from an XML schema and can contain any kind of sub-view. Sub-views can be placed in layouts, splitters, tab controls or groups.

The way custom views are notified from their various sub-views is by a callback mechanism. Every sub-view has an associated id and a set of defined notifications for its type.

The following is a simple example which creates a horizontal splitter which contains a table and a text view. The text view changes its contents based on the currently selected table item.

from Pro.UI import *

def customViewCallback(cv, ud, code, view, data):
    if code == pvnInit:
        t = cv.getView(1)
        labels = NTStringList()
        labels.append("Label")
        t.setColumnCount(1)
        t.setRowCount(10)
        t.setColumnLabels(labels)
        t.setColumnCWidth(0, 30)
        return 1
    elif code == pvnGetTableRow:
        vid = view.id()
        if vid == 1:
            data.setText(0, str(data.row))
    elif code == pvnRowSelected:
        vid = view.id()
        if vid == 1:
            e = cv.getView(2)
            e.setText(str(data.row))
    return 0

def customViewDemo():
    ctx = proContext()
    v = ctx.createView(ProView.Type_Custom, "Custom view demo")
    user_data = None
    v.setup("<ui><hs><table id='1'/><text id='2'/></hs></ui>", customViewCallback, user_data)
    ctx.addView(v)

customViewDemo()

The same example can be expressed in a more class-oriented way by using the user data parameter of the static callback to obtain the instance of the object.

from Pro.UI import *

class CustomView:

    @staticmethod
    def callback(cv, self, code, view, data):
        if code == pvnInit:
            t = cv.getView(1)
            labels = NTStringList()
            labels.append("Label")
            t.setColumnCount(1)
            t.setRowCount(10)
            t.setColumnLabels(labels)
            t.setColumnCWidth(0, 30)
            return 1
        elif code == pvnGetTableRow:
            vid = view.id()
            if vid == 1:
                data.setText(0, str(data.row))
        elif code == pvnRowSelected:
            vid = view.id()
            if vid == 1:
                e = cv.getView(2)
                e.setText(str(data.row))
        return 0

    def show(self):
        ctx = proContext()
        v = ctx.createView(ProView.Type_Custom, "Custom view demo")
        v.setup("<ui><hs><table id='1'/><text id='2'/></hs></ui>", self.callback, self)
        ctx.addView(v)

cv = CustomView()
cv.show()

The first argument of the callback function represents the custom view instance (ProCustomView). The second argument is the user data specified when calling ProCustomView.setup(). The third argument is the notification code (e.g., pvnInit). The fourth argument is the view from which the notification originated. This argument is None if the notification wasn’t sent by a sub-view. Finally, the fifth argument contains I/O data associated with a particular notification code (e.g., pvnCheckChangedData is the data structure associated to the pvnCheckChanged notification code). This argument is None if no data is associated to the notification code.

These are the available types of containers for sub-views:

  • hlayout/hl - Horizontal layout.

  • vlayout/vl - Vertical layout.

  • glayout/gl - Grid layout. (Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.)

  • hsplitter/hs - Horizontal splitter.

  • vsplitter/vs - Horizontal splitter.

  • tab - Tab container (See ProTabBar).

  • group - Group container.

Layout containers support the following attributes:

  • align - The alignment of the layout. This must be a dash (-) separated list of the following possible values: hcenter, vcenter, center, top, left, bottom and right.

  • margin - The margin in pixels of the layout.

  • spacing - The spacing in pixels between the sub-views in the layout.

Additionally, the children of grid layouts support the following attributes:

  • row - The row where the child is placed inside of the grid layout.

  • col - The column where the child is placed inside of the grid layout.

  • rowspan - The row span of the child inside of the grid layout. If not specified, defaults to 1.

  • colspan - The column span of the child inside of the grid layout. If not specified, defaults to 1.

If the children of the grid layout do not specify the row and col attributes, then the grid layout automatically places the children according to their order in the XML schema. Grid layouts support two additional node types to place the children:

  • nl - Increases the current row and resets the current column of the grid layout.

  • sp - Increases the current column of the grid layout.

Splitter containers support the following attributes:

  • sizes - The initial sizes in pixels for the sub-views in the splitter. This must be a dash (-) separated list.

  • csizes - The initial sizes in characters for the sub-views in the splitter. This must be a dash (-) separated list.

Note

Initial sizes for sub-views in a splitter container are indicative. They might not be respected.

Tab containers support the following attributes:

  • index - The initial index of the tab container.

  • titles - The titles of the tabs. This must be a semi-colon (;) separated list.

  • loc - The location of the tab bar. Possible values are: top, left, bottom and right. If not specified, it defaults to top.

Group containers support the following attributes:

  • layout - The layout of the group container. Possible values are: horizontal, h, vertical and v.

Containers can have an associate id, but it is not mandatory.

Hint

All containers can be nested: a layout may contain another layout, a group container may contain a layout and so on.

These are the types of available sub-views with their specific attributes:

  • btn - Button control (See ProPushButton). Available attributes are:

    • text - The text of the button.

  • carbon - Carbon disassembly view (See ProCarbonView).

  • celltable - Cell table view (See ProCellTableView).

  • check - Check-box control (See ProCheckBox). Available attributes are:

    • text - The text of the check-box.

    • checked - If true, the initial state of the check-box is checked.

  • combo - Combo control (See ProComboBox). Available attributes are:

    • edit - If true, the combo control is editable.

    • text - The text of an editable combo control.

  • hex - Hex view (See ProHexView).

  • label - Label control (See ProLabel). The value of the XML node represents the text of the label. Available attributes are:

    • select - If true, the label text is selectable.

    • wrap - If true, the label is word wrapped.

    • margin - The margin in pixels of the label text.

    • align - The alignment of the label text. This must be a dash (-) separated list of the following possible values: hcenter, vcenter, center, top, left, bottom and right.

  • media - Media view (See ProMediaView).

  • out - Output view (See ProView). Available attributes are:

    • readonly - If true, the output view is read-only.

    • linenr - If true, the output view shows the line number.

    • hline - If true, the output view highlights the current line.

    • hword - If true, the output view highlights the current word.

    • wrap - If true, the output view wraps text.

  • pie - Pie view (See ProView).

  • plot - Plot view (See ProPlotView).

  • sqltable - SQLite table view (See ProTableView).

  • table - Table view (See ProTableView).

  • text - Text view (See ProTextView). Available attributes are:

    • readonly - If true, the text view is read-only.

    • linenr - If true, the text view shows the line number.

    • hline - If true, the text view highlights the current line.

    • hword - If true, the text view highlights the current word.

    • wrap - If true, the text view wraps text.

  • tline - Text line control (See ProTextLine).

  • tree - Tree view (See ProTreeView).

Apart from their specific attributes, all sub-views support the following common attributes:

  • width - The preferred width of the view in pixels.

  • height - The preferred height of the view in pixels.

  • min-width - The minimum width of the view in pixels.

  • min-height - The minimum height of the view in pixels.

  • max-width - The maximum width of the view in pixels.

  • max-height - The maximum height of the view in pixels.

  • fixed-width - The fixed width of the view in pixels.

  • fixed-height - The fixed height of the view in pixels.

  • cwidth - The preferred width of the view in characters.

  • cheight - The preferred height of the view in characters.

  • min-cwidth - The minimum width of the view in characters.

  • min-cheight - The minimum height of the view in characters.

  • max-cwidth - The maximum width of the view in characters.

  • max-cheight - The maximum height of the view in characters.

  • fixed-cwidth - The fixed width of the view in characters.

  • fixed-cheight - The fixed height of the view in characters.

  • wfixed - If true, sets the horizontal size policy of the view to fixed.

  • hfixed - If true, sets the vertical size policy of the view to fixed.

  • bold - If true, sets the font of the view to bold.

  • italic - If true, sets the font of the view to italic.

  • focus - If true, sets the initial focus to the view.

  • hint - The tool-tip of the view.

Some sub-views also support the following attributes:

  • bgcolor - The color of the view specified as a hex value. This attribute is supported by the ui, btn, check and label UI elements.

Hint

Code examples for specific views and controls may be found under their class documentation. More examples of custom views can be found in the open source modules shipped with the application.

Dialogs

Dialogs are created around custom views:

from Pro.Core import *
from Pro.UI import *

c = NTContainer()
c.setData(b"Hello, world!")

ctx = proContext()
hv = ctx.createView(ProView.Type_Hex, "Title")
hv.setData(c)

dlg = ctx.createDialog(hv)
dlg.show()

The callback of the embedded custom view receives the notifications originating from the dialog (e.g., pvnShowDialog or pvnCloseDialog).

See also ProContext.createDialog() and ProDialog.

Workspaces

Entire workspaces with menus, tool-bars and dock views can be created from the SDK.

Important

Only one workspace at a time should exists in a process. This is a current limitation of working with workspaces. Therefore, when creating a workspace, as in the following example, it should be done from the context of a logic provider.

An example:

from Pro.Core import *
from Pro.UI import *

def cb(ws, ud, code, view, data):
    if code == pvnInit:
        print("hello world!")
        ws.restoreAppearance()
    elif code == pvnClose:
        print("bye world!")
    elif code == pvnExecuteAction:
        print(data.cmd)
        if data.cmd == 0:
            view = proContext().createView(ProView.Type_Hex, "testview")
            dock = ws.createDock(view, "testdock", "Test dock")
            ws.addDock(dock)
        elif data.cmd == 1:
            ws.saveLayout("d1")
            proContext().msgBox(MBIconInfo, "Saved", "Layout saved")
    return 0

def init():
    ctx = proContext()
    ws = ctx.createWorkspace("Test")
    ws.setup(cb, None)
    ws.setTitle("Test Workspace")
    ws.addStdToolBar(ws.StdToolBar_Run)
    ws.addStdToolBar(ws.StdToolBar_Views)
    ws.addStdToolBar(ws.StdToolBar_CmdLine)
    tbar = ws.addToolBar("test_tbar", "Test ToolBar")
    menu = ws.menuBar().addMenu("&File")
    for i in range(5):
        a = ws.addAction(i, "action " + str(i), "", i)
        tbar.addAction(a)
        menu.addAction(a)
        if i == 2:
            tbar.addSeparator()
            menu.addSeparator()
    for i in range(2):
        view = ctx.createView(ProView.Type_Text, "view" + str(i))
        dock = ws.createDock(view, "d" + str(i), "Test dock " + str(i))
        ws.addDock(dock)
    dock = ws.createStdDock(ws.StdDock_Output)
    ws.addDock(dock)
    ws.show()
    return False

The configuration lines for the logic provider used for the example above are the following:

[Workspace]
descr = Workspace Test
group = Example
file = ws.py
init = init

See also ProContext.createWorkspace() and ProWorkspace.

Module API

Pro.UI module API.

MBIconErr: Final[int]

Error icon for a message box.

See also ProContext.msgBox().

MBIconInfo: Final[int]

Information icon for a message box.

See also ProContext.msgBox().

MBIconWarn: Final[int]

Warning icon for a message box.

See also ProContext.msgBox().

MBOkCancel: Final[int]

Ok-Cancel buttons for a message box.

See also ProContext.msgBox().

MBYesNo: Final[int]

Yes-No buttons for a message box.

See also ProContext.msgBox().

class ProAlign

This class contains alignment constants.

Bottom: Final[int]

Bottom alignment.

Center: Final[int]

Center alignment.

This is a combination of HCenter and VCenter.

HCenter: Final[int]

Horizontal center alignment.

Left: Final[int]

Left alignment.

Right: Final[int]

Right alignment.

Top: Final[int]

Top alignment.

VCenter: Final[int]

Vertical center alignment.

ProAllToolBarAreas: Final[int]

All tool-bar areas.

See also meth:ProWorkspace.addToolBar.

ProBottomToolBarArea: Final[int]

Bottom tool-bar area.

See also meth:ProWorkspace.addToolBar.

class ProCarbonView

Bases: Pro.UI.ProView

This class represents a Carbon disassembly view.

The notifications for this view are:

See also ProContext.createView and ProCustomView.

addLoaderAction(cmd: int, label: str, shortcut: str = str(), icon: int = - 1)Pro.UI.ProUIAction

Adds a UI action from the side of the Carbon loader.

When the UI action is executed, the loader will be informed through CarbonLoader.executeAction().

Parameters
  • cmd (int) – The identifier for the UI action.

  • label (str) – The text for the action.

  • shortcut (str) – The shortcut for the action (e.g. Ctrl+K)

  • icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

Returns

Returns the UI action if successful; otherwise returns an invalid UI action.

Return type

ProUIAction

See also CarbonLoader.executeAction() and ProUIAction.

cursorAddress()tuple
Returns

Returns the cursor address and position if successful; otherwise returns (INVALID_STREAM_OFFSET, INVALID_STREAM_OFFSET).

Return type

int

See also setCursorAddress().

static fromCarbonUIContext(uictx: CarbonUIContext)ProCarbonView

Retrieves a Carbon disassembly view from a Carbon UI context.

Parameters

uictx (CarbonUIContext) – The Carbon UI context.

Returns

Returns a Carbon view if successful; otherwise returns an invalid view.

Return type

ProCarbonView

See also CarbonUIContext and CarbonLoader.

getCarbon()Carbon
Returns

Returns the current Carbon instance.

Return type

Carbon

See also setCarbon().

getSelectedRange(range: Pro.UI.ProCarbonViewRange)bool

Gets the selected range.

Parameters

range (ProCarbonViewRange) – The selected range.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also ProView.hasSelection(), setSelectedRange() and ProCarbonViewRange.

goToModule()None

Shows the module dialog box.

openMemoryView()None

Opens the memory dependent view.

setCarbon(c: Carbon)None

Sets the current Carbon instance.

Parameters

c (Carbon) – The Carbon instance to display in the view.

See also getCarbon().

setCursorAddress(address: int, position: Optional[int] = None)None

Sets the cursor address and position.

Parameters
  • address (int) – The address to set.

  • position (Optional[int]) – The position to set.

See also cursorAddress().

setSelectedRange(range: Pro.UI.ProCarbonViewRange)None

Sets the selected range.

Parameters

range (ProCarbonViewRange) – The range to select.

See also getSelectedRange() and ProCarbonViewRange.

class ProCarbonViewRange

This class represents a range in a Carbon disassembly view.

See also ProCarbonView.

end_addr

The end address of the range.

See also start_addr.

end_pos

The end position of the range.

See also start_pos.

start_addr

The start address of the range.

See also end_addr.

start_pos

The start position of the range.

See also end_pos.

class ProCellTableIndex

This class represent the index of an item in a cell table view.

See also ProCellTableView.

column

The column of the item.

See also row.

isValid()bool
Returns

Returns True if the index is valid; otherwise returns False.

Return type

bool

row

The row of the item.

See also column.

class ProCellTableIndexList

List of ProCellTableIndex elements.

append(value: Pro.UI.ProCellTableIndex)None

Inserts value at the end of the list.

Parameters

value (ProCellTableIndex) – The value to add to the list.

See also insert().

at(i: int)Pro.UI.ProCellTableIndex

Returns the item at index position i in the list. i must be a valid index position in the list (i.e., 0 <= i < size()).

Parameters

i (int) – The index of the element to return.

Returns

Returns the requested element.

Return type

ProCellTableIndex

clear()None

Removes all items from the list.

contains(value: Pro.UI.ProCellTableIndex)bool

Checks the presence of an element in the list.

Parameters

value (ProCellTableIndex) – The value to check for.

Returns

Returns True if the list contains an occurrence of value; otherwise returns False.

Return type

bool

See also indexOf() and count().

count(value: Pro.UI.ProCellTableIndex)int

Returns the number of occurrences of value in the list.

Parameters

value (ProCellTableIndex) – The value to count.

Returns

Returns the number of occurrences.

Return type

int

See also indexOf() and contains().

indexOf(value: Pro.UI.ProCellTableIndex, start: int = 0)int

Searches for an element in the list.

Parameters
  • value (ProCellTableIndex) – The value to search for.

  • start (int) – The start index.

Returns

Returns the index position of the first occurrence of value in the list. Returns -1 if no item was found.

Return type

int

See also contains().

insert(i: int, value: Pro.UI.ProCellTableIndex)None

Inserts value at index position i in the list. If i is 0, the value is prepended to the list. If i is size(), the value is appended to the list.

Parameters
  • i (int) – The position at which to add the value.

  • value (ProCellTableIndex) – The value to add.

See also append() and removeAt().

isEmpty()bool

Checks whether the list is empty.

Returns

Returns True if the list contains no items; otherwise returns False.

Return type

bool

See also size().

iterator()Pro.UI.ProCellTableIndexListIt

Creates an iterator for the list.

Returns

Returns the iterator.

Return type

ProCellTableIndexListIt

removeAll(value: Pro.UI.ProCellTableIndex)int

Removes all occurrences of value in the list and returns the number of entries removed.

Parameters

value (ProCellTableIndex) – The value to remove from the list.

Returns

Returns the number of entries removed.

Return type

int

See also removeAt().

removeAt(i: int)None

Removes the item at index position i. i must be a valid index position in the list (i.e., 0 <= i < size()).

Parameters

i (int) – The index of the item to remove.

See also removeAll().

reserve(alloc: int)None

Reserve space for alloc elements. Calling this method doesn’t change the size of the list.

Parameters

alloc (int) – The amount of elements to reserve space for.

size()int
Returns

Returns the number of items in the list.

Return type

int

See also isEmpty().

takeAt(i: int)Pro.UI.ProCellTableIndex

Removes the item at index position i and returns it. i must be a valid index position in the list (i.e., 0 <= i < size()).

Parameters

i (int) – The index of the element to remove from the list.

Returns

Returns the removed element. If you don’t use the return value, removeAt() is more efficient.

Return type

ProCellTableIndex

See also removeAt().

class ProCellTableIndexListIt(obj: Pro.UI.ProCellTableIndexList)

Iterator class for ProCellTableIndexList.

Parameters

obj (ProCellTableIndexList) – The object to iterate over.

hasNext()bool
Returns

Returns True if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returns False.

Return type

bool

See also hasPrevious() and next().

hasPrevious()bool
Returns

Returns True if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returns False.

Return type

bool

See also hasNext() and previous().

next()Pro.UI.ProCellTableIndex
Returns

Returns the next item and advances the iterator by one position.

Return type

ProCellTableIndex

See also hasNext() and previous().

previous()Pro.UI.ProCellTableIndex
Returns

Returns the previous item and moves the iterator back by one position.

Return type

ProCellTableIndex

See also hasPrevious() and next().

toBack()None

Moves the iterator to the back of the container (after the last item).

See also toFront() and previous().

toFront()None

Moves the iterator to the front of the container (before the first item).

See also toBack() and next().

class ProCellTableView

Bases: Pro.UI.ProView

This class represents a cell table view.

Hint

The difference with ProTableView is that table views are optimized for having many rows and a limited number of columns, while cell table views are not as fast as table views, but they can have as many columns as rows.

The notifications for this view are:

See also ProCustomView and ProTableView.

Data_BackgroundColor: Final[int]

Item background color request type.

See also pvnCellTableGetItem.

Data_EditText: Final[int]

Item editable text request type.

See also pvnCellTableGetItem.

Data_Font: Final[int]

Item font options request type.

See also pvnCellTableGetItem.

Data_Icon: Final[int]

Item icon request type.

See also pvnCellTableGetItem.

Data_Text: Final[int]

Item text request type.

See also pvnCellTableGetItem.

Data_TextAlignment: Final[int]

Item text alignment request type.

See also pvnCellTableGetItem.

Data_TextColor: Final[int]

Item text color request type.

See also pvnCellTableGetItem.

Font_Bold: Final[int]

Bold font option.

See also pvnCellTableGetItemData.setFontOptions().

Font_Italic: Final[int]

Italic font option.

See also pvnCellTableGetItemData.setFontOptions().

Font_Underline: Final[int]

Underline font option.

See also pvnCellTableGetItemData.setFontOptions().

beginInsertColumns(first: int, last: int)None

Begins a column insertion operation.

Parameters
  • first (int) – The index of the first column to insert.

  • last (int) – The index of the last column to insert.

See also endInsertColumns() and beginRemoveColumns().

beginInsertRows(first: int, last: int)None

Begins a row insertion operation.

Parameters
  • first (int) – The index of the first row to insert.

  • last (int) – The index of the last row to insert.

See also endInsertRows() and beginRemoveRows().

beginRemoveColumns(first: int, last: int)None

Begins a column removal operation.

Parameters
  • first (int) – The index of the first column to remove.

  • last (int) – The index of the last column to remove.

See also endRemoveColumns() and beginInsertColumns().

beginRemoveRows(first: int, last: int)None

Begins a row removal operation.

Parameters
  • first (int) – The index of the first row to remove.

  • last (int) – The index of the last row to remove.

See also endRemoveRows() and beginInsertRows().

canGoBack()bool
Returns

Returns True if it’s possible to go back the previous position; otherwise returns False.

Return type

bool

See also goBack() and enableNavigationHistory().

columnCount()int

Returns the number of columns in the table.

Internally this method uses pvnCellTableColumnCount to retrieve the number of columns.

Returns

Returns the number of columns.

Return type

int

See also pvnCellTableColumnCount and rowCount().

enableNavigationHistory(max_queue_size: int = 200)None

Enables the navigation history for the table.

Parameters

max_queue_size (int) – The maximum size of the navigation history.

See also canGoBack() and goBack().

endInsertColumns()None

Ends a column insertion operation.

See also beginInsertColumns().

endInsertRows()None

Ends a row insertion operation.

See also beginInsertRows().

endRemoveColumns()None

Ends a column removal operation.

See also beginRemoveColumns().

endRemoveRows()None

Ends a row removal operation.

See also beginRemoveRows().

getColumnWidth(col: int)int

Retrieves the width of a column.

Parameters

col (int) – The column for which to retrieve the width.

Returns

Returns the column width.

Return type

int

See also setColumnWidth().

getCurrentIndex()Pro.UI.ProCellTableIndex
Returns

Returns the current item if any; otherwise returns an invalid index.

Return type

ProCellTableIndex

See also setCurrentIndex() and ProCellTableIndex.

getHorizontalPosition()int
Returns

Returns the horizontal scroll-bar position.

Return type

int

See also setHorizontalPosition() and getVerticalPosition().

getItemText(idx_or_row: Union[Pro.UI.ProCellTableIndex, int], column: Optional[int] = None)str

Retrieves the text of an item.

Internally this method uses pvnCellTableGetItem with Data_EditText to retrieve the text of the item.

Parameters
  • idx_or_row (Union[ProCellTableIndex, int]) – The index or the row of the item.

  • column (Optional[int]) – The column of the item.

Returns

Returns the text of the item if successful; otherwise returns an empty string.

Return type

str

See also pvnCellTableGetItem.

getSelectedIndexes()Pro.UI.ProCellTableIndexList
Returns

Returns a list of the currently selected items if any; otherwise returns an empty list.

Return type

ProCellTableIndexList

See also ProCellTableIndexList, ProCellTableIndex and setCurrentIndex().

getVerticalPosition()int
Returns

Returns the vertical scroll-bar position.

Return type

int

See also setVerticalPosition() and getHorizontalPosition().

goBack()None

Goes back to the previous position in the navigation history.

Important

Before calling this method, it is necessary to enable navigation history by calling enableNavigationHistory().

See also canGoBack() and enableNavigationHistory().

refresh()None

Refreshes the contents of the table.

rowCount()int

Returns the number of rows in the table.

Internally this method uses pvnCellTableRowCount to retrieve the number of rows.

Returns

Returns the number of rows.

Return type

int

See also pvnCellTableRowCount and columnCount().

setCellHeightInLines(n: int)None

Sets the cell height in lines.

Parameters

n (int) – The number of lines.

See also setDefaultCellCWidth().

setColumnCWidth(col: int, cw: int)None

Sets the width of a column in characters.

Parameters
  • col (int) – The column to resize.

  • cw (int) – The width to set.

See also setColumnWidth() and setDefaultCellCWidth().

setColumnWidth(col: int, w: int)None

Sets the width of a column in pixels.

Parameters
  • col (int) – The column to resize.

  • w (int) – The width to set.

See also getColumnWidth(), setColumnCWidth() and setDefaultCellWidth().

setCurrentIndex(idx_or_row: Union[Pro.UI.ProCellTableIndex, int], column_or_select: Union[bool, int] = True, ensure_visible_or_select: bool = True, ensure_visible: bool = True)None

Sets the current item.

Parameters
  • idx_or_row (Union[ProCellTableIndex, int]) – The index or the row of the item.

  • column_or_select (Union[bool, int]) – The selection status or the column of the item.

  • ensure_visible_or_select (bool) – The selection status or ensure visible argument.

  • ensure_visible (bool) – If True, ensures the visibility of the item.

See also getCurrentIndex() and ProCellTableIndex.

setDefaultCellCWidth(cw: int)None

Sets the default cell width in characters.

Parameters

cw (int) – The width to set.

See also setDefaultCellWidth() and setColumnCWidth().

setDefaultCellWidth(w: int)None

Sets the default cell width in pixels.

Parameters

w (int) – The width to set.

See also setDefaultCellCWidth() and setColumnWidth().

setFixedFont()None

Sets the standard fixed font as font for the table.

setHorizontalPosition(pos: int)None

Sets the horizontal scroll-bar position.

Parameters

pos (int) – The position to set.

See also getHorizontalPosition() and setVerticalPosition().

setVerticalPosition(pos: int)None

Sets the vertical scroll-bar position.

Parameters

pos (int) – The position to set.

See also getVerticalPosition() and setHorizontalPosition().

class ProCheckBox

Bases: Pro.UI.ProView

This class represents a check box control.

The notifications for this control are:

  • pvnCheckChanged - Emitted when the checked status of the check box changes.

See also ProCustomView.

isChecked()bool
Returns

Returns True if the check box is checked; otherwise returns False.

Return type

bool

See also setChecked().

setChecked(b: bool)None

Sets the checked status of the check-box.

Parameters

b (bool) – The status to set.

See also isChecked().

setText(txt: str)None

Sets the text of the check-box.

Parameters

txt (str) – The text to set.

See also text().

text()str
Returns

Returns the text of the check box.

Return type

str

See also setText().

class ProClipboard

This class allows access to the system clipboard.

static getText()str
Returns

Returns the text stored in the clipboard if available; otherwise returns an empty string.

Return type

str

See also setText().

static setText(s: str)None

Sets the text stored in the clipboard.

Parameters

s (str) – The text to set.

See also getText().

ProColor_Custom: Final[int]

Theme based custom color.

ProColor_Error: Final[int]

Theme based error color.

ProColor_Special: Final[int]

Theme based special color.

ProColor_Unreferenced: Final[int]

Theme based unreferenced color.

ProColor_Used: Final[int]

Theme based used color.

class ProComboBox

Bases: Pro.UI.ProView

This class represents a combo box control.

The notifications for this control are:

See also ProCustomView.

addItem(text: str)None

Adds an item to the combo box.

Parameters

text (str) – The text of the item to add.

See also addItems() and removeItem().

addItems(items: Pro.Core.NTStringList)None

Adds a list of items to the combo box.

Parameters

items (NTStringList) – The list of items to add.

See also NTStringList, addItems() and removeItem().

count()int
Returns

Returns the number of items in the combo box.

Return type

int

See also currentIndex() and addItem().

currentIndex()int
Returns

Returns the index of the currently selected item if successful; otherwise returns -1.

Return type

int

See also setCurrentIndex() and editText().

editText()str

Retrieves the text of the combo box.

To use this method, the combo box must be editable (see setEditable()).

Returns

Returns the combo box text.

Return type

str

See also setEditText(), setEditable() and isEditable().

isEditable()bool
Returns

Returns True if the combo box is editable; otherwise returns False.

Return type

bool

See also setEditable(), editText() and setEditText().

itemText(i: int)str

Retrieves the text of an item in the combo box.

Parameters

i (int) – The index of the item.

Returns

Returns the item text if successful; otherwise returns an empty string.

Return type

str

See also editText() and addItem().

maxVisibleItems()int
Returns

Returns the maximum number of items visible when the drop-down button of the combo box is clicked.

Return type

int

See also setMaxVisibleItems().

removeItem(i: int)None

Removes an item from the combo box.

Parameters

i (int) – The index of the item to remove.

See also addItem() and addItems().

setCurrentIndex(i: int)None

Sets the currently selected item.

Parameters

i (int) – The index of the item to select.

See also currentIndex() and addItem().

setEditText(text: str)None

Sets the text of the combo box.

To use this method, the combo box must be editable (see setEditable()).

Parameters

text (str) – The text to set.

See also editText(), setEditable() and isEditable().

setEditable(b: bool)None

Makes the combo box editable.

Parameters

b (bool) – If True, makes the combo box editable; otherwise makes the combo box read-only.

See also editText(), setEditText() and isEditable().

setMaxVisibleItems(n: int)None

Sets the maximum number of items visible when the drop-down button of the combo box is clicked.

Parameters

n (int) – The number of visible items.

See also maxVisibleItems().

class ProContext

Bases: Pro.Core.ProCoreContext

This class provides functionality for the current UI context.

The global instance of this class can be retrieved by calling proContext().

See also proContext().

HexJumpBehavior_Auto: Final[int]

Automatically decides whether to jump using the current analysis view or to open a new one.

See also hexJump(), HexJumpBehavior_InPlace and HexJumpBehavior_OpenNew.

HexJumpBehavior_InPlace: Final[int]

Jumps to the hex view using the current analysis view.

See also hexJump(), HexJumpBehavior_Auto and HexJumpBehavior_OpenNew.

HexJumpBehavior_Mask: Final[int]

Mask for the hex jump behaviour.

See also hexJump(), HexJumpBehavior_Auto, HexJumpBehavior_InPlace and HexJumpBehavior_OpenNew.

HexJumpBehavior_OpenNew: Final[int]

Jumps to the hex view in a newly opened analysis view.

See also hexJump(), HexJumpBehavior_Auto and HexJumpBehavior_InPlace.

HexJumpType_Default: Final[int]

Jumps to the default hex view.

See also hexJump() and HexJumpType_Raw.

HexJumpType_Mask: Final[int]

Mask for the hex jump type.

See also hexJump(), HexJumpType_Default and HexJumpType_Raw.

HexJumpType_Raw: Final[int]

Jumps to the raw hex view.

See also hexJump() and HexJumpType_Default.

addView(view: Pro.UI.ProView, switch_to: bool = True)bool

Adds a view to the current workspace.

Parameters
  • view (ProView) – The view to add.

  • switch_to (bool) – If True, sets the focus to the added view.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also createView() and ProView.

askParams(xml: str, key: str = str(), cb: Optional[object] = None, ud: Optional[object] = None)Pro.Core.NTIntVariantHash

Shows a property editor dialog.

Parameters
  • xml (str) – The XML schema used to create the property dialog (see ProPropertyEditor).

  • key (str) – The unique key for the settings. If this value is specified, the values for the property editor are saved and restored automatically.

  • cb (Optional[object]) – The callback for the property editor dialog.

  • ud (Optional[object]) – The user data which is passed to the callback.

Returns

Returns the values of the fields if successful; otherwise returns an empty NTIntVariantHash.

Return type

NTIntVariantHash

See also ProPropertyEditor.

createDialog(view: Pro.UI.ProView)Pro.UI.ProDialog

Creates a dialog from a custom view.

Parameters

view (ProView) – The child custom view.

Returns

Returns the created dialog.

Return type

ProDialog

See also ProDialog and ProCustomView.

createView(type: int, title: str, flags: int = 0, icon: int = - 1)Pro.UI.ProView

Creates a view.

Parameters
  • type (int) – The type of view to create (e.g., ProView.Type_Text).

  • title (str) – The title of the view.

  • flags (int) – Reserved for future use.

  • icon (int) – The icon of the view (e.g., PubIcon_Text).

Returns

Returns the created view if successful; otherwise returns an invalid view.

Return type

ProView

See also addView() and ProView.

createViewFromWidget(widget: object)Pro.UI.ProView

Creates a view from a Qt widget.

This method was implemented to work with PySide and is now obsolete.

Parameters

widget (object) – The Qt widget.

Returns

Returns the created view if successful; otherwise returns an invalid view.

Return type

ProView

See also ProView.fromWidget() and createView().

createWorkspace(name: str, version: int = 0)Pro.UI.ProWorkspace

Creates a workspace.

Parameters
  • name (str) – The name of the workspace. This must be a unique name, since the settings of the workspace will be saved under this name.

  • version (int) – The version of the workspace. This version is used to decide whether the appearance of the workspace can be restored or not.

Returns

Returns the created workspace.

Return type

ProWorkspace

See also ProWorkspace.

findView(title: str)Pro.UI.ProView

Finds a view from its title.

Parameters

title (str) – The title of the view to find.

Returns

Returns the view if present; otherwise returns an invalid view.

Return type

ProView

See also ProView.

static fromView(view: Pro.UI.ProView)Pro.UI.ProContext

Retrieves the context from a view.

Parameters

view (ProView) – The view for which to retrieve the context.

Returns

Returns the context.

Return type

ProContext

getCurrentAnalysisView()Pro.UI.ProView
Returns

Returns the view of the current analysis view if any; otherwise returns an invalid view.

Return type

ProView

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also getCurrentView() and ProView.

getCurrentView()Pro.UI.ProView
Returns

Returns the current view if any; otherwise returns an invalid view.

Return type

ProView

See also getCurrentAnalysisView() and ProView.

getCurrentWorkspace()Pro.UI.ProWorkspace
Returns

Returns the current workspace if available; otherwise returns an invalid workspace.

Return type

ProWorkspace

See also ProWorkspace.

getExistingDirectory(title: str = str(), dir: str = str())str

Asks the user to select a directory.

Parameters
  • title (str) – The title of the dialog.

  • dir (str) – The initial folder.

Returns

Returns the directory name if successful; otherwise returns an empty string.

Return type

str

See also getOpenFileName() and getSaveFileName().

getOpenFileName(title: str = str(), dir: str = str(), filter: str = str())str

Asks the user to select a file.

Parameters
  • title (str) – The title of the dialog.

  • dir (str) – The initial file or directory.

  • filter (str) – The file extension filter (e.g. "Text files (*.txt)").

Returns

Returns the file name if successful; otherwise returns an empty string.

Return type

str

See also getSaveFileName() and getExistingDirectory().

getPDBDownloadOptions(opt: Pro.UI.ProPDBDownloadOptions)bool

Retrieves the options for downloading PDB files.

Parameters

opt (ProPDBDownloadOptions) – The options to retrieve.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also ProPDBDownloadOptions and PDBAssociationInfo.

getSaveFileName(title: str = str(), dir: str = str(), filter: str = str())str

Asks the user where to save a file.

Parameters
  • title (str) – The title of the dialog.

  • dir (str) – The initial file or directory.

  • filter (str) – The file extension filter (e.g. "Text files (*.txt)").

Returns

Returns the file name if successful; otherwise returns an empty string.

Return type

str

See also getOpenFileName() and getExistingDirectory().

hexJump(offset: int, flags: int = 0)None

Jumps to a specified position in the main hex view for the file being analyzed.

Note

This method works only if called from the context of the analysis workspace.

Parameters
  • offset (int) – The offset at which to jump.

  • flags (int) – The options for the jump (e.g., HexJumpBehavior_OpenNew).

See also HexJumpBehavior_OpenNew and HexJumpType_Raw.

makeFileTitle(prefix: str)str

Creates a view title from the currently open file.

Parameters

prefix (str) – The prefix which comes before the name of the file.

Returns

Returns the created view title.

Return type

str

See also createView() and addView().

msgBox(type: int, caption: str, title: str = str())int

Shows a message box to the user.

If the UI is not available, a message is printed to the output.

Parameters
  • type (int) – The options for the message box (e.g., MBIconInfo).

  • caption (str) – The caption of the message box.

  • title (str) – The title of the message box.

Returns

Returns 1 if either the OK or Yes button have been pressed; otherwise returns 0. Alternatively, always returns 1 if the UI is not available.

Return type

int

See also MBIconInfo, MBIconWarn, MBYesNo and MBOkCancel.

openDirectoryInFileManager(path: str)None

Opens a directory using the system file manager.

Parameters

path (str) – The path of the directory to open.

startWait(label: str, flags: int = 0)Pro.UI.ProWait

Shows a wait-dialog.

ProWait is the UI implementation of NTIWait.

Parameters
  • label (str) – The label of the wait-dialog.

  • flags (int) – The flags (e.g., NTIWait.NoProgress).

Returns

Returns the handle to the created wait-dialog.

Return type

ProWait

See also NTIWait.

class ProCustomView

Bases: Pro.UI.ProView

This class represents a custom view.

The notifications for this view are:

  • pvnInit - Emitted when the custom view is initialized.

  • pvnClose - Emitted when the custom view is destroyed.

  • pvnShow - Emitted when the custom view is shown to the user.

See also ProContext.createView().

getView(id: int)Pro.UI.ProView

Retrieves a child view by its identifier.

Parameters

id (int) – The child view identifier.

Returns

Returns the requested view if successful; otherwise returns an invalid view.

Return type

ProView

See also ProView.isValid().

setup(utf8: str, cb: Optional[object] = None, ud: Optional[object] = None)bool

Initializes a custom view from a UI XML layout and sets its callback.

Parameters
  • utf8 (str) – The UI XML layout.

  • cb (object) – The callback of the custom view.

  • ud (object) – The user data passed to the callback.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

class ProDialog

Bases: Pro.UI.ProView

This class represents a dialog.

Dialogs are created around custom views:

from Pro.Core import *
from Pro.UI import *

c = NTContainer()
c.setData(b"Hello, world!")

ctx = proContext()
hv = ctx.createView(ProView.Type_Hex, "Title")
hv.setData(c)

dlg = ctx.createDialog(hv)
dlg.show()

The notifications for this view are:

Hint

The callback of the embedded custom view receives the notifications originating from the dialog.

See also ProContext.createDialog() and ProDialog.

static fromView(v: Pro.UI.ProView)Pro.UI.ProDialog

Retrieves the dialog in which the specified view is contained.

Parameters

v (ProView) – The child view of the dialog.

Returns

Returns the parent dialog if successful; otherwise returns an invalid dialog.

Return type

ProDialog

show()int

Shows the dialogs.

Returns

Returns the return code of the dialog.

Return type

int

class ProDock

Bases: Pro.UI.ProView

This class represent a dock view of a workspace.

See also ProWorkspace.createDock() and ProWorkspace.createStdDock().

class ProHexView

Bases: Pro.UI.ProView

This class represents a hex view.

See also ProContext.createView() and ProCustomView.

addressToOffset(address: int)int

Converts an address to an offset.

This method is to be used when the hex view displays non-contiguous data.

Parameters

address (int) – The address to convert.

Returns

Returns the converted offset if successful; otherwise returns INVALID_STREAM_OFFSET.

Return type

int

See also offsetToAddress().

getCurrentOffset()int
Returns

Returns the current offset.

Return type

int

See also setCurrentOffset().

getCursorColumn()int

Retrieves the cursor column.

Available values are:

  • 1 - Offset column.

  • 2 - Hex column.

  • 3 - Ascii column.

Returns

Returns the cursor column.

Return type

int

See also getCursorOffset().

getCursorOffset()int
Returns

Returns the offset of the cursor if successful; otherwise returns INVALID_STREAM_OFFSET.

Return type

int

See also getCursorColumn() and setCursorOffset().

getData()Pro.Core.NTContainer
Returns

Returns the data displayed by the hex view.

Return type

NTContainer

See also setData() and NTContainer.

getSelectedRange()Pro.Core.NTOffsetRange
Returns

Returns the selected range.

Return type

NTOffsetRange

See also ProView.hasSelection() and setSelectedRange().

getSize()int
Returns

Returns the size of the data displayed by the hex view.

Return type

int

See also getData().

layoutName()str
Returns

Returns the name of the associated layout if available; otherwise returns an empty string.

Return type

str

See also setLayoutName() and Layout.

offsetToAddress(offset: int)int

Converts an offset to an address.

This method is to be used when the hex view displays non-contiguous data.

Parameters

offset (int) – The offset to convert.

Returns

Returns the converted address if successful; otherwise returns INVALID_STREAM_OFFSET.

Return type

int

See also addressToOffset().

readBytes(offset: int, size: int)bytes

Reads a range of data from the hex view.

Parameters
  • offset (int) – The start offset of the range to read.

  • size (int) – The size of the range to read.

Returns

Returns the requested bytes if successful; otherwise returns an empty bytes object.

Return type

bytes

See also getData().

setAnalysisDelta(delta: int)None

Sets the analysis delta.

When a hex view is shown inside of an analysis view (see ScanProvider._scanViewData() and ScanProvider._formatViewData()) and displays a portion of the file being analyzed, this method can be called to let the view know that the displayed data is a portion of the main file/object.

The delta represents the start offset of the displayed data relative to the file/object being analyzed.

By calling this function, the hex view will automatically allow the loading of embedded child objects.

Parameters

delta (int) – The start offset of the data relative to the file/object being analyzed.

See also ScanProvider._scanViewData() and ScanProvider._formatViewData().

setBytes(bytes: bytes)bool

Sets the bytes to display in the hex view.

This is a convenience function which internally calls setData().

Parameters

bytes (bytes) – The bytes to display.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also setData().

setCurrentOffset(offset: int)None

Sets the current offset of the hex view.

Parameters

offset (int) – The offset to set.

See also getCurrentOffset().

setCursorOffset(offset: int, column: int = - 1)None

Sets the cursor offset and the column.

If the column is not specified, this method will preserve the current column.

Possible values for the column are:

  • 1 - Offset column.

  • 2 - Hex column.

  • 3 - Ascii column.

Parameters
  • offset (int) – The offset to set.

  • column (int) – The column to set.

See also getCursorOffset().

setData(data: Pro.Core.NTContainer)None

Sets the data to display in the hex view.

Parameters

data (NTContainer) – The data to display.

See also getData(), setBytes(), setFileName() and NTContainer.

setDataResizable(b: bool)None

Sets whether or not the data displayed by the hex view is resizable.

By default the data is not resizable.

Parameters

b (bool) – If True, the data will be resizable; otherwise it will not be resizable.

See also setData() and setEditable().

setEditable(b: bool)None

Sets whether or not the data displayed by the hex view is editable.

By default the data is not editable.

Parameters

b (bool) – If True, the data will be editable; otherwise it will be read-only.

See also setData() and setDataResizable().

setFileName(fname: str, readonly: bool = True)bool

Sets the file to display in the hex view.

This is a convenience function which internally calls setData().

Parameters
  • fname (str) – The name of the file to display.

  • readonly (bool) – If True, the file will not be editable; otherwise it will be editable.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also setData().

setLayoutName(name: str)None

Sets the associated layout.

Parameters

name (str) – The name of the layout to set.

See also layoutName() and Layout.

setSelectedRange(offset: int, size: int)bool

Sets the selected range.

Parameters
  • offset (int) – The start offset of the range.

  • size (int) – The size of the range.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also getSelectedRange() and ProView.hasSelection().

class ProInput

This class provides additional common dialogs to those provided by ProContext.

See also ProContext.

static askList(list: Pro.Core.NTStringList, title: str, deflt: int = - 1, label: str = str())int

Asks the user to choose an item from a list of provided items.

Example:

from Pro.Core import NTStringList
from Pro.UI import *

items = NTStringList()
for item in ("a", "b", "c"):
    items.append(item)

i = ProInput.askList(items, "Choose an item...")
if i != -1:
    print(items.at(i))
Parameters
  • list (NTStringList) – The list of items to choose from.

  • title (str) – The title of the dialog.

  • deflt (int) – The index of the initially selected item.

  • label (str) – The label of the dialog. Reserved for future use.

Returns

Returns the index of the selected item if successful; otherwise returns -1.

Return type

int

static askText(title: str, text: str = str(), label: str = str(), history_name: str = str())Optional[str]

Asks the user to insert a text value.

Hint

The difference between askText() and askTextEx() is that with the latter it is possible to specify a default value.

Parameters
  • title (str) – The title of the dialog.

  • text (str) – The text of the dialog. Reserved for future use.

  • label (str) – The label of the dialog. Reserved for future use.

  • history_name (str) – The history key for the value.

Returns

Returns the inserted text if successful; otherwise returns None.

Return type

Union[str, None]

See also askTextEx().

static askTextEx(dflt: str, title: str, text: str = str(), label: str = str(), history_name: str = str())Optional[str]

Asks the user to insert a text value.

Hint

The difference between askText() and askTextEx() is that with the latter it is possible to specify a default value.

Parameters
  • dflt (str) – The default input value.

  • title (str) – The title of the dialog.

  • text (str) – The text of the dialog. Reserved for future use.

  • label (str) – The label of the dialog. Reserved for future use.

  • history_name (str) – The history key for the value.

Returns

Returns the inserted text if successful; otherwise returns None.

Return type

Union[str, None]

See also askText().

static askValue(title: str, label: str = str(), min: int = int(), max: int = int(), history_name: str = str())Optional[int]

Asks the user to insert a numeric value.

Hint

The difference between askValue() and askValueEx() is that with the latter it is possible to specify a default value and the radix of the value.

Parameters
  • title (str) – The title of the dialog.

  • label (str) – The label of the dialog. Reserved for future use.

  • min (int) – The minimum allowed input value.

  • max (int) – The maximum allowed input value.

  • history_name (str) – The history key for the value.

Returns

Returns the inserted value if successful; otherwise returns None.

Return type

Union[int, None]

See also askValueEx().

static askValueEx(deflt: int, radix: int, title: str, label: str = str(), min: int = int(), max: int = int(), history_name: str = str())Optional[int]

Asks the user to insert a numeric value.

Hint

The difference between askValue() and askValueEx() is that with the latter it is possible to specify a default value and the radix of the value.

Parameters
  • deflt (int) – The default input value.

  • radix (int) – The radix of the value.

  • title (str) – The title of the dialog.

  • label (str) – The label of the dialog. Reserved for future use.

  • min (int) – The minimum allowed input value.

  • max (int) – The maximum allowed input value.

  • history_name (str) – The history key for the value.

Returns

Returns the inserted value if successful; otherwise returns None.

Return type

Union[int, None]

See also askValue().

class ProLabel

Bases: Pro.UI.ProView

This class represents a label control.

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also ProCustomView.

setAlignment(alignment: int)None

Sets the alignment for the contents of the label.

Parameters

alignment (int) – The alignment to set (see ProAlign).

See also ProAlign.

setIconSize(size: Pro.UI.ProUISize)None

Sets the size of the icon.

Parameters

size (ProUISize) – The icon size.

See also setLabelIcon().

setLabelIcon(icon: int)None

Sets the icon for the label.

Parameters

icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

See also setIconSize() and proAddPublicIcon().

setText(txt: str)None

Sets the text of the label.

Parameters

txt (str) – The text to set.

See also text().

text()str
Returns

Returns the text of the label.

Return type

str

See also setText().

ProLeftToolBarArea: Final[int]

Left tool-bar area.

See also meth:ProWorkspace.addToolBar.

class ProMediaView

Bases: Pro.UI.ProView

This class represents a media view.

The purpose of media views is to present images in a safe way to the user.

See also ProCustomView.

MediaType_Image: Final[int]

Image media type.

See also mediaType().

MediaType_Unknown: Final[int]

Unknown media type.

See also mediaType().

addImageFromBytes(bytes: bytes, format: str = str())bool

Adds an image to the view from a byte-array.

Parameters
  • bytes (bytes) – The byte-array containing the image.

  • format (str) – The format of the image.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also addImageFromFile().

addImageFromFile(fname: str, format: str = str())bool

Adds an image to the view from a file.

Parameters
  • fname (str) – The file name of the image.

  • format (str) – The format of the image.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also addImageFromBytes().

isReady()bool
Returns

Returns True if the view is ready to be presented to the user; otherwise returns False.

Return type

bool

See also setReady().

mediaType()int
Returns

Returns the current media type (e.g., MediaType_Image).

Return type

int

setReady(b: bool)None

Marks the view ready to be presented to the user.

Parameters

b (bool) – If True, marks the view ready to be presented to the user.

See also isReady().

class ProMenu

This class represents a UI menu.

See also pvnContextMenu, ProMenuBar and ProUIAction.

addAction(action: Pro.UI.ProUIAction)None

Adds a UI action to the menu.

Parameters

action (ProUIAction) – The action to add.

See also addSeparator() and addCopyAction().

addCopyAction(action: Pro.UI.ProUIAction)None

Adds a copy action to the menu.

The characteristics of copy actions is that they are grouped together with the default copy action of the view.

Parameters

action (ProUIAction) – The action to add.

See also addAction() and addSeparator().

addSeparator()None

Adds a separator to the menu.

See also addAction() and addCopyAction().

isNull()bool
Returns

Returns True if the menu is invalid; otherwise returns False.

Return type

bool

menu

The internal pointer to the menu.

class ProMenuBar

This class represents a menu-bar.

Only workspaces can have menu-bars (see ProWorkspace).

See also ProWorkspace, ProMenu and ProUIAction.

addAction(action: Pro.UI.ProUIAction)None

Adds a UI action to the menu-bar.

Parameters

action (ProUIAction) – The action to add.

See also addSeparator() and addMenu().

addMenu(title: str)Pro.UI.ProMenu

Adds a sub-menu to the menu-bar.

Parameters

title (str) – The title of the sub-menu.

Returns

Returns the sub-menu.

Return type

ProMenu

See also addAction() and addSeparator().

addSeparator()None

Adds a separator to the menu-bar.

See also addAction() and addMenu().

clear()None

Clears the menu-bar.

isNull()bool
Returns

Returns True if the menu-bar is invalid; otherwise returns False.

Return type

bool

menubar

The internal pointer to the menu-bar.

ProNoToolBarArea: Final[int]

Invalid tool-bar area.

See also meth:ProWorkspace.addToolBar.

class ProPDBDownloadOptions

This class contains the options to download PDB files.

See also ProContext.getPDBDownloadOptions() and PDBAssociationInfo.

path

The download path for the PDB files.

server

The server from which to retrieve the PDB files.

class ProPlotView

Bases: Pro.UI.ProView

This class represents a plot view.

The notifications for this view are:

See also ProCustomView.

FileSize: Final[int]

Scale type for file sizes.

See also setAxisScale().

addCurve(x: Pro.Core.NTDoubleVector, y: Pro.Core.NTDoubleVector)None

Adds a curve to the plot.

Parameters

See also setAxisScale().

enablePointSelection(b: bool = True)None

Enables point selection.

If enabled, the associated custom view callback receives pvnPlotPointSelected notifications.

Parameters

b (bool) – If True, enables point selection.

See also pvnPlotPointSelected.

getPlotTitle()str
Returns

Returns the title of the plot.

Return type

str

See also setPlotTitle().

setAxisScale(axis: int, min: float, max: float, step: float = 0, type: int = 0)None

Sets up the scale and type of an axis.

Parameters
  • axis (int) – The axis to set up (e.g., xBottom).

  • min (float) – The minimum size.

  • max (float) – The maximum size.

  • step (float) – The step size.

  • type (int) – The type of the scale (e.g., FileSize).

See also addCurve().

setPlotTitle(title: str)None

Sets the title of the plot.

Parameters

title (str) – The title to set.

See also getPlotTitle().

xBottom: Final[int]

Bottom axis.

See also setAxisScale().

xTop: Final[int]

Top axis.

See also setAxisScale().

yLeft: Final[int]

Left axis.

See also setAxisScale().

yRight: Final[int]

Right axis.

See also setAxisScale().

class ProPropertyEditor

Bases: Pro.UI.ProView

This class represents a property editor dialog.

The property editor dialog is shown by calling ProContext.askParams().

Example:

from Pro.Core import *
from Pro.UI import *

# the schema of the property editor
xml = """
<peditor title="Settings">
  <section label="General">
    <property id="0" label="Name" type="edit" value="object" />
    <property id="1" label="Size" type="static" value="(0,0)">
        <property id="2" label="Width" type="integer" value="0" signed="false" radix="10" align="0" maxbits="16" />
        <property id="3" label="Height" type="integer" value="0" signed="false" radix="10" align="0" maxbits="16" />
    </property>
  </section>

  <section label="Options">
    <property id="4" label="Word wrap" type="check" value="false" />
    <property id="5" label="Syntax" type="combo" value="1">
      <list>
        <i>JavaScript</i>
        <i>C++</i>
        <i>Pascal</i>
      </list>
    </property>
  </section>

  <section label="Files">
    <property id="6" label="Open file" type="open-file" value="C:\\test.txt" />
    <property id="7" label="Save file" type="save-file" value="C:\\test2.txt" />
    <property id="8" label="Select directory" type="open-directory" value="C:\\temp" />
  </section>

  <section label="Content">
    <property id="9" label="Text" type="text">
        <value>This \tis a\nsample text</value>
    </property>
  </section>

  <section id="20" label="Numbers">
    <property id="10" label="Base address" type="integer" value="401000" signed="false" radix="16" align="8" />
    <property id="11" label="Char" type="integer" value="127" signed="true" radix="10" align="0" maxbits="8" />
  </section>

</peditor>"""

def updateSize(pe):
    sz = "(" + str(pe.getValue(2)) + "," + str(pe.getValue(3)) + ")"
    pe.setValue(1, sz)

# the callback for the property editor
def paramsCallback(pe, id, userdata):
    print("changed: " + str(id) + " value: " + str(pe.getValue(id)))
    if id == ProPropertyEditor.Notification_Init:
        updateSize(pe)
    elif id == 2 or id == 3:
        updateSize(pe)
        pe.setValue(0, "test2")
        pe.setValue(5, 2)
        pe.setValue(10, 0x2000)
    elif id == 4:
        b = not pe.isVisible(20)
        pe.setVisible(20, b)
        # set or clear some errors to demonstrate how it works
        if not b:
            errors = NTIntList()
            for e in (6, 7):
                errors.append(e)
            pe.setErrors(errors)
        else:
            pe.clearErrors()
    return True

# show a property editor dialog
params = proContext().askParams(xml, "Test", paramsCallback, None)
# print out the returned values
it = params.iterator()
while it.hasNext():
    it.next()
    print("key:", str(it.key()), "value:", str(it.value()))

See also ProContext.askParams().

Notification_Close: Final[int]

Closing notification code.

See also Notification_Init.

Notification_Init: Final[int]

Initialization notification code.

See also Notification_Close.

Notification_PreInit: Final[int]

This notification code is reserved for future use.

See also Notification_Init and Notification_Close.

clearErrors()None

Clears the errors set by setErrors().

See also setErrors().

getStringValue(id: int)Optional[str]

Retrieves the value of a field as a string.

Parameters

id (int) – The id of the field for which to retrieve the value.

Returns

Returns the value of the field if successful; otherwise returns None.

Return type

Union[str, None]

See also setStringValue() and getValue().

getValue(id: int)Optional[Union[int, float, bool, bytes, str]]

Retrieves the value of a field.

Parameters

id (int) – The id of the field for which to retrieve the value.

Returns

Returns the value of the field if successful; otherwise returns None.

Return type

BasicType

See also setValue() and getStringValue().

isEnabled(id: int)bool

Returns the enabled status of a field of the property editor.

Parameters

id (int) – The id of the field.

Returns

Returns True if the field is enabled; otherwise returns False.

Return type

bool

See also setEnabled() and isVisible().

isVisible(id: int)bool

Returns the visibility status of a field of the property editor.

Parameters

id (int) – The id of the field.

Returns

Returns True if the field is visible; otherwise returns False.

Return type

bool

See also setVisible() and isEnabled().

setEnabled(id: int, b: bool)None

Sets the enabled status for a field of the property editor.

Parameters
  • id (int) – The id of the field for which to set the enabled status.

  • b (bool) – If False, disables the field.

See also isEnabled() and setVisible().

setErrors(ids: Pro.Core.NTIntList)None

Sets the errors for the property editor.

This method highlights the specified fields with the default error color.

Parameters

ids (NTIntList) – The list of field ids to highlight with the error color.

See also clearErrors().

setExtensions(id: int, ext: str)None

Sets the allowed file extensions for an open/save file field.

Parameters
  • id (int) – The id of the open/save file field.

  • ext (str) – The allowed extensions (e.g., "Images (*.png *.jpg *.bmp)").

See also setValue().

setStringValue(id: int, value: str)bool

Sets the value of a field of the property editor as a string.

Parameters
  • id (int) – The id of the field for which to set the value.

  • value (str) – The value to set.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also getStringValue() and setValue().

setValue(id: int, value: Optional[Union[int, float, bool, bytes, str]])bool

Sets the value of a field of the property editor.

Parameters
  • id (int) – The id of the field for which to set the value.

  • value (BasicType) – The value to set.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also getValue() and setStringValue().

setVisible(id: int, b: bool)None

Sets the visibility of a field of the property editor.

Parameters
  • id (int) – The id of the field for which to set the visibility.

  • b (bool) – If False, hides the field.

See also isVisible() and setEnabled().

class ProPushButton

Bases: Pro.UI.ProView

This class represents a button control.

The notifications for this control are:

See also ProCustomView().

setButtonIcon(icon: int)None

Sets the icon for the button.

Parameters

icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

Available since Cerbero Suite 5.0 and Cerbero Engine 2.0.

See also proAddPublicIcon().

setText(txt: str)None

Sets the button text.

Parameters

txt (str) – The button text.

See also text().

text()str
Returns

Returns the button text.

Return type

str

See also setText().

ProRightToolBarArea: Final[int]

Right tool-bar area.

See also meth:ProWorkspace.addToolBar.

class ProTabBar

Bases: Pro.UI.ProView

This class represents a tab bar.

The notifications for this control are:

Available since Cerbero Suite 5.0 and Cerbero Engine 2.0.

See also ProCustomView.

currentTab()int
Returns

Returns the index of the current tab.

Return type

int

See also setCurrentTab().

setCurrentTab(i: int)None

Sets the index of the current tab.

Parameters

i (int) – The tab index.

See also currentTab().

class ProTableView

Bases: Pro.UI.ProView

This class represents a table view.

Hint

The difference with ProCellTableView is that table views are optimized for having many rows and a limited number of columns, while cell table views are not as fast as table views, but they can have as many columns as rows.

The notifications for this view are:

See also ProCustomView and ProCellTableView.

displayFlags(fl: Pro.Core.CFFFlags, value: int, title: str)None

Shows the flags dialog box for a specific value.

Parameters
  • fl (CFFFlags) – The flags information structure.

  • value (int) – The flag value.

  • title (str) – The title of the dialog box.

See also CFFFlags.

getColumnCount()int
Returns

Returns the number of columns in the table.

Return type

int

See also setColumnCount() and getRowCount().

getColumnDelta()int
Returns

Returns the column delta.

Return type

int

See also setColumnDelta().

getColumnLabels()Pro.Core.NTStringList
Returns

Returns the column labels.

Return type

NTStringList

See also setColumnLabels() and NTStringList.

getColumnWidth(col: int)int

Retrieves the width of a column.

Parameters

col (int) – The column index.

Returns

Returns the column width if successful; otherwise returns 0.

Return type

int

See also setColumnWidth() and setColumnCWidth().

getItemText(row: int, column: int)str

Retrieves the text of a table item.

Parameters
  • row (int) – The table item row.

  • column (int) – The table item column.

Returns

Returns the table item text if successful; otherwise returns an empty string.

Return type

str

getPosition()int
Returns

Returns the vertical scroll position of the table.

Return type

int

See also setPosition().

getRowCount()int
Returns

Returns the number of rows in the table.

Return type

int

See also setRowCount() and getColumnCount().

getSQLColumns()str

Retrieves the SQL columns displayed by the table which were specified when setSQLTable() was called.

Important

This method can only be called on SQL table views.

Returns

Returns the SQL columns string.

Return type

str

See also setSQLTable() and getSQLCondition().

getSQLCondition()str

Retrieves the SQL condition used to filter the rows displayed by the table which was specified when setSQLTable() was called.

Important

This method can only be called on SQL table views.

Returns

Returns the SQL condition string.

Return type

str

See also setSQLTable() and getSQLColumns().

getSQLTable()str
Returns

Returns the currently selected SQL table if any; otherwise returns an empty string.

Return type

str

See also setSQLTable() and setSQLTableSelectVisible().

getSelectedColumn()int
Returns

Returns the selected column if successful; otherwise returns -1.

Return type

int

See also getSelectedRow(), setSelection() and setSelectedRow().

getSelectedRow()int
Returns

Returns the selected row if successful; otherwise returns -1.

Return type

int

See also getSelectedColumn(), setSelection() and setSelectedRow().

getSelectedText()Optional[str]
Returns

Returns the text of the selected item if any; otherwise returns None.

Return type

bool

See also ProView.hasSelection(), getSelectedColumn() and getSelectedRow().

getStruct()Pro.Core.CFFStruct
Returns

Returns the structure displayed by the table if present; otherwise returns an invalid structure.

Return type

CFFStruct

See also setStruct() and CFFStruct.

isSQLTableView()bool
Returns

Returns True if this is a SQL table view; otherwise returns False.

Return type

bool

See also setSQLite3Object() and setSQLTable().

setColumnCWidth(col: int, cw: int)None

Sets the width of a column in characters.

Parameters
  • col (int) – The column index.

  • cw (int) – The width to set.

See also setColumnWidth(), getColumnWidth() and updateColumnsWidth().

setColumnCount(columns: int)None

Sets the column count for the table.

Parameters

columns (int) – The number of columns to set.

See also getColumnCount() and setRowCount().

setColumnDelta(cd: int)None

Sets the number of initial reserved columns.

When used in conjunction with setStruct(), this method reserves a number of initial columns for own use. This is especially useful when the CFFStruct instance represents an array of structures: by calling this method it is possible to show additional information in the initial columns of the table.

Parameters

cd (int) – The number of columns to reserver for own use.

See also setStruct().

setColumnLabels(labels: Pro.Core.NTStringList)None

Sets the labels for the columns of the table.

Parameters

labels (NTStringList) – The column labels to set.

See also getColumnLabels(), updateColumnsWidth() and NTStringList.

setColumnWidth(col: int, w: int)None

Sets the width of a column in pixels.

Parameters
  • col (int) – The column index.

  • w (int) – The width to set.

See also setColumnCWidth(), getColumnWidth() and updateColumnsWidth().

setPosition(pos: int)None

Sets the vertical scroll position of the table.

Parameters

pos (int) – The position to set.

See also getPosition().

setRowCount(rows: int)None

Sets the row count for the table.

Parameters

rows (int) – The number of rows to set.

See also getRowCount() and setColumnCount().

setSQLTable(table: str, columns: str = str(), condition: str = str())bool

Specifies the SQL table to display in the table.

Important

This method can only be called on SQL table views.

Parameters
  • table (str) – The table to display.

  • columns (str) – The columns to display. The column names must be comma-separated.

  • condition (str) – The SQL condition to filter the rows to display.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also setSQLTableSelectVisible() and setSQLite3Object().

setSQLTableSelectVisible(b: bool)None

Sets whether the control to choose which table to display from the database is visible to the user.

Important

This method can only be called on SQL table views.

Parameters

b (bool) – If True, shows the table choose control to the user. By default, the control is hidden.

See also setSQLTable() and setSQLite3Object().

setSQLite3Object(obj: Pro.Core.CFFObject)None

Sets a SQLite3 object instance as the database of the table view.

Important

This method can only be called on SQL table views.

Parameters

obj (CFFObject) – The SQLite3 object instance.

See also setSQLTableSelectVisible() and setSQLTable().

setSelectedRow(row: int, ensure_visible: bool = True)None

Sets the selected row.

The difference with setSelection() is that this method doesn’t change the focused column.

Parameters
  • row (int) – The row to select.

  • ensure_visible (bool) – If True, ensures that the row is visible.

See also setSelection(), getSelectedRow() and getSelectedColumn().

setSelection(row: int, column: int, ensure_visible: bool = True)None

Sets the current item selection.

Parameters
  • row (int) – The row of the item to select.

  • column (int) – The column of the item to select.

  • ensure_visible (bool) – If True, ensures that the item is visible.

See also setSelectedRow(), getSelectedRow() and getSelectedColumn().

setStruct(s: Pro.Core.CFFStruct, mcount: int = - 1)None

Sets the structure to be displayed by the table.

The CFFStruct() can represent both a single structure as well as an array of structures.

Parameters
  • s (CFFStruct) – The structure or array of structures to display.

  • mcount (int) – The maximum of entries to show in case of an array of structures.

See also getStruct(), CFFStruct and setColumnDelta().

updateColumnsWidth()None

Resizes the columns according to the width of their labels.

See also setColumnLabels().

class ProTextBrowserView

Bases: Pro.UI.ProView

This class represents a text browser.

The methods of this class are not yet exposed to the SDK.

See also ProCustomView.

class ProTextLine

Bases: Pro.UI.ProView

This class represents a text line control.

The notifications for this control are:

See also ProCustomView.

setText(text: str)None

Sets the text of the control.

Parameters

text (str) – The text to set.

See also text().

text()str
Returns

Returns the text of the control.

Return type

str

See also setText().

class ProTextView

Bases: Pro.UI.ProView

This class represents a text view.

See also ProContext.createView() and ProCustomView.

disasmOptions()int
Returns

Returns the current disassembly options for the view (e.g., DisasmOpt_Opcodes).

Return type

int

See also setDisasmOptions().

getCursorPosition()int
Returns

Returns the position of the text cursor.

Return type

int

See also setCursorPosition().

getSelectedText()Optional[str]
Returns

Returns the selected text if successful; otherwise returns None.

Return type

Union[str, None]

See also setSelectedText() and setSelection().

getSelectionSize()int
Returns

Returns the size of the selected text.

Return type

int

See also getSelectionStart(), setSelection() and ProView.hasSelection().

getSelectionStart()int
Returns

Returns the start position of the selected text.

Return type

int

See also getSelectionSize(), setSelection() and ProView.hasSelection().

getText()Optional[str]
Returns

Returns the text of the view if successful; otherwise returns None.

Return type

Union[str, None]

See also getSelectedText(), setText() and setUndoableText().

setCursorPosition(pos: int)None

Sets the position of the text cursor.

Parameters

pos (int) – The position to set.

See also getCursorPosition().

setDisasmOptions(options: int)None

Sets the current disassembly options for the view.

Parameters

options (int) – The disassembly options to set (e.g., DisasmOpt_Opcodes).

See also disasmOptions().

setLanguage(name: str)None

Sets the highlighting rules for the text.

Currently supported languages are:

  • ActionScript2 - Highlighting for Adobe ActionScript2.

  • ActionScript3 - Highlighting for Adobe ActionScript3.

  • C/C++ - Highlighting for both C and C++.

  • Dalvik - Highlighting for Android Dalvik byte-code.

  • JavaByteCode - Highlighting for Java byte-code.

  • JavaScript - Highlighting for JavaScript.

  • Lua - Highlighting for Lua.

  • MachODyld - Highlighting for Mach-O dyld byte-code.

  • MSIL - Highlighting for .NET MSIL byte-code.

  • Python - Highlighting for Python.

  • TrueType - Highlighting for TrueType font byte-code.

  • Type1 - Highlighting for Type1 font byte-code.

  • VBA - Highlighting for VBA and VBS.

  • x86/64 - Highlighting for x86 and x64 assembly.

  • XML - Highlighting for XML.

Parameters

name (str) – The name of the language.

setSelectedText(text: str)bool

Inserts text at the current cursor position and replaces selected text.

Parameters

text (str) – The text to insert.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also getSelectedText(), setText() and setUndoableText().

setSelection(pos: int, size: int)None

Sets the text selection.

Parameters
  • pos (int) – The start position of the selection.

  • size (int) – The size of the selection.

See also ProView.hasSelection(), getSelectionStart() and getSelectionSize().

setText(text_or_text_stream: Union[Pro.Core.NTTextStringBuffer, str])bool

Sets the text of the view.

Contrary to setUndoableText(), this operation is not undoable.

Parameters

text_or_text_stream (Union[NTTextStringBuffer, str]) – The text to set.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also getText(), setSelectedText() and setUndoableText().

setUndoableText(text: str)bool

Sets the text of the view.

The user can undo this operation.

Parameters

text (str) – The text to set.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also getText(), setText() and setUndoableText().

class ProToolBar

This class represents a tool-bar.

Only workspaces can have tool-bars (see ProWorkspace).

See also ProWorkspace, ProUIAction and ProMenuBar.

addAction(action: Pro.UI.ProUIAction)None

Adds a UI action to the tool-bar.

Parameters

action (ProUIAction) – The action to add.

See also addSeparator().

addSeparator()None

Adds a separator to the tool-bar.

See also addAction().

isNull()bool
Returns

Returns True if the tool-bar is invalid; otherwise returns False.

Return type

bool

toolbar

The internal pointer to the tool-bar.

ProTopToolBarArea: Final[int]

Top tool-bar area.

See also meth:ProWorkspace.addToolBar.

class ProTreeIndex

This class represents an index of a custom tree view.

See also ProTreeView.

column

The column of the tree index.

See also row and id.

id

The identifier of the tree index.

This is a user-defined 32-bit unsigned integer.

See also row and column.

isValid()bool
Returns

Returns True if the index is valid; otherwise returns False.

Return type

bool

row

The row of the tree index.

See also column and id.

class ProTreeView

Bases: Pro.UI.ProView

This class represents a tree view.

There are two ways to create a tree view: either from a CFFDB or it can be a custom tree view.

In custom tree views the relationship between parent and child nodes of the tree must be handled by the callback of the view, while when constructing the tree view from a CFFDB this logic is handled automatically.

The notifications for custom tree views are:

The notifications for tree views built from a CFFDB are:

The following is an advanced example of a custom tree view:

from Pro.UI import *

def viewCallback(cv, tree_child_count, code, view, data):
    if code == pvnInit:
        # tree
        t = cv.getView(1)
        t.enableExpansionNotifications(True)
        return 1
    elif code == pvnTreeRowCount:
        # root?
        if not data.isValid():
            return 10
        # children of root items
        elif data.id == 0:
            return tree_child_count[data.row]
        return 0
    elif code == pvnTreeColumnCount:
        # root?
        if not data.isValid():
            return 1
        # children of root items
        elif data.id == 0:
            return 1
        return 0
    elif code == pvnTreeIndex:
        # root item?
        if not data.pidx.isValid():
            data.setItemId(0)
            return 1
        # child of root item
        elif data.pidx.id == 0:
            data.setItemId(data.pidx.row + 1)
            return 1
        return 0
    elif code == pvnTreeParent:
        if data.idx.id > 0:
            data.setParentIndex(data.idx.id - 1, 0, 0)
            return 1
        return 0
    elif code == pvnGetCustomTreeRow:
        if data.id == 0:
            data.setText(0, "parent")
        else:
            data.setText(0, "child")
    elif code == pvnCustomTreeRowSelected:
        if data:
            # data contains row, column, id
            print("selected tree item " + str(data.id))
    elif code == pvnCustomTreeItemExpanded:
        print("tree item expanded")
        # change number of children of root items
        if data.id == 0 and tree_child_count[data.row] == 1:
            t = cv.getView(1)
            t.rowsRemovalStart(data, 0, 0)
            tree_child_count[data.row] = 0
            t.rowsRemovalEnd()
            t.rowsInsertionStart(data, 0, 9)
            tree_child_count[data.row] = 10
            t.rowsInsertionEnd()
    return 0

ctx = proContext()
cv = ctx.createView(ProView.Type_Custom, "Test")
tree_child_count = [1] * 10
cv.setup("<ui><vlayout margin='0'><tree id='1'/></vlayout></ui>", viewCallback, tree_child_count)
ctx.addView(cv)

In the code a tree view with ten root nodes is created. Every root node has a single child node. When a root node is expanded, its child node is deleted and replaced with ten child nodes. The purpose of the example is to demonstrate the functionality of a dynamic custom tree view.

See also ProCustomView() and CFFDB.

collapseAll()None

Collapses all the nodes of the tree view.

See also expandAll().

enableExpansionNotifications(b: bool = True)None

Regulates the emission of node expansion notifications.

Parameters

b (bool) – If True, expansion notifications are emitted; otherwise expansion notifications are not emitted.

See also pvnCustomTreeItemExpanded and pvnTreeItemExpanded.

expandAll()None

Expands all the nodes of the tree view.

See also collapseAll().

getColumnLabels()Pro.Core.NTStringList
Returns

Returns the column labels.

Return type

NTStringList

See also setColumnLabels() and NTStringList.

getColumnWidth(col: int)int

Retrieves the width of a column.

Parameters

col (int) – The index of the column.

Returns

Returns the column with in pixels if successful; otherwise returns 0.

Return type

int

See also setColumnWidth() and setColumnCWidth().

getCustomSelectedIndex()Pro.UI.ProTreeIndex
Returns

Returns the selected index of a custom tree view if successful; otherwise returns an invalid index.

Return type

ProTreeIndex

See also setCustomSelectedIndex(), ProTreeIndex and ProView.hasSelection().

getDB()Pro.Core.CFFDB
Returns

Returns the CFFDB instance if available; otherwise returns an invalid CFFDB.

Return type

CFFDB

See also setDB() and CFFDB.

getSelectedIndex()int
Returns

Returns the CFFDB index of the selected tree node if successful; otherwise returns CFFDBInvalidIndex.

Return type

int

See also setSelectedIndex(), CFFDB and ProView.hasSelection().

parentIndex(idx: Pro.UI.ProTreeIndex)Pro.UI.ProTreeIndex

Retrieves the parent index of an item in a custom tree view.

Parameters

idx (ProTreeIndex) – The index for which to retrieve the parent index.

Returns

Returns the parent index.

Return type

ProTreeIndex

See also setSelectedIndex().

rowsInsertionEnd()None

Ends a row insertion operation in a custom tree.

See also rowsInsertionStart().

rowsInsertionStart(pidx: Pro.UI.ProTreeIndex, first: int, last: int)None

Starts a row insertion operation in a custom tree

Parameters
  • pidx (ProTreeIndex) – The index of the parent item.

  • first (int) – The index of the first row to be inserted.

  • last (int) – The index of the last row to be inserted.

See also rowsInsertionEnd().

rowsRemovalEnd()None

Ends a row removal operation in a custom tree.

See also rowsRemovalStart().

rowsRemovalStart(pidx: Pro.UI.ProTreeIndex, first: int, last: int)None

Starts a row removal operation in a custom tree

Parameters
  • pidx (ProTreeIndex) – The index of the parent item.

  • first (int) – The index of the first row to be removed.

  • last (int) – The index of the last row to be removed.

See also rowsRemovalEnd().

setColumnCWidth(col: int, cw: int)None

Sets the width of a column in characters.

Parameters
  • col (int) – The column index.

  • cw (int) – The width to set.

See also setColumnWidth() and getColumnWidth().

setColumnLabels(labels: Pro.Core.NTStringList)None

Sets the column labels.

Parameters

labels (NTStringList) – The column labels to set.

See also getColumnLabels().

setColumnWidth(col: int, w: int)None

Sets the width of a column in pixels.

Parameters
  • col (int) – The column index.

  • w (int) – The width to set.

See also setColumnCWidth() and getColumnWidth().

setCustomExpanded(idx: Pro.UI.ProTreeIndex, expand: bool, levels: Optional[int] = None)None

Expands or collapses a node in a custom tree view.

Optionally expands child levels of the specified node.

Parameters
  • idx (ProTreeIndex) – The index of the item to expand.

  • expand (bool) – If True, expands the node; otherwise collapses it.

  • levels (Optional[int]) – The number of child node levels to expand.

See also expandAll() and collapseAll().

setCustomSelectedIndex(idx: Pro.UI.ProTreeIndex)None

Selects an item in a custom tree view.

Parameters

idx (ProTreeIndex) – The index of item to select.

See also getCustomSelectedIndex(), ProTreeIndex and ProView.hasSelection().

setDB(db: Pro.Core.CFFDB)None

Initializes the tree view using a CFFDB instance.

Parameters

db (CFFDB) – The CFFDB instance.

See also getDB() and CFFDB.

setExpanded(idx: int, expand: bool, levels: Optional[int] = None)None

Expands or collapses a node in a CFFDB tree view.

Optionally expands child levels of the specified node.

Parameters
  • idx (int) – The CFFDB index of the tree node to expand.

  • expand (bool) – If True, expands the node; otherwise collapses it.

  • levels (Optional[int]) – The number of child node levels to expand.

See also expandAll() and collapseAll().

setSelectedIndex(idx: int)None

Selects an item in a CFFDB tree view.

Parameters

idx (int) – The CFFDB index of the tree node to select.

See also getSelectedIndex(), CFFDB and ProView.hasSelection().

class ProUIAction

This class represents a UI action.

A UI action can be associated to a view, menu or tool-bar.

Important

UI actions must not be confused with actions in the context of extensions!

Moreover, the view which created a UI action should delete it when it’s no longer used by calling free().

See also ProView.addAction().

action

The internal pointer to the action.

free()None

Deletes the action.

getText()str
Returns

Returns the text of the action.

Return type

str

See also setText().

isChecked()bool
Returns

Returns True if the action is checked; otherwise returns False.

Return type

bool

See also setChecked() and setCheckable().

isNull()bool
Returns

Returns True if the action is invalid; otherwise returns False.

Return type

bool

setCheckable(b: bool)None

Sets the checkable status of the action.

Parameters

b (bool) – If True, the action becomes checkable.

See also setChecked() and isChecked().

setChecked(b: bool)None

Sets the checked status of the action.

Hint

An action must be checkable before setting its checked status (see setCheckable()).

Parameters

b (bool) – If True, the action becomes checked.

See also isChecked() and setCheckable().

setEnabled(b: bool)None

Sets the enabled status of the action.

Parameters

b (bool) – If False, the action is disabled.

setIcon(icon: int)None

Sets the icon of the action.

Parameters

icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

See also proAddPublicIcon().

setShortcut(shortcut: str)None

Sets the keyboard shortcut for the action (e.g. Ctrl+K).

Parameters

shortcut (str) – The keyboard shortcut.

setText(text: str)None

Sets the text of the action.

Parameters

text (str) – The text to set.

See also getText().

setVisible(b: bool)None

Sets the visibility of the action.

Parameters

b (bool) – If False, the action is hidden.

class ProUIPoint(x: Optional[int] = None, y: Optional[int] = None)

This class contains the coordinates of a UI point.

Parameters
  • x (Optional[int]) – The x coordinate of the point.

  • y (Optional[int]) – The y coordinate of the point.

See also ProUISize and ProUIRect.

static fromBytes(b: bytes)Pro.UI.ProUIPoint

Converts a byte-array into a UI point.

Parameters

b (bytes) – The byte-array.

Returns

Returns the UI point if successful; otherwise returns a null UI point.

Return type

ProUIPoint

See also toBytes().

toBytes()bytes

Converts the UI point into a byte-array.

Returns

Returns the converted UI point.

Return type

bytes

See also fromBytes().

x

The x coordinate of the point.

See also y.

y

The y coordinate of the point.

See also x.

class ProUIRect(x: Optional[int] = None, y: Optional[int] = None, w: Optional[int] = None, h: Optional[int] = None)

This class contains the coordinates of a UI rect.

Parameters
  • x (Optional[int]) – The x coordinate of the rect.

  • y (Optional[int]) – The y coordinate of the rect.

  • w (Optional[int]) – The width of the rect.

  • h (Optional[int]) – The height of the rect.

See also ProUIPoint and ProUISize.

static fromBytes(b: bytes)Pro.UI.ProUIRect

Converts a byte-array into a UI rect.

Parameters

b (bytes) – The byte-array.

Returns

Returns the UI rect if successful; otherwise returns an empty UI rect.

Return type

ProUIRect

See also toBytes().

h

The height of the rect.

isEmpty()bool
Returns

Returns True if the rect is empty; otherwise returns False.

Return type

bool

toBytes()bytes

Converts the UI rect into a byte-array.

Returns

Returns the converted UI rect.

Return type

bytes

See also fromBytes().

w

The width of the rect.

x

The x coordinate of the rect.

y

The y coordinate of the rect.

class ProUISize(w: Optional[int] = None, h: Optional[int] = None)

This class contains the coordinates of a UI size.

Parameters
  • w (Optional[int]) – The width of the size.

  • h (Optional[int]) – The height of the size.

See also ProUIPoint and ProUIRect.

static fromBytes(b: bytes)Pro.UI.ProUISize

Converts a byte-array into a UI size.

Parameters

b (bytes) – The byte-array.

Returns

Returns the UI size if successful; otherwise returns an empty UI size.

Return type

ProUISize

See also toBytes().

h

The height of the size.

isEmpty()bool
Returns

Returns True if the size is empty; otherwise returns False.

Return type

bool

toBytes()bytes

Converts the UI size into a byte-array.

Returns

Returns the converted UI size.

Return type

bytes

See also fromBytes().

w

The width of the size.

class ProView

This is the base class for every view and control.

To create a new view ProContext.createView() must be used.

Hint

While some views can be created directly from ProContext.createView() (e.g., Type_Hex), the majority of sub-views and controls are only available in the context of custom views (Type_Custom).

The generic notifications that all view types may emit are:

See also ProContext.createView(), Type_Custom and ProCustomView.

Type_Carbon: Final[int]

Creates a Carbon disassembly view.

See also ProContext.createView() and ProCarbonView.

Type_CellTable: Final[int]

Creates a cell table view.

See also ProContext.createView() and ProCellTableView.

Type_Custom: Final[int]

Creates a custom view.

See also ProContext.createView() and ProCustomView.

Type_Hex: Final[int]

Creates a hex view.

See also ProContext.createView() and ProHexView.

Type_Media: Final[int]

Creates a media view.

See also ProContext.createView() and ProMediaView.

Type_Plot: Final[int]

Creates a plot view.

See also ProContext.createView() and ProPlotView.

Type_SqlTable: Final[int]

Creates a SQLite table view.

See also ProContext.createView() and ProTableView.

Type_Table: Final[int]

Creates a table view.

See also ProContext.createView() and ProTableView.

Type_Text: Final[int]

Creates a text view.

See also ProContext.createView() and ProTextView.

Type_TextBrowser: Final[int]

Creates a text browser view.

See also ProContext.createView() and ProTextBrowserView.

Type_Tree: Final[int]

Creates a tree view.

See also ProContext.createView() and ProTreeView.

addAction(cmd: int, label: str, shortcut: str = str(), icon: int = - 1)Pro.UI.ProUIAction

Adds a UI action to the view.

Parameters
  • cmd (int) – The custom identifier for the action.

  • label (str) – The text for the action.

  • shortcut (str) – The shortcut for the action (e.g. Ctrl+K).

  • icon (int) – The icon for the action. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

Returns

Returns a UI action if successful; otherwise returns an invalid UI action.

Return type

ProUIAction

See also ProUIAction.free() and ProUIAction.

addDependentView(view: Pro.UI.ProView)None

Adds a view as dependent from this view.

When the parent view is cleared or destroyed, the dependent view is also destroyed.

Note

Not all views support dependent views. At the moment only hex views (ProHexView) and Carbon disassembly views (ProCarbonView) support dependent views. In the future more parent view types will be supported.

Parameters

view (ProView) – The view to add and to make dependent from this view.

See also closeDependentView() and ProContext.addView().

clear()None

Clears the view.

close(r: int = 0)None

Closes the view.

If the view is the direct child of a dialog box, then it closes the dialog box and sets the return code.

Parameters

r (int) – The return code for the dialog box.

See also ProContext.addView() and ProDialog.

closeDependentView(view: Pro.UI.ProView)None

Closes a dependent view.

Parameters

view (ProView) – The dependent view to close.

See also addDependentView().

contextualHeaderDescription()str
Returns

Returns the description of the contextual header if available; otherwise returns an empty string.

Return type

str

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also contextualHeaderFileName().

contextualHeaderFileName()str
Returns

Returns the file name of the contextual header if available; otherwise returns an empty string.

Return type

str

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also contextualHeaderDescription().

ensureVisible(switch_to: bool = True)None

Ensures the visibility of the view.

Parameters

switch_to (bool) – If True, switches the focus to the view.

See also isVisible() and setEnabled().

static fromWidget(widget: object)Pro.UI.ProView

Creates a view from a Qt widget.

This method was implemented to work with PySide and is now obsolete.

Parameters

widget (object) – The Qt widget.

Returns

Returns the created view if successful; otherwise returns an invalid view.

Return type

ProView

See also ProContext.createViewFromWidget() and ProContext.createView().

getBgColor()int
Returns

Returns the background color of the view.

Return type

int

getGeometry()Pro.UI.ProUIRect
Returns

Returns the geometry of the view.

Return type

ProUIRect

See also setGeometry() and isMaximized().

getName()str
Returns

Returns the name of the view.

Return type

str

See also setName().

getTitle()str
Returns

Returns the title of the view.

Return type

str

See also setTitle().

getTypeName()str
Returns

Returns the internal type name of the view if any; otherwise returns an empty string.

Return type

str

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also setTypeName().

hasFocus()bool
Returns

Returns True if the view is focused; otherwise returns False.

Return type

bool

See also setFocus() and ensureVisible().

hasSelection()bool
Returns

Returns True if the view has a selection; otherwise returns False.

Return type

bool

id()int

Returns the unique identifier of the view.

This identifier is used in the context of custom views (ProCustomView) to identify the view.

Returns

Returns the identifier of the view.

Return type

int

See also ProCustomView.

isEnabled()bool
Returns

Returns True if the view is enabled; otherwise returns False.

Return type

bool

See also setEnabled() and isVisible().

isMaximized()bool
Returns

Returns True if the view is maximized; otherwise returns False.

Return type

bool

See also showMaximized() and getGeometry().

isValid()bool
Returns

Returns True if the view is valid; otherwise returns False.

Return type

bool

isVisible()bool
Returns

Returns True if the view is visible; otherwise returns False.

Return type

bool

See also setVisible() and ensureVisible().

setBold(b: bool)None

Sets the bold property of the view font.

Parameters

b (bool) – If True, the view font becomes bold.

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also setItalic().

setEnabled(b: bool)None

Sets the enabled status of the view.

Parameters

b (bool) – If True, enables the view; otherwise disables the view.

See also isEnabled() and ensureVisible().

setFocus()None

Sets the focus to the view.

See also hasFocus() and ensureVisible().

setGeometry(rc: Pro.UI.ProUIRect)None

Sets the geometry of the view.

Parameters

rc (ProUIRect) – The geometry to set.

See also getGeometry() and isMaximized().

setIcon(icon: int)None

Sets the icon of the view.

Parameters

icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

See also proAddPublicIcon().

setItalic(b: bool)None

Sets the italic property of the view font.

Parameters

b (bool) – If True, the view font becomes italic.

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also setBold().

setName(name: str)None

Sets the name of the view.

Parameters

name (str) – The name to set.

See also getName().

setTitle(title: str)None

Sets the title of the view.

Parameters

title (str) – The title to set.

See also getTitle().

setTypeName(type_name: str)None

Sets the internal type name of the view.

The type name is cleared when the view is reset.

Hint

The purpose of this property is to make a view identifiable to external code.

Parameters

type_name (str) – The type name to set.

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also getTypeName().

setVisible(b: bool)None

Sets the visibility of the view.

Parameters

b (bool) – If True, shows the view; otherwise hides the view.

See also isVisible() and ensureVisible().

showMaximized()None

Shows the view as maximized.

Hint

This method is works only for top-level windows.

See also isMaximized() and showNormal().

showNormal()None

Shows the view in its normal geometry.

Hint

This method is works only for top-level windows.

See also isMaximized() and showMaximized().

toWidget()object

Converts the view to a Qt widget.

This method was implemented to work with PySide and is now obsolete.

Returns

Returns the Qt widget if successful; otherwise returns None.

Return type

object

See also fromWidget().

tryToFindWindowTitle(dflt: str = str())str

Tries to find the top-level title for the current view.

Parameters

dflt (str) – The string to return in case a top-level title couldn’t be found.

Returns

Returns the top-level title if available; otherwise returns dflt.

Return type

str

type()SViewType
Returns

Returns the type of the view (e.g. Type_Text).

Return type

SViewType

See also ProContext.createView().

update()None

Redraws the view.

view

Internal pointer value for the view.

class ProWait

Bases: Pro.Core.NTIWait

This class provides the UI implementation of NTIWait in the shape of a wait dialog.

See also ProContext.startWait() and NTIWait.

class ProWorkspace

Bases: Pro.UI.ProView

This class represents a UI workspace.

Contrary to dialogs, workspace feature menu-bars, tool-bars and dock views

Important

Only one workspace at a time should exists in a process. This is a current limitation of working with workspaces. Therefore, when creating a workspace, as in the following example, it should be done from the context of a logic provider.

See also ProContext.createWorkspace().

StdActions_Layouts: Final[int]

Standard actions for layouts.

See also addStdActions().

StdActions_Run: Final[int]

Standard run actions.

See also addStdActions().

StdActions_Views: Final[int]

Standard actions for views.

See also addStdActions().

StdDock_Output: Final[int]

Standard output view dock.

See also createStdDock().

StdToolBar_CmdLine: Final[int]

Standard command-line tool-bar.

See also addStdToolBar().

StdToolBar_Layouts: Final[int]

Standard tool-bar for layouts.

See also addStdToolBar().

StdToolBar_Run: Final[int]

Standard run tool-bar.

See also addStdToolBar().

StdToolBar_Views: Final[int]

Standard tool-bar for views.

See also addStdToolBar().

addDock(dock: Pro.UI.ProDock, switch_to: bool = True, curtab: bool = False)None

Adds a dock view to the workspace.

Parameters
  • dock (ProDock) – The dock view to add.

  • switch_to (bool) – If True, switches the focus to the dock view to add.

  • curtab (bool) – If True, tabifies the dock view to add the currently focused dock view.

See also createDock() and createStdDock().

addStdActions(type: int)None

Adds a set of standard UI actions to the workspace.

Parameters

type (int) – The type of standard UI actions to add (e.g., StdActions_Views).

See also ProView.addAction(), addStdToolBar() and createStdDock().

addStdToolBar(type: int)Pro.UI.ProToolBar

Adds a standard tool-bar to the workspace.

Parameters

type (int) – The type of standard tool-bar to add (e.g., StdToolBar_Views).

Returns

Returns the standard tool-bar if successful; otherwise returns an invalid tool-bar.

Return type

ProToolBar

See also addToolBar(), addStdActions() and createStdDock().

addToolBar(name: str, title: str, current_area: ProToolBarArea = ProTopToolBarArea)ProToolBar

Adds a tool-bar to the workspace.

Parameters
  • name (str) – The name of the tool-bar.

  • title (str) – The title of the tool-bar.

  • current_area (ProToolBarArea) – The area of the workspace where to add the tool-bar (e.g., ProTopToolBarArea).

Returns

Returns the standard tool-bar if successful; otherwise returns an invalid tool-bar.

Return type

ProToolBar

See also addStdToolBar().

addView(view: Pro.UI.ProView, switch_to: bool = True, curtab: bool = False)Pro.UI.ProDock

Adds a view to the workspace.

Parameters
  • view (ProView) – The view to add.

  • switch_to (bool) – If True, switches the focus to the view to add.

  • curtab (bool) – If True, tabifies the view to add the currently focused view.

Returns

Returns the parent dock view.

Return type

ProDock

See also createDock() and addDock().

createDock(view: Pro.UI.ProView, name: str, title: str, icon: int = - 1)Pro.UI.ProDock

Creates a dock view from a specified view.

Parameters
  • view (ProView) – The child view.

  • name (str) – The name of the dock view. This name will be used when saving and restoring the layout of the workspace. This should be an alphanumeric name. If the name starts with a sharp character (#), the dock view will be hidden and not destroyed when closed by the user.

  • title (str) – The title of the dock view.

  • icon (int) – The icon of the dock view (e.g., PubIcon_Text).

Returns

Returns the created dock view.

Return type

ProDock

See also addDock() and createStdDock().

createStdDock(type: int)Pro.UI.ProDock

Creates a standard dock view.

Parameters

type (int) – The type of standard dock view (e.g., StdDock_Output).

Returns

Returns the created dock view if successful; otherwise returns an invalid dock view.

Return type

ProDock

See also addDock() and createDock().

getLayout(dflt_focus_name: str = str())bytes

Retrieves the layout of the dock views in the workspace.

Parameters

dflt_focus_name (str) – The name of the dock view which should obtain the focus when the layout is restored.

Returns

Returns the layout of the dock views.

Return type

bytes

See also restoreAppearance() and saveLayout().

menuBar()Pro.UI.ProMenuBar
Returns

Returns the menu-bar of the workspace.

Return type

ProMenuBar

See also ProMenuBar.

restoreAppearance(initial_layout: bytes = bytes())None

Restores the appearance of the workspace.

Parameters

initial_layout (bytes) – The initial layout of the dock views.

Hint

Developers can retrieve the layout of the dock views using getLayout().

The initial_layout parameter is available since Cerbero Suite 5.0 and Cerbero Engine 2.0.

See also getLayout() and saveLayout().

saveLayout(dflt_focus_name: str = str())None

Saves the layout of the dock views in the workspace.

Parameters

dflt_focus_name (str) – The name of the dock view which should obtain the focus when the layout is restored.

See also restoreAppearance() and getLayout().

setup(cb: Optional[object] = None, ud: Optional[object] = None)bool

Sets the callback for the workspace.

Parameters
  • cb (object) – The callback.

  • ud (object) – The user-data passed to the callback.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also ProContext.createWorkspace() and show().

show()None

Shows the workspace.

See also ProContext.createWorkspace() and setup().

PubIcon_Add: Final[int]

Identifier for the ‘add’ icon.

See also proAddPublicIcon().

PubIcon_AddBookmark: Final[int]

Identifier for the ‘add bookmark’ icon.

See also proAddPublicIcon().

PubIcon_AddColor: Final[int]

Identifier for the ‘add color’ icon.

See also proAddPublicIcon().

PubIcon_AddStructure: Final[int]

Identifier for the ‘add structure’ icon.

See also proAddPublicIcon().

PubIcon_AddressBook: Final[int]

Identifier for the ‘address book’ icon.

See also proAddPublicIcon().

PubIcon_Attachment: Final[int]

Identifier for the ‘attachment’ icon.

See also proAddPublicIcon().

PubIcon_BlueFlag: Final[int]

Identifier for the ‘blue flag’ icon.

See also proAddPublicIcon().

PubIcon_Bookmarks: Final[int]

Identifier for the ‘bookmarks’ icon.

See also proAddPublicIcon().

PubIcon_BookmarksPresent: Final[int]

Identifier for the ‘bookmarks present’ icon.

See also proAddPublicIcon().

PubIcon_Brush: Final[int]

Identifier for the ‘brush’ icon.

See also proAddPublicIcon().

PubIcon_Bulb: Final[int]

Identifier for the ‘light bulb’ icon.

See also proAddPublicIcon().

PubIcon_Carbon: Final[int]

Identifier for the ‘Carbon’ icon.

See also proAddPublicIcon().

PubIcon_CarbonAdd: Final[int]

Identifier for the ‘Carbon add’ icon.

See also proAddPublicIcon().

PubIcon_Certificate: Final[int]

Identifier for the ‘certificate’ icon.

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also proAddPublicIcon().

PubIcon_Class: Final[int]

Identifier for the ‘code class’ icon.

See also proAddPublicIcon().

PubIcon_Color: Final[int]

Identifier for the ‘color’ icon.

See also proAddPublicIcon().

PubIcon_Computer: Final[int]

Identifier for the ‘computer’ icon.

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also proAddPublicIcon().

PubIcon_Copy: Final[int]

Identifier for the ‘copy’ icon.

See also proAddPublicIcon().

PubIcon_Debug: Final[int]

Identifier for the ‘debug’ icon.

See also proAddPublicIcon().

PubIcon_Delete: Final[int]

Identifier for the ‘delete’ icon.

See also proAddPublicIcon().

PubIcon_Dir: Final[int]

Identifier for the ‘directory’ icon.

See also proAddPublicIcon().

PubIcon_Download: Final[int]

Identifier for the ‘download’ icon.

See also proAddPublicIcon().

PubIcon_Drive: Final[int]

Identifier for the ‘hard-drive’ icon.

See also proAddPublicIcon().

PubIcon_EditBookmark: Final[int]

Identifier for the ‘edit bookmark’ icon.

See also proAddPublicIcon().

PubIcon_Enum: Final[int]

Identifier for the ‘code enumerator’ icon.

See also proAddPublicIcon().

PubIcon_False: Final[int]

Identifier for the ‘false’ icon.

See also proAddPublicIcon().

PubIcon_Filter: Final[int]

Identifier for the ‘filter’ icon.

See also proAddPublicIcon().

PubIcon_Find: Final[int]

Identifier for the ‘find’ icon.

See also proAddPublicIcon().

PubIcon_FullScreen: Final[int]

Identifier for the ‘full-screen’ icon.

See also proAddPublicIcon().

PubIcon_Function: Final[int]

Identifier for the ‘code function’ icon.

See also proAddPublicIcon().

PubIcon_FunctionPrivate: Final[int]

Identifier for the ‘code private function’ icon.

See also proAddPublicIcon().

PubIcon_FunctionProtected: Final[int]

Identifier for the ‘code protected function’ icon.

See also proAddPublicIcon().

PubIcon_Geo: Final[int]

Identifier for the ‘geo-location’ icon.

See also proAddPublicIcon().

PubIcon_GhidraNativeUI: Final[int]

Identifier for the ‘Ghidra native UI’ icon.

See also proAddPublicIcon().

PubIcon_GlobalBookmarks: Final[int]

Identifier for the ‘global bookmarks’ icon.

See also proAddPublicIcon().

PubIcon_GlobalBookmarksPresent: Final[int]

Identifier for the ‘global bookmarks present’ icon.

See also proAddPublicIcon().

PubIcon_GlobalNotes: Final[int]

Identifier for the ‘global notes’ icon.

See also proAddPublicIcon().

PubIcon_GlobalNotesPresent: Final[int]

Identifier for the ‘global notes present’ icon.

See also proAddPublicIcon().

PubIcon_GoToReport: Final[int]

Identifier for the ‘go to report’ icon.

See also proAddPublicIcon().

PubIcon_GreenFlag: Final[int]

Identifier for the ‘green flag’ icon.

See also proAddPublicIcon().

PubIcon_Hammer: Final[int]

Identifier for the ‘hammer tool’ icon.

See also proAddPublicIcon().

PubIcon_HdrMgr: Final[int]

Identifier for the ‘Header Manager’ icon.

See also proAddPublicIcon().

PubIcon_HeaderManager: Final[int]

Identifier for the ‘Header Manager’ icon.

See also proAddPublicIcon().

PubIcon_Hex: Final[int]

Identifier for the ‘hex’ icon.

See also proAddPublicIcon().

PubIcon_HexAdd: Final[int]

Identifier for the ‘hex add’ icon.

See also proAddPublicIcon().

PubIcon_Item: Final[int]

Identifier for the ‘item’ icon.

See also proAddPublicIcon().

PubIcon_Item2: Final[int]

Identifier for the ‘item 2’ icon.

See also proAddPublicIcon().

PubIcon_JSDbg: Final[int]

Identifier for the ‘JavaScript Debugger’ icon.

See also proAddPublicIcon().

PubIcon_Key: Final[int]

Identifier for the ‘key’ icon.

See also proAddPublicIcon().

PubIcon_Layout: Final[int]

Identifier for the ‘layout’ icon.

See also proAddPublicIcon().

PubIcon_LayoutTable: Final[int]

Identifier for the ‘layout table’ icon.

See also proAddPublicIcon().

PubIcon_Namespace: Final[int]

Identifier for the ‘code namespace’ icon.

See also proAddPublicIcon().

PubIcon_NavigationBack: Final[int]

Identifier for the ‘navigation back’ icon.

See also proAddPublicIcon().

PubIcon_NavigationForth: Final[int]

Identifier for the ‘navigation forward’ icon.

See also proAddPublicIcon().

PubIcon_New: Final[int]

Identifier for the ‘new’ icon.

See also proAddPublicIcon().

PubIcon_NewAppInstance: Final[int]

Identifier for the ‘new application instance’ icon.

See also proAddPublicIcon().

PubIcon_NewGhidraNativeUI: Final[int]

Identifier for the ‘new Ghidra native UI’ icon.

See also proAddPublicIcon().

PubIcon_Notes: Final[int]

Identifier for the ‘notes’ icon.

See also proAddPublicIcon().

PubIcon_NotesPresent: Final[int]

Identifier for the ‘notes present’ icon.

See also proAddPublicIcon().

PubIcon_Open: Final[int]

Identifier for the ‘open’ icon.

See also proAddPublicIcon().

PubIcon_Package: Final[int]

Identifier for the ‘package’ icon.

Available since Cerbero Suite 5.1 and Cerbero Engine 2.1.

See also proAddPublicIcon().

PubIcon_Preview: Final[int]

Identifier for the ‘preview’ icon.

See also proAddPublicIcon().

PubIcon_Question: Final[int]

Identifier for the ‘question’ icon.

See also proAddPublicIcon().

PubIcon_Raw: Final[int]

Identifier for the ‘raw data’ icon.

See also proAddPublicIcon().

PubIcon_RedFlag: Final[int]

Identifier for the ‘red flag’ icon.

See also proAddPublicIcon().

PubIcon_Redo: Final[int]

Identifier for the ‘redo’ icon.

See also proAddPublicIcon().

PubIcon_Refresh: Final[int]

Identifier for the ‘refresh’ icon.

See also proAddPublicIcon().

PubIcon_Report: Final[int]

Identifier for the ‘report’ icon.

See also proAddPublicIcon().

PubIcon_ResetLayout: Final[int]

Identifier for the ‘reset layout’ icon.

See also proAddPublicIcon().

PubIcon_Roots: Final[int]

Identifier for the ‘roots’ icon.

See also proAddPublicIcon().

PubIcon_Run: Final[int]

Identifier for the ‘run’ icon.

See also proAddPublicIcon().

PubIcon_RunAction: Final[int]

Identifier for the ‘run action’ icon.

See also proAddPublicIcon().

PubIcon_RunScript: Final[int]

Identifier for the ‘run script’ icon.

See also proAddPublicIcon().

PubIcon_Save: Final[int]

Identifier for the ‘save’ icon.

See also proAddPublicIcon().

PubIcon_SaveLayout: Final[int]

Identifier for the ‘save layout’ icon.

See also proAddPublicIcon().

PubIcon_SaveProject: Final[int]

Identifier for the ‘save project’ icon.

See also proAddPublicIcon().

PubIcon_SaveReport: Final[int]

Identifier for the ‘save report’ icon.

See also proAddPublicIcon().

PubIcon_Scan: Final[int]

Identifier for the ‘scan’ icon.

See also proAddPublicIcon().

PubIcon_ScanActive: Final[int]

Identifier for the ‘scan active’ icon.

See also proAddPublicIcon().

PubIcon_ScanAdd: Final[int]

Identifier for the ‘scan add’ icon.

See also proAddPublicIcon().

PubIcon_ScanHand: Final[int]

Identifier for the ‘scan hand’ icon.

See also proAddPublicIcon().

PubIcon_ScriptEditorAdd: Final[int]

Identifier for the ‘script editor add’ icon.

See also proAddPublicIcon().

PubIcon_Shell: Final[int]

Identifier for the ‘shell’ icon.

See also proAddPublicIcon().

PubIcon_SingleView: Final[int]

Identifier for the ‘single view’ icon.

See also proAddPublicIcon().

PubIcon_Stats: Final[int]

Identifier for the ‘stats’ icon.

See also proAddPublicIcon().

PubIcon_Table: Final[int]

Identifier for the ‘table’ icon.

See also proAddPublicIcon().

PubIcon_Text: Final[int]

Identifier for the ‘text’ icon.

See also proAddPublicIcon().

PubIcon_TextAdd: Final[int]

Identifier for the ‘text add’ icon.

See also proAddPublicIcon().

PubIcon_Tool: Final[int]

Identifier for the ‘tool’ icon.

See also proAddPublicIcon().

PubIcon_TrashEmpty: Final[int]

Identifier for the ‘trash empty’ icon.

See also proAddPublicIcon().

PubIcon_Tree: Final[int]

Identifier for the ‘tree’ icon.

See also proAddPublicIcon().

PubIcon_True: Final[int]

Identifier for the ‘true’ icon.

See also proAddPublicIcon().

PubIcon_UAC: Final[int]

Identifier for the ‘User Account Control’ icon.

See also proAddPublicIcon().

PubIcon_Undo: Final[int]

Identifier for the ‘undo’ icon.

See also proAddPublicIcon().

PubIcon_Variable: Final[int]

Identifier for the ‘code variable’ icon.

See also proAddPublicIcon().

PubIcon_VariablePrivate: Final[int]

Identifier for the ‘code private variable’ icon.

See also proAddPublicIcon().

PubIcon_VariableProtected: Final[int]

Identifier for the ‘code protected variable’ icon.

See also proAddPublicIcon().

PubIcon_Warning: Final[int]

Identifier for the ‘warning’ icon.

See also proAddPublicIcon().

PubIcon_Web: Final[int]

Identifier for the ‘web’ icon.

See also proAddPublicIcon().

PubIcon_Window: Final[int]

Identifier for the ‘window’ icon.

See also proAddPublicIcon().

PubIcon_Windows: Final[int]

Identifier for the ‘windows’ icon.

See also proAddPublicIcon().

PubIcon_YellowFlag: Final[int]

Identifier for the ‘yellow flag’ icon.

See also proAddPublicIcon().

proAddPublicIcon(path: str)int

Adds an icon to the list of public icons.

Note

Once a public icon is no longer needed, it should be freed by calling proRemovePublicIcon().

Parameters

path (str) – The file name of the icon to add.

Returns

Returns the unique identifier of the public icon if successful; otherwise returns -1.

Return type

int

See also proRemovePublicIcon() and proAddPublicIconFromFile().

proAddPublicIconFromFile(fname: str)int

Adds the icon associated to a file to the list of public icons.

Note

Once a public icon is no longer needed, it should be freed by calling proRemovePublicIcon().

Parameters

fname (str) – The name of the file whose icon is to be added.

Returns

Returns the unique identifier of the public icon if successful; otherwise returns -1.

Return type

int

See also proRemovePublicIcon() and proAddPublicIcon().

proContext()Pro.UI.ProContext
Returns

Returns the global ProContext instance.

Return type

ProContext

See also ProContext.

proRemovePublicIcon(iid: int)None

Frees a public icon which was loaded using proAddPublicIcon() or proAddPublicIconFromFile().

Parameters

iid (int) – The unique identifier of the icon to free.

See also proAddPublicIcon() and proAddPublicIconFromFile().

pvnButtonClicked: Final[int]

Notification for when a button is clicked.

See also ProPushButton.

pvnCarbonDebugSymbolsLoaded: Final[int]

Notification to inform the dependent views of a Carbon disassembly view that debug symbols were loaded.

See also ProCarbonView.

pvnCellTableColumnCount: Final[int]

Notification to retrieve the number of columns in a cell table item.

The handler of this notification must return the number of columns in the cell table view.

See also ProCellTableView.

pvnCellTableGetHeader: Final[int]

Notification to retrieve the label of a cell table view header.

The associated data is pvnCellTableGetHeaderData.

See also pvnCellTableGetHeaderData and ProCellTableView.

class pvnCellTableGetHeaderData

This class contains the data associated to pvnCellTableGetHeader.

See also ProTabBar.

horizontal

If True, the request is for the horizontal header of the cell table view; otherwise it’s for the vertical header.

i

The index of the requested header section.

setText(t: str)None

Sets the text of the requested header section.

Parameters

t (str) – The text to set.

See also text().

text()str
Returns

Returns the text of requested header section.

Return type

str

See also setText().

pvnCellTableGetItem: Final[int]

Notification to retrieve the data of a cell table item.

The associated data is pvnCellTableGetItemData.

See also pvnCellTableGetItemData and ProCellTableView.

class pvnCellTableGetItemData

This class contains the data associated to pvnCellTableGetItem.

See also ProCellTableView.

column

The column of the item.

See also row.

row

The row of the item.

See also column.

setColor(color: int)None

Sets the requested item color.

This method can be called when processing the ProCellTableView.Data_BackgroundColor and ProCellTableView.Data_TextColor notifications.

Parameters

color (int) – The color to return.

setFontOptions(opt: int)None

Sets the item font options.

This method can be called when processing the ProCellTableView.Data_Font notification.

Parameters

opt (int) – The options for the font (e.g. ProCellTableView.Font_Bold).

setIcon(icon: int)None

Sets the item icon.

This method can be called when processing the ProCellTableView.Data_Icon notification.

Parameters

icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

See also proAddPublicIcon().

setText(t: str)None

Sets the item text.

This method can be called when processing the ProCellTableView.Data_Text and ProCellTableView.Data_EditText notifications.

Important

Both ProCellTableView.Data_Text and ProCellTableView.Data_EditText notifications should be implemented, even when the cell table view is not editable.

Parameters

t (str) – The item text.

setTextAlignment(align: int)None

Sets the item text.

This method can be called when processing the ProCellTableView.Data_TextAlignment notification.

Parameters

align (int) – The item text alignment (see ProAlign).

See also ProAlign.

type

The type of data requested (e.g. ProCellTableView.Data_Text).

pvnCellTableItemActivated: Final[int]

Notification for when an item is activated in a cell table view.

The associated data is pvnCellTableItemActivatedData.

See also pvnCellTableItemActivatedData and ProCellTableView.

class pvnCellTableItemActivatedData

This class contains the data associated to pvnCellTableItemActivated.

See also ProCellTableView.

column

The column of the activated item.

See also row.

row

The row of the activated item.

See also column.

pvnCellTableRowCount: Final[int]

Notification to retrieve the number of rows in a cell table item.

The handler of this notification must return the number of rows in the cell table view.

See also ProCellTableView.

pvnCellTableSelectionChanged: Final[int]

Notification for when the selection of a cell table view has changed.

See also ProCellTableView.

pvnCheckChanged: Final[int]

Notification for when the status of a check box has changed.

The associated data is pvnCheckChangedData.

See also pvnCheckChangedData and ProCheckBox.

class pvnCheckChangedData

This class contains the data associated to pvnCheckChanged.

See also ProCheckBox.

checked

This value is True when the check box is checked; otherwise it’s False.

pvnClose: Final[int]

Notification for when a custom view is destroyed.

See also ProCustomView.

pvnCloseDialog: Final[int]

Notification for when a dialog box is closed.

See also ProDialog.

pvnComboIndexChanged: Final[int]

Notification for when the current item in a combo box is changed.

The associated data is pvnComboIndexChangedData.

See also pvnComboIndexChangedData and ProComboBox.

class pvnComboIndexChangedData

This class contains the data associated to pvnComboIndexChanged.

See also ProComboBox.

index

The index of the current combo box item.

pvnComboTextChanged: Final[int]

Notification for when the text in an editable combo box is changed.

See also ProComboBox.

class pvnCommonRowData

Base class for other UI notification classes.

See also pvnGetTableRowData, pvnGetTreeRowData and pvnGetCustomTreeRowData.

bgColor(i: int)int

Retrieves the background color for an item in the row.

Parameters

i (int) – The item index.

Returns

Returns the background color.

Return type

int

See also hasBGColor() and setBgColor().

clear(i: int)None

Clears the data for an item in the row.

Parameters

i (int) – The item index.

See also isValid().

flags(i: int)int

Retrieves the flags for an item in the row.

Hint

The individual flags of an item can be checked using methods such as hasBGColor() or isValid().

Parameters

i (int) – The item index.

Returns

Returns the flags for the item.

Return type

int

See also isValid().

hasBGColor(i: int)bool

Checks whether an item in the row has a background color.

Parameters

i (int) – The item index.

Returns

Returns True if the item has a background color; otherwise returns False.

Return type

bool

See also bgColor() and setBgColor().

hasIcon(i: int)bool

Checks whether an item in the row has an icon.

Note

Icons are not yet supported by ProTableView, but they are supported by ProCellTableView.

Parameters

i (int) – The item index.

Returns

Returns True if the item has an icon; otherwise returns False.

Return type

bool

See also icon() and setIcon().

hasStrongBGColor(i: int)bool

Checks whether an item in the row has a strong background color.

Note

This method is reserved for future use.

Parameters

i (int) – The item index.

Returns

Returns True if the item has a strong background color; otherwise returns False.

Return type

bool

See also bgColor() and setBgColor().

icon(i: int)int

Retrieves the icon identifier of an item in the row.

Note

Icons are not yet supported by ProTableView, but they are supported by ProCellTableView.

Parameters

i (int) – The item index.

Returns

Retrieves the icon identifier if the item has an icon; otherwise returns -1.

Return type

int

See also hasIcon() and setIcon().

isValid(i: int)bool

Checks whether an item in the row is valid.

An item becomes valid by setting its text (see setText()).

Parameters

i (int) – The item index.

Returns

Returns True if the item is valid; otherwise returns False.

Return type

bool

See also clear() and setText().

setBgColor(i: int, color: int, strong: bool = True)None

Sets the background color for an item in the row.

Parameters
  • i (int) – The item index.

  • color (int) – The background color.

  • strong (bool) – This value is reserved for future use.

See also hasBGColor() and bgColor().

setBold(i: int, b: bool = True)None

Sets the bold text flag for an item in the row.

Parameters
  • i (int) – The item index.

  • b (bool) – If True, sets the bold text flag; otherwise removes the flag.

See also setText().

setIcon(i: int, icon: int)None

Sets the icon for an item in the row.

Note

Icons are not yet supported by ProTableView, but they are supported by ProCellTableView.

Parameters
  • i (int) – The item index.

  • icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

See also hasIcon() and icon().

setText(i: int, t: str)None

Sets the text for an item in the row.

Parameters
  • i (int) – The item index.

  • t (str) – The item text.

See also text() and isValid().

text(i: int)str

Retrieves the text of an item in the row.

Parameters

i (int) – The item index.

Returns

Returns the text of the item if available; otherwise returns an empty string.

Return type

str

See also setText().

pvnContextMenu: Final[int]

Notification for a context menu request.

The associated data is pvnContextMenuData.

See also pvnContextMenuData and ProView.

class pvnContextMenuData

This class contains the data associated to pvnContextMenu.

See also ProView.

menu

The instance of the ProMenu context menu.

See also ProMenu.

pvnCtrlReset: Final[int]

Notification for control reset.

See also ProView.

pvnCtrlSetup: Final[int]

Notification for control initialization.

See also ProView.

pvnCustomTreeItemActivated: Final[int]

Notification for when an item of a custom tree view was activated.

The associated data is pvnCustomTreeItemActivatedData.

See also pvnCustomTreeItemActivatedData and ProTreeView.

class pvnCustomTreeItemActivatedData

Bases: Pro.UI.ProTreeIndex

This class contains the data associated to pvnCustomTreeItemActivated.

See also ProTreeView.

pvnCustomTreeItemExpanded: Final[int]

Notification for when an item of a custom tree view was expanded.

The associated data is pvnCustomTreeItemExpandedData.

Note

ProTreeView.enableExpansionNotifications() must be called to receive this notification.

See also pvnCustomTreeItemExpandedData and ProTreeView.

class pvnCustomTreeItemExpandedData

Bases: Pro.UI.ProTreeIndex

This class contains the data associated to pvnCustomTreeItemExpanded.

See also ProTreeView.

pvnCustomTreeRowSelected: Final[int]

Notification for when the selected row has changed in a custom tree view.

The associated data is pvnCustomTreeRowSelectedData.

See also pvnCustomTreeRowSelectedData and ProTreeView.

class pvnCustomTreeRowSelectedData

Bases: Pro.UI.ProTreeIndex

This class contains the data associated to pvnCustomTreeRowSelected.

See also ProTreeView.

pvnExecuteAction: Final[int]

Notification for the execution of a UI action.

The associated data is pvnExecuteActionData.

See also pvnExecuteActionData and ProView.

class pvnExecuteActionData

This class contains the data associated to pvnExecuteAction.

See also ProView.

cmd

The identifier of the UI action.

pvnGetCustomTreeRow: Final[int]

Notification to retrieve the data for a row of a custom tree view.

The associated data is pvnGetCustomTreeRowData.

See also pvnGetCustomTreeRowData and ProTreeView.

class pvnGetCustomTreeRowData

Bases: Pro.UI.pvnCommonRowData

This class contains the data associated to pvnGetCustomTreeRow.

See also ProTreeView.

column

The column of the tree index.

See also row and id.

id

The identifier of the tree index.

This is a user-defined 32-bit unsigned integer.

See also row and column.

isValid()bool
Returns

Returns True if the index is valid; otherwise returns False.

Return type

bool

row

The row of the tree index.

See also column and id.

pvnGetTableRow: Final[int]

Notification to retrieve the data for a table view row.

The associated data is pvnGetTableRowData.

See also pvnGetTableRowData and ProTableView.

class pvnGetTableRowData

Bases: Pro.UI.pvnCommonRowData

This class contains the data associated to pvnGetTableRow.

See also pvnCommonRowData and ProTableView.

row

The row to retrieve.

pvnGetTableToolTip: Final[int]

Notification to retrieve the tool-tip data for a table view item.

The associated data is pvnGetTableToolTipData.

See also pvnGetTableToolTipData and ProTableView.

class pvnGetTableToolTipData

This class contains the data associated to pvnGetTableToolTip.

See also ProTableView.

bgColor()int

Retrieves the background color for the tool-tip.

Note

This method is reserved for future use.

Returns

Returns the background color.

Return type

int

See also hasBGColor() and setBgColor().

clear()None

Clears the data set.

column

The column of the table view item.

See also row.

flags()int

Retrieves the flags for the tool-tip.

. hint::

The individual flags can be checked using methods such as hasBGColor() or isValid().

Returns

Returns the flags for the tool-tip.

Return type

int

See also isValid().

hasBGColor()bool

Checks whether the tool-tip has a background color.

Note

This method is reserved for future use.

Returns

Returns True if the tool-tip has a background color; otherwise returns False.

Return type

bool

See also bgColor() and setBgColor().

hasIcon()bool

Checks whether the tool-tip has an icon.

Note

This method is reserved for future use.

Returns

Returns True if the tool-tip has an icon; otherwise returns False.

Return type

bool

See also icon() and setIcon().

hasStrongBGColor()bool

Checks whether the tool-tip has a strong background color.

Note

This method is reserved for future use.

Returns

Returns True if the tool-tip has a strong background color; otherwise returns

Return type

bool

See also bgColor() and setBgColor().

icon()int

Retrieves the icon identifier of the tool-tip.

Note

This method is reserved for future use.

Returns

Retrieves the icon identifier if the tool-tip has an icon; otherwise returns -1.

Return type

int

isValid()bool

Checks whether the tool-tip data is valid.

The tool-tip data becomes valid by setting its text (see setText()).

Returns

Returns True if the tool-tip is valid; otherwise returns False.

Return type

bool

See also clear() and setText().

row

The row of the table view item.

See also column.

setBgColor(color: int, strong: bool = True)None

Sets the background color for the tool-tip

Note

This method is reserved for future use.

Parameters
  • color (int) – The background color.

  • strong (bool) – This value is reserved for future use.

See also hasBGColor() and bgColor().

setBold(b: bool = True)None

Sets the bold text flag for the tool-tip.

Note

This method is reserved for future use.

Parameters

b (bool) – If True, sets the bold text flag; otherwise removes the flag.

See also setText().

setIcon(icon: int)None

Sets the icon for the tool-tip.

Note

This method is reserved for future use.

Parameters

icon (int) – The icon identifier. This can be a predefined icon (e.g., PubIcon_Text) or a custom icon (see proAddPublicIcon()).

See also hasIcon() and icon().

setText(t: str)None

Sets the text for the tool-tip.

Parameters

t (str) – The tool-tip text.

See also text() and isValid().

text()str

Retrieves the text of the tool-tip.

Returns

Returns the text of the tool-tip if available; otherwise returns an empty string.

Return type

str

See also setText().

pvnGetTreeRow: Final[int]

Notification used to retrieve the data for a row of a CFFDB tree view.

The associated data is pvnGetTreeRowData.

See also pvnGetTreeRowData and ProTreeView.

class pvnGetTreeRowData

Bases: Pro.UI.pvnCommonRowData

This class contains the data associated to pvnGetTreeRow.

See also ProTreeView.

index

The CFFDB index of the tree node of the row to retrieve.

pvnHexRangeColor: Final[int]

This notification is not yet exposed to the Python SDK.

See also ProHexView.

pvnInit: Final[int]

Notification for when a custom view is initialized.

See also ProCustomView.

pvnItemActivated: Final[int]

Notification for when an item is activated in a table view.

The associated data is pvnItemActivatedData.

See also pvnItemActivatedData and ProTableView.

class pvnItemActivatedData

This class contains the data associated to pvnItemActivated.

See also ProTableView.

column

The column of the activate item.

See also row.

row

The row of the activate item.

See also column.

pvnItemSelected: Final[int]

Notification for when an item is selected in a table view.

The associated data is pvnItemSelectedData.

See also pvnItemSelectedData and ProTableView.

class pvnItemSelectedData

This class contains the data associated to pvnItemSelected.

See also ProTableView.

column

The column of the selected item.

See also row.

row

The row of the selected item.

See also column.

pvnPlotPointSelected: Final[int]

Notification for a point selection in ProPlotView.

The associated data is pvnPlotPointSelectedData.

Important

In order to receive this notification, point selection must be enabled by calling ProPlotView.enablePointSelection().

See also pvnPlotPointSelectedData and ProPlotView.

class pvnPlotPointSelectedData

This class contains the data associated to pvnPlotPointSelected.

See also ProPlotView.

x

The x-coordinate of the point.

See also y.

y

The y-coordinate of the point.

See also x.

pvnRangeColor: Final[int]

This notification is not yet exposed to the Python SDK.

See also ProHexView.

pvnRangeDescription: Final[int]

This notification is not yet exposed to the Python SDK.

See also ProHexView.

pvnRangeValues: Final[int]

This notification is not yet exposed to the Python SDK.

See also ProHexView.

pvnRowSelected: Final[int]

Notification for when a row is selected in a ProTableView.

The associated data is pvnRowSelectedData.

See also pvnRowSelectedData and ProTableView.

class pvnRowSelectedData

This class contains the data associated to pvnRowSelected.

See also ProTableView.

row

The selected row.

pvnSaveMainSettings: Final[int]

This notification is sent to settings UI hooks to inform them that the user has saved the settings.

pvnShow: Final[int]

Notification for when a custom view is shown to the user.

See also ProCustomView.

pvnShowDialog: Final[int]

Notification for when a dialog box is first shown to the user.

See also ProDialog.

pvnTabChanged: Final[int]

Notification for a tab change in ProTabBar.

The associated data is pvnTabChangedData.

See also pvnTabChangedData and ProTabBar.

class pvnTabChangedData

This class contains the data associated to pvnTabChanged.

See also ProTabBar.

index

The index of the selected tab.

pvnTextLineEdited: Final[int]

Notification for when the text is changed in a text line control.

See also ProTextLine.

pvnTreeColumnCount: Final[int]

Notification used to retrieve the number child columns for an item of a custom tree view.

The associated data is pvnTreeColumnCountData.

The processing callback for this notification must return the number of child columns for the specified item.

See also pvnTreeColumnCountData and ProTreeView.

class pvnTreeColumnCountData

Bases: Pro.UI.ProTreeIndex

This class contains the data associated to pvnTreeColumnCount.

See also ProTreeView.

pvnTreeIndex: Final[int]

Notification used to retrieve the index information for an item of a custom tree view.

The associated data is pvnTreeIndexData.

See also pvnTreeIndexData and ProTreeView.

class pvnTreeIndexData

This class contains the data associated to pvnTreeIndex.

See also ProTreeView.

column

The column of the item.

See also row and pidx.

pidx

The parent index of the item.

See also ProTreeIndex, column and row.

row

The row of the item.

See also column and pidx.

setItemId(id: int)None

Sets the user-defined 32-bit unsigned integer identifier for the item.

Parameters

id (int) – The item identifier.

pvnTreeItemActivated: Final[int]

Notification for when an item of a CFFDB tree view was activated.

The associated data is pvnTreeItemActivatedData.

See also pvnTreeItemActivatedData and ProTreeView.

class pvnTreeItemActivatedData

This class contains the data associated to pvnTreeItemActivated.

See also ProTreeView.

index

The CFFDB index of the activated tree node.

pvnTreeItemExpanded: Final[int]

Notification for when an item of a CFFDB tree view was expanded.

The associated data is pvnTreeItemExpandedData.

Note

ProTreeView.enableExpansionNotifications() must be called to receive this notification.

See also pvnTreeItemExpandedData and ProTreeView.

class pvnTreeItemExpandedData

This class contains the data associated to pvnTreeItemExpanded.

See also ProTreeView.

index

The CFFDB index of the expanded tree node.

pvnTreeItemSelected: Final[int]

This notification is not yet exposed to the Python SDK.

See also ProTreeView.

pvnTreeParent: Final[int]

Notification used to retrieve the parent index information for an item of a custom tree view.

The associated data is pvnTreeParentData.

See also pvnTreeParentData and ProTreeView.

class pvnTreeParentData

This class contains the data associated to pvnTreeParent.

See also ProTreeView.

idx

The index item for which to retrieve the parent index information.

See also ProTreeIndex and setParentIndex().

setParentIndex(row: int, column: int, id: int)None

Sets the parent index information for the index specified by idx.

Parameters
  • row (int) – The row of the parent item.

  • column (int) – The column of the parent item.

  • id (int) – The user-defined 32-bit unsigned integer identifier of the parent item.

See also idx.

pvnTreeRowCount: Final[int]

Notification used to retrieve the number child rows for an item of a custom tree view.

The associated data is pvnTreeRowCountData.

The processing callback for this notification must return the number of child rows for the specified item.

See also pvnTreeRowCountData and ProTreeView.

class pvnTreeRowCountData

Bases: Pro.UI.ProTreeIndex

This class contains the data associated to pvnTreeRowCount.

See also ProTreeView.

pvnTreeRowSelected: Final[int]

Notification for when the selected row has changed in a CFFDB tree view.

The associated data is pvnTreeRowSelectedData.

See also pvnTreeRowSelectedData and ProTreeView.

class pvnTreeRowSelectedData

This class contains the data associated to pvnTreeRowSelected.

See also ProTreeView.

index

The CFFDB index of the selected tree node.