Open viewer when clicking on thumbnail?

Is there a way to open Opus's internal viewer when clicking on a static control with an image? I tried creating a button the same size as the thumbnail and placing it on top, but it didn't work. The button would have to be transparent.

case "btn_visor":
   cmd.RunCommand("Show AUTOFILELIST");
   break;
<control height="72" name="btn_visor" type="button" width="128" x="869" y="8" />
<control halign="left" height="72" image="yes" name="thumbnail" title="imagen" type="static" valign="center" width="128" x="869" y="8" />

Turn on the Report Clicks property for the static control, and it'll send mouse button messages to your message loop.

1 Like

Perfect @Jon, I had already wondered what that click report on static controls was for, and today thanks to you, I learned it, thank you very much!

    while (true) {
        var msg = dlg.GetMsg();
        if (!msg.result) break;

        if (msg.event === "click" && msg.control) {
            if (msg.control === "thumbnail") {
                var cmd = DOpus.Create.Command();
                cmd.RunCommand("Show AUTOFILELIST");
            }
        }
<control halign="left" height="72" image="yes" name="thumbnail" notify="yes" title="imagen" type="static" valign="center" width="128" x="869" y="8" />