constructcalendar
TEMPLATE

The constructcalendar statement creates the form elements for a monthly calendar.


Parameters

This statement has one parameter:

template – text and tags that specify options for constructing a calendar (see discussion below).


Description

This statement automatically creates the form elements for a monthly calendar. The template parameters allow you to customize how the calendar is formatted. You can specify the calendar size, colors, font, text size etc. These tags are discussed below.

Keep in mind that this statement generates regular form objects, just as if you had created them manually. Once the objects are generated, you can manipulate these objects in Graphics Mode any way you like.

Calendar Sections

There are three major section of a calendar:

Calendar Dimensions

The default size for the body of the calendar is 4" high by 6" wide. For different dimensions, use the <height:dimension> and <width:dimension> tags. The measurements are normally expressed in points (1 point = 1/72 inch) but you can also specify values in inches (1 in or 2.5 inch or 0.75") or centimeters (20 cm).

<height:5"><width:7">

The default size for the header of the calendar is 1/2 inch. To change this use the <headerheight:dimension> tag.

<headerheight:1cm>

The height of the title section is 1.5 times the title font height (see below). There is also a margin between the title and the header which is normally 1/2 the title font tag. Use the <titleheightfactor:ratio> and <titlemargin:dimension> tags to change these values.

Calendar Colors

All colors can be specified either by their name (white, blue, silver etc.) or by their HTML value (FF0000 for red, etc.)

To set the background color of the header use the <headerbackgroundcolor:color> tag (the default is a very light gray - F8F8F8). Use the <headertextcolor:color> tag to set the color of this text. This example creates a header with very light gray text on a blue background.

<headerbackgroundcolor:blue><headertextcolor:F8F8F8>

There are three background colors for the body of the calendar. The <bgemptydaycolor:color> tag sets the color of empty days (boxes in the matrix that are not actually days in the current month). The default is white.

The <bgdaycolor:color> tag sets the color of normal days (the default is light green - F0FFF0). The <bgtodaycolor:color> tag sets the color of one special day – today (the default is light blue - F0F0FF).

The <textcolor:color>, <headertextcolor:color> and <titletextcolor:color> tags control the color of text in each of the three sections (all default to black if not specified).

The <framecolor:color> tag sets the color of the calendar frame (the lines in the calendar). The default is light gray - CCCCCC. Set this color to white if you don’t want any lines at all.

Header Pattern

The <headerpattern:pattern> tag controls how the day names are displayed in the header. This is probably best explained with some examples:

<headerpattern:D> ☞ S, M, T, ...
<headerpattern:Day> ☞ Sun, Mon, Tue, ...
<headerpattern:DAY> ☞ SUN, MON, TUE, ...
<headerpattern:DayOfWeek> ☞ Sunday, Monday, Tuesday, ...
<headerpattern:DAYOFWEEK> ☞ SUNDAY, MONDAY, TUESDAY, ...

The default header pattern is Day.

Title Pattern

The <titlepattern:pattern> tag controls how the month and year are displayed in the title area. Again, this is probably best explained with examples:

<titlepattern:Month YYYY> ☞ August 1989
<titlepattern:MONTH YYYY> ☞ AUGUST 1989
<titlepattern:Mon YYYY> ☞ Aug 1989
<titlepattern:Month YY> ☞ August 89

The default title pattern is Month YYYY.

Text Font and Size

To set the font and text size use the <font:name> and <textsize:points> tags (the default is Helvetica 18). The header can have a different size, specified with the <headertextsize:points> tag. The title defaults to 24 point, and can be customized with the <titlefont:name> and <titletextsize:points> tags.

Day Number Alignment

The day number is normally centered in the box for each day. You can move the number to any corner or edge of the box with the <daynumberalign:corner/edge> option. Here are some examples:

<daynumberalign:topleft>
<daynumberalign:topcenter>
<daynumberalign:topright>

Customizing the Forward/Back Buttons

To move back and forward month to month, two buttons are automatically generated to the left and right of the title (including the programming code necessary for these buttons to work). By default, these buttons are and . You can customize the buttons with the <buttons:style> tag. There are six standard styles: hand, arrow, arrowcircle, chevron, chevroncircle, and caret.

The button artwork actually comes from Font Awesome, which is pre-installed in Panorama X. You can actually use any two Font Awesome characters as buttons by specifying the hex values for the characters in the tag, separated by a comma. This example will generate back/forward buttons ( and ).

<buttons:f04a,f04e>

To find these values, go to the Font Awesome icon search page. Click on the icon you want to use, then look for the Unicode value. At the time of this writing, this value is listed in small print in the gray area of the page, in the line below the name of the icon.

The button size is normally the same size as the title. To make the buttons smaller, use the <buttonsize:dimension> tag. The buttons are normally black, but this can be customized with the <buttoncolor:color> tag, for example:

<buttoncolor:blue>
<buttoncolor:339933>

Calendar Date Variable

The calendar needs a fileglobal variable to hold the date associated with the current month. This variable is normally named calendarDate but you can use a different name if you want (for example if you have multiple calendars in your database). Use the <variable:name> tag to specify a different variable name.

Note: When the calendar objects are generated, Panorama also sets up initialization code in the form event procedure to automatically set up the variable to the current day when the form window is opened. If you don’t want this code to be generated (because you are planning on initializing this variable yourself), use the <noinitialize> tag. (Of course you can also delete this code manually at a later date.)

Matrix Frame Objects

In the process of creating the calendar, Panorama creates two matrix frame objects. These normally have the names _CalendarHeader and _CalendarBody – the root is _Calendar. You can use the <framename:root> tag to change the root.

The matrix frame objects are normally generated 1/2 inch to the right of the main calendar objects. Use the <framespace:distance> to change that distance.

Putting Multiple Calendars on One Form

You can only generate one calendar per form. If you want to put two (or more) calendars on one form, here is how you can do it.

First, generate the first calendar.

Next, create a second form. Make sure the root (see previous section) and date variable are different, then generate the calendar. Once generated, you can copy and paste this calendar to the first form. You can then delete the second form if you don’t need it. You can repeat this for as many calendars as you want, making sure to change the root and date variable each time.

Removing Existing Form Objects

If the very first item in the template is the <zapform> tag, the form will be cleared before generating the new objects. Be careful with this tag – it will destroy everything in the form before adding the new objects!

Note: Even if you don’t include the <zapform> tag, this statement will clear any objects that were previously generated by this statement. In other words, even if you use this statement multiple times you’ll only end up with one set of generated objects.


See Also


History

VersionStatusNotes
10.0NewNew in this version.