mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Merge pull request #72 from assertivist/master
Allow setting width and numLines of DirectEntry without clearing text
This commit is contained in:
commit
af9fe8275a
@ -46,8 +46,8 @@ class DirectEntry(DirectFrame):
|
||||
('numStates', 3, None),
|
||||
('state', DGG.NORMAL, None),
|
||||
('entryFont', None, DGG.INITOPT),
|
||||
('width', 10, self.setup),
|
||||
('numLines', 1, self.setup),
|
||||
('width', 10, self.updateWidth),
|
||||
('numLines', 1, self.updateNumLines),
|
||||
('focus', 0, self.setFocus),
|
||||
('cursorKeys', 1, self.setCursorKeysActive),
|
||||
('obscured', 0, self.setObscureMode),
|
||||
@ -146,6 +146,12 @@ class DirectEntry(DirectFrame):
|
||||
def setup(self):
|
||||
self.guiItem.setupMinimal(self['width'], self['numLines'])
|
||||
|
||||
def updateWidth(self):
|
||||
self.guiItem.setMaxWidth(self['width'])
|
||||
|
||||
def updateNumLines(self):
|
||||
self.guiItem.setNumLines(self['numLines'])
|
||||
|
||||
def setFocus(self):
|
||||
PGEntry.setFocus(self.guiItem, self['focus'])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user