<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
It's not a scaling bug, but different origins.<br>
FCCtrl:SetLeft/SetTop uses the top left corner (0,0) of the dialog
window as the origin,<br>
while FCCtrl...:Create..(x,y) seems to use (11,11) as the origin (on
Windows - haven't checked Mac).<br>
I.e. a margin is automatically added when creating the elements.<br>
<br>
So these should address the same position:<br>
local button = dialog:CreateButton(50, 50)<br>
<br>
button:SetLeft(50+11)<br>
button:SetTop(50+11)<br>
<br>
Maybe this should be added to the documentation?<br>
<br>
Jan<br>
<br>
<div class="moz-forward-container"><br>
<br>
-------- Weitergeleitete Nachricht --------
<table class="moz-email-headers-table" cellspacing="0"
cellpadding="0" border="0">
<tbody>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">Betreff:
</th>
<td>[JW Lua] Dialog scaling bug not fixed when changing the
positions afterwards</td>
</tr>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">Datum: </th>
<td>Wed, 25 Oct 2017 13:12:26 +0200</td>
</tr>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">Von: </th>
<td>Jan Angermüller <a class="moz-txt-link-rfc2396E" href="mailto:jan@angermueller.com"><jan@angermueller.com></a></td>
</tr>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">Antwort
an: </th>
<td>The JW Lua script plug-in. <a class="moz-txt-link-rfc2396E" href="mailto:jwlua@jwmusic.nu"><jwlua@jwmusic.nu></a></td>
</tr>
<tr>
<th nowrap="nowrap" valign="BASELINE" align="RIGHT">An: </th>
<td>The JW Lua script plug-in. <a class="moz-txt-link-rfc2396E" href="mailto:jwlua@jwmusic.nu"><jwlua@jwmusic.nu></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
Jari,<br>
<br>
some versions ago you fixed the different scaling/positioning bug
for dialogs on MacOS/Windows.<br>
Today I noticed that the bug fix seem to only affect the
scaling/positioning when creating the dialog.<br>
If the dialog is changed on the fly afterwards, the values are
still scaled differently (on Windows! Haven't tested MacOS).<br>
<br>
Below is the test script which shows different positions when
using CreateButton(x,y) compared to SetLeft(x) / SetTop(y).<br>
Clicking on the "select" button should use the same position as
before, but it changes.<br>
This is how the script looks in action: <a target="_blank"
href="https://youtu.be/gprmtghPbAs" moz-do-not-send="true">https://youtu.be/gprmtghPbAs</a><br>
<br>
It is relevant when I have a dialog with a "standard" and an
"extended" version which use slightly different positions.<br>
<br>
Jan<br>
<br>
local str=finale.FCString()<br>
str.LuaString="Test"<br>
local dialog = finale.FCCustomLuaWindow()<br>
dialog:SetTitle(str)<br>
<br>
local static1= dialog:CreateStatic(0,0)<br>
str.LuaString = "Test:"<br>
static1:SetWidth(120)<br>
static1:SetText(str)<br>
<br>
local button = dialog:CreateButton(50, 50)<br>
str.LuaString = "Select"<br>
button:SetText(str)<br>
button:SetWidth(100)<br>
<br>
local function mycommandhandler(thecontrol)<br>
if thecontrol:GetControlID() ==button:GetControlID() then<br>
button:SetLeft(50)<br>
button:SetTop(50)<br>
end<br>
end<br>
dialog:RegisterHandleCommand(mycommandhandler)<br>
dialog:CreateCancelButton()<br>
dialog:ExecuteModal(nil) <br>
</div>
</body>
</html>