wxoo.propertycontrol
index
p:\wxproperties\wxoo\propertycontrol.py

Property-editing/Data-bound control class
 
This module implements the classic "data bound"
control mechanism.  Via a property descriptor
object, a control is found and then bound to a
particular object.  The property descriptor
determines the appropriate actions to take when
the control updates the value, and how to
retrieve the value for initialization.

 
Modules
       
wxoo.basecontrol
clip_dndc
cmndlgsc
wxoo.compositecontrol
controls2c
controlsc
wxoo.debug
wxoo.events
eventsc
filesysc
fontsc
framesc
gdic
imagec
logging
mdic
misc2c
miscc
printfwc
wxoo.propertydescriptor
sizersc
stattoolc
streamsc
sys
traceback
types
utilsc
windows2c
windows3c
windowsc
wxPython.wx
wxPython.wxc

 
Classes
       
CompositeControl(ContainerWindow, BaseControl)
PropertyControl

 
class PropertyControl(CompositeControl)
    A meta-control hosting a property-specific control
 
The property control is a window which surrounds a regular
value-editing control to provide property-editing semantics
in particular, a property descriptor object allows the
property control to edit a single property of the passed
"value".
 
 
Method resolution order:
PropertyControl
CompositeControl
ContainerWindow
BaseControl
wxControl
wxControlPtr
wxWindowPtr
wxEvtHandlerPtr
wxObjectPtr

Methods defined here:
Abort(self, write=0)
Abort changes (delete local cache of property value)
 
write -- if true, write the original value back to the
        object
 
After changes are aborted, the control will refresh
its value from the object, to ensure that the display
shows the current value.
AcquireValue(self)
Acquire the object's value for our property
 
This method uses the property object to retrieve
the current value of the property from the object.
 
This method does not look at the local cache, so the
value retrieved will be the "original" value if this
control has not yet committed.
CollectValue(self)
Determine our current value, respecting cache
 
This method is responsible for determining the current
value of the control from our sub-control, our cache,
and potentially the object itself.
Commit(self, value=[], force=1)
Commit (write current value to the object)
 
value -- if specified, commits the value specified,
        otherwise uses current value for our property
force -- if true, write regardless of whether the
        control is currently "dirty"
CreateControlParent(self, parent)
Create the window that serves as the control parent
CreateControls(self, style=0)
Create the sub-controls for the property control object
 
Will want:
        name of the property
        data type, preferably as icon
        background set to something dark
        a base wxPanel  to hold our currentControl
 
Would be nice to have:
        mechanism for choosing a different control from registered
        status information (e.g. whether there is undo/dirty
                data available)
        action buttons (undo, abort, commit, choose control)
CreateCurrentControl(self)
Create current control from our current descriptor
CreateDirtyIconDisplay(self, parent)
Create a type-icon control for display in the upper-left corner
CreateTitleText(self, parent)
Create the title-text control
 
Eventually this should include code for showing action menus
CreateTypeIconDisplay(self, parent)
Create a type-icon control for display in the upper-left corner
Dirty(self)
Return true if the property's value has changed
GetControl(self)
Get the current editing control or None
 
This is primarily for internal use
GetDescriptor(self)
Get the current property descriptor for the PropertyControl
 
This may return None if the property descriptor
does not currently have a descriptor.
OnActionMenu(self, event)
Deal with a request to show our action menu
OnControlValueChanged(self, event)
Record a value-changed event from our control
 
If we are auto-committing, we immediately call commit,
otherwise we append the value to our valueCache.
 
XXX should send a message telling our parent that we
        have been updated
SetDescriptor(self, descriptor=None)
Set the property descriptor for the PropertyControl
 
If the descriptor is not our current descriptor,
then we will need to destroy our current control,
then create a new control for the new descriptor.
 
Note that the current value will be edited with
the passed descriptor, so you need to make your
descriptors and editing classes fairly robust.
ShareValue(self, value=[])
Given the "value" object, share property value with children
 
This method is used to drive the low-level control
sharing with it our current value for editing.  This
value is calculated by CollectValue using our
valueCache to determine the appropriate value to share
Undo(self)
Step back one step in our history
__init__(self, parent, id=-1, value=[], pos=wxPoint(-1, -1), size=wxSize(-1, -1), choices=[], style=4718592, validator=<wxPython.windows.wxValidatorPtr instance; proxy...++ wxValidator instance at _d80928_wxValidator_p>, name='', descriptor=[], autoCommit=1)
Initialize the PropertyControl
 
