*** empty log message ***

This commit is contained in:
Mark Mine 2001-08-23 21:11:34 +00:00
parent 11c8bac42b
commit a7d876741c
3 changed files with 19 additions and 3 deletions

View File

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

View File

@ -4,6 +4,7 @@ from DirectGuiGlobals import *
import __builtin__
__builtin__.guiTop = aspect2d.attachNewNode(PGTop('DirectGuiTop'))
guiTop.node().setMouseWatcher(base.mouseWatcherNode)
base.mouseWatcherNode.addRegion(PGMouseWatcherBackground())
# Set up default font
PGItem.getTextNode().setFont(getDefaultFont())

View File

@ -51,6 +51,9 @@ B3RELEASE = PGButton.getReleasePrefix() + MouseButton.three().getName() + '-'
# For DirectEntry widgets
OVERFLOW = PGEntry.getOverflowPrefix()
ACCEPT = PGEntry.getAcceptPrefix() + KeyboardButton.enter().getName() + '-'
TYPE = PGEntry.getTypePrefix()
ERASE = PGEntry.getErasePrefix()
# For setting the sorting order of a widget's visible components
IMAGE_SORT_INDEX = 10