Page 2 of 3

Re: Please show your most complex PICTURE

Posted: Wed Dec 14, 2011 12:49 pm
by l3whmg
Hi Rathinagiri.
Yes you are right about date (I don't remember well, but I think like HMG3); it can be done, but I don't find a Harbour function to do a simple test: IS-A-VALID-DATE (there is ISDATE but with different behaviour)? There are many functions to handle date but not this one; on the other hand, I don't want to use contrib library, I think it is not a good strategy...

On the other hand, I don't see many answer to this thread about complex PICTURE and I think there isn't any reasons to create a complex object to do something if it's not used. A very simple input (without any picture) can be better. Anyway....

Someone can help me about IS-A-VALID-DATE to do check?

Cheers

Re: Please show your most complex PICTURE

Posted: Wed Dec 14, 2011 1:57 pm
by mrduck
There was a checking code in hmg4 textbox.... at least in the past... if you entered a wrong date it was cleared since the conversion from type char to type date failed....

Code: Select all

IF empty( stod( ::value() ) )
  // INVALID DATE
ENDIF

Re: Please show your most complex PICTURE

Posted: Wed Dec 14, 2011 2:04 pm
by l3whmg
Hi MrDuck.
Many thanks for suggestion.
I have used another trick: IF MONTH( dDate) == 0 is wrong date. :D
But your is better: short.

Anyway, I have update the zipped file and fixed bug about numeric value see this color

Download and play.

Cheers

Re: Please show your most complex PICTURE

Posted: Thu Dec 15, 2011 12:10 pm
by l3whmg
Hi friends,
Today (2011.12.15), I have update my demo with a lot of improvement. Please read my post and play.
Cheers

Re: Please show your most complex PICTURE

Posted: Thu Dec 15, 2011 8:15 pm
by l3whmg
Hi to everyone.

I am truly :shock:
No one seems interested in this development. Probably, because do you think it is not possible with HMG4 :?:

In attachment you can find a souce code (semi-oop) and related running demo compiled with my HMG4 revised.

I'm very :(

Cheers

Re: Please show your most complex PICTURE

Posted: Thu Dec 15, 2011 8:22 pm
by Rathinagiri
Hi Luigi,

That looks just great! I am just sleepy at 1.51 a.m. and I would give my comments in the morning.

Re: Please show your most complex PICTURE

Posted: Fri Dec 16, 2011 7:36 am
by Rathinagiri
I like the right aligned editing now Luigi.

So, can we have numeric and right aligned on the same textbox?

Re: Please show your most complex PICTURE

Posted: Fri Dec 16, 2011 7:52 am
by mol
I want to report Backspace is not working in formatted fields :?
UpperCase field doesn't convert to upper
LowerCase field doesn't convert to lower:

Image

Re: Please show your most complex PICTURE

Posted: Fri Dec 16, 2011 8:54 am
by l3whmg
Hi guys.
@Mol: about BACKSPACE or DEL with masquered field you can only "overwrite" the position with a valid character.
If I have a TEXTBOX with this picture "AAA", IMHO, you must enter a valid char in every position (eg. you must enter "FrE").
In this condition, DEL or BACKSPACE are unuseful because you must not remove the character (or the position). On the other hand, if I use DEL or BACKSPACE, what is the right character? NULL it's wrong, SPACE can be considered wrong, etc. because the picture in that position say "A". The string of codes (the mask) give us these informations: 1) what is a valid character (simple coding "A", "X", "N", "9") and the length (f.e. 3 characters must be entered and they must be in the range A-Z and a-z). If you have time, take a look to the codes related with QT inputmask. F.e. they have these codes:
"A" (like Clipper) and it means "required" and "a" (like clipper) but it means "not required". On the other hand, there is another parameter at the end of the QT inputmask and its significate is: instead space what is the "null" character to fill out the string? For example, you can create this Qt inputmask: "NnN;*" and enter "A2b" or enter "A b" but you will see "A*b". Output text must be 3 length.

About other I must investigate. Thanks for you notice.

@Rathinagiri.
At this moment, ALL datatype are left aligned in every condition (editing and viewing). I have forced right alignment for TXT_NUMERIC while viewing; I thought: can be the default for numeric value. So, I can leave left aligned every data type and must be the programmer who uses RIGHTALIGN option (like in this demo for textbox). The internal trick is to use the alignment; it does not affect the source code needed to handle the insertion of characters.
On the other hand, HMG3 has only one option: RIGHTALIGN and numeric value are always right align.
I can think other solution, but it requires a new "option" for numeric value.....

Thanks to everyone
Cheers

Re: Please show your most complex PICTURE

Posted: Fri Dec 16, 2011 9:03 am
by l3whmg
Hi @Mol
You are right: I made ​​a mistake while writing demo with commands. In fact, with the OOP version, works fine
See "CASECONVERT TXT_UPPER": must be "CASECONVERT UPPER".

Cheers.