AWS Thinkbox Discussion Forums

scripting API - embed a hyperlink?

Hi,
I couldn’t think of a way to embed a hyperlink into a Deadline scripting UI element.
For example:

scriptDialog.AddRow() scriptDialog.AddSelectionControl( "CheckboxExample", "CheckBoxControl", False, "Some Text - http://www.google.com", controlWidth, -1 ) scriptDialog.EndRow()

I would like to highlight some of the checkbox text AND make it available as a hyperlink : “http://www.google.com

Any ideas?

Thanks,
Mike

Hey Mike,

There currently isn’t a way to do this. Qt does support having labels behave like hyperlinks, so we could add a script UI control for it, but I don’t think you’ll be able to embed a hyperlink into a checkbox label.

Cheers,

  • Ryan

Hi Ryan,
Yep, a hyperlink script UI control would be most useful. Please could you add it to the wishlist!
I got something sorted for us by doing this:

[code]from System.Diagnostics import *
from System.Drawing import *
from System.IO import *
from Deadline.Scripting import *
from System.Windows.Forms import *

import webbrowser

panel = scriptDialog.AddRow()
scriptDialog.AddSelectionControl( “someText”, “CheckBoxControl”, False, "SomeText : ", controlWidth, -1 )
dynamicLinkLabel = LinkLabel()
dynamicLinkLabel.Text = “http://server:8080
dynamicLinkLabel.AutoSize = True
dynamicLinkLabel.LinkClicked += LinkPressed
dynamicLinkLabel.ActiveLinkColor = Color.Orange
dynamicLinkLabel.VisitedLinkColor = Color.Green
dynamicLinkLabel.LinkColor = Color.RoyalBlue
panel.Controls.Add( dynamicLinkLabel )
scriptDialog.EndRow()

def LinkPressed( *args):
global scriptDialog

bla bla bla[/code]

However, the URL hyperlink isn’t aligned that great with the existing row it sits on. I couldn’t find a way around this. Any idea?

Thanks,
Mike

Our API code handles a lot of layout logic to line everything up, so since you’re manually adding the control, you’ll probably have to play with the margins/padding manually.

Cheers,

  • Ryan
Privacy | Site terms | Cookie preferences