PDA

View Full Version : CalendarControl: Home-built dialogbox



Roel Westhoff [W4]
15-Feb-2010, 04:38 AM
Hello cjSig-Team,

We are trying to implement the calendar-control class in our own app.
Nice work. Thanks. It is a great help.

I have a few questions concerning the calendar-control.

Q1: When new event is added to the calendar the dialog-box seems to be a standard dialog. Is there a way to use a self-built one. We need to add few non-standard features to the calendar
Q2: In the newgroup there is talk about a rewrite of the calendar-class. What is the status of the project.

Roel Westhoff
W4 Software & Consultancy BV
Valkenswaard Netherlands

Renato Villa
15-Feb-2010, 05:36 AM
Hi Roel,

i create Event in the calendar from many View with different DataFile.

For example in a real estate apps i manage appointments from different Datafile (Contdet and Contric in the following code) that update the Calevent file.

In the Calendar view i use the following code



Procedure OnComDblClick
Integer iHitCode iEventID
Boolean bCheckBoxDblClick
Handle hoViewEvent hoEvent
Variant vViewEvent vEvent vProvider
Get ComDataProvider of oSigCJCalendarControl1 to vProvider
Handle hoDataProvider
Get Create u_cComCalendarDataProvider to hoDataProvider
Set pvComObject of hoDataProvider to vProvider
Get pb_DBLCLICK of oSigCJCalendarControl1 to bCheckBoxDblClick <-- checkbox for internal or external Dialog Box
Move (NullComObject()) to vViewEvent
Send GetHitCode (&vViewEvent) (&iHitCode)
If ((iHitCode = 1) or ;
(iHitCode = 8193)) Begin
Send Show_Built_In_Dialog eCal_Dialog_NewEvent vEvent //vEvent not need for NewEvent
End
If ((iHitCode = 32) or ;
(iHitCode = 8208) or ;
(iHitCode = 8224) or ;
(iHitCode = 9472) or ;
(iHitCode = 10496) or ;
(iHitCode = 16416)) Begin
//Now need the Event from the ViewEvent
Get Create U_cSigCjComCalendarViewEvent to hoViewEvent
Set pvComObject of hoViewEvent to vViewEvent
Get ComEvent of hoViewEvent to vEvent
Handle hoCalEvents
Get Create u_cSigCjComCalendarEvent to hoCalEvents
Set pvComObject of hoCalEvents to vEvent
Get ComId of hoCalEvents to iEventID
Clear CalEvent
Move iEventID to CalEvent.URN
Find eq CalEvent by Index.1
Send Destroy of hoViewEvent
If (bCheckBoxDblClick) Begin
Send On_Execute_DblClick
Procedure_Return
End
Send Show_Built_In_Dialog eCal_Dialog_EditEvent vEvent
End
End_Procedure

Procedure On_Execute_DblClick ////PROCEDURA AGGIUNTA
Clear Contdet
Handle hoFile
String sRowId
RowID riRowId
Boolean bFound
If CalEvent.RowID ne '' Begin
Move CalEvent.FileNumber to hofile
Open hoFile
Move (trim(CalEvent.RowID)) to sRowId
Move (DeserializeRowId (sRowID)) to riRowId
Clear hoFile
Move (FindByRowId(hoFile, riRowId)) to bFound
Register_Object Chiamate_Ass
Register_Object oContDet_dd
Register_Object Chiamate_dd
Register_Object oRichiesteView
Register_Object oContRic_dd
Register_Object Richiest_dd
If (hoFile eq Contdet.File_Number) Begin
Relate ContDet
Send request_assign of (oContDet_dd(oChiamate_Pervenute_N(Self))) hoFile
Send Activate_oChiamate_Pervenute_N
End
If (hoFile eq Contric.File_Number) Begin
Relate Contric
Send request_assign of (oContRic_dd(oRichiesteView(Self))) hoFile
Send Activate_oRichiesteView
End
End
If CalEvent.RowID le ' ' Send Stop_box ('Evento' * trim(CalEvent.Subject) * 'Non esiste nelle Chiamate. Verificare la selezione.')
End_Procedure




HTH

Regards

Martin
17-Feb-2010, 08:18 AM
The hooks for pointing events to your own table is in the classes; you should be fine using what is currently in the project, the new version is in progress and is mainly for resource management.