Introduction
Calendar Commander ™

Version 1.0

Copyright © 1997 Kent Briggs

Briggs Softworks

Introduction

Calendar Commander is a versatile calendar design and print program for Windows 95 and NT systems.  Users can print any of the many calendars included with the program or can design their own custom calendars using Calendar Commander’s powerful script editor.  Calendar Commander is not a scheduling program or a personal information manager.  Its sole purpose is for printing attractive calendars in all sizes and styles imaginable.

Calendar Commander has built in support for English, French, German, Italian, and Spanish languages, and can automatically adjust itself for the start-week-on-Monday format  commonly used in Europe.  The program also supports importing images and exporting calendars in the JPG, GIF, PNG, PCX, TIF, and BMP formats.  Users who want to design their own calendars in Calendar Commander can easily share their creations with friends simply by sending them the ASCII-formatted script files.

Software License

Calendar Commander is copyrighted software distributed as shareware.  You are granted a temporary 30-day license to try Calendar Commander to see if it will meet your needs.  If you wish to use the program past the 30-day evaluation period, you must purchase the fully-licensed, registered version from the author or an authorized dealer.  Failure to comply with the license agreement is a violation of federal and international copyright laws.  Click the Register button on Calendar Commander’s main page for ordering instructions.

Disclaimer

This software is provided as is and without warranty.  The author assumes no liability for damages, either direct or consequential, which may result from the use of this product.

Author Contact and Technical Support Information

Kent Briggs

109A Romana Circle

Hewitt, TX  76643

E-mail:

CompuServe: 72124,3234

Internet: kbriggs@execpc.com

World Wide Web Home Page:

http://execpc.com/~kbriggs

Download other Briggs Softworks programs from WWW page:

Puffer - Secure data file and e-mail encryption program for Windows

CryptaPix- Graphics viewer/encryptor supporting jpg, gif, png, pcx, tif, and bmp formats

File Maven 95 - Dual-directory file manager for Windows 95 & NT systems

Miscellaneous

Calendar Commander was written in Object Pascal with Borland Delphi

ImageLib graphics library licensed from Skyline Tools

LZW compression technology for GIF and TIFF file formats has been licensed from Unisys Corporation under U.S. Patent No. 4,558,302 and foreign counterparts.

WISE installation package licensed from Great Lakes Business Solutions

Association of Shareware Professionals

Kent Briggs is a member of the Association of Shareware Professionals (ASP).  The ASP wants to make sure that the shareware principle works for you.  If you are unable to resolve a shareware related problem with an ASP member by contacting the member directly, the ASP may be able to help.  The ASP Ombudsman can help you resolve a dispute or problem with an ASP member, but does not provide technical support for members' products.  Please write to the ASP Ombudsman at 545 Grover Road, Muskegon, MI 49442-9427 USA. FAX 616-788-2765 or send e-mail to the ASP Ombudsman at 70007.3536@compuserve.com.


General Operation

Screen Layout

The Calendar Commander interface consists of a tabbed-notebook section on the left side containing many of the control functions and a big WYSIWYG (What You See Is What You Get) preview section on the right side.  A toolbar is located just above the preview section.  A pull-down menu system is provided for access to the saved calendars and also for program configuration.

Pages

The tabbed-notebook section contains four pages.  Click the labeled tab to make a page active.  The Main page shows the program title and license information.  Click the Register button to display the licensing costs and order form.  The Help button will bring up Calendar Commander’s help contents page.  The Options page contains the user adjustable controls for the current calendar.  This page is blank when no calendar is loaded.  The Script page consists of two listboxes.  The top listbox contains the active script for the current calendar.  The lower listbox contains a list of all the available commands for creating a calendar script.  The Printer page displays information about the current printer.  A Setup button is provided to adjust your printer settings.  Click the Print button to print the current calendar.  Click the Bitmap button to save the current calendar at the current zoom resolution to an image file.

Preview Section

