Print Page | Close Window

Problem with popup toolbar

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=7235
Printed Date: 12 November 2025 at 11:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Problem with popup toolbar
Posted By: Ashok
Subject: Problem with popup toolbar
Date Posted: 25 May 2007 at 3:24am
Hai,
Please go through the below code. The code for bringing the popup toolbar when you click the toolbar button. My problem is when I click at the first time the popup toolbar is not popuping up.but at the second click it is coming. What is the reason?
 
 
In Oncreate(...)
CXTPToolBar* p2DToolBar = (CXTPToolBar*)pCommandBars->Add(_T("2D Graph"), xtpBarLeft);

if (!p2DToolBar || !p2DToolBar->LoadToolBar(IDR_GC_TOOLBAR))

{

TRACE0("Failed to create 2D Graph toolbar\n");

return -1;

}

p2DToolBar->EnableToolTips(TRUE);

p2DToolBar->SetIconSize(CSize(31,31));

p2DToolBar->SetButtonSize(CSize(38,37));

p2DToolBar->GetImageManager()->SetIcons(IDB_2DGRAPH_CREATE, graph_create_buttons, _countof(graph_create_buttons), CSize(31,31), xtpImageNormal);

p2DToolBar->ShowExpandButton(FALSE);

Other function...
 
// Get a pointer to the command bars object.

CXTPCommandBars* pCommandBars = GetCommandBars();

if(pCommandBars == NULL)

{

TRACE0("Failed to create command bars object.\n");

return; // fail to create

}

CXTPControl* pControlIcons = pCommandBars->FindControl(xtpControlButton, ID_GC_MAIN_2DTERNARY, TRUE, FALSE);

if (pControlIcons)

{

CXTPControlPopup* pPopup = (CXTPControlPopup*)pControlIcons->GetControls()->SetControlType(pControlIcons, xtpControlButtonPopup);

pPopup->SetFlags(xtpFlagManualUpdate);

CXTPPopupToolBar* pPopupBar = CXTPPopupToolBar::CreatePopupToolBar(GetCommandBars());

pPopupBar->LoadToolBar(IDR_PALETTE_TERNARY);

pPopupBar->SetIconSize(CSize(33,33));

pPopupBar->SetButtonSize(CSize(40,39));

pPopupBar->GetImageManager()->SetIcons(IDB_TERNARY_PALETTE, graph_create_ternary_plot_buttons, _countof(graph_create_ternary_plot_buttons), CSize(33,33), xtpImageNormal);

pPopupBar->SetWidth(80);

pPopup->SetCommandBar(pPopupBar);

pPopupBar->InternalRelease();

}




Replies:
Posted By: Oleg
Date Posted: 25 May 2007 at 4:23am
Code looks right. Think problem in something else - may be you catch some event and clear something.

When this "other function" called?


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


Posted By: Ashok
Date Posted: 25 May 2007 at 5:43am
Hai'
   The other function is called like this in mainframe.cpp

ON_COMMAND(ID_GC_MAIN_2DTERNARY,OnGC2DTernary)



Posted By: Ashok
Date Posted: 25 May 2007 at 6:15am
Hai,
   In the same popup toolbars some toolbar showing only the text instead of bitmap image.Please help.


Posted By: Oleg
Date Posted: 25 May 2007 at 6:21am

Hi,

its wrong place.
Create it in OnCreate method or better in OnCreateControl.


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


Posted By: Ashok
Date Posted: 25 May 2007 at 8:22am
Hi,
  I can't do it in OnCreate or OnCreateControl because I have to click the toolbar,it would show the popup toolbar. Why some toolbars showing popup toolbar with text only not the bitmap images.Please help


Posted By: Oleg
Date Posted: 25 May 2007 at 8:41am
Hi,
Check Samples\CommandBars\TearOffPopups  - you click borders popup and it show popup toolbar.
 
They show text because don't have associated icons. check IDB_TERNARY_PALETTE.


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



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