If I have a nana::textbox with many lines so that the scroll bar appears, then I manually change the caret position using nana::textbox::caret_pos(const upoint& pos) while the textbox is focused the caret position is changed correctly and the view is scolled so that the caret is visible.
But if I call nana::textbox::caret_pos(const upoint& pos) from another source (i.e. a button) the caret changes position but the textbox does scroll to make the caret visible.
Pressing a when the text box has many line (so scroll bar is shown) takes you back to the first line.
But pressing the button updates the carets position but does not take you to it's position.
After looking at the source code it looks like this is the problem:
nana\source\gui\widgets\skeletonstext_editior.cppLine 1709-1710
Not sure what the reason behind this is, but a temp fix can be achieved by changing the button lambda to:
So really my question is what is the reason behind not updating the scroll when not focused? and is/can there be a fix where I do not have to manually adjust the widgets focus.
If I have a
nana::textbox
with many lines so that the scroll bar appears, then I manually change the caret position usingnana::textbox::caret_pos(const upoint& pos)
while the textbox is focused the caret position is changed correctly and the view is scolled so that the caret is visible. But if I callnana::textbox::caret_pos(const upoint& pos)
from another source (i.e. a button) the caret changes position but the textbox does scroll to make the caret visible.Code to test:
Pressing
a
when the text box has many line (so scroll bar is shown) takes you back to the first line. But pressing the button updates the carets position but does not take you to it's position.After looking at the source code it looks like this is the problem:
nana\source\gui\widgets\skeletonstext_editior.cpp
Line1709-1710
Not sure what the reason behind this is, but a temp fix can be achieved by changing the button lambda to:
So really my question is
what is the reason behind not updating the scroll when not focused?
andis/can there be a fix where I do not have to manually adjust the widgets focus
.