97 lines
3.0 KiB
C++
97 lines
3.0 KiB
C++
// SLNKDwfViewerView.h : interface of the CSLNKDwfViewerView class
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
#include "resource.h"
|
|
//#include "atlgdix.h"
|
|
|
|
void PaintToDC(HDC dc, CString dwfPath, int nPage,
|
|
CWhip2DCImpl &iWhip2DC, CSize wSize,
|
|
BOOL forPrint = FALSE);
|
|
|
|
class CMainFrame;
|
|
class CSLNKDwfViewerView : public CZoomScrollWindowImpl<CSLNKDwfViewerView>
|
|
// , public CDoubleBufferImpl<CSLNKDwfViewerView>
|
|
// , public COffscreenDraw<CSLNKDwfViewerView>
|
|
// , public CPrintPreviewWindowImpl<CSLNKDwfViewerView>
|
|
{
|
|
public:
|
|
DECLARE_WND_CLASS(NULL)
|
|
|
|
//CSLNKDwfViewerView();
|
|
~CSLNKDwfViewerView();
|
|
CSLNKDwfViewerView(CMainFrame& parent);
|
|
BOOL PreTranslateMessage(MSG* pMsg);
|
|
|
|
BEGIN_MSG_MAP(CSLNKDwfViewerView)
|
|
MESSAGE_HANDLER(WM_CREATE, OnCreate)
|
|
MESSAGE_HANDLER(WM_SIZE, OnSize)
|
|
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
|
|
MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)
|
|
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
|
|
MESSAGE_HANDLER(WM_RBUTTONDOWN, OnRButtonDown)
|
|
MESSAGE_HANDLER(WM_RBUTTONUP, OnRButtonUp)
|
|
MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
|
|
|
|
// CHAIN_MSG_MAP(CPrintPreviewWindowImpl<CSLNKDwfViewerView>)
|
|
// CHAIN_MSG_MAP(CDoubleBufferImpl<CSLNKDwfViewerView>)
|
|
// CHAIN_MSG_MAP(COffscreenDraw<CSLNKDwfViewerView>)
|
|
CHAIN_MSG_MAP(CZoomScrollWindowImpl<CSLNKDwfViewerView>)
|
|
END_MSG_MAP()
|
|
|
|
LRESULT OnMouseWheel(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
|
LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
|
{
|
|
return 1; // no background painting needed. Scheelt geflikker
|
|
}
|
|
|
|
int OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
|
{
|
|
CZoomScrollWindowImpl::OnCreate(uMsg, wParam, lParam, bHandled);
|
|
// HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);
|
|
return 1;
|
|
}
|
|
|
|
LRESULT OnRButtonDown(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
LRESULT OnRButtonUp(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled);
|
|
|
|
LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
|
|
{
|
|
SetFocus();
|
|
bHandled = FALSE;
|
|
return 0;
|
|
}
|
|
|
|
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
void DoPaint(CDCHandle dc);
|
|
|
|
void SetDWF(const CString &dwfPath);
|
|
void SetPage(int nPage);
|
|
CWhip2DCImpl *GetWhip2DC()
|
|
{
|
|
return &m_iWhip2DC;
|
|
}
|
|
|
|
CString m_dwfPath;
|
|
private:
|
|
CDC m_MemDC;
|
|
CBitmap *m_Bitmap;
|
|
CPoint m_BitmapViewportOrigin; // zodat je weet wanneer opnieuw genereren
|
|
CSize m_BitmapViewportExt;
|
|
CRect m_BitmapClientRect;
|
|
|
|
int m_nPage;
|
|
CWhip2DCImpl m_iWhip2DC;
|
|
BOOL m_busyPanning;
|
|
CPoint m_PanStartPoint, m_PanTotal, m_PanStartScroll;
|
|
CDCHandle m_hDCOriginal;
|
|
static BOOL my_progress_action(void *param, double progress);
|
|
time_t m_Timer;
|
|
|
|
CMainFrame & m_Parent;
|
|
};
|