| |
- ItemFactoryMixIn
- SequenceEditor
- wxToolBar(wxToolBarPtr)
-
- SequenceEditToolbar
class ItemFactoryMixIn |
|
Mix-in to provide default new-instance factory mechanisms
Each item in the editor factory should have a few features:
__name__ should be fairly readily recognisable to users
Should take 0 arguments to the constructor
Must return a mutable object
Should return an object which is registered with wxoo
for editing/modification via dialog/frame
Usage:
1) Override FactoriesForCollection to allow for configuration
of the factories on a per-collection basis (for instance, by
accessing the values from a collection attribute)
2) Just specify a static set of factories as factories
attribute of the class. |
|
Methods defined here:
- AddFactory(self, child)
- Add a Factory to the list of available factories
- ConfigureFactories(self, collection)
- Create the sequence of factories appropriate for a given collection
- FactoriesForCollection(self, collection)
- Customisation point: return tuple of factories for instance in the collection
The default implementation searches for a factory source in this order:
collection.Factories
collection.factories
self.Factories
self.factories
And adds all of the results together to get the final list of sources.
Each item may be either a tuple or a method taking 0 arguments and
returning a tuple. By convention, Factories should be the methods and
factories the static tuples.
- OnItemNew(self, event)
- Primary event handler for the ItemFactory
- Remove(self, child)
- Remove a Factory from the list of available factories
- SetupFactories(self)
- Must be called during initialisation
Data and other attributes defined here:
- factories = ()
|
class SequenceEditToolbar(wxToolBar) |
|
A toolbar for sequence editors |
|
- Method resolution order:
- SequenceEditToolbar
- wxToolBar
- wxToolBarPtr
- wxToolBarBasePtr
- wxControlPtr
- wxWindowPtr
- wxEvtHandlerPtr
- wxObjectPtr
Methods defined here:
- ConfigureForEditor(self, parent)
- Override to configure ALLOW_* properties for a given object
Normally you'd then call this method to get the actual configuration
of the controls done
- __init__(self, parent, id=-1, pos=wxPoint(-1, -1), size=wxSize(-1, -1), style=2097156, name='SequenceToolbar', editor=None)
Methods inherited from wxToolBarPtr:
- Create(self, *_args, **_kwargs)
- FindToolForPosition(self, *_args, **_kwargs)
- __repr__(self)
Methods inherited from wxToolBarBasePtr:
- AddCheckLabelTool(self, id, label, bitmap, bmpDisabled=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, shortHelp='', longHelp='', clientData=None)
- Add a check tool, i.e. a tool which can be toggled
- AddCheckTool(self, id, bitmap, bmpDisabled=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, shortHelp='', longHelp='', clientData=None)
- Add a check tool, i.e. a tool which can be toggled
- AddControl(self, *_args, **_kwargs)
- AddLabelTool(self, id, label, bitmap, bmpDisabled=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, kind=0, shortHelp='', longHelp='', clientData=None)
- The full AddTool() function.
If bmpDisabled is wxNullBitmap, a shadowed version of the normal bitmap
is created and used as the disabled image.
- AddRadioLabelTool(self, id, label, bitmap, bmpDisabled=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, shortHelp='', longHelp='', clientData=None)
- Add a radio tool, i.e. a tool which can be toggled and releases any
other toggled radio tools in the same group when it happens
- AddRadioTool(self, id, bitmap, bmpDisabled=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, shortHelp='', longHelp='', clientData=None)
- Add a radio tool, i.e. a tool which can be toggled and releases any
other toggled radio tools in the same group when it happens
- AddSeparator(self, *_args, **_kwargs)
- AddSimpleTool(self, id, bitmap, shortHelpString='', longHelpString='', isToggle=0)
- Old style method to add a tool to the toolbar.
- AddTool(self, id, bitmap, pushedBitmap=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, isToggle=0, clientData=None, shortHelpString='', longHelpString='')
- Old style method to add a tool to the toolbar.
- ClearTools(self, *_args, **_kwargs)
- DeleteTool(self, *_args, **_kwargs)
- DeleteToolByPos(self, *_args, **_kwargs)
- DoAddTool(self, *_args, **_kwargs)
- DoInsertTool(self, *_args, **_kwargs)
- EnableTool(self, *_args, **_kwargs)
- FindControl(self, *_args, **_kwargs)
- GetMargins(self, *_args, **_kwargs)
- GetMaxCols(self, *_args, **_kwargs)
- GetMaxRows(self, *_args, **_kwargs)
- GetToolBitmapSize(self, *_args, **_kwargs)
- GetToolClientData(self, *_args, **_kwargs)
- GetToolEnabled(self, *_args, **_kwargs)
- GetToolLongHelp(self, *_args, **_kwargs)
- GetToolMargins(self, *_args, **_kwargs)
- GetToolPacking(self, *_args, **_kwargs)
- GetToolSeparation(self, *_args, **_kwargs)
- GetToolShortHelp(self, *_args, **_kwargs)
- GetToolSize(self, *_args, **_kwargs)
- GetToolState(self, *_args, **_kwargs)
- InsertControl(self, *_args, **_kwargs)
- InsertLabelTool(self, pos, id, label, bitmap, bmpDisabled=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, kind=0, shortHelp='', longHelp='', clientData=None)
- Insert the new tool at the given position, if pos == GetToolsCount(), it
is equivalent to AddTool()
- InsertSeparator(self, *_args, **_kwargs)
- InsertSimpleTool(self, pos, id, bitmap, shortHelpString='', longHelpString='', isToggle=0)
- Old style method to insert a tool in the toolbar.
- InsertTool(self, pos, id, bitmap, pushedBitmap=<wxPython.gdi.wxBitmapPtr instance; proxy of C++ wxBitmap instance at _d82f70_wxBitmap_p>, isToggle=0, clientData=None, shortHelpString='', longHelpString='')
- Old style method to insert a tool in the toolbar.
- IsVertical(self, *_args, **_kwargs)
- Realize(self, *_args, **_kwargs)
- RemoveTool(self, *_args, **_kwargs)
- SetMargins(self, *_args, **_kwargs)
- SetMarginsXY(self, *_args, **_kwargs)
- SetMaxRowsCols(self, *_args, **_kwargs)
- SetRows(self, *_args, **_kwargs)
- SetToggle(self, *_args, **_kwargs)
- SetToolBitmapSize(self, *_args, **_kwargs)
- SetToolClientData(self, *_args, **_kwargs)
- SetToolLongHelp(self, *_args, **_kwargs)
- SetToolPacking(self, *_args, **_kwargs)
- SetToolSeparation(self, *_args, **_kwargs)
- SetToolShortHelp(self, *_args, **_kwargs)
- ToggleTool(self, *_args, **_kwargs)
Methods inherited from wxControlPtr:
- Command(self, *_args, **_kwargs)
- GetLabel(self, *_args, **_kwargs)
- SetLabel(self, *_args, **_kwargs)
Methods inherited from wxWindowPtr:
- AcceptsFocus(self, *_args, **_kwargs)
- AddChild(self, *_args, **_kwargs)
- CaptureMouse(self, *_args, **_kwargs)
- Center(self, *_args, **_kwargs)
- CenterOnParent(self, *_args, **_kwargs)
- CenterOnScreen(self, *_args, **_kwargs)
- Centre(self, *_args, **_kwargs)
- CentreOnParent(self, *_args, **_kwargs)
- CentreOnScreen(self, *_args, **_kwargs)
- Clear(self, *_args, **_kwargs)
- ClientToScreen(self, *_args, **_kwargs)
- ClientToScreenXY(self, *_args, **_kwargs)
- Close(self, *_args, **_kwargs)
- ConvertDialogPointToPixels(self, *_args, **_kwargs)
- ConvertDialogSizeToPixels(self, *_args, **_kwargs)
- ConvertPixelPointToDialog(self, *_args, **_kwargs)
- ConvertPixelSizeToDialog(self, *_args, **_kwargs)
- DLG_PNT(self, *_args, **_kwargs)
- DLG_SZE(self, *_args, **_kwargs)
- Destroy(self, *_args, **_kwargs)
- DestroyChildren(self, *_args, **_kwargs)
- Disable(self, *_args, **_kwargs)
- DragAcceptFiles(self, *_args, **_kwargs)
- Enable(self, *_args, **_kwargs)
- FindWindowById(self, *_args, **_kwargs)
- FindWindowByName(self, *_args, **_kwargs)
- Fit(self, *_args, **_kwargs)
- FitInside(self, *_args, **_kwargs)
- Freeze(self, *_args, **_kwargs)
- GetAcceleratorTable(self, *_args, **_kwargs)
- GetAdjustedBestSize(self, *_args, **_kwargs)
- GetAutoLayout(self, *_args, **_kwargs)
- GetBackgroundColour(self, *_args, **_kwargs)
- GetBestSize(self, *_args, **_kwargs)
- GetBestVirtualSize(self, *_args, **_kwargs)
- GetBorder(self, *_args, **_kwargs)
- GetCaret(self, *_args, **_kwargs)
- # replaces broken shadow method
- GetCharHeight(self, *_args, **_kwargs)
- GetCharWidth(self, *_args, **_kwargs)
- GetChildren(self, *_args, **_kwargs)
- GetClientAreaOrigin(self, *_args, **_kwargs)
- GetClientRect(self, *_args, **_kwargs)
- GetClientSize(self, *_args, **_kwargs)
- GetClientSizeTuple(self, *_args, **_kwargs)
- GetConstraints(self, *_args, **_kwargs)
- GetContainingSizer(self, *_args, **_kwargs)
- GetCursor(self, *_args, **_kwargs)
- GetDefaultItem(self, *_args, **_kwargs)
- GetDropTarget(self, *_args, **_kwargs)
- GetEventHandler(self, *_args, **_kwargs)
- GetFont(self, *_args, **_kwargs)
- GetForegroundColour(self, *_args, **_kwargs)
- GetFullTextExtent(self, *_args, **_kwargs)
- GetGrandParent(self, *_args, **_kwargs)
- GetHandle(self, *_args, **_kwargs)
- GetHelpText(self, *_args, **_kwargs)
- GetId(self, *_args, **_kwargs)
- GetMaxSize(self, *_args, **_kwargs)
- GetName(self, *_args, **_kwargs)
- GetParent(self, *_args, **_kwargs)
- GetPosition(self, *_args, **_kwargs)
- GetPositionTuple(self, *_args, **_kwargs)
- GetRect(self, *_args, **_kwargs)
- GetScrollPos(self, *_args, **_kwargs)
- GetScrollRange(self, *_args, **_kwargs)
- GetScrollThumb(self, *_args, **_kwargs)
- GetSize(self, *_args, **_kwargs)
- GetSizeTuple(self, *_args, **_kwargs)
- GetSizer(self, *_args, **_kwargs)
- GetTextExtent(self, *_args, **_kwargs)
- GetThemeEnabled(self, *_args, **_kwargs)
- GetTitle(self, *_args, **_kwargs)
- GetToolTip(self, *_args, **_kwargs)
- GetUpdateRegion(self, *_args, **_kwargs)
- GetValidator(self, *_args, **_kwargs)
- GetVirtualSize(self, *_args, **_kwargs)
- GetVirtualSizeTuple(self, *_args, **_kwargs)
- GetWindowStyleFlag(self, *_args, **_kwargs)
- HasCapture(self, *_args, **_kwargs)
- HasScrollbar(self, *_args, **_kwargs)
- Hide(self, *_args, **_kwargs)
- HitTest(self, *_args, **_kwargs)
- InitDialog(self, *_args, **_kwargs)
- IsBeingDeleted(self, *_args, **_kwargs)
- IsEnabled(self, *_args, **_kwargs)
- IsExposed(self, *_args, **_kwargs)
- IsExposedPoint(self, *_args, **_kwargs)
- IsExposedRect(self, *_args, **_kwargs)
- IsRetained(self, *_args, **_kwargs)
- IsShown(self, *_args, **_kwargs)
- IsTopLevel(self, *_args, **_kwargs)
- Layout(self, *_args, **_kwargs)
- LineDown(self, *_args, **_kwargs)
- LineUp(self, *_args, **_kwargs)
- Lower(self, *_args, **_kwargs)
- MakeModal(self, *_args, **_kwargs)
- Move(self, *_args, **_kwargs)
- MoveXY(self, *_args, **_kwargs)
- OnPaint(self, *_args, **_kwargs)
- PageDown(self, *_args, **_kwargs)
- PageUp(self, *_args, **_kwargs)
- PopEventHandler(self, *_args, **_kwargs)
- PopupMenu(self, *_args, **_kwargs)
- PopupMenuXY(self, *_args, **_kwargs)
- PushEventHandler(self, *_args, **_kwargs)
- Raise(self, *_args, **_kwargs)
- Refresh(self, *_args, **_kwargs)
- RefreshRect(self, *_args, **_kwargs)
- ReleaseMouse(self, *_args, **_kwargs)
- RemoveChild(self, *_args, **_kwargs)
- RemoveEventHandler(self, *_args, **_kwargs)
- Reparent(self, *_args, **_kwargs)
- ScreenToClient(self, *_args, **_kwargs)
- ScreenToClientXY(self, *_args, **_kwargs)
- ScrollLines(self, *_args, **_kwargs)
- ScrollPages(self, *_args, **_kwargs)
- ScrollWindow(self, *_args, **_kwargs)
- SetAcceleratorTable(self, *_args, **_kwargs)
- SetAutoLayout(self, *_args, **_kwargs)
- SetBackgroundColour(self, *_args, **_kwargs)
- SetCaret(self, *_args, **_kwargs)
- SetClientSize(self, *_args, **_kwargs)
- SetClientSizeWH(self, *_args, **_kwargs)
- SetConstraints(self, *_args, **_kwargs)
- SetContainingSizer(self, *_args, **_kwargs)
- SetCursor(self, *_args, **_kwargs)
- SetDefaultItem(self, *_args, **_kwargs)
- SetDimensions(self, *_args, **_kwargs)
- SetDropTarget(self, *_args, **_kwargs)
- SetEventHandler(self, *_args, **_kwargs)
- SetExtraStyle(self, *_args, **_kwargs)
- SetFocus(self, *_args, **_kwargs)
- SetFocusFromKbd(self, *_args, **_kwargs)
- SetFont(self, *_args, **_kwargs)
- SetForegroundColour(self, *_args, **_kwargs)
- SetHelpText(self, *_args, **_kwargs)
- SetHelpTextForId(self, *_args, **_kwargs)
- SetId(self, *_args, **_kwargs)
- SetName(self, *_args, **_kwargs)
- SetPosition(self, *_args, **_kwargs)
- SetRect(self, *_args, **_kwargs)
- SetScrollPos(self, *_args, **_kwargs)
- SetScrollbar(self, *_args, **_kwargs)
- SetSize(self, *_args, **_kwargs)
- SetSizeHints(self, *_args, **_kwargs)
- SetSizer(self, *_args, **_kwargs)
- SetSizerAndFit(self, *_args, **_kwargs)
- SetThemeEnabled(self, *_args, **_kwargs)
- SetTitle(self, *_args, **_kwargs)
- SetTmpDefaultItem(self, *_args, **_kwargs)
- SetToolTip(self, *_args, **_kwargs)
- SetToolTipString(self, *_args, **_kwargs)
- SetValidator(self, *_args, **_kwargs)
- SetVirtualSize(self, *_args, **_kwargs)
- SetVirtualSizeHints(self, *_args, **_kwargs)
- SetVirtualSizeWH(self, *_args, **_kwargs)
- SetWindowStyle(self, *_args, **_kwargs)
- SetWindowStyleFlag(self, *_args, **_kwargs)
- Show(self, *_args, **_kwargs)
- Thaw(self, *_args, **_kwargs)
- TransferDataFromWindow(self, *_args, **_kwargs)
- TransferDataToWindow(self, *_args, **_kwargs)
- UnsetConstraints(self, *_args, **_kwargs)
- Update(self, *_args, **_kwargs)
- UpdateWindowUI(self, *_args, **_kwargs)
- Validate(self, *_args, **_kwargs)
- WarpPointer(self, *_args, **_kwargs)
Methods inherited from wxEvtHandlerPtr:
- AddPendingEvent(self, *_args, **_kwargs)
- Connect(self, *_args, **_kwargs)
- Disconnect(self, *_args, **_kwargs)
- GetEvtHandlerEnabled(self, *_args, **_kwargs)
- GetNextHandler(self, *_args, **_kwargs)
- GetPreviousHandler(self, *_args, **_kwargs)
- ProcessEvent(self, *_args, **_kwargs)
- SetEvtHandlerEnabled(self, *_args, **_kwargs)
- SetNextHandler(self, *_args, **_kwargs)
- SetPreviousHandler(self, *_args, **_kwargs)
Methods inherited from wxObjectPtr:
- GetClassName(self, *_args, **_kwargs)
|
class SequenceEditor |
|
Mix-in class providing sequence-editing semantics |
|
Methods defined here:
- AppendItem(self, item)
- Override to accomplish the appending of an item to the collection
default implementation is to call self.collection.append( item )
- BeforeDelete(self, indices)
- Customisation point, called before delete begins deletion, if you don't want to allow the delete, return a false value
- BuildControls(self, style=0)
- Layout internal controls (and initialise all internal structures)
- BuildPrimaryControl(self)
- Customisation Point: Build the primary editing/viewing control (e.g. a wxGrid)
- BuildToolbar(self, parent)
- ### Primary Customisation Points for End-User classes
- ConfigureForObject(self, object)
- Customisation point, configure the control for editing a given object
By default, we configure factories (if available),
then tell the toolbar to configure itself (enable/
disable buttons).
- ConfigureForSelection(self)
- Graphically configure the control for the selection of index
Should enable/disable appropriate controls
Should update status text to reflect selection
- DeleteItem(self, index)
- Override to accomplish the deletion of an item from the collection (default implementation does del collection[index])
- EnableDelete(self, value)
- EnableDown(self, value)
- EnableEdit(self, value)
- EnableNew(self, value)
- EnableUp(self, value)
- GetCollection(self)
- Override to return a pointer to the current collection/value
- GetCurrentSelection(self)
- Return indices of currently "selected" objects in the collection
- GetCurrentSelectionObjects(self)
- Return the actual objects in the collection for the current selection
- InsertItem(self, index, item)
- Override to accomplish the insertion of an item into the collection
default implementation is to call self.collection.insert( index, item )
- OnItemDelete(self, event)
- Handle the deletion of an object from the collection
- OnItemDown(self, event)
- Shift the currently selected objects downward (toward higher indices)
- OnItemEdit(self, event)
- Override to take an action when user requests that an item be "edited" (clicks "edit" button)
- OnItemNew(self, event)
- Override to take an action when user requests that an item be created (clicks new button)
- OnItemUp(self, event)
- Shift the currently selected objects upward (toward lower indices)
- OnSelectionChanged(self, event)
- Map your primary control's "selection-changed" event here.
The event need only arive, we will use the direct-get API to
access the new selection-set (this allows the same selection-changed handler
to work for a number of different types of controls w/out an extra
overriding point).
- RefreshView(self)
- Override to force a re-display of all values in your primary control (items may have been added/removed/changed)
- SetCollection(self, object)
- Set the current value (collection) to be edited by the view
- SetCurrentSelection(self, indices)
- Set the current selection programmatically
- ShiftItems(self, originalPositions, newPositions)
- Override to shift items from original to new positions (user clicks on up/down arrow)
Data and other attributes defined here:
- ALLOW_DELETE = 1
- ALLOW_EDIT = 1
- ALLOW_NEW = 1
- ALLOW_REORDER = 1
| |