Marking last word in dcget

This forum is for eXpress++ general support.
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Marking last word in dcget

#1 Post by c-tec »

Hello Roger,
I use version 2.55 and have a problem when I doubleclick the last word of a sentece in a dcget, then the whole line is marked and the cursor stand at the end of the field.
Is there any way to correct this in the source ?
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

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

Re: Marking last word in dcget

#2 Post by rdonnay »

Are you saying that you are still using build 255?

Why are you telling me this now?

I have been working on build 260 for over 1 year.

Build 255 was released in 2011.

I strongly advise that you start using the most current release - build 260.

With this as a new base for you, I can then work with you on any of your open issues.
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Marking last word in dcget

#3 Post by c-tec »

ok, I see, questions about older versions are not welcome. I will update when I see that this problem is solved. So I try to find someone with a new version to check this.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Marking last word in dcget

#4 Post by c-tec »

ok, problem solved, seems to be Windows standard behaviour, so no need for an upate. I will update beginning of next year, then all customers get an new update of my software, no need to do it now.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

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

Re: Marking last word in dcget

#5 Post by Tom »

The problem Rudolf is talking about is caused by the situation we all fill text variables with spaces in order to get a correct formatted DCGET:

cText := Space(30)
@ 1,1 DCGET cText

(same with database fields)

In this situation, the EditBuffer contains 30 blanks, which has two results: a) "CueBanners" won't work, since the EditBuffer is not empty, b) the length of the EditBuffer will always be 30 characters, so marking the last word in it sets the mark up to the end of the line. This has almost nothing to do with eXpress++ - even a native XbpSLE will work this way if it's initialized to 30 blanks. But this will work for both issues - the CueBanner and the last work marked:

Code: Select all

cText1 := ''
cText2 := ''
@ 1,1 DCGET cText1 PICT Replicate("!",30) GETSIZE 30 EVAL {|o|o:CueBanner := 'Test 1'}
@ 2,1 DCGET cText2 PICT Replicate("!",30) GETSIZE 30 EVAL {|o|o:CueBanner := 'Test 2'}
DCREAD GUI ADDBUTTONS FIT
Typing something into the first get and marking the last word work well. DCGET 2 shows the CueBanner:
Attachments
rudolf.jpg
rudolf.jpg (14.2 KiB) Viewed 11726 times
Best regards,
Tom

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

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Marking last word in dcget

#6 Post by skiman »

Tom,

Nice solution with that picture. I think I will implement this in my application. Will be quite some work to alltrim() each database field before editing, and to save the lenght of it.

Code: Select all

cName := alltrim(customer->name)
nNameLenght := len(customer->name)
@ 1,1 DCGET cName PICT '@'+Replicate("!",nNameLenght) GETSIZE 30 EVAL {|o|o:CueBanner := 'Tooltiptext'}
At this moment I have this in my code:

Code: Select all

cName := customer->name
@ 1,1 DCGET cName PICT "@!" GETSIZE 30 TOOLTIP 'Tooltiptext'
Wondering if this could be done with the pre-compiler. I could change the eXpress source code to accomplish this, but with the precompiler would be a better solution.

Just a remark if someone tries your solution for the cuebanner. Don't forget the MANIFEST file, otherwise the cuebanner won't work.
Best regards,

Chris.
www.aboservice.be

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Marking last word in dcget

#7 Post by c-tec »

Hello Chris,
I don't think that this can work, you cannot add characters in the get when you use alltrim().
Thany you Tom, now I also know why o:CueBanner does not work for me, because of the padded input strings.
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Marking last word in dcget

#8 Post by skiman »

c-tec wrote: I don't think that this can work, you cannot add characters in the get when you use alltrim().
With the picture clause as Tom showed in his sample, it will work to add characters. I'm looking for a way to automate the conversion. Otherwise I have thousands of GET's to modify.
Best regards,

Chris.
www.aboservice.be

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

Re: Marking last word in dcget

#9 Post by rdonnay »

Tom -

I am surprised that you don't get an error with a GET that has a length of 0.
I will have to give this a try, or see if I can find a simpler solution for everyone.

Thanks for that info.

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

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: Marking last word in dcget

#10 Post by c-tec »

Hello,
strange, in my sample I cannot add characters to cTest variables, so I always have to care about the correct length for editing with padding spaces. Only with multiline I can edit starting with an empty string.
regards
Rudolf

function test()
******************************************************************
local getlist := {}
local cTest1 := "Test with picture @S50"
local cTest2 := "Test with picture XXXXXXXXXXXX..."
@ 1,1 dcget cTest1 pict "@S50"
@ 2,1 dcget cTest2 pict "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
dcread gui fit
return .t.
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply