Beispiel #1
0
def uiFunc_create_selection_list(parent, items):
    itemList = cgmUI.cgmScrollList(parent, numberOfRows=4, height=75)
    itemList.setItems(items)
    itemList(edit=True,
             selectCommand=cgmGEN.Callback(uiFunc_select_list_item, itemList))

    return itemList
Beispiel #2
0
def buildColumn_main(self, parent, asScroll=False):
    """
    Trying to put all this in here so it's insertable in other uis
    
    """
    if asScroll:
        _inside = mUI.MelScrollLayout(parent,
                                      useTemplate='cgmUIHeaderTemplate')
    else:
        _inside = mUI.MelColumnLayout(parent,
                                      useTemplate='cgmUIHeaderTemplate')

    #>>>Objects Load Row ---------------------------------------------------------------------------------------

    mUI.MelSeparator(_inside, ut='cgmUISubTemplate', h=3)

    _row = mUI.MelHSingleStretchLayout(_inside,
                                       ut='cgmUISubTemplate',
                                       padding=5)

    mUI.MelSpacer(_row, w=_padding)

    mUI.MelLabel(_row, l='Dynamic Chain System:')

    uiTF_objLoad = mUI.MelLabel(_row,
                                ut='cgmUIInstructionsTemplate',
                                l='',
                                en=True)

    self.uiTF_objLoad = uiTF_objLoad
    cgmUI.add_Button(_row, '<<', cgmGEN.Callback(uiFunc_load_selected, self),
                     "Load first selected object.")
    _row.setStretchWidget(uiTF_objLoad)
    mUI.MelSpacer(_row, w=_padding)

    _row.layout()

    mc.setParent(_inside)
    cgmUI.add_LineSubBreak()

    self.detailsFrame = mUI.MelFrameLayout(_inside,
                                           label="Details",
                                           collapsable=True,
                                           collapse=True,
                                           useTemplate='cgmUIHeaderTemplate')

    uiFunc_update_details(self)

    # Create Frame

    self.createFrame = mUI.MelFrameLayout(_inside,
                                          label="Create",
                                          collapsable=True,
                                          collapse=False,
                                          useTemplate='cgmUIHeaderTemplate')

    _create = mUI.MelColumnLayout(self.createFrame,
                                  useTemplate='cgmUIHeaderTemplate')

    cgmUI.add_LineSubBreak()

    _row = mUI.MelHSingleStretchLayout(_create,
                                       ut='cgmUISubTemplate',
                                       padding=_padding)

    mUI.MelSpacer(_row, w=_padding)

    _subRow = mUI.MelColumnLayout(_row, useTemplate='cgmUIHeaderTemplate')
    self.itemList = cgmUI.cgmScrollList(_subRow, numberOfRows=8, height=100)
    self.itemList(edit=True, allowMultiSelection=True)

    mUI.MelSpacer(_row, w=_padding)

    _row.setStretchWidget(_subRow)

    _row.layout()

    mUI.MelSeparator(_create, ut='cgmUISubTemplate', h=5)

    _row = mUI.MelHSingleStretchLayout(_create,
                                       ut='cgmUISubTemplate',
                                       padding=5)

    mUI.MelSpacer(_row, w=_padding)

    addBtn = cgmUI.add_Button(
        _row, 'Add Selected',
        cgmGEN.Callback(uiFunc_list_function, self.itemList, 'add selected'),
        "Load selected objects.")

    cgmUI.add_Button(
        _row, 'Remove Selected',
        cgmGEN.Callback(uiFunc_list_function, self.itemList,
                        'remove selected'), "Remove selected objects.")

    cgmUI.add_Button(
        _row, 'Clear',
        cgmGEN.Callback(uiFunc_list_function, self.itemList, 'clear'),
        "Clear all objects.")

    _row.setStretchWidget(addBtn)

    mUI.MelSpacer(_row, w=_padding)

    _row.layout()

    cgmUI.add_LineSubBreak()

    _row = mUI.MelHSingleStretchLayout(_create,
                                       ut='cgmUISubTemplate',
                                       padding=5)

    mUI.MelSpacer(_row, w=_padding)

    _row.setStretchWidget(
        cgmUI.add_Button(_row, 'Make Dynamic Chain',
                         cgmGEN.Callback(uiFunc_make_dynamic_chain, self),
                         "Make Dynamic Chain."))

    mUI.MelSpacer(_row, w=_padding)

    _row.layout()

    cgmUI.add_LineSubBreak()

    self.optionsFrame = mUI.MelFrameLayout(_create,
                                           label="Options",
                                           collapsable=True,
                                           collapse=True,
                                           useTemplate='cgmUIHeaderTemplate')

    _options = mUI.MelColumnLayout(self.optionsFrame,
                                   useTemplate='cgmUISubTemplate')

    mUI.MelSeparator(_options, ut='cgmUISubTemplate', h=5)

    _row = mUI.MelHSingleStretchLayout(_options,
                                       ut='cgmUISubTemplate',
                                       padding=5)

    mUI.MelSpacer(_row, w=_padding)
    mUI.MelLabel(_row, l='Base Name: ')

    self.options_baseName = mUI.MelTextField(_row,
                                             ann='Name',
                                             text='DynamicChain')

    _row.setStretchWidget(self.options_baseName)

    mUI.MelSpacer(_row, w=_padding)
    _row.layout()

    _row = mUI.MelHSingleStretchLayout(_options,
                                       ut='cgmUISubTemplate',
                                       padding=5)
    mUI.MelSpacer(_row, w=_padding)
    mUI.MelLabel(_row, l='Name: ')

    self.options_name = mUI.MelTextField(_row, ann='Name', text='')

    _row.setStretchWidget(self.options_name)

    mUI.MelSpacer(_row, w=_padding)
    _row.layout()

    mUI.MelSeparator(_options, ut='cgmUISubTemplate', h=5)

    _row = mUI.MelHSingleStretchLayout(_options,
                                       ut='cgmUISubTemplate',
                                       padding=5)

    mUI.MelSpacer(_row, w=_padding)
    mUI.MelLabel(_row, l='Direction:')

    _row.setStretchWidget(mUI.MelSeparator(_row))

    directions = ['x+', 'x-', 'y+', 'y-', 'z+', 'z-']

    mUI.MelLabel(_row, l='Fwd:')

    self.fwdMenu = mUI.MelOptionMenu(_row, useTemplate='cgmUITemplate')
    for dir in directions:
        self.fwdMenu.append(dir)

    self.fwdMenu.setValue('z+')

    mUI.MelSpacer(_row, w=_padding)

    mUI.MelLabel(_row, l='Up:')

    self.upMenu = mUI.MelOptionMenu(_row, useTemplate='cgmUITemplate')
    for dir in directions:
        self.upMenu.append(dir)

    self.upMenu.setValue('y+')

    mUI.MelSpacer(_row, w=_padding)

    _row.layout()
    """
    _row.layout()

    #>>>Report ---------------------------------------------------------------------------------------
    _row_report = mUI.MelHLayout(_inside ,ut='cgmUIInstructionsTemplate',h=20)
    self.uiField_report = mUI.MelLabel(_row_report,
                                       bgc = SHARED._d_gui_state_colors.get('help'),
                                       label = '...',
                                       h=20)
    _row_report.layout() """

    return _inside
