![]() |
![]() |
||
![]() |
|||
| Version
www.capesoft.com |
|
||
![]()
|
|
||||||
| Object Docs |
Have you ever wanted to drop your date information onto a calendar? Leave, birthdays, order due dates, etc look so much more comprehensive on a calendar than in a list box. Or what about a scheduler\planner to view appointments or tasks, and edit them?
Enter HotDates. Add HotDates to your program and using the powerful and intuitive templates, you'll be able to view date related information in a calendar, drilling down to month, week and\or day views in a few minutes. Print your calendar straight to a printer, or edit date related information from the calendar using Drag and Drop, Cut\Copy\Paste or a traditional update.
Included in HotDates:
![]()
De-activate items in the legend (using the checkboxes in the list):
Change priority of items viewed (using the runtime priority buttons):



For this tutorial, we'll use the AutoLog.app that ships with Clarion 5.5. (I've included it in the clarionx\3rdparty\examples\HotDates\Tutorial for Clarion 6 users). I've included a completed tutorial in the examples. It's in the clarionx\3rdparty\examples\HotDates\Tutorial\Completed directory.
The colors and settings tables aid us in setting up the colors styles and
translation of day and month names for the application. You may not require both
of these in your application, but for now, let's add them in so you can see what
they are about.
1. Open the dictionary in the clarionx\3rdparty\examples\HotDates\Tutorial
directory.
2. From the File menu, select the Import Text option.
3. Using the filedialog window, find the HotDatesSettingsTables.txd file which
is located in your clarionx\3rdparty\libsrc directory by default.
4. Save and exit from the dictionary.
If your application is not open - then open it in the Clarion IDE.
1. From your Application menu, select the Template Utility...
item.
2. Select the ImportHotDatesDatePickerABC template utility from the
Select
Utility window
3. From your Application menu, select the Template Utility...
item.
4. Select the ImportHotDatesSettingsProceduresABC template utility from
the Select Utility window.
5. Open the frame and add a Setup menu to your menubar
6. Add a Colors item to your Setup menu, and call the BrowseHotDates_Colors
procedure from this item.
7. Add a Settings item to your Setup menu and call the BrowseHotDates_Settings
procedure from this item.
| 1. | You need to first add the Global Extension Template. To
do this: 1.1. Open the abcdemo.app in the Clarion IDE, and click on the Global button. 1.2. In the Global Properties window, click on the Extensions button. 1.3. Click on the Insert button and select the Activate_HotDates extension template. |
We do this after adding the DatePicker, so that the DatePicker procedure field in the Global Extension template (Options tab) is automatically populated.
A 1 to 12 month Calendar is a view that will show you very minimal detail - basically no descriptions, just colorized dates. It is aimed at giving you a broad spread of a wide date range of data into one summarized calendar - up to a year (which is scrollable).
| 1. | Open the Window Formatter for the BrowseTripLog window (Right-click on the procedure name in the tree and select the Window option) |
| 2. | Add a tab control to the sheet and call it 'Calendar'. |
| 3. | Move the list from the window to the By VIN Number tab (so that we have a clean tab to work with). |
| 4. | Resize the sheet (and window) to about 400 by 240 to fit the calendar nicely on it. |
| 5. | Select Populate - Control Template... from the menu. |
| 6. | Select the HotDates_Calendar template from the Control template list. |
| 7. | Click the top left corner for the group of controls to be
placed on the window. You will see 12 square list boxes (one for each month), the legend controls, and a group of buttons (ScrollBack, ScrollForward, Print and Refresh). |
| 8. | Right-Click on one of the controls and select the Actions menu item. |
| 9. | Click on the Tables button. |
| 10. | Insert the TripLog table, ordered by the TRI:VinDateKey and the Vehicles table. You'll also need to add the HotDates_Colors table to the Other tables. |
| 11. | Go to the General tab and set it up as follows: |
| 12. | Set the Start Date to 'date(1,1,year(today()))', check the Enable Scrolling checkbox and set the From Date to 'date(1,1,year(today()) - 10)' and the To Date to 'date(12,31,year(today()) + 1)'. |
| 13. | Go to the Data tab and set it up as follows: |
| 14. | You will need to create a local data field: Loc:BusinessOnly (a byte with a true value of 1 and a false of 0 that has a checkbox as a screen control). |
| 15. | The Filter field is: (TRI:BusinessTrip=1) or ~Loc:BusinessOnly (this is so we can restrict to BusinessTrips if we check the checkbox) |
| 16. | The Style field: band(pointer(Vehicles),255). There is no autonumber on this file (which is what you could normally use) - so we'll use the pointer instead. Note that there are only 255 styles available, so if we have more that 255 records in the file, then these will be doubled up (in style) |
| 17. | Go to the Styles tab and set it up as follows: |
| 18. | Note that we use the parent table for the styles file. |
| 19. | The StyleID for the legend matches the Style we set up on the DataBase (so that the Style in the legend corrolates to that set in the calendar) |
| 20. | The Description is indicative of the car that did the trips: 'clip(VEH:Make) & ' ' & clip(VEH:Model) & ' ' & clip(VEH:Year)' |
| 21. | Note that we use colors from the HotDates_Colors table which is in a different table to that actual style, so we'll need to put some handcode to get the correct color. |
| 22. | Go to the Filter Embed and enter the following code in the
'Before Adding Style to the palette' embed:
HDCOL:StyleID = band(pointer(Vehicles),255) |
| 23. | Go to the Options Tab |
| 24. | The procedure for the MonthViewer has not yet been created, so we'll create that after we're finished with this window. |
| 25. | Click OK to return to the Window Formatter. |
| 26. | Populate the Loc:BusinessOnly checkbox on the window. (Populate - Column and select Loc:BusinessOnly) |
| 27. | Double-click on the checkbox to bring up the embeds and
place a call to reset the window in the Accepted embed:
self.reset(1) |
| 1. | If you've exited out of the Window Formatter for the BrowseTripLog window, then re-open it again. |
| 2. | Select Populate - Control Template... from the menu. |
| 3. | Select the HotDates_CalendarUpdate template (for adding update controls to your 1 to 12 month Calendar) from the Control template list. |
| 4. | Click the top left corner for the group of controls to be placed on the window. You will see the Insert, Change and Delete buttons appear on the window. |
| 5. | Right-click on one of the buttons and select the Actions...option |
| 6. | Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window) |
| 7. | Basically what's happening here is that when you're inserting, you want the trip to start at the date clicked, and you want it to be attached to a selected variable (which is selected from the BrowseVehicles procedure). |
| 8. | Go to the Options tab and check the Add Update buttons to popup and the Allow inserts when a record exists on a date checkboxes (i.e. we want to be able to edit via popup and we also want to be able to insert a record on a particular day - even if there is already a trip allocated for another vehicle). |
Before continuing we need to add a Select control to the BrowseVehicles routine.
| 1. | If you've exited out of the Window Formatter for the BrowseTripLog window, then re-open it again. |
| 2. | Select Populate - Control Template... from the menu. |
| 3. | Select the BrowseSelectButton template from the Control template list. |
| 4. | Click the top left corner for the group of controls to be placed on the window. |
The MonthViewer is designed to show you a entire month's data - with more detail than the 1 to 12 month Calendar. This will give you a description attached to each colorization, and if more than one data exists for a specific date, then it will show you more than the highest priority data for that day.
| 1. | Double-Click on the MonthViewer (ToDo) procedure and select Window - Generic Window Handler from the Templateslist. |
| 2. | Enter the Procedure's prototype and parameters fields as the following:
(long pStartDate=0) |
| 3. | Open the Window formatter (use the Simple Window
template when prompted) and resize the window to: 385x220. You'll also need to make sure that this is an MDI Child window (the MDI Child checkbox on the Extra tab on the Window Properties window). |
| 4. | Select Populate - Control Template... from the menu. |
| 5. | Select the HotDates_MonthViewer template from the Control template list. |
| 6. | Click the top left corner for the group of controls to be
placed on the window. You will see 2 buttons in a Group and the legend controls. |
| 7. | Right-click on one of the controls and select the Actionsmenu item. |
| 8. | Click on the Tables button and setup the tables as follows (You'll also need to add the HotDates_Colors table to the Other tables):. |
| 9. | Enter 'pStartDate' into the Start At Date field. |
| 11. | Goto the Data tab and set it up as follows: |
| 12. | You will need to create a local data field: Loc:BusinessOnly (a byte with a true value of 1 and a false of 0 that has a checkbox as a screen control). |
| 13. | The Filter field is: (TRI:BusinessTrip=1) or ~Loc:BusinessOnly (this is so we can restrict to BusinessTrips if we check the checkbox) |
| 14. | The Style field: band(pointer(Vehicles),255). There is no autonumber on this file (which is what you could normally use) - so we'll use the pointer instead. Note that there are only 255 styles available, so if we have more that 255 records in the file, then these will be doubled up (in style) |
| 15. | Go to the Styles tab and set it up as follows: |
| 16. | Note that we use the parent table for the styles file. |
| 17. | The StyleID for the legend matches the Style we set up on the DataBase (so that the Style in the legend corrolates to that set in the MonthView) |
| 18. | The Description is indicative of the car that did the trips: 'clip(VEH:Make) & ' ' & clip(VEH:Model) & ' ' & clip(VEH:Year)' |
| 19. | Note that we use colors from the HotDates_Colors table which is in a different table to that actual style, so we'll need to put some handcode to get the correct color. |
| 20. | Go to the Filter Embed and enter the following code in the
'Before Adding Style to the palette' embed:
HDCOL:StyleID = band(pointer(Vehicles),255) |
| 22. | Go to the Options Tab and leave the default settings as they are. You can enter 'WeeklyPlanner' into the Drill down Procedure procedure. |
| 23. | Place the Loc:BusinessOnly checkbox control on your window (not inside the ?MonthViewGroup control) |
| 24. | Double-click on the Loc:BusinessOnly checkbox control and in
the accepted event embed, place a call to a forced window reset:
self.reset(1) |
| 1. | If you've exited out of the Window Formatter for the MonthViewer window, then re-open it again. |
| 2. | Select Populate - Control Template... from the menu. |
| 3. | Select the HotDates_MonthViewerUpdate template from the Control template list. |
| 4. | Click the top left corner for the group of controls to be placed on the window. You will see the Insert, Change and Delete buttons appear on the window. |
| 5. | Right-click on one of the buttons and select the Actions...option |
| 6. | Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window) |
| 7. | Basically what's happening here is that when you're inserting, you want the trip to start at the date clicked, and you want it to be attached to a selected variable. |
| 8. | Go to the Options tab and ensure the Add Update buttons to popup checkbox is checked (i.e. we want to be able to edit via popup). |
The Planner gives you a bit more scope to work with than the MonthView. The MonthView is a 2 dimensional - date and "activities", whereas the Planner is 3 dimensional - Date, "activities" and parent data. I guess the best would to show a pictoral example:
The left column contains the parent data (in this case the 'People'). Each of the Day columns to the right of that contains activities that pertain to that Person.
| 1. | Double-Click on the WeeklyPlanner (ToDo) procedure and select Window - Generic Window Handler from the Templates list. |
| 2. | Enter the Procedure's prototype and parameters fields as the following:
(long pStartDate=0) |
| 3. | Open the Window formatter (use the Simple Window
template when prompted) and resize the window to: 525x255. You'll also need to make sure that this is an MDI Child window (the MDI Child checkbox on the Extra tab on the Window Properties window). |
| 4. | Click the top left corner for the group of controls to be
placed on the window. You will see 2 buttons in a Group and the legend controls. |
| 5. | Delete the controls that you don't require. You must leave the ?Planner control. |
| 6. | Right-click on one of the controls and select the Actions menu item. |
| 7. | Click on the Tables button. |
| 8. | Insert the tables that will contain the data to populate in the ListBox. The Primary table is the table that contains the data for the left column. (Note that we don't need the HotDates_Colors table here as we'l be styling this calendar slightly differently) |
| 9. | On the General tab: |

