I have a issue with the DesignerScript and RerunDesignerScript that I can't seem to come up with a good work around. Maybe someone can help me.
I have created a project that uses the AHPViewPager for main navigation. The pager contains 8 to 10 panels and 4 or 5 of these have the exact same layout. What I do is loop and create a panel that will do a LoadLayout based on the counter. The panel's tag keeps an info type that helps keep track of the data contained in the panel.
It will then set the views (controls in my world in case I slip back and use that term) to their expected values using something similar to the following. It isn't the best but since there is no way to iterate through the controls (see I slipped) and get their names; I have to deal with control hierarchy. This is very ugly and would benefit from a name and a method to get a control by its parent and name. Typing this up I thought maybe using the Tag instead of Name. Enhancement in designer to auto set Tag to name?
parent = PageContainer.GetPageObject(pageNum)
pnl = parent.GetView(0)
dim vw as ImageView
vw = pnl.GetGet(3)
... code to load a bitmap into bmp etc
vw.Bitmap = bmp
Lots of work instead of something like
vw = FindView(parent, "Panel1.IVAvatar")
Sorry, I went off on a tagent. What I am finding is that since I created the pager panels and used LoadLayout the pager panels are too tall and thus the lower portion of the panels are not visible. If I do a RerunDesignerScript only the last known panel with the specified name gets adjusted. What I need is to tell RerunDesignerScript which parent panel to apply the changes to. Maybe even have the LoadLayout give back a unique ID that keeps track of the parent panel and script and then call RerunDesignerScript with an ID instead of the name again.
This might be a partial issue with the pager library but I know the layout/designer isn't as smart as it might be.
Thanks for any info/comments on this.
I have created a project that uses the AHPViewPager for main navigation. The pager contains 8 to 10 panels and 4 or 5 of these have the exact same layout. What I do is loop and create a panel that will do a LoadLayout based on the counter. The panel's tag keeps an info type that helps keep track of the data contained in the panel.
It will then set the views (controls in my world in case I slip back and use that term) to their expected values using something similar to the following. It isn't the best but since there is no way to iterate through the controls (see I slipped) and get their names; I have to deal with control hierarchy. This is very ugly and would benefit from a name and a method to get a control by its parent and name. Typing this up I thought maybe using the Tag instead of Name. Enhancement in designer to auto set Tag to name?
parent = PageContainer.GetPageObject(pageNum)
pnl = parent.GetView(0)
dim vw as ImageView
vw = pnl.GetGet(3)
... code to load a bitmap into bmp etc
vw.Bitmap = bmp
Lots of work instead of something like
vw = FindView(parent, "Panel1.IVAvatar")
Sorry, I went off on a tagent. What I am finding is that since I created the pager panels and used LoadLayout the pager panels are too tall and thus the lower portion of the panels are not visible. If I do a RerunDesignerScript only the last known panel with the specified name gets adjusted. What I need is to tell RerunDesignerScript which parent panel to apply the changes to. Maybe even have the LoadLayout give back a unique ID that keeps track of the parent panel and script and then call RerunDesignerScript with an ID instead of the name again.
This might be a partial issue with the pager library but I know the layout/designer isn't as smart as it might be.
Thanks for any info/comments on this.