📄 prgtabtest.h
字号:
// PrgTabTest.h : interface of the PrgTabTest class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_PRGTABTEST_H__7A49D2CC_2E9C_11D2_B19E_0060084FA860__INCLUDED_)
#define AFX_PRGTABTEST_H__7A49D2CC_2E9C_11D2_B19E_0060084FA860__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
//TABLET: setup required here
//
#include <wintab.h>
//
// define what packet data is required here. A PACKET structure
// will be created by pktdef.h Only the required information
// will be returned in each packet, so some of the members will
// not be available, depending on your choices here. Change your code as appropriate.
// For multiple packet types refer to the WinTab API reference.
//
//#define PACKETDATA (PK_Z | PK_NORMAL_PRESSURE | PK_ORIENTATION | PK_TANGENT_PRESSURE)
//#define PACKETDATA (PK_Z | PK_NORMAL_PRESSURE)
//#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_ORIENTATION | PK_CURSOR)
//#define PACKETDATA (PK_Z | PK_NORMAL_PRESSURE | PK_ORIENTATION | PK_CURSOR)
#define PACKETDATA (PK_NORMAL_PRESSURE | PK_ORIENTATION | PK_CURSOR)
#define PACKETMODE 0
#include <pktdef.h>
//
/////////////////////////////////////////////////////////////////////////////
//
// JCB: This example is a CView class, but the tablet functions should work with
// any class derived from CCmdTarget
//
/////////////////////////////////////////////////////////////////////////////
class PrgTabTest : public CView
{
protected: // create from serialization only
PrgTabTest();
DECLARE_DYNCREATE(PrgTabTest)
// Attributes
public:
DocTabTest* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PrgTabTest)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
//JCB used to display statistics
CString m_strTiltWords;
CString m_strAngleWords;
CString m_strPresWords;
CString m_strButtonWords;
CString m_strPointWords;
CString m_strPacketWords;
CString m_strTabletWords;
//TABLET: members available throughout class
HCTX t_hTablet; // Tablet context
BOOL t_bTiltSupport; // TRUE if tablet provides tilt and direction information
// current pen statistics
UINT t_prsNew; // Pressure value
UINT t_curNew; // Cursor number
ORIENTATION t_ortNew; // Varios movement values, direction and tilt
CPoint m_pntMouseLoc; // Mouse pointer location, which is also the pen location
// tablet specific functions
HCTX InitTablet(HWND hWnd);
BOOL GetTabState(LPARAM lParam, WPARAM wParam, UINT & nTabPressure, int & nTabAltitude, int & nTabTwist, int & nTabCompass, UINT & nTabCursor);
BOOL IsTabletInstalled();
CString GetTabletName();
// used for example
void RepresentPen(CDC* pDC);
COLORREF ChangeColour(UINT nCursor = 0);
// adjustments used in example
double t_dblAltAdjust; // Tablet Altitude zero adjust
double t_dblAltFactor; // Tablet Altitude factor
double t_dblAziFactor; // Table Azimuth factor
//End Tablet specific
virtual ~PrgTabTest();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(PrgTabTest)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
afx_msg void OnTabPacket(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in PrgTabTest.cpp
inline DocTabTest* PrgTabTest::GetDocument()
{ return (DocTabTest*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PRGTABTEST_H__7A49D2CC_2E9C_11D2_B19E_0060084FA860__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -