Hi Everyone,

I am busy generating a script that reads the assigned models from a function object. I then have to sort the assigned models manually, to get the sequence in the report in the correct order.

I have created a Dialog, with arrows next to a ListBox. I want to change the sequence in the ListBox by selecting a value and then clicking either the up or down button.

My code to this point:

var nuserdlg = 0;

  var userdialog = Dialogs.createNewDialogTemplate(0, 0, 680, 320, "Output sequence");

  userdialog.Text(10, 10, 460, 15, "Select the output sequence.");

  userdialog.Text(10, 25, 460, 15, "Click on \'OK\' to finish the selection.");

  userdialog.OptionGroup("Options");

  userdialog.OptionButton(20, 55, 360, 15, "Sort alphabetically", "Opt1");

  userdialog.OptionButton(20, 70, 360, 15, "Sort manually", "Opt2");

  userdialog.ListBox(20, 90, 586, 220, modNames, "list");

  userdialog.PushButton(610, 90, 25, 25, "<SYMBOL_ARROWUP>", "MoveUp");

  userdialog.PushButton(610, 280, 25, 25, "<SYMBOL_ARROWDN>", "MoveDwn");

  userdialog.OKButton();

  userdialog.CancelButton();

  var dlg = Dialogs.createUserDialog(userdialog);

  nuserdlg = Dialogs.show(dlg);

    var test = dlg.getDlgSelection("list");

        this.MoveUp_pressed = function()

 

Does anyone have any code on how to change the sequence when clicking on the MoveUp button?

Thanks,

Willem