Page 1 of 1

Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Fri Nov 25, 2016 11:33 am
by OpusAndi
While working with multiple monitors, right-clicking a macro and selecting edit... always results in the edit dialog appearing on the monitor currently set as the main display in the Windows display settings dialog.

My expectation is for the edit dialog to appear on the monitor MapTool is currently displaying regardless of re-positioning during execution.

Poking and prodding (methodical testing) reveals the following:
  • 1. If I redefine the main display while MapTool is running, subsequent macro edit dialogs appear on the newly defined monitor.
    2. All other UI elements I have tested do not exhibit this behavior. They all track with the current position of the MapTool application.
Is this UI behavior something that needs to be edited in MapTool's code, or is there a setting/configuration I am able to take advantage of to update this behavior?

I am running MapTool 1.4.1.7 on Windows 10.

Re: Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Fri Nov 25, 2016 12:27 pm
by aliasmask
I'm not sure, but I know it may have something to do with Windows. If you hold ctrl and click the X to close a window it will save the window information including size, position and location.

Also, in my signature is a drop in called RPEdit. It's something I use to import/export code quickly to MapTool so I can use an external text editor like Notepad++. I have some Notepad++ files to add function data with in the editor as well.

Re: Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Fri Nov 25, 2016 1:25 pm
by OpusAndi
First, I must say my early discovery of your Notepad++ & RPedit have been very useful as I have been learning MapTool.

The Notepad++ syntax highlighting is invaluable.
I have not found a way to use RPedit in conjunction with Global and Campaign macros.
I am probably just missing something.

Second, Testing ctrl-click-close has some very interesting results.
This tip is wonderful for my 4k display. I will certainly take advantage of it despite the following limitation:

The default location for the edit macro dialog is the upper-left of the currently defined main display.
Using ctrl-click-close on the main display works as expected. The new location is remembered.
Using ctrl-click-close after dragging the edit macro dialog to secondary display sets the new location to the bottom-right corner of the main display. Not the secondary display it resided on.
A side-note: it does maintain any resizing that was applied.

My suspicion is this has something to do with the way MapTool is coded to display this particular dialog. No other UI windows seem to be effected.
This is not a major issue in the long run as I am able to easily work around it by setting my main display on the fly as needed.
The good news is the relative saved dialog location is maintained. If it was saved to the upper-right on display1 it will open at the upper-right on display2 after the switch.
At this point I consider this mostly a curiosity.

On a related tangent: Do you know of a way to interact with the system clipboard from within an MT macro?

Re: Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Fri Nov 25, 2016 1:42 pm
by aliasmask
Global Macros are saved to the registry, so there is a way to edit them from outside of MapTool just by using a .reg file. I usually work with lib tokens and just put calls to the macros in the Campaign Window. I rarely have need for the global macros.

Re: Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Fri Nov 25, 2016 5:43 pm
by JamzTheMan
There is a fix in the pipeline. There was a function that most frames/dialogs in MT used to center them on the main MapTool frame. It had an extra check that reset x/y if they were less than 0. In Windows, secondary monitors can have a value less than 0. In my case, the main monitor is in the middle so the left monitor goes negative x up to it's width.

This fix is in 1.4.1.x. But the "Edit Macro" dialog did not call this function. I've changed that so it now centers on the MapTool frame although may add more code to "remember" it's position...

I've made some changes as I'm doing some macro editing so it's been annoying me lol. My personal build now has Syntax highlighting built in and allows the edit window to stay open while you run/test the macro. It also allows multiple windows open. If you wish to play/test/comment on it, it's @ maptool.nerps.net

Re: Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Fri Nov 25, 2016 11:37 pm
by OpusAndi
All I can say is brilliant Jamz!!!

I can verify MapTool 1.4.3.3 by Nerps positions the macro edit dialog as expected on multiple monitors.

Funny enough your build does not behave the same in regards to the ctrl-click-close method AM introduced me to in this thread (which I love).
In your build 1.4.3.3 ctrl-click-close reflects changes made to frame size but disregards positional information (the primary quality I loved in the 1.4.1.7 build). As you indicated the open dialog centers on the main MapTool frame.

The ideal behavior I envision would have each dialog record size and positional information on ctrl-click-close. This would best take advantage of the ability you introduced to open multiple dialogs. Here is an example of what that might look like.
Example
Image
I will continue to work with the MapTool Nerp build sharing anything that catches my attention.

P.S. I have also been interested i working with your Custom TokenTool (version 1.0b33) but the links return 404.

I have to say I normally participate in forums as an observer and have done so with MapTool for years.
Aliasmask and you have made my early experience incredible.

Thank you for the excellent support.

Re: Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Sat Nov 26, 2016 1:52 am
by OpusAndi
Silly me.... I did not read your last post closely enough and missed this statement.
... although may add more code to "remember" it's position...
.

Re: Multiple Monitor Idiosyncrasy - Macro Edit Dialog

Posted: Sun Nov 27, 2016 2:07 pm
by JamzTheMan
OpusAndi wrote:Silly me.... I did not read your last post closely enough and missed this statement.
... although may add more code to "remember" it's position...
.
:-) Yea, I'll probably end up emulating ctrl+click+close as the normal close method and also remember your line "position" so you can get back to editing quicker. I'm thinking of adding break points as well in the margin (basically call assert for you). For now I had to add additional onClose events to track the dialogs and such which probably broke the default ctrl+click+close behavior (it wasn't specifically coded to do that as is). Eventually I'll move it to it's own dockable panel and use tabs maybe. Feel free to chime in if you think multiple windows over a tabbed interface is preferred...

If I can get RSyntax to give us a pop-up wiki-text for the functions, I want to do that too. And maybe add some <insert snippet> that would insert blank default for:each, switch:case, and if statement blocks for you.


PS/Edit: I restored the TokenTool.exe link. I've lost the jar for now :-( But I'm in the process of packaging TokenTool with MapTool and may integrate it a bit more...stay tuned!