Skip to content

Commit 798db37

Browse files
committed
Allows drag dialog grabbed points to be changed before OK
1 parent 22065af commit 798db37

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

.pydevproject

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@
66
<path>/AndroidViewClient/src</path>
77
<path>/AndroidViewClient/examples</path>
88
</pydev_pathproperty>
9-
<pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
10-
<path>/usr/local/lib/python2.7/site-packages/PIL</path>
11-
</pydev_pathproperty>
9+
1210
</pydev_project>

src/com/dtmilano/android/culebron.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
limitations under the License.
1717
1818
@author: Diego Torres Milano
19+
1920
'''
2021

21-
__version__ = '8.12.3'
22+
__version__ = '8.12.4'
2223

2324
import sys
2425
import threading
@@ -831,6 +832,9 @@ def onGrabEp(self):
831832
def onGrab(self, entry):
832833
'''
833834
Generic grab method.
835+
836+
@param entry: the entry being grabbed
837+
@type entry: Tkinter.Entry
834838
'''
835839

836840
self.culebron.setOnTouchListener(self.onTouchListener)
@@ -840,9 +844,12 @@ def onGrab(self, entry):
840844
def onTouchListener(self, point):
841845
'''
842846
Listens for touch events and draws the corresponding shapes on the Culebron canvas.
843-
If the starting point is being grabbed it draws the toucing point via
847+
If the starting point is being grabbed it draws the touching point via
844848
C{Culebron.drawTouchedPoint()} and if the end point is being grabbed it draws
845849
using C{Culebron.drawDragLine()}.
850+
851+
@param point: the point touched
852+
@type point: tuple
846853
'''
847854

848855
x = point[0]
@@ -852,9 +859,11 @@ def onTouchListener(self, point):
852859
self.onValidate(value)
853860
self.culebron.setGrab(False)
854861
if self.__grabbing == self.sp:
862+
self.__cleanUpSpId()
855863
self.spX = x
856864
self.spY = y
857865
elif self.__grabbing == self.ep:
866+
self.__cleanUpEpId()
858867
self.epX = x
859868
self.epY = y
860869
if self.spX and self.spY and not self.spId:
@@ -864,11 +873,19 @@ def onTouchListener(self, point):
864873
self.__grabbing = None
865874
self.culebron.setOnTouchListener(None)
866875

867-
def cleanUp(self):
876+
def __cleanUpSpId(self):
868877
if self.spId:
869878
self.culebron.canvas.delete(self.spId)
879+
self.spId = None
880+
881+
def __cleanUpEpId(self):
870882
if self.epId:
871883
self.culebron.canvas.delete(self.epId)
884+
self.epId = None
885+
886+
def cleanUp(self):
887+
self.__cleanUpSpId()
888+
self.__cleanUpEpId()
872889

873890

874891
class HelpDialog(Tkinter.Toplevel):

0 commit comments

Comments
 (0)