当前位置: 首页>>代码示例>>Python>>正文


Python PM_GroupBox.__init__方法代码示例

本文整理汇总了Python中PM.PM_GroupBox.PM_GroupBox.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python PM_GroupBox.__init__方法的具体用法?Python PM_GroupBox.__init__怎么用?Python PM_GroupBox.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PM.PM_GroupBox.PM_GroupBox的用法示例。


在下文中一共展示了PM_GroupBox.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
 def __init__(self, 
              parentWidget,
              glpane = None,
              title = 'Preview'
              ):
     """
     Appends a PM_PreviewGroupBox widget to I{parentWidget},a L{PM_Dialog}
             
     @param parentWidget: The parent dialog (Property manager) containing 
                          this  widget.
     @type  parentWidget: L{PM_Dialog}
     
     @param glpane: GLPane object used in construction of the 
                    L{self.elementViewer}
     @type  glpane: L{GLPane} or None
     
     @param title: The title (button) text.
     @type  title: str      
     
     """
     PM_GroupBox.__init__(self, parentWidget, title)
     
     self.glpane = glpane 
     self.parentWidget = parentWidget        
     self._loadPreviewGroupBox()
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:27,代码来源:PM_PreviewGroupBox.py

示例2: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
    def __init__(self,
                 parentWidget,
                 paramsForCheckBoxes=(),
                 checkBoxColumn=1,
                 title=''):
        """
        @param parentWidget: The parent dialog or group box containing this
                             widget.
        @type  parentWidget: L{PM_Dialog} or L{PM_GroupBox}
        
        @param title: The title (button) text. If empty, no title is added.
        @type  title: str
        
        @param paramsForCheckBoxes: A list object that contains tuples like the
               following : ('checkBoxTextString' , preference_key). The 
               checkboxes will be constucted by looping over this list.
        @type paramsForCheckBoxes:list
        @param checkBoxColumn: The widget column in which all the checkboxes
               will be inserted. 
        @type  checkBoxColumn: int
        
        @see: DnaDuplexPropertyManager._loadDisplayOptionsGroupBox for an 
              example use.
        """
        PM_GroupBox.__init__(self, parentWidget, title=title)

        self._checkBoxColumn = checkBoxColumn

        #Also maintain all checkboxes created by this class in this list,
        #just in case the caller needs them. (need access methods for this)
        self.checkBoxes = []

        #Create checkboxes and also connect them to their preference keys.
        self._addCheckBoxes(paramsForCheckBoxes)
开发者ID:octopus89,项目名称:NanoEngineer-1,代码行数:36,代码来源:PM_PrefsCheckBoxes.py

示例3: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
    def __init__(self, parentWidget, title="Clipboard", win=None, elementViewer=None):

        """
        Appends a PM_Clipboard groupbox widget to I{parentWidget},a L{PM_Dialog}
                
        @param parentWidget: The parent dialog (Property manager) containing 
                             this  widget.
        @type  parentWidget: L{PM_Dialog}
        
        @param title: The title (button) text.
        @type  title: str
        
        @param win: MainWindow object
        @type  win: L{MWsemantics} or None
        
        @param elementViewer: The associated preview pane groupbox. If provided, 
                              The selected item in L{self.clipboardListWidget}
                              is shown (previewed) by L{elementViewer}.
                              The object being previewed can then be deposited 
                              into the 3D workspace.
        @type  elementViewer: L{PM_PreviewGroupBox} or None
        
        """

        self.w = win
        self.elementViewer = elementViewer
        self.elementViewer.setDisplay(diTUBES)
        self.pastableItems = None

        PM_GroupBox.__init__(self, parentWidget, title)

        self._loadClipboardGroupbox()
开发者ID:octopus89,项目名称:NanoEngineer-1,代码行数:34,代码来源:PM_Clipboard.py

示例4: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
    def __init__(self, 
                 parentWidget,
                 title = 'Part Library',
                 win   = None,
                 elementViewer = None
                 ):            
        self.w = win
        self.elementViewer = elementViewer
        # piotr 080410 changed diTUBES to diTrueCPK
        self.elementViewer.setDisplay(diTrueCPK)
        self.partLib = None
        self.newModel = None

        PM_GroupBox.__init__(self, parentWidget, title)

        self._loadPartLibGroupBox()
