Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Problem with popup toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with popup toolbar

 Post Reply Post Reply
Author
Message
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post Topic: Problem with popup toolbar
    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();

}

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: 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
Back to Top
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post 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.
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: 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
Back to Top
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post 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
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: 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
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.032 seconds.