dip.toolkits¶
The dip.toolkits module contains the toolkits
included with dip. The default toolkit uses PyQt4.
BaseToolkit¶
-
class
dip.toolkits.BaseToolkit¶ Base class:
ModelThe BaseToolkit class is a base class for toolkits that implements the default mapping of
dip.modeltypes to the editors used to handle them.-
attribute_type_to_declarative_factory_map = Tuple() A map of declarative factories to attribute types.
-
attribute_type_to_editor_factory_map = Tuple() A map of editor factories to attribute types.
-
declarative_factory_for_attribute_type(attribute_type)¶ Get an
EditorFactorysub-class that will create a factory that will create an editor to handle attributes of a particular type.Parameters: attribute_type – is the type of the attribute. Returns: the EditorFactorysub-class.
-
editor_factory_for_attribute_type(attribute_type)¶ Get a callable that will create a editor to handle attributes of a particular type.
Parameters: attribute_type – is the type of the attribute. Returns: the callable.
-
IToolkit¶
-
class
dip.toolkits.IToolkit¶ Base class:
InterfaceThe IToolkit interface defines the API to be implemented by a toolkit.
-
action(parent)¶ Create an action, i.e. an object that implements the
IActioninterface.Parameters: parent – is the optional parent view. Returns: the action.
-
application(argv, **properties)¶ Create a singleton application, i.e. an object that implements the
IApplicationinterface.Parameters: - argv – is the sequence of command line arguments.
- **properties – are the keyword arguments used as toolkit specific property names and values that are used to configure the application.
Returns: the application. Repeated calls must return the same application.
-
check_box(parent)¶ Create an editor that implements the
ICheckBoxinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
close_action()¶ Create an action, i.e. an object that implements the
IActioninterface, to handle closing an object.Returns: the action.
-
combo_box(parent)¶ Create an editor that implements the
IComboBoxinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
declarative_factory_for_attribute_type(attribute_type)¶ Get an
EditorFactorysub-class that will create a factory that will create an editor to handle attributes of a particular type.Parameters: attribute_type – is the type of the attribute. Returns: the EditorFactorysub-class.
-
designer_load(ui_file_name)¶ Load a file containing a user interface design.
Parameters: ui_file_name – is the name of the file. Returns: an opaque object that will be passed to designer_view().
-
designer_view(design, parent)¶ Create a view from a previously loaded user interface design.
Parameters: - design – is an opaque object returned by a previous call to
designer_load(). - parent – is the optional parent view.
Returns: the view.
- design – is an opaque object returned by a previous call to
-
dialog(parent)¶ Create a view that implements the
IDialoginterface.Parameters: parent – is the optional parent view. Returns: the view.
-
displayable(view)¶ Return a view that can be displayed as a top-level window.
Parameters: view – is the view to be displayed. Returns: the view, possibly wrapped so that it can be displayed.
-
dock(parent)¶ Create a view that implements the
IDockinterface..Parameters: parent – is the optional parent view. Returns: the view.
-
editor_factory_for_attribute_type(attribute_type)¶ Get a callable that will create a editor to handle attributes of a particular type.
Parameters: attribute_type – is the type of the attribute. Returns: the callable.
-
filesystem_location_editor(parent)¶ Create an editor that implements the
IFilesystemLocationEditorinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
find_toolkit_view(toolkit_root, id)¶ Find the toolkit view with a particular identifier.
Parameters: - toolkit_root – is the root toolkit view to begin the search.
- id – is the identifier of the view to search for.
Returns: the toolkit view. An exception will be raised if the view could not be found.
-
float_spin_box(parent)¶ Create an editor that implements the
IFloatSpinBoxinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
form(parent)¶ Create a view that implements the
IForminterface.Parameters: parent – is the optional parent view. Returns: the view.
-
get_open_file(window_title, directory='', filter='', parent=None)¶ Get the name of a file to open from the user.
Parameters: - window_title – is the window title, typically used as the title of a dialog.
- directory – is the name of an optional initial directory or file.
- filter – is the optional file filter.
- parent – is the optional parent view.
Returns: the name of the file to open or an empty string if there was none.
-
get_save_file(window_title, directory='', filter='', parent=None)¶ Get the name of a file to save from the user.
Parameters: - window_title – is the window title, typically used as the title of a dialog.
- directory – is the name of an optional initial directory or file.
- filter – is the optional file filter.
- parent – is the optional parent view.
Returns: the name of the file to save or an empty string if there was none.
-
grid(parent)¶ Create a view that implements the
IGridinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
group_box(parent)¶ Create a view that implements the
IGroupBoxinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
h_box(parent)¶ Create a view that implements the
IHBoxinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
information(window_title, text, parent)¶ Display a informational message to the user.
Parameters: - window_title – is the window title, typically used as the title of a dialog.
- text – is the text of the message.
- parent – is the optional parent view.
-
label(parent)¶ Create an editor that implements the
ILabelinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
line_editor(parent)¶ Create an editor that implements the
ILineEditorinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
list_editor(parent)¶ Create an editor that implements the
IListEditorinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
main_window(parent)¶ Create a view that implements the
IMainWindowinterface.Parameters: parent – is the optional parent view. Returns: the view.
Create a view that implements the
IMenuinterface.Parameters: parent – is the optional parent view. Returns: the view.
Create a view that implements the
IMenuBarinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
message_area(parent)¶ Create a view that implements the
IMessageAreainterface.Parameters: parent – is the optional parent view. Returns: the view.
-
new_action()¶ Create an action, i.e. an object that implements the
IActioninterface, to handle creating a new object.Returns: the action.
-
open_action()¶ Create an action, i.e. an object that implements the
IActioninterface, to handle opening an object.Returns: the action.
-
option_list(parent)¶ Create an editor that implements the
IOptionListinterface.Parameters: parent – is the optional parent view. Returns: the editor.
Create an editor that implements the
IPushButtoninterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
question(window_title, text, parent, detail, buttons)¶ Ask the user a question.
Parameters: - window_title – is the window title, typically used as the title of a dialog.
- text – is the text of the question.
- parent – is the optional parent view.
- detail – is the optional additional detail.
- buttons – is the sequence of buttons to display. Possible buttons are ‘yes’, ‘no’, ‘cancel’, ‘save’ and ‘discard’. The first in the sequence is used as the default.
Returns: The button that was pressed.
-
quit_action()¶ Create an action, i.e. an object that implements the
IActioninterface, to handle quitting the application.Returns: the action.
Create an editor that implements the
IRadioButtonsinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
save_action()¶ Create an action, i.e. an object that implements the
IActioninterface, to handle saving an object.Returns: the action.
-
save_as_action()¶ Create an action, i.e. an object that implements the
IActioninterface, to handle saving an object under a new name.Returns: the action.
-
settings(organization, application)¶ Create a settings object, i.e. an object that implements the
ISettingsStorageinterface.Parameters: - organization – the name of the organization.
- application – the name of the application.
Returns: the settings object.
-
spin_box(parent)¶ Create an editor that implements the
ISpinBoxinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
splitter(parent)¶ Create a view that implements the
ISplitterinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
storage_location_editor(parent)¶ Create an editor that implements the
IStorageLocationEditorinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
tab_bar(parent)¶ Create a view that implements the
ITabBarinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
tab_page(parent)¶ Create a view that implements the
ITabPageinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
table_editor(parent)¶ Create an editor that implements the
ITableEditorinterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
text_editor(parent)¶ Create an editor that implements the
ITextEditorinterface.Parameters: parent – is the optional parent view. Returns: the editor.
Create an editor that implements the
IToolButtoninterface.Parameters: parent – is the optional parent view. Returns: the editor.
-
v_box(parent)¶ Create a view that implements the
IVBoxinterface.Parameters: parent – is the optional parent view. Returns: the layout.
-
view_stack(parent)¶ Create a view that implements the
IViewStackinterface.Parameters: parent – is the optional parent view. Returns: the layout.
-
warning(window_title, text, parent, detail)¶ Display a warning message to the user.
Parameters: - window_title – is the window title, typically used as the title of a dialog.
- text – is the text of the warning.
- parent – is the optional parent view.
- detail – is the optional additional detail.
-
whats_this_action()¶ Create an action, i.e. an object that implements the
IActioninterface, to handle “What’s This?”.Returns: the action.
-
wizard(parent)¶ Create a view that implements the
IWizardinterface.Parameters: parent – is the optional parent view. Returns: the view.
-
wizard_page(parent)¶ Create a view that implements the
IWizardPageinterface.Parameters: parent – is the optional parent view. Returns: the view.
-