XbpMLE() manipulation

This forum is for general support of Xbase++
Post Reply
Message
Author
reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

XbpMLE() manipulation

#1 Post by reganc »

Hi guys

I would like to be able to move the cursor within an MLE so that the bottom line is visible immediately. I want to have an MLE hold progress text and show what is currently being done...

I have tried various things in the past but not found a solution that works reliably.

Does anyone know how to do it?
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: XbpMLE() manipulation

#2 Post by Tom »

Code: Select all

@ 1,1 DCMULTILINE cText OBJECT oText ... EVAL {||oText:Enter := {||oText:SetFirstChar(Len(cText))}}
or, more unspecific:

Code: Select all

EVAL {|o|o:Enter := {|a,x,o|o:SetFirstChar(Len(o:EditBuffer()))}
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: XbpMLE() manipulation

#3 Post by reganc »

Tom wrote:

Code: Select all

@ 1,1 DCMULTILINE cText OBJECT oText ... EVAL {||oText:Enter := {||oText:SetFirstChar(Len(cText))}}
or, more unspecific:

Code: Select all

EVAL {|o|o:Enter := {|a,x,o|o:SetFirstChar(Len(o:EditBuffer()))}
Thanks Tom...that was a great help!

I made a small function (with the only paramter being the mle object) which also did a setdata() to make sure the string had been updated, used editbuffer to get the position, setmarked to move the cursor there and the whole thing is wrapped in a lockupdate / invalidaterect block to stop any flickering.

Works like a charm...
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: XbpMLE() manipulation

#4 Post by Tom »

Hi, Regan.
that was a great help!
:)

BTW, if it's something like a protocol viewer, moving to the bottom can also be done inside the function which updates the MLE contens. Same code.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: XbpMLE() manipulation

#5 Post by rdonnay »

Regan -

I always thought that browsing an array was easier to use for progress text.

I would add the next line of text to the array, do a oBrowse:goBottom() and refresh the browse.

Roger
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: XbpMLE() manipulation

#6 Post by Tom »

Hi, Roger.

This is in fact easier, but it limits the to-be-added text to the column width. So, you need to format/break the (new) text if your protocol function adds multi-lined information.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: XbpMLE() manipulation

#7 Post by rdonnay »

Good point.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: XbpMLE() manipulation

#8 Post by Auge_Ohr »

offtopic :

btw. did you know how to set Tabstop in a XbpMLE() ?
greetings by OHR
Jimmy

Post Reply