parent, id, value, pos, size, choices, style, validator, name --
        passed to the superclass's initializer.
        
        Note: the value is the object whose property is to be edited,
                not the value of the property on the object. The
                descriptor will be used to retrieve/set the value.
descriptor -- a PropertyDescriptor object which defines the
        property to be edited by the control.
autoCommit -- if true, property-value changes will be written
        immediately to the object.  This is the default operation.
        
        if false, the PropertyControl will merely store the changed
        value until told to commit (or abort)

Data and other attributes defined here:
currentControl = None
lastError = None

Methods inherited from ContainerWindow:
GetControlContainer(self)
Get the current control-container object
GetDefaultItem(self)
return container.GetDefaultItem()
OnChildFocus(self, focusEvent)
container.SetLastFocus
OnFocus(self, focusEvent)
container.HandleOnFocus
OnNavigationKey(self, navigationKeyEvent)
container.HandleOnNavigationKey
RemoveChild(self, childWindow)
container.HandleOnWindowDestroy(child), then base
SetControlContainer(self, value)
Set the current control-container object
SetDefaultItem(self, childWindow)
container.SetDefaultItem(childWindow)
SetFocus(self)
container.DoSetFocus(), calls base SetFocus if that returns false
SetTmpDefaultItem(self, childWindow)
container.SetTmpDefaultItem(childWindow)

Data and other attributes inherited from ContainerWindow:
controlContainerClass = <class wxoo.wxcontrolcontainer.ControlContainer at 0x012BD720>
ControlContainer with ability to explicitly specify tab-order
 
This is a wxoo-specific tabbing-order control
container object.  It provides a simple mechanism
for explicitly setting the focus set through
which keyboard navigation will traverse.
 
XXX Should have API for manipulating the list:
 
        AppendFocusItem
        RemoveFocusItem
        InsertFocusItem
 
or
 
        Have GetFocusChildren set the focus children
        on default get to allow for direct manipulation
        of the list.  However, this is ideologically
        fuzzy, because it is not immediately clear
        whether the focus children should then be the
        whole children set, or merely an empty list
        to begin with.

Methods inherited from BaseControl:
GetChoices(self)
Customization point: Get the current choice-set
GetValue(self)
Customization point: Get current value from control
 
The implementation here merely retrieves the value by
returning RetrieveValue().
RetrieveChoices(self)
Customization point: Retrieve reference to choice-set
 
The point of this customization point is to allow,
for instance, storing only weak references within
the GUI to allow for re-acquiring references whenever
necessary.
RetrieveValue(self)
Customization point: Retrieve reference to edited value
 
The point of this customization point is to allow,
for instance, storing only weak references within
the GUI to allow for re-acquiring references whenever
necessary.
SaveChoices(self, value)
Customization point: Store reference to choice-set
 
The point of this customization point is to allow,
for instance, storing only weak references within
the GUI to allow for re-acquiring references whenever
necessary.
SaveValue(self, value)
Customization point: Store reference to the value
 
The point of this customization point is to allow,
for instance, storing only weak references within
the GUI to allow for re-acquiring references whenever
necessary.
SendValueChanged(self, value, previous=[])
Send a value-changed message if appropriate for value and previous
 
Sends the message if previous is not __NULL_VALUE__ and
previous is not equal to value.  "Equality" is dependent
on the compareIdentity member.  If true, then uses
        value is previous
otherwise uses:
        value != previous
SetChoices(self, choices)
Customization point: Set the current choice-set
SetValue(self, value)
Customization point: Set current value for control
 
implementation here stores value by calling
        SaveValue(value)
 
Calls SendValueChanged( value, previous )
ShareChoices(self, value)
Customization point: Share new value with sub-controls
__repr__(self)

Data and other attributes inherited from BaseControl:
choices = ()
compareIdentity = 0
currentValue = []

Methods inherited from wxControlPtr:
Command(self, *_args, **_kwargs)
Create(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)
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)
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)
SetDimensions(self, *_args, **_kwargs)
SetDropTarget(self, *_args, **_kwargs)
SetEventHandler(self, *_args, **_kwargs)
SetExtraStyle(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)
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)

 
Data
        DEBUG = 10
ERROR = 40
INFO = 20
WARN = 30