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 » RE: RibbonMenu question (Part3) Collapse All
Subject Author Date
tera tera Jun 1, 2009 - 11:37 PM

Hello.


With the following sample

http://ifreeta.dee.cc/20090508/RibbonBarMDI.lzh


When I execute MenuRebuild,

Quick accelerator information of ClipBorad which I added is deleted.



As the specifications that I expect

I perform MenuReuild ,

But please do not erase the QuickAccess information of clipborad.

Technical Support Jun 11, 2009 - 9:25 AM

We improved the CExtRibbonBar and CExtRibbonPage classes. Now the SetButtons() method works and causes no crashes. Please drop us an e-mail to the support mail box at this web site so we will provide you with the FTP download for the source code update.

tera tera Jun 11, 2009 - 7:12 PM

Thank you for a revision.

I am saved.

By the way,

Does not MenuRebuild have any problem in following program-code?


 


 void MenuRebuild( CExtRibbonNode * pRibbonNode )  {   CMemFile _file;     CArchive arSave( &_file, CArchive::store );     MenuInfoGetDefault()->AccelTableSerialize( arSave );     arSave.Close();

// // // PROF-UIS TECH SUPPORT // The folloiwing code snippet fixes the assertion problem. // You are reinitializing the ribbon bar control using // the same command tree as was used in it before. // But after the quick access toolbar customization, this command tree // contains some temporarily command nodes. // So, such command tree should not be assigned to the ribbon bar again. // The code snippet below just cleans temporarily command nodes. // //

//CExtRibbonNodeQuickAccessButtonsCollection * pNodeColQATB = Ribbon_GetQuickAccessRootNode(); //INT nIndex, nCount = pNodeColQATB->GetNodeCount(); //for( nIndex = 0; nIndex < nCount; ) //{ // CExtCustomizeCmdTreeNode * pNode = pNodeColQATB->ElementAt( nIndex ); // if( pNode == NULL ) // { //  nIndex ++; //  continue; // } // ASSERT_VALID( pNode ); // if( (pNode->GetFlags()&__ECTN_RIBBON_QA_CLONED_COPY) != 0 ) // { //  pNode->RemoveSelf( NULL ); //  nCount --; //  continue; // } // else // { //  pNode->ModifyFlags(  0, __ECTN_TBB_HIDDEN ); //  nIndex ++; //  continue; // } //} // for( nIndex = 0; nIndex < nCount; )

  SetButtons( NULL );     SetButtons( pRibbonNode );     _file.Seek( 0, CFile::begin );     CArchive arLoad( &_file, CArchive::load );     MenuInfoGetDefault()->AccelTableSerialize( arLoad );     arLoad.Close();     _RecalcPositionsImpl();     CMDIFrameWnd * pFrame = (CMDIFrameWnd *)AfxGetMainWnd();     OnUpdateCmdUI( pFrame , TRUE ); // // PROF-UIS TECH SUPPORT // We are sorry, we forgot to invoke the following line of code // which updates in-MFC accelerator tables: //   OnUpdateAccelGlobalInfo( true );

    RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_ALLCHILDREN );     CExtPaintManager::stat_PassPaintMessages();  };

};

Technical Support Jun 12, 2009 - 5:59 AM

This will work because we tested the latest ribbon bar using the same version of the MenuRebuild() method. Of course, we also checked the accelerator table restoring.

Technical Support Jun 3, 2009 - 4:33 AM

We are trying to improve the ribbon bar’s source code and make the SetButtons() method working without any preliminary and final serializations and without removing temporarily command nodes as we did in scope of your project. Please give us 2-3 days more.

tera tera Jun 8, 2009 - 6:17 PM

Hi


I want you to teach the revision days.

I want a revision soon.


Give my best regards.

Technical Support Jun 9, 2009 - 12:29 PM

We are sorry but the requested ribbon bar improvement is not finished yet. It requires some serious modification of the ribbon bar initialization and serialization procedures. Please give us a few days more.

tera tera Jun 2, 2009 - 12:35 AM

tera tera Jun 2, 2009 - 5:58 PM

I am troubled.

I ask for an answer.