"Fossies" - the Fresh Open Source Software Archive

Member "avidemux_2.7.8/avidemux_plugins/ADM_scriptEngines/qtScript/src/html/_dialog_8admjs-example.html" (7 Mar 2021, 10712 Bytes) of package /linux/misc/avidemux_2.7.8.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the avidemux_2.7.8.tar.gz project site itself.

Avidemux 2.6 Scripting Reference
 All Classes Functions Enumerations Enumerator Properties Groups Pages
Dialog.admjs

This is an example script that demonstrates all the dialog controls that are available to the scripting environment.

Dialog.jpg
var dialog = new Dialog("Test Window");
var checkBox = new CheckBoxControl("Test CheckBox", true);
var spinBox = new SpinBoxControl("Test SpinBox:", 0, 100, 43);
var doubleSpinBox = new DoubleSpinBoxControl("Test DoubleSpinBox:", 0, 100, 48.3);
var lineEdit = new LineEditControl("Test LineEdit:", "text");
var slider = new SliderControl("Test Slider:", 0, 100, 13, 5);
var comboBox = new ComboBoxControl("Test ComboBox:");
comboBox.items.add("item 1", "value 1");
comboBox.items.add(new ComboBoxItem("item 2", "value 2"));
comboBox.selectedItemIndex = 1;
dialog.controls.add(checkBox);
dialog.controls.add(spinBox);
dialog.controls.add(doubleSpinBox);
dialog.controls.add(lineEdit);
dialog.controls.add(slider);
dialog.controls.add(comboBox);
print("Dialog Result: " + dialog.show());
print("CheckBox - Value: " + checkBox.checked);
print("SpinBox - Value: " + spinBox.value);
print("DoubleSpinBox - Value: " + doubleSpinBox.value);
print("LineEdit - Value: " + lineEdit.value);
print("Slider - Value: " + slider.value);
print("ComboBox - Selected Index: " + comboBox.selectedItemIndex);
print("ComboBox - Selected Item Title: " + comboBox.selectedItem.title);
print("ComboBox - Selected Item Value: " + comboBox.selectedItem.value);