As a newbie I looked at the example for coding views..sweet.
Have had no problem loading webviews, doing db updates and moving between panels thanks to all the great examples.
Then I downloaded 2.2 and it looks like I should use designer to implement designer scripts for scaling
So I rejigged everything but I've lost the plot.
I set up 3 activities, but now I find that objects cannot be made global, so how do I use code in one activity or code module that needs to manipulate views created in another?
Probably a dumb question but its go me beat.:BangHead:
other than that Its been a fun couple of weeks.
Views (buttons etc) are 'activity objects' and therefore cannot be declared as 'Process Globals', so one activity cannot reference another activities views. If I remember you would have to do it indirectly (save variables / load variables) I think somebody did a post on it a while back.
You cannot manipulate from an activity views created in another activity !
You can manipulate views in a code module but these views must be an the active activity. To access a view in a code module you need to tansmit the view as an object ib the calling routine. Like in this example
What kind of view manipulation do you want to from in another activity?
If I understand you correctly you have 2 Activities 'Main' & 'setup', if you are in Main you cannot call "pnlSetup.visible=True" as pnlSetup is in a different Activity and at that point in time does not exist as it is a 'Global' object not a 'process_ Global' object. You would have to call the 'setup' activity
Hi,I am still getting pnlSetup not initilised with StartActivity("Setup")
I thought another answer might be to move the sub to the Setup activity name it LoadSetUp then call it with
CallSubDelayed2(pnlSetup,"LoadSetup",txt) (txt=btnSetup.Text) which I read as starting the activity but pnlSetup is still not initailised.
I think I am missing or not understanding something very simple so I'll start some more reading.
Hi,
Attached 2 files the SigGen1 has the views created in code, you can check out the Set up button and Classifications and get an idea on what I'm doing
The views created in designer SigGen2, Set up throws an exception.
Many thanks for taking the time to help.
I tried to test your programs but can't because there is no database file included in your projects.
From what I have seen is in the SinGen2 project you initialize panels which are already defined in the layout files you shouldn't initialize them once more in the code !
Then you define pnlSetup in the Main module but it's a view in the Setup activity. You cannot acces view in other activities !
In Setup you initialize pnlSetup but you shouldn't because because it's already defined in the layout file and you set it's Visible property to False ?
You should read the tutorial about Activities and their life cycle.
It seems that you are mixing up Panels in the same activity with Panels in other activities.
To show pnlSetup you need to call StartActivity(Setup) as laogore already suggested. This will load the Setup activity.
I get it now, the Set Up and Classification panels working....
I think I was overcomplicating the way activities work and trying to pass variables when there was no need.
Thanks again.