Most of Calendar Commander’s main window is dedicated to this section so you can see what a calendar will look like before it is printed.  A blank page is presented when no calendar is loaded.  The preview section can be displayed at 11 zoom levels, ranging from 0% to 100% in 10% intervals.  0% represents the full, zoomed-out level where the entire page is visible.  Calendar Commander will stretch the page to as large a size as the preview section allows so the actual size at 0% zoom depends on your screen resolution and whether or not you have maximized the main program window.  100% zoom will display the calendar at a screen resolution exactly equal to the current printer’s resolution such that each pixel on the screen represents 1 dot on the printer.  For example, if the current printer’s resolution is 600 dpi (dots per inch), then at 100% zoom, the length of 600 pixels on your screen represents 1 inch on your printer.  Scroll bars will appear at all zoom levels above 0% so that you can pan across the page.

Toolbar

The toolbar is located just above the preview section.  It contains buttons for common commands (also available from the Configure menu) and Day, Month, Year controls for setting the date.  The right section of the toolbar displays the x,y coordinate of the mouse pointer when it is positioned over the preview page.  When you position the mouse cursor over a toolbar item for about 1 second, a yellow hint balloon will appear, describing the item’s function.  The Zoom-in and Zoom-out functions are represented by the magnifying glass buttons.  Each click adjusts the zoom level by 10%.  The Landscape button is used to toggle the paper position from portrait (upright) to landscape (sideways).  The Print Margin button will toggle the margin (represented by dashed gray lines) on and off.  This shows the printable area on the page for the current printer setting.  The Disable Preview button will toggle the preview section on and off.

File Menu

The File menu contains commands for opening and saving calendar (*.cc1) files.  These files are text files that contain a specially formatted script that tells Calendar Commander how to construct and print a specific calendar.  There are actually no calendars built into the program.  All calendars are produced from these script files that you can create yourself.  Fortunately, over a dozen calendars are included with the program so that most people will not have to worry about making their own.  Simply select File/Open from the menu and pick one of the daily, weekly, monthly, or yearly calendars already prepared for you.  After loading, check the Options page to see what changes (colors, titles, fonts, etc.) can be made on the fly and adjust the date setting on the toolbar if necessary.  Then click the Print button on the Printer page to print the current calendar.

Configure Menu

Use the Configure menu to make configuration changes to Calendar Commander.  Use the Language setting to determine what language the month and weekday names will be displayed on the calendars.  Your choices are English, French, German, Italian, and Spanish.  Use the “Week starts” setting to determine whether weeks start on a Sunday or a Monday.  Use the “Autoload last file” setting to have Calendar Commander automatically load the last calendar file used when the program is started.  The “TrueType as graphics” setting is necessary for some laser printers to be able to print white text on a dark background.  These first four settings on the Configure menu are saved in the Windows registry so they do not have to be reset each time the program is executed.  The Zoom, Orientation, Show margin, and Disable preview settings are the same functions available from the toolbar as described above.  The Events command displays the events editor as described in the next section.


Event Files

Event files are used to store holidays, anniversaries, birthdays, and other events commonly printed on calendars.  Several of the monthly calendars included with Calendar Commander have built in support for event files.  A Holiday.ev1 event file is included with the program that contains the commonly observed holidays in the U.S.  An empty Personal.ev1 event file is also included so that you can enter personal events and use it right away with the monthly calendars included.

Select “Events” from the Configure menu to display the event editor.  The event editor has its own File menu for opening and saving event files.  You can open the Holiday.ev1 event file included with the program to see how a typical event file is constructed.  It consists of a list of events with a month, day, offset, and event parameters.  The Month parameter is either one of the 12 months or is “All”, which means the event occurs every month.  The Day parameter can be one of several dozen choices including a “hard-coded” day like 4 (e.g. July 4th) or a day of the week sequence (e.g. 2nd Monday).  A special “Easter” day is included for specifying Easter and related holidays that are based on a complicated formula that takes into account the moon phases and other factors.  The Offset parameter allows you to add or subtract days from the date specified by the first two parameters.  For example, since Good Friday is always 2 days before Easter, you can set the Day parameter to “Easter” and set the Offset to -2 to create an event record for Good Friday.  The final parameter is the actual description of the event that will be displayed on the calendar.  This should be kept short so that it will fit in a typical day block on a calendar.

To add a new event to an event file, set the appropriate parameters and click the “+” button to add the event to the list.  The event is added below the current highlighted event.  To remove an event from the list, highlight it and click the “-” button.  To edit an existing event, click on it to load the parameters in the controls, make the adjustments and then click the check button to update the changes.  You can use the up arrow and down arrow button to move the order of events around in the list.

Use the “File/Save” or “File/Save as” command from the menu to save the changes to the event file.  Note that your events will only show up on calendars specifically designed to display events (using the LoadEvents, Event, and EventGrid script commands).


Printing Calendars

Use the Printers page to view or change the current printer settings, print the current calendar, or export the calendar to an image file.

Setup

Click the Setup button to display the standard printer setup dialog for Windows 95/NT.  Here you can change printers, paper sizes, and set other properties for your printer.

Print

Click the Print button to display Calendar Commander’s print dialog.  Set the print range to the number of consecutive pages you want to print starting with the current displayed page.  If you will be printing more than 1 page at a time, you then need to set the increment feature.  For example, if the current calendar is a monthly calendar and you want to print 12 consecutive months, you would set the print range to 12, and the increment to 1 month.  Adjust the number of copies feature as needed.  If you are printing multiple copies and a print range of more than one page, you can set the Collate option to force a complete set to be printed before the next copy is started.

Note that Calendar Commander is a graphically oriented printing program.  If you have a laser printer, you must have enough on-board RAM in the printer to handle a full page of graphics at high resolution.  Normally this about 1.5 mb for 300 dpi printers and 6 mb for 600 dpi printers.  If your printer returns out-of-memory errors, you might need to lower the print resolution through the Setup feature.  Note that memory issues are usually not a problem with inkjet printers.

Some laser printers will not print white text on a dark background as needed with some of the monthly calendars included unless the “Print TrueType as graphics” option is set in the printer setup dialog.  You can set the “TrueType as graphics” option on the Configure menu to force this setting to always be on and thus avoid having to adjust your printer setup each time you run the program.

Bitmap

You can also click the Bitmap button and export the current calendar to a bitmap image file in any of these formats: JPG, GIF, PNG, PCX, TIF, and BMP.  Note that JPG is a “lossy” format and may not be as well suited for saving vector-type graphics as the other formats.   The size of the image depends on the current zoom resolution and is displayed (width by height) on the title bar after the Bitmap button is clicked.  You might not be able to save a calendar at 100% zoom if the current printer resolution is too large.  An internal bitmap has to be created in memory before it can be saved to disk so you may get an out-of-resources error if the image is too large.  If this happens, zoom out to smaller level and try again.


Designing Calendars

Calendar Commander creates its calendars from script files.  When you load a *.cc1 calendar file with the File/Open command, the contents of the file is loaded into the script editor on the program’s Script page.  The upper listbox contains the script itself and the lower listbox contains a list of all available script commands.  The script is executed by the script interpreter and the resulting calendar is drawn on the preview section at the current zoom level.  The script is executed each time the preview section needs to be refreshed (e.g. after sizing the program window), when a change is made to a script, and when the user makes a change on the Options page.

Coordinate System

Creating a calendar involves the process of drawing lines, shapes and text on the page.  The page can be thought of as a canvas made up with a grid of dots, or pixels.  The number of dots on the printed page depends on the resolution capabilities of your printer and the number of pixels on your screen depends on the resolution of your monitor and your graphics card.

Fortunately, Calendar Commander uses a single percentage-based coordinate system that automatically works with all screen resolutions, printer resolutions, and paper sizes.  The upper left corner of the page is coordinate (0,0) and the bottom right corner is (100,100).  The first number represents the horizontal (x) distance from the left margin and the second number represents the vertical (y) distance from the top margin.  These rules always apply no matter what the paper size or orientation is.  You can see the coordinates for a particular point on the page by positioning the mouse cursor over it and viewing the x,y position on the toolbar.

A Grid.cc1 file is included with the program that displays the coordinate system.  Load it with File/Open and print a copy at both landscape and portrait orientations to use as a reference in designing new calendars.

The Canvas

The canvas has three basic properties that affect how items are drawn on it: the brush, the pen, and the font.  The brush determines the color and pattern for filled areas when rectangles and ellipses are drawn and the background when text is drawn.  The brush is initially set to “Clear” so that no filling is performed and text is drawn with a transparent background.  Use the Brush command to change the brush properties.  The pen determines the color, style and width when lines, arcs, and the borders of rectangles and ellipses are drawn.  The pen is initially set to solid black with a width of 1 pixel.  Use the Pen command to change the pen properties.  The font property determines the typeface, size, color, and style of text drawn on the canvas.  The font is initially set to the “System” typeface with a black color.  Use the Font command to change the font properties.

Variables

Calendar Commander has 32 built-in numeric variables named n00 through n31 and 16 text variables named t00 through t15.  The numeric variables are initialized to 0.0 and the text variables are initialized to an empty string before the script is executed.  Variables allow you to write flexible calendar scripts where the command parameters can be adjusted while the script is running.  A VarRef.cc1 file is included with the program.  Load it with File/Open and print a copy to track your variable usage when designing a new calendar.

Script Files

Script files are ASCII text files that contain a list of script commands in two sections.  The top section is the [OPTIONS] section.  It contains a list of controls that are placed on the Options page so that the user can make custom adjustments to a calendar without having to modify the actual script.  The bottom section is the [COMMANDS] section that contains the commands for drawing the calendar.  Commands are executed in the order they appear in the script.  A Block/EndBlock structure is provided for conditional execution and looping ability.  Select File/New from the menu to clear the script editor and start creating a new calendar.

To add a new command to the current script, first position the selection bar in the upper list box.  The new command will be added immediately below the selected line.  Then double click the desired command (or select one and click the “+” button) from the list of commands in the lower listbox, fill in the appropriate parameters on the command’s dialog box and click the Ok button.  Each command dialog box has a help button that explains the parameters for the particular command.  To delete a line from the script, select it and click the “-” button.  To edit a line in the script, double click it or select it and click the “check” button.  To move a command in the script, select it and click the up arrow or down arrow button.

Note that each time you make a script change, Calendar Commander attempts to execute the script in its present stage.  You can temporarily disable this feature by turning the preview mode off with the toolbar button or the “Disable preview” command on the Configure menu.

[OPTIONS] Section

Only three commands can go in the [OPTIONS] section of the script: Option, Orientation, and Remark.  The Orientation function allows you to specify the default page orientation (portrait or landscape) when the calendar is loaded with the File/Open command.  Of course, the user can override this setting with the toolbar or the Configure menu after the calendar is loaded.

The Option command allows you to place five types of controls on the Option page so that the user can make custom adjustments to your calendar.  The changes are automatically stored in the specified numeric and text variables.  You can place up to 32 controls on the Options page.  See the Option command for more information.

[COMMANDS] Section

All other commands beside “Option” and “Orientation” go in the [COMMANDS] section (Remarks can go in both sections).  Before attempting to design a new calendar from scratch, you should browse through the individual help sections for the commands to see what functions are available.  You can also examine the *.cc1 calendar scripts included with Calendar Commander to see how they are constructed.  The script files are text files so they can be loaded into NotePad and printed out if desired.


Arc

The Arc command draws an arc along the perimeter of the ellipse bounded by the specified rectangle using the current pen color, width, and style.  Coordinates x1,y1 and x2,y2 define the enclosing rectangle for the arc. The arc starts at the intersection of the ellipse edge and the line from the center of the ellipse to the specified starting point x3,y3. The arc is drawn counterclockwise until it reaches the position where the ellipse edge intersects the line from the center of the ellipse to the specified ending point x4,y4.


Block

The Block command is used to execute a block of instructions when a certain condition exists.  Set the “Type” parameter to “If” if you want to execute the block only once.  Set the “Type” parameter to “While” if you want to create a loop that executes the block as long as the condition returns true.  Use the EndBlock command to terminate the block.  All instructions in between the Block and EndBlock statements will be indented two spaces.  You can also embed one block inside another.

The test of whether the block should be executed is performed at the top of the block.  You can compare a numeric variable with a raw number or another numeric variable or you can compare a text variable with a raw text string or another text variable.  Set the first “Variable” parameter to one of the 32 numeric or 16 text variables.  Set the “Test” parameter to one of the six tests: equals (=), not equal (<>), greater than (>), less than (<), greater than or equal (>=), less than or equal (<=).  Type in a comparison value in the last parameter or pick a variable from the drop down list.

