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.
Subject |
Author |
Date |
|
Neville Franks
|
Dec 16, 2003 - 11:38 PM
|
Hi, I’ve got several toolbar combo’s based on the Style Editor sample app and I want to update the combo current selection (font name/size etc.) as the user moves around in the text. My only problem is getting the combo to redraw efficiently.
I’ve added the following OnUpdatexxx:
void CFMNView::OnUpdateGenericEditRedraw(CCmdUI* pCmdUI) { pCmdUI->Enable( Editing() );
// Force Toolbar Combo to show correct Style. pMainFrame()->CExtCustomizeSite::RedrawCommandItems( pCmdUI->m_nID ); }
which works, however with three toolbar combos (ie. 3 calls to RedrawCommandItems()) it slows down my app considerably. So what is the best, most efficient way of doing this.
I’d also like to only update the respective combo’s if the selection actually needs changing (eg. caret is on text which is a different size to combo).
Thanks, Neville
|
|
Technical Support
|
Dec 18, 2003 - 7:18 AM
|
Dear Neville, The following code seems to be a solution to what you need: CExtCustomizeSite::RedrawCommandItems(nID0, false) CExtCustomizeSite::RedrawCommandItems(nID1, false)
. . . CExtCustomizeSite::RedrawCommandItems(nIDN, false) CExtCustomizeSite::UpdateAllCommandItems() ;
That should increase the speed.
|
|