Please show your most complex PICTURE

Moderator: Rathinagiri

User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Please show your most complex PICTURE

Post 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
Luigi from Italy
www.L3W.it
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: Please show your most complex PICTURE

Post 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
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Please show your most complex PICTURE

Post 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
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Please show your most complex PICTURE

Post 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
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Please show your most complex PICTURE

Post 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
Attachments
Hmg_TextBox.zip
hmg4 demo
(1.35 MiB) Downloaded 229 times
Luigi from Italy
www.L3W.it
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Please show your most complex PICTURE

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Please show your most complex PICTURE

Post by Rathinagiri »

I like the right aligned editing now Luigi.

So, can we have numeric and right aligned on the same textbox?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Please show your most complex PICTURE

Post 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
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Please show your most complex PICTURE

Post 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
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Please show your most complex PICTURE

Post 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.
Luigi from Italy
www.L3W.it
Post Reply