Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
1ac79dbf
Commit
1ac79dbf
authored
Jul 09, 2015
by
eric pellegrini
Browse files
Modified configurators widget according to the change in Configurable
class
parent
7831fa64
Changes
21
Show whitespace changes
Inline
Side-by-side
MDANSE/App/GUI/ComboWidgets/ConfigurationPanel.py
View file @
1ac79dbf
import
wx
from
MDANSE
import
REGISTRY
from
MDANSE.Framework.Configurators.IConfigurator
import
ConfiguratorError
class
ConfigurationPanel
(
wx
.
Panel
):
...
...
@@ -19,11 +18,15 @@ class ConfigurationPanel(wx.Panel):
self
.
panelSizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
for
cfgName
,
cfg
in
self
.
_configurable
.
settings
.
items
()
:
configuration
=
self
.
_configurable
.
build_configuration
()
widgetClass
=
REGISTRY
[
"widget"
][
cfg
[
1
].
get
(
'widget'
,
cfg
[
0
])]
for
cfgName
in
self
.
_configurable
.
settings
.
keys
():
self
.
_widgets
[
cfgName
]
=
widgetClass
(
self
,
cfgName
,
self
.
_configurable
)
widget
=
configuration
[
cfgName
].
widget
widgetClass
=
REGISTRY
[
"widget"
][
widget
]
self
.
_widgets
[
cfgName
]
=
widgetClass
(
self
,
cfgName
,
configuration
[
cfgName
])
self
.
panelSizer
.
Add
(
self
.
_widgets
[
cfgName
],
0
,
wx
.
ALL
|
wx
.
EXPAND
,
5
)
...
...
@@ -41,21 +44,21 @@ class ConfigurationPanel(wx.Panel):
return
dict
([(
k
,
v
.
get_value
())
for
k
,
v
in
self
.
_widgets
.
items
()])
def
validate
(
self
):
for
w
in
self
.
_widgets
.
values
():
w
.
SetBackgroundColour
(
wx
.
NullColour
)
w
.
Refresh
()
try
:
self
.
_configurable
.
parameters
=
self
.
get_value
()
except
ConfiguratorError
as
e
:
d
=
wx
.
MessageDialog
(
self
,
str
(
e
),
style
=
wx
.
ICON_ERROR
|
wx
.
STAY_ON_TOP
|
wx
.
CENTRE
)
d
.
ShowModal
()
w
=
self
.
_widgets
[
e
.
configurator
.
name
]
w
.
SetBackgroundColour
(
"Pink"
)
w
.
Refresh
()
w
.
SetFocus
()
return
False
else
:
return
True
#
def validate(self):
#
#
for w in self._widgets.values():
#
w.SetBackgroundColour(wx.NullColour)
#
w.Refresh()
#
#
try:
#
self._configurable.parameters = self.get_value()
#
except ConfiguratorError as e:
#
d = wx.MessageDialog(self, str(e), style=wx.ICON_ERROR|wx.STAY_ON_TOP|wx.CENTRE)
#
d.ShowModal()
#
w = self._widgets[e.configurator.name]
#
w.SetBackgroundColour("Pink")
#
w.Refresh()
#
w.SetFocus()
#
return False
#
else:
#
return True
MDANSE/App/GUI/Framework/Widgets/AtomSelectionWidget.py
View file @
1ac79dbf
...
...
@@ -38,7 +38,6 @@ import wx
from
MDANSE
import
LOGGER
,
REGISTRY
from
MDANSE.Externals.pubsub
import
pub
from
MDANSE.Framework.AtomSelectionParser
import
AtomSelectionParser
,
AtomSelectionParserError
from
MDANSE.Framework.Configurable
import
ConfigurationError
from
MDANSE.MolecularDynamics.Trajectory
import
sorted_atoms
from
MDANSE.App.GUI.Framework.Widgets.UserDefinitionWidget
import
UserDefinitionsDialog
,
UserDefinitionWidget
...
...
@@ -390,6 +389,15 @@ class AtomSelectionWidget(UserDefinitionWidget):
dlg
.
Show
()
def
get_widget_value
(
self
):
ud
=
self
.
_availableUDs
.
GetStringSelection
()
if
not
ud
:
return
'all'
else
:
return
str
(
ud
)
if
__name__
==
"__main__"
:
from
MMTK.Trajectory
import
Trajectory
...
...
MDANSE/App/GUI/Framework/Widgets/AtomTransmutationWidget.py
View file @
1ac79dbf
...
...
@@ -34,7 +34,8 @@ import wx
from
MDANSE
import
ELEMENTS
,
LOGGER
from
MDANSE.App.GUI.Framework.Widgets.AtomSelectionWidget
import
AtomSelectionDialog
,
AtomSelectionWidget
from
MDANSE.App.GUI.Framework.Widgets.UserDefinitionWidget
import
UserDefinitionWidget
from
MDANSE.App.GUI.Framework.Widgets.AtomSelectionWidget
import
AtomSelectionDialog
class
AtomTransmutationDialog
(
AtomSelectionDialog
):
...
...
@@ -60,7 +61,7 @@ class AtomTransmutationDialog(AtomSelectionDialog):
return
{
'transmutation'
:
{
'element'
:
element
,
'selection'
:
self
.
_selection
}}
class
AtomTransmutationWidget
(
AtomSelec
tionWidget
):
class
AtomTransmutationWidget
(
UserDefini
tionWidget
):
type
=
"atom_transmutation"
...
...
@@ -70,6 +71,15 @@ class AtomTransmutationWidget(AtomSelectionWidget):
dlg
.
Show
()
def
get_widget_value
(
self
):
ud
=
self
.
_availableUDs
.
GetStringSelection
()
if
not
ud
:
return
None
else
:
return
str
(
ud
)
if
__name__
==
"__main__"
:
from
MMTK.Trajectory
import
Trajectory
...
...
MDANSE/App/GUI/Framework/Widgets/AtomsListWidget.py
View file @
1ac79dbf
...
...
@@ -166,11 +166,11 @@ class AtomListWidget(UserDefinitionWidget):
UserDefinitionWidget
.
initialize
(
self
)
self
.
type
=
"%d_atoms_list"
%
self
.
configurator
.
nAtoms
self
.
type
=
"%d_atoms_list"
%
self
.
_
configurator
.
nAtoms
def
on_new_user_definition
(
self
,
event
):
atomsListDlg
=
AtomsListDialog
(
self
,
self
.
_trajectory
,
self
.
configurat
or
.
nAtoms
)
atomsListDlg
=
AtomsListDialog
(
self
,
self
.
_trajectory
,
self
.
configurat
ion
[
self
.
_name
]
.
nAtoms
)
atomsListDlg
.
ShowModal
()
...
...
MDANSE/App/GUI/Framework/Widgets/BooleanWidget.py
View file @
1ac79dbf
...
...
@@ -42,10 +42,8 @@ class BooleanWidget(IWidget):
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
default
=
self
.
configurator
.
default
self
.
_boolean
=
wx
.
CheckBox
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
label
=
"Yes"
)
self
.
_boolean
.
SetValue
(
default
)
self
.
_boolean
.
SetValue
(
self
.
_configurator
.
default
)
sizer
.
Add
(
self
.
_boolean
,
1
,
wx
.
ALL
|
wx
.
EXPAND
,
5
)
...
...
MDANSE/App/GUI/Framework/Widgets/FloatWidget.py
View file @
1ac79dbf
...
...
@@ -44,7 +44,7 @@ class FloatWidget(StringWidget):
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
_float
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
str
(
self
.
configurator
.
default
))
self
.
_float
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
str
(
self
.
_
configurator
.
default
))
sizer
.
Add
(
self
.
_float
,
0
,
wx
.
ALL
,
5
)
...
...
@@ -53,9 +53,8 @@ class FloatWidget(StringWidget):
def
get_widget_value
(
self
):
try
:
_
=
float
(
self
.
_float
.
GetValue
())
val
=
float
(
self
.
_float
.
GetValue
())
except
ValueError
:
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
configurator
.
name
)
val
=
self
.
_float
.
GetValue
()
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
name
)
else
:
return
val
MDANSE/App/GUI/Framework/Widgets/IWidget.py
View file @
1ac79dbf
...
...
@@ -42,7 +42,7 @@ class IWidget(wx.Panel):
type
=
"widget"
def
__init__
(
self
,
parent
,
name
,
configura
ble
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
parent
,
name
,
configura
tor
,
*
args
,
**
kwargs
):
wx
.
Panel
.
__init__
(
self
,
parent
,
wx
.
ID_ANY
,
*
args
,
**
kwargs
)
...
...
@@ -50,20 +50,14 @@ class IWidget(wx.Panel):
self
.
_name
=
name
self
.
_configura
ble
=
configura
ble
self
.
_configura
tor
=
configura
tor
self
.
_configurator
=
self
.
_configurable
.
configurators
[
name
]
self
.
_label
=
self
.
_configurator
.
label
self
.
_label
=
name
self
.
initialize
()
self
.
build_panel
()
@
property
def
configurator
(
self
):
return
self
.
_configurator
@
property
def
label
(
self
):
return
self
.
_label
...
...
MDANSE/App/GUI/Framework/Widgets/InputDirectoryWidget.py
View file @
1ac79dbf
...
...
@@ -41,12 +41,12 @@ class InputDirectoryWidget(IWidget):
def
add_widgets
(
self
):
cfg
=
self
.
configurator
default
=
self
.
_
configurator
.
default
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
_dirname
=
wxfile
.
DirBrowseButton
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
startDirectory
=
cfg
.
default
,
newDirectory
=
True
)
self
.
_dirname
.
SetValue
(
cfg
.
default
)
self
.
_dirname
=
wxfile
.
DirBrowseButton
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
startDirectory
=
default
,
newDirectory
=
True
)
self
.
_dirname
.
SetValue
(
default
)
sizer
.
Add
(
self
.
_dirname
,
1
,
wx
.
ALL
|
wx
.
EXPAND
,
0
)
...
...
MDANSE/App/GUI/Framework/Widgets/InputFileWidget.py
View file @
1ac79dbf
...
...
@@ -43,11 +43,12 @@ class InputFileWidget(IWidget):
def
add_widgets
(
self
):
cfg
=
self
.
configurator
default
=
self
.
_configurator
.
default
wildcard
=
self
.
_configurator
.
wildcard
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
_browser
=
wxfile
.
FileBrowseButton
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
labelText
=
""
,
initialValue
=
cfg
.
default
,
startDirectory
=
cfg
.
default
,
fileMask
=
cfg
.
wildcard
)
self
.
_browser
=
wxfile
.
FileBrowseButton
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
labelText
=
""
,
initialValue
=
default
,
startDirectory
=
default
,
fileMask
=
wildcard
)
sizer
.
Add
(
self
.
_browser
,
1
,
wx
.
ALL
|
wx
.
EXPAND
,
5
)
...
...
MDANSE/App/GUI/Framework/Widgets/InstrumentResolutionWidget.py
View file @
1ac79dbf
...
...
@@ -191,7 +191,7 @@ class InstrumentResolutionConfigurator(IWidget):
sizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
_resolution
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
str
(
self
.
configurator
.
default
))
self
.
_resolution
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
str
(
self
.
_
configurator
.
default
))
self
.
_setResolution
=
wx
.
Button
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
label
=
"Set"
)
self
.
_setResolution
.
Enable
(
False
)
...
...
@@ -212,7 +212,7 @@ class InstrumentResolutionConfigurator(IWidget):
def
on_set_instrument_resolution
(
self
,
event
):
frameCfgName
=
self
.
configurator
.
dependencies
[
"frames"
]
frameCfgName
=
self
.
_
configurator
.
dependencies
[
"frames"
]
time
=
self
.
Parent
.
widgets
[
frameCfgName
].
time
timeStep
=
time
[
1
]
-
time
[
0
]
nSteps
=
len
(
time
)
...
...
MDANSE/App/GUI/Framework/Widgets/IntegerWidget.py
View file @
1ac79dbf
...
...
@@ -45,7 +45,7 @@ class IntegerWidget(IWidget):
cfg
=
self
.
_configurator
if
cfg
.
choices
:
if
self
.
_configurator
.
choices
:
self
.
_integer
=
wx
.
SpinCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
min
=
cfg
.
choices
[
0
],
max
=
cfg
.
choices
[
-
1
],
initial
=
cfg
.
default
,
style
=
wx
.
SP_ARROW_KEYS
|
wx
.
SP_WRAP
)
else
:
self
.
_integer
=
wxintctrl
.
IntCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
cfg
.
default
,
min
=
cfg
.
mini
,
max
=
cfg
.
maxi
,
limited
=
True
,
allow_none
=
False
,
style
=
wx
.
ALIGN_RIGHT
)
...
...
MDANSE/App/GUI/Framework/Widgets/InterpolationOrderWidget.py
View file @
1ac79dbf
...
...
@@ -47,19 +47,16 @@ class InterpolationOrderWidget(IWidget):
label
=
wx
.
StaticText
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
label
=
"interpolation order"
)
self
.
_interpolationOrder
=
wx
.
Choice
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
choices
=
self
.
configurator
.
orders
)
self
.
_interpolationOrder
.
SetStringSelection
(
InterpolationOrderWidget
.
orders
[
self
.
configurator
.
default
])
self
.
_interpolationOrder
=
wx
.
Choice
(
self
.
_widgetPanel
,
wx
.
ID_ANY
)
sizer
.
Add
(
label
,
0
,
wx
.
ALL
|
wx
.
ALIGN_CENTER_VERTICAL
,
5
)
sizer
.
Add
(
self
.
_interpolationOrder
,
0
,
wx
.
ALL
,
5
)
pub
.
subscribe
(
self
.
set_wigdet_value
,
(
"set_trajectory"
))
self
.
_interpolationOrder
.
SetValue
(
self
.
configurator
.
orders
[
0
])
pub
.
subscribe
(
self
.
on_set_trajectory
,
(
"set_trajectory"
))
return
sizer
def
set_
wigdet_value
(
self
,
message
):
def
on_
set_
trajectory
(
self
,
message
):
window
,
filename
=
message
...
...
@@ -69,9 +66,11 @@ class InterpolationOrderWidget(IWidget):
trajectory
=
DATA_CONTROLLER
[
filename
]
if
"velocities"
in
trajectory
.
data
.
variables
():
self
.
_interpolationOrder
.
Set
StringSelection
(
self
.
configurator
.
order
s
)
self
.
_interpolationOrder
.
Set
Items
(
self
.
_
configurator
.
choice
s
)
else
:
self
.
_interpolationOrder
.
SetStringSelection
(
self
.
configurator
.
orders
[
1
:])
self
.
_interpolationOrder
.
SetItems
(
self
.
_configurator
.
choices
[
1
:])
self
.
_interpolationOrder
.
SetStringSelection
(
self
.
_configurator
.
choices
[
0
])
def
get_widget_value
(
self
):
...
...
MDANSE/App/GUI/Framework/Widgets/McStasOptionsWidget.py
View file @
1ac79dbf
...
...
@@ -34,7 +34,7 @@ import wx
from
MDANSE.Framework.Jobs.McStasVirtualInstrument
import
McStasOptions
from
MDANSE.App.GUI.Framework.Widgets.IWidget
import
IWidget
from
MDANSE.App.GUI.ConfigurationPanel
import
ConfigurationPanel
from
MDANSE.App.GUI.
ComboWidgets.
ConfigurationPanel
import
ConfigurationPanel
class
McStasOptionsConfiguratorWidget
(
IWidget
):
...
...
MDANSE/App/GUI/Framework/Widgets/McStasParametersWidget.py
View file @
1ac79dbf
...
...
@@ -36,7 +36,7 @@ from MDANSE.Externals.pubsub import pub
from
MDANSE.Framework.Configurable
import
ConfigurationError
from
MDANSE.Framework.Jobs.McStasVirtualInstrument
import
McStasParameters
from
MDANSE.App.GUI.ConfigurationPanel
import
ConfigurationPanel
from
MDANSE.App.GUI.
ComboWidgets.
ConfigurationPanel
import
ConfigurationPanel
from
MDANSE.App.GUI.Framework.Widgets.IWidget
import
IWidget
class
McStasParametersWidget
(
IWidget
):
...
...
@@ -63,14 +63,14 @@ class McStasParametersWidget(IWidget):
if
not
window
in
self
.
Parent
.
widgets
.
values
():
return
for
k
in
self
.
configurator
.
exclude
:
for
k
in
self
.
_
configurator
.
exclude
:
parameters
.
pop
(
k
)
self
.
_mcstasParameters
=
McStasParameters
()
for
name
,
value
in
parameters
.
items
():
typ
,
default
=
value
self
.
_mcstasParameters
.
configurator
s
[
name
]
=
(
self
.
_mcStasTypes
[
typ
],
{
"default"
:
default
})
self
.
_mcstasParameters
.
setting
s
[
name
]
=
(
self
.
_mcStasTypes
[
typ
],
{
"default"
:
default
})
self
.
_sizer
.
Clear
(
deleteWindows
=
True
)
...
...
MDANSE/App/GUI/Framework/Widgets/MultipleChoicesWidget.py
View file @
1ac79dbf
...
...
@@ -43,10 +43,12 @@ class MultipleChoicesWidget(IWidget):
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
_choices
=
wx
.
combo
.
ComboCtrl
(
self
.
_widgetPanel
,
value
=
self
.
configurator
.
label
,
style
=
wx
.
CB_READONLY
)
tcp
=
ComboCheckbox
(
self
.
configurator
.
choices
,
self
.
configurator
.
nChoices
)
cfg
=
self
.
_configurator
self
.
_choices
=
wx
.
combo
.
ComboCtrl
(
self
.
_widgetPanel
,
value
=
cfg
.
label
,
style
=
wx
.
CB_READONLY
)
tcp
=
ComboCheckbox
(
cfg
.
choices
,
cfg
.
nChoices
)
self
.
_choices
.
SetPopupControl
(
tcp
)
tcp
.
checklistbox
.
SetCheckedStrings
(
self
.
configurator
.
default
)
tcp
.
checklistbox
.
SetCheckedStrings
(
cfg
.
default
)
sizer
.
Add
(
self
.
_choices
,
1
,
wx
.
ALL
|
wx
.
EXPAND
,
5
)
...
...
MDANSE/App/GUI/Framework/Widgets/ProjectionWidget.py
View file @
1ac79dbf
...
...
@@ -110,7 +110,7 @@ class ProjectionWidget(IWidget):
try
:
val
=
(
"axial"
,
tuple
([
float
(
v
.
GetValue
())
for
v
in
(
self
.
_ax
,
self
.
_ay
,
self
.
_az
)]))
except
ValueError
:
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
configurator
.
name
)
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
name
)
else
:
return
val
...
...
@@ -118,7 +118,7 @@ class ProjectionWidget(IWidget):
try
:
val
=
(
"planar"
,
tuple
([
v
.
GetValue
()
for
v
in
(
self
.
_px
,
self
.
_py
,
self
.
_pz
)]))
except
ValueError
:
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
configurator
.
name
)
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
name
)
else
:
return
val
...
...
MDANSE/App/GUI/Framework/Widgets/PythonObjectWidgets.py
View file @
1ac79dbf
...
...
@@ -44,7 +44,7 @@ class PythonObjectWidget(IWidget):
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
_string
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
repr
(
self
.
configurator
.
default
))
self
.
_string
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
repr
(
self
.
_
configurator
[
self
.
_name
]
.
default
))
sizer
.
Add
(
self
.
_string
,
0
,
wx
.
ALL
,
5
)
...
...
MDANSE/App/GUI/Framework/Widgets/RangeWidget.py
View file @
1ac79dbf
...
...
@@ -54,11 +54,11 @@ class RangeWidget(IWidget):
self
.
_last
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
)
self
.
_step
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
)
cfg
=
self
.
configurator
first
,
last
,
step
=
self
.
_
configurator
.
default
self
.
_first
.
SetValue
(
str
(
cfg
.
default
[
0
]
))
self
.
_last
.
SetValue
(
str
(
cfg
.
default
[
1
]
))
self
.
_step
.
SetValue
(
str
(
cfg
.
default
[
2
]
))
self
.
_first
.
SetValue
(
str
(
first
))
self
.
_last
.
SetValue
(
str
(
last
))
self
.
_step
.
SetValue
(
str
(
step
))
gbSizer
.
Add
(
firstLabel
,
(
0
,
0
),
flag
=
wx
.
ALIGN_CENTER_VERTICAL
)
gbSizer
.
Add
(
labelLabel
,
(
0
,
3
),
flag
=
wx
.
ALIGN_CENTER_VERTICAL
)
...
...
@@ -75,10 +75,10 @@ class RangeWidget(IWidget):
def
get_widget_value
(
self
):
try
:
val
=
(
self
.
configurator
.
valueType
(
self
.
_first
.
GetValue
()),
self
.
configurator
.
valueType
(
self
.
_last
.
GetValue
()),
self
.
configurator
.
valueType
(
self
.
_step
.
GetValue
()))
val
=
(
self
.
_
configurator
.
valueType
(
self
.
_first
.
GetValue
()),
self
.
_
configurator
.
valueType
(
self
.
_last
.
GetValue
()),
self
.
_
configurator
.
valueType
(
self
.
_step
.
GetValue
()))
except
ValueError
:
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
configurator
.
name
)
raise
ConfigurationError
(
"Invalid value for %r entry"
%
self
.
name
)
else
:
return
val
MDANSE/App/GUI/Framework/Widgets/SingleChoiceWidget.py
View file @
1ac79dbf
...
...
@@ -42,8 +42,8 @@ class SingleChoiceWidget(IWidget):
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
_choices
=
wx
.
Choice
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
choices
=
self
.
configurator
.
choices
)
self
.
_choices
.
SetStringSelection
(
self
.
configurator
.
default
)
self
.
_choices
=
wx
.
Choice
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
choices
=
self
.
_
configurator
.
choices
)
self
.
_choices
.
SetStringSelection
(
self
.
_
configurator
.
default
)
sizer
.
Add
(
self
.
_choices
,
1
,
wx
.
ALL
|
wx
.
EXPAND
,
5
)
...
...
MDANSE/App/GUI/Framework/Widgets/StringWidget.py
View file @
1ac79dbf
...
...
@@ -42,7 +42,7 @@ class StringWidget(IWidget):
sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
_string
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
self
.
configurator
.
default
)
self
.
_string
=
wx
.
TextCtrl
(
self
.
_widgetPanel
,
wx
.
ID_ANY
,
value
=
self
.
_
configurator
.
default
)
sizer
.
Add
(
self
.
_string
,
0
,
wx
.
ALL
,
5
)
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment