Behaviour of GetWindow
ChrLie
I tried to use
GetWindow PanelName wsizeOuter
to get the V_left, V_top coordinates - this works on a Mac, but I get an offset of the panel from its previous position on Windows.From the documentation it's not clear to me why this is and what would I need to do to get the position of the panel right on Windows?
Cheers
Christian
Variable top = V_top*ScreenResolution/72
Variable left = V_left*ScreenResolution/72
Note that the /W positioning for a graph works in points.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
September 1, 2010 at 10:31 am - Permalink
A Code Snippet that shows a "platform-agnostic" example of how to extend a panel in one direction (down) can be found here. It might help as a start for building what you want.
Also, you can draw and add controls outside of the normal panel size. They will be "invisible" until the panel is resized to encompass them. A good practice in such cases is also to set the disable state of any controls outside the panel size to either 1 or 2 until you resize to make them "visible" again (in which case, you would set their disable state to 0).
Finally, doing the following in your code is useful to help keep users from making changes:
// uncomment next line to edit panel size and controls
//#define TEST
// WITHIN THE PANEL CREATION FUNCTION
NewPanel/N=MYNEWPANEL ...
#ifndef TEST
ModifyPanel/W=MYNEWPANEL noEdit=1, fixedSize=1
#endif
HTH
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
September 1, 2010 at 11:37 am - Permalink
JJ,
Hiding controls by plotting them outside the panel doesn't work in my case, because I don't know in the beginning with how many controls I will end up. The controls are part of a 'filter set' with which data from chemical analyses are being processed. For some data I may need 3 filter sets, for others maybe 10.
However, the snippet looks indeed very useful! Thanks!
Christian
September 2, 2010 at 02:03 am - Permalink
For things like that, I often use a ListBox control. You can put the ListBox into a mode that has editable cells, so if you need to change the values it can be done. The ListBox easily accommodates a variable number of values, and scrolls when you have a large number of rows.
To see the possibilities, you can look at the Listbox Demo experiment, in File->Example Experiments->Feature Demos 2->ListBox Demo.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
September 2, 2010 at 09:32 am - Permalink
ok, I haven't worked with or didn't know about ListBox yet. This might be an option if the number of controls get exceedingly high, which I don't see coming at the moment, but still, good to know!
C
September 2, 2010 at 12:49 pm - Permalink