def __new__(cls, name=None, create=False, *args, **kwargs):

        if create:
            import windows

            kwargs.pop('bl', None)
            kwargs['buttonLabel'] = 'Browse'
            kwargs.pop('bc', None)
            kwargs.pop('buttonCommand', None)

            name = cmds.textFieldButtonGrp(name, *args, **kwargs)

            promptFunction = getattr(windows, cls.PROMPT_FUNCTION)

            def setPathCB(name):
                f = promptFunction()
                if f:
                    cmds.textFieldButtonGrp(name,
                                            e=1,
                                            text=f,
                                            forceChangeCommand=True)

            import windows
            cb = windows.Callback(setPathCB, name)
            cmds.textFieldButtonGrp(name, e=1, buttonCommand=cb)

        return super(PathButtonGrp, cls).__new__(cls,
                                                 name,
                                                 create=False,
                                                 *args,
                                                 **kwargs)
 def setPathCB(name):
     f = promptFunction()
     if f:
         cmds.textFieldButtonGrp(name,
                                 e=1,
                                 text=f,
                                 forceChangeCommand=True)
Example #3
0
    def __new__(cls, name=None, create=False, *args, **kwargs):

        if create:
            import windows

            kwargs.pop("bl", None)
            kwargs["buttonLabel"] = "Browse"
            kwargs.pop("bc", None)
            kwargs.pop("buttonCommand", None)

            name = cmds.textFieldButtonGrp(name, *args, **kwargs)

            promptFunction = getattr(windows, cls.PROMPT_FUNCTION)

            def setPathCB(name):
                f = promptFunction()
                if f:
                    cmds.textFieldButtonGrp(name, e=1, text=f, forceChangeCommand=True)

            import windows

            cb = windows.Callback(setPathCB, name)
            cmds.textFieldButtonGrp(name, e=1, buttonCommand=cb)

        return super(PathButtonGrp, cls).__new__(cls, name, create=False, *args, **kwargs)
Example #4
0
def pathButtonGrp(name=None, *args, **kwargs):
    if name is None or not cmds.textFieldButtonGrp(name, ex=1):
        create = True
    else:
        create = False

    return _uitypes.PathButtonGrp(name=name, create=create, *args, **kwargs)
Example #5
0
def folderButtonGrp( name=None, *args, **kwargs ):
    import uitypes    
    if name is None or not cmds.textFieldButtonGrp( name, ex=1 ):
        create = True
    else:
        create = False

    return uitypes.FolderButtonGrp( name=name, create=create, *args, **kwargs )
Example #6
0
def folderButtonGrp(name=None, *args, **kwargs):
    import uitypes
    if name is None or not cmds.textFieldButtonGrp(name, ex=1):
        create = True
    else:
        create = False

    return uitypes.FolderButtonGrp(name=name, create=create, *args, **kwargs)
Example #7
0
    def __new__(cls, name=None, create=False, *args, **kwargs):

        if create:
            kwargs.pop('bl', None)
            kwargs['buttonLabel'] = 'Browse'
            kwargs.pop('bc', None)
            kwargs.pop('buttonCommand', None)

            name = cmds.textFieldButtonGrp( name, *args, **kwargs)

            def setPathCB(name):
                import windows
                f = windows.promptForPath()
                if f:
                    cmds.textFieldButtonGrp( name, e=1, text=f, forceChangeCommand=True)

            import windows
            cb = windows.Callback( setPathCB, name )
            cmds.textFieldButtonGrp( name, e=1, buttonCommand=cb )

        return dynModule.TextFieldButtonGrp.__new__( cls, name, create=False, *args, **kwargs )
Example #8
0
    def __new__(cls, name=None, create=False, *args, **kwargs):

        if create:
            kwargs.pop("bl", None)
            kwargs["buttonLabel"] = "Browse"
            kwargs.pop("bl", None)
            kwargs["buttonLabel"] = "Browse"
            kwargs.pop("bc", None)
            kwargs.pop("buttonCommand", None)

            name = cmds.textFieldButtonGrp(name, *args, **kwargs)

            def setPathCB(name):
                f = promptForPath()
                if f:
                    cmds.textFieldButtonGrp(name, e=1, text=f)

            import windows

            cb = windows.Callback(setPathCB, name)
            cmds.textFieldButtonGrp(name, e=1, buttonCommand=cb)

        return dynModule.TextFieldButtonGrp.__new__(cls, name, create=False, *args, **kwargs)
Example #9
0
 def setPathCB(name):
     f = promptFunction()
     if f:
         cmds.textFieldButtonGrp(name, e=1, text=f, forceChangeCommand=True)
Example #10
0
 def setPathCB(name):
     import windows
     f = windows.promptForPath()
     if f:
         cmds.textFieldButtonGrp( name, e=1, text=f, forceChangeCommand=True)
Example #11
0
 def setPathCB(name):
     f = promptForPath()
     if f:
         cmds.textFieldButtonGrp( name, e=1, text=f)
Example #12
0
 def setPathCB(name):
     import windows
     f = windows.promptForPath()
     if f:
         cmds.textFieldButtonGrp( name, e=1, text=f)