Download the free trial version
Open Source Projects The place to discuss Basic4ppc open source applications.
Pocket Weather
11-15-2008, 03:09 PM
Basic4ppc Expert
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,760
Awards Showcase
Hi digitaldon37,
I had a look at your program, very nice and interesting.
One suggestion would be to insert somewhere the link to
Yahoo! Weather
where the user can find its location(s) from all around the world.
I tried some locations from Europe, works fine.
In your code you should add a test if
WeatherCurrent.code = 3200
3200 is the unknown code, this code is sometimes given for certain locations.
And in this case, in the Sub SetMainPage routine, line
imgCurrent.Image= AppPath & "\themes\" & INI.themeDir & "\conditions\" & WeatherConditionImages(WeatherCurrent.code)
generates an error.
There does also exist a condition code 0 (tornado), you shoud add an image 0.jpg for this code.
The images in your last version look nicer to me than those from the nws.
Didn't you have a link for their images in your first post ?
Best regards.
__________________
Klaus
Switzerland
11-15-2008, 05:22 PM
Basic4ppc Veteran
Join Date: Jan 2008
Posts: 215
Quote:
Originally Posted by
klaus
Hi digitaldon37,
I had a look at your program, very nice and interesting.
One suggestion would be to insert somewhere the link to
Yahoo! Weather
where the user can find its location(s) from all around the world.
I tried some locations from Europe, works fine.
In your code you should add a test if
WeatherCurrent.code = 3200
3200 is the unknown code, this code is sometimes given for certain locations.
And in this case, in the Sub SetMainPage routine, line
imgCurrent.Image= AppPath & "\themes\" & INI.themeDir & "\conditions\" & WeatherConditionImages(WeatherCurrent.code)
generates an error.
There does also exist a condition code 0 (tornado), you shoud add an image 0.jpg for this code.
The images in your last version look nicer to me than those from the nws.
Didn't you have a link for their images in your first post ?
Best regards.
Hi Klaus - thanks for the feedback and finding the bugs - I'll get those added to the next release.
I haven't decided exactly how to let the user find their location id yet. I am thinking of added a new program form with agraham's webbrowser library and inserting the Yahoo page (there doesn't seem to be a web service available) and to capture the result.
The original icons (before I grabbed the Yahoo icons) I think I got from here:
Weathericons - Weatherstation Salo, Halikko, FI . I was going to go back and put together a post on how to change the theme and weather icons.
11-17-2008, 11:23 AM
Basic4ppc Expert
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,760
Awards Showcase
Hi digitaldon37,
I wanted to learn a bit more in retrieving web information, so I took your program as a first sample.
As once suggested, I took the liberty to add a location search to your program.
I didn't make any cosmetics.
If you are interested in you can for shure use it.
I post only the sbp file.
Best regards.
__________________
Klaus
Switzerland
Last edited by klaus : 11-17-2008 at 12:12 PM .
11-17-2008, 03:30 PM
Basic4ppc Veteran
Join Date: Jan 2008
Posts: 215
Quote:
Originally Posted by
klaus
Hi digitaldon37,
I wanted to learn a bit more in retrieving web information, so I took your program as a first sample.
As once suggested, I took the liberty to add a location search to your program.
I didn't make any cosmetics.
If you are interested in you can for shure use it.
I post only the sbp file.
Best regards.
This is great! I will add it to the next developer release. Thanks Klaus!
11-17-2008, 10:21 PM
Basic4ppc Veteran
Join Date: Jan 2008
Posts: 215
version .25
Developer's version .25 has been uploaded to the main post. This version contains the location look-up code that Klaus generously provided.
I am going to try to wait at least a week before adding any new enhancements. This will give me enough time to test this thoroughly. Thanks to everyone for their help and feedback.
11-18-2008, 07:17 AM
Basic4ppc Expert
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,760
Awards Showcase
Hi digitaldon37,
In the location search part of the program you should change one line.
Code:
<font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > <font size= " 2 " ><font face= " Courier New " ><font color= " #0000ff " > Sub </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >cbxCountry_SelectionChanged (Index, Value)</font></font> </font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > Dim </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > txt</font></font> <font size= " 2 " ><font face= " Courier New " > cbxCity.Visible=</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > True </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > RegionI=Index</font></font> <font size= " 2 " ><font face= " Courier New " > txt=</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " > " http://weather.yahoo.com/ " </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >&AL2.Item(Index)</font></font> <font size= " 2 " ><font face= " Courier New " > WebRequest(txt)</font></font> <font size= " 2 " ><font face= " Courier New " > BrowseSubRegional</font></font> </font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > If </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxCity.Count > </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " ><font color= " red " ><b> 20 </b></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > AND </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " >StrAt</font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >(cbxCity.Item(</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >),</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >) = </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " >StrAt</font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >(cbxCity.Item(cbxCity.Count-</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 1 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >),</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >) </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > Then </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxAlphabet.Visible = </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > True </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxAlphabet.SelectedIndex=</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > Else </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxAlphabet.Visible = </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > False </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > End </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > If </font></font></font> <font size= " 2 " ><font face= " Courier New " ><font color= " #0000ff " > End Sub </font></font></font> </font></font></font></font></font></font>
You should replace 1 by 20. Because the routine checks if the first character of the first and last city name is equal and if yes displays the alphabet combobox.
Unfortunately for Estonia there is only 1 city list but the first and last city names begin with the same character.
Best regards.
__________________
Klaus
Switzerland
11-18-2008, 06:32 PM
Basic4ppc Veteran
Join Date: Jan 2008
Posts: 215
Quote:
Originally Posted by
klaus
Hi digitaldon37,
In the location search part of the program you should change one line.
Code:
<font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > <font size= " 2 " ><font face= " Courier New " ><font color= " #0000ff " > Sub </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >cbxCountry_SelectionChanged (Index, Value)</font></font> </font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > Dim </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > txt</font></font> <font size= " 2 " ><font face= " Courier New " > cbxCity.Visible=</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > True </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > RegionI=Index</font></font> <font size= " 2 " ><font face= " Courier New " > txt=</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " > " http://weather.yahoo.com/ " </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >&AL2.Item(Index)</font></font> <font size= " 2 " ><font face= " Courier New " > WebRequest(txt)</font></font> <font size= " 2 " ><font face= " Courier New " > BrowseSubRegional</font></font> </font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > If </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxCity.Count > </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " ><font color= " red " ><b> 20 </b></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > AND </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " >StrAt</font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >(cbxCity.Item(</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >),</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >) = </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " >StrAt</font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >(cbxCity.Item(cbxCity.Count-</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 1 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >),</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >) </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > Then </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxAlphabet.Visible = </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > True </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxAlphabet.SelectedIndex=</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > Else </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " > cbxAlphabet.Visible = </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > False </font></font></font> </font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > End </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " ><font face= " Courier New " ><font size= " 2 " ><font color= " #0000ff " > If </font></font></font> <font size= " 2 " ><font face= " Courier New " ><font color= " #0000ff " > End Sub </font></font></font> </font></font></font></font></font></font>
You should replace 1 by 20. Because the routine checks if the first character of the first and last city name is equal and if yes displays the alphabet combobox.
Unfortunately for Estonia there is only 1 city list but the first and last city names begin with the same character.
Best regards.
Thanks. I made the change and am testing with some other minor tweaks.
11-19-2008, 07:49 PM
Basic4ppc Expert
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 900
Awards Showcase
Hi digitaldon37,
thank you, very good work.
Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
11-20-2008, 07:53 AM
Basic4ppc Veteran
Join Date: Jul 2008
Location: Schwäbisch Gmünd
Posts: 353
Hi digitaldon37,
very nice work!
Do you also want to have it in other languages (German)?
__________________
JOTHA | Greetz from the Schwabenländle.
Pocket-PC: HTC HD2 (Dual-Boot WindowsMobile 6.51 + Android 2.2 Froyo)
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT. The time now is 02:44 PM .