palasx wrote: ↑Wed Oct 04, 2023 3:06 pm
Ilmafein wrote: ↑Fri Sep 15, 2023 11:47 pm
EvenLess wrote: ↑Thu Sep 14, 2023 2:37 pm
The
Reset Form Position
doesn't activate because it's not a toggle/switch. If you want the checkmark to show when "activating" it, just remove the one
nop
(which means no operation) line in the script. When you toggle the show/hide it will re-open at the previous position. Is it the latest version where I have made it always open on main screen/center?
Yes, it is the latest version, both table and sql file. The "reset form" option is kinda moot (for me in this situation) because the window itself does not show. I can catch a blink of it, but it immediately closes. I really don't know what could be causing this, as it is clear that the activation script works fine. Using Zanzer´s table, activating all options manually works fine, with the occasional CTD (really no biggie as I always save beforehand), but trying the table with autoloader also does not work. It really boggles my mind
Were you ever able to resolve this? I also get the window flashing very briefly when activating bg3commaner, but then it disappears. the reset position option does nothing, and if i deactivate bg3commander then i cannot reactivate it.
I have 3 monitors attached, two of which i usually leave disabled in windows when im not using them. i re-enabled them to see if the window was being moved to another monitor, but nothing changed. I'll try again later with the monitors physically detached, as it might be Windows seeing my primary monitor as "Display 3" even though the gpu sees it at "\\DISPLAY1\"
Where in the CT is the script to always default to display one, so that i can remote it and re-test?
I've never had the issue you're describing, so I have not really spend any time on resolving an issue I couldn't reproduce (sorry).
The form settings or stored in the form itself, not in scripts. The things in the script are what CE should do when various interactions are done in the form. The form is actually encoded into a string, that are added to the CT XML.
You can change more or less all the form settings (I think) through script, if you wanted, but it would be easier to just edit the form and change the settings through the nice GUI that are built into CE.
Just save a copy of the CT, so you can always just go back to the saved copy, if you accidentally changed something that completely broke the form (I've done that several times, broken something that is
)
The setting that specifies the opening placement are set on the main form element (which I called
FormBG3Commander
). Here you can set the
DefaultMonitor
,
Position
,
Left
, and
Top
which controls the opening position of the form. As I recall,
Position
would for some of the options be in relation to
DefaultMonitor
. I can't remember all the details, so just play around with it.
If you just want to try some quick things using Lua script, I can recommend using the Lua Engine window (the one that opens when doing a
print()
or when an error occurs). You can just enter the code you want to execute and press Execute, and see the results. And there are other benefits, such as some form of intellisense etc.
Just did a minor bit of playing around to refresh my memory, and it kinda looks like the
Top
/
Left
might be in relation to a combination of the
DefaultMonitor
and
Position
. At least a test started to open the window to the right/blow of the center of my main screen, when I changed the
Position
to
poMainFormCenter
.
This code prints some things, that might help you to "locate" the window, and it tries to reset the position to 100 pixels from the top/left of the primary screen, then shows the form. I'm not sure when you would want to use the
refresh()
or
update()
method calls. I'm not really sure I understand
[Link]. I just added them for good measure, even though I see no difference whether they are there or not in my own tests.
Code: Select all
print('Default Monitor: ', FormBG3Commander.DefaultMonitor)
print('Position: ', FormBG3Commander.Position)
print('State: ', tostring(FormBG3Commander.FormState))
print('Top: ', tostring(FormBG3Commander.Top))
print('Left: ', tostring(FormBG3Commander.Left))
print('Width: ', tostring(FormBG3Commander.Width))
print('Height: ', tostring(FormBG3Commander.Height))
print('Enabled: ', tostring(FormBG3Commander.Enabled))
print('Visible: ', tostring(FormBG3Commander.Visible))
--FormBG3Commander.DefaultMonitor = dmPrimary
--FormBG3Commander.Position = poMainFormCenter
FormBG3Commander.Top = 100 -- x position
FormBG3Commander.Left = 100 -- y position
--FormBG3Commander.centerScreen()
--FormBG3Commander.Width = 1280
--FormBG3Commander.Height = 720
FormBG3Commander.show()
FormBG3Commander.update()
FormBG3Commander.refresh()
print('Default Monitor: ', FormBG3Commander.DefaultMonitor)
print('Position: ', FormBG3Commander.Position)
print('State: ', tostring(FormBG3Commander.FormState))
print('Top: ', tostring(FormBG3Commander.Top))
print('Left: ', tostring(FormBG3Commander.Left))
print('Width: ', tostring(FormBG3Commander.Width))
print('Height: ', tostring(FormBG3Commander.Height))
print('Enabled: ', tostring(FormBG3Commander.Enabled))
print('Visible: ', tostring(FormBG3Commander.Visible))
I The annoying part is that I can find absolutely nothing about the Default Monitor option, except a single reference to where it is defined as a property. I can't even find anything about the options. Usually I can find those in the
defines.lua
in the CE installation folder, or at least by searching the CE Github repository. But for this, nothing.