PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
New WINDEV, WEBDEV 23 feature!
  • 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
  • Deleting an appointment
  • Modifying the display of the control
  • Using the popup menu (AAF)
  • Possibilities of the popup menu
  • Advanced use of processes with procedure
  • Managing bank holidays
  • Properties specific to the Organizer controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
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 proposed in illustration is used to store the appointments in a HFSQL database.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 18 and later
WEBDEV - Server code The Organizer controls are now available for the WEBDEV sites (in Windows and Linux).
PHP The Organizer controls are now available for the PHP sites.
New in version 18
WEBDEV - Server code The Organizer controls are now available for the WEBDEV sites (in Windows and Linux).
PHP The Organizer controls are now available for the PHP sites.
WEBDEV - Server code The Organizer controls are now available for the WEBDEV sites (in Windows and Linux).
PHP The Organizer controls are now available for the PHP sites.
Handling the Organizer control by programming

Adding an appointment

Adding an appointment into an Organizer control is performed by <Organizer>.AddAppointment. This function accepts two syntaxes:
  • syntax used to specify the appointment characteristics: title, description, ...
    // Adds an appointment into the Organizer control
    ORG_MyOrganizer.AddAppointment("Sales meeting", "201003220845", ...
    "201003221230", "Sales")
  • syntax that is using an Appointment variable.
    // 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 ..BrushColor property of 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 a HFSQL data file

The records are stored in a HFSQL file. The initial fill of the Organizer control can be done by browsing the file via the FOR EACH syntax and by adding each appointment via <Organizer>.AddAppointment.
// Appointment variable
MyAppointment is Appointment
// Browse the appointments stored in 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
Versions 16 and later
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.
New in version 16
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.
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

<Organizer>.ListAppointment is used to retrieve:
  • 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 = 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

<Organizer>.DeleteAppointment is used to delete:
  • the appointment selected in the control.
  • a specific appointment.
// Deletes the first appointment
ORG_MyOrganizer.DeleteAppointment(1)
<Organizer>.DeleteAll 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)
WINDEV

Possibilities of the popup menu

The popup menu of Organizer control is used to:
  • modify the display mode of control,
  • add, modify or delete an appointment.
To save the operations performed, you must use the processes of Organizer control.
In the relevant process, all you have to do is retrieve the appointment currently used and perform the corresponding process.
Example: To store in an APT data file an appointment added by the user via the popup menu, all you have to do is enter in the "Enter the appointment in input" process:
PROCEDURE Edit(aptEdited is Appointment)

// Store the data
APT.Title = aptEdited..Title
APT.StartDate = aptEdited..StartDate
APT.EndDate = aptEdited..EndDate
...
HAdd(APT)
The same type of code can be implemented for the different processes of the Organizer control. Indeed, a procedure was automatically declared by the Organizer control for each control process that handles an appointment.
These procedures receive in parameter an Appointment variable affected by the process.
WINDEV

Advanced use of processes with procedure

You can also allow the user to define more precisely the characteristics of his appointment during an addition or a modification. To do so, create a window with the information to specify.
In the code, all you have to do is open the window in the "Enter the appointment in input" process. To lock the direct input via the popup menu of the organizer, the process must return False.
This principle can be applied to all the processes called by the popup menu of Organizer control.
Example:
PROCEDURE Edit(aptEdited is Appointment)

// Opens the window for entering an appointment
// with the selected appointment (in Creation or Modification mode)
Open(WIN_InputAPT_HFSQL, aptEdited)

// Returns False to lock the direct input in the Organizer control
RESULT False
Managing bank holidays
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.
Versions 17 and later
DirectInputAPT
New in version 17
DirectInputAPT
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.
Versions 15 and later
GranularityAppointment
New in version 15
GranularityAppointment
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.
Versions 16 and later
GranularityDuration
New in version 16
GranularityDuration
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.
Versions 16 and later
GranularityMovement
New in version 16
GranularityMovement
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.
Versions 16 and later
MaskTitleDate
New in version 16
MaskTitleDate
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.
Versions 15 and later
ModificationDurationAPT
New in version 15
ModificationDurationAPT
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.
Versions 17 and later
MovementAPT
New in version 17
MovementAPT
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.
Versions 15 and later
Num1stDayOfTheWeek
New in version 15
Num1stDayOfTheWeek
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.
Versions 17 and later
PeriodSelection
New in version 17
PeriodSelection
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.
Versions 15 and later
WorkingHourEnd
New in version 15
WorkingHourEnd
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).
Versions 15 and later
WorkingHourStart
New in version 15
WorkingHourStart
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).
To find out the entire list of WLanguage properties that can be used with an Organizer control, see Properties associated with the Organizer control.
Minimum required version
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment