![]() |
How to Add Close Button to CXTPTabControl |
Post Reply
|
| Author | |
qinzhw
Newbie
Joined: 25 November 2005 Location: Colombia Status: Offline Points: 16 |
Post Options
Thanks(0)
Quote Reply
Topic: How to Add Close Button to CXTPTabControlPosted: 26 November 2005 at 12:20am |
|
I want to devlop an application like the sample of Samples\Common\TabbedView, the views I want to add to the CXTPTabControl are derived from CHtmlView and CFormView, and I want to add or delete tab view dynamically, so I want to display a 'Close' Button or something else for user to close the active tab view, how can I do ? my XT is 9.6 thank you very much if you can answer my question |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 November 2005 at 6:31am |
|
try m_wndTabControl.FindNavigateButton(xtpTabNavigateButtonClose )->SetFlags(xtpTabNavigateButtonAlways); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 November 2005 at 6:32am |
|
ps. not sure but may be "xtpTabNavigateButtonClose" in 9.6 called as XTP_TABMANAGER_BUTTON_CLOSE |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
qinzhw
Newbie
Joined: 25 November 2005 Location: Colombia Status: Offline Points: 16 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 November 2005 at 9:15am |
|
Unhandled exception at 0x00856626 (XTP9601Libd.dll) in TabCtrlTest.exe: 0xC0000005: Access violation reading location 0x00000038. |
|
![]() |
|
qinzhw
Newbie
Joined: 25 November 2005 Location: Colombia Status: Offline Points: 16 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 November 2005 at 9:17am |
|
sorry, the error occurs at the time I am closing all the tab view in a view.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 November 2005 at 4:02am |
|
I need call stack. May be it is something in your sources.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
qinzhw
Newbie
Joined: 25 November 2005 Location: Colombia Status: Offline Points: 16 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 November 2005 at 7:39am |
|
my sources are including a lot of chinese characters, I don't know if you can read them normally, and I found this problem exists when I add a line as follows : m_wndTabControl.FindNavigateButton(xtpTabNavigateButtonClose )->SetFlags(xtpTabNavigateButtonAlways); in the end of the CTabbedViewView::OnCreate(LPCREATESTRUCT lpCreateStruct) function in TabbedView Examples. shall I write a line as m_wndTabControl.FindNavigateButton(xtpTabNavigateButtonClose )->SetFlags(xtpTabNavigateButtonNone); before I close all the tabItems? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 November 2005 at 2:47am |
|
ic. Problem that you copied code from our sample that don't check that GetSelectedItem() can be NULL because it have no ability to close views.
You must add these checks. F.e. 1. in void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle) add if (pView && pView->m_wndTabControl.GetSelectedItem()) 2. in CTabbedViewView::OnSelectedChanged add
if (m_wndTabControl.GetSelectedItem()) pFrame->SetActiveView(pView); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
qinzhw
Newbie
Joined: 25 November 2005 Location: Colombia Status: Offline Points: 16 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 November 2005 at 6:51am |
thx!!!!!!!!!!!!!!!
|
|
![]() |
|
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 |