Example #1
0
    def __init__(self,
                 parentWidget,
                 title='',
                 labelList=[],
                 alignment=None,
                 isBold=False):
        """
        Appends a PM_LabelGrid widget ( a groupbox) 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 labelList: A list of I{label info lists}. There is one label
                           info list for each label in the grid. The label
                           info list contains the following items:
                           1. Widget Type - in this case its 'Label'(str),
                           2. Label text (str),
                           3. Column (int), 
                           4. Row (int).
        @type  labelList: list
        """

        self.isBold = isBold

        #Empty list that will contain all the labels in this widget.
        self.labels = []

        PM_WidgetGrid.__init__(self, parentWidget, title, labelList, alignment)
Example #2
0
 def __init__(self, 
              parentWidget,
              title     = '',
              widgetList = [],  
              alignment  = None,
              label = '',
              labelColumn = 0,
              spanWidth   = False
              ):
     
     """
     Appends a PM_WidgetRow (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: L{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)
     
     """
             
     PM_WidgetGrid.__init__(self, 
                            parentWidget , 
                            title, 
                            widgetList,
                            alignment ,
                            label,
                            labelColumn,
                            spanWidth 
                           )
Example #3
0
    def __init__(self,
                 parentWidget,
                 title='',
                 widgetList=[],
                 alignment=None,
                 label='',
                 labelColumn=0,
                 spanWidth=False):
        """
        Appends a PM_WidgetRow (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: L{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)
        
        """

        PM_WidgetGrid.__init__(self, parentWidget, title, widgetList,
                               alignment, label, labelColumn, spanWidth)
Example #4
0
 def __init__(self, 
              parentWidget,
              title     = '',
              labelList = [], 
              alignment = None,
              isBold    = False
              ):
     """
     Appends a PM_LabelGrid widget ( a groupbox) 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 labelList: A list of I{label info lists}. There is one label
                        info list for each label in the grid. The label
                        info list contains the following items:
                        1. Widget Type - in this case its 'Label'(str),
                        2. Label text (str),
                        3. Column (int), 
                        4. Row (int).
     @type  labelList: list
     """
     
     self.isBold = isBold
     
     #Empty list that will contain all the labels in this widget. 
     self.labels = []
     
     PM_WidgetGrid.__init__(self, 
                            parentWidget , 
                            title, 
                            labelList,
                            alignment)
    def __init__(self,
                 parentWidget,
                 title='',
                 buttonList=[],
                 alignment=None,
                 label='',
                 labelColumn=0,
                 spanWidth=True,
                 checkedId=-1,
                 setAsDefault=False,
                 isAutoRaise=False,
                 isCheckable=True):
        """
        Appends a PM_ToolButtonGrid 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 buttonList: A list of I{button info lists}. There is one button
                           info list for each button in the grid. The button
                           info list contains the following items:
                           1. Button Type - in this case its 'ToolButton'(str),
                           2. Button Id (int), 
                           3. Button text (str),
                           4. Button icon path (str),
                           5. Button tool tip (str),
                           6. Column (int), 
                           7. Row (int).
        @type  buttonList: list
        
        @param alignment:  The alignment of the toolbutton 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 toolbutton row. If present, it is 
                           added to the same grid layout as the rest of the 
                           toolbuttons, in column number E{0}.
        @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)
                
        @param checkedId:  Checked button id in the button group. Default value
                           is -1 that implies no button is checked. 
        @type  checkedId:  int
        
        @param setAsDefault: If True, sets the I{checkedId} specified by the
                            user as the  default checked
        @type  setAsDefault: boolean
        """

        self.buttonGroup = QButtonGroup()
        self.buttonGroup.setExclusive(True)

        self.isAutoRaise = isAutoRaise
        self.isCheckable = isCheckable
        self.buttonsById = {}
        self.buttonsByText = {}

        if setAsDefault:
            self.setDefaultCheckedId(checkedId)

        PM_WidgetGrid.__init__(self, parentWidget, title, buttonList,
                               alignment, label, labelColumn, spanWidth)
 def __init__(self, 
              parentWidget, 
              title        = '', 
              buttonList   = [],
              alignment    = None, 
              label        = '',
              labelColumn = 0,
              spanWidth   = True,
              checkedId    = -1, 
              setAsDefault = False,   
              isAutoRaise  = False,
              isCheckable  = True
              ):
     """
     Appends a PM_ToolButtonGrid 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 buttonList: A list of I{button info lists}. There is one button
                        info list for each button in the grid. The button
                        info list contains the following items:
                        1. Button Type - in this case its 'ToolButton'(str),
                        2. Button Id (int), 
                        3. Button text (str),
                        4. Button icon path (str),
                        5. Button tool tip (str),
                        6. Column (int), 
                        7. Row (int).
     @type  buttonList: list
     
     @param alignment:  The alignment of the toolbutton 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 toolbutton row. If present, it is 
                        added to the same grid layout as the rest of the 
                        toolbuttons, in column number E{0}.
     @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)
             
     @param checkedId:  Checked button id in the button group. Default value
                        is -1 that implies no button is checked. 
     @type  checkedId:  int
     
     @param setAsDefault: If True, sets the I{checkedId} specified by the
                         user as the  default checked
     @type  setAsDefault: boolean
     """
             
     self.buttonGroup = QButtonGroup()
     self.buttonGroup.setExclusive(True)
     
     self.isAutoRaise = isAutoRaise    
     self.isCheckable = isCheckable
     self.buttonsById   = {}
     self.buttonsByText = {}
     
     if setAsDefault:
         self.setDefaultCheckedId(checkedId)
     
                 
     PM_WidgetGrid.__init__(self, 
                            parentWidget , 
                            title, 
                            buttonList, 
                            alignment,
                            label,
                            labelColumn,
                            spanWidth
                           )