CapeSoft.Com
Clarion Accessories
HotDates
Documentation
CapeSoft Logo

CapeSoft HotDates
Documentation

Download Latest Version JumpStart FAQ History
Installed Version Latest Version

Introduction

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.

Features

Included in HotDates: Colorize data screenshot

De-activate items in the legend (using the checkboxes in the list):

de-activate items screenshot

Change priority of items viewed (using the runtime priority buttons):

change item priority screenshot
Update calender information screenshot
Date range selection screenshot
easy global translation screenshot
Easy drill down and up screenshot

JumpStart in adding HotDates to your Application

I've included a completed tutorial in the examples. It's in the clarion\examples\HotDates\Tutorial\Completed directory. You can use the start app in the clarion\examples\HotDates\Tutorial folder if you want to test this first before applying to your application.

Adding the Colors and Settings tables to the application

The colors and settings tables aid us in setting up the colors styles and translation of day and month names for the application. You would typically require the Settings table if you're wanting to add translation to your calendars and/or allow weeks to start on a different day. The Colors table is very useful to have one style set that you can use across all your calendars. Include these now, and you'll thank me later.
  1. Open your dictionary
  2. From the File menu, select the Import Text option.
  3. Using the file dialog window, find the HotDatesSettingsTables.dctx file which is located in your clarion\accessory\libsrc\win directory.
  4. Save and exit from the dictionary.

Adding a DatePicker and Settings windows to the application

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 Calendar Colors item to your Setup menu, and call the BrowseHotDates_Colors procedure from this item.
  7. Add a Calendar Settings item to your Setup menu and call the BrowseHotDates_Settings procedure from this item.

Adding the Global Extension Template to the application

  1. Now you need to add the Global Extension Template. To do this:

    • Open your application in the Clarion IDE, and click on the Global button.
    • In the Global Properties window, click on the Extensions button.
    • 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.

Adding a 1 to 12 Month Calendar to the BrowseTripLog window

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 to 12 month calendar screenshot

  1. Create a new window for your calendar (or add to your existing browse if you would like the browse on the same screen as your calendar). Right-click on the procedure name in the tree and select the Window option. In the tutorial, we'd use the BrowseTripLog window to add our calendar to the browse.
  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).

    NOTE: In clarion 8 you will be prompted for the first column in each list, click Cancel when you are presented with this list.
  8. Clarion 6: Right-Click on one of the controls and select the Actions menu item.
  9. Clarion 6: Click on the Tables button.
    Clarion 8: click the Data /Tables tab

    table screenshot

    In this case, the TripLog file is the file that contains the date data, so would be the primary file for the calendar. The Vehicles contains the file that is used for the legend (on the right) and each trip is colored to match the color of the style that is used to highlight the vehicle in the legend, so that the eye will naturally link the trip to the vehicle by the style. In your application, you may have constants for the legend, and therefore there may not be an additional table in the tree.
  10. Insert the tables in the tree as described above. For the tutorial, 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:

    general tab screenshot

    • The Start Date is the first date of the calendar displayed.
    • Check Enable Scrolling to allow the calendar to scroll earlier than the start date, or later than the startdaten + number of months.
    • From Date lets you determine the date that the user can scroll back to.
    • To Date lets you determine the date the user can scroll forward to.
    • Scroll by (months) lets you set the increment the calendar changes with each scroll.
    • Heading lets you set the heading of the calendar when it is printed.
  12. In the tutorial, we'll 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:

    data tab screenshot

    • Stored as allows you to select how the date data is stored in your dates table. You can select FromDate-ToDate, Date (useful for something like birthdays or public holidays where each entry is a single date), Date-Duration (Startdate, and number of days long), Handcoded (something else).
    • Depending on your Stored As selection, would depend on the fields presented, but for FromDate-Todate, you'd need to enter the FromDate and ToDate fields. These are the fields in your table that contain the date information. For info Stored As Date, you'd have just the one Date field, and for info Stored as Date-Duration, you'd have a FromDate and Duration fields.
    • ToDate optional (infinite when 0) means that the calendar will get highlighted from that date on if 0 date is set in the ToDate field.
    • Style is an expression (usually a style field - like an ID to the legend table) to link to the style field in the next tab.
    • Filter is used to discard unwanted records from being displayed on the calendar
    • View Filter is used to set the parent filter for the view. This should not contain functions, but table fields and constants as in a normal browse filter.

    NOTE: Rather use an ID for the style. Using a pointer is not supported in SQL. There are various ways of doing this discussed in the Hotdates Training manual that will be better in different scenarios
  14. In the tutorial, 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) to be used in the filter.
  15. The Filter field (for the tutorial) 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:

    styles tab screenshot

    • Max Columns in Legend allows you to set how many columns you want in the legend. If you'd like the legend on the left of the calendar (usually), then you'll keep this to 1. This can be set to a maximum of 5 columns.
    • Use Checkboxes to activate styles. Check this to allow a user to "turn off" a particular legend item from being displayed in the calendar.
    • Save and Restore. Check this to save the legend order and the state of the legend checkboxes between sessions.
    • Load Styles from a file. Check this if your legend data is in a file, or leave unchecked to manually enter the items in the legend list.
    • FileStyles: You need to enter from which file the legend is loaded, and the key used to populate the legend, as well as a filter.
    • Style ID: this is the legend ID that will be used to link the legend style to the calendar data (so that the same colorization will be used in the legend as the linked item in the calendar. This is the other side of the relationship from that used in the data tab (above).
    • Description: the text used to describe the style in the legend list.
    • Color fields: the color fields used for the legend list.
    NOTE: Rather use an ID for the style. Using a pointer is not supported in SQL. There are various ways of doing this discussed in the Hotdates Training manual that will be better in different scenarios
  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. In the tutorial, 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)     !This is the expression in the Style
    access:HotDates_Colours.fetch(HDCOL:ByStyleID)
  23. Go to the Options Tab

    options tab screenshot
  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)

