Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » sluggish UI: please help Collapse All
Subject Author Date
locke cole Jun 22, 2004 - 2:14 PM

I’ve used a CExtToolControlBar in my app. It works fine, but I find that the buttons respond sluggishly. You can notice this in the ’FunnyBars’ app as well (in fact in any app that uses the control).


The problem is that if you double-click on the button, it totally ignores the second click. Say if you had an undo button and you want to quickly undo a bunch of stuff... it reacts very slowly and it loses half of your clicks. It feels amateurish.


I don’t know why it’s doing this but it seems like a bug to me. Is there any way to speed it up? I’d like to keep the rest of the functionality intact. Everything else is great.


Thanks in advance


--


Jan


 

Technical Support Jun 24, 2004 - 3:46 AM

Dear Jan,

Any Prof-UIS control bar is a window, whose window class is registered with the CS_DBLCLKS class style. This allows the double-click mouse messages to be sent to the window. These messages are required when the user undockes the control bar by double clicking on the control bar’s caption or gripper. You may use your own class derived from CExtControlBar and handle the WM_LBUTTONDBLCLICK windows message. You can detect whether any toolbar button is clicked and re-send the WM_LBUTTONDBLCLICK as two single button-down and button-up messages.

locke cole Jun 27, 2004 - 2:56 AM

hmm ok I’ll give that a try. It’s weird because if I look at other programs (like visual studio). Their toolbars can be re-docked by double-clicking on them, but if you double click on their buttons it registers as two individual clicks.
How do they do that?

Technical Support Jun 29, 2004 - 3:24 AM

Dear Jan,

Please find the CExtToolControlBar::OnLButtonDblClk method in the ExtToolControlBar.cpp file and replace it with the following code:

void CExtToolControlBar::OnLButtonDblClk(UINT nFlags,
                                          CPoint point)
{
    if( m_bRowResizing || m_bRowRecalcing || m_bDragging )
 {
  CExtControlBar::OnLButtonDblClk(nFlags, point);
  return;
 }
int nBtnIdx = _HitTestImpl(point);
 if( nBtnIdx >= 0 )
 {
  WPARAM wParam = WPARAM(nFlags);
  LPARAM lParam = MAKELPARAM( point.x, point.y );
  SendMessage( WM_LBUTTONUP, wParam, lParam );
  SendMessage( WM_LBUTTONDOWN, wParam, lParam );
  return;
 } // if( nBtnIdx >= 0 )
 CExtControlBar::OnLButtonDblClk(nFlags,point);
}
Now you should get what you need.

locke cole Jul 1, 2004 - 3:49 AM

great! this works perfectly thanks very much