New API reference documentation is available for testing at http://thewinecellarbook.com/daboDocTestAlt/. Please report any problems or suggestions on the dabo-users mailing list.
Application
Read-only object reference to the Dabo Application object. (dApp). (inherited from dObject) |
BackColor
Color of the box background (str or tuple) |
BaseClass
The base Dabo class of the object. Read-only. (class) (inherited from dObject) |
BasePrefKey
Base key used when saving/restoring preferences (str) (inherited from dObject) |
Box
Reference to the box used in the sizer (dBox) |
Caption
Caption for the box (str) |
ChildObjects
List of all the objects (controls, sizers, spacers) that are directly managed by this sizer (list of objects (inherited from dSizerMixin) |
ChildSizers
List of all the sizers that are directly managed by this sizer (list of sizers (inherited from dSizerMixin) |
ChildSpacers
List of all the spacer items that are directly managed by this sizer (list of spacer items (inherited from dSizerMixin) |
ChildWindows
List of all the windows that are directly managed by this sizer (list of controls (inherited from dSizerMixin) |
Children
List of all the sizer items managed by this sizer (list of sizerItems (inherited from Sizer) |
Class
The class the object is based on. Read-only. (class) (inherited from dObject) |
ControllingSizer
Reference to the sizer that controls this control's layout. (dSizer) (inherited from dSizerMixin) |
ControllingSizerItem
Reference to the sizer item that control's this control's layout. This is useful for getting information about how the item is being sized, and for changing those settings. (inherited from dSizerMixin) |
DefaultBorder
Sets a default value for the border that will be applied to any controls added to the sizer afterwards for whom an explicit value for the border is not set. Note that it does not affect the border of items already added to the control. This property is useful when you want to add a series of items to a sizer with the same border: just set this property once, and then add your items. Default=0 (int) (inherited from dSizerMixin) |
DefaultBorderAll
When True, the DefaultBorder property is applied to all of the sides of any controls added to the sizer. If any of the individual side properties, such as DefaultBorderTop, are set to False, this property will return False. Setting DefaultBorderAll will effectively set all of the individual side properties to that value. Default=True (bool) (inherited from dSizerMixin) |
DefaultBorderBottom
Affects whether the DefaultBorder property is applied to the Bottom side of controls added to the sizer. Default=True (bool) (inherited from dSizerMixin) |
DefaultBorderLeft
Affects whether the DefaultBorder property is applied to the Left side of controls added to the sizer. Default=True (bool) (inherited from dSizerMixin) |
DefaultBorderRight
Affects whether the DefaultBorder property is applied to the Right side of controls added to the sizer. Default=True (bool) (inherited from dSizerMixin) |
DefaultBorderTop
Affects whether the DefaultBorder property is applied to the Top side of controls added to the sizer. Default=True (bool) (inherited from dSizerMixin) |
DefaultSpacing
Amount of space automatically inserted between elements. (int) (inherited from dSizerMixin) |
DynamicBackColor
Dynamically determine the value of the BackColor property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the BackColor property. If DynamicBackColor is set to None (the default), BackColor will not be dynamically evaluated. |
DynamicCaption
Dynamically determine the value of the Caption property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the Caption property. If DynamicCaption is set to None (the default), Caption will not be dynamically evaluated. |
DynamicDefaultBorder
Dynamically determine the value of the DefaultBorder property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the DefaultBorder property. If DynamicDefaultBorder is set to None (the default), DefaultBorder will not be dynamically evaluated. (inherited from dSizerMixin) |
DynamicFontBold
Dynamically determine the value of the FontBold property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the FontBold property. If DynamicFontBold is set to None (the default), FontBold will not be dynamically evaluated. |
DynamicFontFace
Dynamically determine the value of the FontFace property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the FontFace property. If DynamicFontFace is set to None (the default), FontFace will not be dynamically evaluated. |
DynamicFontItalic
Dynamically determine the value of the FontItalic property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the FontItalic property. If DynamicFontItalic is set to None (the default), FontItalic will not be dynamically evaluated. |
DynamicFontSize
Dynamically determine the value of the FontSize property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the FontSize property. If DynamicFontSize is set to None (the default), FontSize will not be dynamically evaluated. |
DynamicFontUnderline
Dynamically determine the value of the FontUnderline property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the FontUnderline property. If DynamicFontUnderline is set to None (the default), FontUnderline will not be dynamically evaluated. |
DynamicVisible
Dynamically determine the value of the Visible property. Specify a function and optional arguments that will get called from the update() method. The return value of the function will get set to the Visible property. If DynamicVisible is set to None (the default), Visible will not be dynamically evaluated. (inherited from dSizerMixin) |
FontBold
Controls the bold setting of the box caption (bool) |
FontFace
Controls the type face of the box caption (str) |
FontItalic
Controls the italic setting of the box caption (bool) |
FontSize
Size of the box caption font (int) |
FontUnderline
Controls the underline setting of the box caption (bool) |
Form
Form with which the sizer is associated. (dForm or None) (inherited from dSizerMixin) |
Height
Height of the sizer (int) (inherited from dSizerMixin) |
LogEvents
Specifies which events to log. (list of strings) If the first element is 'All', all events except the following listed events will be logged. Event logging is resource-intensive, so in addition to setting this LogEvents property, you also need to make the following call: >>> dabo.eventLogging = True (inherited from dObject) |
Name
The name of the object. (str) (inherited from dObject) |
Orientation
Sets the orientation of the sizer, either 'Vertical' or 'Horizontal'. (inherited from BoxSizer) |
Parent
The object that contains this sizer. In the case of nested sizers, it is the object that the outermost sizer belongs to. (obj) (inherited from dObject) |
PreferenceManager
Reference to the Preference Management object (dPref) (inherited from dObject) |
Visible
Specifies whether the sizer and contained items are shown (bool) (inherited from dSizerMixin) |
Width
Width of this sizer (int) (inherited from dSizerMixin) |
|
addDefaultSpacer(self, pos=None)
(inherited from dSizerMixin) |
|
addSpacer(self, val, pos=None, proportion=0)
(inherited from dSizerMixin) |
afterInit(self)
Subclass hook. Called after the object's __init__ has run fully. Subclasses should place their __init__ code here in this hook, instead of overriding __init__ directly, to avoid conflicting with base Dabo behavior. (inherited from dObject) |
append(self, obj, layout='normal', proportion=0, alignment=None, halign='left', valign='top', border=None, borderSides=None)
Adds the passed object to the end of the sizer layout.
+--------------------------------------------------------------------------+
|Additional arguments: |
+=============+============================================================+
|layout: |Specifies how the object expands in the opposite dimension |
| |of the sizer. If "normal" (the default), no expansion takes |
| |place. If "expand" (a common setting), the item will expand |
| |to fill up otherwise unoccupied space in the sizer. |
+-------------+------------------------------------------------------------+
|proportion |Specifies the proportional amount of space that the object |
| |can grow to in the same dimension as this sizer. If 0 (the |
| |default), the object will maintain its size. If > 0, the |
| |object will get a spacing in the sizer proportional to |
| |other objects in the sizer with proportions > 0. So if this |
| |is a horizontal sizer, and the proportion for the object is |
| |set to 1, and no other objects in the sizer have proportion |
| |set, the object will fill up all extra horizontal space. |
+-------------+------------------------------------------------------------+
|alignment |Possible values are "top", "middle", and "bottom" for |
| |horizontal sizers, and "left", "center", and "right" for |
| |vertical sizers. Specifies where the object appears within |
| |the available area in the sizer. |
+-------------+------------------------------------------------------------+
|halign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|valign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|border |Specifies the number of pixels to put around the object in |
| |the sizer, on the sides specified by the borderSides |
| |argument, or by the value of the DefaultBorderLeft, |
| |DefaultBorderRight, DefaultBorderTop, and |
| |DefaultBorderBottom boolean properties. |
+-------------+------------------------------------------------------------+
|borderSides |Specifies the sides around the object to place the border |
| |specified in the border argument or the DefaultBorder |
| |property. This should be a tuple that contains at least |
| |some of the values ("left", "right", "top", "bottom") |
+-------------+------------------------------------------------------------+
(inherited from dSizerMixin) |
append1x(self, obj, **kwargs)
Shorthand for sizer.append(obj, 1, "expand"). (inherited from dSizerMixin) |
appendItems(self, items, *args, **kwargs)
Append each item to the sizer.
+--------------------------------------------------------------------------+
|Additional arguments: |
+=============+============================================================+
|layout: |Specifies how the object expands in the opposite dimension |
| |of the sizer. If "normal" (the default), no expansion takes |
| |place. If "expand" (a common setting), the item will expand |
| |to fill up otherwise unoccupied space in the sizer. |
+-------------+------------------------------------------------------------+
|proportion |Specifies the proportional amount of space that the object |
| |can grow to in the same dimension as this sizer. If 0 (the |
| |default), the object will maintain its size. If > 0, the |
| |object will get a spacing in the sizer proportional to |
| |other objects in the sizer with proportions > 0. So if this |
| |is a horizontal sizer, and the proportion for the object is |
| |set to 1, and no other objects in the sizer have proportion |
| |set, the object will fill up all extra horizontal space. |
+-------------+------------------------------------------------------------+
|alignment |Possible values are "top", "middle", and "bottom" for |
| |horizontal sizers, and "left", "center", and "right" for |
| |vertical sizers. Specifies where the object appears within |
| |the available area in the sizer. |
+-------------+------------------------------------------------------------+
|halign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|valign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|border |Specifies the number of pixels to put around the object in |
| |the sizer, on the sides specified by the borderSides |
| |argument, or by the value of the DefaultBorderLeft, |
| |DefaultBorderRight, DefaultBorderTop, and |
| |DefaultBorderBottom boolean properties. |
+-------------+------------------------------------------------------------+
|borderSides |Specifies the sides around the object to place the border |
| |specified in the border argument or the DefaultBorder |
| |property. This should be a tuple that contains at least |
| |some of the values ("left", "right", "top", "bottom") |
+-------------+------------------------------------------------------------+
(inherited from dSizerMixin) |
appendSpacer(self, val, proportion=0)
Appends a spacer to the sizer. (inherited from dSizerMixin) |
autoBindEvents(self, force=True)
Automatically bind any on*() methods to the associated event. User code only needs to define the callback, and Dabo will automatically set up the event binding. This will satisfy lots of common cases where you want an object or its parent to respond to the object's events. To use this feature, just define a method on<EventName>(), or if you want a parent container to respond to the event, make a method in the parent on<EventName>_<object Name or RegID>(). For example:: class MyButton(dabo.ui.dButton): def onHit(self, evt): print "Hit!" class MyPanel(dabo.ui.dPanel): def afterInit(self): self.addObject(MyButton, RegID="btn1") def onHit_btn1(self, evt): print "panel: button hit!" When the button is pressed, you'll see both 'hit' messages because of auto event binding. If you want to bind your events explicitly, you can turn off auto event binding by calling:: dabo.autoBindEvents = False This feature is inspired by PythonCard. (inherited from EventMixin) |
beforeInit(self, *args, **kwargs)
Subclass hook. Called before the object is fully instantiated. Usually, user code should override afterInit() instead, but there may be cases where you need to set an attribute before the init stage is fully underway. (inherited from dObject) |
bindEvent(self, eventClass, function, _auto=False)
Bind a dEvent to a callback function. (inherited from EventMixin) |
bindEvents(self, bindings)
Bind a sequence of [dEvent, callback] lists. (inherited from EventMixin) |
clear(self, destroy=False)
This method is called to remove all items from the sizer. If the optional 'destroy' parameter is set to True, any contained items will be destroyed. Otherwise, they will remain as is, but no longer under control of the sizer. (inherited from dSizerMixin) |
drawOutline(self, win, recurse=False, drawChildren=False)
There are some cases where being able to see the sizer is helpful, such as at design time. This method can be called to see the outline; it needs to be called whenever the containing window is resized or repainted. (inherited from dSizerMixin) |
getAbsoluteName(self)
Return the fully qualified name of the object. (inherited from dObject) |
|
getContainingWindow(self, *args, **kwargs)
(inherited from dSizerMixin) |
getItem(self, szItem)
Querying sizers for their contents returns sizer items, not the actual items. So given a sizer item, this method will return the actual item in the sizer. (inherited from dSizerMixin) |
getItemProp(self, itm, prop)
Get the current value of the specified property for the sizer item. Grid sizers must override with their specific props. (inherited from dSizerMixin) |
getItemProps(self, itm)
Returns a dict containing all the sizer properties as keys along with their associated values. (inherited from dSizerMixin) |
getNonBorderedClass(self)
Return the class that is the non-border sizer version of this class. |
getPositionInSizer(self)
Returns the current position of this sizer in its containing sizer, or None if there isn't a containing sizer. (inherited from dSizerMixin) |
getProperties(self, propertySequence=(), propsToSkip=(), ignoreErrors=False, *propertyArguments)
Returns a dictionary of property name/value pairs.
If a sequence of properties is passed, just those property values
will be returned. Otherwise, all property values will be returned.
The sequence of properties can be a list, tuple, or plain string
positional arguments. For instance, all of the following are
equivilent::
print self.getProperties("Caption", "FontInfo", "Form")
print self.getProperties(["Caption", "FontInfo", "Form"])
t = ("Caption", "FontInfo", "Form")
print self.getProperties(t)
print self.getProperties(\*t)
An exception will be raised if any passed property names don't
exist, aren't actual properties, or are not readable (do not have
getter functions).
However, if an exception is raised from the property getter function,
the exception will get caught and used as the property value in the
returned property dictionary. This allows the property list to be
returned even if some properties can't be evaluated correctly by the
object yet.
(inherited from PropertyHelperMixin) |
hideItem(self, itm)
Hides the passed item (inherited from dSizerMixin) |
initEvents(self)
Hook for subclasses. User code should do custom event binding here, such as:: self.bindEvent(dEvents.GotFocus, self.customGotFocusHandler) (inherited from dObject) |
initProperties(self)
Hook for subclasses. User subclasses should set properties here, such as:: self.Name = "MyTextBox" self.BackColor = (192,192,192) (inherited from dObject) |
insert(self, index, obj, layout='normal', proportion=0, alignment=None, halign='left', valign='top', border=None, borderSides=None)
Inserts the passed object into the sizer layout at the specified position.
+--------------------------------------------------------------------------+
|Additional arguments: |
+=============+============================================================+
|layout: |Specifies how the object expands in the opposite dimension |
| |of the sizer. If "normal" (the default), no expansion takes |
| |place. If "expand" (a common setting), the item will expand |
| |to fill up otherwise unoccupied space in the sizer. |
+-------------+------------------------------------------------------------+
|proportion |Specifies the proportional amount of space that the object |
| |can grow to in the same dimension as this sizer. If 0 (the |
| |default), the object will maintain its size. If > 0, the |
| |object will get a spacing in the sizer proportional to |
| |other objects in the sizer with proportions > 0. So if this |
| |is a horizontal sizer, and the proportion for the object is |
| |set to 1, and no other objects in the sizer have proportion |
| |set, the object will fill up all extra horizontal space. |
+-------------+------------------------------------------------------------+
|alignment |Possible values are "top", "middle", and "bottom" for |
| |horizontal sizers, and "left", "center", and "right" for |
| |vertical sizers. Specifies where the object appears within |
| |the available area in the sizer. |
+-------------+------------------------------------------------------------+
|halign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|valign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|border |Specifies the number of pixels to put around the object in |
| |the sizer, on the sides specified by the borderSides |
| |argument, or by the value of the DefaultBorderLeft, |
| |DefaultBorderRight, DefaultBorderTop, and |
| |DefaultBorderBottom boolean properties. |
+-------------+------------------------------------------------------------+
|borderSides |Specifies the sides around the object to place the border |
| |specified in the border argument or the DefaultBorder |
| |property. This should be a tuple that contains at least |
| |some of the values ("left", "right", "top", "bottom") |
+-------------+------------------------------------------------------------+
(inherited from dSizerMixin) |
insertSpacer(self, pos, val, proportion=0)
Added to be consistent with the sizers' add/insert design. Inserts a spacer at the specified position. (inherited from dSizerMixin) |
isContainedBy(self, obj)
Returns True if this the containership hierarchy for this control includes obj. (inherited from dSizerMixin) |
layout(self)
Layout the items in the sizer. This is handled automatically when the sizer is resized, but you'll have to call it manually after you are done adding items to the sizer. (inherited from dSizerMixin) |
listMembers(self, recurse=False, lvl=0)
Debugging method. This will list all the members of this sizer, and if recurse is True, drill down into all contained sizers. (inherited from dSizerMixin) |
prepend(self, obj, layout='normal', proportion=0, alignment=None, halign='left', valign='top', border=None, borderSides=None)
Insert the object at the beginning of the sizer layout.
+--------------------------------------------------------------------------+
|Additional arguments: |
+=============+============================================================+
|layout: |Specifies how the object expands in the opposite dimension |
| |of the sizer. If "normal" (the default), no expansion takes |
| |place. If "expand" (a common setting), the item will expand |
| |to fill up otherwise unoccupied space in the sizer. |
+-------------+------------------------------------------------------------+
|proportion |Specifies the proportional amount of space that the object |
| |can grow to in the same dimension as this sizer. If 0 (the |
| |default), the object will maintain its size. If > 0, the |
| |object will get a spacing in the sizer proportional to |
| |other objects in the sizer with proportions > 0. So if this |
| |is a horizontal sizer, and the proportion for the object is |
| |set to 1, and no other objects in the sizer have proportion |
| |set, the object will fill up all extra horizontal space. |
+-------------+------------------------------------------------------------+
|alignment |Possible values are "top", "middle", and "bottom" for |
| |horizontal sizers, and "left", "center", and "right" for |
| |vertical sizers. Specifies where the object appears within |
| |the available area in the sizer. |
+-------------+------------------------------------------------------------+
|halign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|valign |Only used if the alignment property not set. |
+-------------+------------------------------------------------------------+
|border |Specifies the number of pixels to put around the object in |
| |the sizer, on the sides specified by the borderSides |
| |argument, or by the value of the DefaultBorderLeft, |
| |DefaultBorderRight, DefaultBorderTop, and |
| |DefaultBorderBottom boolean properties. |
+-------------+------------------------------------------------------------+
|borderSides |Specifies the sides around the object to place the border |
| |specified in the border argument or the DefaultBorder |
| |property. This should be a tuple that contains at least |
| |some of the values ("left", "right", "top", "bottom") |
+-------------+------------------------------------------------------------+
(inherited from dSizerMixin) |
prependSpacer(self, val, proportion=0)
Added to be consistent with the sizers' add/insert design. Inserts a spacer in the first position. (inherited from dSizerMixin) |
raiseEvent(self, eventClass, uiEvent=None, *args, **kwargs)
Send the event to all registered listeners. If uiEvent is sent, dEvents.Event will be able to parse it for useful information to send along to the callback. Additional arguments, if any, are sent along to the constructor of the event. While this feature exists so that UI-lib event handlers can pass along information (such as the keystroke information in a key event), user code may pass along additional arguments as well, which will exist in the event.EventData dictionary property. In most cases, user code should call raiseEvent() with the event class (dEvents.Hit, for example) as the only parameter. (inherited from EventMixin) |
release(self, releaseContents=False)
Normally just destroys the sizer, leaving any objects controlled by the sizer intact. But if the 'releaseContents' parameter is passed as True, all objects contained in the sizer are destroyed first. (inherited from dSizerMixin) |
remove(self, itm, destroy=None)
This will remove the item from the sizer. It will not cause the item to be destroyed unless the 'destroy' parameter is True. If the item is not one of this sizer's items, no error will be raised - it will simply do nothing. (inherited from dSizerMixin) |
setItemProp(self, itm, prop, val)
Given a sizer item, a property and a value, sets things as you would expect. (inherited from dSizerMixin) |
setItemProps(self, itm, props)
This accepts a dict of properties and values, and applies them to the specified sizer item. (inherited from dSizerMixin) |
|
setPositionInSizer(self, obj, pos)
(inherited from dSizerMixin) |
setProperties(self, propDict={}, ignoreErrors=False, **propKw)
Sets a group of properties on the object all at once.
You have the following options for sending the properties:
1) Property/Value pair dictionary
2) Keyword arguments
3) Both
The following examples all do the same thing::
self.setProperties(FontBold=True, ForeColor="Red")
self.setProperties({"FontBold": True, "ForeColor": "Red"})
self.setProperties({"FontBold": True}, ForeColor="Red")
(inherited from PropertyHelperMixin) |
setPropertiesFromAtts(self, propDict={}, ignoreExtra=True, context=None)
Sets a group of properties on the object all at once. This is different from the regular setProperties() method because it only accepts a dict containing prop:value pairs, and it assumes that the value is always a string. It will convert the value to the correct type for the property, and then set the property to that converted value. If the value needs to be evaluated in a specific namespace, pass that as the 'context' parameter. (inherited from PropertyHelperMixin) |
showItem(self, itm)
Makes sure that the passed item is visible (inherited from dSizerMixin) |
unbindEvent(self, eventClass=None, function=None)
Remove a previously registered event binding. Removes all registrations that exist for the given binding for this object. If event is None, all bindings for the passed function are removed. If function is None, all bindings for the passed event are removed. If both event and function are None, all event bindings are removed. (inherited from EventMixin) |