SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages
List of all members
SortedComponentUIHelper.SortedComponentUIHelper Class Reference

A mixin class to help simple components adapt to member edit conventions. More...

Inheritance diagram for SortedComponentUIHelper.SortedComponentUIHelper:
componentedit.ComponentUIHelper

Methods defined here:

def CreateUI
def Save
def __init__

Methods inherited from componentedit.ComponentUIHelper:

def Finalize
def IsValid
def Load
def Reset

Data descriptors inherited from componentedit.ComponentUIHelper:

def __dict__
 dictionary for instance variables (if defined)
def __weakref__
 list of weak references to the object (if defined)

Data and other attributes inherited from componentedit.ComponentUIHelper:

int default_label_width = 40

Additional Inherited Members

- Public Member Functions inherited from componentedit.ComponentUIHelper
- Static Public Attributes inherited from componentedit.ComponentUIHelper
int default_label_width = 40

Detailed Description

A mixin class to help simple components adapt to member edit conventions.

Component classes derived from this class can define methods decorated with "@leaf", which use the SDS/2 Dialog API to define their user interface. These methods will be used to populate leaves in the member edit screen. Each leaf method must return a model (as defined by the Dialog API) that will be used by that leaf's Subdialog.

The derived class should also provide a member called "column_title", a string which will be used to label the component's column.

ComponentUIHelper also provides obvious implementations for methods required by the member edit protocol, CreateUI, Load, Save, Reset, and Finalize, so component author's need not work about providing them (unless something move than the obvious implementation is required).

See Dialog documentation for more on creating user interfaces with the Dialog library.

Usage:

class MyComponent(ComponentUIHelper):
    def __init__(self):
        self.column_title = 'My Component'
        self.color = 'Red'

    @leaf("My Leaf", 0):
    def create_my_leaf(self, subdialog):
        subdialog.menu('color', ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'],
                       'Red', label="Color:")
        return [self]

Unlike the original, this class enforces order of creation. Each leaf is created in order of its sort key. This allows for inter leaf dependencies to be created.

In addition, a dictionary has been added to facilitate moving widget objects around between leaf methods.

Method resolution order

SortedComponentUIHelper
componentedit.ComponentUIHelper
builtin.object

Constructor & Destructor Documentation

def SortedComponentUIHelper.SortedComponentUIHelper.__init__ (   args)
 __init__(args)

Reimplemented from componentedit.ComponentUIHelper.

Member Function Documentation

def SortedComponentUIHelper.SortedComponentUIHelper.__dict__ (   args)

dictionary for instance variables (if defined)

Reimplemented from componentedit.ComponentUIHelper.

def SortedComponentUIHelper.SortedComponentUIHelper.__weakref__ (   args)

list of weak references to the object (if defined)

Reimplemented from componentedit.ComponentUIHelper.

def SortedComponentUIHelper.SortedComponentUIHelper.CreateUI (   args)
 CreateUI(args)

Reimplemented from componentedit.ComponentUIHelper.

def SortedComponentUIHelper.SortedComponentUIHelper.Finalize (   args)
 Calls the End method on all subdialogs created by this
 object.

Reimplemented from componentedit.ComponentUIHelper.

def SortedComponentUIHelper.SortedComponentUIHelper.IsValid (   args)
 Calls the IsValid method on all subdialogs created by this
 object.

Reimplemented from componentedit.ComponentUIHelper.

def SortedComponentUIHelper.SortedComponentUIHelper.Load (   args)
 Calls the load method of all subdialogs created by this
 object.

Reimplemented from componentedit.ComponentUIHelper.

def SortedComponentUIHelper.SortedComponentUIHelper.Reset (   args)
 Calls the reset method on all subdialogs created by this
 object.

Reimplemented from componentedit.ComponentUIHelper.

def SortedComponentUIHelper.SortedComponentUIHelper.Save (   args)
 Save(args)

Reimplemented from componentedit.ComponentUIHelper.

Member Data Documentation

int SortedComponentUIHelper.SortedComponentUIHelper.default_label_width = 40
static