![]() |
I combined "ReportSample" and "TabbedView", but .. |
Post Reply
|
| Author | |
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Topic: I combined "ReportSample" and "TabbedView", but ..Posted: 29 May 2008 at 7:40am |
|
In "ReportSample", the vertical scrollbar is like this:
![]() I combined "ReportSample" and "TabbedView", but the scrollbar:
![]() Why?
|
|
![]() |
|
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 May 2008 at 7:43am |
|
the code is like this:
class CTabbedReport : public CXTPReportView { public: CXTPScrollBar m_wndScrollBar; protected: CTabbedReport(){} DECLARE_DYNCREATE(CTabbedReport) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_MESSAGE_MAP() }; IMPLEMENT_DYNCREATE(CTabbedReport, CXTPReportView)
BEGIN_MESSAGE_MAP(CTabbedReport, CXTPReportView)
ON_WM_CREATE() END_MESSAGE_MAP() int CTabbedReport::OnCreate(LPCREATESTRUCT lpCreateStruct)
{ if (CXTPReportView::OnCreate(lpCreateStruct) == -1) return -1; m_wndReport.GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);
m_wndScrollBar.Create(WS_CHILD | WS_VISIBLE | SBS_VERT, CRect(0, 0, 0, 0), this, 100);
m_wndScrollBar.SetScrollBarStyle(xtpScrollStyleOffice2007Dark); SetScrollBarCtrl(&m_wndScrollBar); return 0;
} //
int CTabbedViewView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{ if (CView::OnCreate(lpCreateStruct) == -1) return -1; //.......
AddView(RUNTIME_CLASS(CResourceTreeView), _T("Resource Tree"), 2);
AddView(RUNTIME_CLASS(CPropertiesView), _T("Properties"), 1); AddView(RUNTIME_CLASS(CTabbedReport), _T("Report"), 1); return 0;
} |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 May 2008 at 8:58am |
|
Hi,
See code of Reportsample - it adds CXTPScrollBar.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 May 2008 at 9:55am |
|
sorry, i forget this: CXTPPaintManager::SetTheme(xtpThemeRibbon);
It's OK now.
thanks, oleg.
but can I add a horizontal CXTPScrollbar?
![]() |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 May 2008 at 3:06pm |
|
Hi,
Sorry, seems no :(
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 May 2008 at 12:25am |
|
Hello Oleg,
Excuse me for asking again!
In my app, I don't need document, so I created a project without document architecture.
I added a tabbedview and a reportview just like before.
but the scrollbar goes back to old style:
![]() I attached my project here uploads/20080530_002000_TabbedReport.zip
I think may be it is because my CChildView is not derived from CView but CWnd.
can you help me?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 May 2008 at 1:46am |
|
Hi,
Add
m_wndScrollBar .SetCommandBars(((CXTPFrameWnd*)GetParentFrame())->GetCommandBars());and move // create a view to occupy the client area of the frame if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL)){ TRACE0("Failed to create view window\n"); return -1;} afterif (!InitCommandBars()) return -1; |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 May 2008 at 8:48am |
|
yes!!
thank u, Oleg!
|
|
![]() |
|
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 |