
Moving Panels without Changing Their Size

jjweimer
MoveWindow uses points. Panels are dimensioned in pixels. GetWindow returns pixels or points. Points and pixels are related by the screen resolution.
To offset a window by loffset and toffset, for any other (non-panel) window, I would do
GetWindow winname wsize MoveWindow winname V_left+loffset, V_top+toffset, V_right+loffset, V_bottom+toffset
For a panel, I could do the same, however I am concerned that translations between points <-> pixels might cause the panel to shrink/expand, even if only to an imperceptible degree.
Comments would be appreciated.
Because GetWindow and MoveWindow work with fractional points, you're okay.
Here's a demo that should reassure you: a "drunkard's walk" demo of a moving panel.
Run the macro and observe the initial and final window sizes. Resize the panel manually (chances are it'll be a fractional point size) and run the demo again.
Software Engineer, WaveMetrics, Inc.
July 2, 2008 at 11:27 am - Permalink
Good to know. I'll modify my ScreenSizer package accordingly to work with fractional points rather than rounded values.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
July 2, 2008 at 12:52 pm - Permalink