If you set the block type to “While”, the block will execute continuously as long as the test condition is true.  However, a built-in “infinite loop” detector is built in so that the block will automatically terminate after 1000 loops.  You may want to turn the calendar display off (toolbar button or Configure menu) while you are building a While block until you have completed the block with the EndBlock command.


Brush

The Brush command sets the fill color and style of all subsequent Ellipse, Rectangle, RoundRect commands and also affects the background of text placement.  You can type in a raw color number or pick a numeric variable for setting the brush color at run time.  You can also pick a color visually by clicking the Select button to bring up the color selection dialog.  Select one of the 16 standard colors from the Color box or adjust the blue, green, and red components (0-255) to create a custom color.  The color number is returned as a hex value (preceded with a “$”) representing the blue, green, and red components of the color.

Select one of the eight standard styles from the Style box or pick a numeric variable for selecting a style number at run time.  Use the “Clear” style when you want rectangles, ellipses, and text to be drawn in a transparent mode on the canvas.


DateNum

Use the DateNum function to retrieve the current date setting that is displayed (and can be changed by the user) on the toolbar.  Pick either “Day” (1-31), “Month” (1-12), or “Year” (1600-3999) and its current value at run time will be assigned to the numeric variable specified.  The Day/Month/Year settings are initialized to the computer’s system date when the program is first started.


DateText

Use the DateText function to convert a month number (1-12) or week day (1-7) number to a descriptive string in the language (English, French, German, Italian, Spanish) set in the Configure menu.

When the “Week starts” option is set to “on Sunday” in the Configure menu, week days 1 through 7 correspond to Sunday through Saturday.  When the option is set to “on Monday” (common in Europe), week days 1 through 7 correspond to Monday through Sunday.

Set the left-most “Variable” parameter to the text variable that will receive the string (January-December or Sunday-Monday).  Set the “Type” parameter to either “Month” or “Day of week”.  Set the “Length” parameter to either “Full” (e.g. January, Sunday) or “3-letter” (e.g. Jan, Sun) or “1-letter” (e.g. J, S).  Set the “Format” parameter to either “Capitalized” (e.g. January, Sunday) or “Lower case” (e.g. january, sunday) or “Upper case” (e.g. JANUARY, SUNDAY).  Finally, set the right-most “Variable” parameter to the numeric variable that will contain the month number (1-12) or day of week (1-7) at run time.

If you use the DateText function to get the month and weekday names (as opposed to hard-coding the names in your script), your calendar will automatically be compatible in the five languages mentioned above without any additional work on your part.


DateToJulian

The DateToJulian function will convert a date in three separate year, month, and day values into a single Julian day number.  Calendar Commander uses December 30, 1899 as Julian Day 0.  The Julian day increases by 1 for each day that has passed since (e.g. January 1, 1997 is Julian day 35431).  Julian days are negative for dates before December 30, 1899.

The raw Julian number is not important in itself.  You use it for date arithmetic so you do not have to worry about crossing month or year boundaries or calculate for leap years.  For example, if you need to know the date 100 days from now, you would use the DateToJulian function to convert the year, month, day to a Julian number.  You then add 100 to that number and convert it back to a date with the JulianToDate function.


Ellipse

The Ellipse command draws an ellipse bounded by the rectangular region starting at the x1,y1 coordinate and ending at the x2,y2 coordinate, using the current pen color, width, and style.  The Ellipse is also filled with the current brush.


Event

The Event function will get the event string (if any) for the specified month and day and assign it to the specified text variable.  Events are loaded from an event file with the LoadEvents command.  Event files can be created and edited from the Configure menu. Typical events are holidays, anniversaries, birthdays, meeting notices, etc.  A sample event file called Holiday.ev1 is included with Calendar Commander that contains most of the holidays commonly observed in the U.S.  An empty Personal.ev1 event file is included for you to add your own personal events to.


EventGrid

The EventGrid command allows you to draw a full month of events on a calendar grid with a single command.  It is similar to the NumGrid function, except it draws event strings instead of numbers.  Events are loaded from an event file with the LoadEvents command.  Event files can be created and edited from the Configure menu.  Typical events are holidays, anniversaries, birthdays, meeting notices, etc.

