Commit ff34e0c6 authored by Taylor Hanayik's avatar Taylor Hanayik
Browse files

add point widget

parent 3964aabc
......@@ -21,7 +21,8 @@ allowedContainerWidgets = (
allowedWidgets = (
*allowedContainerWidgets,
'filepath', 'checkbox', 'choice',
'number', 'button', 'FsleyesImage'
'number', 'button', 'FsleyesImage',
'point'
)
allowedConfigKeys = (
......@@ -175,7 +176,7 @@ def makeWidget(parent, propObj, key, tag, value):
"""
if key in allowedWidgets:
wid = widgetFromKey(key)
print('making widget: ', key)
# print('making widget: ', key)
if isinstance(value, dict):
w = wid(parent, propObj, **value)
else:
......
......@@ -115,6 +115,17 @@ def number(parent, propobj, **kwargs):
panel.GetSizer().Add(prp, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
return panel
def point(parent, propobj, **kwargs):
if kwargs.get('label') == None:
raise fslerrs.MissingRequiredKey("A 'label' key must be provided to a Checkbox")
panel = wx.Panel(parent)
panel.SetSizer(wx.BoxSizer(wx.HORIZONTAL))
st = wx.StaticText(panel, label=kwargs.pop('label'))
panel.GetSizer().Add(st, proportion=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=2)
prp = props.widgets.makeWidget(panel, propobj, **kwargs)
panel.GetSizer().Add(prp, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
return panel
def choice(parent, propobj, **kwargs):
if kwargs.get('label') == None:
raise fslerrs.MissingRequiredKey("A 'label' key must be provided to a Checkbox")
......
......@@ -28,5 +28,4 @@ setup(
package_data={
'fsl': ['gui/icons/*.png'],
},
)
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment