-
-
Save strarsis/c900cb342140ec7d1439b35c05b1cd26 to your computer and use it in GitHub Desktop.
javascript: indesign progress bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function index_progress_bar(title) { | |
var w = new Window("palette", title, undefined); | |
w.orientation = "column"; | |
var text_group = w.add("group"); | |
text_group.orientation = "column"; | |
var file_name = text_group.add("statictext", [0,0,350,20], "calculating.."); | |
var remain = text_group.add("statictext", [0,0,350,20], "Remain: .."); | |
text_group.alignChildren = "left"; | |
var progressbar = w.add("progressbar", undefined, 0, 100); | |
progressbar.preferredSize = [350,20]; | |
this.reset = function(maxValue) { | |
progressbar.value = 0; | |
progressbar.maxvalue = maxValue||0; | |
progressbar.visible = !!maxValue; | |
w.show(); | |
}; | |
this.show = function(name, remain_string, value) { | |
file_name.text = name; | |
remain.text = remain_string; | |
progressbar.value = value; | |
}; | |
this.hide = function() {w.hide();}; | |
this.close = function() {w.close();}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment