![]() |
Problem with popup toolbar |
Post Reply
|
| Author | |
Ashok
Senior Member
Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
Quote Reply
Topic: Problem with popup toolbarPosted: 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(); } |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Ashok
Senior Member
Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
Quote Reply
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) |
|
![]() |
|
Ashok
Senior Member
Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Ashok
Senior Member
Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |