Print Page | Close Window

Disable in-place delete of events

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=15908
Printed Date: 12 May 2024 at 6:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Disable in-place delete of events
Posted By: corrado
Subject: Disable in-place delete of events
Date Posted: 21 December 2009 at 8:20pm
Is it possible to disable only deleting of selected event by pressing DELETE key (or at least having a confirmation message before deletion)?
I want to be able to add and edit events by clicking calendar.
 
Thank you



Replies:
Posted By: wlcabral
Date Posted: 23 December 2009 at 5:40pm

Try the code bellow (written in FOXPRO) in BeforeEditOperation event

 

Pocedure BeforeEditOperation

parameters opparams, bcanceloperation

 

Do Case

                    Case opparams.operation = xtpCalendarEO_DragMove Or ;

                                         opparams.operation = xtpCalendarEO_DragResizeBegin

                    Case opparams.operation = xtpCalendarEO_InPlaceCreateEvent

                                        This.Parent.lInPlaceCreatingEvent = .T.

                    Case opparams.operation = xtpCalendarEO_DeleteSelectedEvents

                                        If opparams.EventViews.Count > 1

                                                            cMsg = "deseja excluir os eventos selecionados"

                                        Else

                                                            cMsg = "deseja excluir o evento selecionado"

                                        Endif

                                        If Messagebox(cMsg,4+32) != 6

                                                            bcanceloperation = .T.

                                        endif

                                        This.Parent.lInPlaceCreatingEvent = .F.

                    otherwise

                                       

Endcase                                                                                             



-------------
wlcabral


Posted By: corrado
Date Posted: 23 December 2009 at 8:41pm
wlcabral,
 
Thanks a lot for your advice.
At the moment I use KeyDown event to filter Delete key pressed and that works fine for me.
Your solution must be better and I will give it a try later on.
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net