Thread: Pocket Weather
View Single Post
  #9 (permalink)  
Old 11-15-2008, 06:45 AM
Erel's Avatar
Erel Erel is offline
Administrator
 
Join Date: Apr 2007
Posts: 13,119
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You are only updating the three variables when the user presses on rbtnSettings.
If the user just opens the settings page and closes it these three variables will not be updated.
Here is a possible solution:
Code:
Sub editLocations
    rbtnLocations.Checked=
True
    pnlLocations.Enabled=
True
    pnlLocations.Visible=
True
    pnlSettings.Enabled=
False
    pnlSettings.Visible=
False
    
    lblDefault.Visible=
True
    lblLocationDescription.Visible=
True
    lblDelete.Visible=
True
    
Select CurrentLocationCode
        
Case Location(0)
            rbtnLocation1.Checked=
True
        
Case Location(1)
            rbtnLocation2.Checked=
True
        
Case Location(2)
            rbtnLocation3.Checked=
True
        
Case Location(3)
            rbtnLocation4.Checked=
True
        
Case Location(4)
            rbtnLocation5.Checked=
True
    
End Select
    
    form3.show
End Sub
Sub editSettings
    rbtnSettings.Checked=
True
    pnlSettings.Enabled=
True
    pnlSettings.Visible=
True
    pnlLocations.Enabled=
False
    pnlLocations.Visible=
False
    lblDefault.Visible=
False
    lblLocationDescription.Visible=
False
    lblDelete.Visible=
False

    
Select ini.mainWeatherUnits
        
Case "c"
            rbtnCelcius.Checked=
True
        
Case "f"
            rbtnFarenheit.Checked=
True
    
End Select
    form3.Show
End Sub
Sub updateSettings
    txtThemeSetting.Text=INI.themeDir
    txtHttpSetting.Text=INI.httpTimeout
    txtRefreshSetting.Text=INI.refreshInterval
    txtLocation1.Text=
Location(0)
    txtlocation2.Text=
Location(1)
    txtLocation3.Text=
Location(2)
    txtLocation4.Text=
Location(3)
    txtLocation5.Text=
Location(4)
End Sub
Sub Form3_Show
    updateSettings
End Sub
If you like you can use an ImageList and add all your images to this list.
That way the images will be merged in the executable.
__________________
Basic4android documentation
Reply With Quote