开发者ID:elfion,项目名称:nanoengineer,代码行数:18,代码来源:PM_PartLib.py

示例5: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
    def __init__(self,
                 parentWidget,
                 parentPropMgr   = None,
                 title           = "Molecular Modeling Kit",
                 element         = "",
                 elementViewer   =  None,
                 ):
        """
        Appends a AtomChooser widget (see subclasses) to the bottom of
        I{parentWidget}, a Property Manager dialog.
        (or as a sub groupbox for Atom Chooser  GroupBox.)

        @param parentWidget: The parent PM_Dialog or PM_groupBox containing this
                             widget.
        @type  parentWidget: PM_Dialog or PM_GroupBox

        @param parentPropMgr: The parent Property Manager
        @type  parentPropMgr: PM_Dialog or None

        @param title: The button title on the group box containing the
                      Element Chooser.
        @type  title: str

        @param element: The initially selected element. It can be either an
                        element symbol or name.
        @type  element: str
        """

        PM_GroupBox.__init__(self, parentWidget, title)

        self.element = self._periodicTable.getElement(element)
        self.elementViewer = elementViewer
        self.updateElementViewer()

        if parentPropMgr:
            self.parentPropMgr = parentPropMgr
        else:
            self.parentPropMgr = parentWidget

        self._addGroupBoxes()
        self.connect_or_disconnect_signals(True)
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:43,代码来源:PM_MolecularModelingKit.py

示例6: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
 def __init__(self, 
              parentWidget,
              title = "",
              label = '',
              labelColumn = 0,
              spanWidth   = True 
              ):
     """
     Appends a PM_CoordinateSpinBoxes groupbox widget to I{parentWidget},
     a L{PM_Groupbox} or a L{PM_Dialog}
             
     @param parentWidget: The parent groupbox or dialog (Property manager) 
                          containing this  widget.
     @type  parentWidget: L{PM_GroupBox} or L{PM_Dialog} 
     
     @param title: The title (button) text.
     @type  title: str        
     
     @param label:      The label for the coordinate spinbox.
     @type  label:      str
     
     @param labelColumn: The column in the parentWidget's grid layout to 
                         which this widget's label will be added. 
                         The labelColum can only be E{0} or E{1}
     @type  labelColumn: int
     
     @param spanWidth: If True, the widget and its label will span the width
                      of the group box. Its label will appear directly above
                      the widget (unless the label is empty) and is left 
                      justified.
     @type  spanWidth: bool (default False)
     """
     
     # Intializing label, labelColumn etc is needed before doing 
     # PM_GroupBox.__init__. This is done so that 
     # self.parentWidget.addPmWidget(self) done at the end of __init__
     # works properly. 
     # 'self.parentWidget.addPmWidget(self)' is done to avoid a bug where a 
     # groupbox is always appended as the 'last widget' when its 
     # parentWidget is also a groupbox. This is due to other PM widgets 
     #(e.g. PM_PushButton)add themselves to their parent widget in their 
     #__init__ using self.parentWidget.addPmWidget(self). So doing the
     #same thing here. More general fix is needed in PM_GroupBox code
     # --Ninad 2007-11-14
     self.label = label
     self.labelColumn = labelColumn
     self.spanWidth = spanWidth
     
     if label: # Create this widget's QLabel.
         self.labelWidget = QLabel()
         self.labelWidget.setText(label)
         
     PM_GroupBox.__init__(self, parentWidget, title)
     
     #Initialize attributes
     self.xSpinBox = None
     self.ySpinBox = None
     self.zSpinBox = None
     
     self._loadCoordinateSpinBoxes()
     
     self.parentWidget.addPmWidget(self)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:64,代码来源:PM_CoordinateSpinBoxes.py

示例7: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
    def __init__(self,
                 parentWidget,
                 title = "Message"
                 ):
        """
        PM_MessageGroupBox constructor.

        @param parentWidget: the PM_Dialog containing this message groupbox.
        @type  parentWidget: PM_Dialog

        @param title: The title on the collapse button
        @type  title: str
        """

        PM_GroupBox.__init__(self, parentWidget, title)

        self.vBoxLayout.setMargin(0)
        self.vBoxLayout.setSpacing(0)

        self.gridLayout.setMargin(0)
        self.gridLayout.setSpacing(0)


        self.MessageTextEdit = PM_TextEdit(self,
                                           label='',
                                           spanWidth = True,
                                           addToParent = False,
                                           ##cursorPosition = 'beginning'
                                       )
            # We pass addToParent = False to suppress the usual call by
            # PM_TextEdit.__init__ of self.addPmWidget(new textedit widget),
            # since we need to add it to self in a different way (below).
            # [bruce 071103 refactored this from what used to be a special case
            #  in PM_TextEdit.__init__ based on self being an instance of
            #  PM_MessageGroupBox.]

        # Needed for Intel MacOS. Otherwise, the horizontal scrollbar
        # is displayed in the MessageGroupBox. Mark 2007-05-24.
        # Shouldn't be needed with _setHeight() in PM_TextEdit.

        #Note 2008-06-17: We now permit a vertical scrollbar in message groupbox
        #--Ninad

        self.MessageTextEdit.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

        # Add self.MessageTextEdit to self's vBoxLayout.
        self.vBoxLayout.addWidget(self.MessageTextEdit)
        # We should be calling the PM's getMessageTextEditPalette() method,
        # but that will take some extra work which I will do soon. Mark 2007-06-21
        self.MessageTextEdit.setPalette(getPalette( None,
                                                    QPalette.Base,
                                                    pmMessageBoxColor))
        self.MessageTextEdit.setReadOnly(True)
        #@self.MessageTextEdit.labelWidget = None # Never has one. Mark 2007-05-31
        self._widgetList.append(self.MessageTextEdit)
        self._rowCount += 1


        # wrapWrapMode seems to be set to QTextOption.WrapAnywhere on MacOS,
        # so let's force it here. Mark 2007-05-22.
        self.MessageTextEdit.setWordWrapMode(QTextOption.WordWrap)

        parentWidget.MessageTextEdit = self.MessageTextEdit

        # These two policies very important. Mark 2007-05-22
        self.setSizePolicy(
            QSizePolicy(QSizePolicy.Policy(QSizePolicy.Preferred),
                        QSizePolicy.Policy(QSizePolicy.Fixed)))

        self.MessageTextEdit.setSizePolicy(
            QSizePolicy(QSizePolicy.Policy(QSizePolicy.Preferred),
                        QSizePolicy.Policy(QSizePolicy.Fixed)))

        self.setWhatsThis("""<b>Messages</b>
                          <p>This prompts the user for a requisite operation and/or displays
helpful messages to the user.</p>""")

        # Hide until insertHtmlMessage() loads a message.
        self.hide()
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:81,代码来源:PM_MessageGroupBox.py

示例8: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
 def __init__(self, 
              parentWidget,
              title     = '',
              widgetList = [],
              alignment = None,
              label = '',
              labelColumn = 0,
              spanWidth   = True                 
              ):
     
     
     """
     Appends a PM_WidgetGrid (a group box widget) to the bottom of 
     I{parentWidget},the Property Manager Group box.
     
     @param parentWidget: The parent group box containing this widget.
     @type  parentWidget: PM_GroupBox 
     
     @param title: The group box title.
     @type  title: str
     
     @param widgetList: A list of I{widget info lists}. There is one widget
                        info list for each widget in the grid. The widget
                        info list contains custom information about the 
                        widget but the following items are always present:
                        - First Item       : Widget Type (str),
                        - Second Last Item : Column (int), 
                        - Last Item        : Row (int).
     @type  widgetList: list
     
     @param alignment:  The alignment of the widget row in the parent 
                        groupbox. Based on its value,spacer items is added 
                        to the grid layout of the parent groupbox. 
     @type  alignment:  str
     
     @param label:      The label for the widget row. .
     @type  label:      str
     
     @param labelColumn: The column in the parentWidget's grid layout to 
                         which this widget's label will be added. 
                         The labelColum can only be E{0} or E{1}
     @type  labelColumn: int
     
     @param spanWidth: If True, the widget and its label will span the width
                      of the group box. Its label will appear directly above
                      the widget (unless the label is empty) and is left 
                      justified.
     @type  spanWidth: bool (default False)
     
    
     """
      
     
     self.label = label
     self.labelColumn = labelColumn
     self.spanWidth = spanWidth
     
     if label: # Create this widget's QLabel.
         self.labelWidget = QLabel()
         self.labelWidget.setText(label)
     
     PM_GroupBox.__init__(self, parentWidget, title)
     
     # These are needed to properly maintain the height of the grid if 
     # all labels in a row are hidden via hide().
     self.vBoxLayout.setMargin(0)
     self.vBoxLayout.setSpacing(0)
     
     self.gridLayout.setMargin(0)
     self.gridLayout.setSpacing(0)
                  
     self.parentWidget = parentWidget
     self.widgetList   = widgetList
                 
     self.alignment = alignment
     
     self.loadWidgets()
