|
|
|
|
|
- Overview
- Manipulating Organizer controls programmatically
- Adding an appointment
- Filling an Organizer control with the data found in an HFSQL data file
- Retrieving a list of appointments
- Displaying an Organizer control from a specific date
- Deleting an appointment
- Modifying the control display options
- Using the context menu (AAF)
- Possibilities of the context menu
- Advanced use of events with procedures
- Management of public holidays
- Properties specific to Organizer controls
Manipulating Organizer controls programmatically (prefix syntax)
An Organizer control can be: WINDEV and WEBDEV include the OrganizerXXX functions to manipulate Organizer controls. This help page explains how to programmatically manipulate an Organizer control in a window or page. The example used in the illustration allows you to store appointments in an HFSQL database.
Manipulating Organizer controls programmatically Adding an appointment - syntax used to specify the appointment characteristics: title, description, etc.
// Adds an appointment to the Organizer control ORG_MyOrganizer.AddAppointment("Sales meeting", "201003220845", ... "201003221230", "Sales") - syntax that handles a variable of type Appointment.
// Declares an Appointment variable MyAppointment is Appointment // Fills the appointment MyAppointment.Title = "Sales meeting" MyAppointment.Content = "Meeting to discuss the weekly objectives." MyAppointment.StartDate = "201003220845" MyAppointment.EndDate = "201003221230" MyAppointment.Category = "Sales" MyAppointment.ID = 1 // Adds the appointment into the control ORG_Organizer.AddAppointment(MyAppointment)
The BackgroundColor property of the Appointment variable is used to define a display color for an appointment. If no background color is defined, the Organizer control will automatically use the color associated with the appointment category. Filling an Organizer control with the data found in an HFSQL data file The records are stored in an HFSQL data file. The Organizer control can be initially filled by browsing the data file via the FOR EACH syntax and by adding each appointment via <Organizer>.AddAppointment.
// Appointment variable MyAppointment is Appointment // Browse through the appointments stored in the database FOR EACH APT // Fills the information of the variable MyAppointment.Title = APT.Title MyAppointment.Content = APT.Content MyAppointment.StartDate = APT.StartDate MyAppointment.EndDate = APT.EndDate MyAppointment.Category = APT.Category MyAppointment.ID = APT.APTID Â // Adds the appointment to the Organizer control ORG_MyOrganizer.AddAppointment(MyAppointment) Â END Reminder: You also have the ability to use an Organizer control linked to a data file. For more details, see Organizer control linked to a data file.Retrieving a list of appointments - the list of all appointments in the Organizer control:
// Array containing a list of Appointment arrAppointmentList is array of Appointment // Lists of appointments arrAppointmentList = ORG_MyOrganizer.ListAppointment() - the list of appointments included between two dates:
// List of appointments for January 2010 arrAppointmentList is array of Appointment // Lists of appointments arrAppointmentList = ORG_MyOrganizer.ListAppointment("20100101", "20100131") - the appointment currently selected or hovered:
// Selected appointment arrAppointmentList is array of Appointment arrAppointmentList = ORG_MyOrganizer.ListAppointment(orgAptSelected)
Displaying an Organizer control from a specific date To display the Organizer control from a specific date, use <Organizer>.Position.
// Positions the organizer on today's date ORG_Organizer1.Position(Today()) // Positions the organizer on December 20, 2012 ORG_Organizer1.Position("20121220") Deleting an appointment - the appointment selected in the control.
- a specific appointment.
// Deletes the first appointment ORG_MyOrganizer.DeleteAppointment(1) <Organizer>.DeleteAll deletes all the appointments from the Organizer control. Modifying the control display options The current display of an Organizer control can be modified by the following functions: Using the context menu (AAF) Management of public holidays Public holidays can be set programmatically. Several WLanguage functions (starting with BankHolidayXXX) are available. To define the bank holidays displayed in the Organizer controls and in the Calendar controls, you must use BankHolidayAdd. This function allows you to define the list of public holidays to be used. This function allows you to customize the public holidays according to the country and local regulations. This function must be used at the beginning of the application because it has a global effect on the application. The bank holidays will be colored in green in the Organizer control. Example:
// Delete all public holidays BankHolidayDeleteAll() // Initialize the 11 public holidays common to the French regions and territories BankHolidayAdd("0101") // 1st of January BankHolidayAdd(bhEasterMonday) // Easter Monday BankHolidayAdd("0501") // 1st of May BankHolidayAdd("0508") // 8th of May BankHolidayAdd(bhAscensionDay) // Ascension day BankHolidayAdd(bhWhitMonday) // Whit Monday BankHolidayAdd("0714") // 14th of July BankHolidayAdd("0815") // 15th of August (Assumption) BankHolidayAdd("1101") // All Saints' Day BankHolidayAdd("1111") // 11th of November BankHolidayAdd("1225") // Christmas  // Add 2 additional public holidays for the regions of Moselle and Alsace BankHolidayAdd("1226" + CR + bhGoodFriday) Properties specific to Organizer controls The following properties can be used to manipulate Organizer controls.
| | DirectInputAPT | The DirectInputAPT property is used to determine and specify if the user can directly change the title of an appointment in a Scheduler or Organizer control. | GranularityAppointment | The GranularityAppointment gets and changes the precision of the grid used to define appointments in Organizer or Scheduler controls.
Property kept for backward compatibility. | GranularityDuration | The GranularityDuration property is used to get and change the size of the grid to resize:- appointments in an Organizer control.
- appointments in a Scheduler control.
- events in a TimeLine control.
- tasks in a Gantt Chart column.
| GranularityMovement | The GranularityMovement property is used to get and change the size of the grid to move: - appointments in an Organizer control.
- appointments in a Scheduler control.
- events in a TimeLine control.
- tasks in a Gantt Chart column.
| MaskTitleDate | The MaskTitleDate property is used to identify and change the input mask used for the title of day columns in Organizer or Scheduler controls | ModificationDurationAPT | The ModificationDurationAPT property is used to determine and specify if the user can modify the duration of an appointment in a Scheduler or Organizer control. | MovementAPT | The MovementAPT property allows you to know and specify whether users can move appointments in a Scheduler or Organizer control. | Num1stDayOfTheWeek | The Num1stDayOfTheWeek property gets and sets the 1st day of the week displayed in:- a Calendar control.
- an Organizer control.
- a Scheduler control.
- an Edit control in Date format with Calendar.
| PeriodSelection | The PeriodSelection property is used to determine and specify if the user can select a time period in an Scheduler or Organizer control. | WorkingHourEnd | The WorkingHourEnd property is used to identify and change the end time of working hours used:- by an Organizer control.
- by a Scheduler control.
- by a Gantt Chart column (in a Table or TreeView Table control).
| WorkingHourStart | The WorkingHourStart property is used to get and change the start time of working hours used: - by an Organizer control.
- by a Scheduler control.
- by a Gantt Chart column (in a Table or TreeView Table control).
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|