Forums > MaxMSP

Create a calendar in max!

January 6, 2011 | 11:57 pm

Hi people! .. and Happy New Year!

Do you think it is possible to have a calendar interface in max? At least one like the one in the picture?

Thank you
ygr

[attachment=150672,1645]

Attachments:
  1. cal.png

January 7, 2011 | 12:40 am

I’d start by looking at [jit.cellblock] and maybe referencing it to a [coll]. Apart from looking like the image above what exactly do you need it to do?


January 7, 2011 | 12:54 am

Hey, thanks Luke! I looked at jit.cellblock. But it didn’t help much. What I wanted to do was that, for example when I’m to press a specific date in the calendar, the patch should take me to some info related to that specific date. So every date with a specific info. The info could be stored in a [coll] for example.

Of course I would have to add the info in the [coll] in order to access it.

I am guessing once it can look like the image above, I can click on a specific date which would output the date as an index for a [coll]?



yns
January 7, 2011 | 1:40 am

you can index coll objects with symbols. the patcher shows you how.

you can also save your coll to disk and load it later, look at coll’s helpfile.

– Pasted Max Patch, click to expand. –

January 7, 2011 | 5:06 am

You can use [textedit] with a preset to store each day’s info. For the days themselves, [tab] would be easiest, but you’d have to ensure that the "non-month" days (grayed out) wouldn’t be clickable, maybe with a [ubutton] over them. In this example I used a [textbutton] for each day, yes it was laborious, but it works. To be slicker (and to make as many months as you want) you’d probably need to get into scripting the objects into the patch: you’d specify a starting date/day and the number of days in the month, it would create them in the proper places with the right numbers on them. Would take some doing up front, but you could then generate all your months programatically instead of by hand…

And Luke’s suggestion for using [jit.cellblock] is a good one, it would be much simpler as far as getting the dates etc. filled-in. You’d save the months in a jit.matrixset maybe. Again, you’d need to make certain cells inactive. When you click an active cell, it would trigger the preset for the [textedit].

To save line-feeds in [textedit] you need to put in a semicolon, otherwise it’ll erase any line-feeds you put in.

anyway, see how you like this one :)

– Pasted Max Patch, click to expand. –

January 7, 2011 | 9:22 am

Wow! Thank you for all the help, guys! The whole idea from the beginning was to use some sort of calendar that updates and fills itself automatically with proper dates according to the month. Think [date] object on a larger scale! So I wouldn’t have to type the dates myself month after month, year after year. Like the [date] object it could use the OS’s system to show me the calendar. But I am guessing that is more related to java or something.

But your solutions could help me get out of this mess! Using jit.cellblock, coll or textedit and preset are fabulous ideas! So many solutions! Thank you so much to all 3 of you!


January 7, 2011 | 10:27 am

sounds great!

thinking about it some more, it should be feasible to give just the day of the week that January 1 falls on, then build the whole year from that (with a caveat for leap years). Would take some fiddling though… as does everything interesting…


January 7, 2011 | 12:56 pm

Without giving it too much deep thought, my suggestion for what I think you *really* want to do is to use Java (mxj) – there are tons of freeware Java widgets that you should be able to use – found this one very quickly:

http://www.toedter.com/en/jcalendar/index.html

Of course, this requires that you know some Java, know your way around mxj, etc…


January 7, 2011 | 6:21 pm

That’s what I figured! Unfortunately I don’t know any java! :(


March 11, 2014 | 2:13 am

Never thought of that, I will try using some UI calendar control if I have time. I’ll tell you the result.


Viewing 10 posts - 1 through 10 (of 10 total)