|
@@ -28,6 +28,8 @@ class DirectEntry(DirectFrame):
|
|
|
('width', 10, self.setup),
|
|
('width', 10, self.setup),
|
|
|
('numLines', 5, self.setup),
|
|
('numLines', 5, self.setup),
|
|
|
('focus', 0, self.setFocus),
|
|
('focus', 0, self.setFocus),
|
|
|
|
|
+ ('cursorKeys', 0, self.setCursorKeysActive),
|
|
|
|
|
+ ('backgroundFocus', 0, self.setBackgroundFocus),
|
|
|
# Text used for the PGEntry text node
|
|
# Text used for the PGEntry text node
|
|
|
# NOTE: This overrides the DirectFrame text option
|
|
# NOTE: This overrides the DirectFrame text option
|
|
|
('initialText', '', INITOPT),
|
|
('initialText', '', INITOPT),
|
|
@@ -81,12 +83,15 @@ class DirectEntry(DirectFrame):
|
|
|
def setup(self):
|
|
def setup(self):
|
|
|
self.node().setup(self['width'], self['numLines'])
|
|
self.node().setup(self['width'], self['numLines'])
|
|
|
|
|
|
|
|
- def setFont(self):
|
|
|
|
|
- self.onscreenText.setFont(self['font'])
|
|
|
|
|
-
|
|
|
|
|
def setFocus(self):
|
|
def setFocus(self):
|
|
|
PGEntry.setFocus(self.guiItem, self['focus'])
|
|
PGEntry.setFocus(self.guiItem, self['focus'])
|
|
|
|
|
|
|
|
|
|
+ def setCursorKeysActive(self):
|
|
|
|
|
+ PGEntry.setCursorKeysActive(self.guiItem, self['cursorKeys'])
|
|
|
|
|
+
|
|
|
|
|
+ def setBackgroundFocus(self):
|
|
|
|
|
+ PGEntry.setBackgroundFocus(self.guiItem, self['backgroundFocus'])
|
|
|
|
|
+
|
|
|
def setRolloverSound(self):
|
|
def setRolloverSound(self):
|
|
|
if base.wantSfx:
|
|
if base.wantSfx:
|
|
|
rolloverSound = self['rolloverSound']
|
|
rolloverSound = self['rolloverSound']
|
|
@@ -106,4 +111,11 @@ class DirectEntry(DirectFrame):
|
|
|
def get(self):
|
|
def get(self):
|
|
|
return self.guiItem.getText()
|
|
return self.guiItem.getText()
|
|
|
|
|
|
|
|
|
|
+ def setCursorPosition(self, pos):
|
|
|
|
|
+ if (pos < 0):
|
|
|
|
|
+ self.guiItem.setCursorPosition(len(self.get()) + pos)
|
|
|
|
|
+ else:
|
|
|
|
|
+ self.guiItem.setCursorPosition(pos)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|