Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - I combined "ReportSample" and "TabbedView", but ..
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
Message
shineryu View Drop Down
Groupie
Groupie


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
shineryu View Drop Down
Groupie
Groupie


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post 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;
}
 
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: 29 May 2008 at 8:58am
Hi,
See code of Reportsample - it adds CXTPScrollBar.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
shineryu View Drop Down
Groupie
Groupie


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post 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?
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: 29 May 2008 at 3:06pm
Hi,
 
Sorry, seems no :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
shineryu View Drop Down
Groupie
Groupie


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post 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?
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: 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
Back to Top
shineryu View Drop Down
Groupie
Groupie


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post Posted: 30 May 2008 at 8:48am
yes!!
 
thank u, Oleg!
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.