Calendar widget
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Calendar widget
Hi Mark,
I tried your sample stack and as you say it does not work with a "navigation bar" widget.
However it works with the SVG Icon widget, the Header Bar widget and the Segemented control widget.
For Segmented control widget use "on hilitechanged" instead of "on mouseUp", the rest being the same as above script.
The probable reason why it does not work with the "navigation bar" widget is that the widget itself uses a popUp mechanism for tooltips in an experimental "editmode" mode.
Maybe one of the other widgets will do?
Kind regards
Bernd
I tried your sample stack and as you say it does not work with a "navigation bar" widget.
However it works with the SVG Icon widget, the Header Bar widget and the Segemented control widget.
For Segmented control widget use "on hilitechanged" instead of "on mouseUp", the rest being the same as above script.
The probable reason why it does not work with the "navigation bar" widget is that the widget itself uses a popUp mechanism for tooltips in an experimental "editmode" mode.
Maybe one of the other widgets will do?
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
I have a question for you all, which comes partly as a suggestion from Elanor. She suggested, as a way around the popup problem on iOS, to hide/show a group. But I was wondering, can you "show" a group at a particular location (like mouseLoc for example)?
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: Calendar widget
Hi Mark,
sure, this is Livecode:

Best
Klaus
sure, this is Livecode:
Code: Select all
...
set the loc of grp "currently hidden group" to the mouseloc
## Or wherever you like...
show grp "currently hidden group"
...

Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
Wonderful, thanks Klaus!! (I figured there was a way, just wasn't sure how)Klaus wrote: ↑Fri Dec 11, 2020 9:33 amHi Mark,
sure, this is Livecode:Code: Select all
... set the loc of grp "currently hidden group" to the mouseloc ## Or wherever you like... show grp "currently hidden group" ...
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
Or this way...SparkOut wrote: ↑Thu Dec 03, 2020 1:05 amJust as an aside, the determination of whether a year is a leap year is not solely judged by whether it is divisible by 4. (1900, for instance is not a leap year. Century years must be divisible by 400 to be a leap year.)
Revised function:Code: Select all
function isaLeap pYear // returns true if it is a leap year if pYear mod 4 is not 0 then return false if pYear mod 100 is not 0 then return true if pYear mod 400 is 0 then return true return false end isaLeap

Code: Select all
function isLeap pYear
// returns true if it is a leap year
put false into tLeap
if (pYear mod 4 = 0) and ((pYear mod 100 <> 0) or (pYear mod 400 = 0)) then put true into tLeap
return tLeap
end isLeap
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
Klaus, a follow up question. Can you display a group on card A that is located on card B? like... show group "MyGroup" of card "B". I tried this and it did not display the group on A, but I suspect it was showing it on the invisible card B. Confused yet? Ok, the idea is to have a popup calendar that is a group. I don't want to have multiple examples of the calendar, just one, stored on a card called "controls". So when I am where I want to display the calendar I would write something like "show group "Calendar" of card "Controls" and it would popup. I have tried it on the same card and that works. Just not when I put it on a different card.Klaus wrote: ↑Fri Dec 11, 2020 9:33 amHi Mark,
sure, this is Livecode:Code: Select all
... set the loc of grp "currently hidden group" to the mouseloc ## Or wherever you like... show grp "currently hidden group" ...
Thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: Calendar widget
Hi Mark,
But you can do something like this:
Then you can later, if neccessary:
Best
Klaus
no, this is not directly possible, the group needs to be on the same card.show group "MyGroup" of card "B".
But you can do something like this:
Code: Select all
...
lock screen
place bg "Calender" onto this cd
## set its loc if neccessary
unlock screen
## Et voila, your group! :-)
...
Code: Select all
...
remove grp "Calender" from this cd
...
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
Ok thanks. This is probably what I will end up doing since I need to have the same group appear on about 4 different cards.Klaus wrote: ↑Sat Dec 12, 2020 5:58 pmHi Mark,
no, this is not directly possible, the group needs to be on the same card.show group "MyGroup" of card "B".
But you can do something like this:Then you can later, if neccessary:Code: Select all
... lock screen place bg "Calender" onto this cd ## set its loc if neccessary unlock screen ## Et voila, your group! :-) ...
BestCode: Select all
... remove grp "Calender" from this cd ...
Klaus
Best,
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: Calendar widget
Or alternatively use a widget and pop it up at desired location. I do this with Hermann’s date picker widget, works well (his documentation in the widget itself has sample code how to do this...)
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
Thanks Stam. Are you doing this on iOS?
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
Thanks Klaus, this was definitely the way to go. And by doing the following I could install it on a card when needed and not worry about it. Very simple.Klaus wrote: ↑Sat Dec 12, 2020 5:58 pmHi Mark,
no, this is not directly possible, the group needs to be on the same card.show group "MyGroup" of card "B".
But you can do something like this:KlausCode: Select all
... lock screen place bg "Calender" onto this cd ## set its loc if neccessary unlock screen ## Et voila, your group! :-) ...
Code: Select all
if not exists(group "Calendar") then
lock screen
place bg "Calendar" onto this cd
unlock screen
end if
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Calendar widget
I ended up using the LC Calendar and popping it up (show/hide) in a group. Groups have their own visual effects so I was able to add the drop shadow effect, mimicking the way LC does it on the desktop. I also installed oversize left/right arrow buttons in the group to make it easier to use on mobile. I'm pretty satisfied with the result. I've attached an example stack in case anyone is looking for ideas.
Mark
Mark
- Attachments
-
- example calendar.livecode.zip
- (5.17 KiB) Downloaded 262 times
Last edited by marksmithhfx on Mon Dec 21, 2020 2:18 pm, edited 1 time in total.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: Calendar widget
OFF TOPIC -- but how do you create the 'Attachments' box in the forum post?
Re: Calendar widget
Is there a way to get the calendar widget to respond to a mouseUp message? It did not respond to one when I put that handler into the widget's script. As a workaround experiment,I tried making the widget its own group and put the message there. Of course,I could create a button as a control that would do what I want.
What do I want? I don't know yet, but I know I want to control something.
What do I want? I don't know yet, but I know I want to control something.
