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:
00665936
Vues:
22
Hi!

Well, I also dived deep into the events firing related to page frames. The issue in my application was with grids and it was similar. But it was related to NOT firing the LostFocus event of the control inside of the grid.

The problem was that I made a grid similar to ListBox. So I used SET CURSOR ON/OFF to hide the text cursor when text field is focused. It worked ok till I switched to next page. On teh next page I observed strange thing - when textbox was focused inmy grid, and I switch to anotehr page, text cursor does not appear in the text boxes on next page. I started to dive deeper and determined that LostFocus of the grid control does not fire (I SET CURSOR ON there). The worse - that grid was a class in our framework (listbox-like grid class).

How I solved this problem? To workaroud this generically on a framework level, this was a kind of nightmare. First of all, I had to define code in UIEnable. In that event I call SetAll for special property. this assignment was catched by grids property _Assign method where I catch the moment where I need to SET CURSOR ON or OFF.

I see the same story is yours. All I recommend is to make this on the level of classes, otherwise you will require to add too much code to the form. I have no any recommendations to your case apart from my general experience. You can send me a form and I will try to look to it, if you have a time to prepare it for this.

Situation like "Catch a wind on a field". The one that cause sitting at office till 23:00 or all over the night... ;(((

>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)?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform