JS/ScriptUI: placeholder madness

I created this yummy text box entry placeholder for CS4 on my Mac:
but for some reason this fails to draw correctly on Windows! If the edit box is active and the cursor is in it, the text is not drawn but the cursor blinks at correct position at the end of that invisible text. Moving the cursor or typing in something makes the text pop back into view. (Sorry, should have thought of making a 'shot of that as well.) A real shame, because on my Mac it works as I meant it to: placeholder text shows when the field is inactive and empty, placeholder disappears when you enter the field and type anything in it. Delete text and leave box makes it appear again.
Is this an error in my code (silently corrected on the Mac but showing up on 'the other platform'), or is it an error on the Windows' Side of the world? Or is this just something one should not be messing with using ScriptUI? (A fairly reasonable explanation.) Or might it work correctly on CS5 for both platforms? (In which case I could put in a platform/version check -- "no fancy dialog for you, you Older Version on a Microsoft Platform!").
I also have a variant of same code that would underline static text, which also shows up correctly on Mac and not-at-all on Windows -- but then it may be failing for the very same reason.
My code:
var w = new Window ("dialog", "Display Placeholder");
w.bg = w.graphics.newBrush(w.graphics.BrushType.SOLID_COLOR,[1,1,1]);
w.textPen = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[0.67,0.67,0.67], 1);
with(w.add ("group"))
  add ("statictext", undefined, "Text");
  editbox = add ("edittext", undefined, '');
  editbox.characters = 32;
  editbox.onDraw = function(d)
    if( this.text || this.active)
      this.parent.onDraw(d)
    else
      this.graphics.rectPath (0,0,this.size.width,this.size.height);
      this.graphics.fillPath(w.bg);
      this.graphics.drawString("<required>",w.textPen,0,0,this.graphics.font);

Hi Guys
Peter, I'm afraid I should disagree with you on a few points.
(...) In CS5.5, your script breaks on this.parent.onDraw(d). The error message is "this.parent.onDraw is not a function", which is fair enough, because onDraw is a callback. (...)
The reason why this.parent.onDraw is not a function in Jongware's code, is just that this.parent.onDraw is undefined—as John supposed. When we call x( ) from an undefined x var, the interpreter prompts a not-a-function error.
Why is this.parent.onDraw undefined? Because there is no line in the code which sets up such member on this.parent—which by the way is a (ScriptUI) Group object, considering the context. What we call 'callback' functions are optional custom methods that are supposed to connect to events, usually, but widget prototypes do not provide any default callbacks. myWidget.onDraw, myWidget.onClick, etc., are simply undefined as long as we don't set them.
In addition, the onDraw callback, when defined, does not work the same way that other event callbacks (which are high-level fake event listeners and could generally be developed through an addEventListener() setter providing much more precision). Indeed, onDraw has no actual event counterpart (or, if any, it is not exposed to scripters as 'show', 'focus', 'blur', 'change', 'click', etc., are.) As documented, onDraw is automatically called when a widget needs to be (re)drawn, but this 'when' is highly unpredictable as it depends on the user interactions, the OS, and probably a number of low-level events.
We also know that custom layout—i.e. myContainer.layout.layout(1)—triggers such drawing stages (from containers). Also, there are crazy paths to get a non-container widget redrawn, for example:
    wg.visible=false; wg.visible=true;
or sometimes:
   wg.size = [wg.size[0],wg.size[1]];
The issue with manually calling  a custom onDraw() method is we generally don't know when it is safe to call it and whether it may conflict with the automatic calls. I found circumstances where manual onDraw() simply fails due to a temporary invalidation of the widget.graphics property (I believe this depends on the object type). This may explain why Peter wrote:
(...) onDraw is a function but not one that you call like x.onDraw()
However, onDraw is indeed a simple (callable) function if the script did it so. What matters is that a custom onDraw() overrides and bypasses, as much as possible, the native drawing stage. So, in many cases, an empty onDraw() callback makes the widget totally undrawn (hidden) although room has been reserved to it during layout. (That's not true for composite or very interactive widgets—such as scrollbar or listbox—which still inherit from low-level painting events, at least partially.)
ANYWAY, in Jongware's script I don't see any reason to make this.onDraw() attempt to call a hypothetical parent onDraw method—which for the time being does not exist—or even to trigger the native drawing stage on the parent. Why? I guess there is a confusion between drawing and layout (?)
What is sure is that the statement  this.parent.onDraw(d) fails. And, since ScriptUI is known for hushing errors up in many event handlers, you get unaccountable side effects in your EditText control.
To me, a valid approach would be to invoke the ScriptUIGraphics.drawOSControl() method when you need to produce the default widget skin before further customization.
The following snippets should provide better results (unfortunately, I can't test this on all systems):
// =====================================
// EditText placeholder
// =====================================
var u,
    w = new Window('dialog', "Display Placeholder"),
    e1 = w.add('edittext'),
    e2 = w.add('edittext'),
    b = w.add('button', u, "OK"),
    wgx = w.graphics,
    grayPen = wgx.newPen(wgx.PenType.SOLID_COLOR,[.67,.67,.67], 1);
e1.characters = e2.characters = 32;
e1.onDraw = e2.onDraw = function(/*DrawState*/)
    var gx = this.graphics;
    gx.drawOSControl();
    this.text || this.active || gx.drawString("<required>", grayPen, 0, 0);
w.show();
And:
// =====================================
// Underlined StaticText
// =====================================
var u,
    w = new Window('dialog', "Underline Me!"),
    s1 = w.add('statictext', u, "Not Underlined"),
    s2 = w.add('statictext', u, "Underlined"),
    b = w.add('button', u, "OK"),
    wgx = w.graphics,
    linePen = wgx.newPen(wgx.PenType.SOLID_COLOR,[0,0,0], 1);
s2.preferredSize[1] += 3;
s2.onDraw = function(/*DrawState*/)
    var gx = this.graphics,
        sz = this.preferredSize,
        y = sz[1]-1;
    gx.drawOSControl();
    gx.newPath();
    gx.moveTo(0, y);
    gx.lineTo(sz[0],y);
    gx.strokePath(linePen);
w.show();
Hope that helps.
@+
Marc

Similar Messages

  • Dreamweaver MX: Image is showing as a grey placeholder box, and I can't place my hotspots...

    Hello:
    I know, old school with Dreamwevaer MX, but I need some help here. I've made half a dozen pages in exactly the same way as this one: insert a jpeg image, hotspot the text/areas I want to be links, and call it a day. Well in this page, the image always shows up as a gray placeholder box, thereby preventing me from seeing where the hotspots need to be and completing the page. I'm inserting the code here in case there's some hiccup in the code that I don't see. I've compared it line-by-line with another page that works properly, and I don't see any structural differences. I even re-saved the image in web format under a new name and constructed a new HTML page to see if the old one had just soured or something. No go.
    In fact, the only difference between this hotspotted image and the others is that this one is much longer. But I had a previous version of this page that was working fine before, and the image was just as long, so I don't understand why replacing the image has caused such a meltdown.
    Thank for any help in advance!
    Kurt
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Ankeny Studio - Common Questions</title>
    </head>
    <body>
    <img src="ASCCommon.jpg" width="1082" height="3379" border="0" usemap="#Map">
    <map name="Map">
      <area shape="rect" coords="308,2332,489,2354" href="mailto:[email protected]">
      <area shape="rect" coords="320,2103,435,2123" href="http://www.ankenystudio.com/instructor.htm">
      <area shape="rect" coords="261,1895,388,1915" href="http://www.ankenystudio.com/registration.htm">
      <area shape="rect" coords="642,366,768,386" href="http://www.ankenystudio.com/registration.htm">
      <area shape="rect" coords="530,1770,658,1787" href="http://www.ankenystudio.com/registration.htm">
      <area shape="rect" coords="566,1269,747,1287" href="http://www.tfaoi.com/aa/4aa/4aa553.htm" target="_blank">
      <area shape="rect" coords="374,1026,408,1043" href="http://www.cape-ann.com/accom.html" target="_blank">
      <area shape="rect" coords="799,897,929,917" href="http://maps.google.com/maps?oe=utf-8&client=firefox-a&ie=UTF8&q=linden+tree+inn,+MA&fb=1&split=1&gl=us&cid=0,0,4311611072443259400&ei=QLzjSZqbF8afmAfk9YDmAQ&t=h&z=16&iwloc=A" target="_blank">
      <area shape="rect" coords="261,793,301,813" href="#">
      <area shape="rect" coords="818,769,936,791" href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=1091+Washington+Street,+Gloucester,+MA+01930&sll=42.657945,-70.624689&sspn=0.014155,0.024054&gl=us&ie=UTF8&t=h&z=17&iwloc=A" target="_blank">
      <area shape="rect" coords="261,666,338,682" href="http://maps.google.com/maps?f=d&source=s_d&saddr=logan+airport&daddr=1091+Washington+Street,+Gloucester,+MA+01930&hl=en&geocode=&gl=us&mra=ls&sll=42.677628,-70.658242&sspn=0.007075,0.012027&g=1091+Washington+Street,+Gloucester,+MA+01930&ie=UTF8&t=h&z=11" target="_blank">
      <area shape="rect" coords="128,32,950,157" href="http://www.ankenystudio.com">
    </map>
    </body>
    </html>

    Yeah, I know, it's not pretty programming. However, usually it's effective, quick and allows me complete control over everything from font to perfect element placement. I don't need to site to be dynamic in the least, since I'll only be updating it minimally once a year.
    Are there any size limits to the images DW MX can handle that anyone knows about?

  • Why is the placeholder Q&A for multiple choice not visible on screen?

    After inserting 6 Multiple choice quiz slides in Captivate 7, the placeholder Q&A text is not visible, so there's no way for me to modify them with my Q&A's. However, they are visble in Preview mode. Any suggestions?
    This is happeneing in a project that someone else created & I am editing. I made a new version & copy/pasted the quiz slides into a new file. Ever since then I've had this problem. When I open the original file, it's now doing the same thing there as well. What gives??
    Below is what I'm seeing. If you look at the slides on the filmstrip on the left, you can see that there is nothing there, however in the Preview, you can see the placeholder text.

    Hi Rod & Lily! Thanks so much for replying.
    OK - the screen shot below is what I see when I am in edit mode. Completly blank except for the "Multiple Choice" heading at the top. I've highlighted in red on the Properties & Filmstrip, which Master slide I'm using. Hopefully you can see that on the Master Slide the placeholder text is there, but not in the edit view.
    Lily - below is a screen shot of the Quiz Properties. Hopefully you can see it.

  • Need urgent help how show my placeholder column in my report

    hi master
    sir
    i use report 6i
    i am making report with useing emp table i report i need one formula column and one placeholder column i
    first i mad report by useing report wizard
    after this i go in data modul and select one placeholder column and one formula column i write pl/sql
    :cp_1 := :sal;
    again run wizard and move
    placeholder column and one formula column
    in display item
    but when i run the report give me this error
    rep-1517 column 'cf_1' reffrence column 'sal' which is incompatible frequency
    please give me idea how i print my formula result in report
    thanking you
    aamir
    how show placeholder column in my report

    Hi,
    First create a formula column eg CF_1.
    Then create a placeholder column eg CP_1.
    Write a code in CF_1.
    [eg
    select bolFrValid into :CP_1 from tablename where condition;
    return :CP_1;
    Hope u got it

  • [CS5/JS/ScriptUI]: All contents is removed from tabbedpanel when showing alert box or other Window.

    When I open a new window (an alert box, another scriptUI window, or an old style InDesign dialog) from my non modal ScriptUI interface, the contents inside all tabs on the tabbedpanel of the window disappear completely, and the last tab is selected.
    Other controls, outside the tabbed panel (but in the same window) are left untouched.
    I suspect the error has to do with the tab control. I have been able to recreate the error in an extremely simple window, and I attach the code below.
    #targetengine 'test'
    var Window1 = new Window('palette','Test',undefined);
    buildWindow();
    Window1.show();
    function buildWindow(){
        Window1.tabMain = Window1.add('tabbedpanel',undefined,undefined);
        Window1.tabMain.minimumSize= [450,170];
        Window1.tabMain.Tab1 = Window1.tabMain.add('tab',undefined,"Tab 1");
        Window1.tabMain.Tab1.Static1 = Window1.tabMain.Tab1.add('staticText',undefined,"Text on tab 1");
        Window1.tabMain.Tab2 = Window1.tabMain.add('tab',undefined,"Tab 2");
        Window1.tabMain.Tab2.Static1 = Window1.tabMain.Tab2.add('staticText',undefined,"Text on tab 2");
        Window1.tabMain.Tab1.btnTest = Window1.tabMain.Tab1.add('button',undefined,"Test");
        Window1.tabMain.Tab1.btnTest.onClick = function(){alert('btnTest_onClick')};
        // Trying with calls to layout . (This button is not affected by the alert showing - only controls inside the tabbed panel)
        Window1.btnLayout = Window1.add('button', undefined, 'Window1.layout.layout()');
        Window1.btnLayout.onClick = function(){Window1.layout.layout()};
    The interface works well in CS4, and also if I make the window modal (by creating it as a "dialog").
    In CS5, the result is this:
    Calling layout.layout() or layout.resize() doesn't do anything.
    If someone else would like to try my code, do you get the same effect?
    Is the behaviour known?
    Is there a way to prevent this from happening for non modal ScriptUI windows?
    Best regards,
    Andreas Jansson

    Thanks Marijan, for testing and letting me know!
    I filed a bug report now. We would perhaps have to "force" a couple of our clients to an upgrade from CS5 to CS5.5 in order to beat this bug and get it working, unless Adobe acknowledges it quickly, which I don't count on.
    No good news then... I took for granted that the interface would work in CS5 if I made it in CS4.
    (The thing that I was mostly concerned about was a tree view which I tested in Mac/PC and on CS4/CS5. Not the "tabbed panel"...)
    Andreas
    Adding this answer I got from Adobe:
    Monday, November 21, 2011 2:21:03 AM PST
    Hello Andreas,
    I was able to replicate this problem with InDesign CS5. This bug seems
    to have already been fixed as a side effect of some code change within
    InDesign CS5.5.
    I have logged this under bug # 3050997. This will now be worked upon by
    InDesign engineering and should be fixed soon.
    I'll keep you informed about updates on this bug.
    Message was edited by: Andreas Jansson. Response from Adobe added.

  • [JS CS3] Can a dropdown list be made editable?

    Hello,
    I would like to have a dropdown list that is editable. The list I have is a list of existing xml tags. I have a script that creates new xml tags and I would like to include the now existing tag names and the ability to create new names.
    If a dropdown list cannot be made editable I can always create two fields, one a dropdown list, the other a textEditbox. But I'd like to just have one.
    Thanks,
    Tom

    Hmmmm...I thought I was using ScriptUI, but I now see in the ScriptUI Classes that there is an element called "ListItem" that appears to foot the bill. It appears that one can add to its drop down list.
    I'm not sure I want to rewrite what I have in "classical" just to eliminate an extra field. It is working fine now. Maybe next time I'll experiment with this.
    Thanks.

  • PDF printing out background placeholder text in fillable forms

    I'm trying to print out a PDF which has fillable form fields. The Date of Birth text field has a faint grey placeholder text dd/mm/yyyy. Everytime those fields are filled in, the dd/mm/yyyy will also print out in the background. Is this an option that can be turned off or is it something to do with how the form was made?

    Hi Daniel O'Toole,
    Please help with the below listed information for further assistance on this.
    1) Version of Acrobat/ Reader being used.
    2) Os being used
    3) Please attach a sample file to test.
    Thanks,
    Vikrantt Singh

  • Few questions about live cycle 9.0 es2. Opened pdf made from indesign.

    I am new to live cycle. I took a pdf which I created in InDesign.  I have some questions so I may finish editing it in LiveCycle. When I go to group text by dragging the mouse using the field tool, some remains in text boxes, other text remains in light outlined boxes. I would like it to all group and stay within one box for editing. Also, I see no white space to move the text to to edit it off to the right of the form like in InDesign. Nor can I find a way to create a blank page to move the text to to do more editing if  I would like. I also did not see a duplicate spread option to create a copy of the page I am editing. There is blurry and clear text after I opened the pdf in Live Cycle. How do  I make it all clear? This includes an eps logo at the top of the page. How do I do  copy and paste in place. Can I insert a pdf page after I am done edit this pdf page in LiveCycle? CAn brcodes take on alphanumeric, not just 1's and 0's? Thanks.

    No one?
    Some questions are answered by someone else.
    -The SLD is okay, it doesn't need to be configured
    -The Adobe Lifecycle Designer is automatically installed when installing the Netweaver Studio Sneak Preview SP16
    Just two more questions:
    1)when I open http://server:port/webdynpro/dispatcher/local/TutWD_OnlineInteractiveForm/OnlineInteractiveFormApp
    The PDF is shown but I can't use the buttons or the dropdown boxes.
    I tried to install ACF but I have NW04s SP16, and the ACF is only SP11.
    So when I install that, it only shows a blue screen with "I am the placeholder control"
    When I install ACF SP19 for NW04, the PDF shows again, but I still can't use the buttons or dropdowns. Is this normal?
    2) Do I need the license described below?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_srv/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d373530373834%7d
    Main questions----
    I need to create a form with a few fields (of which some fields are mandatory); then I have to use a few BAPI's to check these fields and to save the content in a CRM system.
    I've installed Netweaver Sneak Preview, and configured Adobe Document Services (made ADSUser & ADSCaller, set IIOP etc to Autostart, Installed the credentials). The tests seem to work fine, but I haven't developed anything yet.
    My questions:
    1) What about the ACF?
    2) Also the license described above?
    Grz
    Allan

  • ScriptUI and Flex SDK version

    Hello,
    what is the last Flex SDK version supported by ScriptUI?
    It seems I'm having troubles loading a swf made with Flex 4.5 (Flash project, not AIR).
    I've been told that 3.6 is the latest, usable SDK - yet I'm afraid it could be a permission issue (the error says: "Error #2032: Stream Error. URL: /Volumes/Macintosh HD/DEVELOPER/myExtension/GUI_Test/resources/framework_4.5.0.20967.swf")
    Thanks in advance
    Davide

    I confirm that with Flex SDK 3.6 the problem disappears - following versions are not supported (alas). You can download it here.
    Davide

  • $$PlaceHolder$$ in  RH7 HTML output

    Help!. We have recently upgraded from RH6 to RH7 (as part of
    Adobe Tech Comm Suite). Opening a RH6 project with RH7 all seems OK
    (topics, template, TOC, etc.) until I try closing and/or saving a
    topic. At this point -even if I've made no changes to the topic nor
    to the template- I am noticed that changes have been made to the
    header and footer and I am prompted to "apply the modification" to
    either "all the topics created from the template" or "only to the
    current topic". No matter what option I choose, every time I work
    with the same topic/s I have to repeat the whole process. Then,
    when I generate the HTML output, the text "$$PlaceHolder$$" appears
    instead of the header and footer. All the other features (Topic
    contents, TOC, Glossary, Browse sequences) are displayed properly.
    Note that header and footer look OK in Preview mode!
    About configurations: I have unistalled RH 6 before
    installing RH7; RH7 is version 7.01.001; my OS is Windows XP Pro
    (2002 with SP2).
    I don't know what to do other than going back to RH6. Please
    help!

    We have the same issue... the auto-update Date field in the
    footer causes the template warning message in RH 7. We have never
    had this problem before (all the way back to RoboHelp 9 and X5).
    Colum, you wrote:
    quote:
    A template is just standard text that can be applied to a
    topic.
    Well, that's partly true. A template is used to enforce
    headers, footers, and styles. Standard text, not included in a
    header and footer is only good once--if the template's body
    changes, that doesn't get pushed to topics (unless the standard
    text is included in a snippet); header and footer changes are
    pushed. So, I guess my point is that the templates are used to
    enforce a "corporate look". If you alter that look or delete
    standard text/variables, then you should be prompted with the
    warning. I'd imagine that for many authors, these warnings come as
    a surprise in RH 7. The content of the template really hasn't
    changed, just the value of a variable.

  • ScriptUI tab through the fields in a modeless dialog (IDCS4ME)

    Hi,
    I've made a dialog with ScriptUI, a "palette" i.e., modeless. I'd like the user to be able to press the Tab key and shift through the various text input fields etc. But instead, the Tab key hides the InDesign panels even when the dialog has the focus.
    Anyone know how I can get the Tab key to work in a standard way?
    Thanks,
    Ariel

    Thanks Harbs
    Is this the same bug that when typing characters they sometimes are applied to the InDesign document, and sometimes to the dialog?
    If so, does this mean that essentially nobody uses modeless dialogs with ScriptUI on a PC?

  • ScriptUI: How to update Listbox values? (CC2014)

    Is there way to update listbox element that filled with JS array elements. If I push more elements to the array, how I can re-render it in ScriptUI? Is there way to do this.
    I know there is way just to add elements to listbox like in Peter Kahrel's PDF. But this isn't so dynamic:
    var w = new Window ("dialog");
    var myList = w.add ("listbox", undefined, ["one", "two", "three"]);
    var b = w.add ("button", undefined, "Add");
    b.onClick = function () {myList.add ("item", "zero", 0)}
    w.show ();
    How about if I wan't to update listbox when I have changed my arrays, like below:
    // Create example array
    var testArr = ['item1', 'item2']
    $.writeln(testArr.length);
    startGUI();
    function startGUI() {
        // Window
        var win = new Window( "palette", script_name, undefined, { resizeable:true } );
        win.orientation = "column";
        win.alignChildren = ["fill", "fill"];
        // Listbox
        var myListbox = win.add ("listbox", undefined, testArr, 
            numberOfColumns: 1, 
            showHeaders: true, 
            columnTitles: ['Name']
        // Add Item To Array
        var addItem = win.add("button", undefined, "Add Item");
        addItem.onClick = function() {  
            testArr.push ('item3');
            $.writeln(testArr.length);
        // Quit BTN
        win.quitBtn = win.add("button", undefined, "Close");
        win.quitBtn.onClick = function() {  
            win.close();  
        win.show();
    Maybe there is some update funtion on ScriptUI. I tried to search solution without success. Any help?

    I updated your own script to show how I removed the listbox
    I added a group to host the listbox, the purpose of the group is to be used as a placeholder( to add the new listbox in the right place) and to easily get the listbox to be removed
    // listboxEditFromJSArray.jsx - Sakari Niittymaa
    // https://forums.adobe.com/message/6785515
    //#target illustrator
    // Create example array
    var testArr = ['item1', 'item2', 'item3'];
    startGUI();
    function startGUI() {
        // Main Window
        var win = new Window( "palette", "Test Listbox", undefined, { resizeable:true } );
        win.orientation = "column";
        win.alignChildren = ["fill", "fill"];
        // Listbox Group
        var grpListbox = win.add('group');
        grpListbox.alignChildren = ['fill', 'fill'];
        var myListbox = addListBox (grpListbox, testArr);
        // add ListBox
      function addListBox(container, testArr) {
            var listbox = container.add("listbox", undefined, testArr,  
                numberOfColumns: 1,  
                showHeaders: true,  
                columnTitles: ['Name']
            return listbox;
        // BTN: Add Items To Array
        var addItem = win.add("button", undefined, "Add Item");
        addItem.onClick = function() {
            testArr.push ('item' + (testArr.length + 1));
            grpListbox.remove(grpListbox.children[0]);
            myListbox = addListBox (grpListbox, testArr);
            win.layout.layout(true);
            //updateListboxArray(myListbox);
            //$.writeln (testArr.length + "  " + myListbox.items.length);
        // BTN: Remove Selected
        var removeSelectedItems = win.add("button", undefined, "Remove Selected");
        removeSelectedItems.onClick = function() {
            // Remove selected listbox item from array
            testArr.splice( myListbox.selection.index, 1 );
            updateListboxArray(myListbox);
        // BTN: Clear Listbox
        var removeAllItems = win.add("button", undefined, "Clear Listbox");
        removeAllItems.onClick = function() {
            // Clear the array
            testArr = [];
            updateListboxArray(myListbox);
        // Update listbox items
        function updateListboxArray(listbox) {
            // Clear listbox first
            listbox.removeAll();
            // Create new listbox items from array
            var i = 0;
            while (listbox.items.length < testArr.length) {
                listbox.add ("item", testArr[i]);
                i++;
        // Quit BTN
        win.quitBtn = win.add("button", undefined, "Close");
        win.quitBtn.onClick = function() {  
            win.close();  
        // Window Settings
        win.onResizing = function () { this.layout.resize(); };
        win.onShow = function () { win.layout.resize(); };
        win.center();    
        win.show();

  • [JS] ScriptUI CS6

    Hi
    Can anyone help me with a bit of ScriptUI. I am building a dialog box that contains a tabbed panel containing a single tab. I am filling this window with rows of editText boxes. Is it possible to make the tabed panel scrollable? There will be times when the screen is not deep enough, and need to be able to scroll up and down.
    Cheers
    Roy

    Hi all,
    I made an easy to use scrollable panel function.
    There is one significant change from the methodology used above.  That is the use of maximumSize, without using this the size of the inner panel is limited to the size of the screen.
    Enjoy,
    Trevor
    // By Trevor http://forums.adobe.com/thread/1229123?tstart=0
    function addScrollablePanel (toTheParent,
                                                locationX,
                                                locationY,
                                                outerPanelWidth,
                                                outerPanelHeight,
                                                innerPanelWidth /* leave blank if not scrolling horizontally*/,
                                                innerPanelHeight /* leave blank if  not scrolling vertically*/,
                                                barThickness /* optional */)
            var  padding = 2, innerPanel, outerPanel, scrollbarH, scrollbarV;
            innerPanelWidth || innerPanelWidth = outerPanelWidth; // if the optinal variables are not defined then define them
            innerPanelHeight || innerPanelHeight = outerPanelHeight;
            barThickness || barThickness = 15;
            innerPanelWidth += padding;
            innerPanelHeight += padding;
            scrollbarH = (innerPanelWidth != outerPanelWidth + padding);
            scrollbarV = (innerPanelHeight != outerPanelHeight + padding);
            if ($.os.match(/Windows/i))
                     scrollbarV && scrollbarV = toTheParent.add('scrollbar', [locationX + outerPanelWidth - barThickness -  padding, locationY + padding , locationX + outerPanelWidth  -  padding, locationY + outerPanelHeight  - padding - (scrollbarH && barThickness)]);
                     scrollbarH && scrollbarH = toTheParent.add('scrollbar', [locationX + padding, locationY + outerPanelHeight - padding -barThickness,  locationX + outerPanelWidth - padding - (scrollbarV && barThickness), locationY + outerPanelHeight - padding]);
                     scrollbarH && scrollbarV && toTheParent.add('statictext', [locationX + outerPanelWidth - barThickness - padding , locationY + outerPanelHeight - barThickness - padding, locationX + outerPanelWidth - padding, locationY + outerPanelHeight - padding]); // fill the gap between the scrollbarbuttons
                     outerPanel = toTheParent.add('panel',[locationX, locationY, locationX + outerPanelWidth, locationY + outerPanelHeight]);
            else // Mac
                    outerPanel = toTheParent.add('panel',[locationX, locationY, locationX + outerPanelWidth, locationY + outerPanelHeight]);
                    scrollbarV && scrollbarV = toTheParent.add('scrollbar', [locationX + outerPanelWidth - barThickness -  padding, locationY + padding , locationX + outerPanelWidth  -  padding, locationY + outerPanelHeight  - padding - (scrollbarH && barThickness)]);
                    scrollbarH && scrollbarH = toTheParent.add('scrollbar', [locationX + padding, locationY + outerPanelHeight - padding ,  locationX + outerPanelWidth - padding - (scrollbarV && barThickness), locationY + outerPanelHeight - padding - barThickness]);
                    scrollbarH && scrollbarV && toTheParent.add('statictext', [locationX + outerPanelWidth - barThickness - padding , locationY + outerPanelHeight - barThickness - padding, locationX + outerPanelWidth - padding, locationY + outerPanelHeight - padding]);              
            innerPanel = outerPanel.add('panel'); // set the bounds after setting the maximumSize
            innerPanel.maximumSize = [innerPanelWidth * 2, innerPanelHeight * 2]; // This needs to be set to at lest the required size otherwise the panel size is limmited to the screen size
            innerPanel.bounds = [0, 0, innerPanelWidth, innerPanelHeight]; // now we can set the size :-)
            scrollbarV && scrollbarV.jumpdelta = 100 * outerPanelHeight / innerPanelHeight; // Make size of bar whatdoyoucallit (drag thing) propotional to the size of the windows
            scrollbarH && scrollbarH.jumpdelta = 100 * outerPanelWidth / innerPanelWidth; // Make size of bar whatdoyoucallit (drag thing) propotional to the size of the windows
            scrollbarV && scrollbarV.onChanging = function () {innerPanel.location.y = scrollbarV.value*(outerPanelHeight)/100 - scrollbarV.value*(innerPanelHeight)/100 - padding *(1-scrollbarV.value/100) };
            scrollbarH && scrollbarH.onChanging = function () {innerPanel.location.x = scrollbarH.value*(outerPanelWidth)/100 - scrollbarH.value*(innerPanelWidth)/100 - padding *(1-scrollbarH.value/100) };
            innerPanel.location.x -= padding;
            innerPanel.location.y -= padding;
            return innerPanel;
    function hiJareck (toTheParent, accross, down, n, nn)
            accross || accross = 1;
            down || down = 1;
            /*        if (!accross >1) accross = 1;
            if (!down >1) down = 1;*/
            for (n = 0; n < down; n++) for (nn = 0; nn < accross; nn++) toTheParent.add('edittext',[20+nn * 140,15+n*30, 130 + nn * 140 ,35+n*30], "Hi Jareck #"+ (n+1) + " #"  + (nn+1) );
    /* ****************** USAGE ********************* */
    var w = new Window ("dialog","My Horizontally Scrollable Panel",[100, 100, 900 , 600]);
    horizontalScrollablePanel = addScrollablePanel (w, 20, 20, 250, 70, 3700, false, 20);
    horizontalScrollablePanel2 = addScrollablePanel (w, 20, 100, 250, 70, 1000, false, 20);
    verticalScrollablePanel = addScrollablePanel (w, 300, 20, 200, 150, false, 1000, 20);
    verticalScrollablePanel2 = addScrollablePanel (w, 510, 20, 200, 150, false, 1000, 40);
    vertAndHorzScrollablePanel = addScrollablePanel (w, 250, 190, 310, 210, 3520, 820);
    hiJareck(horizontalScrollablePanel, 26, 1);
    hiJareck(horizontalScrollablePanel2, 7, 1);
    hiJareck(verticalScrollablePanel, 1, 30);
    hiJareck(verticalScrollablePanel2, 1, 30);
    hiJareck(vertAndHorzScrollablePanel, 25, 25);
    w.show();

  • RapidScriptUI - ScriptUI Generator - free until 3/29/09

    We are proud to announce to our fellow scripters that our breakthrough product RapidScriptUI is now available for download at http://www.scriptui.com.
    We are convinced that our product will make it considerably easier to create ScriptUI code without having to write the error prone code.
    This is how it works, you download the Windows (.net 2.0) application at our website. Design, test your dialog using Photoshop, Indesign or Illustrator and save .rapid file. Then go to website http://www.scriptui.com/upload.aspx and upload your file and email address. click try it free and we will instantly forward to you an email with the JavaScript code.
    After the free trial time, there will be 2 purchase options as detailed on Website, with our basic option starting at just $2.
    For pictures of app and sample dialog created (immitation of new Character Style dialog in InDesign) see http://www.scriptui.com/gallery.aspx.
    Thanks

    The scripts produced are cross platform. it's the app that isn't see Indesign scripting Forum and http://www.scriptui.com/faq.aspx
    Thanks to all that tried out Rapid ScriptUI and http://www.scriptui.com.
    At this point we are testing the payment system on scriptui.com and all purchases made before April 6, 2009 will be refunded as is written on http://www.scriptui.com/upload.aspx under payment button.
    As it concerns mac users. it would be possible using the mono project to use app on the mac, however the ability to preview won't work since it uses com technology which doesn't exist on mac. However it might be possible to dynamicly create applescript which will do the same thing (create javascript and run in Photoshop etc..). However it is important that the code should not be exposed through command line etc..
    Anyone with knowledge to share with or without some reimbursement could share it here or email at 'support [at] scriptui .com'.
    Thanks again

  • Drop Zone / Final Cut Placeholder

    Is there a posibility to change (convert) a Drop Zone into FC Placeholder? I made some projects in Motion and I wan to use them as FCPX Titles with placeholder instead of Drop Zone.

    Read this thread all the way to the end:
    Is there any way to convert Dropzone to Final Cut Placeholder?
    That was for an Effect. For a Title, rename the project .moti (hopefully the same trick will work.)

Maybe you are looking for

  • Unable to Execute Packages using Agent

    Hi, When i am trying to run packages using Agent which is situated on other machine it is giving the following error. *" unable to executethe selected logical agent is not assosciated to a physical agent in desired context."* java.util.NoSuchElementE

  • HDMI cable with Mosh MiniDisplay port

    Hello, I got a Mosh mini display and a HDMI cable, and even though the image works fine. There is no sound. I thought HDMI cable transmit sound. Do I need another cable? Is there a Mosh Mini display that plugs to both my sound and my Thunderbolt port

  • Inserting Payment terms field in ME28 screen

    Dear Friends, Is it possible to insert one column for "payment terms" in ME28 screen. Because purchase approver wants to see the payment terms for particular vendor in the ME28 screen and release. Now he has to go for particular PO to see the Payment

  • Question: plz help in this

    hi, in XI how we will maintain for a perticular file for example at a particular time.like the poll interval if maintained at 30sec the porocessor will check the record for every 30sec but if we want to schedule at 12:00 every day to check for the re

  • Hallo ich habe ein Problem mit meinem iPhone 4 und zwar mein Vibrationsalarm funktioniert nicht mehr

    Hallo habe Probleme mit der Vibration mit meinem IPhone 4