Set Variable Anchor

Hello,

I've created a display window which contains a graph, color scale, and two set variable inputs. These inputs change the range of the color scale and update the whole window each time a value is changed. I'm using a sub-graph inside of the display window to contain the color scale to prevent the scale image from overlapping the rest of the graph when I resize the whole window. This works great. The set variable input boxes however are an issue. When resizing of the window is done, the set variable boxes stay at an absolute position on the window and are soon either covered or drastically out of place. The only options I see for positioning of the set variables are the tags pos and pos+ which both work in absolute pixels.

Is there anyway to anchor the set variable input boxes as a relative distance from the edge of the window so resizing of the window does not mess up alignment of elements in the window? I've tried to force the input boxes into the sub window I created for the color scale but Igor doesn't seem to like that. Is there some special flag for set variable similar to the text box anchor /A=LT or the sub window's guides? It just seems odd that most of the other elements have the option to align to something instead of fixed pixel coords and this doesn't. Am I missing something obvious or is this just not available for set variable boxes? I'm open to other ways of doing this as well its just that everything apart from the position of set variables works really well.

Thanks,
I'm often using the Resize controls helpers found via #include <Resize Controls Panel> and #include <Rewrite Controls Position>. They basically make it not necessary anymore to handcode the resize behaviour.
I suggest you post a screen capture of your interface so we can better help you.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
It sounds to me like you need to put your SetVariable controls into a sub-panel, and then have the sub-panel anchored to subwindow guides. For more info, while in Draw Mode (or Tool Mode?) in a panel window, right-click and select Layout Tips.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thank you for the quick responses.

JimProuty wrote:
I suggest you post a screen capture of your interface so we can better help you.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.


I've attached a image of the normal window and one of what happens when it is resized. As you can see, the Low/High set variable boxes are fixed and get pushed out of alignment when the window is resized. Ideally, they would be paired with the color scale and would be a percentage of the subgraph distance from the corners of the subgraph so resizing of the window wouldn't mess up the alignment.

johnweeks wrote:
It sounds to me like you need to put your SetVariable controls into a sub-panel, and then have the sub-panel anchored to subwindow guides. For more info, while in Draw Mode (or Tool Mode?) in a panel window, right-click and select Layout Tips.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com


When I try to do this with my current code I get, "While executing SetVariable, the following error occurred: Can't put controls in a subgraph.". Are you saying that this should work in a subpanel but not a subgraph? If so, would the placement of the SetVariables in the subpanel be based on pixel position inside the subpanel? Wouldn't that still have issues if the window is resized enough to resize the sub window?

Thanks,
normal.jpg (160.07 KB) resized.jpg (148.11 KB)
Yes, a sub-panel. We regret ever allowing controls in a graph.

With your layout, you would need two sub-panels, one at each end of the color scale. You might re-think the layout to make it easier to implement.

The default gray background of a panel sub-window might not look right, either- you probably will want to change the background color to white. If you put the sub-panel below the color scale, the gray background might look OK.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com