开发者ID:elfion,项目名称:nanoengineer,代码行数:79,代码来源:PM_WidgetGrid.py

示例9: __init__

# 需要导入模块: from PM.PM_GroupBox import PM_GroupBox [as 别名]
# 或者: from PM.PM_GroupBox.PM_GroupBox import __init__ [as 别名]
 def __init__(self, 
              parentWidget, 
              title        = '', 
              label = '',
              labelColumn = 0,
              buttonList   = [],
              checkedId    = -1,
              setAsDefault = False, 
              spanWidth   = True, 
              borders = True
              ):
     """
     Appends a PM_RadioButtonList widget to the bottom of I{parentWidget}, 
     the Property Manager dialog or group box.
     
     @param parentWidget: The parent group box containing this widget.
     @type  parentWidget: PM_GroupBox or PM_Dialog
     
     @param title: The group box title.
     @type  title: str
     
     @param label:      The label for the coordinate spinbox.
     @type  label:      str
     
     @param labelColumn: The column in the parentWidget's grid layout to 
                         which this widget's label will be added. 
                         The labelColum can only be E{0} or E{1}
     @type  labelColumn: int
             
     
     @param buttonList: A list of I{button info lists}. There is one button
                        info list for each radio button in the list. The 
                        button info list contains the following three items:
                        1). Button Id (int), 
                        2). Button text (str),
                        3). Button tool tip (str).
     @type  buttonList: list
     
     @param spanWidth: If True, the widget and its label will span the width
                      of the group box. Its label will appear directly above
                      the widget (unless the label is empty) and is left 
                      justified.
     @type  spanWidth: bool (default False)
     
     
     @param borders: If true (default), this widget will have borders displayed. 
                     otherwise the won't be any outside borders around the 
                     set of radio buttons this class provides
     @type borders: boolean
     """
     
     # Intializing label, labelColumn etc is needed before doing 
     # PM_GroupBox.__init__. This is done so that 
     # self.parentWidget.addPmWidget(self) done at the end of __init__
     # works properly. 
     # 'self.parentWidget.addPmWidget(self)' is done to avoid a bug where a 
     # groupbox is always appended as the 'last widget' when its 
     # parentWidget is also a groupbox. This is due to other PM widgets 
     #(e.g. PM_PushButton)add themselves to their parent widget in their 
     #__init__ using self.parentWidget.addPmWidget(self). So doing the
     #same thing here. More general fix is needed in PM_GroupBox code
     # --Ninad 2007-11-14 (comment copied from PM_coordinateSpinBoxes)
     self.label = label
     self.labelColumn = labelColumn
     self.spanWidth = spanWidth
     
     if label: # Create this widget's QLabel.
         self.labelWidget = QLabel()
         self.labelWidget.setText(label)
         
     
     PM_GroupBox.__init__(self, parentWidget, title)
     
     # These are needed to properly maintain the height of the grid if 
     # all buttons in a row are hidden via hide().
     self.vBoxLayout.setMargin(0)
     self.vBoxLayout.setSpacing(0)
     
     self.buttonGroup = QButtonGroup()
     self.buttonGroup.setExclusive(True)
     
     self.parentWidget = parentWidget
     self.buttonList   = buttonList
     
     if setAsDefault:
         self.setDefaultCheckedId(checkedId)
     
     self.buttonsById   = {}
     self.buttonsByText = {}
         
     # Create radio button list from button info.
     for buttonInfo in buttonList:
         buttonId       = buttonInfo[0]
         buttonText     = buttonInfo[1]
         buttonToolTip  = buttonInfo[2]
         
         button = QRadioButton(self)
         
         button.setText(buttonText)
         button.setToolTip(buttonToolTip) # Not working.
#.........这里部分代码省略.........
开发者ID:elfion,项目名称:nanoengineer,代码行数:103,代码来源:PM_RadioButtonList.py


注:本文中的PM.PM_GroupBox.PM_GroupBox.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。