Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPControlButton /CXTPPopupBar  display
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlButton /CXTPPopupBar display

 Post Reply Post Reply
Author
Message
craig View Drop Down
Groupie
Groupie


Joined: 11 August 2005
Location: United States
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote craig Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlButton /CXTPPopupBar display
    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;
}

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
craig View Drop Down
Groupie
Groupie


Joined: 11 August 2005
Location: United States
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote craig Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.