|
- Overview
- Handling the Organizer control by programming
- Adding an appointment
- Filling an Organizer control with the data found in a HFSQL data file
- Retrieving a list of appointments
- Displaying an Organizer control from a specific date
- Delete an appointment
- Modifying the display of the control
- Using the popup menu (AAF)
- Possibilities of the popup menu
- Advanced use of events with procedure
- Managing bank holidays
- Properties specific to the Organizer controls
Handling an Organizer control by programming
An Organizer control can be: To handle an Organizer control by programming, WINDEV and WEBDEV propose the OrganizerXXX functions. This help page explains how to handle an Organizer control found in a window or in a page by programming. The example used in the illustration allows you to store appointments in an HFSQL database. Versions 24 and later New in version 24 Remark: From version 19, HFSQL is the new name of HyperFileSQL. Versions 18 and later New in version 18 Handling the Organizer control by programming Adding an appointment Adding an appointment into an Organizer control is performed by OrganizerAddAppointment. This function accepts two syntaxes: - syntax used to specify the appointment characteristics: title, description, ...
// Adds an appointment into the Organizer control OrganizerAddAppointment(ORG_MyOrganizer, "Sales meeting", "201003220845", ... "201003221230", "Sales")
- syntax handling 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 OrganizerAddAppointment(ORG_Organizer, MyAppointment)
The property ...BackgroundColor of the variable Appointment allows you 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 a HFSQL data file The records are stored in a 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 OrganizerAddAppointment.
// 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 OrganizerAddAppointment(ORG_MyOrganizer, MyAppointment) END
Reminder: You also have the ability to use an Organizer control linked to a data file. See Organizer control linked to a data file for more details.Retrieving a list of appointments - the list of all appointments found in the Organizer control:
// Array containing a list of Appointment arrAppointmentList is array of Appointment // Lists of appointments arrAppointmentList = OrganizerListAppointment(ORG_MyOrganizer)
- the list of appointments included between two dates:
// List of appointments for January 2010 arrAppointmentList is array of Appointment
// Lists of appointments arrAppointmentList = OrganizerListAppointment(ORG_MyOrganizer, "20100101", "20100131")
- the appointment currently selected or hovered:
// Selected appointment arrAppointmentList is array of Appointment
arrAppointmentList = OrganizerListAppointment(ORG_MyOrganizer, orgAptSelected)
Displaying an Organizer control from a specific date To display the Organizer control from a specific date, use OrganizerPosition.
// Position the Organizer control on today's date OrganizerPosition(ORG_Organizer1, Today()) // Position the Organizer control on December 20, 2012 OrganizerPosition(ORG_Organizer1, "20121220")
Delete an appointment - the appointment selected in the control.
- a specific appointment.
// Deletes the first appointment OrganizerDeleteAppointment(ORG_MyOrganizer, 1)
OrganizerDeleteAll is used to delete all the appointments found in the Organizer control. Modifying the display of the control The current display of an Organizer control can be modified by the following functions: Using the popup menu (AAF) The bank holidays are managed by programming. 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 bank holidays that will be used. This function allows you to customize the bank holidays according to the country and to the 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 bank holidays BankHolidayDeleteAll() // Initialize the 11 bank holidays common to the French regions and to the French 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 bank holidays for the regions of Moselle and Alsace BankHolidayAdd("1226" + CR + bhGoodFriday)
Properties specific to the Organizer controls The following properties are used to manage an Organizer control by programming.
| | DirectInputAPT | ..DirectInputAPT is used to find out and specify whether a user can directly modify the title of an appointment in an Organizer or Scheduler control. | GranularityAppointment | ..GranularityAppointment allows you to find out and modify the precision of the grid used by the Organizer control or by the Scheduler control to define the appointments.
Property kept for backward compatibility. | GranularityDuration | ..GranularityDuration allows you to find out and modify the size of the grid used to resize:- the appointments of an Organizer control.
- the appointments of a Scheduler control.
- the events of a TimeLine control.
- the tasks found in a Gantt Chart column.
| GranularityMovement | ..GranularityMovement is used to find out and modify the size of the grid used to move: - the appointments of an Organizer control.
- the appointments of a Scheduler control.
- the events of a TimeLine control.
- the tasks found in a Gantt Chart column.
| MaskTitleDate | ..MaskTitleDate is used to find out and modify the mask used for the title of the day columns in an Organizer control or in a Scheduler control. | ModificationDurationAPT | ..ModificationDurationAPT allows you to find out and specify whether the user can modify the duration of an appointment in a Scheduler or Organizer control. | MovementAPT | ..MovementAPT is used to find out and specify whether the user can move an appointment in a Scheduler control or in an Organizer control. | Num1stDayOfTheWeek | ..Num1stDayOfTheWeek is used to find out and modify 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 | ..PeriodSelection is used to find out and indicate whether the user can select a period in a Scheduler control or in an Organizer control. | WorkingHourEnd | ..WorkingHourEnd is used to find out and modify the end time of the working hours used:- by an Organizer control.
- by a Scheduler control.
- by a Gantt Chart column (in a Table or TreeView Table control).
| WorkingHourStart | ..WorkingHourStart is used to find out and modify the start time of the 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…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |