0 Votes

Common Graphics

Last modified by WikiBot on 2025/05/14 13:10

Common Graphics

Common Graphics (CG) is a graphical user interface (GUI) of Allegro Common Lisp. It is not a part of Common Lisp standard.

The following Common Graphics objects are available in IDA scripts:

  • Dialog items (widgets);
  • Menu items;
  • Fonts;
  • Colors (RGB structures);
  • Pixmap handles.

IDA Modeler uses dialog items (or widgets) defined in Common Graphics in two places:

  • When specifying field properties, it is possible (in Advanced dialog) to specify a particular widget class (attribute :widget) or some other attribute accepted by CG widgets;
  • When defining a script-based dialog.

Here is the list of CG widget classes:

 
lisp-group-box
static-text
editable-text
multi-line-editable-text
lisp-text
single-item-list
multi-item-list
combo-box
button
default-button
cancel-button
radio-button 
check-box 
static-picture 
picture-button
horizontal-scroll-bar 
vertical-scroll-bar
outline 
dropping-outline
header-control
trackbar
up-down-control
progress-indicator
grid-widget

Here is the widget classes defined in IDA Modeler

 
data-button
hyperlink
radio-list
ida-outline
outline-table
listview-control
treeview-control

Here is a list of common widget attributes and their values:

  
:available-p T or NIL
:background-color a RGB structure
:border :NONE, :PLAIN, :STATIC, :BLACK
:font a list (family face size style)
:foreground-color a RGB structure
:groupstart T or NIL
:help-string a string
:hidden-p T or NIL
:name any value; unique among the widgets of the dialog
:tabstop T or NIL
:title a string; for picture button – filename.
:value depends on widget class

Here is a list of specific widget attributes and their values:

  
:3d-style :SUNKEN, :RAISED, :SUNKEN-EDGE, :RAISED-EDGE, :2D (for lisp-group-box)
:buddy-side :LEFT, :RIGHT (up-down-control)
:buddy-widget a widget name (up-down-control)
:button-style-p T or NIL (tab-control, header-control)
:click-off :YES, :NO, NIL (for buttons)
:cluster a symbol common to all button in a group (for buttons, radio buttons)
:column-width a number (for multi-column list widgets)
:delayed T or NIL (for editable widgets, scrollbars, trackbar, up-down-control)
:direction :UP and :DOWN (for scrollbars, trackbar)
:draw-icons-p T or NIL (for outline widgets)
:draw-lines-p T or NIL (for outline widgets)
:draw-plus-minus-p T or NIL (for outline widgets)
:dropping T or NIL (for combo-box)
:editable-in-place-p T or NIL (for outline widgets)
:fixed-width-p T or NIL (tab-control)
:focus-on-click-p T or NIL (tab-control)
:increment a number (for scrollbars, trackbar)
:indentation a number (for outline widgets)
:justification :LEFT, :CENTER, :RIGHT (for text widgets)
:key a function or a script that gives the printable representation of the widget value (for combo-box and list widgets)
:multi-column-p T or NIL (for list widgets)
:multiple-selection-p T or NIL (for outline widgets)
:no-pointer-p T or NIL (for trackbar)
:orientation :VERTICAL, :HORIZONTAL (for trackbar, up-down-control)
:page-increment a number (for scrollbars, trackbar)
:password T or NIL (for editable widgets)
:ragged-right-p T or NIL (tab-control)
:range the list of values (for combo-box and list widgets)
(min max) (for scrollbars, progress indicator, trackbar, up-down-control)
the list of top-level outline items (for outline widget)
list of header-info structures (header-control)
list of tab-info structures (tab-control)
:read-only T or NIL (for editable widgets)
:scrollable NIL, :VERTICAL, :HORIZONTAL, T (for multi-line widgets)
:select-on-open-p T or NIL (for outline widgets)
:single-line-p T or NIL (tab-control)
:sort-predicate a function comparing two values (for outline widgets)
:stretching T or NIL (for pictures)
:tab-height a number (tab-control)
:tabs a list of tab positions (for list widgets and outlines)
:tab-width a number (tab-control)
:tick-frequency a number (for trackbar)
:tick-side :NONE, :LEFT, :TOP, :RIGHT, :BOTTOM, :BOTH (for trackbar)
:typable T or NIL (for combo-box)
:use-arrow-keys T or NIL (up-down-control)
:wrapping T or NIL (up-down-control)

Menu items are generated by calling function (make-menu-item [:key value] …).

Here is the list of supported keys and their values:

  
:name The value should be a string, symbol or a number. It provides the default for the :title argument.
:title The object to display. The value should be a string, symbol, character, number, or a pixmap handle. If a string, the ~ character has the special meaning of making the immediately following character a keyboard short cut.
If the title is "-" (i.e. a single dash), then the menu-item will act as a menu-item separator and be displayed as a horizontal line in the menu.
:selected-p If this slot is non-nil (the default is nil), a check will appear next to the item in the menu
:available-p If non-nil, the menu-item can be selected by the user. It defaults to t.
:value Is the value to be returned when the menu-item is selected.
:plist A property list for the menu-item This can be used to communicate information when the item is chosen.
:help-string A string, which documents the menu-item.