Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslgui
Commits
ff34e0c6
Commit
ff34e0c6
authored
Jun 02, 2020
by
Taylor Hanayik
Browse files
add point widget
parent
3964aabc
Changes
3
Hide whitespace changes
Inline
Side-by-side
fsl/gui/core.py
View file @
ff34e0c6
...
@@ -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
:
...
...
fsl/gui/widgets.py
View file @
ff34e0c6
...
@@ -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"
)
...
...
setup.py
View file @
ff34e0c6
...
@@ -28,5 +28,4 @@ setup(
...
@@ -28,5 +28,4 @@ setup(
package_data
=
{
package_data
=
{
'fsl'
:
[
'gui/icons/*.png'
],
'fsl'
:
[
'gui/icons/*.png'
],
},
},
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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