OK I try to explain why i like this error check system.
My costumers work with IBM AS400 machine (i'm the programmer) , with big and
green caracters. Mouse is used only to close the Client Access window!
When the users begin to use this working system, they are slow, unable and
often wrong.
Not to make mistakes users need a thousand requests for confirmation
This make the data enter very slow.
After two or three months of work, the practice makes them extremely fast,
safe and mistakes are rare.
User will not ever remove his hands off the keyboard to take the mouse, find
a window control and then click over this.
At this point people ask me "gian luca take away all confirmation from
programs. Make my work as fast as possible. If I will rarely wrong, I fix
myself the mistake."
My accounting program (Italian) is done in this way and is appreciated by my
customers.
A "bad" day my customers ask me the same program but really version windows.
I tried to send an email attachment with the form of my program, but is not
allowed.
I try to explain in words, without figures.
As you can (-'t-) see, there are four GroupBox (steps) : Dati Comuni, Conti,
C/F, IVA.
For each Group, a CheckButton with Caption STOP.
The current Group (Step) has clGradientActiveCaption Color, the others
clBtnFace color.
A ListBox with error list (Txx=Terminal error, Wxx=Warning error).
A Button CHIUDI
Every fields for each group have a OnExit routine that
1- verify the correctness of data
2- if correct, check whether there are sufficient data to move to next
step
3- if correct and sufficient, verify if the group checkbox is Unchecked.
4- if everything is true, the program passes to the next step
I try to explain you the mechanism.
We begin the first step.
The user find "Data Registrazione" alredy set to today date.
The cursor is in "Causale" field.
The user begin with two keystrokes: 02.
Causale= 02 makes it mandatory number and date document. The program show
IMMEDIATLY
and WITHOUT ANY OTHER ACTION, like click a "OK" button, a Terminal message
(this is the reason why the error list is LIVE!
The list shows the errors as the user enters data, not after pressing a OK
Button).
The user continues with number and date document whitout removing hands off
the keyboard .
When done, the program consider to have sufficient and correct data to
continue to step two.
The "Storno" field is a no mandatory field, so is bypassed.
Now, the current Group (Step) with clGradientActiveCaption Color, is
"Conti".
Fields Enabled or Disabled, Visible or invisible in active group "Conti"
depend on the value of "Causale" field.
Let's go back a step backwards.
Rarely the user may want to set the "Storno" field.
I want the user enter number and data document and then click the STOP
CheckBox to say
"don't go to the next step,i want enter more data than minimal sufficient".
As you know, when the user passes from the data document to the checkbox
with a click of mouse, OnExit is processed before updating value of CheckBox
State.
So the program read "check box state=UNcecked" (the old value) and continue
without leaving the user the ability to enter more data in the same Group.
I thought to customize the status of departure of STOP checkboxes of each
group according to the skill of the user.
For example, the user wants the fast data entry (minimal) for the group
"Comuni", so start with UNchecked "Comuni" Stop Checkbox.
That rare time the user wants insert more data, will click on "Comuni" Stop
Checkbox.
Instead the user usually wants to enter all the data for "Comuni" group, so
start with CHECKED "Conti" Stop Checkbox.
When the user wants to go to next step (without errors), will click on
"Comuni" Stop Checkbox to set UNChecked.
with this system, will continue until complete registration over all groups.
the same kind of problem there if I want to close the window with the button
CHIUDI but there are still Terminal errors.
I hope I have answered your question.
Post by Remy Lebeau (TeamB)Then the WM_CHECKMINDATA message is arriving in the message queue before
the CheckBox messages arrive. You will have to delay it longer, such as
via a timer.
Sorry Gambit, can you show me a little example?
Post by Remy Lebeau (TeamB)Alternatively, when the TEdit receives focus, set a flag somewhere
indicating the TEdit is the last control entered. When the CheckBox is
focused, see if the flag is set. If so, then you know the user moved from
the TEdit to the CheckBox, and can act accordingly.
Yes Gambit, but i don't know if the user go to the CheckBox with the TAB key
(in this case i don't know if the user wants toggle the CheckBox value)
or with a click of mouse (in this case i know that the user wants toggle the
CheckBox Value).
as I already know that this would solve my problem.
In other words: if i Know if the user leave the TEdit control with TAB key
or with a mouse click, I solve my problem.
Thank you!
Gian Luca Spadotto
Post by Remy Lebeau (TeamB)Post by Gian Luca SpadottoI tryed your suggestion as follow, but, as you can see
in the following source code, nothing has changed!
Then the WM_CHECKMINDATA message is arriving in the message queue before
the CheckBox messages arrive. You will have to delay it longer, such as
via a timer.
Alternatively, when the TEdit receives focus, set a flag somewhere
indicating the TEdit is the last control entered. When the CheckBox is
focused, see if the flag is set. If so, then you know the user moved from
the TEdit to the CheckBox, and can act accordingly.
I still think you have a fundamentally flawed design in general. You did
not answer my earlier question about why you are abandoning standard
validation practices. You already have OK and ABORT buttons on the form.
That is where you should be doing your validation. NOT when moving from
one control to the next.
Gambit