Print Page | Close Window

[SOLVED](ribbonbar) pointers no more persistent!!

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=22319
Printed Date: 09 May 2024 at 3:54am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED](ribbonbar) pointers no more persistent!!
Posted By: Michl
Subject: [SOLVED](ribbonbar) pointers no more persistent!!
Date Posted: 05 June 2014 at 11:37am
How did you thought to works??

Try this!
  • Add controls to ribbon bar and save this pointer (result of Add)
  • Run app and resize application frame to minimum width
  • Now, the single controls should be groupped by parent button
  • click this button to popup/see your controls
  • Click on some button

If you now using your saved pointer, you see that this points to a freed memory block.

The reason is, that you frees the original controls!

                // we need to copy the popped ribbon group to the existing (in order not to lose user's changes)

                CXTPRibbonGroupPopupToolBar *pPopupToolbar = DYNAMIC_DOWNCAST(CXTPRibbonGroupPopupToolBar, m_pCommandBar);

                if (pPopupToolbar && pPopupToolbar->m_pRibbonGroup)
                {
                    m_pPopupGroup->RemoveAll();
                    m_pPopupGroup->Copy(pPopupToolbar->m_pRibbonGroup);
                }


I think, this problem is not implement correctly. Controls should force to move, not copy/duplicate, in other popups. It should be transparent where they should be displayed. It's the same control (e.g. button)!




Replies:
Posted By: Michl
Date Posted: 27 June 2014 at 2:58am
This article is solved. I already get a response from codejock guys.
I had got it wrong.

Quote
You should rely on correct pointer values returned from Add only immediately after a call to Add in order to change control's properties, in all other cases you can always find a conrol's pointer by control's ID. As for the custom controls, they have to be built taking into account this behavior.


Although I am not happy about this Wink
In my opinion, it should be irrelevant for programmer where codejock displays the control (directly in ribbon bar or in a popup for any reason)

Thanks for response



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