| 10. | Go to the Data tab. |
| 11. | The Left Heading field contains the heading (a constant, vairable or expression) for the left-most column. |
| 12. | The Displayed Data field contains the data for the left most column. |
| 13. | Note the Style field - instead of colorizing the cells by vehicle, we now have the rows which identify each vehicle. We'll colorize these cells with a different detail - i.e. business or private (2 for business and 1 for private). |
| 14. | The Data to Display field will contain the field or expression to place the data in each item in the row. |
| 15. | Go to the Styles tab and set the settings there as follows (setup the styles with differing colors): |

| 16. | Go to the Options tab and set the settings there as follows: |

| 17. | Save and quit out Window Formatter. |
| 18. | Open the Embeds - and find the Local Objects | Abc Objects |
WindowManager | Init | CODE | ParentCall and enter the following source
immediately after the Parent Call:
if pStartDate then Loc:StartDate = pStartDate . This will set the StartDate to the date that we've passed to the window on startup. |
| 1. | If you've exited out of the Window Formatter for the WeeklyPlanner window, then re-open it again. |
| 2. | Select Populate - Control Template... from the menu. |
| 3. | Select the HotDates_PlannerUpdatetemplate from the Control template list. |
| 4. | Click the top left corner for the group of controls to be placed on the window. You will see the Insert, Change and Delete buttons appear on the window. |
| 5. | Right-click on one of the buttons and select the Actions... option |
| 6. | Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window) |
| 7. | Basically what's happening here is that when you're inserting, you want the trip to start at the date clicked, and you want it to be attached to the Vehicle for that row. |
| 8. | Go to the Options tab and ensure the Add Update buttons to popup checkbox is checked (i.e. we want to be able to edit via popup). |
The DayScheduler will help us view the activities for each vehicle for the day.
There are two places in the tutorial application where we need to add the DatePicker Lookup HotKey extension : UpdateVehicles and UpdateTripLog.
| 1. | Double-Click on the DayScheduler (ToDo) procedure and select Window - Generic Window Handler from the Templates list. |
| 2. | Enter the Procedure's prototype and parameters fields as the following:
(long pStartDate=0) |
| 3. | Open the Window formatter (use the Simple Window
template when prompted) and resize the window to: 465x300. You'll also need to make sure that this is an MDI Child window (the MDI Child checkbox on the Extra tab on the Window Properties window). |
| 4. | Click the top left corner for the group of controls to be
placed on the window. You will see 2 buttons in a Group and the legend controls. |
| 5. | Right-click on one of the controls and select the Actions menu item. |
| 6. | Click on the Tables button. |
| 8. | Insert the tables that will contain the data to populate in the ListBox. The Primary table is the table that contains the data for the left column. (Note that we don't need the HotDates_Colors table here as we'l be styling this calendar slightly differently) |
| 9. | On the General tab, set the Display date to pStartDate. |
| 10. | Go to the Headers tab and set the following settings (besides the defaults): |

| We've filtered out the vehicles that have a sold date (so the filter is VEH:DateSold=0), as we're only interested in current vehicles. Each vehicle will have it's own column showing the day's scheduled activity. The Displayed data shows the contents of the column heading (in this case clip(VEH:Make) & ' ' & clip(VEH:Model). |
| 11. | Go to the Data tab and set the following settings: |

| We have an additional Time Limiting group - because in this HotDates view, we can view time detail. This is similar to the Date Stored as settings. |
| 12. | Go to the Styles tab and set the following settings: |

| 1. | If you've exited out of the Window Formatter for the DayScheduler window, then re-open it again. |
| 2. | Select Populate - Control Template... from the menu. |
| 3. | Select the HotDates_SchedulerUpdatetemplate from the Control template list. |
| 4. | Click the top left corner for the group of controls to be placed on the window. You will see the Insert, Change and Delete buttons appear on the window. |
| 5. | Right-click on one of the buttons and select the Actions... option |
| 6. | Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window) |
| Basically what's happening here is that when you're inserting, you want the trip to start and end at the time block selected, and you want it to be attached to the Vehicle for that column. In this case we've checked the End time is at the end of the last block which means that the time selected is inclusive. | |
| 7. | Go to the Options tab and ensure the Add Update buttons to popup checkbox is checked (i.e. we want to be able to edit via popup). |
| 1. | Go back to the application IDE tree window, and double click on the UpdateVehicles procedure and click the Extensions button. |
| 2. | Select the HotDates_DatePickerHotKeyLookup template from the Extension template list. |
Repeat these 2 steps for the UpdateTripLog window.
Another addition - you can add the DayScheduler to the options in the Main window, and then post an accepted event at startup to open the DayScheduler automatically.
The Global
Extension template and Adding a DatePicker window to your application
Adding a 1 to 12 Month Calendar to your application
Adding Update buttons to your Calendar/View
Adding a MonthViewer to your application
The Weekly Planner Control Template
Adding a Day Scheduler to your application
Ways
to use the DatePicker effectively (the
Lookup button, and
the window HotKey)
If you would like to use the HotDates_Colors table in your application for styling, then check this out in the Useful Tips section.
| 1. |
The
first thing you need to do is add the DatePicker procedure (in a Multi-DLL
application, this would be your root or data-DLL) - actually, you don't
have to do this, but you'd lose a bunch of functionality by NOT doing this:
1. If your application is not open - then open it in the Clarion IDE. Check out the FAQs on using your own DatePicker if you'd like this option rather. |
| 2. | Then you need to add the Global Extension Template. To do this: 1. Open your app in the Clarion IDE, and click on the Globalbutton. 2. In the Global Properties window, click on the Extensions button. 3. Click on the Insert button and select the Activate_HotDates extension template. The following prompts are available on the Options tab of the Global Extension template:
1.1. Setting a global
Refresh
Event means that when performing operations between two calendar
windows (like Drag and Drop or Cut/Copy/Paste), the originating window can
be refreshed on a successful operation completed on the recipient window.
You need to set this event to a unique event in the user event range
(0400H-0FFFH). The default is 082EH.
3. If you'd like to customize your Planner and Scheduler zoom settings,
then you can check the Customize Zoom Settings checkbox and the
Zoom settings groups will appear (otherwise the default will be used), allowing you to set:
4.1. You can select a first weekday (by default Sunday) using the
First
Weekday drop down. This will force the left most day of all the
calendars to the day you specify.
Setup the necessary information (required for HotDates to use the Colours
settings table in your application) on the Colors Table tab if
you're using the HotDates Colours table. |
| 1.1. | Open the Window Formatter for the window that you are wanting to add the Calendar to. |
| 1.2. | Select Populate - Control Template... from the menu. |
| 1.3. | Select the HotDates_Calendar template from the Control template list. |
| 1.4. | Click the top left corner for the group of controls to be placed on the window. You will see 12 square list boxes (one for each month), the legend controls, and a group of buttons (ScrollBack, ScrollForward, Print and Refresh). |
| 1.5. | Delete the controls that you don't require. These could include some of the month list boxes (if you don't require a full 12 month calendar) starting from the bottom right and proceeding left, the legend priority buttons (two buttons one with the SortUp and the other with the SortDown icons), the ScrollBack & ScrollForward buttons. You must leave the ?CalendarGroup and at least one list control. |
| 1.6. | Right-Click on one of the controls and select the Actions menu item. |
| 2.1. | Click on the Tables button. |
| 2.2. | Insert the files that will contain the data to populate on the Browse. If there is more than one table required to extricate the data, then use the one with the StartDate as the Primary file. This will also be the file which gets primed for update when we add the update buttons later. If you are using the HotDates_Colors table for your style-colors, then you need to add the HotDates_Colors table to your Other Tables. |
| 2.3. | You can also enter an optimum key to sort the table by. This should be a unique key (to obtain the correct record for updating). |
| 2.4. | On the General tab: |

| 2.5. | The StartDate field sets the month and year of the top-left month in the calendar when the window is opened. Leave it blank for today. Tip: You can enter date(1,1,year(today())) to show the whole of this year starting at January. |
| 2.6. | If you want to be able to scroll (i.e. back date or forward
date), then check the Enable Scrolling checkbox. Otherwise the
calendar will be fixed. 1. Set the From Date to the date to which you can scroll _back_ to. (leave blank for January last year) 2. Set the To Date to the date to which you can scroll _forward_ to.(leave blank for December next year) 3. Set the number of months to scroll by in the Scroll by (months) entry (normally 1 - although you may want to jump by up to an entire year - in which case you would enter 12). |
| 2.7. | The Print group contains options that pertain to the
calendar when outputting to a printer: 1. Heading: (oddly enough) the heading that appears at the top of the report. |
| 3.1. | Goto the Data tab. |
| 3.2. | Select the method by which the Data is stored (either a single date, a Date Range [i.e. FromDate-ToDate], a Date Duration or handcoded). |
| 3.3. | You'll need to enter a from date, an end date (for Date Ranges) and/or a date duration (for DateDuration) expression depending on the method that you selected in the 'Stored As' drop down. |
| 3.4. | If you're using a ToDate (end date) option, and your end dates may be blank, then you'll need to check the ToDate optional (infinite when 0). Otherwise the EndDate will be assumed to be correct at 0. |
| 3.5. | If you have multiple records for days, and you would like to use totalling to reflect a sum, count, average, maximum or minimum of the values for those days, then you can check the Style based on totalling checkbox. |
| 3.6. | If you checked Style based on totalling checkbox,
then pick a Total Type from the drop combo. Count will count
the records that pertain to each calendar day; Sum will add the
Total Field/expr for each record that pertains to a day;
Maximum will
reflect the maximum to the Total Field/expr for each record that
pertains to a day; Minimum does the inverse, and Average reflects the mean
of the Total Field/expr for all records for each day.
Note: The result (for each day) will be stored in DatesQueue:<x>.Total (where x is the ActiveTemplateInstance for this control template addition). You can use this value in your Style expression. |
| 3.7. | The Style entry needs to contain a field or expression for the style of the data on the view. Check out the Useful Tips on more possible uses. This Style ID is a numeric that references to the Style ID in the styles (or legends) setup on the Styles tab. |
| 3.8. | You can enter an expression to filter unwanted data in the Filter field. |
| 3.9. | To code a more indepth filter, you can use the Embeds, accessible via the Filter Embed button. For more details, check out the useful tips section on Coding Manual Filters |
| 4.1. | Go to the Styles tab. |
| 4.2. | This tab is used to setup the details for the legend controls. You can have up to 5 columns in the legend control (in case you want it horizontally, rather than vertically) |
| 4.3. | If you want to be able to optionally view styles at runtime, then check the Use Checkboxes to activate styles checkbox. Otherwise all styles will be displayed. |
| 4.4. | To keep your style settings (style priority and active state) between sessions, you can check the Save and Restore checkbox. |
| 4.5. | If your styles are stored in a style file, then you can check the Load Styles from a File checkbox. Otherwise you can set them up in the Manual Styles list box. |
| 4.6. | If the colours that you will use for the styles are in the Global HotDates Colours table, then check the Use Colors tablecheckbox. |
| 4.7. | If your styles will be loaded from a file (and not the
Global HotDates Colours table), then you need to
enter the Styles details. The File, Key, StyleID to use, Colors and
Description (which is the text in the style entry in the legend list
describing the style). The StyleID must be a byte value (between 1 and
255) - which will be used as a reference to the Style field on the Data
tab. You don't have to have a relationship between the table used for the
styles and the table for the data - although a Style reference in the data
should exist in the Styles table.
If you check the Sort styles in Key order checkbox, then when the items initially appear in the listbox, they will appear sorted in the order of the key specified in the Key field - otherwise they will be sorted in StyleID order. |
| 4.8. | Similarly with Manual styles, you can set the above settings from the template. |
| 5.1. | Go to the Options Tab |

| 5.2. | If you don't want the year to be shown in the month header, then check the Year portion of date is irrelevant checkbox. This is useful for yearless calendars (like Birthday calendars, etc). |
| 5.3. | You can Enable Drill Down and enter a drill down procedure in the
Drill down procedure
drop list. This will enable a day/week/month to be expanded. If your drill
down procedure takes more than one parameter, then you can handcode the
call to the drill down using the Handcode Drill down call embed
button. You need to pass the clickdate property so that the receiving
procedure will display the correct start date. Example:
ViewMonth(ThisYear5.clickdate) |
| 5.4. | The Cell Tips section lets you set up cell tip information. You can leave this blank to omit cell tips. The field provided is a formula in which you can use fields from files in your HotDates tables. If you require the use of other fields (from tables that are not in the HotDates tables) - then you can use the Coded Lookups button to handcode into the embed. |
| 5.5. | If you have Replicate added to this application, then you will be able to Turn Replicate off during calendar loading. This is very useful if your HotDates view has a lot of data, and the calendar takes a long time to load. Please read the Clarion5.5 caveat in the FAQs. |
| 5.6. | Go to the Classes tab and set the Based on Class to YearClass and the Object Name to something unique and descriptive like ThisYear1. |
| 1.1. | Open the Window Formatter for the Calendar/View window. |
| 1.2. | Select Populate - Control Template... from the menu. |
| 1.3. | Select the HotDates_CalendarUpdate template (for adding update controls to your 1 to 12 month Calendar), HotDates_MonthViewerUpdate template (for adding update controls to your MonthViewer) or HotDates_PlannerUpdate template (for adding update controls to your Planner) from the Control template list. |
| 1.4. | Click the top left corner for the group of controls to be placed on the window. You will see the Insert, Change and Delete buttons appear on the window. |
| 2.1. | Right-click on one of the buttons and select the Actions...option |
| 4.2. | If you want to edit view Right-Click and popup, then check the Add Update buttons to popup checkbox. |
| 4.3. | Your Legend is by default not refreshed after a table update (from the calendar). However, in some cases your Legend may have changed when your tables were updated, so you may like to check the Refresh Legend list after Update checkbox in order to refresh the legend list on the screen. Otherwise the legend will remain the same as before a table edit. |
| 4.4. | You may like to allow Inserts even if there is already a record on a date. In this case check the Allow inserts when a record exists on a date checkbox. Otherwise you will not be able to insert a record if the date is styled. |
| 4.5. | If you would like to support drag and drop on this calendar, then enter a Unique Drag ID (which should match your other calendars that you want to drag from and drop to). The Drag and Drop ID is populated with a default, but you can change this to a unique one if you'd like to. |
| 4.6. | If you are supporting Cut|Copy|Paste, then it's a good idea to use the Unique Drag ID for the Paste ID - in order to prevent mismatched pasting from the clipboard. |
| 4.7. | If you are supporting Cut|Copy|Paste and\or Drag and Drop, then you'll need to handcode a validation routine to avoid duplication occuring (Useful Tip: 11. Validating Paste and Dropped data entries). |
| 4.8. | Go to the Classes tab |
| 4.9. | Go to the Classes tab and set the Based on Class to PopupClass and the Popup Object Name to something unique and descriptive like ThisPopup1. |
| 1.1. | Open the Window Formatter for the window that you are wanting to add the Month Viewer to. |
| 1.2. | Select Populate - Control Template... from the menu. |
| 1.3. | Select the HotDates_MonthViewer template from the Control template list. |
| 1.4. | Click the top left corner for the group of controls to be
placed on the window. You will see 2 buttons in a Group and the legend controls. |
| 1.5. | Delete the controls that you don't require. You must leave the ?MonthViewGroup. |
| 1.6. | Right-click on one of the controls and select the Actions menu item. |
| 1.7. | Click on the Tables button. |
| 1.8. | Insert the files that will contain the data to populate on the Browse. If there is more than one table required to extricate the data, then use the one with the StartDate as the Primary file. This will also be the file which gets primed for update when we add the update buttons later. If you are using the HotDates_Colors table for your style-colors, then you need to add the HotDates_Colors table to your Other Tables. |
| 1.9. | You can also enter an optimum key to sort the table by. This should be a unique key (to obtain the correct record for updating). |
| 2.0. | Go to the Data tab. |
| 2.1. | Select the method by which the Data is stored (either a single date, a Date Range [i.e. FromDate-ToDate], a Date Duration or handcoded). |
| 2.2. | You'll need to enter a from date, an end date (for Date Ranges) and/or a date duration (for DateDuration) expression depending on the method that you selected in the 'Stored As' drop down. |
| 2.3. | If you're using a ToDate (end date) option, and your end dates may be blank, then you'll need to check the ToDate optional (infinite when 0). Otherwise the EndDate will be assumed to be correct at 0. |
| 2.4. | The Style entry needs to contain a field or expression for the style of the data on the view. Check out the Useful Tips on more possible uses. This Style ID is a numeric that references to the Style ID in the styles (or legends) setup on the Styles tab. |
| 2.5. | You can enter an expression to filter unwanted data in the Filter field. |
| 2.6. | To code a more indepth filter, you can use the Embeds, accessible via the Filter Embed button. For more details, check out the useful tips section on Coding Manual Filters |
| 2.7. | The Data to Display field will contain the field or expression to place the data in each item in the daylist in the month. |
| 2.8. | The ID of the Icon to display is used to tell HotDates which icon to place at the items entry in the daylist. This is probably initially disabled - and will be enabled after you've set the Icons up in the Icons tab. Similarly to the Style field, you can place a formula to obtain the correct icon ID. |
| 3.0. | Go to the Styles tab. Check out the Calendar Control template for help in setting up styles. |
| 4.0. | Go to the Icons Tab |
![]()
| 5.1. | The Date indicator is a numbered string that floats ontop of the date data box. You can set the Color, the proportional size (in relation to the ListBox), and the position (Vertical and Horizontal Orientation). The Today's Date Color field allows you to use a different color to highlight today's date on the calendar. You can leave this blank if you don't want Today's date to be highlighted. |
| 5.2. | The Heading in the Print group is the heading that will appear at the top of the MonthView printout. (Check FAQ 6.1. for more detail on how to print out the MonthView) |
| 5.3. | If the Year portion of date is irrelevant (i.e. this displays data like birthdays or anniversaries where data must not be filtered out where the year does not match the current year) then check this checkbox. |
| 5.4. | You can Enable Drill Down and enter a drill down procedure in the
Drill down procedure
drop list. This will enable a day/week/month to be expanded. If your drill
down procedure takes more than one parameter, then you can handcode the
call to the drill down using the Handcode Drill down call embed
button. You need to pass the clickdate property so that the receiving
procedure will display the correct start date. Example:
ViewMonth(ThisYear5.clickdate) |
| 5.5. | The Drill Up follows the same principles as Drill Down (immediately above). |
| 5.6. | The Cell Tips section lets you set up cell tip information. You can leave this blank to omit cell tips. The field provided is a formula in which you can use fields from files in your HotDates tables. If you require the use of other fields (from tables that are not in the HotDates tables) - then you can use the Coded Lookups button to handcode into the embed. |
| 5.7. | If you have Replicate added to this application, then you will be able to Turn Replicate off during calendar loading. This is very useful if your HotDates view has a lot of data, and the calendar takes a long time to load. Please read the Clarion5.5 caveat in the FAQs. |
| 6.0. | Go to the Classes tab and set the Based on Class to MonthListClass and the Object Name to something unique and descriptive like ThisMonth1. |
Check out the Adding Update buttons to your Calendar/View to add update buttons to your Month View.
The WeeklyPlanner gives you a bit more scope to work with than the MonthView. The MonthView is a 2 dimensional - date and "activities", whereas the Weekly Planner is 3 dimensional - Date, "activities" and parent data. I guess the best would to show a pictoral example:
The left column contains the parent data (in this case the 'People'). Each of the Day columns to the right of that contains activities that pertain to that Person.
Your WeeklyPlanner procedure must be prototyped with at least a StartDate if you're using the Drill down/up functionality in HotDates:
WeeklyPlanner procedure (long pStartDate=0)| 1.1. | Open the Window Formatter for the window that you are wanting to add the WeeklyPlanner to. |
| 1.2. | Select Populate - Control Template... from the menu. |
| 1.3. | Select the HotDates_Planner template from the Control template list. |
| 1.4. | Click the top left corner for the group of controls to be
placed on the window. You will see 2 buttons in a Group and the legend controls. |
| 1.5. | Delete the controls that you don't require. You must leave the ?Planner control. |
| 1.6. | Right-click on one of the controls and select the Actions menu item. |
| 1.7. | Click on the Tables button. |
| 1.8. | Insert the tables that will contain the data to populate on the Browse. You should make the Primary table the table that contains the data for the left column. You can attach a keyed order to the Primary table in order to sort the data. The table that contains the daily details data should be added to this tree as well. If you are using the HotDates_Colors table for your style-colors, then you need to add the HotDates_Colors table to your Other Tables. |
| 2.1. | On the General tab: |

| 3.2. | The Date Picture for Column Headers is the format in which the date must be displayed in the column heading (from column 2 onwards) |
| 3.3. | The Use American Date for abbreviated dates checkbox is used to format the date into American date order when an abbreviated date must be used in the column header because of space limitations. |
| 3.4. | Select the method by which the Data is stored (either a single date, a Date Range [i.e. FromDate-ToDate], a Date Duration or handcoded). |
| 3.5. | You'll need to enter a from date, an end date (for Date Ranges) and/or a date duration (for DateDuration) expression depending on the method that you selected in the 'Stored As' drop down. |
| 3.6. | If you're using a ToDate (end date) option, and your end dates may be blank, then you'll need to check the ToDate optional (infinite when 0). Otherwise the EndDate will be assumed to be correct at 0. |
| 3.7. | The Style entry needs to contain a field or expression for the style of the data on the view. Check out the Useful Tips on more possible uses. This Style ID is a numeric that references to the Style ID in the styles (or legends) setup on the Styles tab. |
| 3.8. | You can enter an expression to filter unwanted data in the Filter field. |
| 3.9. | The Data to Display field will contain the field or expression to place the data in each item in the row. |
| 3.10. | The ID of the Icon to display is used to tell HotDates which icon to place at the items entry in the row. This is probably initially disabled - and will be enabled after you've set the Icons up in the Icons tab. Similarly to the Style field, you can place a formula to obtain the correct icon ID. |
| 3.11. | The default Heading Justification drop down can be used to select an alternative justification for the column headers. Force to Left, Center, Right - or use the default. |
| 4.1. | Go to the Queue tab. |

| 4.2. | You can sort the child data cells (in the rows) in 3 possible orders - by the order that is in the Legend, in the DisplayData order (which is simply sorted by string), or in a customizable order (Other). |
| 4.3. | If you selected Other in the Row Data Ordered by drop
down list, then you can enter a manual sort order in the embed provided.
Your primary sort fields, must always be those used in the left column,
and then in specific child fields. For example:
sort(DatesQueue:1,DatesQueue:1.PEO:PeopleID,DatesQueue:1.TAS:TaskTime) |
| 4.4. | If you are coding a manual filter (for populating data from the template generated queue to the planner queue) - then you need to add the fields to the template queue that you will use in the filter. These will be the file fields, but in the coded filter, you must use their queue field equivalents. |
| 4.5. | To code a more indepth filter, you can use the Embeds, accessible via the Filter Embed button. For more details, check out the useful tips section on Coding Manual Filters |
| 5.1 | Go to the Styles tab. Check out the Calendar Control template for help in setting up styles. |
| 6.1. | Go to the Icons Tab. |
![]()
| 6.2. | If you are not going to use Icons, then leave the Use Icons unchecked and move straight on to the Classes tab (below). Otherwise check the UseIcons checkbox. |
| 6.3. | You can either select the Top Detail Cell Only or All Detail Cells to display icons on. The first option will only place one icon (on the top detail dell) per parent row per day. Otherwise all day detail cells can be iconed. |
| 6.4. | Select whether you want the Icons to be Transparent or Normal Square icons (in the daylists) |
| 6.5. | If your Icons are stored in a table, then check this checkbox, otherwise leave it unchecked and manually enter the icon files and their respective IDs in the list box on this tab. |
| 6.6. | If your Icons are stored in a table, then enter the Icon Table name, the Key to access the table, the Icon Number field, and the Icon File field that contains the File for the icon. |
| 7.1. | You can Enable Drill Down and enter a drill down procedure in the
Drill down procedure
drop list. This will enable a day/week/month to be expanded. If your drill
down procedure takes more than one parameter, then you can handcode the
call to the drill down using the Handcode Drill down call embed
button. You need to pass the clickdate property so that the receiving
procedure will display the correct start date. Example:
ViewMonth(ThisYear5.clickdate) |
| 7.2. | The Drill Up follows the same principles as Drill Down (immediately above). |
| 7.3. | If you want to use Greenbarring to make your planner more legible, then check the Use Greenbar checkbox and enter an appropriate RGB color value (or variable name) into the Greenbar color field provided. |
| 7.4. | If you would like to alter the height of the lines (or rows) in the planner, then you can stipulate a Set row height to value or variable. |
| 7.5. | If you would like to customize the grid color of the planner control, then you can do that here by entering an RGB color value (or variable name) into the Set grid color to field. |
| 7.6. | If you have Replicate added to this application, then you will be able to Turn Replicate off during calendar loading. This is very useful if your HotDates view has a lot of data, and the calendar takes a long time to load. Please read the Clarion5.5 caveat in the FAQs. |
| 7.7. | The Cell Tips section lets you set up cell tip information. You can leave this blank to omit cell tips. The field provided is a formula in which you can use fields from files in your HotDates tables. If you require the use of other fields (from tables that are not in the HotDates tables) - then you can use the Coded Lookups button to handcode into the embed. |
| 8.1. | Go to the Classes tab and set the Based on Class to PlannerClass and the Object Name to something unique and descriptive like ThisPlanner1. |
Check out the Adding Update buttons to your Calendar/View to add update buttons to your Planner.
The Scheduler gives you a bit more detail to work with than the MonthView or Planner template. The Day scheduler breaks the day down into hours and shows you in diary form the details for the day. I guess the best would to show a pictorial example:
In the scheduler template, the data is arranged vertically. In this case, we're viewing a single day's info. Each person is arranged along the column headers and the Time is in the left most column data.
| 1.1. | Open the Window Formatter for the window that you are wanting to add the WeeklyPlanner to. |
| 1.2. | Select Populate - Control Template... from the menu. |
| 1.3. | Select the HotDates_Scheduler template from the Control template list. |
| 1.4. | Click the top left corner for the group of controls to be
placed on the window. You will see: 1. The legend controls (a list box on the right and 2 buttons below with an up arrow on the one and a down arrow on the other). 2. The SchedulerList control (which will display the data we're wanting to see). 3. 2 buttons, a region and a string control above the SchedulerList that will be used to set and show the date of the data that we're viewing. 4. A set of 4 buttons and a spin control that can be used to adjust the amount of rows displayed, and the time value of each row. |
| 1.5. | Delete the controls that you don't require. You must leave the ?SchedulerList control. |
| 1.6. | Right-click on one of the controls and select the Actions menu item. |
| 1.7. | Click on the Tables button. |
| 1.8. | Insert the tables that will contain the data to populate on the Browse. You should make the Primary table the table that contains the data for the Column headings. You can attach a keyed order to the Primary table in order to sort the data. The table that contains the daily details data should be added to this tree as well. If you are using the HotDates_Colors table for your style-colors, then you need to add the HotDates_Colors table to your Other Tables. |
| 2.0. | On the General tab: |

| 2.1. | The Display date indicates the date that will initially be displayed in the scheduler. You can pass a parameter to the window and use that as the initial date. |
| 3.0. | Go to the Headers tab. |


| 4.1. | Select the method by which the Data is stored (either a single date, a Date Range [i.e. FromDate-ToDate], a Date Duration or handcoded) using the Stored as drop list. This pertains to the data in the entire Scheduler list. |
| 4.2. | You'll need to enter a FromDate, a ToDate (for Date Ranges) and/or a Date Duration (for DateDuration) expression depending on the method that you selected in the 'Stored As' drop down. |
| 4.3. | If you're using a ToDate (end date) option, and your end dates may be blank, then you'll need to check the ToDate optional (infinite when 0). Otherwise the EndDate will be assumed to be correct at 0. |
| 4.4. | The Style entry needs to contain a field or expression for the style of the data on the view. Check out the Useful Tips on more possible uses. This Style ID is a numeric that references to the Style ID in the styles (or legends) setup on the Styles tab. |
| 4.5. | You can enter an expression to filter unwanted data in the Filter field. |
| 4.6. | The Data to Display field will contain the field or expression to place the data in each item in the row. |
| 4.7. | The ID of the Icon to display is used to tell HotDates which icon to place at the items entry in the row. This is probably initially disabled - and will be enabled after you've set the Icons up in the Icons tab. Similarly to the Style field, you can place a formula to obtain the correct icon ID. |
| 4.8. | If you would like to add a column that totals the number of active (or styled) cells in each row, then check the Add a Totalling (Counter) column checkbox. |
| 4.9. | The default Heading Justification drop down can be used to select an alternative justification for the column headers. Force to Left, Center, Right - or use the default. |
| 4.10. | For the data in each cell, we use the Time Limiting group. The data can either be Stored as TimeDuration, FromTime-ToTime or handcoded. |
| 4.11. | You'll need to enter a FromTime and a ToTime (For FromTime-ToTime data) or a Duration (for TimeDuration data) |
| 4.12. | You can use the Filter embed to handcode a filter to filter out data that must not be displayed in a specific cell. |
| 5.0. | Go to the Styles tab. Check out the Calendar Control template for help in setting up styles. |
| 6.0. | Go to the Icons tab. Check out the MonthViewer Control template for help in setting up icons. |
| 7.0. | You can Enable Drill Up and enter a drill up procedure in the
Drill up procedure
drop list. This will enable a day/week/month to be expanded. If your drill
up procedure takes more than one parameter, then you can handcode the call
to the drill down using the Handcode Drill up call embed button.
You need to pass the clickdate property so that the receiving procedure
will display the correct start date. Example:
ViewMonth(ThisYear5.clickdate) |
| 7.1. | The Cell Tips section lets you set up cell tip information. You can leave this blank to omit cell tips. The field provided is a formula in which you can use fields from files in your HotDates tables. If you require the use of other fields (from tables that are not in the HotDates tables) - then you can use the Coded Lookups button to handcode into the embed. |
| 7.2. | If you have Replicate added to this application, then you will be able to Turn Replicate off during calendar loading. This is very useful if your HotDates view has a lot of data, and the calendar takes a long time to load. Please read the Clarion5.5 caveat in the FAQs. |
| 7.3. | Check out the Planner template for the adornment group details. |
| 8.0. | Go to the Classes tab and set the Based on Class to SchedulerClass and the Object Name to something unique and descriptive like ThisScheduler1. |
There are many times you may want to quickly enter a date, which is where a DatePicker can come in extremely useful. We've included 2 templates to help you do this - you can either select using a lookup button next to the field requiring the date, or you can use a HotKey (like CtrlD) to populate a Date enter an entry field that has the focus.
You need to add one button per entry field that requires the use of a DatePicker.
| 1. | Open the Window Formatter for the window that you are wanting to add the DatePicker lookup button to. |
| 2. | Select Populate - Control Template... from the menu. |
| 3. | Select the HotDates_DatePickerLookup template from the Control template list. |
| 4. | Click the top left location for where you want to place the lookup button on the window. |
| 5. | Right-click on one of the controls and select the Actions menu item. |
| 6. | The Date Field must contain the field that will receive the date returned from the DatePicker procedure |
| 7. | The Date Picker Header Text contains the text (either as a constant in quotes or a variable name) that must be displayed at the top of the DatePicker. |
| 8. | The if 0 Prime with: is self-explanitory. It's an expression - so you can use variables or formulae (like today()) |
You need to add one extension per window that requires the use of the HotKey. You can set the HotKey in the Global Extension template.
| 1. | Open the Extension and Control Templates window for the window that you are wanting to add the DatePicker HotKey lookup extension to. |
| 2. | Click the Insert button. |
| 3. | Select the HotDates_DatePickerLookup template from the Control template list. |
| 4. | Go to the Options tab. |
| 5. | The Default Date Picture must contain a default picture for the date picker to return (can be overridden per field). |
| 6. | The Date Picker Header Text contains the text (either as a constant in quotes or a variable name) that must be displayed at the top of the DatePicker. |
Each entry and spin box control on the window, is listed in the Date Picker controls list. To change an item's properties, double-click on the item.
| 7. | Check the Enable the DatePicker for this field checkbox if you want to allow the HotKey to operate when this field is selected (Otherwise the HotKey will have no effect). |
| 8. | The if 0 Prime with: is self-explanitory. It's an expression - so you can use variables or formulae (like today()) |
| 9. | The Date Picture must contain a default picture for the date picker to return (can be overridden per field). |
This template is really useful for date limited browses. Populating this control template will add the Date entry and lookup button as well as some special date incrementing and decrementing ability (setup in the Global Extension template) - while automatically refreshing the browse for you.
Open your Window Formatter of your browse and add the control template to your window.
If you right-click on one of the controls and select the Actions tab, then you can setup some of the options of the control template:
| 1. | The Refresh Browses checkbox (if checked) will force browses to be refreshed when the date changes. You need to place the limit in the filter of each browse though. |
| 2. | The Default Date is the date that is initialised when the window is opened. |
| 3. | The Date Picker Header Text is the text that is passed to the DatePicker when the DatePicker hotkey or Lookup button is activated. |
| 4. | The Date range limiting fields are useful to limit the range of the selection of dates - both using the incrementor/decrementor hotkeys, and in the DatePicker window. |
Tip: You can use two fields for limiting your browse to a range of dates - one for high limiting and one for low limiting (obviously you'll need to create the second variable for the second field - as HotDates will only create one variable). For the high limiter (in the above template options), you can enter a Date range limiting minimum of the initial variable (HotDates_DateLocator), and for the low limiter, you can enter a Date range limiting maximum of the other (new) variable (e.g. HotDates_DateHiLocator).
Don't forget to add the filter in your browse template prompts so that the list will only show data in the date range specified in the locator fields.
Style field formula examples
Coding Manual Filters
Tricks in linking records for Updating
Refreshing the calendar
Implementing Translation
Making Printouts
Overriding
Global Settings (like DatePickerHotKey and FirstDayofWeek) on the fly
Drag and drop across windows
Cut/Copy/Paste across
different windows
Creating
a Style file (for themes and across-the-app colorization)
Validating Paste and Dropped data entries
Using the DateEntry
Locator control template
Using the HotDatesSettingsTable
(to store multiple sets of Translation and other global settings)
The Style field entry in the control templates (on the Data tab) is an expression that must result in a byte (1 - 255). The result of which should be in the legend (which is setup on the Styles tab) and should match one of the StyleIDs. Sometimes you can have a field in a datafile to indicate the Style that should be used to display the data on the calendar. But it's probably more likely to be a formula.
Example 1:
You may want to show orders that were shipped late in Red and those on time or early in green. In this case you can Create the following in the Style field:
choose(ORD:Shipped>ORD:ExpectedShipDate,1,2)
Your Style tab would be set up as follows:

Example 2:
You could create a Function to return the correct Style value in which case your Style field entry in your Control Template would look something like:
CompareDates(ORD:Shipped,ORD:ExpectedShipDate) + 2
The procedure returns -1 for an early shipment, 0 for ontime or 1 for a late shipment:
CompareDates
procedure (Long pFirstDate,long pSecondDate)
code
return(choose(pFirstDate=pSecondDate,0,1) *
choose(pFirstDate>pSecondDate,-1,1))
Your Style tab would be set up as follows:

One of the cases where you would want to code a manual filter, is if you have a StartDate and EndDate that indicates a period start point and end point. For example: in a diary, you may have a 3rd term (school entry) which starts on 14 July and ends on 12 September. You would want to mark the weekdays, but skip the weekends, even though the weekend dates are valid dates in the range. What HotDates will do (unless you put a filter in) is cycle from 14 July to 12 September and mark each day with the style associated with school.
For the
1 to 12 month calendar:
You have 3 inbuilt template variable dates to work with (if you're using the FromDate-ToDate or Date Duration template settings):
StartDate - the date at the
beginning of the range (eg. 14 July)
EndDate - the date at the end of the range (eg. 12 September)
WorkingDate - that is the date worked with
So if we want to skip the weekends:
if ~inrange(WorkingDate % 7,1,5) and (TAS:Type = WeekDaysOnly) then cycle .
You need to put this code in the following embed (which you can get to easily via the Filter Embed button on the Data tab of the YearCalendar control template) :
For the
MonthViewer:
You have a single variable which to use. The month viewer uses a fixed range to cycle from (1st day to last day of the month), unlike the Year calendar. But you can use the following date in the filter:
WorkingDate - that is the date worked with
You can put the same formula for the MonthViewer as the 1 to 12 month calendar in the following embed (which you can get to easily via the Filter Embed button on the Data tab of the Month Viewer control template):
For the
Planner:
You have a single variable which to use. The month viewer uses a fixed range to cycle from (1st day to last day of the month), unlike the Year calendar.
WorkingDate - that is the date worked with
The big difference in the planner is that you're working with data from the queue as apposed to working from data loaded directly from a file. And so you will need to code it as follows:
if ~inrange(WorkingDate % 7,1,5) and (DatesQueue:1.TAS:Type = WeekDaysOnly) then cycle .
DatesQueue:1 is the label of the queue in the planner control template, and you need to have added the TAS:Type variable to the list in order to have this as a variable you can use in the manual filter.
You can add this code to the following embed (which you can get to easily via the Filter Embed button on the Data tab of the Planner control template):
For the
Scheduler:
You have a single variable which to use. The Day Scheduler uses a single day (at this stage). But you can use the following date in the filter:
self.FirstDate - that is the date worked with
You can put the same formula for the MonthViewer as the 1 to 12 month calendar in the following embed (which you can get to easily via the Filter Embed button on the Data tab of the Month Viewer control template):
Sometimes it can be a bit difficult to ensure that HotDates gets the correct record for the user to update when they click on the change button (or the insert if you are using the Planner template).
Tip 1:
Ensure that the file you are updating has a unique key - and preferably a primary key. The fewer fields in the key, the better. HotDates will first use the Primary key, or if no Primary key, then a unique key. If neither key is available, then you will be prompted for one in the template. If you cannot have a unique key, then create a key with as many fields in it - so that it can be as unique as possible.
Tip 2:
In your table structure (for your HotDates Year Calendar and Month Viewer NOT your Planner and/or Scheduler), enter the table that you want to edit as the primary table (this is probably the table that contains the dates for the range in any event).
Tip 3 (in the planner template):
The problem:
When the insert option is picked, the record needs to be related to both a row and a column. In other words, it needs to be linked to the Salesman (in the above case Bruce Johnson) and the date (Thu 4/3). HotDates does the date bit for you, it's the linking back to the salesman which can be a bit tricky.
In the above case, the sales table is a child of the parent (Salesman), and so it's a one step process linking the new child to the parent, but in many cases this will be a bit more complicated.
To help you, I've added some spare linking fields into the planner list which you can use to get the correct row co-ordinate.
Firstly, you need to populate the link fields with their correct values, which you can do in the following embed point (must be between the Setup the Left Column Data and the Adding to the Column data Queue embed points):
Example code:
self.plan.link3 = DAS:MyLinkField
self.plan.link4 = DAS:MyLinkField2
Secondly, you need to use these fields to load the correct record before updating:
Example code:
DAS:MyLinkField = self.plan.link3
DAS:MylinkField2 = self.plan.link3
access:MyLinkTable.fetch(MyLinkFieldKey)
Tip 3 (in the Scheduler template):
Similarly to the planner template, you'll find that you want to prime a parent record of a cell - particularly when inserting into a cell that does not yet contain data. For non-SQL applications you can use the following steps to get the record of the parent (i.e. the column record) used to populate the header data:
In your Local Embeds (on that procedure) - find the Local Objects | Capesoft Objects | ThisScheduler | Update (Long p_d),long | CODE | Get record from the <filelabel> embed point. You need to put your code to retrieve the header file record immediately after this embed point:
get(<MyHeaderdataFile>,self.ColumnHeaderID[self.clickcolumn])
!This is a pointer to the file, so you can't use this for SQL tables.
if ~errorcode()
!Do priming here.
end
If you are wanting to have a runtime filter (like the calendar is linked to a parent browse, and displays information related to the record that is selected in the browse) that requires the calendar to be refreshed, then at the appropriate code place, you can enter the following:
ThisWindow.reset(1)
or if your application is in legacy:
MyCalendarObject.reset(1)
So in the above scenario, you would trap the NewSelection event - set the necessary variables to what they should be (i.e. those ones that are used in the Filter for the calendar as set up in the Date tab of the HotDates control template) and then reset the window.
The easiest way to do this is to use the HotDatesSettingsTable that comes included in HotDates. Otherwise do the following:
While translation is not in the scope of HotDates - we've made it easy for you to use another translation mechanism to translate some of the HotDates text (like day and month names).
You can quite easily set translation on the fly as well - in case your program supports multiple languages. Basically, wherever you would normally translate your text you can place the following code to accomplish translation in the HotDates windows (e.g. into Afrikaans):
HotDatesGlobalSettings.SetGlobalSetting('Sunday','Sondag')
HotDatesGlobalSettings.SetGlobalSetting('Monday','Maandag')
HotDatesGlobalSettings.SetGlobalSetting('Tuesday','Dinsdag')
HotDatesGlobalSettings.SetGlobalSetting('Wednesday','Woensdag')
HotDatesGlobalSettings.SetGlobalSetting('Thursday','Donderdag')
HotDatesGlobalSettings.SetGlobalSetting('Friday','Vrydag')
HotDatesGlobalSettings.SetGlobalSetting('Saturday','Saterdag')
HotDatesGlobalSettings.SetGlobalSetting('January','Januarie')
HotDatesGlobalSettings.SetGlobalSetting('February','Februarie')
HotDatesGlobalSettings.SetGlobalSetting('March','Maart')
HotDatesGlobalSettings.SetGlobalSetting('April','April')
HotDatesGlobalSettings.SetGlobalSetting('May','Mei')
HotDatesGlobalSettings.SetGlobalSetting('June','Junie')
HotDatesGlobalSettings.SetGlobalSetting('July','Julie')
HotDatesGlobalSettings.SetGlobalSetting('August','Augustus')
HotDatesGlobalSettings.SetGlobalSetting('October','Oktober')
HotDatesGlobalSettings.SetGlobalSetting('December','Desember')
You will notice that in the above example code September and November are omitted. This is because these two months are the same in the two languages, so there is no need to 'Translate' them.
If you are not using a Translation engine, then the best place to put the above code is in the Program Setup global embed of your EXE application.
There's another method which you need to use to translate miscellaneous text:
In your Global Embeds (on the DataDLL if this is a Multi-DLL application): you can access the Translation Embed point (after the parent call):

and place your translation text in for the respective text:
case pStringToTranslate
of 'Insert'
return 'Ny'
of 'Change'
..
of 'Delete'
..
of 'No Valid Tip'
..
of 'Quick Edit'
..
of 'Cut'
..
of 'Copy'
..
of 'Paste'
..
of 'Print'
..
of 'Drill Down'
..
of 'Drill Up'
..
end
This is built in for the YearCalendar and the MonthViewer (check FAQ 6.1. on how to do this). To print out the DayScheduler and\or the WeeklyPlanner you can use SendTo ( www.capesoft.com\accessories\sendtosp.htm). Complete the necessary steps laid out in the SendTo documentation to add the SendTo control (for List boxes) for your DayScheduler (or Weekly Planner). Enter the following for the Planner:
and for the DayScheduler:
where ThisScheduler1 and ThisPlan1 are the names of the DayScheduler and WeeklyPlanner objects.
The easiest way to do this is to use the HotDatesSettingsTable that comes included in HotDates. Otherwise do the following:
You can set the DatePickerHotKey and FirstDayOfWeek in the HotDates global extension template (if this is a Multi-DLL app, then in your data DLL) - but you may like to allow the user to change these options on the fly. To do this you can do the following:
HotDatesGlobalSettings.SetGlobalSetting('FirstDayOfWeek',UserSetting)
HotDatesGlobalSettings.SetGlobalSetting('DatePickerHotKey',UserSetting)
You'll need to save and restore the setting between sessions. You will need to restore after the template has set the default (this is done in the construct method, so you can put code into the ProgramSetup to accomplish this).
You can easily add Drag and drop support to you calendars so that entries can be dragged across the windows. You need to ensure that the same drag ID is assigned to both windows, and that the update tables are the same. The graphic below shows the setup of a typical DragID which can be copied across to your other calendar templates. This options tab appears in your Calendar Update control template.
In order to make sure that your drop is valid you need to check out 11. Validating Paste and Dropped data entries
If you created your application using HotDates v1.34 or older, then you need to delete your UpdateCalendar control template and add it back in again in order to make use of this functionality. Before deleting, make sure you take a couple of snapshots of the template settings so that you can set these up as they were. Calendars created with v1.35 or later will automatically have this functionality built in. If you don't want to support Cut/Copy/Paste, then you can simply delete the controls (without deleting the control template of course <g>).
In order to make sure that your paste is valid you need to check out 11. Validating Paste and Dropped data entries
For an example of this functionality, check out the MonthViewer procedure in the clarionx\3rdparty\examples\HotDates\abc\abcdemo.app
Creating the Color table: You can import the HotDates_Colors and HotDates_Settings table from the TXD in the clarionx\3rdparty\libsrc directory that ships with HotDates.
Editing the Color table: Once adding this to your dictionary, you can open your application and run the ImportHotDatesSettingsProcedures template utility (ABC only at this stage) to import the necessary procedures into your application. A Color Setup browse with an update form for adding and changing colors will be added to your application (as well as a browse and form pair to set runtime options like Day and month name translation and First Day of week - but you can delete these procedures if you don't require them).
Implementing Styles using the Color table: In our example app, we've setup the following Style attribute which the data will use:
band(pointer(Vehicles),255)
This means that if there are more than 255 vehicles, the style is just cycled 'round. In the Legend setup (on the Styles tab) - we do a lookup in the Colors table to get the colors to use for the text, and use use these variables for the Styles in the Legend. The ABC lookup is simply as follows:
COL:StyleID = band(pointer(Vehicles),255)
access:Colours.fetch(COL:ByStyleID)
This code is inserted into the 'Before adding Styles to the palette' embed point (accessed from the Filter Embed button on the Styles tab).
Using Themes: You could expand this concept to use a Theme table as well. Your theme table could be a parent of the Colors table - where multiple sets of colors could be selected from depending on the user's preference (e.g. Rain Forest - 253 colors of deep greens and browns, Palm beach - soft yellows, blue, etc).
To make this a SQL file:
You need to create a general ValidatePaste procedure for all your calendars (or each calendar set if you have calendars displaying different data in your application) - unless you are only using the YearCalendar with the Allow inserts when a record exists on a date checkbox is unchecked (which will do internal checking for you). Otherwise you need to call your procedure in the ValidPaste derived method in each of your calendars as follows:
For the Planner, MonthViewer and Calendar (you can use the Validate Drop|Paste code embed in the HotDatesUpdate template to get to the right place) (Red is your code):
ThisPlan1.ValidPaste PROCEDURE ()
ReturnValue long
CODE
ReturnValue = PARENT.ValidPaste ()
if ReturnValue = 1 !If the
class already found this as invalid (i.e. returned 0), then don't worry.
return CheckValidPaste()
!You
could warn the user here the first time he does it so that he is aware that he
is trying to paste into an invalid time slot.
end
Return ReturnValue
For the Scheduler (Red is your code):
case self.CheckInRange(TRI:EndDate,TRI:EndTime,self.clickcolumn-1)
!The ClickDate and ClickTime is
used for the Start Date and Time, so there's no parameters for these - only for
the EndDate and time.
of 0 !Cool
Return 1
of 1 !Invalid - already data on that date
Return 0
of -1 !Out of range
for class to check
return CheckValidPaste()
ReturnValue = PARENT.ValidPaste ()
end
Your procedure should like something like this (which is taken from the example) - it takes no parameters (as the record must already be loaded) - and returns a 0 (invalid) if a duplicate exists, or a 1 if it's fine to paste:
ReturnValue = 1
!Presume no possible overlap
SAVED:TRI:Record = TRI:Record
SAVED:TRI:AutoVIN = TRI:AutoVIN
SAVED:TRI:BeginDate = TRI:BeginDate
SAVED:TRI:EndDate = TRI:EndDate
SAVED:TRI:BeginTime = TRI:BeginTime
SAVED:TRI:EndTime = TRI:EndTime
Loc:Ptr = pointer(TripLog)
!The
values have already changed, so save the pointer
set(TRI:VinDateKey,TRI:VinDateKey)
loop until access:TripLog.next()
if TRI:AutoVIN <> SAVED:TRI:AutoVIN then break .
if pointer(TripLog) = Loc:Ptr then cycle.
!Don't compare the record we're working with
if TRI:BeginDate > SAVED:TRI:EndDate then break .
if (TRI:BeginDate = SAVED:TRI:EndDate) and (TRI:BeginTime > SAVED:TRI:EndTime) then break .
ReturnValue = 0 !Overlapping time for the same vehicle
end
TRI:Record = SAVED:TRI:Record
set(TRI:VinDateKey,TRI:VinDateKey)
loop until access:TripLog.previous()
if TRI:AutoVIN <> SAVED:TRI:AutoVIN then break .
if pointer(TripLog) = Loc:Ptr then cycle.
!Don't compare the record we're working with
if SAVED:TRI:BeginDate > TRI:EndDate then break .
if (SAVED:TRI:BeginDate = TRI:EndDate) and (SAVED:TRI:BeginTime > TRI:EndTime) then break .
ReturnValue = 0 !Overlapping time for the same vehicle
end
get(TripLog,Loc:Ptr) !We
have to use get in order to get the precise record.
TRI:Record = SAVED:TRI:Record
return ReturnValue
The HotDates settings table that comes in the box, provides a mechanism for setting some global settings as defaults. There’s a browse and a form that makes it easy for you to get a starting point of using and editing these settings.
Contained in this file are:
1. Translation settings (weekday and month names)
2. First day of the week.
You can add a record for each language/setting that you want to support and ship the file with your application.
Steps to add this functionality into your application:
For Multi-DLL applications, do steps 2 and 3 in your EXE application, and 4, 5 and 6 in your Data DLL application.
In order to display public holidays, you need to do 2 things (in the Year Calendar):
1. Add the public holiday style to the legend.
2. Add the public holidays to the calendar data.
There are 3 examples that ship with HotDates - you can find them in your clarionx\3rdparty\examples\HotDates folder. There is one each for ABC and legacy, as well as a completed tutorial. These examples demonstrate the use of the HotDates control templates in a real life application.
Compile and Trappable Runtime Errors associated with HotDates
DatePicker Queries
1.1.
My DatePicker returns today's date if I click the cancel button.
1.2. I want to use my own DatePicker - how do I do this?
1.3. My DatePicker flickers a lot when it opens.
General Data\Template Queries
2.1. Not all my
data is being shown on the Calendar
2.2. I
only want the change button to be active on the window.
2.3. My data is not
refreshed after editing
2.4.
I want to double-click to drill down\up. How do I do this?
2.5.
My calendar is opening on today's date, and not on the selected\passed date.
2.6.
What is the potential danger in turning Replicate off during calendar loading?
2.7. My
Cut/Copy/Paste does not work between my calendars.
2.8. How do I validate a paste\drop to eliminate invalid dropping\Pasting?
2.9. Can I use
prop:filter on my HotDates views?
2.10.
The TIP string is not displaying the whole TIP that I am setting it to. Why is
this?
2.11.
My styles (in my legend) are all black - what am I doing wrong?
2.12. I want to retrieve the legend record when the user
clicks on it (to display more information).
2.13. I need to put some code in on a successful record
update (insert, change or delete). Where must I put this code?
2.14. My calendar takes a long time to refresh - how do I
optimize the time taken for the calendar to load?
2.15. How do I distinguish between a drop,
copy and paste action?
2.16. I wonder to perform a function when
the user clicks on a cell. Where's the best place to do this?
2.17. My HotDateSettings aren't being restored at app0 startup.
2.18. How do I reset my calendar to a specific date on the
fly?
Year Calendar (1-12month) template queries
3.1. I am
not getting any data displayed in my calendar.
3.2. How do I display today's date in the
calendar?
3.3. How do I scroll to a particular date?
3.4. I want to control the resizing of the legend and button
controls. How do I do this?
Day Scheduler template queries
4.1. My update
is not selecting the correct record.
4.2. I
would like to add a total column. How do I do this?
4.3. How do I sort the order of the columns?
4.4. When the number of records (used for the column headers)
changes, the number of columns does not increase.
4.5. I want a AllDayEvent field (so that I don't need to stipulate
time for certain events). How do I implement this?
4.6. How do I display info pertaining to the clicked record on
the window?
4.7. The time block finishes at 12:00 - but
does not show the 12:00-12:30 time block included in the display range.
4.8. Only 50bytes of my data is displayed
in each cell. How do I increase this?
4.9. The names of the months are not translated in the
DayScheduler.
4.10 How do I get the record of the cell that I click on?
Planner Template queries
5.1.
How do I sort my child (or row data) into a better order?
5.2.
My window takes a long time to load. Can I make it quicker?
5.3.
I cannot get more than about 150 cells per row - is there a limit?
5.4.
Is
that possible for me to fix the date’s header width in a planner?
5.5. How can I restrict the header to only display one row (of
date header details)?
MonthViewer template queries
6.1. How do I print out my
calendar?
6.2. How do I make my
dates more prominent?
6.3. How do I get the table record of the item in the Queue
that I've clicked on?
6.4. How do I make the font smaller when
printing out the calendar?
1.1.
My DatePicker returns today's date if I click the cancel button.
Answer 1: (If you're calling the DatePicker using a lookup button) There's a setting in the control template that is calling the DatePicker (i.e. on your window) - which defaults to today(). You can blank this out, so that no initial date will be passed to the DatePicker. Go to the procedure, and select extensions, highlight the HotDates - DatePicker lookup button and clear the if 0 prime with field.
Answer 2: (If you're calling the DatePicker using a HotKey) There's a setting in the extension template that is calling the DatePicker (i.e. on your window) - which defaults to today() for each control. You can blank this out, so that no initial date will be passed to the DatePicker. Go to the procedure, and select extensions, highlight the HotDates - DatePicker HotKey lookup. Select the Options tab and double-click on the field that you want to leave unprimed. Clear the if 0 prime with field.
1.2.
I want to use my own DatePicker - how do I do this?
Answer: If you're really sure that you don't want to use our fancy state-of-the-art DatePicker then read on, otherwise you can quickly reverse that thought process now and decide that you're really much better off using the HotDates one after all<g>.
OK - so you really are sure then.......
Multi-DLL applications: The best place is to put your DatePicker procedure is in the DataDLL. Leave the other applications setup as normal for using a normal HotDates DatePicker in the DataDLL.
SingleEXEs and Multi-DLL applications: Replace the HotDates DatePicker procedure with a source coded call to your DatePicker (which will enable you to receive the parameters that HotDates is passing and pass them on in the correct format/order to your DatePicker) containing the following:
DatePicker PROCEDURE (long pStartDate=0,<string pHeader>,long pMinDate=0,long pMaxDate=0)
code
return MyDatePicker(Parameters Required)
pStartDate is the initial date to highlight and display.
pHeader is the header of the DatePicker window.
pMinDate is the minimum date that the DatePicker can go back to.
pMaxDate is the maximum date that the DatePicker will scroll forward to
This is assuming that your DatePicker returns a selected date. (HotDates expects 0 for a cancelled date pick - different DatePickers may handle cancelled selection in a different manner).
1.3. My DatePicker flickers a lot when it opens.
Answer: There's a problem in one of the ABC methods. For a workaround:
1. Open your ABTOOLBA.clw file in a text editor.
2. Search for ToolbarUpdateClass.DisplayButtons PROCEDURE
3. Go to the last line of the procedure:
DISPLAY(Toolbar:First,Toolbar:Last)
and comment it out (probably line 240 of ABTOOLBA.clw):
!DISPLAY(Toolbar:First,Toolbar:Last)
4. Save and exit.
2.1.
I am not getting any data displayed in my calendar.
Answer: You've probably got a manual filter in your calendar. Check that this is setup correctly. Also you must cycle (if the filter does not meet the necessary criteria) not break.
2.2.
I only want the change button to be active on the window.
Answer: If you will never want your users to add or delete data from the HotDates template, then you can simply delete the Insert and Delete buttons. If you still want to allow users under some circumstances to Insert\Delete, then you can derive the CanInsert and the CanDelete methods and conditionally enable these buttons. For example (in your Local Objects | CapeSoft Objects | ThisPlan1 | CanDelete | CODE after the parentcall embed) :
if
MyFunctionToCheckIfInsertIsLegal() and ReturnValue
return(1)
else
return(0)
end
Note: In some circumstances the CanInsert method is returned before the ParentCall (template generated). In this case you need to make sure that you do your function check and return before the 'Always allow inserts' template generated code.
2.3.
My legend data is not refreshed after editing.
Answer: In this instance it is very likely that your legend data requires refreshing. If you have used the same table in the calendar and the legend, then this is often the case. In your HotDates_CalendarUpdate control template, on the Options tab, check the Refresh Legend list after Update checkbox.
If you have other local variables on the window that need to be refreshed after the update window is called, you can call this from the derived <HotDatesObject>.reset method (either before or after the parent call).
2.4.
I want to double-click to drill down\up. How do I do this?
Answer: You cannot do this if you're using the UpdateCalendar control as double-click will select the ChangeControl, but if you're not using the UpdateCalendar control, then you can add the following code in after the parent call to the ThisHotDatesObjectname.TakeAlerted method:
if self.FieldIsDateControl()
case keycode()
of MouseLeft2
post(event:accepted,?DrillDown)
setkeycode(0)
end
end
2.5.
My calendar is opening on today's date, and not on the selected\passed date.
Answer: You calendar must have it's initial date set to the procedure's startdate parameter (as passed from the calling procedure). This is set in the HotDates control template (the From Date\Start Date\Display Date on the General tab).
2.6.
What is the potential danger in Turning Replicate off during calendar loading?
Answer: Checking this option is fine in Clarion6, as the FileManager classes are properly threaded - and so disabling Replicate on this thread, will not affect Replication on other threads (i.e. if, during the loading of the calendar, another thread is writing to the datafiles, these changes will be logged as per normal). However, in Clarion5.5 the FileManager class is unthreaded, and so turning off Replicate will turn it off for the entire application (while the calendar is loading). If you have other procedures writing to your datafiles, then these changes will not be logged. If your application is an SDI application or only consists of one thread\window, then you can use this option with no problems.
2.7.
My Cut/Copy/Paste does not work between my calendars.
Answer: If you have a different table selected to update - or a different key is selected to update the table with, then HotDates will not be able to use the information passed from the one procedure to the other one to locate the correct record to perform the Cut/Copy/Paste. Check the setup of your Calendar_Update templates to rectify.
2.8. How do I validate a paste\drop to eliminate invalid dropping\Pasting?
Answer: 11. Validating Paste and Dropped data entries
2.9.
Can I use prop:filter on my HotDates views?
Answer: Yes you can. There is an embed point, which you can access from the 'Filter embed' button on the Data tab of your HotDates extension templates. The place to code your prop filter is shown below:

You'll need to check the DatesView name, as it is given a template instance number (this will be evident by viewing the source).
2.10.
The TIP string is not displaying the whole TIP that I am setting it to. Why is
this?
Answer: The TIP length has been set by eqTipLen equate in the HotDates.inc file (about line 60 or so). You can increase this if you wish (you will need to set this after every HotDates re-install), but you need to bare in mind that as you increase it, this will add 150x each byte to each WeeklyPlanner and DayScheduler row (as there are 150 cells in each row). Currently, each cell consists of a Description (50), icon (4), style (4), Tip (200) and ID (4) for a total of 262 bytes per cell (*150) = 39300 bytes per row.
2.11. My styles (in my legend) are all black - what am I doing wrong?
Answer: Your colours are all 0 - otherwise you may be using the colors file, without doing the lookup when HotDates is populating the styles. Check UseFul Tip 10 for more details.
2.12.
I want to retrieve the legend record when the user clicks on it (to display more
information).
Answer: This can be a little tricky as the style ID may not correlate directly to a record in the table. Probably the easiest would be to use the ExtraField in the StyleQueue queue and store the extra info in this field when populating the legend queue.
In your application in the Filter Embed (on the Styles tab of your HotDates control template) 'Before adding Styles to the palette', enter the following:
self.styles.ExtraField = MyVarForExtraDetail
2.13.
I need to put some code in on a successful record update (insert, change or
delete). Where must I put this code?
Answer: The run method is used to call the Update form used to update a record. In your run method, you will find a call to the update form that handles the record change, what you want to do is put code in (check for successful update first) after this call. Typically the code generated in the template would look something like:
GlobalRequest = Request
UpdateTripLog
if GlobalResponse <> RequestCancelled then
self.reset(1)
end
if GlobalResponse <> RequestCancelled then
case Request
of InsertRecord
!Do stuff here when a record is inserted (probably best
to call a routine or procedure)
of ChangeRecord
!Do stuff here when a record is changed
of DeleteRecord
!Do stuff here when a record is deleted
end
end
You will also need to put code into the TakeDropEvent method to handle Paste and Drop of records. You need to do this in the 'HotDates - After Saving record to dropped (or Paste) position' embed point (which is inside the TakeDropEvent derived method). For example:
if pCopy
!Do the same stuff here as when a record is inserted
else
!Do the same stuff here as when a record is changed
end
2.15.
How do I distinguish between a drop, copy and paste action?
Answer: The easiest way to check if the function is a copy, check the pCopy flag in the TakeDropEvent or ValidPaste methods. If it's set, then it's busy with a copy, otherwise it's either a paste or a drop.
If you want to differentiate between Cut and Drop, then probably your easiest, would be to check the pID as follows:
if len(pID) > 4
2.16. I
wonder to perform a function when the user clicks on a cell. Where's the best
place to do this?
Answer: The best place is in the derived SetClickedInfo method after the parent call. This will have the correct values for ClickID, ClickDate, etc.
2.17.
My HotDateSettings aren't being restored at app startup.
Answer: You are setting your datapath too late in the Program Setup. You need to do this before the call to the HotDatesGlobalSettings.init().
2.18.
How do I reset my calendar to a specific date on the fly?
Answer: For the MonthViewer and YearPlanner classes you need to use the following:
ThisCalendar.ScrollToDate(DateToScrollTo)
For the DayScheduler use the following:
ThisCalendar.ChangeDateTo(DateToScrollTo)
where ThisCalendar is the name of the hotDates class, and DateToScrollTo is the value of the date you want to reset to.
2.19.
How do I get the date that the user clicked on?
Answer: Use the property: ThisCalendar.clickdate (This must only be used after the ThisHotDates.TakeEvent has been called)
3.1.
I am not getting any data displayed in my calendar.
Answer: Check:
3.2.
How do I display today's date in the calendar?
Answer: First thing - where your styles are added by the template (in the ThisYearx.PopulateLegend), add today's date style (check AddStyle method in the docs for details):
self.AddStyle(253,'Today''s Date',16711680,16777215,16777215,16711680)
Next - In the LoadData derived method (after generated code):
self.AddStyleToDate(Today(),253)
3.3.
How do I scroll to a particular date?
Answer: There's a method to do this:
ThisCalendar.ScrollToDate(<datetoscrollto>) !Where datetoscrollto is the date to scroll to.
3.4.
I want to control the resizing of the legend and button controls. How do I do
this?
Answer: On the Options tab of the HotDates Calendar control template, check the 'HotDates must not resize the Legend'. Now in the window editor, resize the Calendar Group control to just include the calendar controls.
4.1.
My update is not selecting the correct record.
Answer: You probably have not enough fields in your key to ensure that HotDates selects the correct record. For example: if your key does not have a time related component and you have 2 fields for the same day (in the same column), then HotDates will always pick the one record. The key is to have a unique key in the table used for the cell data so that HotDates can make sure that the correct record is fetched from the file.
4.2.
I would like to add a total column. How do I do this?
Answer: Simply go to your Data tab on your Scheduler control template's prompts, and check the Add a totalling (Counter) column checkbox (not available yet).
4.3.
How do I sort the order of the columns?
Answer: The headers are populated from the Header table. Whichever key you use will determine the order in which the columns are sorted. Columns are not dynamically sortable at this stage.
4.4.
When the number of records (used for the column headers) changes, the number of
columns does not increase.
Answer: You're using ThisWindow.reset instead of ThisWindow.Reset(1) when resetting the calendar (i.e. applying the dynamic filter for the data for the column headers).
Answer: In the Data tab (of the DayScheduler template) - you will find a 'Filter Embed' which takes you to the LoadData method. Between the 'Check for invalid records' and the 'Adding data to the Template Queue' embed points, put the following source:
if PRE:AllDayFieldYN='Y'
DatesQueue:1.Start1 = 1
DatesQueue:1.End1 = 8640000
end
You're basically forcing the start and end times before inserting into the
template queue.
4.6.
How do I display info pertaining to the clicked record on the window?
Answer: This is demonstrated in the example abcdemo application. Normally you'd want to display a field from the specific table, or else get a record from a relating table and display a field from that. In the DayScheduler's derived TakeEvent method (after the parent call), put the following:
if self.FieldIsDateControl()
DisplayString = ''
if self.Update(self.clickdate) = 0
DisplayString = TRI:TripNotes
!Put code in here to fetch other table's records if required.
end
display(?DisplayString)
end
4.7.
The time block finishes at 12:00 - but does not show the 12:00-12:30 time block
included in the display range.
Answer: Normally, if you have an appointment from 11:30 to 12:00 (with the DayScheduler set to display 30 minute blocks) - you would only want to show 1 block - i.e. 11:30: 11:59:59. This is because your next block starts at 12:00 for the next half hour block.
If you would like it to include the subsequent block when displaying the appointment, then you can simply check the Include the end time block in the display checkbox in the DayScheduler template (on the Data (Time) tab).
4.8.
Only 50bytes of my data is displayed in each cell. How do I increase this?
Answer: The queue field (used in the planner/scheduler to display the cell data) is 50 bytes long, you can change this in the clarion6\3rdparty\libsrc\HotDates.inc file as follows:
eqDataStringLen equate(50) ---> change to 255 (or whatever your require)
This will increase your queue size quite dramatically (150 cells in a row, so that's 150x205Bytes per row increase) - so you need to be aware of the knock on the memory usage.
4.9.
The names of the months are not translated in the DayScheduler.
Answer: That's because the datepicture is using @d18 - your windows default date picture, and your language (Windows setting) is set to English. You can change this picture in the template (Headers tab, Date Format (in Header)) - or set your computer's default language to your language.
4.10
How do I get the record of the cell that I click on?
Answer: The dayscheduler and weekplanner use 2 queues for the data - one to display on the list itself, and the other to store the necessary data required by the list. Each cell has the data required for that cell (tip, text, styling, etc) and an ID. The ID is a pointer to the data queue which contains all the field values required for that cell. So basically, when you get a drag/drop/click, then you use the self.ClickID to get the row that matches that cell from the dataqueue.
Here's from the example (in the update method):
ThisScheduler1.Update PROCEDURE (Long
p_d)
ReturnValue Long
CODE
ReturnValue = PARENT.Update (p_d)
get(DatesQueue:1,self.ClickID)
if ~errorcode()
TRI:ID = DatesQueue:1.TRI:ID
self.UpdateID = TRI:ID
return access:TripLog.fetch(TRI:KeyID)
end
self.clickID will have the ID loaded of the record on event:accepted, drag, drop and selected. If there are other events that you are trying to get the record ID then you will need to load the ClickID from the list queue.
5.1.
How do I sort my child (or row data) into a better order?
Answer: You can set this up in the control template to be ordered in the way that you would like.
5.2.
My window takes a long time to load. Can I make it quicker?
Answer: HotDates makes use of a view to load the data into a queue which is used to populate the data into the Planner queue. The view can be quite an inefficient way of reading data from a file.
1. Limit your tables (in the HotDates Planner view) to one.
2. Manually add the necessary fields into the template created queue (see the
Planner Template - Queue Tab).
These should include the child fields used for display data, icons and styles,
as well as fields that link the child to the parent. According to the example
code below, the DAT:Date and DAT:ID will need to be added to the template
generated queue fields.
3. In your Planner Template - Queue Tab
select to sort row data by 'Other'.
4. Now create a loop for each child table inside the view loop by adding the
following (example) code below the Local Objects | CapeSoft Objects | ThisPlan1
| LoadData | CODE | Refresh the template Queue with data from the tables - Start
of loop embed point:
DAT:Date = self.FirstDate
DAT:SalesmanID = SAL:ID
set(DAT:SalesmanIDKey,DAT:SalesmanIDKey)
loop until access:Data.next()
if (SAL:ID <> DAT:SalesmanID) or |
NOT (inrange(DAT:Date,self.FirstDate,self.LastDate))
break
end
5. To end the loop, and create the sort order, place the following (example) code in the CapeSoft HotDates: x | Manual Sorting embed:
end
sort(DatesQueue:1,DatesQueue:1.SAL:Firstname,DatesQueue:1.SAL:Lastname ,DatesQueue:1.DAT:Date,DatesQueue:1.DAT:ID,DatesQueue:1.Style)
6. This is not built into the DayScheduler template (yet). You can override the LoadData method manually if you like (i.e. put your queue population code loop in before the template generated one and then return before the template generated code). You'll need to code the loop as above, without using the view (which in some cases is the time costly aspect of the loop).
5.3.
I cannot get more than about 150 cells per row - is there a limit?
Answer: There is a limit of 150 cells per row. Each cell requires 262 bytes (the description, icon, style, ID and Tip fields) - this means that each row is 39Kbytes of RAM. This is fine for a handful of rows but for a couple of thousand, this can head towards a chunk of memory usage. We've tried to reach a compromise between those using lots of rows, and those using lots of cells.
5.4. Is that possible for me to fix the date’s header width in a planner?
Answer: You need to set the following properties before (or in fact you could derive the init method and place it in there) the Hotdates.Init method.
ThisCalendar.ZoomSteps = 1
ThisCalendar.MinColWidth = 20 !Or
whatever you want the ColWidth to be
5.5.
How can I restrict the header to only display one row (of date header details)?
Answer: you need to code the following around the parent call to the GetColumnHeader method:
6.1.
How do I print out my Monthviewer?
Answer: In versions prior to 1.29 printing out was not support in the MonthViewer, so you need to either:
1. delete the MonthViewer control template (please make a note of all your template settings so that you can re-apply them correctly), quit and save - and then add the MonthViewer template back onto your window again. This will include the Print button.
- OR -
2. add a button to the window, and then in your source just before the ThisMonthViewerx.Init call enter the following code:
ThisMonthViewerx.PrintControl = ?MyPrintButton
6.2.
How do I make my dates more prominent?
Answer: This is a setting on the Control Template of the MonthViewer. On the Options tab, in the Date Indicator group you can change the color, proportional size, and orientation of the date indicator string to suit your needs. The date indicator string is a string control that floats on top of the list box control. When the listbox is selected (i.e. scrolling, etc) the listbox will have the focus and will swap to the front of the string control - thereby making the date invisible during the scrolling.
6.3.
How do I get the table record of the item in the Queue that I've clicked on?
Answer: You need to use the ThisMonthViewer.Update method (check the template code to see what it puts in the derived method). It basically fetches the data from the queue and fetches the respective records from the queue of the day that was last clicked on. You must have populated the MonthViewerUpdate control template as well in order for the derived code to be placed in the procedure.
6.4.
How do I make the font smaller when printing out the calendar?
Answer: Printing the calendar makes use
of the styles queue to obtain the font attributes (style, color, size, etc). You
could alter these on the way into the PrintNow method (i.e. before the parent
call) - and then reset them on the way out (i.e. after the parent call).
In your LocalData, add an array to store the fontsizes:
In your MonthClass.PrintNow method (before the parent call):
loop x = 1 to 255In your MonthClass.PrintNow method (after the parent call):
loop x = 1 to 2551.
This is a warning of a bug in Clarion6.1 (some versions) where the relate:file.open does not open all the files in a relationship. This causes your data not to be displayed because the view cannot be opened. You can solve this by adding the tables to the Other Tables branch in the tables tree on your window where you have added the HotDates control template.
2.
You probably have a multi-DLL application. This error indicates that you have 2 DatePicker procedures in your data-DLL, which both have the same external name and are both exported. In your data-DLL application, delete the DatePicker procedure that you don't require. HotDates ships with 2 DatePicker windows (depending on your preference) - in a single application, the two can live happily side-by-side - the one unused. It's only a problem in a Multi-DLL application because both have the same external name.
3.
You have a multi-DLL application that is requiring the use of the DatePicker. You DatePicker name (set in the global extension template) does not match the name of that in the Data-DLL. This must match the exported name (not the physical procedure name) in your Data-DLL.
4.
You have a multi-DLL application that is requiring the use of the DatePicker - but you have Multi-Proj and HotDates added to this application. Both are creating the map to the external DatePicker procedure, so you need to set the Dont automatically map to the external DatePicker checkbox in the HotDates Global Extension template.
5. Missing Procedure Definition: SetGlobalSetting(HotDatesGlobalSettings,String,?)
If you have a multi-DLL application, then you're probably missing the compile directives ABCDLLMODE and ABCLINKMODE in one of your DLLs.
6.
This is not a HotDates error per sê, but can occur in one of your HotDates windows if it does not have the MDI-child attribute turned on.
7.

The WeeklyPlanner template will extract your data much more efficiently if you have a key that has the date field as the first component in that key. You can turn this assert off in the HotDates extension template in the procedure indicated, but it's better to add a key to your dates table (it does not have to be unique) that contains the date field as the first component.
8.

You have not selected a key in the Table tree on the Procedure where the YearCalendar exists. For example:

| CapeSoft Sales | |||
| Web | |||
|
|
|||
| Telephone |
+27 21 715 4000
|
||
| Fax |
+27 21 715 2535
|
||
| Post |
PO Box 511, Plumstead, 7801, South Africa
|
||
| Buy Online | |||
| Web | |||
Henry Manney (in a email on 6 December 2004)
This product is awesome - I have integrated it with a Task scheduler and it is phenomenal.In an email 15 March 2005 (Annon.)
HotDates seems to me the product that is most likely to become the next
killer accessoire(sic) from Capesoft. Lot's of stuff is cool, but this is
indeed useful too. I've been looking forward make a weekly planner for
quite some time now, but never really had room in my schedule. With
HotDates combined with InMemory driver and a little handcode I now have
a plan showing all employees and other resources, their notes, plans,
and time registrations, including update functionality. All in one
window, complete overview in one look. The templates are close to self
explanatory and as usuall(sic) the docs wipe out any confusion.
Keep OOP the good work!