Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
REPORTWND.CPP
Package: SNMP_source.rar [view]
Upload User: lvjun8202
Upload Date: 2013-04-30
Package Size: 797k
Code Size: 3k
Category:
SNMP
Development Platform:
C/C++
- // ReportWnd.cpp : implementation file
- //
- #include "stdafx.h"
- #include "OAM.h"
- #include "ReportWnd.h"
- #include "OutputReport.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CReportWnd
- CReportWnd::CReportWnd()
- {
- }
- CReportWnd::~CReportWnd()
- {
- }
- BEGIN_MESSAGE_MAP(CReportWnd, CWnd)
- //{{AFX_MSG_MAP(CReportWnd)
- ON_WM_NCCALCSIZE()
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- ON_MESSAGE(SM_PAGECHANGED,OnPageChanged)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CReportWnd message handlers
- void CReportWnd::ActivateScrollBar()
- {
- if(!m_wndSheet.GetSafeHwnd())
- return;
- int min = 0;
- int max = 1024;
- int page = 10;
- COutputReport * pWnd = (COutputReport *)m_wndSheet.GetActiveView();
- if(pWnd && pWnd->GetSafeHwnd())
- {
- max = pWnd->GetHScrollRange();
- }
- // BOOL bShow = NeedScroll();
- m_wndSheet.ShowScrollBar(max>0);
- if (max>0)
- {
- /* CRect rect; pWnd->GetClientRect(rect);
- SCROLLINFO scrollInfor;
- scrollInfor.nPage = rect.Width();
- scrollInfor.nMin = 0;
- scrollInfor.nMax = max+100;
- scrollInfor.fMask = SIF_RANGE;
- m_wndSheet.GetScrollBar().SetScrollInfo( &scrollInfor);
- */ m_wndSheet.GetScrollBar().SetScrollRange(min, max);
- }
- }
- BOOL CReportWnd::NeedScroll()
- {
- CRect rect; GetClientRect(rect);
- return TRUE;//rect.Width() < SumWidthColumns() - 1;
- }
- void CReportWnd::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
- {
- // TODO: Add your message handler code here and/or call default
- if(m_wndSheet.GetSafeHwnd())
- {
- CWnd * pWnd = m_wndSheet.GetActiveView();
- // if(pWnd && pWnd->GetSafeHwnd())
- // pWnd->ModifyStyle(WS_HSCROLL, 0);//, SWP_NOREDRAW | SWP_NOSENDCHANGING);
- }
- ModifyStyle(WS_HSCROLL, 0, SWP_NOREDRAW | SWP_NOSENDCHANGING);
- CWnd::OnNcCalcSize(bCalcValidRects, lpncsp);
- ActivateScrollBar();
- }
- int CReportWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
- // TODO: Add your specialized creation code here
- if (!m_wndSheet.GetSafeHwnd())
- {
- ModifyStyle(0, WS_CLIPCHILDREN);
- m_wndSheet.Attach(this);
- m_wndSheet.SetWindowPos(&CWnd::wndTop,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE);
- }
- return 0;
- }
- BOOL CReportWnd::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
- {
- // TODO: Add your specialized code here and/or call the base class
- ActivateScrollBar();
- return CWnd::OnNotify(wParam, lParam, pResult);
- }
- LRESULT CReportWnd::OnPageChanged(WPARAM pNewView, LPARAM)
- {
- if(pNewView)
- {
- ;//ActivateScrollBar();
- }
- return TRUE;
- }