It’s easy to create your first CalendarSet area.
The variable name will be used as a parameter for the CalendarSet commands.
Be careful to never have two CalendarSet objects with the same variable name on a 4D form.
We will have a quick overview of the Advanced Properties Dialog here; you’ll find a detailed explanation of it later in this manual.
You can use the commands and functions to configure every aspect of a CalendarSet area, and to get information about an area.
The commands and functions are grouped into themes: User Action, Configuration, Drag and Drop, etc.
All CalendarSet commands and functions need to be passed a reference to the area on which they will act. Since CalendarSet areas are initialised in the On Load phase of a form, the commands must be called during this phase or afterwards; if you try to call any CalendarSet commands before the form has been loaded, you’ll get an error message because 4D does not recognize the area reference.
If you do not issue any CalendarSet commands in the On Load phase, and you haven’t chosen any arrays in the Advanced Properties dialog, an empty calendar will be displayed in the CalendarSet area on the form.
You can modify the area by making calls to commands during any other phase or from objects, such as buttons and menus, on the form or in menu bars.
The commands can be used completely independently of the Advanced Properties dialog, or they can work in conjunction with the options you set therein.
For example, you might select the arrays to display in the Advanced Properties dialog and then use some commands to specify different coloring for each event according to some criteria that you specify.
Each command you write must adhere to a specific syntax in order for it to be correctly understood by CalendarSet. Some commands return a result: these are functions. You can use the commands and functions to configure every operation performed by CalendarSet, and to get various information.
Each CalendarSet command has a syntax, or rules, that describe how to use the command in your 4D database. For each command, the name of the command is followed by the command’s parameters, and result in case of functions.
A CalendarSet command syntax looks like this:
CS_GetAreaPtrProperty (area:L; property:T; pointer:Z) → result:L
The parameters are enclosed in parenthesis, and separated by semicolons.
Each parameter is followed by a colon and a letter indicating the type of data required for that parameter:
:L - longint
:O - blob
:P - picture
:R - real
:T - text
:Y - array
:Z - pointer
Each is preceded by one of three arrow signs, which indicate whether it is a value that you pass to the command or one that the command returns to you, or a value that is passed, then modified and returned by the command in the same parameter:
→ parameter – A value that you pass to the command
← parameter – A value that is returned by the command
Note: when calling a plugin command, all omitted parameters are initialized to the NULL of the respective types (0, 0.0, "", !00:00:00!, …).
The first parameter for most commands is the area reference, depending on the way the plugin area was created:
This parameter is a long integer, and is required to allow the commands to operate on the correct object.
Note: If an invalid area reference is passed to CalendarSet, the 4D debugger will open in trace (interpreted mode) or an alert is displayed (compiled mode).
CalendarSet version 5 is compatible with 4D version 15 and above, in both 32-bit and 64 modes.
To upgrade to CalendarSet version 5, simply install it as described in the Installation section of this manual, replacing your older version.
See the About CalendarSet v5 section.
CalendarSet provides an automated solution to register itself using an Internet connection.
This feature can be helpful whenever you don’t want to bother your end user with plugin registration, or want to save the time to collect the serial / machine ID, or any other reason when you want the process to be entirely and automatically managed from the client site.
CalendarSet v4 allows offscreen areas, which can be set, populated and printed or published on the Web (using CS_GetPicture) without being displayed.
CalendarSet supports Unicode for display.
CalendarSet version 4.0 supports 64 bit server on Windows and MacOS. This feature is only useful for registration or automatic purposes (no user interface), CalendarSet is not meant to be used on a server by a user. However, for example, printing CalendarSet areas will work on a 64 bit server.
Constants are available for most command parameter values, to help code legibility and maintenance.
Time is now supported in events.
An alternate “Windows” look popup date control is available on both platforms when the new design parameter to MM_SetOptions is set to 1:
In previous versions, CalendarSet used its own drag and drop manager. It now uses 4D’s drag and drop manager. Drop always occurs in the context of the destination process.
This means that you will need to make a few changes to your drag and drop handling. For more information, see CalendarSet Dragging Commands.
If a drag is initiated, CalendarSet receives a drag event. But this has nothing to do with the actual drop: it could end anywhere (e.g. if the user pressed Esc — no drop). 4D does not inform CalendarSet that the drag was not successful.
When a drop has occurred, an On Drop event is fired. You should therefore use the new CS_GetDrgSrcArea command to find out what was dropped.
CalendarSet can accept drags from non-CalendarSet objects such as AreaList Pro areas or other 4D objects (in the same process or a different one) and external sources (text selection or document). Furthermore, the drop from external sources can be allowed or disallowed.
It is now possible to drag and drop to banners.
CalendarSet uses CoreText on Mac and GDI+ on Windows.
Only fonts and font faces supported by these technologies can be used in CalendarSet. In particular, GDI+ does not support non-TrueType fonts on some Windows versions.
MM_SetOptions (area; popIndicator; useDoubleClick; design; colors)
TM_SetOptions (area; popIndicator; useDoubleClick)
Current day background is supported (CS_FontDefaults with selector 5, advanced properties).
For compatibility reasons, when the area background color is set (CS_SetCalColor), the current day background color is set to the same value. Set the current day background color after setting the area background color.
Unused days background can be set separately from the background color (third parameter to CS_SetCalColor).
The default value for the first day of week is taken from the system (use -1 to apply the system setting in your call to CS_Options).
The resource fork model is now completely obsolete. Therefore you must move the icons to be used into the picture library before calling CS_SetIconArray.
Banners are stacked from the bottom and can be partially visible below the events.
CalendarSet will automatically truncate data and display the standard ellipsis (…) if the banner width is too small to display the full text. The ellipsis is now displayed in the middle of the banner text instead of at the end.
If you are using any of the following commands, you will need to remove them from your code:
|Old Command||How to replace it|
|CS_DoResize||No longer exists, remove and use 4D options (“Grow”) or commands (OBJECT MOVE).|
|CS_DragMgrAvail||No longer relevant; always true.|
|CS_GetDrgArea||Obsolete, use CS_GetDrgSrcArea.|
|CS_SetSizeOpts||No longer exists, remove and use 4D options (“Grow”) or commands (OBJECT MOVE).|
|Util_SetDate||Deprecated, use 4D’s Add to date (!00/00/0000!;$years;$months;$days)|