Beispiel #3
0
    def build_layoutWrapper(self,parent):
        _str_func = 'build_layoutWrapper'
        #self._d_uiCheckBoxes = {}
    
        #_MainForm = mUI.MelFormLayout(parent,ut='cgmUISubTemplate')
        _MainForm = mUI.MelFormLayout(self,ut='cgmUITemplate')
        _mainScroll = mUI.MelScrollLayout(_MainForm,useTemplate = 'cgmUIHeaderTemplate') 

        _mappingFrame = mUI.MelFrameLayout(_mainScroll, label='Create Mapping', collapsable=True, collapse=False,useTemplate = 'cgmUIHeaderTemplate')
        
        self.mappingColumn = mUI.MelColumnLayout(_mappingFrame,useTemplate = 'cgmUISubTemplate') 

        buildColumn_create_mapping(self)

        _loadMappingFrame = mUI.MelFrameLayout(_mainScroll, label='Load Mappings', collapsable=True, collapse=False,useTemplate = 'cgmUIHeaderTemplate')
        
        self.loadMappingColumn = mUI.MelColumnLayout(_loadMappingFrame,useTemplate = 'cgmUISubTemplate') 

        _row = mUI.MelHSingleStretchLayout(self.loadMappingColumn,ut='cgmUISubTemplate',padding = _padding, height=75+_padding)

        mUI.MelSpacer(_row,w=_padding)

        _colorColumn = mUI.MelColumnLayout(_row,useTemplate = 'cgmUIHeaderTemplate', height=75 )
        self.mappingListTSL = cgmUI.cgmScrollList(_colorColumn, numberOfRows = 4, height=75)

        mUI.MelSpacer(_row,w=_padding)

        _row.setStretchWidget(_colorColumn)

        _row.layout()

        mc.setParent(self.loadMappingColumn)
        cgmUI.add_LineSubBreak()

        _row = mUI.MelHLayout(self.loadMappingColumn,ut='cgmUISubTemplate',padding = _padding*2)
        cgmUI.add_Button(_row,'Load From File',
            cgmGEN.Callback(uiFunc_load,self),
            #lambda *a: attrToolsLib.doAddAttributesToSelected(self),
            'Load a mapping from file',h=30)
        cgmUI.add_Button(_row,'Remove Mapping',
            cgmGEN.Callback(uiFunc_remove_mapping,self),
            'Remove selected mapping',h=30) 

        _row.layout() 

        mc.setParent(self.loadMappingColumn)
        cgmUI.add_LineSubBreak()

        # Start GamePad Button
        #
        #_row = mUI.MelHLayout(_mainScroll,ut='cgmUISubTemplate',padding = _padding*2)
        
        self.animDrawBtn = cgmUI.add_Button(_mainScroll,'Start GamePad',
            cgmGEN.Callback(start_controller,self),                         
            #lambda *a: attrToolsLib.doAddAttributesToSelected(self),
            'Start Gamepad Button',h=50)

        #_row.layout()    
        #
        # End Recording Button

        _row_cgm = cgmUI.add_cgmFooter(_MainForm)            
        _MainForm(edit = True,
                  af = [(_mainScroll,"top",0),
                        (_mainScroll,"left",0),
                        (_mainScroll,"right",0),                        
                        (_row_cgm,"left",0),
                        (_row_cgm,"right",0),                        
                        (_row_cgm,"bottom",0),
    
                        ],
                  ac = [(_mainScroll,"bottom",2,_row_cgm),
                        ],
                  attachNone = [(_row_cgm,"top")])