| Issue 276: | Solve TextInput problem when text width exceeds textinput.width (make scrollable)? | |
| 3 people starred this issue and may be notified of changes. | Back to list |
How could we do this? A hard character limit isn't a good idea... What you have in most cases is a 'scrollable' text input field (which might, if you want, expand a little automatically within predefined bounds). We should do the same. How, though. Quick Idea: Use MTList do display text. However, then we don't need to inherit from MTButton, right? Opinions on this? Really not sure how to best implement...
Jul 5, 2010
Project Member
#1
dennd...@gmail.com
Owner:
txprog
Aug 17, 2010
Usage of stencil for textarea solve the problem, but reduce a lot performance.
{{{
#
# Needed to prevent the label go out of the bounds
#
def draw_label(self, dx=0, dy=0):
stencilPush()
drawRectangle(pos=self.pos, size=self.size)
stencilUse()
if self.is_active_input:
padding = self.padding
if type(padding) in (list, tuple):
padding = padding[0]
dx = -self._used_label.width + self.width + padding
super(MTTextInput, self).draw_label(dx, dy)
stencilPop()
}}}
A much deeper solution must be found, since even core Label() can have problem with size.
I've played with texture coordinate, but the problem is taht the text is blur after adjustment.
screenshot0000 is no limitation,
screenshot0001 is with limitation.
Testing other solution...
Status:
Started
Aug 18, 2010
scroll and scroll_trigger attribute have been added, default to True and 10. Refer to documentation abotu the behavior. It still a big changes, since now, cause only a part of Core Label can be drawed. This can be manipulate with viewport_pos and viewport_size on Label(). And MTLabel is now always set the viewport_size, to prevent rendering outside the bounds of the label.
Aug 18, 2010
Closed via GitHub: http://github.com/tito/pymt/commit/8a4e8a8f30952645679ff7e0a5ef3e12eba7f846 textinput: add scroll + scroll_trigger property, and rework textinput to add more documentation and make it more understandable (fixes issue 276 )
Status:
Done
|