how i can have one date picker in iOS and Android?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
how i can have one date picker in iOS and Android?
Hi,
I am trying to put one date picker...But i feel lost!
It should be one object date picker to can drag it to my card?
Anyway, as i didn't find nothing and as in the lesson was not explained to drag any object i copied the code but it didn't work...
I had one error with one handler...
This is the lesson i was following and where is the code i copied:
http://lessons.runrev.com/m/4069/l/3730 ... -on-mobile
And what i am waiting to see in my card is what i attached in the image.
Regards.
I am trying to put one date picker...But i feel lost!
It should be one object date picker to can drag it to my card?
Anyway, as i didn't find nothing and as in the lesson was not explained to drag any object i copied the code but it didn't work...
I had one error with one handler...
This is the lesson i was following and where is the code i copied:
http://lessons.runrev.com/m/4069/l/3730 ... -on-mobile
And what i am waiting to see in my card is what i attached in the image.
Regards.
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: how i can have one date picker in iOS and Android?
Hi...
The datePicker will only appear in your stack if it is running in the simulator or on a device... I have attached a stack that displays the datepicker on opening for you... The lesson that you were reading is the correct one to understand the datePicker... There is no 'datePicker' object that you can drag from the tool palette...
The datePicker will only appear in your stack if it is running in the simulator or on a device... I have attached a stack that displays the datepicker on opening for you... The lesson that you were reading is the correct one to understand the datePicker... There is no 'datePicker' object that you can drag from the tool palette...
- Attachments
-
- datePick.livecode.zip
- (1.75 KiB) Downloaded 176 times
Re: how i can have one date picker in iOS and Android?
Hi Dixie,
Thanks for your answer...
I tried what you attached me in my iPad and it is working fine!
My only doubt, is that if the picker can be as the image i attached in my last post ( the same one as the image in the lesson i saw ) or if it will be only as the image i attached in this post?
Because in the dictionary i didn't see the option to change it and make it 'more pretty'...
Regards.
Thanks for your answer...
I tried what you attached me in my iPad and it is working fine!
My only doubt, is that if the picker can be as the image i attached in my last post ( the same one as the image in the lesson i saw ) or if it will be only as the image i attached in this post?
Because in the dictionary i didn't see the option to change it and make it 'more pretty'...
Regards.
- Attachments
-
- DatePicker2.png (26.4 KiB) Viewed 6721 times
Re: how i can have one date picker in iOS and Android?
Hi aebki,
what you experience here is the cooperation between LC and the underlying OS!
LC does NOT create windows for its stacks, that's why e.g. Mac and Windows windows look different.
Same for almost any other controls like fields, scrollbars, buttons etc.
What you see here is this:
Obviously the lesson with the screenshot has been made with iOS < 8, so it looked a bit more colorful
than what you are seeing on your device with iOS >= 8, so complain at Apple for the current iOS look
P.S.
In case this is not clear enough: you cannot change this behavior!
Best
Klaus
what you experience here is the cooperation between LC and the underlying OS!
LC does NOT create windows for its stacks, that's why e.g. Mac and Windows windows look different.
Same for almost any other controls like fields, scrollbars, buttons etc.
What you see here is this:
Obviously the lesson with the screenshot has been made with iOS < 8, so it looked a bit more colorful
than what you are seeing on your device with iOS >= 8, so complain at Apple for the current iOS look
P.S.
In case this is not clear enough: you cannot change this behavior!
Best
Klaus
Re: how i can have one date picker in iOS and Android?
Hi Klaus,
Thanks for your answer...
Ok so i will complain to apple...
I didn't imagine that they could do it 'less pretty' in one newer version...
Regards.
Thanks for your answer...
Ok so i will complain to apple...
I didn't imagine that they could do it 'less pretty' in one newer version...
Regards.
Re: how i can have one date picker in iOS and Android?
Hi aebki,
beauty lies in the eye of the beholder!
And Apple's beholder is Jonathan Ives at the moment
Best
Klaus
beauty lies in the eye of the beholder!
And Apple's beholder is Jonathan Ives at the moment
Best
Klaus
Re: how i can have one date picker in iOS and Android?
Hi,
another doubts about the date picker...
How can i change the location of this object?
I tried with this line in the code, but it is not doing nothing...
So, this all the code:
I need to locate the picker, because i will need to show two pickers ( one with date, and another one only to choose one value) and both they should appear when i open the card and i one precise place...
And even to make it appear in "on openCard" or "on openStack" is not working... Only with one "on mouseUp"...
Is it normal? Because in the dictionary it was not written that is restricted only to "on mouseUp"...
So, i don't know how, but i thnk it should be possible to locate the date picker where you want and maybe too call it from one "on openCard"...
Thanks in advance!
Regards.
another doubts about the date picker...
How can i change the location of this object?
I tried with this line in the code, but it is not doing nothing...
Code: Select all
set the loc of iphonePickDate to 250 & comma & 450
Code: Select all
on mouseUp
if environment() = "mobile" then
iphonePickDate "date"
set the loc of iphonePickDate to 250 & comma & 450
if the result <> "cancel" then
put the result into red
put red into line 1 of fld 1
convert red to seconds
put red into line 2 of fld 1
convert red to long date
put red into line 3 of fld 1
end if
end if
end mouseUp
And even to make it appear in "on openCard" or "on openStack" is not working... Only with one "on mouseUp"...
Is it normal? Because in the dictionary it was not written that is restricted only to "on mouseUp"...
So, i don't know how, but i thnk it should be possible to locate the date picker where you want and maybe too call it from one "on openCard"...
Thanks in advance!
Regards.
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: how i can have one date picker in iOS and Android?
You can only display one 'date picker' at a time...
You can get the datePicker to display from openCard...
You can get the datePicker to display from openCard...
Code: Select all
on openCard
if environment() = "mobile" then
send "showDatePicker" to this card in 100 millisecs
end if
end openCard
on showDatePicker
iphonePickDate "date"
end showDatePicker
Re: how i can have one date picker in iOS and Android?
Hi Dixie,
Thanks for your answer...
Ok, so i will do it in another way as i can't show two 'date pickers' in the same time...
Thanks to show me how to do it from one 'openCard'...
And about the location of this 'date picker'... is it possible to choose where to locate it?
Regards.
Thanks for your answer...
Ok, so i will do it in another way as i can't show two 'date pickers' in the same time...
Thanks to show me how to do it from one 'openCard'...
And about the location of this 'date picker'... is it possible to choose where to locate it?
Code: Select all
set the loc of iphonePickDate to 250 & comma & 450
Re: how i can have one date picker in iOS and Android?
Hi aebki,
See it (and iPhonePickPhoto etc...) as a modal dialog like ASK and ANSWER,
there can only be ONE at a time on the screen.
Hint:
RED is actually a reserved word (= the colorname!) so to avoid possible inconveniences, you should use another name.
Every new version of the engine is less forgiving that the previous one!
Best
Klaus
"iPhonePickDate" is a COMMAND, not an abject, so you cannot set its loc!set the loc of iphonePickDate to 250 & comma & 450
See it (and iPhonePickPhoto etc...) as a modal dialog like ASK and ANSWER,
there can only be ONE at a time on the screen.
Hint:
Be careful with your variable names!...
put the result into red
...
RED is actually a reserved word (= the colorname!) so to avoid possible inconveniences, you should use another name.
Every new version of the engine is less forgiving that the previous one!
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: how i can have one date picker in iOS and Android?
Oops... the name of the variable 'red' is my fault... not aebki's... I often just use what comes into my head when writing snippets..
Re: how i can have one date picker in iOS and Android?
Hi,
Thanks for the answers!
So yes, i saw that was not one object...
What i could see, even if we can't loc the date picker is that is appearing always near the button who called it...
So i am wondering if i can wrote the code in the script of one button and make it invisible and then execute the code of this button without to press on it ( directly in the openCard...
Is it possible to call the script of one button without press the button???
Ok, i will change the red variable...
Regards.
Thanks for the answers!
So yes, i saw that was not one object...
What i could see, even if we can't loc the date picker is that is appearing always near the button who called it...
So i am wondering if i can wrote the code in the script of one button and make it invisible and then execute the code of this button without to press on it ( directly in the openCard...
Is it possible to call the script of one button without press the button???
Ok, i will change the red variable...
Regards.
Re: how i can have one date picker in iOS and Android?
Hi aebki,
...
send "mouseup" to btn "whatever"
...
It might be more effective to create a handler in the card or stack script
and call this from the button and/or from everywhere else! Know what I mean?
Best
Klaus
sure, you can always:aebki wrote:Is it possible to call the script of one button without press the button???
...
send "mouseup" to btn "whatever"
...
It might be more effective to create a handler in the card or stack script
and call this from the button and/or from everywhere else! Know what I mean?
Best
Klaus