AWS Thinkbox Discussion Forums

Adding a scroll bar to the job submit UI.

Does anyone know how to add a scroll bar to the job submit UI? At the moment I am having to use scriptControl.AddGroupBox()

A multiline control will automatically display a scroll-bar when necessary.

Monitor -> Scripts -> Misc -> Script UI Example

[attachment=0]Screen Shot 2017-07-18 at 09.29.50.png[/attachment]

Hey Mike, thanks for getting back to me. I had thought about the multi file approach, but was not entirely sure it was appropriate for the problem I have.We have never had more than 30 shots before to slate and concatenate, so it hasn’t been a problem. This current show has 70+, and although I can at least collapse the group and get to the submit button, it would be great to be able to get to the shots > 45 to amend any frame ranges or slate info. Yes, I could group in sets of 10, but surely a UI scroll is neater?

[attachment=0]Capture.PNG[/attachment]

ok, gotcha. If you remove the groupbox and add all the controls to a UI grid, it should present a scroll-bar. I need to check.

They are/were already using AddControlToGrid(“ButtonControl”, LabelControl", "TextControl, etc).

Hey Mike, in the mean time i’ve added a bit of crude code to keep us going, so no hurry. Cheers.

groupSize = 20	
shotNumbers = range(jobCount+1)	
shotGroups = [ shotNumbers[i:i+groupSize] for i in range(1, jobCount+1, groupSize) ]
	
for group in shotGroups:
	scriptDialog.AddGroupBox( "GroupBox4", "Shots %s-%s" % (group[0], group[-1]), True )
	scriptDialog.AddGrid()
	for shot in group:
		scriptDialog.AddControlToGrid( 'ShotBox%s' % shot, "TextControl", '', shot+10, 0,)
		scriptDialog.AddControlToGrid( 'VersionListBox%s' % shot, "TextControl", "", shot+10, 1, colSpan=4) 
		scriptDialog.AddControlToGrid( 'TakeListBox%s' % shot, "TextControl", '', shot+10, 5,)  
		scriptDialog.AddControlToGrid( 'FrameRangeListBox%s' % shot, "TextControl", "", shot+10, 6,)
		scriptDialog.AddControlToGrid( 'AudioFileListBox%s' % shot, "TextControl", "", shot+10, 7, colSpan=4)        
		scriptDialog.AddControlToGrid( 'IDListBox%s' % shot, "ReadOnlyTextControl", "", shot+10, 11, colSpan=2)
		scriptDialog.AddControlToGrid( 'OutFileListBox%s' % shot, "ReadOnlyTextControl", "", shot+10, 13, colSpan=7)
	scriptDialog.EndGrid()
	scriptDialog.EndGroupBox( True )

I’ll add a RFE for QScrollArea support in our Scripting UI. However, as we inherit from PyQt, you can implement a custom UI directly yourself today.

Here’s a quick and dirty example for you:

[code]import sys

from System.IO import *

from Deadline.Scripting import *

from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *

import PyQt5.QtCore, PyQt5.QtWidgets, PyQt5.QtGui

########################################################################

Globals

########################################################################
dialog = None

########################################################################

Custom QDialog with some basic controls.

########################################################################
class CustomQtDialog(QDialog):

def __init__(self, parent=None):
    super( CustomQtDialog, self ).__init__( parent )

    #set the main layout as a vertical one
    self.mainLayout = QVBoxLayout()
    self.setLayout( self.mainLayout )

    self.myGroupBox = QGroupBox('this is my groupbox')
    myform = QFormLayout()
    labellist = []
    combolist = []
    for i in range(30):
        labellist.append( QLabel('mylabel') )
        combolist.append( QComboBox() )
        myform.addRow( labellist[i],combolist[i] )
    self.myGroupBox.setLayout( myform )
    scroll = QScrollArea()
    scroll.setWidget( self.myGroupBox )
    scroll.setWidgetResizable( True )
    scroll.setFixedHeight( 400 )
    self.mainLayout.addWidget(scroll)

    # Close button
    self.buttonLayout = QHBoxLayout()
    self.closeButton = QPushButton( "Close" )
    self.buttonLayout.addWidget( self.closeButton )

    self.mainLayout.addLayout( self.buttonLayout )

    #hook up the button signals to our slots
    self.closeButton.clicked.connect( self.closeButtonPressed )

@pyqtSlot( bool )
def closeButtonPressed( self, checked ):
    self.done( 0 )

########################################################################

Main Function Called By Deadline

########################################################################
def main():
global dialog

#Create an instance of our custom dialog, and show it
dialog = CustomQtDialog()
dialog.setVisible( True )[/code]

CustomQtDialog.py.zip (1.26 KB)

Awesome, thanks Mike. I have been avoiding it for far too long, but it looks like I will have to finally retire Tkinter and take the plunge in to PyQt. :blush:

Hi,
Turns out there is a way to do this easily. The property was added quietly by another developer a little while ago and I simply hadn’t noticed it in the docs! Seven curses to the gods of the new world and the old. Oops. Too much GoT this week. :sunglasses:

docs.thinkboxsoftware.com/produ … 7884fe77eb

So, when you add a TabPage and you need it to be scrollable:

scriptDialog.AddTabPage( "Conform Stack", True )

:laughing: Well that was easy!

Privacy | Site terms | Cookie preferences