![]() |
Detecting R-Click prior to _FocusChanging |
Post Reply ![]() |
Author | |
bryanu ![]() Groupie ![]() ![]() Joined: 19 February 2007 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() Posted: 23 March 2011 at 4:34pm |
Hello,
I am using the report control to show a list of available reports, as the user clicks on a report or uses the Up/Down arrows, I show the details of the report selected. However, I want the user to be able to R-Click the report and have a Pop-Up menu appear WITHOUT changing the Focus of the row that was R-Clicked. It appears that the _FocusChanging event is fired before the _MouseDown or the _RowRClick event. What I am trying to accomplish is the user to only be able to change the selected Row when the Left Mouse button is used or the arrow keys change the current selection, and show a Pop-Up menu when right clicked. Any suggestions???? Regards, |
|
Suite Pro v16.3.1
Visual Basic 6.0 ENT sp6 Windows 8.1 |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
I just tried a ReportControl with the following:
And right-clicking doesn't change the focus for me, so it seems that your desired behaviour is the default behaviour. Unless I've misunderstood your requirements? |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
@jpbro
I tried your code but I too had the FocusChanging event firing, which is the default behaviour of the ReportControl. @bryanu I have uploaded a code example that allows you to only change the row focus on left click or up/down arrow keys, clicking with the right mouse button will no longer change the row focus. uploads/2960/Prevent_Right_Mouse_Click.rar |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Hmm, strange - my FocusChanging event does fire when I right-click (using the code I provided), but the focus doesn't actually change!
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
Very strange indeed, my FocusChanging event fired also but the row focus also changed.
Maybe you have a default setting on the ReportControl which is the solution to this afterall! The code I uploaded is a workaround using the GetAsyncKeyState API. |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
One note about using GetAsyncKeystate with VK_L/RBUTTON to test for the
mouse button state is that you should also use a GetSystemMetrics check
to make sure the buttons haven't been swapped by left handed users:
I'll investigate my settings a bit more to see why the focus isn't changing... |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
Nice catch on the use of GetSystemMetric to check for the swapped mouse buttons!
Must admit I never did think of that! |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Just for the record, I used same code as Jason and focus does change as well.
What worries me more is the fact, when rightclicking last row (if not entirely visible) RC scrolls one row down to make that row visible and focus changes a second time.
To reproduce:
Thanks
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
@Aaron
I tried this out and you're right, it does set focus to the row after the one you right click on. Looks like a bug to me! |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
Thanks, will be fixed today. |
|
Codejock support
|
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Any idea why my focus isn't changing even though FocusChanging event fires? In fact FocusChanging seems to fire twice (once on rbuttondown, once on rbuttonup) even though there is no visible change to focus.
Maybe something to do with Windows 2000? Here's a video: http://www.statslog.com/rcrc.avi |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Xander75 ![]() Senior Member ![]() ![]() Joined: 26 April 2007 Status: Offline Points: 353 |
![]() ![]() ![]() ![]() ![]() |
@jpbro
I have no idea why your focus is not changing maybe one for CJ ![]() |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
![]() |
|
SuperMario ![]() Senior Member ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
There was a bug in 15.0.1 that was fixed in 15.0.2. I see in your sig that 15.0.1 is used. " |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Thanks SuperMario, that would explain it ;)
I didn't move to 15.0.2 because of the reported problems about slowness that I saw in the forum. Since it's not a big issue to me about the right-click, I'll wait for 15.0.3. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I've reviewed the code changes of the report control. Selection on right-click has been introduced in 13.3 to allow dragging on right-click. Unfortunately the row will always become selected, even if dragging on right-click is disabled. I'll add several properties that allow to define the behaviour of the report control: SetFocus = True | False SetSelection = True | False EnsureVisible = True | False StartDrag = True | False ShowContextMenu = True | False I'll also add default sets to reproduce the different behaviours of the Office products (Outlook, Excel). Andre |
|
Codejock support
|
|
![]() |
|
bryanu ![]() Groupie ![]() ![]() Joined: 19 February 2007 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Hey Guys,
I appreciate the help in this matter, I have it up and running now with your help. Looks like the first bug I have ever uncovered in a CJ product ;) Sounds like it's being addressed. Regards, |
|
Suite Pro v16.3.1
Visual Basic 6.0 ENT sp6 Windows 8.1 |
|
![]() |
|
ABuenger ![]() Newbie ![]() ![]() Joined: 02 February 2006 Status: Offline Points: 1075 |
![]() ![]() ![]() ![]() ![]() |
Fixed for 15.0.3. @Aaron: You can test the scheme "Codejock default". If you select "Codejock 15.0.2" you'll even see the old bug. I'll also add the 13.x versions. 15.0.2 also did not select subitems on right-click, which I've changed for 15.0.3. When upgrading the report control the behavior can always be reverted with a single line of code: wndReportControl.Behavior.Scheme = xtpReportBehaviorCodejock1502 @bryanu: I've implemented customizable behavior for 15.0.3. Please download the updated sample and let me know if the scheme "custom" works for you. It's a customized Outlook scheme. Right click a group row to see the behavior. You might also want to try the Outlook scheme, focus is only temporarily set to the row if you right-click it. ![]() Download sample: uploads/1755/ReportSample.zip |
|
Codejock support
|
|
![]() |
|
McKloony ![]() Senior Member ![]() ![]() Joined: 09 January 2007 Location: Germany Status: Offline Points: 340 |
![]() ![]() ![]() ![]() ![]() |
Do you know, the release date of the official 15.0.3 ?
|
|
Product: Xtreme SuitePro (ActiveX) 16.2.5
Platform: XP / Windows 7 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
SuperMario ![]() Senior Member ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
We don't have a date at this time.
http://www.codejock.com/corporate/release-date-policy.asp |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |