AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Agenda
  • 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
  • Delete 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
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
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

You can add an appointment to an Organizer control using OrganizerAddAppointment. This function accepts two syntaxes:
  • syntax for specifying appointment features: title, description, etc..
    // Adds an appointment to the Organizer control
    OrganizerAddAppointment(ORG_MyOrganizer, "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
    OrganizerAddAppointment(ORG_Organizer, 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 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 It is also possible 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

OrganizerListAppointment is used to retrieve:
  • the list of all the 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())
// Set Organizer control to December 20, 2022
OrganizerPosition(ORG_Organizer1, "20221220")

Delete an appointment

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

Possibilities of the context menu

The context menu of Organizer control is used to:
  • change the control display mode,
  • add, modify or delete an appointment.
To save the operations performed, you must use the events of Organizer control.
In the corresponding event, simply retrieve the appointment currently used and perform the corresponding process.
Example To store an appointment added by the user via the context menu in an RDV data file, simply enter the following in the "Enter appointment" event:
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 used for the different events of the Organizer control. Indeed, a procedure has been automatically declared by the Organizer control for each event in the control that handles an appointment.
These procedures take an Appointment variable as parameter. This variable contains the characteristics of the appointment used by the event.
WINDEVAndroidiPhone/iPad

Advanced use of events with procedures

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, simply open the window in the "Entry in edit in an appointment" event. To lock the direct input via the context menu of the organizer, the event must return False.
This principle can be applied to all the events called by the context menu of the 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
RETURN False
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.
DirectInputAPTLa propiedad DirectInputAPT se utiliza para determinar y especificar si el usuario puede cambiar directamente el título de una cita en un control Planificador u Organizador.
GranularityAppointmentThe GranularityAppointment gets and changes the precision of the grid used to define appointments in Organizer or Scheduler controls. Property retained by compatibility.
GranularityDurationThe GranularityDuration property gets and sets 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.
GranularityMovementThe GranularityMovement property gets and sets 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.
MaskTitleDateThe MaskTitleDate property is used to identify and change the input mask used for the title of day columns in Organizer or Scheduler controls
ModificationDurationAPTThe ModificationDurationAPT property is used to determine and specify if the user can modify the duration of an appointment in a Scheduler or Organizer control.
MovementAPTLa propiedad MovementAPT permite saber y especificar si los usuarios pueden mover citas en un control Planificador o Agenda.
Num1stDayOfTheWeekLa propiedad Num1stDayOfTheWeek obtiene y establece el primer día de la semana que se muestra en:
  • un control Calendario.
  • un control Agenda.
  • un control Planificador.
  • un control Campo de entrada en formato de fecha con calendario.
PeriodSelectionLa propiedad PeriodSelection se utiliza para determinar y especificar si el usuario puede seleccionar un periodo de tiempo en un control Planificador u Organizador.
WorkingHourEndLa propiedad WorkingHourEnd se utiliza para identificar y modificar la hora de finalización de las horas de trabajo utilizadas:
  • por un control Agenda.
  • mediante un control Planificador.
  • por una columna Diagrama de Gantt (en un control Tabla o TreeView Table).
WorkingHourStartLa propiedad WorkingHourStart obtiene y establece la hora de inicio de las horas de trabajo utilizadas:
  • por un control Agenda.
  • mediante un control Planificador.
  • por una columna Diagrama de Gantt (en un control Tabla o TreeView Table).
For a complete list of WLanguage properties that can be used with Organizer controls, see Organizer control properties.
Versión mínima requerida
  • Versión 16
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 14/12/2024

Señalar un error o enviar una sugerencia | Ayuda local