Adding Update buttons to the Calendar

  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

    update screenshot
  6. Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window)

    prime fields on insert screenshot
  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.

Adding a MonthViewer to a new 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.

month viewer screenshot

  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. 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.
  6. Clarion 6: Right-click on one of the controls and select the Actions menu item.
  7. Clarion 6: Click on the Tables button.
    Clarion 8: click the Data /Tables tab

    tables setup screenshot
  8. Enter 'pStartDate' into the Start At Date field.

    start at date screenshot
  9. Goto the Data tab and set it up as follows:

    data tab screenshot
  10. 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).
  11. The Filter field is: (TRI:BusinessTrip=1) or ~Loc:BusinessOnly (this is so we can restrict to BusinessTrips if we check the checkbox)
  12. 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)
  13. Go to the Styles tab and set it up as follows:

    styles tab screenshot
  14. Note that we use the parent table for the styles file.
  15. 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)
  16. The Description is indicative of the car that did the trips: 'clip(VEH:Make) & ' ' & clip(VEH:Model) & ' ' & clip(VEH:Year)'
  17. 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.
  18. 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)
    access:HotDates_Colours.fetch(HDCOL:ByStyleID)
  19. Go to the Options Tab and leave the default settings as they are. You can enter 'WeeklyPlanner' into the Drill down Procedure procedure.
  20. Place the Loc:BusinessOnly checkbox control on your window (not inside the ?MonthViewGroup control)
  21. 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)

Adding Update buttons to the MonthViewer

  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

    actions option screenshot
  6. Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window)

    prime fields on insert option
  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).

Adding a 1 to 100 day Planner to a new window

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 pictorial example:

1 to 100 day planner screenshot

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. Clarion 6: Right-click on one of the controls and select the Actionsmenu item.
  7. Clarion 6: Click on the Tables button.
    Clarion 8: click the Data /Tables tab

    tables screenshot
  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'll be styling this calendar slightly differently)
  9. On the General tab:

    general tab screenshot
  10. Go to the Data tab.

    data tab screenshot
  11. The Left Heading field contains the heading (a constant, variable 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):

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

    options screenshot
  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.

Adding Update buttons to the WeeklyPlanner

  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_PlannerUpdate 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

    actions screenshot
  6. Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window)

    prime fields on insert screenshot
  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).

Adding a DayScheduler

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. Clarion 6: Right-click on one of the controls and select the Actions menu item.
  6. Clarion 6: Click on the Tables button.
    Clarion 8: click the Data /Tables tab

    tables screenshot
  7. 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)
  8. On the General tab, set the Display date to pStartDate.
  9. Go to the Headers tab and set the following settings (besides the defaults):

    headers tab screenshot

    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).
  10. Go to the Data tab and set the following settings:

    data tab screenshot

    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.
  11. Go to the Styles tab and set the following settings:

    styles tab screenshot

Adding Update buttons to the DayScheduler

  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

    actions screenshot
  6. Go to the Prime Fields on Insert tab to the following: (Note you will need to wizard up a SelectVehicle window)

    prime fields on insert screenshot

    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).

Adding the DatePicker Lookup Hotkey

  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 HotDates Templates (and how to add them to your Application)

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. If you want to use the HotDates_Color tablem and the Hotdates_Settings table, then import these into your dictionary. To do this open your dictionary and import the clarion\accessory\libsrc\win\HotDatesSettingsTables.DCTX file.
  2. Open the app. Add the Global Extension Template. To do this:

    1. Open your app in the Clarion IDE, and click on the Global button.
    2. In the Global Properties window, click on the Extensions button.
    3. Click on the Insert button and select the Activate_HotDates extension template.
    4. If this is the Data DLL, or this is a single-app system and this is the EXE, click on the button to Import the DatePicker procedure. If you imported the tables mentioned in step 1 then you can also click the button to import the Settings procedures.
    5. Set the settings on the Options tab.
      The following prompts are available on the Options tab of the Global Extension template:

      options screenshot
    6. 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.
    7. You can specify a Legend List row height for all your legend lists here.
    8. If you imported the DatePicker procedure, then ensure the Date Picker Procedure field is pointing to the DatePicker you required (otherwise leave it blank).
    9. To call the DatePicker procedure using a HotKey, specify the Date-Picker HotKey here. You will need to add the DatePicker HotKeyLookup extension to each window where you require the use of the HotKey.
    10. If you have a Multi-DLL application, then you can place your DatePicker procedure in a DLL, and all your other applications can use the one DatePicker procedure in that DLL. In this case, check the HotDates globals are in another app checkbox and enter the name of the DatePicker procedure in the string provided above that. Your DatePicker HotKey, First Weekday and Refresh event will also be set only in the Multi-DLL.
    11. If you would like to manually map the DatePicker, then you can check the Don't automatically map the procedure checkbox. In this case, you will need to manually code the Map to your DatePicker window in the Global map.
    12. You can set the Date-Field Alternator keys in the fields provided. This simply means that all the Hotdates DateEntry templates will use these settings for global date-entry compatibility. If you don't require one (or more) of the HotKeys, then clear the entry.

      zoom screenshot
    13. 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:
    14. Zoom steps (i.e. the amount of times to click the zoom out (or zoom in) to get from the lowest to highest (or visa-versa) resolution of the column width.
    15. Minimum Column width - the narrowest column width to zoom out to.
    16. Maximum Column width - the widest column width to zoom in to.

      settings screenshot
    17. 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.
    18. If you want to enable the user to set the various global HotDates settings on the fly, then you can do this using the HotDates Settings Table. Check out the Using the HotDatesSettingsTable (to store multiple sets of Translation and other global settings) section of this doc for more details.

      colors table screenshot

      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.

Adding a 1 to 12 Month Calendar to your application

  1. Open the Window Formatter for the window that you are wanting to add the Calendar to.
  2. Select Populate - Control Template... from the menu.
  3. Select the HotDates_Calendar 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 12 square list boxes (one for each month), the legend controls, and a group of buttons (ScrollBack, ScrollForward, Print and Refresh).
  5. Hide 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.
  6. Right-Click on one of the controls and select the Actions menu item.
  7. Click on the Tables button.

    tables screenshot
  8. Insert the files that will contain the data to populate on the Calendar. If there is more than one table required to extricate the data, then use the one with the Date fields 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.
  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).
  10. On the General tab:

    general tab screenshot
  11. 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.
  12. 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.

    • Set the From Date to the date to which you can scroll _back_ to. (leave blank for January last year)
    • Set the To Date to the date to which you can scroll _forward_ to.(leave blank for December next year)
    • 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).
  13. The Print group contains options that pertain to the calendar when outputting to a printer:

    Heading: (oddly enough) the heading that appears at the top of the report.
  14. Goto the Data tab.

    data tab screenshot
  15. 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).
  16. 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.
  17. 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.
  18. If you have multiple records for days, and you would like to use totaling to reflect a sum, count, average, maximum or minimum of the values for those days, then you can check the Style based on totaling checkbox.

    Style based on totalling screenshot
  19. If you checked Style based on totaling 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.
  20. 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.
  21. You can enter an expression to filter unwanted data in the Filter field.
  22. To code a more in depth 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
  23. Go to the Styles tab.

    styles tab screenshot
  24. 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)
  25. 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.
  26. To keep your style settings (style priority and active state) between sessions, you can check the Save and Restore checkbox.
  27. 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.
  28. If the colours that you will use for the styles are in the Global HotDates Colours table, then check the Use Colors table checkbox.
  29. 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.
  30. Similarly with Manual styles, you can set the above settings from the template.
  31. Go to the Options Tab

    options tab screenshot
  32. 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.).
  33. 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)
  34. 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.
  35. 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.
  36. Go to the Classes tab and set the Based on Class to YearClass and the Object Name to something unique and descriptive like ThisYear1.

Adding Update buttons to your Calendar/View

  1. Open the Window Formatter for the Calendar/View window.
  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), 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.
  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

    actions screenshot
  6. Select the Update File - if there is no unique key found, then you will need to enter a Key to access the file by.
  7. Enter the Update Procedure that will be used to update the record.
  8. If the procedure takes Parameters, then you can enter those in the field provided.
  9. Go to the Prime Fields on Insert tab

    prime fields on insert screenshot
  10. Enter the field that will receive the date that is clicked in the Field for Clicked date entry.
  11. If your displayed data is stored as a date range (FromDate-Todate or DateDuration), then you can enter the field that will receive the ToDate (or Duration) that is clicked in the Field for End date entry. This will allow a date range selection in the calendar using ShiftMouseLeft.
  12. You may want to select a parent record to relate a clicked entry to. You can enter the procedure used to select the parent in the Parent record using: drop list.
  13. To prime other fields, use the Other fields to prime list box to enter variables to be primed with their respective values.
  14. If you have entered a End date field (i.e. you are allowing date range selection), then you need to stipulate a identification for the selection in the Selected Date Range Identification group.
  15. The following options are available for the Update buttons in a DayScheduler as well:

    time field screenshot
  16. Field for Clicked Time is the data field to receive the value of the start of the clicked time range (if it's a range) or the clicked time cell (if no range is selected).
  17. Field for End Time is the data field to receive the last time of the time range selected. If you don't want to enable time range selection, then leave this blank.
  18. You can use the checkbox End Time is at the end of the last block to determine whether the End Time is at the end of the last selected cell or at the beginning.
  19. Go to the Options tab

    options tab screenshot
  20. If you want to edit view Right-Click and popup, then check the Add Update buttons to popup checkbox.
  21. 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.
  22. 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.
  23. 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.
  24. 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.
  25. If you are supporting Cut|Copy|Paste and\or Drag and Drop, then you'll need to handcode a validation routine to avoid duplication occurring (Useful Tip: 11. Validating Paste and Dropped data entries).
  26. Go to the Classes tab
  27. 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.

Adding a MonthViewer to your application

  1. Open the Window Formatter for the window that you are wanting to add the Month Viewer to.
  2. Select Populate - Control Template... from the menu.
  3. Select the HotDates_MonthViewer 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 2 buttons in a Group and the legend controls.
  5. Delete the controls that you don't require. You must leave the ?MonthViewGroup.
  6. Right-click on one of the controls and select the Actions menu item.
  7. Click on the Tables button.

    tables screenshot
  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.
  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).
  10. Go to the Data tab.

    data tab screenshot
  11. 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).
  12. 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.
  13. 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.
  14. 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.
  15. You can enter an expression to filter unwanted data in the Filter field.
  16. 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
  17. The Data to Display field will contain the field or expression to place the data in each item in the daylist in the month.
  18. 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.
  19. Go to the Styles tab. Check out the Calendar Control template for help in setting up styles.
  20. Go to the Icons Tab

    icons tab screenshot
  21. If you are not going to use Icons, then leave the Use Icons unchecked and move straight on to the Options tab (below). Otherwise check the UseIcons checkbox.
  22. Select whether you want the Icons to be Transparent or Normal Square icons (in the daylists)
  23. 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.
  24. 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 Filename for the icon.
  25. Go to the Options Tab

    options tab screenshot
  26. 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.
  27. 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)
  28. 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.
  29. 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)
  30. The Drill Up follows the same principles as Drill Down (immediately above).
  31. 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.
  32. 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.
  33. 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 Week/Month Planner Control Template

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 pictorial example:

week / month planner control template screenshot

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. Open the Window Formatter for the window that you are wanting to add the WeeklyPlanner to.
  2. Select Populate - Control Template... from the menu.
  3. Select the HotDates_Planner 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 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.

    tables screenshot
  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.
  9. On the General tab:

    general tab screenshot
  10. The From Date indicates the date of the 2nd column. You can use the Loc:StartDate variable (which has an entry control as part of the control template), a fixed date (like today()) or an expression.
  11. The Prime Loc:StartDate with passed date. If you're using a variable startdate (in the FromDate), then you can get the template to prime this variable with the parameter passed (from drill-down/up).
  12. The Days to view indicates (oddly enough) the number of days to view in the list. You can use the Loc:DaysToView (which has an entry control as part of the control template), a fixed number (like 7) or an expression (like day(date(month(today())+1,1,year(today())))).
  13. The Details per day indicates the number of detail rows to have per parent (left column) per day. You can use the Loc:DetailsPerDay (which has an entry control as part of the control template), a fixed number (like 3) or an expression.
  14. The Heading field contains the heading (a constant, variable or expression) for the left-most column.
  15. The Filter field is used to filter out obsolete records from being added to the queue.
  16. The Displayed Data field contains the data for the left most column.
  17. The Width field contains the initial width for the left most column.
  18. The Load Data the new way (see docs for details) checkbox creates the cell data in a more efficient manner, using the legend order to populate the style, rather than looping through styles and generating the style based on the legend order. This is not backward compatible (IRO which embed points are used for populating the style data), and so this is off by default, but for new calendars, this should be checked in order to use the more efficient mechanism for loading data.
  19. Go to the Data tab.

    data tab screenshot
  20. The Date Picture for Column Headers is the format in which the date must be displayed in the column heading (from column 2 onwards)
  21. 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.
  22. 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).
  23. 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.
  24. 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.
  25. 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.
  26. You can enter an expression to filter unwanted data in the Filter field.
  27. The Data to Display field will contain the field or expression to place the data in each item in the row.
  28. 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.
  29. 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.
  30. Go to the Queue tab.
    Queue tab screenshot
  31. 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).
  32. 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)
  33. 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.
  34. To code a more in depth 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
  35. Go to the Styles tab. Check out the Calendar Control template for help in setting up styles.
  36. Go to the Icons Tab.
    icons tab screenshot
  37. 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.
  38. 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.
  39. Select whether you want the Icons to be Transparent or Normal Square icons (in the daylists)
  40. 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.
  41. 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.

    options tab screenshot
  42. 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)
  43. The Drill Up follows the same principles as Drill Down (immediately above).
  44. 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.
  45. 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.
  46. 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.
  47. 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.
  48. 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.
  49. 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.

Adding a Day Scheduler to your application

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:

day scheduler screenshot

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. Open the Window Formatter for the window that you are wanting to add the WeeklyPlanner to.
  2. Select Populate - Control Template... from the menu.
  3. Select the HotDates_Scheduler 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 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).
    • The SchedulerList control (which will display the data we're wanting to see).
    • 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.
    • 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.
  5. Delete the controls that you don't require. You must leave the ?SchedulerList control.
  6. Right-click on one of the controls and select the Actions menu item.
  7. Click on the Tables button.

    tables screenshot
  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.
  9. On the General tab:

    general tab screenshot
  10. 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.
  11. Go to the Headers tab.

    headers tab screenshot
  12. The Date Format is the date picture format of the header that appears above the Scheduler list box. Leave this blank for the default (@d18)
  13. The Left Column Data group pertains to the amount of rows and the left most data in those rows. The Left Heading is the text that will be placed in the header for the left column.
  14. The Row Intervals by drop list will enable you (in future) to determine whether the Scheduler is rowed in days or in time.
  15. The Row Interval (Sec/100) indicates the time period in 100ths of a second of each row. In the above example this is set to 30 minutes.
  16. The Start Time is the time that is initially represented in the first row of the Scheduler list (this can be changed at runtime if required).
  17. The Rows entry indicates the amount of rows to initially display in the Scheduler List (this can be changed at runtime if required).
  18. The Picture entry indicates the picture token to use for the left column data. This must either be a string in quotes or a variable.
  19. The Column Headings group pertains to the data that must be used for the column headings. At this stage the headings can only be file-loaded - but we'll add pipe-list as well.
  20. The number of column headings will be determined by the records in the primary table of the HotDates Scheduler (which you set earlier). Each record will have a column of data. You can filter out unwanted records using the Filter entry.
  21. The Displayed Data entry is the text to display in the heading of the column. This should contain some unique fields from the primary table to correctly identify the column that pertains to that record.
  22. The ID field is not required for file drivers that support the POINTER() function - but you'll need an auto-incrementing LONG for drivers that don't support the POINTER() function (SQL drivers).
  23. Go to the Data tab.

    data tab screenshot
  24. 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.
  25. 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.
  26. 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.
  27. 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.
  28. You can enter an expression to filter unwanted data in the Filter field.
  29. The Data to Display field will contain the field or expression to place the data in each item in the row.
  30. 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.
  31. 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 Totaling                                                             (Counter) column checkbox.
  32. 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.
  33. For the data in each cell, we use the Time Limiting group. The data can either be Stored as TimeDuration, FromTime-ToTime or handcoded.
  34. You'll need to enter a FromTime and a ToTime (For FromTime-ToTime data) or a Duration (for TimeDuration data)
  35. You can use the Filter embed to handcode a filter to filter out data that must not be displayed in a specific cell.
  36. Go to the Styles tab. Check out the Calendar Control template for help in setting up styles.
  37. Go to the Icons tab. Check out the MonthViewer Control template for help in setting up icons.
  38. 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)
  39. 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.
  40. 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.
  41. Check out the Planner template for the adornment group details.
  42. Go to the Classes tab and set the Based on Class to SchedulerClass and the Object Name to something unique and descriptive like ThisScheduler1.

Ways to use the DatePicker effectively (the Lookup button, and the window HotKey)

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.

Adding the Date Picker Lookup Button

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.

    date picker screenshot
  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())

Adding the DatePicker HotKey extension to your window

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.

    options tab screenshot
  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.

    enable date picker screenshot
  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-explanatory. 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).

Using the DateEntry Locator control template

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:

locator options screenshot
  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.

Useful Tips

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)
Styling a cell manually in the Weekly Planner

Style field formula examples

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 Stylefield:

choose(ORD:Shipped>ORD:ExpectedShipDate,1,2)

Your Style tab would be set up as follows:

styles field screenshot

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:

styles tab setup screenshot

Coding Manual Filters

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 (e.g. 14 July)
EndDate - the date at the end of the range (e.g. 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):


Tricks in linking records for Updating

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:

planner screenshot

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):

link embed screenshot

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:

link embed screenshot

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

Refreshing the calendar

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.

Implementing Translation

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):

global embeds screenshot

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

Making Printouts

This is built in for the YearCalendar and the MonthViewer (check FAQ 6.1. on how to do this). If you want to preview the report before printing out, take a look at FAQ3.5. 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.

Overriding Global Settings (like DatePickerHotKey and FirstDayofWeek) on the fly

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).

Drag and drop across windows

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.

options screenshot

In order to make sure that your drop is valid you need to check out 11. Validating Paste and Dropped data entries
To refresh the drag window, set the refresh event in the global extension to a user event (> 400H). Post this refresh event from the drop window to the thread of the drag window.

Cut/Copy/Paste across different windows

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

Creating a Style file (for themes and across-the-app colorization)

For an example of this functionality, check out the MonthViewer procedure in the clarion\examples\HotDates\abc\abcdemo.app

Creating the Color table: You can import the HotDates_Colors and HotDates_Settings table from the DCTX in the clarion\accessory\libsrc\win 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:

The HotDates construct method calls the init method (which is called before FM3 initializes). This will mean that you get a native Clarion connect window, before the FM3 window has a chance to run.

2 things to do to correct this:

  1. in your HotDates global derived class (in the init method before generated code and the parent call):

      if ds_FMInited = 0 
        return
      end
  2. make a call to the HotDates global init method after FM3 has initialized:

    in the 'FM3 - Just outside Init code loop' embed point:

    HotDatesGlobalSettings.Init()

Validating Paste and Dropped data entries

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

Using the HotDatesSettingsTable

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:
  1. Import the HotDatesSettings tables into your dictionary (you may already have done this):
    Open your dictionary, select the Import Text from the File menu, and select the HotDatesSettingsTables.dctx which is found in your Clarion\accessory\libsrc\win directory.
  2. Open your application, and run the Template Utility ImportHotDatesSettingsProcedures from the Application | Template Utility menu item. This will add the necessary procedures to your application to edit the settings.
  3. Add a menu item in your frame (or somewhere in your application) to point to the BrowseHotDates_Settings procedure. Call it something like 'Calendar Settings'.
  4. Open your HotDates global Extension template and check the 'Use the HotDates Settings Table' checkbox and enter the HotDates_Settings table into the field provided immediately below this.
  5. Use the HotDates Settings Table Fields button to ensure that the fields are correctly populated with the ones that are in the imported table (these should all be correct be default).
  6. Set the ini file entry and section where you want to store the defaults between sessions.
For Multi-DLL applications, do steps 2 and 3 in your EXE application, and 4, 5 and 6 in your Data DLL application.

Displaying public Holidays

In order to display public holidays, you need to do 2 things:
1. Add the public holiday style to the legend.
2. Add the public holidays to the calendar data (in a year calendar).

3. Adding the public holidays to the weekly planner involves adding the holiday style to each person in the LoadCells method that you can derive in your application. you need to do this after the template generated code. Here's some example code that shows you how to first load the holidays into a style array, and then using the style array, apply the holiday style to each of the rows at the dates where the public holiday exists.

Examples

There are 3 examples that ship with HotDates - you can find them in your clarion\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.

Frequently Asked Questions

Compile and Trappable Runtime Errors associated with HotDates Check out general product CompilerErrors.

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?
2.19. How do I keep the double-click drill down/up, but disable the popup menu?
2.20. How do I get the date that the user clicked on?

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?
3.5. How do I call a PrintPreviewer when printing my calendar?
3.6. How do I drilldown on double-click?
3.7. How do I trap a click on the calendar to refresh some data?

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?
4.11 How do I fix the column widths to a specific value?
4.12 How do I post a double-click event from the calendar to a control?
4.13 How do I trap a click on the calendar to refresh some data?
4.14 If I go to the form from the scheduler and change the date of the calendar item there, how do I change to the new date of the item after closing the form?

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?
4.8. Only 50bytes of my data is displayed in each cell. How do I increase this?

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:

Prop filter embed screenshot

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


You would place your handcode in the embed point immediately after this:

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.14. My calendar takes a long time to refresh - how do I optimize the time taken for the calendar to load?

Answer: Optimization will vary from case to case, but here are some guidelines:

If you have more than one calendar on a procedure, then copy the procedure to another one, and remove all calendars except one, and repeat until you find the calendar that takes the long time to load. If all the calendars on the window are taking a long time, then you'll need to work on each calendar, but work on each individual calendar one at a time, so you can measure each optimization step.

One of the most likely causes is your view filter is not setup (correctly or at all). This will especially affect SQL applications (but TPS as well). In the HotDates calendar templates on the data tab, there are 2 Filter entries - the one for a client side filter "Filter:" and the other for a Server side filter "View Filter". The client side filter filters records after they are retrieved from the backend. This is useful for additional filtering, but should not be your primary filter. The View Filter sets the filter for the view (i.e. limits the records fetched from the database). Any variables that are not used in the files in the view must be bound (using the Bind Fields button). (You can also handcode the filter - see below).

Once you've optimized the filer, the next most likely cause is you're not filtering out unwanted styles. For each cell (of each calendar) - HotDates needs to work out the top priority style to display in a particular cell, and by allowing the user the flexibility to prioritize styles they want to, this means that there's a lot of looping going on (relating to styles) for each cell. Use the Filter Embed in the Styles tab of the hotDates calendar template to filter out styles that aren't needed - and this will make a dramatic difference to the load time of the calendar.

Another likely case for taking a long time to load is an inefficient view. Take a look at the view structure that HotDates is generating for you.

DatesView:4  VIEW(Yearly_Alerts),ORDER('YAlerts:Alert_date,YAlerts:AnotherField')
                           JOIN(JOBvehicles:Key_ID,YAlerts:Vehicle_ID)
                             JOIN(CLI:Key_ID,YAlerts:Client_ID)
                             END
                           END
                         END


HotDates will attempt to use the date field to order the view by (as this will 99% of the time be the most efficient way of fetching the data for the calendar). If your data is in a TPS backend, then the best way to optimize this is to make sure that the date component(s) used in the ORDER statement are contained in a key in the table used in the View. So in the above case the Yearly_Alerts table should have a key with the following structure:

KeyAlertDate       key(YAlerts:Alert_date,YAlerts:AnotherField),DUP

The key can have other components after the above two, but the key detail is that the fields used in the ORDER statement of the view must appear in order as the primary components of the ORDER statement.

Next thing is to place a handcoded filter statement just after the view open so that only the records in the date range required are loaded (see 2.9. Can I use prop:filter on my HotDates views? for more details on where to put this statement):

DatesView:1{prop:filter} = 'YAlerts:Alert_date >= ' & self.firstdate & ' and YAlerts:Alert_date <= ' & self.lastdate

Note: Don't be tempted to use Clarion commands in the filter statement (like inrange) - because these will be very inefficient for SQL processing (if you decide to convert your application to SQL at a later stage).

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
  case pID[1:4]
  of '[Cut'  
      !Cutting
  of '[Cop'
   !Copying
  else   
    !Dropping
  end


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 keep the double-click drill down/up, but disable the popup menu?

Answer: The easiest is to put a case/if-statement around the popup menu addition in the embed code (this is in the ThisWindow.init code):



2.20. 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:

  1. That the tables that you are using are correctly setup in the Table Schematic. If you look at the legdemo example app, you'll see that the TripLog is the primary table (this has the dates in it) - and the relating table (Vehicles) is a secondary table. The relationship between the Dates (i.e. the TripLog) and the legend (i.e. the Vehicles) is established through the table relationship of these 2 files. This relationship (i.e. between calendar dates and the legend) must be established in order for it (the HotDates calendar) to work.
  2. That the tables do in fact have data in the date range that you are viewing.

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.

3.5. How do I call a PrintPreviewer when printing my calendar?

Answer: Create your previewer procedure. It must receive a PrintPreviewFileQueue type for the first parameter and a Report type for the second parameter. It must return 1 to print the report, and 0 to cancel. In your calendar procedure, select the Print Previewer procedure on the options tab of the HotDates calendar template.

3.6. How do I drilldown on double-click?

Answer: You need to set your drill down procedure in the Calendar template (on the Options tab), and check the "Double-click to Drill down" checkbox.



You must also add the Calendar Update Controls to the window (hide the buttons and disable the edit options if no editing is required).

3.7. How do I trap a click on the calendar to refresh some data?

On the TakeNewSelection method (after the parent call), you can enter your code to populate the data:



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 totaling (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).

4.5. I want a AllDayEvent field (so that I don't need to stipulate time for certain events). How do I implement this?

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 clarion\accessory\libsrc\win\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.

4.11 How do I fix the column widths to a specific value?

Answer:
You need to code the following at the end of the ThisWindow.init method:

ThisScheduler.RootWidth = <YourColumnwidth>
ThisScheduler.ZoomChanged(0)

You might also want to disable/hide the zoom in and zoom out buttons.

4.12 How do I post a double-click event from the calendar to a control?

Answer:
In the Scheduler template's prompts (on the options tab), you must set the control to receive the event:



You can use the clickdate, and clicktime properties to post to your routine. Upon returning from the procedure, you can use the ThisScheduler.refresh(1) to force a refresh if your routine changes data.

You must also add the Calendar Update Controls to the window (hide the buttons and disable the edit options if no editing is required).

4.14 If I go to the form from the scheduler and change the date of the calendar item there, how do I change to the new date of the item after closing the form?

Answer:
In your form, return the change date variable, and then in the calendar, immediately after calling the form (if returns with requestcompleted), check if the date has changed, reload the data, and then reset the calendar:

If NewStartDate <> pStartDate  !NewStartDate is the date returned from the form.
  pStartDate = NewStartDate
  ThisScheduler6.LoadData()
  ThisScheduler6.ChangeDateTo(NewStartDate)
End
ThisScheduler6.reset(1)

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. First - if you have Replicate added to this application, then turning off Replicate during the LoadData method will make a significant impact on loading time. You can do this in your HotDates control template's Options tab.
  2. If you don't have Replicate added, or you are still not satisfied with the speed that your calendar loads, check that you don't have a filecallback on any of your tables used in the calendar template's tables (this could be a 3rdparty template).
  3. You can optimise the way the data is read in a couple of easy steps - provided that your child files have a Date component in a Key with the relating parent fields in it.
    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:

        if p_Row = 1 then
          MySavedRows = self.rows
          self.rows = 1


    ! Parent Call
        ReturnValue = PARENT.GetColumnHeader (p_Col,p_Row)
    ! [Priority 6000]


          self.rows = MySavedRows
        end



    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:
    YourStyleArrayToStoreOriginalStyleSizes long,dim[255]
    In your MonthClass.PrintNow method (before the parent call):
    loop x = 1 to 255
    get(self.style,x)
    if errorcode() then break .
    YourStyleArrayToStoreOriginalStyleSizes[x] = self.styles.FontSize
    self.styles.FontSize = 4 (or whatever)
    put(self.style)
    end


    In your MonthClass.PrintNow method (after the parent call):
    loop x = 1 to 255
    get(self.style,x)
    if errorcode() then break .
    self.styles.FontSize = YourStyleArrayToStoreOriginalStyleSizes[x]
    put(self.style)
    end

    Compile and Trappable Runtime Errors associates with HotDates


    1. assertion failed screenshot

      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. multiple date picker error screenshot

      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. multi- DLL date picker error screenshot
      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. runtime error screenshot

      This is not a HotDates error per se, but can occur in one of your HotDates windows if it does not have the MDI-child attribute turned on.

    7. error editor screenshot

      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:

      No Key In Year Calender Table Broken screenshotNo Key In Year Calender Table Fix screenshot

License & Copyright

This template is copyright © 2013 by CapeSoft Software. None of the included files may be distributed. Your programs which use HotDates can be distributed without any HotDates royalties.

This product is provided as-is. Use it entirely at your own risk. Use of this product implies your acceptance of this, along with the recognition of copyright stated above. In no way will CapeSoft Software, their employees or affiliates be liable in any way for any damages or business losses you may incur as a direct or indirect result of using this product.

Source Code Policy

We have chosen to ship HotDates as source code, rather than as a compiled DLL. This makes it much easier for you to modify, but it also makes it much easier for you to pirate. We ask you to please consider the effort involved in writing this product, before you choose to hand it on to any other developers.

If you received this program illegally (i.e. if you didn't pay for it, or you didn't buy it from CapeSoft, ClarionShop, or one of their respective dealers) then we ask you to contact us so that we can remedy this situation. Without the revenue generated from products such as this it is impossible for us to create new products.
This next bit is optional - and is included for the benefit of programmers wishing to inspect, or alter, the HotDates object.

We welcome any suggestions from users regarding new features that might be added to HotDates.
CapeSoft Support
Email
Telephone +27 87 828 0123
Fax +27 21 715 2535
Post PO Box 511, Plumstead, 7801, Cape Town, South Africa
HotDates may be purchased from:
CapeSoft Sales
Web www.capesoft.com
Email sales at capesoft dot com
Telephone +27 87 828 0123
Fax +27 21 715 2535
Post PO Box 511, Plumstead, 7801, Cape Town, South Africa
Buy Online
Web Buy now at ClarionShop
www.clarionshop.com

Installation

Run the supplied installation file.

What the Users are saying about HotDates

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 accessory 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 usual the docs wipe out any confusion. Keep OOP the good work!

Version History

Download latest version here

Version 2.01 : Released 24 May 2021 Version 2.00 : Released 8 September 2020 Version 1.99 : Released 17 March 2020 Version 1.98 : Released 18 Sept 2018 Version 1.97 : Released 16 March 2016 Version 1.96 : Released 7 February 2016 Version 1.95 : Released 25 February 2015 Version 1.94 : Released 16 January 2014 Version 1.93 : Released 21 October 2013 Version 1.92 : Released 10 October 2013 Version 1.91 : Released 7 October 2013

 

Version 1.90 Gold: Released  30 May 2013 Version 1.89 Gold: Released  2 May 2013 Version 1.88 Gold: Released  2 May 2013 Version 1.87 Gold: Released  14 March 2013
Version 1.86 Gold: Released 4 January 2013
Version 1.85 Gold: Released 17 November 2010 Version 1.84 Gold: Released 9 November 2010 Version 1.83 Gold: Released 9 September 2010 Version 1.82 Gold: Released 3 September 2010 Version 1.81 Gold: Released 31 August 2010 Version 1.80 Gold: Released 16 August 2010 Version 1.79 Gold: Released 24 May 2010 Version 1.78 Gold: Released 31 August 2009 Version 1.77 Gold: Released 20 April 2009 Version 1.76 Gold: Released 17 April 2009 Version 1.75 Gold: Released 13 January 2009 Version 1.74 Gold: Released November 10, 2008 Version 1.73 Gold: Released September 23, 2008 Version 1.72 Gold: Released September 20, 2008 Version 1.70 Gold: Released November 21, 2006 Version 1.69 Gold: Released November 8, 2006 Version 1.68 Gold: Released August 1 , 2006 Version 1.67 Gold: Released July 28 , 2006 Version 1.66 Gold: Released July 24 , 2006 Version 1.65 Gold: Released July 5 , 2006 Version 1.64 Gold: Released June 30 , 2006 Version 1.63 Gold: Released June 22 , 2006 Version 1.62 Gold: Released June 5 , 2006 Version 1.61 Gold: Released May 29 , 2006 Version 1.60 Gold: Released May 22 , 2006 Version 1.59 Gold: Released March 22 , 2006 Version 1.58 Gold: Released January , 2006 Version 1.57 Gold: Released December 9, 2005 Version 1.56 Gold: Released December 7, 2005 Version 1.55 Gold: Released November 3, 2005 Version 1.54 Gold: Released October 19, 2005 Version 1.53 Gold: Released October 6, 2005 Version 1.52 Gold: Released August 23, 2005

NB: You will need to re-import the DatePicker windows (using the ImportHotDatesDatePicker Template utility) Version 1.51 Gold: Released August 10, 2005 Version 1.50 Gold: Released August 5, 2005 Version 1.38 Beta: Released July 28, 2005 Version 1.37 Beta: Released July 27, 2005 Version 1.36 Beta: Released July 22, 2005 Version 1.35 Beta: Released July 20, 2005 Version 1.34 Beta: Released July 6, 2005 Version 1.33 Beta: Released July 5, 2005 Version 1.32 Beta: Released July 1, 2005 Version 1.31 Beta: Released June 21, 2005 Version 1.29 Beta: Released April 29, 2005 Version 1.28 Beta: Released April 25, 2005 Version 1.27 Beta: Released April 20, 2005 Version 1.26 Beta: Released April 18, 2005 Version 1.25 Beta: Released April 14, 2005

Basically this release contains fixes to regressions in v1.24 Version 1.24 Beta: Released April 14, 2005

Basically this release contains some improvements to the Planner template. Also in the MonthViewer: In all templates: Version 1.23 Beta: Released April 6, 2005

Basically this release is a fix for some regressions that have crept in as well as a bit of class restructuring that was required. Here are some details: Version 1.22 Beta: Released April 4, 2005 Version 1.21 Beta: Released March 16, 2005 Version 1.20 Beta: Released March 15, 2005 Version 1.19 Beta: Released March 11, 2005 Version 1.18 Beta: Released March 10, 2005 Version 1.17 Beta: Released March 9, 2005 Version 1.16 Beta: Released March 8, 2005 Version 1.15 Beta: Released February 15, 2005 Version 1.14 Beta: Released February 11, 2005 Version 1.13 Beta: Released February 8, 2005 Version 1.12 Beta: Released January 5, 2005

What's Changed: Details Version 1.11 Beta: Released December 3, 2004

What's Changed: Version 1.10 Beta: Released November 15, 2004

What's Changed: Version 1.09 Beta: Released November 15, 2004

What's Changed: Version 1.08 Beta: Released October 27, 2004

What's Changed: Version 1.07 Beta: Released October 26, 2004

What's Changed: Version 1.06 Beta: Released October 22, 2004

What's Changed: Version 1.05 Beta: Released October 19, 2004

What's Changed: Version 1.04 Beta: Released October 18, 2004
What's Changed: Version 1.03 Beta: Released October 5, 2004

What's Changed: Version 1.02 Beta: Released September 17, 2004

What's Changed: Version 1.01 Beta: Released September 17, 2004

What's Changed: Details: Version 1.00 Beta: Released September 14, 2004