Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hot keys for buttons
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00665597
Message ID:
00665905
Vues:
17
Hi Vlad,

Ok, I'll think more about Cancel (ESC) option and also ask the user's manager, what functionality she thinks would be better here. She is very helpful in debugging (discoveres lots of little things, which can easily be overlooked) and also has a great experience with DataEntry.

Vlad, if you would not mind, I'll switch a subject a little bit:

DataEntry form has two textboxes on the form itself (txtSource and txtMiscType)[Actually, there are more, but let's not distract on this detail] and a pageframe with 4 pages:

if user types S or M in txtSource (Sales or Mortgage), the first or second page is activating.

If user types C (Credit), txtMiscType becomes visible and user chooses what kind of Credit transaction he/she wants. 3rd page is activated and textboxes and labels, which are relevant to this particular type of Credit records become visible (this is Table driven).

So far so good. However, there is a problem.

Say, user choosed S (Sales) first, typed info, ended on Seller1 field (required) and without leaving this field pressed F9 (save). FormValid was fired, suppose, there were no problems with this particular transaction and so data were saved and append blank was issued and the cursor is now back on the txtSource field. The user typed another S in the txtSource field and I move focus to the Page1.txtDate programmatically. However, this fires unwanted valid of the Seller1 textbox, since in order to set focus on another control I first need to leave focus from the current active control on the page.

So, basically there are situations, when the Valid fires, which I don't want to fire.

I'm wondering, how do you handle such situations?

I've added a new property to my textboxes DoValid. If this property is set to false, I skip textbox validation. However, yesterday I was trying to determine, when I need to set textboxes DoValid to false and when restore it back to true and went absolutely crazy...


>Hi!
>
>I also go for option to use Cancel=.T. for button. It does not matter that field value changes are lost when user press ESC key - you will cancel anyway, and in most interfaces pressing cancel does not prompt user for confirmation. So, wonder why this is an issue?
>
>BTW, This is also a common problem (like it was with value of field not saved when saving data from toolbar or hotkey that we discussed in recent thread). And, as usual, many frameworks has workarounds for this.
>
>In our framework we created special generic approach for this, but we did not dived so deep into generalizing things. We have a propery to specify Cancel button object location (starting from thisform object). Then we just had a generic method in the form class that using coordinates of mouse and coordinates of button determine if that button is pressed by mouse. Also, check for all other things like ESC or hotkey or whatever. Remember that Cancel button could go with image, as well as a hot key for it could be not always "C".
>
>
>>Hi everybody,
>>
>>How can I find out, if button has a Hot Key (letter highlighted) and what's the value of it. Say, I have Cancel button with first letter highlighted. I added in my CancelValidation method of the form:
>>
>>
>>********************************************************************
>>*  Description.......: CancelValidation
>>*  Calling Samples...:
>>*  Parameter List....:
>>*  Created by........: John Koziol
>>*  Modified by.......:
>>********************************************************************
>>local nCancelTop,nCancelHeight,nCancelLeft,nCancelWidth, llReturn
>>nCancelTop=thisform.cmdCancel.top
>>nCancelBottom=m.nCancelTop+thisform.cmdCancel.height
>>nCancelLeft=thisform.cmdCancel.left
>>nCancelRight=m.nCancelLeft+thisform.cmdCancel.width
>>llReturn = .f.
>>if between(mrow(thisform.name,3),m.nCancelTop,m.nCancelBottom) and ;
>>		between(mcol(thisform.name,3),m.nCancelLeft,m.nCancelRight) and ;
>>		mdown()
>>	llReturn = .t.
>>endif
>>return m.llReturn or lastkey()= 46 && Alt+C (shortcut for Cancel)
>>
>>Is there a way to make this more generic (e.g. find out key combination for Cancel button automatically)?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform