Added cursor position to item class.
This commit is contained in:
+10
-1
@@ -38,9 +38,11 @@ class NWItem():
|
|||||||
self.itemStatus = 0
|
self.itemStatus = 0
|
||||||
self.isExpanded = False
|
self.isExpanded = False
|
||||||
|
|
||||||
|
# Document Meta Data
|
||||||
self.charCount = 0
|
self.charCount = 0
|
||||||
self.wordCount = 0
|
self.wordCount = 0
|
||||||
self.paraCount = 0
|
self.paraCount = 0
|
||||||
|
self.cursorPos = 0
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -64,6 +66,7 @@ class NWItem():
|
|||||||
xSub = self._subPack(xPack,"charCount", text=str(self.charCount), none=False)
|
xSub = self._subPack(xPack,"charCount", text=str(self.charCount), none=False)
|
||||||
xSub = self._subPack(xPack,"wordCount", text=str(self.wordCount), none=False)
|
xSub = self._subPack(xPack,"wordCount", text=str(self.wordCount), none=False)
|
||||||
xSub = self._subPack(xPack,"paraCount", text=str(self.paraCount), none=False)
|
xSub = self._subPack(xPack,"paraCount", text=str(self.paraCount), none=False)
|
||||||
|
xSub = self._subPack(xPack,"cursorPos", text=str(self.cursorPos), none=False)
|
||||||
return xPack
|
return xPack
|
||||||
|
|
||||||
def _subPack(self, xParent, name, attrib=None, text=None, none=True):
|
def _subPack(self, xParent, name, attrib=None, text=None, none=True):
|
||||||
@@ -90,6 +93,7 @@ class NWItem():
|
|||||||
elif tagName == "charCount": self.setCharCount(tagValue)
|
elif tagName == "charCount": self.setCharCount(tagValue)
|
||||||
elif tagName == "wordCount": self.setWordCount(tagValue)
|
elif tagName == "wordCount": self.setWordCount(tagValue)
|
||||||
elif tagName == "paraCount": self.setParaCount(tagValue)
|
elif tagName == "paraCount": self.setParaCount(tagValue)
|
||||||
|
elif tagName == "cursorPos": self.setCursorPos(tagValue)
|
||||||
else:
|
else:
|
||||||
logger.error("Unknown tag '%s'" % tagName)
|
logger.error("Unknown tag '%s'" % tagName)
|
||||||
return
|
return
|
||||||
@@ -166,7 +170,7 @@ class NWItem():
|
|||||||
return
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
# Set Stats
|
# Set Document Meta Data
|
||||||
##
|
##
|
||||||
|
|
||||||
def setCharCount(self, theCount):
|
def setCharCount(self, theCount):
|
||||||
@@ -184,4 +188,9 @@ class NWItem():
|
|||||||
self.paraCount = theCount
|
self.paraCount = theCount
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def setCursorPos(self, thePosition):
|
||||||
|
thePosition = checkInt(thePosition,0)
|
||||||
|
self.cursorPos = thePosition
|
||||||
|
return
|
||||||
|
|
||||||
# END Class NWItem
|
# END Class NWItem
|
||||||
|
|||||||
Reference in New Issue
Block a user