dabo Commit
Revision 2521
Date: 2006-12-08 17:18:49 -0800 (Fri, 08 Dec 2006)
Author: paul
Changed:
U branches/stable/dabo/dObject.py
U branches/stable/dabo/ui/dDataControlMixinBase.py
U branches/stable/dabo/ui/uiwx/__init__.py
U branches/stable/dabo/ui/uiwx/dBitmap.py
U branches/stable/dabo/ui/uiwx/dBitmapButton.py
U branches/stable/dabo/ui/uiwx/dBorderSizer.py
U branches/stable/dabo/ui/uiwx/dBox.py
U branches/stable/dabo/ui/uiwx/dButton.py
U branches/stable/dabo/ui/uiwx/dCalendar.py
U branches/stable/dabo/ui/uiwx/dCheckBox.py
U branches/stable/dabo/ui/uiwx/dCheckListBox.py
U branches/stable/dabo/ui/uiwx/dComboBox.py
U branches/stable/dabo/ui/uiwx/dDialog.py
U branches/stable/dabo/ui/uiwx/dDropdownList.py
U branches/stable/dabo/ui/uiwx/dEditBox.py
U branches/stable/dabo/ui/uiwx/dEditableList.py
U branches/stable/dabo/ui/uiwx/dEditor.py
U branches/stable/dabo/ui/uiwx/dFileDialog.py
U branches/stable/dabo/ui/uiwx/dFoldPanelBar.py
U branches/stable/dabo/ui/uiwx/dForm.py
U branches/stable/dabo/ui/uiwx/dFormMain.py
U branches/stable/dabo/ui/uiwx/dGauge.py
U branches/stable/dabo/ui/uiwx/dGrid.py
U branches/stable/dabo/ui/uiwx/dGridSizer.py
U branches/stable/dabo/ui/uiwx/dHtmlBox.py
U branches/stable/dabo/ui/uiwx/dHyperLink.py
U branches/stable/dabo/ui/uiwx/dImage.py
U branches/stable/dabo/ui/uiwx/dLabel.py
U branches/stable/dabo/ui/uiwx/dLine.py
U branches/stable/dabo/ui/uiwx/dListBox.py
U branches/stable/dabo/ui/uiwx/dListControl.py
U branches/stable/dabo/ui/uiwx/dMenu.py
U branches/stable/dabo/ui/uiwx/dMenuBar.py
U branches/stable/dabo/ui/uiwx/dMenuItem.py
U branches/stable/dabo/ui/uiwx/dPageFrame.py
U branches/stable/dabo/ui/uiwx/dPanel.py
U branches/stable/dabo/ui/uiwx/dPemMixin.py
U branches/stable/dabo/ui/uiwx/dRadioGroup.py
U branches/stable/dabo/ui/uiwx/dRadioList.py
U branches/stable/dabo/ui/uiwx/dSizer.py
U branches/stable/dabo/ui/uiwx/dSlider.py
U branches/stable/dabo/ui/uiwx/dSpinner.py
U branches/stable/dabo/ui/uiwx/dSplitter.py
U branches/stable/dabo/ui/uiwx/dStatusBar.py
U branches/stable/dabo/ui/uiwx/dTextBox.py
U branches/stable/dabo/ui/uiwx/dTimer.py
U branches/stable/dabo/ui/uiwx/dToggleButton.py
U branches/stable/dabo/ui/uiwx/dToolBar.py
U branches/stable/dabo/ui/uiwx/dTreeView.py
U branches/stable/dabo/ui/uiwx/uiApp.py
Log:
Backported all the fixes to make Dabo 0.7 work with wxPython 2.7. The merge
came from the following revisions:
2482
2483
2486
2487
2514
2515
2516
2518
2520
Diff:
Modified: branches/stable/dabo/dObject.py
===================================================================
--- branches/stable/dabo/dObject.py 2006-12-08 21:58:05 UTC (rev 2520)
+++ branches/stable/dabo/dObject.py 2006-12-09 01:18:49 UTC (rev 2521)
@@ -8,9 +8,17 @@
from dabo.lib.autosuper import autosuper
from dabo.dPref import dPref
from dabo.dLocalize import _
-
-class dObject(autosuper, DoDefaultMixin, PropertyHelperMixin,
+class Dummy(object):
+ # Much thanks to Robin Dunn for a workaround to a nasty problem that
reared
+ # its head starting with wxPython 2.7, when we had to switch around the
order
+ # of base classes so that wxPython's properties didn't trump Dabo's.
Neither
+ # of us really understand what is happening, but it is at the Python
level,
+ # and suffice it to say making dObject first inherit from this Dummy
class
+ # fixes the issue, which was ultimately caused by autosuper's __slots__.
+ pass
+
+class dObject(Dummy, autosuper, DoDefaultMixin, PropertyHelperMixin,
EventMixin):
""" The basic ancestor of all dabo objects."""
# Subclasses can set these to False, in which case they are responsible
Modified: branches/stable/dabo/ui/dDataControlMixinBase.py
===================================================================
--- branches/stable/dabo/ui/dDataControlMixinBase.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/dDataControlMixinBase.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -16,7 +16,7 @@
self._designerMode = None
self._oldVal = None
- super(dDataControlMixinBase, self).__init__(*args, **kwargs)
+ dabo.ui.dControlMixin.__init__(self, *args, **kwargs)
self._value = self.Value
self._enabled = True
Modified: branches/stable/dabo/ui/uiwx/__init__.py
===================================================================
--- branches/stable/dabo/ui/uiwx/__init__.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/__init__.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -364,7 +364,7 @@
ed["menuItem"] = itm
if isinstance(wxEvt, wx.KeyEvent):
- ed["keyCode"] = wxEvt.KeyCode()
+ ed["keyCode"] = wxEvt.GetKeyCode()
ed["rawKeyCode"] = wxEvt.GetRawKeyCode()
ed["rawKeyFlags"] = wxEvt.GetRawKeyFlags()
ed["unicodeChar"] = wxEvt.GetUniChar()
@@ -920,8 +920,8 @@
fnt.SetWeight(wx.BOLD)
if italic is not None:
fnt.SetStyle(wx.ITALIC)
-
- if not isinstance(wind, dabo.ui.dForm):
+
+ if not isinstance(wind, (dabo.ui.dForm, wx.Frame)):
try:
wind = wind.Form
except:
Modified: branches/stable/dabo/ui/uiwx/dBitmap.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dBitmap.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dBitmap.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -12,7 +12,7 @@
from dabo.ui import makeDynamicProperty
-class dBitmap(wx.StaticBitmap, cm.dControlMixin, dim.dImageMixin):
+class dBitmap(cm.dControlMixin, dim.dImageMixin, wx.StaticBitmap):
"""Creates a simple bitmap control to display images on your forms."""
def __init__(self, parent, properties=None, *args, **kwargs):
self._baseClass = dBitmap
Modified: branches/stable/dabo/ui/uiwx/dBitmapButton.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dBitmapButton.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dBitmapButton.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -11,7 +11,7 @@
import dImageMixin as dim
-class dBitmapButton(wx.BitmapButton, cm.dControlMixin, dim.dImageMixin):
+class dBitmapButton(cm.dControlMixin, dim.dImageMixin, wx.BitmapButton):
"""Creates a button with a picture.
The button can have up to three pictures associated with it:
Modified: branches/stable/dabo/ui/uiwx/dBorderSizer.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dBorderSizer.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dBorderSizer.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -7,7 +7,7 @@
dabo.ui.loadUI("wx")
-class dBorderSizer(wx.StaticBoxSizer, dabo.ui.dSizerMixin):
+class dBorderSizer(dabo.ui.dSizerMixin, wx.StaticBoxSizer):
"""A BorderSizer is a regular box sizer, but with a visible box around
the perimiter. You must either create the box first and pass it to the
dBorderSizer's constructor, or pass a parent object, and the box
Modified: branches/stable/dabo/ui/uiwx/dBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dBox.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dBox.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -5,7 +5,7 @@
import dControlMixin as cm
-class dBox(wx.StaticBox, cm.dControlMixin):
+class dBox(cm.dControlMixin, wx.StaticBox):
"""Creates a box for visually grouping objects on your form.
"""
## pkm: I'm not sure of the utility of this class, since you can draw
Modified: branches/stable/dabo/ui/uiwx/dButton.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dButton.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dButton.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -11,7 +11,7 @@
from dabo.ui import makeDynamicProperty
-class dButton(wx.Button, cm.dControlMixin):
+class dButton(cm.dControlMixin, wx.Button):
"""Creates a button that can be pressed by the user to trigger an
action.
Example:
Modified: branches/stable/dabo/ui/uiwx/dCalendar.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dCalendar.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dCalendar.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -11,7 +11,7 @@
from dabo.ui import makeDynamicProperty
-class BaseCalendar(wxcal.CalendarCtrl, dcm.dControlMixin):
+class BaseCalendar(dcm.dControlMixin, wxcal.CalendarCtrl):
"""This is the base wrapper of the wx calendar control. Do not
use this directly; instead, use either the 'dCalendar' or the
'dExtendedCalendar' subclasses.
Modified: branches/stable/dabo/ui/uiwx/dCheckBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dCheckBox.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dCheckBox.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dCheckBox(wx.CheckBox, dcm.dDataControlMixin):
+class dCheckBox(dcm.dDataControlMixin, wx.CheckBox):
"""Creates a checkbox, allowing editing boolean values."""
def __init__(self, parent, properties=None, *args, **kwargs):
self._baseClass = dCheckBox
Modified: branches/stable/dabo/ui/uiwx/dCheckListBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dCheckListBox.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dCheckListBox.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -8,7 +8,7 @@
from dabo.dLocalize import _
-class dCheckListBox(wx.CheckListBox, dcm.dControlItemMixin):
+class dCheckListBox(dcm.dControlItemMixin, wx.CheckListBox):
"""Creates a listbox, allowing the user to choose one or more items
by checking/unchecking each one
"""
Modified: branches/stable/dabo/ui/uiwx/dComboBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dComboBox.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dComboBox.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -7,7 +7,7 @@
from dabo.ui import makeDynamicProperty
-class dComboBox(wx.ComboBox, dcm.dControlItemMixin):
+class dComboBox(dcm.dControlItemMixin, wx.ComboBox):
"""Creates a combobox, which combines a dropdown list with a textbox.
The user can choose an item in the dropdown, or enter freeform text.
Modified: branches/stable/dabo/ui/uiwx/dDialog.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dDialog.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dDialog.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dDialog(wx.Dialog, fm.dFormMixin):
+class dDialog(fm.dFormMixin, wx.Dialog):
"""Creates a dialog, which is a lightweight form.
Dialogs are like forms, but typically are modal and are requesting a
very
Modified: branches/stable/dabo/ui/uiwx/dDropdownList.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dDropdownList.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dDropdownList.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -6,7 +6,7 @@
from dabo.dLocalize import _
-class dDropdownList(wx.Choice, dcm.dControlItemMixin):
+class dDropdownList(dcm.dControlItemMixin, wx.Choice):
"""Creates a dropdown list, which allows the user to select one item.
This is a very simple control, suitable for choosing from one of a
handful
Modified: branches/stable/dabo/ui/uiwx/dEditBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dEditBox.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dEditBox.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -11,7 +11,7 @@
# The EditBox is just a TextBox with some additional styles.
-class dEditBox(wx.TextCtrl, dcm.dDataControlMixin):
+class dEditBox(dcm.dDataControlMixin, wx.TextCtrl):
"""Creates an editbox, which allows editing of string data of unlimited
size.
The editbox will create scrollbars as necessary, and can edit string or
Modified: branches/stable/dabo/ui/uiwx/dEditableList.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dEditableList.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dEditableList.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -8,8 +8,7 @@
from dabo.ui import makeDynamicProperty
-class dEditableList(wx.gizmos.EditableListBox,
- dcm.dControlMixin):
+class dEditableList(dcm.dControlMixin, wx.gizmos.EditableListBox):
"""Creates an editable list box, complete with buttons to control
editing, adding/deleting items, and re-ordering them.
"""
Modified: branches/stable/dabo/ui/uiwx/dEditor.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dEditor.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dEditor.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -67,7 +67,7 @@
self.Parent.SetLexer(stc.STC_LEX_CONTAINER)
-class dEditor(stc.StyledTextCtrl, dcm.dDataControlMixin):
+class dEditor(dcm.dDataControlMixin, stc.StyledTextCtrl):
# The Editor is copied from the wxPython demo, StyledTextCtrl_2.py,
# and modified. Thanks to Robin Dunn and everyone that contributed to
# that demo to get us going!
Modified: branches/stable/dabo/ui/uiwx/dFileDialog.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dFileDialog.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dFileDialog.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -3,9 +3,11 @@
class OsDialogMixin(object):
- def __init__(self):
+ def _beforeInit(self):
self._dir = self._fname = self._msg = self._path =
self._wildcard = ""
+ super(OsDialogMixin, self)._beforeInit()
+
def show(self):
self._dir = self._fname = self._path = ""
ret = k.DLG_CANCEL
@@ -72,7 +74,7 @@
-class dFileDialog(wx.FileDialog, OsDialogMixin):
+class dFileDialog(OsDialogMixin, wx.FileDialog):
"""Creates a file dialog, which asks the user to choose a file."""
_exposeFiles = True
@@ -89,7 +91,7 @@
wildcard=wildcard, style=style)
-class dFolderDialog(wx.DirDialog, OsDialogMixin):
+class dFolderDialog(OsDialogMixin, wx.DirDialog):
"""Creates a folder dialog, which asks the user to choose a folder."""
_exposeFiles = False
Modified: branches/stable/dabo/ui/uiwx/dFoldPanelBar.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dFoldPanelBar.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dFoldPanelBar.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -10,7 +10,7 @@
from dabo.ui import makeDynamicProperty
-class dFoldPanel(fpb.FoldPanelItem, dcm.dControlMixin):
+class dFoldPanel(dcm.dControlMixin, fpb.FoldPanelItem):
def __init__(self, parent, caption=None, collapsed=None,
properties=None, *args, **kwargs):
@@ -186,6 +186,10 @@
self._bar.Collapse(self)
+ def _getParent(self):
+ return self._bar
+
+
BarColor1 = property(_getBarColor1, _setBarColor1, None,
_("Main color for the caption bar (dColor)"))
@@ -219,6 +223,8 @@
Expanded = property(_getExpanded, _setExpanded, None,
_("Is the panel's contents visible? (bool)"))
+ Parent = property(_getParent, None, None,
+ _("Reference to the containing dFoldPanelBar."))
DynamicBarColor1 = makeDynamicProperty(BarColor1)
DynamicBarColor2 = makeDynamicProperty(BarColor2)
@@ -231,7 +237,7 @@
-class dFoldPanelBar(wx.lib.foldpanelbar.FoldPanelBar, dcm.dControlMixin):
+class dFoldPanelBar(dcm.dControlMixin, wx.lib.foldpanelbar.FoldPanelBar):
"""Creates a control consisting of several panels that can be
hidden or revealed by clicking on their 'caption bar'.
@@ -252,8 +258,6 @@
dcm.dControlMixin.__init__(self, preClass, parent, properties,
*args, **kwargs)
- # We need this 'trick' so that the object crawling routines work
- self._foldPanel.Parent = self
self._setInitialOpenPanel()
self.bindEvent(dEvents.FoldPanelChange,
self.__onFoldPanelChange)
Modified: branches/stable/dabo/ui/uiwx/dForm.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dForm.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dForm.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -760,18 +760,18 @@
-class dForm(wx.Frame, BaseForm):
+class dForm(BaseForm, wx.Frame):
def __init__(self, parent=None, properties=None, *args, **kwargs):
self._baseClass = dForm
if dabo.settings.MDI and isinstance(parent, wx.MDIParentFrame):
# Hack this into an MDI Child:
- dForm.__bases__ = (wx.MDIChildFrame, BaseForm)
+ dForm.__bases__ = (BaseForm, wx.MDIChildFrame)
preClass = wx.PreMDIChildFrame
self._mdi = True
else:
# This is a normal SDI form:
- dForm.__bases__ = (wx.Frame, BaseForm)
+ dForm.__bases__ = (BaseForm, wx.Frame)
preClass = wx.PreFrame
self._mdi = False
## (Note that it is necessary to run the above block each time,
because
@@ -784,7 +784,7 @@
wx.CallAfter(self.update)
-class dToolForm(wx.MiniFrame, BaseForm):
+class dToolForm(BaseForm, wx.MiniFrame):
def __init__(self, parent=None, properties=None, *args, **kwargs):
self._baseClass = dToolForm
preClass = wx.PreMiniFrame
@@ -795,7 +795,7 @@
BaseForm.__init__(self, preClass, parent, properties, *args,
**kwargs)
-class dBorderlessForm(wx.Frame, BaseForm):
+class dBorderlessForm(BaseForm, wx.Frame):
def __init__(self, parent=None, properties=None, *args, **kwargs):
self._baseClass = dBorderlessForm
style = kwargs.get("style", 0)
Modified: branches/stable/dabo/ui/uiwx/dFormMain.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dFormMain.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dFormMain.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -62,18 +62,18 @@
-class dFormMain(wx.Frame, dFormMainBase):
+class dFormMain(dFormMainBase, wx.Frame):
def __init__(self, parent=None, properties=None, *args, **kwargs):
self._baseClass = dFormMain
if dabo.settings.MDI:
# Hack this into an MDI Parent:
- dFormMain.__bases__ = (wx.MDIParentFrame, dFormMainBase)
+ dFormMain.__bases__ = (dFormMainBase, wx.MDIParentFrame)
preClass = wx.PreMDIParentFrame
self._mdi = True
else:
# This is a normal SDI form:
- dFormMain.__bases__ = (wx.Frame, dFormMainBase)
+ dFormMain.__bases__ = (dFormMainBase, wx.Frame)
preClass = wx.PreFrame
self._mdi = False
## (Note that it is necessary to run the above block each time,
because
Modified: branches/stable/dabo/ui/uiwx/dGauge.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dGauge.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dGauge.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dGauge(wx.Gauge, cm.dControlMixin):
+class dGauge(cm.dControlMixin, wx.Gauge):
"""Creates a gauge, which can be used as a progress bar."""
def __init__(self, parent, properties=None, *args, **kwargs):
self._baseClass = dGauge
Modified: branches/stable/dabo/ui/uiwx/dGrid.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dGrid.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dGrid.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -1482,7 +1482,7 @@
-class dGrid(wx.grid.Grid, cm.dControlMixin):
+class dGrid(cm.dControlMixin, wx.grid.Grid):
"""Creates a grid, with rows and columns to represent records and
fields.
Grids are powerful controls for allowing reading and writing of data. A
Modified: branches/stable/dabo/ui/uiwx/dGridSizer.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dGridSizer.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dGridSizer.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -7,7 +7,7 @@
import warnings
-class dGridSizer(wx.GridBagSizer, dSizerMixin.dSizerMixin):
+class dGridSizer(dSizerMixin.dSizerMixin, wx.GridBagSizer):
def __init__(self, vgap=3, hgap=3, maxRows=0, maxCols=0, **kwargs):
"""dGridSizer is a sizer that can lay out items in a virtual
grid arrangement.
Items can be placed is specific row/column positions if that
position is
Modified: branches/stable/dabo/ui/uiwx/dHtmlBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dHtmlBox.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dHtmlBox.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -12,7 +12,7 @@
import dControlMixin as cm
from dabo.ui import makeDynamicProperty
-class dHtmlBox(wx.html.HtmlWindow, cm.dControlMixin):
+class dHtmlBox(cm.dControlMixin, wx.html.HtmlWindow):
"""Creates a scrolled panel that can load and display html pages
The Html Window can load any html text, file, or url that is fed to it.
Modified: branches/stable/dabo/ui/uiwx/dHyperLink.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dHyperLink.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dHyperLink.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -10,7 +10,7 @@
from dabo.ui import makeDynamicProperty
-class dHyperLink(hyperlink.HyperLinkCtrl, dcm.dControlMixin):
+class dHyperLink(dcm.dControlMixin, hyperlink.HyperLinkCtrl):
"""Creates a hyperlink that, when clicked, launches the specified
URL in the user's default browser.
"""
Modified: branches/stable/dabo/ui/uiwx/dImage.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dImage.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dImage.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -12,7 +12,7 @@
from dabo.ui import makeDynamicProperty
-class dImage(wx.StaticBitmap, dcm.dDataControlMixin, dim.dImageMixin):
+class dImage(dcm.dDataControlMixin, dim.dImageMixin, wx.StaticBitmap):
""" Create a simple bitmap to display images."""
def __init__(self, parent, properties=None, attProperties=None,
*args, **kwargs):
Modified: branches/stable/dabo/ui/uiwx/dLabel.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dLabel.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dLabel.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dLabel(wx.StaticText, cm.dControlMixin):
+class dLabel(cm.dControlMixin, wx.StaticText):
"""Creates a static label, to make a caption for another control, for
example."""
def __init__(self, parent, properties=None, *args, **kwargs):
self._baseClass = dLabel
Modified: branches/stable/dabo/ui/uiwx/dLine.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dLine.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dLine.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -7,7 +7,7 @@
from dabo.ui import makeDynamicProperty
-class dLine(wx.StaticLine, cm.dControlMixin):
+class dLine(cm.dControlMixin, wx.StaticLine):
"""Creates a horizontal or vertical line.
If Orientation is "Vertical", Height refers to the length of the line.
Modified: branches/stable/dabo/ui/uiwx/dListBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dListBox.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dListBox.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dListBox(wx.ListBox, dcm.dControlItemMixin):
+class dListBox(dcm.dControlItemMixin, wx.ListBox):
"""Creates a listbox, allowing the user to choose one or more items."""
def __init__(self, parent, properties=None, *args, **kwargs):
self._baseClass = dListBox
Modified: branches/stable/dabo/ui/uiwx/dListControl.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dListControl.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dListControl.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -9,8 +9,8 @@
from dabo.ui import makeDynamicProperty
-class dListControl(wx.ListCtrl, dcm.dControlItemMixin,
- ListMixin.ListCtrlAutoWidthMixin):
+class dListControl(dcm.dControlItemMixin,
+ ListMixin.ListCtrlAutoWidthMixin, wx.ListCtrl):
"""Creates a list control, which is a flexible, virtual list box.
The List Control is ideal for visually dealing with data sets where
each
Modified: branches/stable/dabo/ui/uiwx/dMenu.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dMenu.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dMenu.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -13,7 +13,7 @@
RadioItemType = wx.ITEM_RADIO
-class dMenu(wx.Menu, pm.dPemMixin):
+class dMenu(pm.dPemMixin, wx.Menu):
"""Creates a menu, which can contain submenus, menu items,
and separators.
"""
@@ -228,7 +228,13 @@
del self._daboChildren[id_]
self.RemoveItem(item)
if release:
- item.Destroy()
+ if wx.VERSION[0] == 2 and wx.VERSION[1] >= 7:
+ # segfault when destroying menu items for
wx2.7. I've reported it and
+ # it will probably be fixed soon. For now,
don't destroy it but return
+ # None to the caller.
+ item = None
+ else:
+ item.Destroy()
return item
Modified: branches/stable/dabo/ui/uiwx/dMenuBar.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dMenuBar.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dMenuBar.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -6,7 +6,7 @@
import dabo.dEvents as dEvents
-class dMenuBar(wx.MenuBar, pm.dPemMixin):
+class dMenuBar(pm.dPemMixin, wx.MenuBar):
"""Creates a menu bar, which can contain dMenus.
You probably don't want to use this directly. Instead, see dBaseMenuBar
Modified: branches/stable/dabo/ui/uiwx/dMenuItem.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dMenuItem.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dMenuItem.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -8,7 +8,7 @@
from dabo.ui import makeDynamicProperty
-class dMenuItem(wx.MenuItem, pm.dPemMixin):
+class dMenuItem(pm.dPemMixin, wx.MenuItem):
"""Creates a menu item, which is usually represented as a string."""
def __init__(self, parent=None, properties=None, *args, **kwargs):
self._baseClass = dMenuItem
Modified: branches/stable/dabo/ui/uiwx/dPageFrame.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dPageFrame.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dPageFrame.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -18,7 +18,7 @@
return property(lambda self: value)
-class dPageFrame(wx.Notebook, dPageFrameMixin):
+class dPageFrame(dPageFrameMixin, wx.Notebook):
"""Creates a pageframe, which can contain an unlimited number of pages.
Typically, your pages will descend from dPage, but they can in fact be
any
@@ -58,7 +58,7 @@
print "Page number changed from %s to %s" % (evt.oldPageNum,
evt.newPageNum)
-class dPageList(wx.Listbook, dPageFrameMixin):
+class dPageList(dPageFrameMixin, wx.Listbook):
_evtPageChanged = readonly(wx.EVT_LISTBOOK_PAGE_CHANGED)
_tabposBottom = readonly(wx.LB_BOTTOM)
_tabposRight = readonly(wx.LB_RIGHT)
@@ -103,7 +103,7 @@
-class dPageSelect(wx.Choicebook, dPageFrameMixin):
+class dPageSelect(dPageFrameMixin, wx.Choicebook):
_evtPageChanged = readonly(wx.EVT_CHOICEBOOK_PAGE_CHANGED)
_tabposBottom = readonly(wx.CHB_BOTTOM)
_tabposRight = readonly(wx.CHB_RIGHT)
Modified: branches/stable/dabo/ui/uiwx/dPanel.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dPanel.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dPanel.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dPanel(wx.Panel, cm.dControlMixin):
+class dPanel(cm.dControlMixin, wx.Panel):
"""Creates a panel, a basic container for controls.
Panels can contain subpanels to unlimited depth, making them quite
@@ -92,7 +92,7 @@
-class dScrollPanel(wx.ScrolledWindow, cm.dControlMixin):
+class dScrollPanel(cm.dControlMixin, wx.ScrolledWindow):
""" This is a basic container for controls that allows scrolling.
Panels can contain subpanels to unlimited depth, making them quite
Modified: branches/stable/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dPemMixin.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dPemMixin.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -131,8 +131,13 @@
# This is needed because these classes require a
'parent' param.
kwargs["parent"] = parent
elif issubclass(self._baseClass, dabo.ui.dToggleButton):
- self._preInitProperties["ID"] =
self._preInitProperties["id"]
- del self._preInitProperties["id"]
+ version = wx.VERSION
+ major = version[0]
+ minor = version[1]
+ if major == 2 and minor < 7:
+ # versions prior to 2.7 had the id parameter as
ID, unfortunately.
+ self._preInitProperties["ID"] =
self._preInitProperties["id"]
+ del self._preInitProperties["id"]
# This is needed when running from a saved design file
self._extractKey(properties, "designerClass")
# This attribute is used when saving code with a design file
@@ -1077,7 +1082,7 @@
def __onUpdate(self, evt):
"""Update any dynamic properties, and then call the refresh()
hook."""
- if isinstance(self, dabo.ui.deadObject):
+ if isinstance(self, dabo.ui.deadObject) or not
self._constructed():
return
self.update()
@@ -1598,7 +1603,12 @@
# Frames have a Title separate from Label, but I can't
think
# of a reason why that would be necessary... can you?
- self.SetTitle(val)
+ try:
+ self.SetTitle(val)
+ except AttributeError:
+ # wxPython 2.7.x started not having this
attribute for labels
+ # at least.
+ pass
else:
self._properties["Caption"] = val
@@ -1736,7 +1746,12 @@
if isinstance(self, (wx.Frame, wx.Dialog) ):
self.SetSize(newSize)
else:
- self.SetBestFittingSize(newSize)
+ if hasattr(self, "SetInitialSize"):
+ # wxPython 2.7.x:
+ self.SetInitialSize(newSize)
+ else:
+ # prior to wxPython 2.7.s:
+ self.SetBestFittingSize(newSize)
else:
self._properties["Height"] = val
@@ -1949,7 +1964,12 @@
if isinstance(self, (wx.Frame, wx.Dialog) ):
self.SetSize(val)
else:
- self.SetBestFittingSize(val)
+ if hasattr(self, "SetInitialSize"):
+ # wxPython 2.7.x:
+ self.SetInitialSize(val)
+ else:
+ # prior to wxPython 2.7.s:
+ self.SetBestFittingSize(val)
else:
self._properties["Size"] = val
@@ -2048,7 +2068,12 @@
if isinstance(self, (wx.Frame, wx.Dialog) ):
self.SetSize(newSize)
else:
- self.SetBestFittingSize(newSize)
+ if hasattr(self, "SetInitialSize"):
+ # wxPython 2.7.x:
+ self.SetInitialSize(newSize)
+ else:
+ # prior to wxPython 2.7.s:
+ self.SetBestFittingSize(newSize)
else:
self._properties["Width"] = val
Modified: branches/stable/dabo/ui/uiwx/dRadioGroup.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dRadioGroup.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dRadioGroup.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -10,7 +10,7 @@
import warnings
-class dRadioGroup(wx.RadioBox, dcm.dDataControlMixin):
+class dRadioGroup(dcm.dDataControlMixin, wx.RadioBox):
"""Creates a group of radio buttons, allowing mutually-exclusive
choices.
Like a dDropdownList, use this to present the user with multiple
choices and
Modified: branches/stable/dabo/ui/uiwx/dRadioList.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dRadioList.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dRadioList.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -11,7 +11,7 @@
from dabo.ui import makeDynamicProperty
-class _dRadioButton(wx.RadioButton, dcm.dDataControlMixin):
+class _dRadioButton(dcm.dDataControlMixin, wx.RadioButton):
"""Subclass of wx.RadioButton. Not meant to be used individually, but
only in the context of a parent dRadioList control.
"""
@@ -116,7 +116,7 @@
self.Parent.PositionValue = positionValue
-class dRadioList(wx.Panel, cim.dControlItemMixin):
+class dRadioList(cim.dControlItemMixin, wx.Panel):
"""Creates a group of radio buttons, allowing mutually-exclusive
choices.
Like a dDropdownList, use this to present the user with multiple
choices and
Modified: branches/stable/dabo/ui/uiwx/dSizer.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dSizer.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dSizer.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -3,7 +3,7 @@
import dPemMixin
import dSizerMixin
-class dSizer(wx.BoxSizer, dSizerMixin.dSizerMixin):
+class dSizer(dSizerMixin.dSizerMixin, wx.BoxSizer):
def __init__(self, orientation="h", properties=None, **kwargs ):
# Convert Dabo orientation to wx orientation
self._baseClass = dSizer
Modified: branches/stable/dabo/ui/uiwx/dSlider.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dSlider.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dSlider.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dSlider(wx.Slider, dcm.dDataControlMixin):
+class dSlider(dcm.dDataControlMixin, wx.Slider):
"""Creates a slider control, allowing editing integer values.
Unlike dSpinner, dSlider does not allow entering a value with the
keyboard.
Modified: branches/stable/dabo/ui/uiwx/dSpinner.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dSpinner.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dSpinner.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -9,7 +9,7 @@
from dabo.ui import makeDynamicProperty
-class dSpinner(wx.SpinCtrl, dcm.dDataControlMixin):
+class dSpinner(dcm.dDataControlMixin, wx.SpinCtrl):
"""Creates a spinner, which is a textbox with clickable up/down arrows.
Use this to edit integer values. You can set the maximum and minimum
Modified: branches/stable/dabo/ui/uiwx/dSplitter.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dSplitter.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dSplitter.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -99,7 +99,7 @@
-class dSplitter(wx.SplitterWindow, cm.dControlMixin):
+class dSplitter(cm.dControlMixin, wx.SplitterWindow):
""" Main class for handling split windows. It will contain two
panels (subclass of SplitterPanelMixin), each of which can further
split itself in two.
Modified: branches/stable/dabo/ui/uiwx/dStatusBar.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dStatusBar.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dStatusBar.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -8,7 +8,7 @@
import dControlMixin as dcm
-class dStatusBar(wx.StatusBar, dcm.dControlMixin):
+class dStatusBar(dcm.dControlMixin, wx.StatusBar):
"""Creates a status bar, which displays information to the user.
The status bar is displayed at the bottom of the form. Add the status
bar
Modified: branches/stable/dabo/ui/uiwx/dTextBox.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dTextBox.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dTextBox.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -19,7 +19,7 @@
from dabo.ui import makeDynamicProperty
-class dTextBox(wx.TextCtrl, dcm.dDataControlMixin):
+class dTextBox(dcm.dDataControlMixin, wx.TextCtrl):
"""Creates a text box for editing one line of string data."""
def __init__(self, parent, properties=None, *args, **kwargs):
self._baseClass = dTextBox
Modified: branches/stable/dabo/ui/uiwx/dTimer.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dTimer.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dTimer.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -10,7 +10,7 @@
import dPanel
-class dTimer(wx.Timer, cm.dControlMixin):
+class dTimer(cm.dControlMixin, wx.Timer):
"""Creates a timer, for causing something to happen at regular
intervals."""
def __init__(self, parent=None, properties=None, *args, **kwargs):
self._baseClass = dTimer
Modified: branches/stable/dabo/ui/uiwx/dToggleButton.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dToggleButton.py 2006-12-08 21:58:05 UTC
(rev 2520)
+++ branches/stable/dabo/ui/uiwx/dToggleButton.py 2006-12-09 01:18:49 UTC
(rev 2521)
@@ -11,8 +11,8 @@
from dabo.dLocalize import _
import dabo.dEvents as dEvents
-class dToggleButton(wxb.GenBitmapTextToggleButton, dcm.dDataControlMixin,
- dim.dImageMixin):
+class dToggleButton(dcm.dDataControlMixin, dim.dImageMixin,
+ wxb.GenBitmapTextToggleButton):
"""Creates a button that toggles on and off, for editing boolean values.
This is functionally equivilent to a dCheckbox, but visually much
different.
Modified: branches/stable/dabo/ui/uiwx/dToolBar.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dToolBar.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dToolBar.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -12,7 +12,7 @@
from dabo.ui import makeDynamicProperty
-class dToolBar(wx.ToolBar, cm.dControlMixin):
+class dToolBar(cm.dControlMixin, wx.ToolBar):
"""Creates a toolbar, which is a menu-like collection of icons.
You may also add items to a toolbar such as separators and real Dabo
Modified: branches/stable/dabo/ui/uiwx/dTreeView.py
===================================================================
--- branches/stable/dabo/ui/uiwx/dTreeView.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/dTreeView.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -262,7 +262,7 @@
-class dTreeView(wx.TreeCtrl, dcm.dControlMixin):
+class dTreeView(dcm.dControlMixin, wx.TreeCtrl):
"""Creates a treeview, which allows display of hierarchical data."""
def __init__(self, parent, properties=None, *args, **kwargs):
self._baseClass = dTreeView
Modified: branches/stable/dabo/ui/uiwx/uiApp.py
===================================================================
--- branches/stable/dabo/ui/uiwx/uiApp.py 2006-12-08 21:58:05 UTC (rev
2520)
+++ branches/stable/dabo/ui/uiwx/uiApp.py 2006-12-09 01:18:49 UTC (rev
2521)
@@ -97,7 +97,7 @@
-class uiApp(wx.App, dObject):
+class uiApp(dObject, wx.App):
def __init__(self, app, callback=None, *args):
self.dApp = app
self.callback = callback
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev