Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to code MouseDown event of Grid Control
Message
From
29/07/2010 11:45:34
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
29/07/2010 11:39:46
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01474450
Message ID:
01474468
Views:
44
This message has been marked as a message which has helped to the initial question of the thread.
I would use a submenu popup that the user chose which set of menus to select from.

>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform