Weather iOS app

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Weather iOS app

Post by Klaus » Mon May 25, 2015 5:36 pm

Ah, OK, I see! :D
Glad you got it working!

catalinanesia
Posts: 83
Joined: Sun Feb 16, 2014 10:08 pm

Re: Weather iOS app

Post by catalinanesia » Mon May 25, 2015 5:49 pm

Klaus,
Why will never scroll back to letter A and hi-lite the row?
It will go nicely down (B,C,D,E,F,etc.) but not back to exactly A and hi-lite ?
Any hint?

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Weather iOS app

Post by Klaus » Mon May 25, 2015 5:53 pm

As I wrote, I just tested this here and worked as exspected!?
Please post your script.

catalinanesia
Posts: 83
Joined: Sun Feb 16, 2014 10:08 pm

Re: Weather iOS app

Post by catalinanesia » Mon May 25, 2015 6:13 pm

Klaus,
I modified this portion of your latest code and it woks:

Code: Select all

if tOffset > 0 then  -- I replaced 1 with 0
   add 1 to tOffset
end if
Also I added a button (0) to the group.
Thanks!

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Weather iOS app

Post by Klaus » Mon May 25, 2015 6:27 pm

Hi Catalin,

hm, with your modification, clicking A will display and hilite the SECOND line in my field!
And since we already exited when tOffSet = 0, tOffSet will ALWAYS be > 0 after that!
So "... > 1" is correct. Know what I mean?

Can you post the stack here or maybe send it to me and I can take look?
klaus AT major-k.de


Best

Klaus

catalinanesia
Posts: 83
Joined: Sun Feb 16, 2014 10:08 pm

Re: Weather iOS app

Post by catalinanesia » Mon May 25, 2015 7:10 pm

Hi Klaus,
see the attached stack, I left a comment on the code close to the end with your name.
If I replace the 1 with 0 then when I click the button A will go to that line if not then will
never hi-lite the A line ...
Thanks for the help, it works for me as intended ...

Regards,
Catalin
Attachments
Weather1.zip
(1.37 KiB) Downloaded 304 times

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Weather iOS app

Post by Klaus » Mon May 25, 2015 8:59 pm

AHA! Now I get it, me and my script presumed that A was the very first letter in that field, did not think of a ZERO 8)

OK, after thinking it over again, I think I have forgotten something very important to make it work all the time,
no matter what thte first char actually is. Oops :shock:

Please use this script and all is fine:

Code: Select all

on mouseup
   
   ## What button did the user click:
   put the label of the target into tFirstChar
   
   ## Check if a City with that first character is in the list
   put lineOffset(CR & tFirstChar, CR & field "citylist") into tOffSet 
   ## FORGOT to also use ->  ...CR & field "citylist"), silly me :-)

   if tOffSet = 0 then
      beep 
      exit mouseup
   end if
   
   ## Success! Now scroll the first line starting with that character into view:
   set the scroll of field "citylist" to round(tOffSet * the effective textHeight of field "citylist")
   add 1 to tOffset
   set the hilitedlines of fld "citylist" to tOffSet
   set itemdel to TAB
   put item 2 of the selectedtext of fld "citylist" into tCode
   put tCode into field "CityCode"
end mouseup

brandcode
Posts: 28
Joined: Mon Dec 01, 2014 12:28 pm

Re: Weather iOS app

Post by brandcode » Tue Jun 02, 2015 12:48 pm

i have make a full weather application on the LC is about 80% ready.
here is some photos full weather day + scroll with 36 hours and second view with week days.
is xml parse and i have stop the project.
Image
Image

catalinanesia
Posts: 83
Joined: Sun Feb 16, 2014 10:08 pm

Re: Weather iOS app

Post by catalinanesia » Tue Jun 02, 2015 5:38 pm

Nicely done brandcode,
why stop? it definitely looks good ...
What was the hardest part?
What was the easiest part?
Did you used Data Grids?
What is the most consuming part: programming or graphics?
What API you used?
do you mind to share some dev. insight? ...

I am studying the DG's now to implement them in my app,
I have started with a very long scroll field to put the world
City's in but then I wanted to add a "country flag" to be displayed
on each city row so I ended up reading about the DG's ...
Now I have skelet of a DG and I am trying to figure out a way of
transferring the long list of city's into it ...

Over all I have fun with LC.
Regards,
Catalin

brandcode
Posts: 28
Joined: Mon Dec 01, 2014 12:28 pm

Re: Weather iOS app

Post by brandcode » Wed Jun 03, 2015 12:07 pm

Hi Catalin.
There is no hard part for the application,was easy!!
The consuming part is the Graphics and most of them the Icons,because you need to synchronize time,city,hour with them.
There is no datagrid in applications you don't need it at all.
The Only part that need to be careful is the repeat commands,because need to extract specific parts from xml,or json format.
I use xml with xml parse and the api i have use is wunderground and wwo for alternative.
About the flags from city's and the DG.
For DG start with this http://lessons.runrev.com/m/datagrid/l/ ... -with-data
if you want to work with datagrids this is best tool for you http://livecode.com/products/thirdparty ... per-1-3-4/ you save time !!
i will put the project for sale next week because i have stop using LC.
I hope you have fun with LC.

Post Reply