Marking last word in dcget
Marking last word in dcget
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
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
Re: Marking last word in dcget
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.
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.
Re: Marking last word in dcget
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
regards
Rudolf
Re: Marking last word in dcget
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
regards
Rudolf
Re: Marking last word in dcget
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:
Typing something into the first get and marking the last word work well. DCGET 2 shows the CueBanner:
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
- Attachments
-
- rudolf.jpg (14.2 KiB) Viewed 11708 times
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Marking last word in dcget
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.
At this moment I have this in my code:
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.
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'}
Code: Select all
cName := customer->name
@ 1,1 DCGET cName PICT "@!" GETSIZE 30 TOOLTIP 'Tooltiptext'
Just a remark if someone tries your solution for the cuebanner. Don't forget the MANIFEST file, otherwise the cuebanner won't work.
Re: Marking last word in dcget
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
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
Re: Marking last word in dcget
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.c-tec wrote: I don't think that this can work, you cannot add characters in the get when you use alltrim().
Re: Marking last word in dcget
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
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.
Re: Marking last word in dcget
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.
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.