two-stage creation of XRC-based dialogs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -351,12 +351,12 @@ class ParamUnit(PPanel):
|
|||||||
self.Change(-1)
|
self.Change(-1)
|
||||||
|
|
||||||
# Dialog for editing multi-line text
|
# Dialog for editing multi-line text
|
||||||
class TextDialog(wxDialogPtr):
|
class TextDialog(wxDialog):
|
||||||
def __init__(self, parent, value):
|
def __init__(self, parent, value):
|
||||||
# Is this normal???
|
pre = wxPreDialog()
|
||||||
w = g.frame.res.LoadDialog(parent, 'DIALOG_TEXT')
|
g.frame.res.LoadOnDialog(pre, parent, 'DIALOG_TEXT')
|
||||||
wxDialogPtr.__init__(self, w.this)
|
self.this = pre.this
|
||||||
self.thisown = 1
|
self._setOORInfo(self)
|
||||||
self.text = self.FindWindowByName('TEXT')
|
self.text = self.FindWindowByName('TEXT')
|
||||||
self.text.SetValue(value)
|
self.text.SetValue(value)
|
||||||
self.SetAutoLayout(True)
|
self.SetAutoLayout(True)
|
||||||
@@ -432,13 +432,13 @@ class ParamEncoding(ParamText):
|
|||||||
def __init__(self, parent, name):
|
def __init__(self, parent, name):
|
||||||
ParamText.__init__(self, parent, name, 100)
|
ParamText.__init__(self, parent, name, 100)
|
||||||
|
|
||||||
class ContentDialog(wxDialogPtr):
|
class ContentDialog(wxDialog):
|
||||||
def __init__(self, parent, value):
|
def __init__(self, parent, value):
|
||||||
# Load from resource
|
# Load from resource
|
||||||
w = g.frame.res.LoadDialog(parent, 'DIALOG_CONTENT')
|
pre = wxPreDialog()
|
||||||
# Perform initialization with class pointer
|
g.frame.res.LoadOnDialog(pre, parent, 'DIALOG_CONTENT')
|
||||||
wxDialogPtr.__init__(self, w.this)
|
self.this = pre.this
|
||||||
self.thisown = 1
|
self._setOORInfo(self)
|
||||||
self.list = self.FindWindowByName('LIST')
|
self.list = self.FindWindowByName('LIST')
|
||||||
# Set list items
|
# Set list items
|
||||||
for v in value:
|
for v in value:
|
||||||
@@ -483,11 +483,12 @@ class ContentDialog(wxDialogPtr):
|
|||||||
evt.Enable(self.list.GetSelection() != -1 and \
|
evt.Enable(self.list.GetSelection() != -1 and \
|
||||||
self.list.GetSelection() < self.list.Number() - 1)
|
self.list.GetSelection() < self.list.Number() - 1)
|
||||||
|
|
||||||
class ContentCheckListDialog(wxDialogPtr):
|
class ContentCheckListDialog(wxDialog):
|
||||||
def __init__(self, parent, value):
|
def __init__(self, parent, value):
|
||||||
w = g.frame.res.LoadDialog(parent, 'DIALOG_CONTENT_CHECK_LIST')
|
pre = wxPreDialog()
|
||||||
wxDialogPtr.__init__(self, w.this)
|
g.frame.res.LoadOnDialog(pre, parent, 'DIALOG_CONTENT_CHECK_LIST')
|
||||||
self.thisown = 1
|
self.this = pre.this
|
||||||
|
self._setOORInfo(self)
|
||||||
self.list = self.FindWindowByName('CHECK_LIST')
|
self.list = self.FindWindowByName('CHECK_LIST')
|
||||||
# Set list items
|
# Set list items
|
||||||
i = 0
|
i = 0
|
||||||
@@ -615,12 +616,12 @@ class ParamContentCheckList(ParamContent):
|
|||||||
self.textModified = False
|
self.textModified = False
|
||||||
dlg.Destroy()
|
dlg.Destroy()
|
||||||
|
|
||||||
class IntListDialog(wxDialogPtr):
|
class IntListDialog(wxDialog):
|
||||||
def __init__(self, parent, value):
|
def __init__(self, parent, value):
|
||||||
# Is this normal???
|
pre = wxPreDialog()
|
||||||
w = g.frame.res.LoadDialog(parent, 'DIALOG_INTLIST')
|
g.frame.res.LoadOnDialog(pre, parent, 'DIALOG_INTLIST')
|
||||||
wxDialogPtr.__init__(self, w.this)
|
self.this = pre.this
|
||||||
self.thisown = 1
|
self._setOORInfo(self)
|
||||||
self.list = self.FindWindowByName('LIST')
|
self.list = self.FindWindowByName('LIST')
|
||||||
# Set list items
|
# Set list items
|
||||||
value.sort()
|
value.sort()
|
||||||
@@ -784,11 +785,10 @@ class ParamFile(PPanel):
|
|||||||
|
|
||||||
class ParamBitmap(PPanel):
|
class ParamBitmap(PPanel):
|
||||||
def __init__(self, parent, name):
|
def __init__(self, parent, name):
|
||||||
# Load from resource
|
pre = wxPrePanel()
|
||||||
w = g.frame.res.LoadPanel(parent, 'PANEL_BITMAP')
|
g.frame.res.LoadOnPanel(pre, parent, 'PANEL_BITMAP')
|
||||||
# Perform initialization with class pointer
|
self.this = pre.this
|
||||||
wxPanelPtr.__init__(self, w.this)
|
self._setOORInfo(self)
|
||||||
self.thisown = 1
|
|
||||||
self.modified = self.freeze = False
|
self.modified = self.freeze = False
|
||||||
self.SetBackgroundColour(g.panel.GetBackgroundColour())
|
self.SetBackgroundColour(g.panel.GetBackgroundColour())
|
||||||
self.radio_std = self.FindWindowByName('RADIO_STD')
|
self.radio_std = self.FindWindowByName('RADIO_STD')
|
||||||
|
Reference in New Issue
Block a user