Print Page | Close Window

CXTPControlButton /CXTPPopupBar display

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3414
Printed Date: 09 November 2025 at 9:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlButton /CXTPPopupBar display
Posted By: craig
Subject: CXTPControlButton /CXTPPopupBar display
Date Posted: 15 December 2005 at 2:18pm
I am displaying CXTPControlButton's on my CXTPPopupBar.  I've done this numerous times with success, but for some reason this particular menu is getting buggy on me.  The only difference with this popup is that it only has Popup buttons and no other controls.  Here is my onCreateControl method and a snapshot of the problem:




int CGeoDbWnd::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{

    if (lpCreateControl->bToolBar)
    {
        // Maintenance popup
        if (lpCreateControl->nID == ID_GEODB_MAINTENANCE)
        {
            // Popup button to go on the menu
            CXTPControlPopup* pPopup = CXTPControlPopup::CreateControlPopup(xtpControlSplitButtonPo pup);

            // Bar to contain the controls
            CXTPPopupBar* pMaintenanceBar = (CXTPPopupBar*)CXTPPopupToolBar::CreateObject();
           
            // Vacuum Control
            CXTPControlButton* pVacuumBtn = new CXTPControlButton();
            pMaintenanceBar->GetControls()->Add(pVacuumBtn, ID_GEODB_VACUUM);

            // Vacuum Analyze Control
            CXTPControlButton* pVacuumAnalyzeBtn = new CXTPControlButton();
            pMaintenanceBar->GetControls()->Add(pVacuumAnalyzeBtn, ID_GEODB_VACUUM_ANALYZE);

            // Vacuum Full Control
            CXTPControlButton* pVacuumFullBtn = new CXTPControlButton();
            pMaintenanceBar->GetControls()->Add(pVacuumFullBtn, ID_GEODB_VACUUM_FULL);

            // Spatial Index Control
            CXTPControlButton* pSpatialIndexBtn = new CXTPControlButton();
            pMaintenanceBar->GetControls()->Add(pSpatialIndexBtn, ID_GEODB_SPATIAL_INDEX);

            // Hook the Maintenance Toolbar up to the Popup Button.
            pPopup->SetCommandBar(pMaintenanceBar);

            pMaintenanceBar->EnableCustomization(FALSE);  // Don't allow this toolbar to be managed by the user.
            pMaintenanceBar->InternalRelease();
            lpCreateControl->pControl = pPopup;

            //XTPImageManager()->SetIcon(ID_PT_FGCOLOR, ID_PT_FGCOLOR);
            return TRUE;
        }
    }

    return FALSE;
}




Replies:
Posted By: Oleg
Date Posted: 16 December 2005 at 4:12am

Hi,

May be you need

CXTPPopupBar::CreateObject();

instead

CXTPPopupToolBar::CreateObject();

 

to make it looks like popup bar and not like popup toolbar?



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: craig
Date Posted: 22 December 2005 at 11:24am


Its always so obvious once I see the mistake I made.  Copyitis rears its ugly head.

Thanks Oleg.



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