dbTalk Databases Forums  

gotfocus Firing Twice

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss gotfocus Firing Twice in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default gotfocus Firing Twice - 06-02-2008 , 01:09 AM






I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Reply With Quote
  #2  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM






Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #3  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #4  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #5  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #6  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #7  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #8  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #9  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
  #10  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: gotfocus Firing Twice - 06-02-2008 , 03:33 AM



Quote:
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.
In addition, anyButton.GotFocus() also runs when the user tabs
thru the controls, doesn't it. I'd suggest not to use .GotFocus()
at all in your scenario but rather put both parts into button.Click()
(or .Valid()):
If Thisform.SaveData()
Thisform.ExternalXY()
...


Regards
-Stefan

"Gene Wirchenko" <genew (AT) ocis (DOT) net> schrieb im Newsbeitrag
news:s23744t7f1b2ldtvp92ojg9j5moijm67u0 (AT) 4ax (DOT) com...
Quote:
I have one form in my app which is used to control invoicing. It
has a number of functions that are internal and some that are
external. These functions are started by the operator clicking a
button. The form also has some data about the current client. Some
of this data can be changed. It should be saved before doing
something. With most buttons -- the exceptions are unimportant -- the
gotfocus of the button contains code to save the client data. The
valid contains the code to run.

In the case of the external functions, other forms are created.
The problem that I have is that when these functions return, the focus
goes back to the first form. gotfocus fires a second time. I do not
want it to, or I want to avoid the save.

I think I have a solution. I can set a status flag in the
valid's code which the save routine will check to determine whether it
should save. At the end, the save routine would reset this flag. This
seems somewhat convoluted.

Is there something I am missing, or is this the way to go?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.