Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to code MouseDown event of Grid Control
Message
De
29/07/2010 11:39:46
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, États-Unis
 
 
À
29/07/2010 11:12:27
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01474450
Message ID:
01474466
Vues:
27
>How about having the control call a grid custom method. That way you can force the user to select a menu item. Set a flag on the grid before displaying the menu. Then check the flag in the lostfocus event and set the focus back to the grid if a menu item has not been selected.
>
>If I was doing this, I would use bindevents() and aevent() instead of coding the textbox control.
>

Hi James,

I actually tried calling a custom method and setting a flag then setting foucs back to the gird but still the same problem, it seems like there is some issues with foucs or the MouseDown event "completing". I have moved my code to the appropriate RightClick and Click methods of the grid and NO focus issues, but I now have no ALT-RightClick option.

Maybe taking a look at using BindEvents might work, Thanks for the input.

Scott

>>>The only place on the grid that detects a click is the upper-left hand corner. You need to capture the click in the control that's inside the column, typically a textbox.
>>
>>That is what I am doing, the event fires correctly and I can detect left, right and any keys pressed, the problem is the focus and the grid being rebuilt.
>>
>>>
>>>>Is there a proper way to code the MouseDown event? What I mean is, when coding a MouseDown event is there required calls to NODEFAULT or DODEFAULT so that the events are no short circuited.
>>>>
>>>>The reason I had to code the MouseDown event is becuase I want to display one menu for a riight click and another menu for an ALT right click. The problem I am having is if a user right clicks in the grid and does NOT select an option, just clicks off on another form, focus is not moved from the grid cell and when the grids refresh timer fires again (I am using a custom text field in the grid to pass mousedown, click, double click etc to the parent grid object because the grid is rebuilt with the timer) I am not able to issue my Addobject command, it errors with "an object with that name already exist". If I look in the debugs call stack I do NOT see that it is running any code in the grid, I just see Main.prg and the timer.
>>>>
>>>>I hope I have explaind the situation and look forward to any and all input. Thanks for any help.
>>>>
>>>>Scott
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform