本文整理汇总了Python中PM.PM_ToolButton.PM_ToolButton类的典型用法代码示例。如果您正苦于以下问题:Python PM_ToolButton类的具体用法?Python PM_ToolButton怎么用?Python PM_ToolButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PM_ToolButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _loadAddRemoveButtons
def _loadAddRemoveButtons(self):
"""
"""
self._addToolButton = PM_ToolButton(
self,
text = "Add items to the list",
iconPath = self._addIcon,
spanWidth = True )
self._addToolButton.setCheckable(True)
self._addToolButton.setAutoRaise(True)
self._removeToolButton = PM_ToolButton(
self,
text = "Remove items from the list",
iconPath = self._removeIcon,
spanWidth = True )
self._removeToolButton.setCheckable(True)
self._removeToolButton.setAutoRaise(True)
#Widgets to include in the widget row.
widgetList = [
('QLabel', " Add/Remove Items:", 0),
('QSpacerItem', 5, 5, 1),
('PM_ToolButton', self._addToolButton, 2),
('QSpacerItem', 5, 5, 3),
('PM_ToolButton', self._removeToolButton, 4),
('QSpacerItem', 5, 5, 5) ]
widgetRow = PM_WidgetRow(self,
title = '',
widgetList = widgetList,
label = "",
spanWidth = True )
示例2: _loadMovieFilesGroupBox
def _loadMovieFilesGroupBox(self, inPmGroupBox):
"""
Load widgets in the Open/Save Movie Files group box.
@param inPmGroupBox: The Open/Save Movie Files groupbox in the PM
@type inPmGroupBox: L{PM_GroupBox}
"""
for action in self.fileOpenMovieAction, self.fileSaveMovieAction:
btn = PM_ToolButton(inPmGroupBox,
text = str(action.text()),
spanWidth = True)
btn.setDefaultAction(action)
btn.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
示例3: _loadGroupBox1
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box 1.
"""
#Following toolbutton facilitates entering a temporary NanotubeLineMode
#to create a CNT using endpoints of the specified line.
self.specifyCntLineButton = PM_ToolButton(
pmGroupBox,
text = "Specify Endpoints",
iconPath = "ui/actions/Properties Manager/Pencil.png",
spanWidth = True
)
self.specifyCntLineButton.setCheckable(True)
self.specifyCntLineButton.setAutoRaise(True)
self.specifyCntLineButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
#EndPoint1 and endPoint2 coordinates. These widgets are hidden
# as of 2007- 12 - 05
self._endPoint1SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
label = "End Point 1")
self.x1SpinBox = self._endPoint1SpinBoxes.xSpinBox
self.y1SpinBox = self._endPoint1SpinBoxes.ySpinBox
self.z1SpinBox = self._endPoint1SpinBoxes.zSpinBox
self._endPoint2SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
label = "End Point 2")
self.x2SpinBox = self._endPoint2SpinBoxes.xSpinBox
self.y2SpinBox = self._endPoint2SpinBoxes.ySpinBox
self.z2SpinBox = self._endPoint2SpinBoxes.zSpinBox
self._endPoint1SpinBoxes.hide()
self._endPoint2SpinBoxes.hide()
示例4: _loadGroupBox1
def _loadGroupBox1(self, pmGroupBox):
"""
load widgets in groupbox1
"""
self.segmentListWidget = PM_SelectionListWidget(
pmGroupBox,
self.win,
label = "",
heightByRows = 12)
self.segmentListWidget.setFocusPolicy(Qt.StrongFocus)
self.segmentListWidget.setFocus()
self.setFocusPolicy(Qt.StrongFocus)
self.addSegmentsToolButton = PM_ToolButton(
pmGroupBox,
text = "Add segments to the list",
iconPath = "ui/actions/Properties Manager"\
"/AddSegment_To_ResizeSegmentList.png",
spanWidth = True )
self.addSegmentsToolButton.setCheckable(True)
self.addSegmentsToolButton.setAutoRaise(True)
self.removeSegmentsToolButton = PM_ToolButton(
pmGroupBox,
text = "Remove segments from the list",
iconPath = "ui/actions/Properties Manager"\
"/RemoveSegment_From_ResizeSegmentList.png",
spanWidth = True )
self.removeSegmentsToolButton.setCheckable(True)
self.removeSegmentsToolButton.setAutoRaise(True)
#Widgets to include in the widget row.
widgetList = [
('QLabel', " Add/Remove Segments:", 0),
('QSpacerItem', 5, 5, 1),
('PM_ToolButton', self.addSegmentsToolButton, 2),
('QSpacerItem', 5, 5, 3),
('PM_ToolButton', self.removeSegmentsToolButton, 4),
('QSpacerItem', 5, 5, 5) ]
widgetRow = PM_WidgetRow(pmGroupBox,
title = '',
widgetList = widgetList,
label = "",
spanWidth = True )
示例5: _loadGroupBox2
def _loadGroupBox2(self, pmGroupBox):
"""
Load widgets in 2nd group box.
@param pmGroupBox: The 1st group box in the PM.
@type pmGroupBox: L{PM_GroupBox}
"""
self.launchQuteMolButton = PM_ToolButton(
pmGroupBox,
text = "Launch QuteMolX",
iconPath = "ui/actions/Properties Manager/QuteMol.png",
spanWidth = True )
self.launchQuteMolButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
示例6: Ui_MovePropertyManager
#.........这里部分代码省略.........
"""
Load widgets in the Free Drag Translate group box, which is present
within the Translate groupbox.
@param inPmGroupBox: The Free Drag Translate group box in the Translate
group box.
@type inPmGroupBox: L{PM_GroupBox}
"""
# Button list to create a toolbutton row.
# Format:
# - buttonId,
# - buttonText ,
# - iconPath
# - tooltip
# - shortcut
# - column
BUTTON_LIST = [
( "QToolButton", 1, "MOVEDEFAULT",
"ui/actions/Properties Manager/Move_Free.png", "", "F", 0),
( "QToolButton", 2, "TRANSX",
"ui/actions/Properties Manager/TranslateX.png", "", "X", 1),
( "QToolButton", 3, "TRANSY",
"ui/actions/Properties Manager/TranslateY.png", "", "Y", 2),
( "QToolButton", 4, "TRANSZ",
"ui/actions/Properties Manager/TranslateZ.png", "", "Z", 3),
( "QToolButton", 5, "ROT_TRANS_ALONG_AXIS",
"ui/actions/Properties Manager/translate+rotate-A.png", "", \
"A", 4)
]
self.freeDragTranslateButtonGroup = \
PM_ToolButtonRow( inPmGroupBox,
title = "",
buttonList = BUTTON_LIST,
checkedId = 1,
setAsDefault = True,
)
self.transFreeButton =self.freeDragTranslateButtonGroup.getButtonById(1)
self.transXButton = self.freeDragTranslateButtonGroup.getButtonById(2)
self.transYButton = self.freeDragTranslateButtonGroup.getButtonById(3)
self.transZButton = self.freeDragTranslateButtonGroup.getButtonById(4)
self.transAlongAxisButton = \
self.freeDragTranslateButtonGroup.getButtonById(5)
self.moveFromToButton = PM_ToolButton(
inPmGroupBox,
text = "Translate from/to",
iconPath = "ui/actions/Properties Manager"\
"/Translate_Components.png",
spanWidth = True
)
self.moveFromToButton.setCheckable(True)
self.moveFromToButton.setAutoRaise(True)
self.moveFromToButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
self.startCoordLineEdit = PM_LineEdit(
inPmGroupBox,
label = "ui/actions/Properties Manager"\
"/Move_Start_Point.png",
text = "Define 'from' and 'to' points",
setAsDefault = False,
示例7: _loadFreeDragRotateGroupBox
def _loadFreeDragRotateGroupBox(self, inPmGroupBox):
"""
Load widgets in the Free Drag Rotate group box, which is
present within the Rotate groupbox.
@param inPmGroupBox: The Free Drag Rotate group box in the Rotate
group box.
@type inPmGroupBox: L{PM_GroupBox}
"""
# Button list to create a toolbutton row.
# Format:
# - buttonId,
# - buttonText ,
# - iconPath
# - tooltip
# - shortcut
# - column
BUTTON_LIST = [
( "QToolButton", 1, "ROTATEDEFAULT",
"ui/actions/Properties Manager/Rotate_Free.png", "", "F", 0 ),
( "QToolButton", 2, "ROTATEX",
"ui/actions/Properties Manager/RotateX.png", "", "X", 1 ),
( "QToolButton", 3, "ROTATEY",
"ui/actions/Properties Manager/RotateY.png", "", "Y", 2 ),
( "QToolButton", 4, "ROTATEZ",
"ui/actions/Properties Manager/RotateZ.png", "", "Z", 3 ),
( "QToolButton", 5, "ROT_TRANS_ALONG_AXIS",
"ui/actions/Properties Manager/translate+rotate-A.png", "", \
"A", 4 )
]
self.freeDragRotateButtonGroup = \
PM_ToolButtonRow( inPmGroupBox,
title = "",
buttonList = BUTTON_LIST,
spanWidth = True,
checkedId = 1,
setAsDefault = True,
)
self.rotateFreeButton = self.freeDragRotateButtonGroup.getButtonById(1)
self.rotateXButton = self.freeDragRotateButtonGroup.getButtonById(2)
self.rotateYButton = self.freeDragRotateButtonGroup.getButtonById(3)
self.rotateZButton = self.freeDragRotateButtonGroup.getButtonById(4)
self.rotAlongAxisButton = \
self.freeDragRotateButtonGroup.getButtonById(5)
inPmGroupBox.setStyleSheet(
self.freeDragRotateButtonGroup._getStyleSheet())
X_ROW_LABELS = [("QLabel", "Delta Theta X:", 0),
("QLabel", "", 1),
("QLabel", "0.00", 2),
("QLabel", "Degrees", 3)]
Y_ROW_LABELS = [("QLabel", "Delta Theta Y:", 0),
("QLabel", "", 1),
("QLabel", "0.00", 2),
("QLabel", "Degrees", 3)]
Z_ROW_LABELS = [("QLabel", "Delta Theta Z:", 0),
("QLabel", "", 1),
("QLabel", "0.00", 2),
("QLabel", "Degrees", 3)]
self.rotateXLabelRow = PM_LabelRow( inPmGroupBox,
title = "",
labelList = X_ROW_LABELS )
self.deltaThetaX_lbl = self.rotateXLabelRow.labels[2]
self.rotateYLabelRow = PM_LabelRow( inPmGroupBox,
title = "",
labelList = Y_ROW_LABELS )
self.deltaThetaY_lbl = self.rotateYLabelRow.labels[2]
self.rotateZLabelRow = PM_LabelRow( inPmGroupBox,
title = "",
labelList = Z_ROW_LABELS )
self.deltaThetaZ_lbl = self.rotateZLabelRow.labels[2]
self.rotateAboutPointButton = PM_ToolButton(
inPmGroupBox,
text = "Rotate selection about a point",
iconPath = "ui/actions/Properties Manager"\
"/Rotate_Components.png",
spanWidth = True
)
self.rotateAboutPointButton.setCheckable(True)
self.rotateAboutPointButton.setAutoRaise(True)
self.rotateAboutPointButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
self.rotateStartCoordLineEdit = PM_LineEdit(
inPmGroupBox,
#.........这里部分代码省略.........
示例8: _loadFreeDragTranslateGroupBox
def _loadFreeDragTranslateGroupBox(self, inPmGroupBox):
"""
Load widgets in the Free Drag Translate group box, which is present
within the Translate groupbox.
@param inPmGroupBox: The Free Drag Translate group box in the Translate
group box.
@type inPmGroupBox: L{PM_GroupBox}
"""
# Button list to create a toolbutton row.
# Format:
# - buttonId,
# - buttonText ,
# - iconPath
# - tooltip
# - shortcut
# - column
BUTTON_LIST = [
( "QToolButton", 1, "MOVEDEFAULT",
"ui/actions/Properties Manager/Move_Free.png", "", "F", 0),
( "QToolButton", 2, "TRANSX",
"ui/actions/Properties Manager/TranslateX.png", "", "X", 1),
( "QToolButton", 3, "TRANSY",
"ui/actions/Properties Manager/TranslateY.png", "", "Y", 2),
( "QToolButton", 4, "TRANSZ",
"ui/actions/Properties Manager/TranslateZ.png", "", "Z", 3),
( "QToolButton", 5, "ROT_TRANS_ALONG_AXIS",
"ui/actions/Properties Manager/translate+rotate-A.png", "", \
"A", 4)
]
self.freeDragTranslateButtonGroup = \
PM_ToolButtonRow( inPmGroupBox,
title = "",
buttonList = BUTTON_LIST,
checkedId = 1,
setAsDefault = True,
)
self.transFreeButton =self.freeDragTranslateButtonGroup.getButtonById(1)
self.transXButton = self.freeDragTranslateButtonGroup.getButtonById(2)
self.transYButton = self.freeDragTranslateButtonGroup.getButtonById(3)
self.transZButton = self.freeDragTranslateButtonGroup.getButtonById(4)
self.transAlongAxisButton = \
self.freeDragTranslateButtonGroup.getButtonById(5)
self.moveFromToButton = PM_ToolButton(
inPmGroupBox,
text = "Translate from/to",
iconPath = "ui/actions/Properties Manager"\
"/Translate_Components.png",
spanWidth = True
)
self.moveFromToButton.setCheckable(True)
self.moveFromToButton.setAutoRaise(True)
self.moveFromToButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
self.startCoordLineEdit = PM_LineEdit(
inPmGroupBox,
label = "ui/actions/Properties Manager"\
"/Move_Start_Point.png",
text = "Define 'from' and 'to' points",
setAsDefault = False,
)
self.startCoordLineEdit.setReadOnly(True)
self.startCoordLineEdit.setEnabled(False)
示例9: SelectNodeByNameDockWidget
#.........这里部分代码省略.........
self.searchTypeComboBox = \
PM_ComboBox( self,
label = "Search options:",
choices = ["By node name", "By # of bases (DNA only)"],
setAsDefault = True)
#Find widgets --
self._nucleotidesSpinBox_1 = PM_SpinBox(self,
label = "",
value = 10,
setAsDefault = False,
singleStep = 10,
minimum = 1,
maximum = 50000)
self._nucleotidesSpinBox_2 = PM_SpinBox(self,
label = "",
value = 50,
setAsDefault = False,
singleStep = 10,
minimum = 1,
maximum = 50000)
self.findLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.findLineEdit.setMaximumWidth(80)
self.findOptionsToolButton = PM_ToolButton(self)
self.findOptionsToolButton.setMaximumWidth(12)
self.findOptionsToolButton.setAutoRaise(True)
##self.findOptionsToolButton.setPopupMode(QToolButton.MenuButtonPopup)
##self._setFindOptionsToolButtonMenu()
self.searchToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Next.png")
self.searchToolButton.setAutoRaise(False)
self.warningSign = QLabel(self)
self.warningSign.setPixmap(
getpixmap('ui/actions/Properties Manager/Warning.png'))
self.warningSign.hide()
self.phraseNotFoundLabel = QLabel(self)
self.phraseNotFoundLabel.setText("Not Found")
self.phraseNotFoundLabel.hide()
# NOTE: Following needs cleanup in the PM_WidgetRow/ PM_WidgetGrid
# but this explanation is sufficient until thats done --
# When the widget type starts with the word 'PM_' , the
# PM_WidgetRow treats it as a well defined widget and thus doesn't try
# to create a QWidget object (or its subclasses)
# This is the reason why qLabels such as self.warningSign and
# self.phraseNotFoundLabel are defined as PM_Labels and not 'QLabels'
# If they were defined as 'QLabel'(s) then PM_WidgetRow would have
# recreated the label. Since we want to show/hide the above mentioned
示例10: Ui_ProteinSequenceEditor
class Ui_ProteinSequenceEditor(PM_DockWidget):
"""
The Ui_DnaSequenceEditor class defines UI elements for the Sequence Editor
object. The sequence editor is usually visible while in DNA edit mode.
It is a DockWidget that is doced at the bottom of the MainWindow
"""
_title = "Sequence Editor"
_groupBoxCount = 0
_lastGroupBox = None
def __init__(self, win):
"""
Constructor for the Ui_DnaSequenceEditor
@param win: The parentWidget (MainWindow) for the sequence editor
"""
self.win = win
# Should parentWidget for a docwidget always be win?
#Not necessary but most likely it will be the case.
parentWidget = win
_superclass.__init__(self, parentWidget, title = self._title)
#A flag used to restore the state of the Reports dock widget
#(which can be accessed through View > Reports) see self.show() and
#self.closeEvent() for more details.
self._reportsDockWidget_closed_in_show_method = False
self.setFixedHeight(90)
def show(self):
"""
Shows the sequence editor. While doing this, it also closes the reports
dock widget (if visible) the state of the reports dockwidget will be
restored when the sequence editor is closed.
@see:self.closeEvent()
"""
self._reportsDockWidget_closed_in_show_method = False
if self.win.viewFullScreenAction.isChecked() or \
self.win.viewSemiFullScreenAction.isChecked():
pass
else:
if self.win.reportsDockWidget.isVisible():
self.win.reportsDockWidget.close()
self._reportsDockWidget_closed_in_show_method = True
_superclass.show(self)
def closeEvent(self, event):
"""
Overrides close event. Makes sure that the visible state of the reports
widgetis restored when the sequence editor is closed.
@see: self.show()
"""
_superclass.closeEvent(self, event)
if self.win.viewFullScreenAction.isChecked() or \
self.win.viewSemiFullScreenAction.isChecked():
pass
else:
if self._reportsDockWidget_closed_in_show_method:
self.win.viewReportsAction.setChecked(True)
self._reportsDockWidget_closed_in_show_method = False
def _loadWidgets(self):
"""
Overrides PM.PM_DockWidget._loadWidgets. Loads the widget in this
dockwidget.
"""
self._loadMenuWidgets()
self._loadTextEditWidget()
def _loadMenuWidgets(self):
"""
Load the various menu widgets (e.g. Open, save sequence options,
Find and replace widgets etc.
"""
#Note: Find and replace widgets might be moved to their own class.
self.loadSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Open.png")
self.saveSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Save_Strand_Sequence.png")
self.loadSequenceButton.setAutoRaise(True)
self.saveSequenceButton.setAutoRaise(True)
#Find and replace widgets --
self.findLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.findLineEdit.setMaximumWidth(60)
#.........这里部分代码省略.........
示例11: _loadMenuWidgets
def _loadMenuWidgets(self):
"""
Load the various menu widgets (e.g. Open, save sequence options,
Find and replace widgets etc.
"""
#Note: Find and replace widgets might be moved to their own class.
self.loadSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Open.png")
self.saveSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Save_Strand_Sequence.png")
self.loadSequenceButton.setAutoRaise(True)
self.saveSequenceButton.setAutoRaise(True)
#Find and replace widgets --
self.findLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.findLineEdit.setMaximumWidth(60)
self.replaceLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.replaceLineEdit.setMaximumWidth(60)
self.findOptionsToolButton = PM_ToolButton(self)
self.findOptionsToolButton.setMaximumWidth(12)
self.findOptionsToolButton.setAutoRaise(True)
self.findOptionsToolButton.setPopupMode(QToolButton.MenuButtonPopup)
self._setFindOptionsToolButtonMenu()
self.findNextToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Next.png")
self.findNextToolButton.setAutoRaise(True)
self.findPreviousToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Previous.png")
self.findPreviousToolButton.setAutoRaise(True)
self.replacePushButton = PM_PushButton(self, text = "Replace")
self.warningSign = QLabel(self)
self.warningSign.setPixmap(
getpixmap('ui/actions/Properties Manager/Warning.png'))
self.warningSign.hide()
self.phraseNotFoundLabel = QLabel(self)
self.phraseNotFoundLabel.setText("Sequence Not Found")
self.phraseNotFoundLabel.hide()
#Widgets to include in the widget row.
widgetList = [('PM_ToolButton', self.loadSequenceButton, 0),
('PM_ToolButton', self.saveSequenceButton, 1),
('QLabel', " Find:", 4),
('PM_LineEdit', self.findLineEdit, 5),
('PM_ToolButton', self.findOptionsToolButton, 6),
('PM_ToolButton', self.findPreviousToolButton, 7),
('PM_ToolButton', self.findNextToolButton, 8),
('QLabel', " Replace:", 9),
('PM_TextEdit', self.replaceLineEdit, 10),
('PM_PushButton', self.replacePushButton, 11),
('PM_Label', self.warningSign, 12),
('PM_Label', self.phraseNotFoundLabel, 13),
('QSpacerItem', 5, 5, 14) ]
widgetRow = PM_WidgetRow(self,
title = '',
widgetList = widgetList,
label = "",
spanWidth = True )
示例12: QuteMolPropertyManager
class QuteMolPropertyManager(PM_Dialog):
"""
The QuteMolPropertyManager class provides a Property Manager for
QuteMolX, allowing its launch for external rendering of the model.
"""
# The title that appears in the Property Manager header.
title = "QuteMolX"
# The name of this Property Manager. This will be set to
# the name of the PM_Dialog object via setObjectName().
pmName = title
# The relative path to the PNG file that appears in the header
iconPath = "ui/actions/Properties Manager/QuteMol.png"
# DNA Display choices.
_axes_display_choices = [ "Render axes",
"Hide axes" ]
_bases_display_choices = [ "Render bases",
"Hide bases" ]
#"Color bases black",
#"Color bases by type" ]
# PDB exclude flags = _axesFlags | _basesFlags
_axesFlags = EXCLUDE_HIDDEN_ATOMS
_basesFlags = EXCLUDE_HIDDEN_ATOMS
def __init__(self, win):
"""
Construct the QuteMolX Property Manager.
@param win: The main window.
@type win: QMainWindow
"""
self.win = win
self.pw = None
PM_Dialog.__init__( self, self.pmName, self.iconPath, self.title )
msg = "Select a QuteMolX rendering style and click the \
<b>Launch QuteMolX</b> button when ready."
# This causes the "Message" box to be displayed as well.
self.updateMessage(msg)
# Hide Preview and Restore defaults button for Alpha9.
self.hideTopRowButtons(PM_RESTORE_DEFAULTS_BUTTON | PM_PREVIEW_BUTTON)
def _addGroupBoxes(self):
"""
Add the 1st group box to the Property Manager.
"""
self.pmGroupBox1 = PM_GroupBox(self, title = "DNA Display Options")
self._loadGroupBox1(self.pmGroupBox1)
self.pmGroupBox2 = PM_GroupBox(self, title = "Launch")
self._loadGroupBox2(self.pmGroupBox2)
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in 1st group box.
@param pmGroupBox: The 1st group box in the PM.
@type pmGroupBox: L{PM_GroupBox}
"""
self.axesCombobox = PM_ComboBox(
pmGroupBox,
label = 'Axes: ',
choices = self._axes_display_choices,
index = 0,
setAsDefault = True,
spanWidth = False )
self.basesCombobox = PM_ComboBox(
pmGroupBox,
label = 'Bases: ',
choices = self._bases_display_choices,
index = 0,
setAsDefault = True,
spanWidth = False )
def _loadGroupBox2(self, pmGroupBox):
"""
Load widgets in 2nd group box.
@param pmGroupBox: The 1st group box in the PM.
@type pmGroupBox: L{PM_GroupBox}
"""
self.launchQuteMolButton = PM_ToolButton(
pmGroupBox,
text = "Launch QuteMolX",
iconPath = "ui/actions/Properties Manager/QuteMol.png",
spanWidth = True )
self.launchQuteMolButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
def _addWhatsThisText(self):
#.........这里部分代码省略.........
示例13: _loadMenuWidgets
def _loadMenuWidgets(self):
"""
Load the various menu widgets (e.g. Open, save sequence options,
Find and replace widgets etc.
"""
self.loadSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Open.png")
self.saveSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Save_Strand_Sequence.png")
self.loadSequenceButton.setAutoRaise(True)
self.saveSequenceButton.setAutoRaise(True)
# Hide load and save buttons until they are implemented. -Mark 2008-12-20.
self.loadSequenceButton.hide()
self.saveSequenceButton.hide()
#Find and replace widgets --
self.findLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.findLineEdit.setMaximumWidth(60)
self.replaceLineEdit = \
PM_LineEdit( self,
label = " Replace:",
spanWidth = False)
self.replaceLineEdit.setMaximumWidth(60)
self.findOptionsToolButton = PM_ToolButton(self)
self.findOptionsToolButton.setMaximumWidth(12)
self.findOptionsToolButton.setAutoRaise(True)
self.findOptionsToolButton.setPopupMode(QToolButton.MenuButtonPopup)
self._setFindOptionsToolButtonMenu()
self.findNextToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Next.png")
self.findNextToolButton.setAutoRaise(True)
self.findPreviousToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Previous.png")
self.findPreviousToolButton.setAutoRaise(True)
self.replacePushButton = PM_PushButton(self, text = "Replace")
# Hide Replace widgets until we add support for transmuting residues.
# Mark 2008-12-19
#self.replaceLabel.hide()
self.replacePushButton.hide()
self.replaceLineEdit.hide()
self.warningSign = QLabel(self)
self.warningSign.setPixmap(
getpixmap('ui/actions/Properties Manager/Warning.png'))
self.warningSign.hide()
self.phraseNotFoundLabel = QLabel(self)
self.phraseNotFoundLabel.setText("Sequence Not Found")
self.phraseNotFoundLabel.hide()
#Widgets to include in the widget row.
widgetList = [('PM_ToolButton', self.loadSequenceButton, 0),
('PM_ToolButton', self.saveSequenceButton, 1),
('QLabel', " Find:", 4),
('PM_LineEdit', self.findLineEdit, 5),
('PM_ToolButton', self.findOptionsToolButton, 6),
('PM_ToolButton', self.findPreviousToolButton, 7),
('PM_ToolButton', self.findNextToolButton, 8),
#('PM_Label', self.replaceLabel, 9),
('PM_TextEdit', self.replaceLineEdit, 9),
('PM_PushButton', self.replacePushButton, 10),
('PM_Label', self.warningSign, 11),
('PM_Label', self.phraseNotFoundLabel, 12),
('QSpacerItem', 5, 5, 13) ]
widgetRow = PM_WidgetRow(self,
title = '',
widgetList = widgetList,
label = "",
spanWidth = True )
return
示例14: InsertNanotube_PropertyManager
#.........这里部分代码省略.........
"""
Add the Insert Nanotube Property Manager group boxes.
"""
self._pmGroupBox1 = PM_GroupBox( self, title = "Endpoints" )
self._loadGroupBox1( self._pmGroupBox1 )
self._pmGroupBox1.hide()
self._pmGroupBox2 = PM_GroupBox( self, title = "Parameters" )
self._loadGroupBox2( self._pmGroupBox2 )
self._displayOptionsGroupBox = PM_GroupBox( self,
title = "Display Options" )
self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )
self._pmGroupBox3 = PM_GroupBox( self, title = "Nanotube Distortion" )
self._loadGroupBox3( self._pmGroupBox3 )
self._pmGroupBox3.hide() #@ Temporary.
self._pmGroupBox4 = PM_GroupBox( self, title = "Multi-Walled CNTs" )
self._loadGroupBox4( self._pmGroupBox4 )
self._pmGroupBox4.hide() #@ Temporary.
self._pmGroupBox5 = PM_GroupBox( self, title = "Advanced Options" )
self._loadGroupBox5( self._pmGroupBox5 )
self._pmGroupBox5.hide() #@ Temporary.
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box 1.
"""
#Following toolbutton facilitates entering a temporary NanotubeLineMode
#to create a CNT using endpoints of the specified line.
self.specifyCntLineButton = PM_ToolButton(
pmGroupBox,
text = "Specify Endpoints",
iconPath = "ui/actions/Properties Manager/Pencil.png",
spanWidth = True
)
self.specifyCntLineButton.setCheckable(True)
self.specifyCntLineButton.setAutoRaise(True)
self.specifyCntLineButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
#EndPoint1 and endPoint2 coordinates. These widgets are hidden
# as of 2007- 12 - 05
self._endPoint1SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
label = "End Point 1")
self.x1SpinBox = self._endPoint1SpinBoxes.xSpinBox
self.y1SpinBox = self._endPoint1SpinBoxes.ySpinBox
self.z1SpinBox = self._endPoint1SpinBoxes.zSpinBox
self._endPoint2SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
label = "End Point 2")
self.x2SpinBox = self._endPoint2SpinBoxes.xSpinBox
self.y2SpinBox = self._endPoint2SpinBoxes.ySpinBox
self.z2SpinBox = self._endPoint2SpinBoxes.zSpinBox
self._endPoint1SpinBoxes.hide()
self._endPoint2SpinBoxes.hide()
def _loadGroupBox2(self, pmGroupBox):
"""
Load widgets in group box 2.
"""
示例15: DnaDuplexPropertyManager
#.........这里部分代码省略.........
commandActionLists.append(lst)
params = (subControlAreaActionList, commandActionLists, allActionsList)
return params
def _addGroupBoxes( self ):
"""
Add the DNA Property Manager group boxes.
"""
self._pmReferencePlaneGroupBox = PM_GroupBox( self,
title = "Placement Options" )
self._loadReferencePlaneGroupBox( self._pmReferencePlaneGroupBox )
self._pmGroupBox1 = PM_GroupBox( self, title = "Endpoints" )
self._loadGroupBox1( self._pmGroupBox1 )
self._pmGroupBox1.hide()
self._pmGroupBox2 = PM_GroupBox( self, title = "Parameters" )
self._loadGroupBox2( self._pmGroupBox2 )
self._displayOptionsGroupBox = PM_GroupBox( self,
title = "Display Options" )
self._loadDisplayOptionsGroupBox( self._displayOptionsGroupBox )
def _loadGroupBox1(self, pmGroupBox):
"""
Load widgets in group box 3.
"""
#Folllowing toolbutton facilitates entering a temporary DnaLineMode
#to create a DNA using endpoints of the specified line.
self.specifyDnaLineButton = PM_ToolButton(
pmGroupBox,
text = "Specify Endpoints",
iconPath = "ui/actions/Properties Manager/Pencil.png",
spanWidth = True
)
self.specifyDnaLineButton.setCheckable(True)
self.specifyDnaLineButton.setAutoRaise(True)
self.specifyDnaLineButton.setToolButtonStyle(
Qt.ToolButtonTextBesideIcon)
#EndPoint1 and endPoint2 coordinates. These widgets are hidden
# as of 2007- 12 - 05
self._endPoint1SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
label = "End Point 1")
self.x1SpinBox = self._endPoint1SpinBoxes.xSpinBox
self.y1SpinBox = self._endPoint1SpinBoxes.ySpinBox
self.z1SpinBox = self._endPoint1SpinBoxes.zSpinBox
self._endPoint2SpinBoxes = PM_CoordinateSpinBoxes(pmGroupBox,
label = "End Point 2")
self.x2SpinBox = self._endPoint2SpinBoxes.xSpinBox
self.y2SpinBox = self._endPoint2SpinBoxes.ySpinBox
self.z2SpinBox = self._endPoint2SpinBoxes.zSpinBox
self._endPoint1SpinBoxes.hide()
self._endPoint2SpinBoxes.hide()
def _loadGroupBox2(self, pmGroupBox):
"""
Load widgets in group box 4.
"""