Print Page | Close Window

CommandBars not processing mouse click

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=15570
Printed Date: 21 May 2025 at 4:17am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandBars not processing mouse click
Posted By: ijwelch
Subject: CommandBars not processing mouse click
Date Posted: 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



Replies:
Posted By: Oleg
Date Posted: 09 November 2009 at 3:25am
Hi,
 
Maybe you can create small demo to show it ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ijwelch
Date 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


Posted By: Oleg
Date 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


Posted By: ijwelch
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net