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 Tech Support » Ribbon drawing issues Collapse All
Subject Author Date
Jean Gareau Aug 25, 2009 - 6:01 PM

We converted an app (using 2.85) by replacing its menu by a ribbon. Thanks to the RibbonBar example, the transition went smoothly. Everything is working, but there’s some bar redrawing that occurs when the application is launched. For instance, on Vista, the Quick Access Toolbar is clearly drawn (with a black background) under the application’s title bar and then is "moved up" in the title bar after a very noticeable delay (maybe 500 ms). The behavior is also similar in XP.


Interestingly enough, we had this issue in Debug mode only. When we tried in Release, that issue did not occur (we could not see it). We went ahead and added all the nodes in the ribbon, and at some point the problem came back, in both Debug and Release mode. The ribbon code is nearly identical to the RibbonBar.


It should be noted that after that delay of 500 ms (or so), the application is properly redrawn: both the ribbon and title bar (with the File icon and the Quick Access Toolbar) are ok.


Do you have any thoughts as to why there is that "drawing delay" and how it can be avoided?

Jean Gareau Aug 26, 2009 - 1:00 PM

We replied a little too fast. although the delay is gone, some of the drawing is incorrect until we resize the app (even by 1 pixel). We sent you an email with a screenshot. Thank you.

Technical Support Aug 27, 2009 - 7:56 AM

We received your e-mail and replied it.

Jean Gareau Aug 26, 2009 - 12:27 PM

Problem solved.


To answer your question: it uses a timer but it’s a one-shot timer that is set in OnCreate() for 1500 ms i.e. SetTimer(1, 1500, NULL). OnIdle() is not overridden. So that was not the issue in our case.


But we looked again at the RibbonBar sample and found out that the paint manager is installed in the main frame’s ctor. We solved the issue by moving it from our app’s main frame’s OnCreate (where it was) to the ctor as well, and the issue just went away.


 

Technical Support Aug 26, 2009 - 11:37 AM

Do you use any "heavy" code in the WM_TIMER message handler methods or in the application’s OnIdle() virtual method? You can send us your main frame’s source code and we will check it.