Skip navigation.
Home
The QNX Community Portal

View topic - PtMultiText circular buffer

Page 1 of 1

PtMultiText circular buffer

PostPosted: Thu Aug 16, 2012 9:36 am
by roby.2004
HI,

I would like to display only the latest 1000 lines in PtMultiText widget of some continuous logs ,while logging is happening.i.e if I scroll up ,I should be able to see the latest 1000 logs,eventhough lot of logs has happened early.
Other previous logs should not be there.Is there any way to do this.

Thanks in advance

Regards
Roby Varghese

Re: PtMultiText circular buffer

PostPosted: Thu Aug 16, 2012 4:27 pm
by maschoen
It's not a feature of the MultiText widget, but you can implement it programatically. On a recent project I had to do something similar. The tricky part was to keep the data scrolled right. When scrolled to the end the user wanted new data to appear. When the user scrolled up, the data had to be be static, not jump to the bottom when new data appeared. Also we had Top, Bottom, Page Up + Down and single Up + Down keys.

I didn't use MultiText, instead I used multiple label widgets. The Text and MultiText widgets make more sense if you want the user to be able to edit the data.

Re: PtMultiText circular buffer

PostPosted: Fri Aug 17, 2012 6:18 am
by roby.2004
maschoen wrote:It's not a feature of the MultiText widget, but you can implement it programatically. On a recent project I had to do something similar. The tricky part was to keep the data scrolled right.
When scrolled to the end the user wanted new data to appear. When the user scrolled up, the data had to be be static, not jump to the bottom when new data appeared
. Also we had Top, Bottom, Page Up + Down and single Up + Down keys.

I didn't use MultiText, instead I used multiple label widgets. The Text and MultiText widgets make more sense if you want the user to be able to edit the data.

Re: PtMultiText circular buffer

PostPosted: Fri Aug 17, 2012 1:30 pm
by maschoen
Did you intend to just quote the previous post, or did you have another question?

Re: PtMultiText circular buffer

PostPosted: Mon Aug 20, 2012 2:35 pm
by roby.2004
HI,
I have fixed the problem by deleting the first line by calling
PtMultiTextModifyText(ABW_PtMultiTextLogView,0,s32_message_length,-1, NULL,
s32_message_length,NULL,0);
,when the line count crosses 1000. So only last 1000 lines appear in the ptMultiText buffer.

Now a new problem.

When I call PtMultiTextModifyText to delete the first line the scroll bar also move up.and then again a log
is coming at the end the scroll bar moves down ,so the filckering of scroll bar happening.

Is there any way to avoid this?

I think of disabling the scroll bar when deleting the first line to avoid the flickering effect.But I dont know how to disable the scroll bar.
How to disable and enable the scroll bar programatically?

Thanks in advance

Regards
Roby