The button with the butterfly in the taskbar starts my alternative Windows start menu. When I click on one of the programs, the start menu closes and the program opens. The empty fields in the start menu also close the start menu when I click on it, if I don't want to do anything. This works very well. However, I sometimes accidentally open the start menu multiple times.
So I want to add a feature: The start menu should close as soon as I leave the floating toolbar with the mouse. This should prevent the opening of a second instance of the start menu.
The AI was of the opinion that a script could be applied to the entire toolbar. However, this is not possible (or is it?)
The AI suggested the following script.
function OnMouseLeave(data) {
var cmd = DOpus.FS().command;
cmd.RunCommand('Toolbar NAME=Startmenu CLOSE');
}
That being said, I can not think of any standard mean in Opus to achieve what you'd want.
The only thing I can think of would be to add some "empty" button that triggers (with a hotkey) the toolbar close action (or make it a global hotkey in Opus). But it's not related to the mouse position/movement.
PassThePeas, thank you for your quick answer. I had already thought that the artificial intelligence hallucinates again. As I wrote above, I already have the function to close the start menu in the toolbar at the empty fields.
So here comes my second question: Is there a way to force the start menu to have only one instance? That would do nearly the same job for me.
Sadly that doesn´t work as I intended. If I use your code Toolbar NAME="Startmenu" STATE=float TOGGLE
the floating toolbar doesn´t close after runnig a program with one of it´s buttons. When I hit on the empty fields, which have the Toolbar Startmenu CLOSE command nothing happens. But if I hit the Starter button in the taskbar the second time the toolbar Startmenu is closing ( the TOGGLE is working)
Before that I used the following command for the "Starter": Toolbar NAME="Startmenu" STATE=float AUTOCLOSE
This command is called by a link to the Dopusrt.exe because I want to have the button for the Startmenu in the Windows taskbar. So the target is: "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /acmd Starter
With AUTOCLOSE at the end of the Starter command the Startmenu toolbar is closing when I hit a program button or on the empty fields (command Toolbar Startmenu CLOSE)
But when I hit my taskbar Starter button without clicking somewhere on my Startmenu a new Startmenu opens. This is what I wanted to aviod. So I now tested something unconventional and it works. The command now is: Toolbar AUTOCLOSE NAME="Startmenu" STATE=float TOGGLE
I am pretty sure that this is against the syntax, but it works as I want it.
When the Startmenu toolbar comes up and I hit a button the Startmenu toolbar is closing and the program is starting. If I click next to the Startmenu toolbar when it is open, it also closes. Leo, do you have an explanation for this? Or does this not interfere with the syntax at the end? Thanks for your help, Leo!