Set the x and y parameters to the upper left corner of the grid.  Set the dx and dy parameters to the horizontal and vertical distances between nodes.  For example, if the calendar has 7 columns and 6 rows, the dx value will be 1/7th of the total grid width and the dy value will be 1/6th of the total grid height.  Set the number of columns (usually 7 in a typical month calendar).  Set the 1st column value.  This is normally the column that contains the 1st day of the month (see the WeekDay function).  Set the 1st day value (normally 1).  Set the Last day value.  This is normally the last day of the month obtained with the LastDay function.  Set the text origin and month values.  The origin setting tells Calendar Commander which one of the 9 position points that the x,y point will represent.


Font

The Font command specifies the text font for all subsequent Text, NumGrid, and EventGrid commands.  All of your current screen fonts will be preloaded into the typeface selection box.  You can also specify a text variable for selecting the typeface at run time.

Set the height parameter to specify the font size.  This is not a “point” size, it is the height of the character cell measured in percent of the page height (0 to 100).

Select a font color by typing in a raw color number or picking a numeric variable for setting the color at run time.  You can also pick a color visually by clicking the Select button to bring up the color selection dialog.  Select one of the 16 standard colors from the Color box or adjust the blue, green, and red components (0-255) to create a custom color.  The color number is returned as a hex value (preceded with a “$”) representing the blue, green, and red components of the color.

Set any combination of styles: bold, italic, underline, and strikeout.  A value of 0 means the style if off, and 1 means the style is on.


Grid

Use the grid command to draw a grid of horizontal and vertical lines using the current pen color, width, and style.  The x1,y1 point represents the upper left corner of the grid and the x2,y2 point represents the lower right corner.  The number of horizontal and vertical cells to create are determined by the xc and yc parameters.  Set the Border to a value of 1 to draw an outside border on the grid (0 for no border).


Image

The Image command allows you to place a picture file (JPG, GIF, PNG, PCX, TIF, BMP) on your calendar.  Set the x,y parameters for the starting point.  Set the w (width) and h (height) parameters to specify the maximum dimensions on the page.  If you want to force the picture to be stretched to both the w and h dimensions, set the “Stretch to fit” value to 1.  If you want the picture to maintain its original aspect ratio, set the stretch value to 0.

The origin setting tells Calendar Commander which one of the 9 position points that the x,y point will represent.  For example, to center an image on the page, set the x,y point to 50,50 and set the origin to 4 (Center).  To place an image in the lower right corner of the page, set the x,y point to 100,100 and the origin to 8 (Bottom Right).

Place the file name in the image name parameter.  Click the browse button to find it on your disk drive.

If you are running your system in 256-color mode and you place more than one photographic image on a page, you will probably get a palette clash if there are too many distinct colors in the images.  The calendar should still print Ok, though.


JulianToDate

The JulianToDate function allows you to extract the year, month, day, or weekday from the specified Julian number to the specified numeric variable.  See the DateToJulian function for more information.


LastDay

The LastDay function returns the last day (28-31) of the specified month/year and assigns it to the specified numeric variable.  This function is commonly used with the NumGrid and EventGrid commands.


Line

The Line command draws a straight line starting at the x1,y1 coordinate and ending at the x2,y2 coordinate, using the current pen color, width, and style.


LoadEvents

The LoadEvents command will load an event file (*.ev1) into memory for the specified year for all subsequent Event and EventGrid commands.  Event files can be created and edited from the Configure menu.  Typical events are holidays, anniversaries, birthdays, meeting notices, etc.


NumGrid

The NumGrid command will draw a grid of numbers (typically for a monthly calendar) with a single command using the current font.  The numbers are drawn in rows left to right.

Set the x and y parameters to the upper left corner of the grid.  Set the dx and dy parameters to the horizontal and vertical distances between nodes.  For example, if the calendar has 7 columns and 6 rows, the dx value will be 1/7th of the total grid width and the dy value will be 1/6th of the total grid height.  Set the number of columns (usually 7 in a typical month calendar).  Set the 1st column value.  This is normally the column that contains the 1st day of the month (see the WeekDay function).  Set the 1st number value (normally 1).  Set the Last number value.  This is normally the last day of the month obtained with the LastDay function.  Set the text origin value.  The origin setting tells Calendar Commander which one of the 9 position points that the x,y point will represent.


