Portrait screen orientation: Switching to "Dual Horizontal" via event

Hello again,

when I open a lister on a monitor with portrait screen orientation, my aim is that the lister is switched to "Dual Horizontal" layout.

As a first attempt I'm using event OnOpenLister(openListerData). With Lister properties .right - .left I can calculate the width and via .bottom - .top the height of the monitor. If ( iWidth < iHeight ) then the monitor is a portrait one.
But setting openListerData.Lister.dual = 2 (dual-display, horizontal layout) doesn't work, like .dual( 2 ).

That works of course only when a lister is opened. What I miss is an event when the entire Directory Opus window is moved to another monitor.
I'm aware of the SysInfo object, method Monitors and its return object Vector:Rect which will be usefull in the future.

Any hints?

Many thanks and greetings
opusfreak

Resize, move and maximize, minimize is something you cannot detect right now. I tried similar things in the past, like hiding the viewer pane if I resize the window to be small and such, but the current event (OnListerUIChange) does not provide detailed enough information about what happened (minimize/maximize e.g.) or does not fire at all (resize, move e.g.).

Hello tbone,

thanks for your answer - as expected are events missing.

But how can I set a lister in dual-display, horizontal layout? As mentioned openListerData.Lister.dual = 2 doesn't work, like .dual( 2 ).

Many thanks and greetings
opusfreak

You need to run the commands which are already used in the buttons on the top right (in case your setup is similar to "stock").

Set DUAL=Toggle,Horiz Set DUAL=Toggle,Vert
In jscript code this could look something like this, in case you like to toggle into/out of dual horizontal layout:

cmd.RunCommand("Set DUAL=Toggle,Horiz");

Hello all,

the following instruction doesn't work:

DOpus.Create.Command.RunCommand( "Set DUAL=horiz" ) ;Any hints?

Many thanks and greetings
opusfreak

Any errors? Where do you run this?

DOpus.Create.Command will give you a new command object that does not have a lister/tab assigned to it. It will probably use the last active tab, which won't always be what you want.

You are often passed a command object to use that already has the details filled in. In most other situations you're passed a source folder tab or a lister which can be used to get it.

What's the context that your script is running in? Can you give the full script so we have all the details?

Hello,

because I use event OnOpenLister(openListerData) I have an openListerData object with a lister property.

Many thanks and greetings
opusfreak

Try this..

var cmd = DOpus.Create.Command(); cmd.SetSourceTab(openListerData.lister.activetab); cmd.RunCommand( "Set DUAL=horiz" );

Hello Tbone,

yep, is working! Many thanks.

Greetings
opusfreak