!CommandToggle Thread last updated on 2003-02-23 11:41:06

Posted by member 5406 on 2003-02-22 11:43:58

I find that !CommandToggle is missing with lsxcommand. I've created !HideCommand and !ShowCommand bangs that show and hide the command box and the surrounding image. Now I was looking to create a !ToggleCommand but how do I toggle the command box? Is there some variable that I can use in an if-statement which tells if the command is shown or not? I've tried adding "shown 0" and "shown 1" to the !hide and !show bangs but it doesn't seem to work (using Sciscript.dll).
Also CommandFocus seems to be "missing" in lsxcommand.dll. Is there some other way of giving the command box focus?
I would also like to be able to read the position of the mouse so I can !CommandMove the command box on !show.

Posted by member 5406 on 2003-02-22 12:13:47 link

Ok. I've decided to change my theme a little which brings up a new problem. I'm only using the !ShowCommand bang now, and then I've added "CommandHideOnUnfocus" to my step.rc. Now I also want to hide the surrounding image, when the command box is hidden. Can anyone help me on that? I would still like it if you could answer my previous question though since it would be good to know.

Posted by member 562 on 2003-02-22 13:36:22 link

!FocusCommand works just fine for me.

Posted by member 5406 on 2003-02-22 14:42:22 link

ahh. It's just that the documents says !CommandFocus. Thanks for the help on that.

Posted by member 5406 on 2003-02-22 17:36:53 link

ok. I've but the whole thing into an LSbox now. It's solved some of my problems like toggleing the whole thing and the ability of popping up at the mouse postion - this only works first time after a recycle when I actually load the box so I would still like to know how to read the mouse position so that I can !LSBoxMoveBox.
The box also seem to be a bit buggy.
*Hotkey Win C !execute [!LsBoxCreate command.box] [!FocusCommand]
will always open the box, but sometimes it disappears again instantly. This is due to "LsboxAutoHide" which I have set in command.box. But this shouldn't affect the box since it gains focus both on creation and from !FocusCommand. Is there someway to get around this bug or do I have to live with it?

Posted by member 7223 on 2003-02-23 02:56:23 link

Humm, I'm not using LSBox for a while, but I could give you some tricks:
- Use mzscript.dll. It gives you vars like %{MouseX} and %{MouseY}. Then you can easily write things like !Exec !LsBoxMoveBox %{MouseX} %{MouseY}
- I don't know why you use !LsBoxCreate. I recommend to create boxes only one time and use !LsBoxShow, !LsBoxHide. I don't know if creating several times the same box could be buggy or not, but I guess it's not a good way...
- I don't know how LsBoxAutoHide works. Perhaps when LsxCommand get the focus, the box loose its own focus... Ty another way...

Posted by member 5406 on 2003-02-23 06:02:45 link

It isn't smart to create it all the time, but I did that to make the box popup at mouse location. I've changed it now to load hidden at start up and the show on my hotkey but it still has the same bug. The box doesn't loose focus when the command gains focus 'cause it works sometimes.

Posted by member 5406 on 2003-02-23 11:41:06 link

thanks. mzscript helped me out, now it's just the way I wanted it to be except it's still a little buggy on the focus issue.