Print Page | Close Window

I combined "ReportSample" and "TabbedView", but ..

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=10827
Printed Date: 15 November 2025 at 4:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: I combined "ReportSample" and "TabbedView", but ..
Posted By: shineryu
Subject: I combined "ReportSample" and "TabbedView", but ..
Date Posted: 29 May 2008 at 7:40am
In "ReportSample", the vertical scrollbar is like this:
 
I combined "ReportSample" and "TabbedView", but the scrollbar:
 
 
Why?



Replies:
Posted By: shineryu
Date 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;
}
 


Posted By: Oleg
Date Posted: 29 May 2008 at 8:58am
Hi,
See code of Reportsample - it adds CXTPScrollBar.


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


Posted By: shineryu
Date 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?


Posted By: Oleg
Date Posted: 29 May 2008 at 3:06pm
Hi,
 
Sorry, seems no :(


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


Posted By: shineryu
Date 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 https://forum.codejock.com/uploads/20080530_002000_TabbedReport.zip - 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?


Posted By: Oleg
Date 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;

}

after

if (!InitCommandBars())

return -1;



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


Posted By: shineryu
Date Posted: 30 May 2008 at 8:48am
yes!!
 
thank u, Oleg!



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