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

add point widget

parent 3964aabc
...@@ -21,7 +21,8 @@ allowedContainerWidgets = ( ...@@ -21,7 +21,8 @@ allowedContainerWidgets = (
allowedWidgets = ( allowedWidgets = (
*allowedContainerWidgets, *allowedContainerWidgets,
'filepath', 'checkbox', 'choice', 'filepath', 'checkbox', 'choice',
'number', 'button', 'FsleyesImage' 'number', 'button', 'FsleyesImage',
'point'
) )
allowedConfigKeys = ( allowedConfigKeys = (
...@@ -175,7 +176,7 @@ def makeWidget(parent, propObj, key, tag, value): ...@@ -175,7 +176,7 @@ def makeWidget(parent, propObj, key, tag, value):
""" """
if key in allowedWidgets: if key in allowedWidgets:
wid = widgetFromKey(key) wid = widgetFromKey(key)
print('making widget: ', key) # print('making widget: ', key)
if isinstance(value, dict): if isinstance(value, dict):
w = wid(parent, propObj, **value) w = wid(parent, propObj, **value)
else: else:
......
...@@ -115,6 +115,17 @@ def number(parent, propobj, **kwargs): ...@@ -115,6 +115,17 @@ def number(parent, propobj, **kwargs):
panel.GetSizer().Add(prp, proportion=0, flag=wx.ALL | wx.EXPAND, border=5) panel.GetSizer().Add(prp, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
return panel 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): def choice(parent, propobj, **kwargs):
if kwargs.get('label') == None: if kwargs.get('label') == None:
raise fslerrs.MissingRequiredKey("A 'label' key must be provided to a Checkbox") raise fslerrs.MissingRequiredKey("A 'label' key must be provided to a Checkbox")
......
...@@ -28,5 +28,4 @@ setup( ...@@ -28,5 +28,4 @@ setup(
package_data={ package_data={
'fsl': ['gui/icons/*.png'], '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