![]() |
CommandBars not processing mouse click |
Post Reply
|
| Author | |
ijwelch
Senior Member
Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
Quote Reply
Topic: CommandBars not processing mouse clickPosted: 08 November 2009 at 9:28pm |
|
I have a problem with commandbars not raising Execute event when system resources are low.
My app is playing video and there's a lot of GDI stuff going on while the video is running. If I run the video at small size (say, 320x240) then all is fine. If the video is larger (640x480) then the commandbars no longer process mouse clicks. The Update event still fires, and hottracking is still working - just not raising Execute event. Command Buttons work ok, as do all other controls. DoEvents doesn't help. Any ideas how I can fix this? |
|
|
ExtremeSuitePro 12.1.1
WinXP SP3 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 09 November 2009 at 3:25am |
|
Hi,
Maybe you can create small demo to show it ?
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
ijwelch
Senior Member
Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
Quote Reply
Posted: 09 November 2009 at 9:02am |
|
Here's code:
Option Explicit Private Sub CommandBars1_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl) Debug.Print "Execute", Now End Sub Private Sub Form_Load() Dim bar As CommandBar Me.CommandBars1.DeleteAll Set bar = Me.CommandBars1.Add("Toolbar", xtpBarTop) bar.Controls.Add xtpControlButton, 1000, "Button1" bar.Controls.Add xtpControlButton, 1001, "Button2" Timer1.Interval = 10 Timer1.Enabled = True End Sub Private Sub pDraw() Dim i As Long Dim r As Byte, g As Byte, b As Byte Dim x As Long, y As Long, x2 As Long, y2 As Long Cls Randomize For i = 1 To 1000 r = CByte(255 * Rnd) g = CByte(255 * Rnd) b = CByte(255 * Rnd) Me.ForeColor = RGB(r, g, b) x = Me.ScaleWidth * Rnd x2 = Me.ScaleWidth * Rnd y = Me.ScaleHeight * Rnd y2 = Me.ScaleHeight * Rnd Me.Line (x, y)-(x2, y2) Next DoEvents 'this is the offending line End Sub Private Sub Timer1_Timer() pDraw End Sub I run this and I see missed clicks in commandbar. Also commandbar can get in bad state (see image - button1 is down, button2 is hottracked).
Comment out DoEvents and all is ok. Thing is, I need to DoEvents. I've found workaround by subclassing CommandBar mousedown, consuming message and calling Execute on the SelectedControl myself. This works for normal CommandBarButtons but it's going to get messy for popups etc. |
|
|
ExtremeSuitePro 12.1.1
WinXP SP3 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 November 2009 at 1:52am |
|
Hi,
Maybe it was fixed after 12.1 but I can't catch it:
Execute 11/10/2009 9:52:07 AM
Execute 11/10/2009 9:52:08 AM Execute 11/10/2009 9:52:08 AM Execute 11/10/2009 9:52:08 AM Maybe you can check last evaluation ?
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
ijwelch
Senior Member
Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 November 2009 at 5:28am |
|
Still the same in 13.1. Don't know about 13.2. Seems click/mousedown is 'timing out' somehow - but mouseover effects etc still work ok.
It's ok though. I've reworked things so not so much cpu resources are used (treat the cause not the symptom) and all is well. |
|
|
ExtremeSuitePro 12.1.1
WinXP SP3 |
|
![]() |
|
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 |