[GastForen Programme Print/Bildbearbeitung Adobe InDesign Skriptwerkstatt ui und Windows 10 (CS6, WIN10.0 BUILD10240)

  • Suche
  • Hilfe
  • Lesezeichen
  • Benutzerliste
Print/Bildbearbeitung - Photos, Layout, Design
Themen
Beiträge
Moderatoren
Letzter Beitrag

ui und Windows 10 (CS6, WIN10.0 BUILD10240)

cwenet
Beiträge gesamt: 1139

15. Jan 2016, 19:38
Beitrag # 1 von 5
Bewertung:
(1768 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Guten Abend,

folgender Script Dialog will unter Windows 10 nicht richtig dargestellt werden.
Die Listbox bleibt einfach leer. Unter Windows 7 läuft es reibungslos.


Code
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
var choices =
[ [
"Auswahl1 Text1",
"Auswahl1 Text2",
"Auswahl1 Text3",
"Auswahl1 Text4"
],
[
"Auswahl2 Text1",
"Auswahl2 Text2",
"Auswahl2 Text3",
"Auswahl2 Text4"
] ];
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



getDialog = function() {
var w = new Window( "dialog", "Windows10 Test" );
w.alignChildren = "left";

rbuttons = w.add ('group');
rbuttons.add ('radiobutton {text: "(Auswahl 1)", value: 1}');
rbuttons.add ('radiobutton {text: "(Auswahl 2)"}');


w.listBox = w.add( "listbox" );
w.listBox.preferredSize = [ 300, 150 ];
var g = w.add( "group" );
w.okButton = g.add( "button", undefined, "OK" );
w.okButton.onClick = function() {
this.window.close( 1 );
}
w.canButton = g.add( "button", undefined, "Abbrechen" );
w.canButton.onClick = function() {
this.window.close( 2 );
}


// Standardliste anlegen
w.listBox.removeAll();
for (var n = 0; n < choices[0].length; n++) {
w.listBox.add("item", choices[0][n] )
}

rbuttons.children[0].onClick = function () {
w.listBox.removeAll();
for (var n = 0; n < choices[0].length; n++) {
w.listBox.add("item", choices[0][n] )
}
}

rbuttons.children[1].onClick = function () {
w.listBox.removeAll();
for (var n = 0; n < choices[1].length; n++) {
w.listBox.add("item", choices[1][n] )
}
}

return w;
}



function getSelectedButton (rgroup) {
for (var i = rgroup.children.length-1; i >= 0; i--) {
if (rgroup.children[i].value) {
return i;
}
}
return null;
}



var w = getDialog();
w.center();
if ( w.show() == 1 ) {
var sel = w.listBox.selection; // sel ist ListItem

if ( sel != null ) {
alert("Sie haben " + sel.text + " ausgewählt");
//alert ('Sie haben ' + rbuttons.children[getSelectedButton (rbuttons)].text + " ausgewählt");



}
}



Wie kann ich das Script zur richtigen Darstellung überreden?

Gruß
Christoph
X

ui und Windows 10 (CS6, WIN10.0 BUILD10240)

Peter Kahrel
Beiträge gesamt: 182

24. Jan 2016, 13:24
Beitrag # 2 von 5
Beitrag ID: #546265
Bewertung:
(1619 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hello Christoph,

Sounds like a (re)draw problem. I don't use Windows 10 myself so I can't really check it. One thing you could try is to force a redraw when the window is first drawn:

Code
w.onShow = function () { 
w.layout.layout();
}


Or, since it's just the listbox, try some harsh treatment, e.g. adding a dummy to the list and removing it:

Code
w.listBox.add("item", "dummy"); 
w.listBox.remove (w.listBox.find("dummy"));


Hope that that works.

Peter


als Antwort auf: [#545995]

ui und Windows 10 (CS6, WIN10.0 BUILD10240)

cwenet
Beiträge gesamt: 1139

25. Jan 2016, 16:22
Beitrag # 3 von 5
Beitrag ID: #546315
Bewertung:
(1550 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hallo Peter,

vielen Dank für Deine Antwort.
Ich habe versucht, Deine Codeschnipsel zu verwenden.
Leider hat es nicht funktioniert.

Ich bin mir auch nicht sicher, an welche Stelle genau, die Schnipsel eingefügt werden sollen.

Grüße
Christoph


als Antwort auf: [#546265]

ui und Windows 10 (CS6, WIN10.0 BUILD10240)

Peter Kahrel
Beiträge gesamt: 182

25. Jan 2016, 17:27
Beitrag # 4 von 5
Beitrag ID: #546318
Bewertung:
(1526 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
You would do that every time immediately after you create a list, e.g.

// Standardliste anlegen
Code
w.listBox.removeAll(); 
for (var n = 0; n < choices[0].length; n++) {
w.listBox.add("item", choices[0][n] );
}
w.listBox.add("item", "dummy");
w.listBox.remove (w.listBox.find("dummy"));


So you need to do the 'dummy' workaround more than once in your script.

Peter


als Antwort auf: [#546315]

ui und Windows 10 (CS6, WIN10.0 BUILD10240)

cwenet
Beiträge gesamt: 1139

25. Jan 2016, 20:51
Beitrag # 5 von 5
Beitrag ID: #546327
Bewertung:
(1481 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Vielen Dank Peter,

für Deine erneute Hilfe.
Leider funktioniert es nicht.

Dann muss ich damit leben.
In Indesign CC2015.2 (11.2.0.100 x64) funktioniert es wieder :-).

Grüße
Christoph


als Antwort auf: [#546318]
X