NumVar

Use the NumVar function to set the value or perform a mathematical operation on a numeric variable.  Set the left parameter to the destination variable.  Set the operation to one these five functions: “set equal to”, “increment by”, “decrement by”, “multiply by” or “divide by”.  Set the right parameter to the source variable or type in a raw number.


Option

Use the Option command to place controls on the Options page so that the user can make custom changes to the calendar at run time without having to modify your script.  You can only use the Option command in the [OPTIONS] portion of the script file.  Controls are displayed on the Options page in the same order as they appear in the [OPTIONS] section.

The three numeric controls available are Color, Checkbox, and Number.  The two text controls are Typeface and Text.  The variable specified will be initialized to the control value each time the script is executed.  Numeric variables not specified are always initialized to 0 and text variables are initialized to empty strings.

Use the Label parameter to describe the control and Default parameter to give the control an initial value when the calendar file is opened.

Color: lets the user specify a color and assigns it to a numeric variable.  The user will see a color selection dialog and can pick one of the 16 standard colors or can tweak the blue/green/red controls to choose a custom color.  You can specify a default color in hex by using the format of “$BBGGRR”.

Checkbox: gives the user a yes/no choice.  Returns 1 if checked and 0 if not checked to a numeric variable.

Number: lets the user enter a raw number and assigns it to a numeric variable.

Typeface: lets the user pick from a list of available fonts installed on their system and returns the string to a text variable.

Text: lets the user enter a raw string and assigns it to a text variable.


Orientation

Use the Orientation option to specify the default page orientation (portrait or landscape) when the calendar file is opened.  This command must be placed in the [OPTIONS] section of the script file.


PageInfo

The PageInfo function returns information from the current printer driver and assigns it to the specified numeric variable.  The available information is:

x dpi: printer’s horizontal dots per inch

x margin: printer’s left margin in dots

x width: printer’s page width in dots

y dpi: printer’s vertical dots per inch

y margin: printer’s top margin in dots

y height: printer’s page height in dots

orientation: 0 for portrait, 1 for landscape


Pen

The Pen function sets the color, style, and width of all subsequent lines, grids, arcs and borders on ellipses, rectangles, and roundrects.  Select one of the 16 standard colors from the Color box or adjust the blue, green, and red components (0-255) to create a custom color.  Select one of 6 pen styles from the Style box.  The Width value specifies the line width in pixels.


Rectangle

The Rectangle command draws a rectangular box starting at the x1,y1 coordinate and ending at the x2,y2 coordinate, using the current pen color, width, and style and filled with the current brush.


Remark

Use the Remark command to place a comment in the script.  A “;” with be prepended to the remark, telling the script interpreter to skip that line.


RoundRect

The RoundRect command draws a rectangular box with rounded corners starting at the x1,y1 coordinate and ending at the x2,y2 coordinate, using the current pen color, width, and style and filled with the current brush.  The corner radius is specified by the x3,y3 values.


Text

Use the Text command to place text on the calendar starting at the x,y coordinate.  Use the Origin parameter to specify how the text is positioned in relation to the x,y point.  The text is drawn in the current font.  You can type in a string in the Text box or specify a variable.  If you specify a numeric variable, it will be rounded to the nearest integer (whole number) and then converted to text.


TextVar

Use the TextVar function to assign or append a string to a text variable.  The left parameter is the destination variable.  The right parameter is the source string.  It can be a raw string or a variable.  If you select a numeric variable as the source, it will be rounded to the nearest integer (whole number) and then converted to text.


WeekDay

Use the WeekDay function to get the day of the week (1-7) for the specified Year/Month/Day and assign it to a numeric variable.  If the “Week starts” setting on the Configure menu is “on Sunday” then 1 through 7 represents Sunday through Saturday.  If the setting is “on Monday” then 1 through 7 represents Monday through Sunday.

This function is useful with the NumGrid and EventGrid commands to get the starting column for a particular month.