forked from BhallaLab/moose-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SettingsDialog.py
81 lines (65 loc) · 2.27 KB
/
SettingsDialog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- coding: utf-8 -*-
from __future__ import print_function
"""Dialog for settings. Currently only plot settings are supported
"""
__author__ = "Aviral Goel"
__credits__ = ["Upi Lab"]
__license__ = "GPL3"
__version__ = "1.0.0"
__maintainer__ = "Aviral Goel"
__email__ = "goel.aviral@gmail.com"
__status__ = "Development"
import sys
import os
from PyQt4 import QtGui, Qt
from PyQt4.QtGui import QWidget
from PyQt4.QtGui import QLabel
from PyQt4.QtGui import QComboBox
from PyQt4.QtGui import QGridLayout
from PyQt4.QtGui import QTabWidget
class SettingsWidget(QTabWidget):
def __init__( self
, plotFieldMap
, parent = None
):
super(SettingsWidget, self).__init__(parent)
self.plotFieldMap = plotFieldMap
self.addTab(self.plotSettingsPage(),"Plot Settings");
self.addTab(self.plotSettingsPage(),"Other Settings");
def plotSettingsPage(self):
page = QWidget()
layout = QGridLayout()
page.setLayout(layout)
index = 0
for key, values in self.plotFieldMap.iteritems() :
label = QLabel(key, page)
combo = QComboBox(page)
for value in values:
combo.addItem(value)
layout.addWidget(label,index,0, Qt.Qt.AlignRight)
layout.addWidget(combo,index,1, Qt.Qt.AlignLeft)
index += 1
return page
# combo.move(50, 50)
# self.lbl.move(50, 150)
# combo.activated[str].connect(self.onActivated)
# self.setGeometry(300, 300, 300, 200)
# self.setWindowTitle('QtGui.QComboBox')
# self.show()
def main():
app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()
dialog = SettingsWidget({
'LeakyIaF':['Vm'],
'Compartment':['Vm','Im'],
'HHChannel':['Ik','Gk'],
'ZombiePool':['n','conc'],
'ZombieBufPool':['n','conc'],
'HHChannel2D':['Ik','Gk'],
'CaConc':['Ca']
}
)
dialog.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()