
Help needed in construction of subpanels

masheroz
I'm trying to construct a panel layout that nicely scales as the window is resized.
I've attached an image of what I currently have from hacking away at the CWT demo, and a layout of what I think I want.
I've written up this code so far, but the placement of the panels in which I want to place the plots doesn't seem to work; no notice seems to be being taken of my frameguides.
What am I doing wrong?
//--------------------------------------------------------------------------- Function BuildTestPanel() //parent panel DoWindow/F TestPanel if(V_Flag==1) return 0 endif NewPanel /K=1 /W=(6,44,600,800) as "Test Panel" DoWindow/C TestPanel SetDrawLayer UserBack //panel to hold controls DefineGuide cpL={FL,5},cpR={FR,-5},cpB={FB,-5},cpT={cpB,-200} NewPanel /FG=(cpL,cpT,cpR,cpB) /N=controls /HOST=TestPanel DrawText 10,25,"Controls go here:" SetActiveSubwindow TestPanel //panel to holds graphs DefineGuide grL={cpL,0},grR={cpR,0},grB={cpT,-5},grT={FT,-5} NewPanel /FG=(grL,grT,grR,grB) /N=graphs /HOST=TestPanel SetActiveSubwindow TestPanel //panel to hold XRD plot DefineGuide xrdL={FL,5},xrdR={FR,-5},xrdT={FT,-5},xrdB={xrdT,-50} NewPanel /FG=(xrdL,xrdT,xrdR,xrdB) /N=xrdplot /HOST=TestPanel#graphs DrawText 10,25,"Diffraction pattern" SetActiveSubwindow TestPanel //panel to hold CWT plot DefineGuide cwtL={FL,5},cwtR={FR,-5},cwtB={FB,-5},cwtT={cwtB,-50} NewPanel /FG=(cwtL,cwtT,cwtR,cwtB) /N=cwtplot /HOST=TestPanel#graphs DrawText 10,25,"Wavelet transform" SetActiveSubwindow TestPanel end
The parent panel is 600x800
Any resizing of the width of the parent panel must result in the same change in all subpanels
Any resizing of height is specified below.
The bottom blue panel is 100% wide* and a fixed 200 pixels high. I've fixed it to the bottom of the parent panel. This is where I'm going to put all of my controls
The top blue panel is 100% wide, and the bottom of this panel is fixed to the top of the bottom blue panel. The top blue panel will change height, with the bottom blue panel remaining 200 pixels upon any resizing vertically
The two green panels are 100% wide and 50% high.
The red outlines in the green panels represent the plots.
The plots are 100% wide, and ~30 pixels less than the panel height, to allow for panel text.
* with 5 pixel setback all around

I was focussed on the wrong panels.
This is what I've got:
September 3, 2015 at 01:48 am - Permalink
September 3, 2015 at 01:57 am - Permalink
In case you don't already know, there's a package that ships with Igor that can be used to handle the resizing and repositioning of controls for you. It might be easier to use this package instead of doing the resizing yourself.
September 3, 2015 at 05:33 am - Permalink
I'll have a read in my copious spare time!
Sounds like it should help a fair bit in the next stage of the process. I'll probably have a look at your tab control thing too.
September 3, 2015 at 06:41 am - Permalink
https://en.wikipedia.org/wiki/Rubber_duck_debugging
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
September 3, 2015 at 10:26 am - Permalink
I didn't delete my post as I thought it might help someone else. I also got to learn about the resize commands; just about to read up on them now.
September 3, 2015 at 05:16 pm - Permalink