Open GoogleCodeExporter opened 9 years ago
guichan 0.8.0
Original comment by igagis@gmail.com
on 1 May 2008 at 8:26
I believe TextBox calls adjustSize automatically since it is meant to be used
within
a ScrollArea, where the user only defines the size of the ScrollArea. This is
different from Label and TextField, which do not automatically adjust their
size. The
documentation doesn't seem to mention this, however. TextBox also relies on
ScrollArea to draw a border around it.
I'm not sure about the best way to fix this. In Qt, the QTextEdit (like
gcn::TextBox)
subclasses from QAbstractScrollArea (like gcn::ScrollArea), so you can't even
use it
on its own. Though of course you can disable the scroll bars and the border.
Original comment by b.lindeijer
on 5 May 2008 at 10:56
Well, I think it would be the best solution to embed the Scrolling
functionality to
TextBox class (as it is in QT). Because it is not obvious that I always must use
TextBox in conjunction with scroll area.
Possible solution: derive TextBox from ScrollArea and add the object of Current
TextBox class to this scroll area in the constructor of new TextBox class.
Something
like that?
Original comment by igagis@gmail.com
on 5 May 2008 at 11:08
One problem I didn't realize before with deriving from gcn::ScrollArea is that
it
then becomes rather impossible to use your own customized ScrollArea class.
You'd
basically have to re-do the same customizations on top of gcn::TextBox.
So the solution I would suggest for now is to improve the documentation.
Original comment by b.lindeijer
on 5 May 2008 at 12:29
Yes, looks like modifying docs will be enough.
By the way, if TextBox is supposed to be used only in conjunction with
ScrollArea,
maybe the default TextBox should have transparent background then? So, it would
draw
only text inside it and ScrollArea will be responsible for drawing background.
Currently TextBox has white background color.
Original comment by igagis@gmail.com
on 5 May 2008 at 1:02
One solution to the problem is to make TextBox use a ScrollArea widget just like
DropDown does, that way you only need to pass a customized ScrollArea to TextBox
instead of subclassing TextBox.
Original comment by olof.nae...@gmail.com
on 6 May 2008 at 1:19
Original issue reported on code.google.com by
igagis@gmail.com
on 1 May 2008 at 8:14