Example on CalendarPane

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Example on CalendarPane

Post by NigelS » Thu Dec 27, 2012 6:53 pm

I've been trying to get CalendarPane working for two days now and keep getting the following error. Can someone please advise what I'm doing wrong or can provide some simple example of how to put this together. This is the latest version from them. I've also attacted the instruction that came with the package.
Attachments
Screen Shot 2012-12-27 at 7.04.27 PM.png
Screen Shot 2012-12-27 at 6.51.29 PM.png

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Example on CalendarPane

Post by sturgis » Thu Dec 27, 2012 8:13 pm

Just tried things here and it seems to work ok for me.

Can you provide the code line that attempts to create a calendar?

To get a very simple stack working, I placed the following in the card script of my stack (only 1 card, just seeing if it would work for me)

Code: Select all

local sCalendarId
on opencard
-- I set both stacks as substacks of my project stack so that they can be referenced without a path. 
   start using stack "lib_Rect" 
   start using stack "lib_CalendarPane"

-- creates a calendar pane at the topleft of the screen (0,0) 1 month, vertical. 
   get CalendarPane_CreateNew( (the short name of this stack),0,0,1,"Vertical")
   put it into sCalendarId --saved the returned id for other usage
end opencard

on closecard
   stop using stack "lib_Rect" -- remove them from memory
   stop using stack "lib_CalendarPane"
   
end closecard

More information on where it fails might help locate the issue.

Also, since I've not used it before I had to find calendarpane. For anyone else looking in to this, the library is here. http://www.rotundasoftware.com/livecode ... arPane.php

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Example on CalendarPane

Post by NigelS » Thu Dec 27, 2012 8:48 pm

On the MainStack in Stack script I've code code as shown below.

Code: Select all

on preOpenStack
   start using stack "lib_CalendarPane"
   start using stack "lib_Rect"
end preOpenStack

on closeStack
   close stack "lib_CalendarPane"
   close stack "lib_Rect"
end closeStack
then via a button option selected by the user another card is opened and in that card stack is the following code.

Code: Select all

on openCard
   get CalendarPane_CreateNew("PLNListingCard",0,0,1,"Vertical")
end openCard
I now get this error
Attachments
Screen Shot 2012-12-27 at 9.46.44 PM.png
Screen Shot 2012-12-27 at 9.42.51 PM.png
Screen Shot 2012-12-27 at 9.42.51 PM.png (29.63 KiB) Viewed 7966 times

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Example on CalendarPane

Post by sturgis » Thu Dec 27, 2012 8:59 pm

It requires the short stack name, not the card name. Switch to the card where you want the object, then pass the stack name as the argument, not the cardname and I believe you'll be good to go. Notice in the error message it says that is is copying the group to stack destinationstack where destination stack is the name of the stack where you wish it to appear.

And the error is "can't find stack". The property inspector image that you attached is showing information for a card not stack.

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Example on CalendarPane

Post by NigelS » Fri Dec 28, 2012 7:49 am

Okay I get it now. Thanks

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Example on CalendarPane

Post by NigelS » Sat Dec 29, 2012 7:06 am

I've now gotten the Calendar to popup at the right location.

I used this script on a button to achieve this

Code: Select all


get CalendarPane_CreateNew("PLNL Management",257,108,1,"Vertical")
put it into sCalendarID 

my question know is, how do I get the return value once I've clicked on the date or selected the date?

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Example on CalendarPane

Post by NigelS » Sat Dec 29, 2012 7:11 am

What I'm trying to achieve is allow a user to press a button upon which a calendar will popup and will allow a date to be selected.
Attachments
Screen Shot 2012-12-29 at 8.08.01 AM.png

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Example on CalendarPane

Post by NigelS » Sat Dec 29, 2012 1:14 pm

I've scrapped using CalendarPane, not because it don't work, but because I just cant to get to grips with the way it's suppose to be used. After trying flcDataPicker within a couple of minutes I had a functional calendar working the way I expected it too.

The only reason why I didn't try flcDataPicker was because of the price, not that for the US and Europe it's expensive but it sure is for us here in South Arica. Fortunately I hope to recoup the cost as the application that I'm currently working on will bring in some revenue be it only in 2 months time. Soon I'm going to have to purchase the professional version of LiveCode and that also is going to be a fair outlay, so I was trying to keep cost's down.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Example on CalendarPane

Post by sturgis » Sat Dec 29, 2012 4:03 pm

Sorry for the delay getting back to you. I'm glad you found a way to get things working. I've never used calendarPane so i'm afraid my ability to help would be limited anyway. (There are other free alternatives out there, but the docs for those aren't always that clear either)

If you are looking for other information, tools, plugins, libraries.. (or just want to look at another calendar option) you can find some interesting stuff at http://www.troz.net/rev/index.irev
There is also droptools which is a handy plugin of pre-made custom controls. The controls can be seen at http://droptools.sonsothunder.com/all.irev Somewhere on the same site is the actual droptools plugin. also the sonsofthunder site has some really good stuff, the livecode specific stuff is at http://sonsothunder.com/devres/livecode/livecode.htm much of it is pretty old, but still valid.

I also don't know if you've yet been referred to:
http://lessons.runrev.com
http://www.runrev.com/developers/docume ... rs-course/
http://www.runrev.com/developers/lesson ... nferences/
http://livecode.byu.edu/indexgeneric.php
http://www.runrevplanet.com/free-downloads.html

Mark also has this site http://www3.economy-x-talk.com/index.php with lc information as well as a bunch of other stuff. Think some parts of the site require a donation (mainly to download the tools I believe, but I think the lc information portion is open)

Hopefully if you hit snags, or need to figure out a specific task or method, one of these links will point you in the right direction.

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Example on CalendarPane

Post by NigelS » Sun Dec 30, 2012 9:34 am

Thanks Sturgis for your response I certainly will avail myself to look around these site. I've been to some of them and found some useful information.
Time to get back to the work....

LC4iOS
Posts: 88
Joined: Tue Dec 03, 2013 8:15 pm

Re: Example on CalendarPane

Post by LC4iOS » Mon Jan 13, 2014 3:35 am

As always the info is here I just have to be able to find it.

Many thanks for this.

Code: Select all

on mouseUp
   dispatch "ReturnSelectedDate" to group CalendarPane    --as date serial
    answer the result
end mouseUp
Thanks to RunRev.
Thanks to LiveCode forum members.

LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member

Post Reply