Hello Stani & NG,
I implemented drag and drop functionality in SPE. However there is
problem. I need to be able to veto specific drag and drop events. Is
this possible?
I have added some lines to the DnD event in NotebookCtrl, and now is
possible to "veto" the DnD event. Basically, you should Bind() the
wxEVT_NOTEBOOKCTRL_PAGE_DND event in your application and, based on your
specific DnD events, you can do something like:
# Bound Event To OnDnD() Method
def OnDnD(self, event):
old = event.GetOldPosition()
new = event.GetNewPosition()
# Show How To Veto DnD On ScrolledWindow Tab
# ==> If You Don't Call event.Skip(), The DnD Event Is Vetoed <===
if self.nb.GetPageText(old) == "ScrolledWindow":
self.log.write("OnPageDnD: Tab 'ScrolledWindow' Can Not Be
Moved ;-)\n")
return
self.log.write('OnPageDnD: Old:%d, New:%d\n' % (old, new))
event.Skip()
I have added this to the demo, in order to show how to veto a particular
DnD event. At the moment the NotebookCtrl file is not complete, because the
Reparenting() issue is still in progress (!). However, Stani, if you need
this modifications now for SPE, I will try to send you a patch to handle
vetoing of DnD events.
Andrea.
···
_______________________________________________
Andrea Gavana
Reservoir Engineer
MOGI ? Reservoir Characterization and Modeling Dept.
ENI S.p.A. ? Exploration & Production Division
Via Emilia, 1 ? 20097 San Donato Milanese (MI) ? Italy
Phone: +39 02 520 62972
Fax: +39 02 520 61824
E-mail: andrea.gavana@agip.it
Restyled Internet Site: http://xoomer.virgilio.it/infinity77/
____________________________________________________
Eni S.p.A.
Sede legale in Roma,
Piazzale Enrico Mattei 1, 00144 Roma
Tel. centralino: +39 06598.21
www.eni.it
Capitale sociale 4.002.934.326 i.v.
Registro Imprese di Roma,
Codice Fiscale 00484960588
Part. IVA 00905811006
R.E.A. Roma n. 756453