If your installer built with Setup Factory uses dialogs with custom sizes, you may notice that the dialogs won't show centered when you jump from a small dialog to a larger dialog or vice-versa. With this script, the new dialogs will always remain centered relative to the position of the former dialog.
How it works
- Place this into the Global functions:
function getScreenCenter() local tScreenCenter = {}; local tProps = Screen.GetProperties(); local hWnd = tProps.WindowHandle; local tPos = Window.GetPos(hWnd); local tSize = Window.GetSize(hWnd); tScreenCenter.X = tPos.X + tSize.Width/2; tScreenCenter.Y = tPos.Y + tSize.Height/2; return tScreenCenter; end function setScreenCenter(tScreenCenter) local tProps = Screen.GetProperties(); local hWnd = tProps.WindowHandle; local tPos = Window.GetPos(hWnd); local tSize = Window.GetSize(hWnd); local CurrentDialog = {}; CurrentDialog.X = tPos.X + tSize.Width/2; CurrentDialog.Y = tPos.Y + tSize.Height/2; local x = tPos.X + (tScreenCenter.X - CurrentDialog.X); local y = tPos.Y + (tScreenCenter.Y - CurrentDialog.Y); Window.SetPos(hWnd, x, y); end
- Place this into each On Preload script of your dialogs:
if (tScreenCenter ~= nil) then setScreenCenter(tScreenCenter); end
- Place this into each On Back and On Next scripts of your dialogs:
tScreenCenter = getScreenCenter();
With this code, the center of each dialog will not move when you navigate in the screens of your installer.






We provide customer support for Indigo Rose software development products since 2008!
Add a comment (For questions, please use the contact form!)