Page 1 of 1

DCMULTILINE text display

Posted: Mon Aug 03, 2020 6:30 am
by reganc
Is there an easy way to update an MLE and get the display to always make the last line visible?

I have a number of places where we use DCMULTILINE to display audit logs and I've tried a number of things but never really got a handle on the correct way to do this.

Anybody have any tricks they can show me?

Re: DCMULTILINE text display

Posted: Mon Aug 03, 2020 6:47 am
by Tom

Code: Select all

@ x,y DCMULTILINE cStatus ... OBJECT oStatus

(.. somewhere in your code, where oStatus gets updated ...)
FUNCTION UpdateStatus(cStatus,oStatus,nStatusLineWidth)
cStatus += "Something happend!"+CRLF
oStatus:SetData()
oStatus:SetFirstChar(Len(cStatus)-nStatusLineWidth)

Re: DCMULTILINE text display

Posted: Mon Aug 03, 2020 7:40 am
by reganc
Tom wrote:

Code: Select all

@ x,y DCMULTILINE cStatus ... OBJECT oStatus

(.. somewhere in your code, where oStatus gets updated ...)
FUNCTION UpdateStatus(cStatus,oStatus,nStatusLineWidth)
cStatus += "Something happend!"+CRLF
oStatus:SetData()
oStatus:SetFirstChar(Len(cStatus)-nStatusLineWidth)
Should have known it would be so simple...!

And even if I am not updating the text and displaying at the same time, I can always use code to work out the last line anyway.
Thanks, Tom

Re: DCMULTILINE text display

Posted: Mon Aug 03, 2020 7:42 am
by Tom
A pleasure. :)

Re: DCMULTILINE text display

Posted: Thu Feb 03, 2022 6:32 am
by rdonnay
Tom -

I just used your solution too after exhausting every way to use xbeK_CTRL_END.

Thanks