DOpus.Dialog -> Width

Hey,

I want to use the mouse as few as possible.
Shortcuts are too limited, so I defined some usercommands.
They are more powerful and accessible within the fayt-field (Vim-like :sunglasses: )

I wrote a script that lists all defined user commands in a dialog-message.
The problem is that I can not specify the dialog-width.
Therefore my list is not well formatted (word-wrap) :frowning:
And german umlauts are not correctly displayed as well...


Any ideas?

The umlauts issue is part of the current beta-releases if I'm not wrong. I have issues with bad characters as well since the latest betas.

And regarding the dialog-width, there's one hackish way of extending the width:
Add a checkbox and give it a label with 120+ blanks and at the end a single tab "\t", else the label will be trimmed and will have no effect.

var label = new Array(120).join(" ") + "\t"; 
dlg.options(0).label = label;
dlg.options(0).state = 0;

A native way to set a dialogs width has been requested already and I'm in the same boat! o)

This is news to me. Have these issues been reported? If not, what are they?

There was an issue in the betas specific to metadata tags, but that was unrelated to scripting.

As you can see in my screenshot, the umlauts and the ampersand are not correctly encoded.


1 = Suchen&Ersetzen
2 = Verknüpfung
3 = öffnen
4 = über

Thanks tbone - now I notized, that the height does not fit as well :frowning:
Not a good idea with the Dialog :confused:

Another encoding-example....

File encoding is correct:

Output (Protocol & Dialog) is incorrect:

It's the same with <, > ...

@leo
I was referring to this thread/post Current betas: diacritical characters

At work I'm on v11.12.3, but the bad character do not show anymore, will check at home as well. Maybe it has been resolved in the meantime, don't know exactly when I updated DO on my system at work.

@dinkel
Maybe better launch notepad to visualize your shortcut commands? (nice idea btw. o).
Currently the dialogs seem to have some problems with larger/taller/wider texts than usual for requesters.
Regarding the umlauts, make sure your scriptfile has an appropriate encoding! Ah, wait.. usercommand.. mhh, sorry! o)

@dinkel:
I meant tbone's comment. Can see there's definitely something wrong with the dialog there (looks like it's being fed UTF-8 instead of UTF-16), but I didn't remember a general issue with scripting and the current betas.

@tbone:

Thanks! That may have been overlooked as it was an aside in a thread about metadata. It may be the same thing as this thread, so leave it with us for now.

The dialog is just displaying the text that you give it. It's your script that's reading the raw file from disk, so your script needs to be responsible for handling the encoding (i.e. convert UTF-8 to UTF-16), and translating the character entity references (& etc).

You might be better off using an XML parser rather than reading the files as plain text - here's an example of using the Microsoft.XMLDOM object to load an XML file.

@tbone:
Yes, I came up with the idea using notepad (resp. the default application) as well :slight_smile:

@jon:
Thanks for the hint. Because I use notepad now I don't worry about it in this case :wink:
But for future use cases it might be helpful :thumbsup:

Any progress on providing a way for the user to specify a dialog width? My use case is similar to @Dinkelhopper's and I can't get @tbone's hack to work with the current (11.18) version.

I just want to display a help panel with a single OK button so a text input box is superfluous. However, I note that setting dlg.options(0) has no effect unless dlg.max=nnn is also specified.

Regards, AB

Yes, being able to set the dialog width would be something! o)