initial
This commit is contained in:
85
public/wintab/examples/mfc_demo/demodoc.cpp
Normal file
85
public/wintab/examples/mfc_demo/demodoc.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
// MFC_DEMODoc.cpp : implementation of the CMFC_DEMODoc class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
#include "point.h"
|
||||
|
||||
#include "DEMODoc.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMFC_DEMODoc, CDocument)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMFC_DEMODoc, CDocument)
|
||||
//{{AFX_MSG_MAP(CMFC_DEMODoc)
|
||||
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc construction/destruction
|
||||
|
||||
CMFC_DEMODoc::CMFC_DEMODoc()
|
||||
{
|
||||
pt_lst = new list<point>;
|
||||
}
|
||||
|
||||
CMFC_DEMODoc::~CMFC_DEMODoc()
|
||||
{
|
||||
delete pt_lst;
|
||||
}
|
||||
|
||||
BOOL CMFC_DEMODoc::OnNewDocument()
|
||||
{
|
||||
if (!CDocument::OnNewDocument())
|
||||
return FALSE;
|
||||
|
||||
// Clear the point list
|
||||
delete pt_lst;
|
||||
pt_lst = new list<point>;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc serialization
|
||||
|
||||
void CMFC_DEMODoc::Serialize(CArchive& ar)
|
||||
{
|
||||
if (ar.IsStoring())
|
||||
{
|
||||
// TODO: add storing code here
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: add loading code here
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMFC_DEMODoc::AssertValid() const
|
||||
{
|
||||
CDocument::AssertValid();
|
||||
}
|
||||
|
||||
void CMFC_DEMODoc::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CDocument::Dump(dc);
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc commands
|
||||
66
public/wintab/examples/mfc_demo/demodoc.h
Normal file
66
public/wintab/examples/mfc_demo/demodoc.h
Normal file
@@ -0,0 +1,66 @@
|
||||
// MFC_DEMODoc.h : interface of the CMFC_DEMODoc class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MFC_DEMODOC_H__B7D0AFEC_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MFC_DEMODOC_H__B7D0AFEC_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "point.H"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CMFC_DEMODoc : public CDocument
|
||||
{
|
||||
list<point> * pt_lst;
|
||||
|
||||
protected: // create from serialization only
|
||||
CMFC_DEMODoc();
|
||||
DECLARE_DYNCREATE(CMFC_DEMODoc)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
list<point> * GetLst( void ) { return pt_lst; };
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMFC_DEMODoc)
|
||||
public:
|
||||
virtual BOOL OnNewDocument();
|
||||
virtual void Serialize(CArchive& ar);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMFC_DEMODoc();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMFC_DEMODoc)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MFC_DEMODOC_H__B7D0AFEC_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
179
public/wintab/examples/mfc_demo/demoview.cpp
Normal file
179
public/wintab/examples/mfc_demo/demoview.cpp
Normal file
@@ -0,0 +1,179 @@
|
||||
// MFC_DEMOView.cpp : implementation of the CMFC_DEMOView class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
|
||||
#include "DEMODoc.h"
|
||||
#include "DEMOView.h"
|
||||
|
||||
#include <wintab.h>
|
||||
|
||||
#define PACKETDATA PK_X | PK_Y | PK_BUTTONS
|
||||
#define PACKETMODE 0
|
||||
#include <pktdef.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMFC_DEMOView, CView)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMFC_DEMOView, CView)
|
||||
ON_MESSAGE(WT_PACKET, OnWTPacket)
|
||||
//{{AFX_MSG_MAP(CMFC_DEMOView)
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView construction/destruction
|
||||
|
||||
CMFC_DEMOView::CMFC_DEMOView()
|
||||
{
|
||||
csr.x = -1;
|
||||
prev_pkButtons = 0;
|
||||
pWTMutex = new CMutex( TRUE, NULL, NULL );
|
||||
hCtx = 0;
|
||||
}
|
||||
|
||||
CMFC_DEMOView::~CMFC_DEMOView()
|
||||
{
|
||||
delete pWTMutex;
|
||||
if( hCtx )
|
||||
WTClose( hCtx );
|
||||
}
|
||||
|
||||
BOOL CMFC_DEMOView::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
return CView::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView drawing
|
||||
|
||||
void CMFC_DEMOView::OnDraw(CDC* pDC)
|
||||
{
|
||||
CMFC_DEMODoc* pDoc = GetDocument();
|
||||
ASSERT_VALID(pDoc);
|
||||
|
||||
csr.x = -1;
|
||||
|
||||
list<point> * lst = pDoc->GetLst();
|
||||
list<point>::iterator i = lst->begin();
|
||||
while( i != lst->end() ) {
|
||||
if( i->x >= 0 )
|
||||
pDC->LineTo(i->x,i->y);
|
||||
else
|
||||
pDC->MoveTo(abs(i->x),abs(i->y));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMFC_DEMOView::AssertValid() const
|
||||
{
|
||||
CView::AssertValid();
|
||||
}
|
||||
|
||||
void CMFC_DEMOView::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CView::Dump(dc);
|
||||
}
|
||||
|
||||
CMFC_DEMODoc* CMFC_DEMOView::GetDocument() // non-debug version is inline
|
||||
{
|
||||
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFC_DEMODoc)));
|
||||
return (CMFC_DEMODoc*)m_pDocument;
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView message handlers
|
||||
|
||||
LRESULT CMFC_DEMOView::OnWTPacket(WPARAM wSerial, LPARAM hCtx)
|
||||
{
|
||||
// Read the packet
|
||||
PACKET pkt;
|
||||
WTPacket( (HCTX)hCtx, wSerial, &pkt );
|
||||
|
||||
// Process packets in order, one at a time
|
||||
CSingleLock lock( pWTMutex, TRUE );
|
||||
|
||||
CDC *pDC = GetDC();
|
||||
|
||||
// Get window size
|
||||
RECT window_rect;
|
||||
GetWindowRect( &window_rect );
|
||||
POINT size;
|
||||
size.x = window_rect.right - window_rect.left;
|
||||
size.y = window_rect.bottom - window_rect.top;
|
||||
|
||||
// Erase the old cursor
|
||||
if( csr.x >= 0 ) {
|
||||
CRgn r;
|
||||
r.CreateRectRgn( csr.x - 2, csr.y - 2, csr.x + 2, csr.y + 2 );
|
||||
pDC->InvertRgn( &r );
|
||||
}
|
||||
|
||||
csr.x = (size.x * pkt.pkX) / lc.lcInExtX;
|
||||
csr.y = size.y - (size.y * pkt.pkY) / lc.lcInExtY;
|
||||
|
||||
if( pkt.pkButtons ) {
|
||||
CMFC_DEMODoc *pDoc = GetDocument();
|
||||
list<point> * lst = pDoc->GetLst();
|
||||
|
||||
if( prev_pkButtons ) {
|
||||
|
||||
list<point>::iterator i = lst->end();
|
||||
i--;
|
||||
pDC->MoveTo(abs(i->x),abs(i->y));
|
||||
|
||||
lst->push_back(csr);
|
||||
pDC->LineTo(csr);
|
||||
} else {
|
||||
POINT pt;
|
||||
pt.x = -csr.x;
|
||||
pt.y = -csr.y;
|
||||
lst->push_back(pt);
|
||||
}
|
||||
}
|
||||
|
||||
prev_pkButtons = pkt.pkButtons;
|
||||
|
||||
// Draw a new cursor
|
||||
CRgn r;
|
||||
r.CreateRectRgn( csr.x - 2, csr.y - 2, csr.x + 2, csr.y + 2 );
|
||||
pDC->InvertRgn( &r );
|
||||
|
||||
ReleaseDC( pDC );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int CMFC_DEMOView::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CView::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
// Open a Wintab context
|
||||
|
||||
// Get default context information
|
||||
WTInfo( WTI_DEFCONTEXT, 0, &lc );
|
||||
|
||||
// Open the context
|
||||
lc.lcPktData = PACKETDATA;
|
||||
lc.lcPktMode = PACKETMODE;
|
||||
lc.lcOptions = CXO_MESSAGES;
|
||||
//hCtx = WTOpen( m_hWnd, &lc, TRUE );
|
||||
hCtx = WTOpen( m_hWnd, &lc, TRUE );
|
||||
return 0;
|
||||
}
|
||||
80
public/wintab/examples/mfc_demo/demoview.h
Normal file
80
public/wintab/examples/mfc_demo/demoview.h
Normal file
@@ -0,0 +1,80 @@
|
||||
// MFC_DEMOView.h : interface of the CMFC_DEMOView class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#if !defined(AFX_MFC_DEMOVIEW_H__B7D0AFEE_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MFC_DEMOVIEW_H__B7D0AFEE_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#include <afxmt.h>
|
||||
#include <windows.h>
|
||||
#include <wintab.h>
|
||||
|
||||
#include "point.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CMFC_DEMOView : public CView
|
||||
{
|
||||
CMutex *pWTMutex;
|
||||
POINT csr;
|
||||
HCTX hCtx;
|
||||
unsigned prev_pkButtons;
|
||||
LOGCONTEXT lc;
|
||||
|
||||
protected: // create from serialization only
|
||||
CMFC_DEMOView();
|
||||
DECLARE_DYNCREATE(CMFC_DEMOView)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
CMFC_DEMODoc* GetDocument();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMFC_DEMOView)
|
||||
public:
|
||||
virtual void OnDraw(CDC* pDC); // overridden to draw this view
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
protected:
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMFC_DEMOView();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
afx_msg LRESULT OnWTPacket(WPARAM, LPARAM);
|
||||
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMFC_DEMOView)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnCancelMode();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#ifndef _DEBUG // debug version in MFC_DEMOView.cpp
|
||||
inline CMFC_DEMODoc* CMFC_DEMOView::GetDocument()
|
||||
{ return (CMFC_DEMODoc*)m_pDocument; }
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MFC_DEMOVIEW_H__B7D0AFEE_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
70
public/wintab/examples/mfc_demo/mainfrm.cpp
Normal file
70
public/wintab/examples/mfc_demo/mainfrm.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
// MainFrm.cpp : implementation of the CMainFrame class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
|
||||
#include "MainFrm.h"
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
|
||||
//{{AFX_MSG_MAP(CMainFrame)
|
||||
ON_WM_PAINT()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame construction/destruction
|
||||
|
||||
CMainFrame::CMainFrame()
|
||||
{
|
||||
// TODO: add member initialization code here
|
||||
|
||||
}
|
||||
|
||||
CMainFrame::~CMainFrame()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
// TODO: Modify the Window class or styles here by modifying
|
||||
// the CREATESTRUCT cs
|
||||
|
||||
return CFrameWnd::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMainFrame::AssertValid() const
|
||||
{
|
||||
CFrameWnd::AssertValid();
|
||||
}
|
||||
|
||||
void CMainFrame::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CFrameWnd::Dump(dc);
|
||||
}
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame message handlers
|
||||
|
||||
void CMainFrame::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
}
|
||||
51
public/wintab/examples/mfc_demo/mainfrm.h
Normal file
51
public/wintab/examples/mfc_demo/mainfrm.h
Normal file
@@ -0,0 +1,51 @@
|
||||
// MainFrm.h : interface of the CMainFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINFRM_H__B7D0AFEA_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MAINFRM_H__B7D0AFEA_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CMainFrame : public CFrameWnd
|
||||
{
|
||||
protected: // create from serialization only
|
||||
CMainFrame();
|
||||
DECLARE_DYNCREATE(CMainFrame)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMainFrame)
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMainFrame();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMainFrame)
|
||||
afx_msg void OnPaint();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAINFRM_H__B7D0AFEA_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
92
public/wintab/examples/mfc_demo/mfc_demo.clw
Normal file
92
public/wintab/examples/mfc_demo/mfc_demo.clw
Normal file
@@ -0,0 +1,92 @@
|
||||
; CLW file contains information for the MFC ClassWizard
|
||||
|
||||
[General Info]
|
||||
Version=1
|
||||
LastClass=CMFC_DEMOView
|
||||
LastTemplate=CDialog
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "MFC_DEMO.h"
|
||||
LastPage=0
|
||||
|
||||
ClassCount=8
|
||||
Class1=CMFC_DEMOApp
|
||||
Class2=CMFC_DEMODoc
|
||||
Class3=CMFC_DEMOView
|
||||
Class4=CMainFrame
|
||||
Class7=CAboutDlg
|
||||
|
||||
ResourceCount=5
|
||||
Resource1=IDD_ABOUTBOX
|
||||
Resource2=IDR_MAINFRAME
|
||||
|
||||
[CLS:CMFC_DEMOApp]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMO.h
|
||||
ImplementationFile=MFC_DEMO.cpp
|
||||
Filter=N
|
||||
|
||||
[CLS:CMFC_DEMODoc]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMODoc.h
|
||||
ImplementationFile=MFC_DEMODoc.cpp
|
||||
Filter=N
|
||||
|
||||
[CLS:CMFC_DEMOView]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMOView.h
|
||||
ImplementationFile=MFC_DEMOView.cpp
|
||||
Filter=C
|
||||
BaseClass=CView
|
||||
VirtualFilter=VWC
|
||||
|
||||
[CLS:CMainFrame]
|
||||
Type=0
|
||||
HeaderFile=MainFrm.h
|
||||
ImplementationFile=MainFrm.cpp
|
||||
Filter=T
|
||||
BaseClass=CFrameWnd
|
||||
VirtualFilter=fWC
|
||||
|
||||
|
||||
|
||||
[CLS:CAboutDlg]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMO.cpp
|
||||
ImplementationFile=MFC_DEMO.cpp
|
||||
Filter=D
|
||||
|
||||
[DLG:IDD_ABOUTBOX]
|
||||
Type=1
|
||||
Class=CAboutDlg
|
||||
ControlCount=4
|
||||
Control1=IDC_STATIC,static,1342177283
|
||||
Control2=IDC_STATIC,static,1342308480
|
||||
Control3=IDC_STATIC,static,1342308352
|
||||
Control4=IDOK,button,1342373889
|
||||
|
||||
[MNU:IDR_MAINFRAME]
|
||||
Type=1
|
||||
Class=CMainFrame
|
||||
Command1=ID_FILE_NEW
|
||||
Command2=ID_APP_EXIT
|
||||
Command3=ID_APP_ABOUT
|
||||
CommandCount=3
|
||||
|
||||
[ACL:IDR_MAINFRAME]
|
||||
Type=1
|
||||
Class=CMainFrame
|
||||
Command1=ID_FILE_NEW
|
||||
Command2=ID_FILE_OPEN
|
||||
Command3=ID_FILE_SAVE
|
||||
Command4=ID_EDIT_UNDO
|
||||
Command5=ID_EDIT_CUT
|
||||
Command6=ID_EDIT_COPY
|
||||
Command7=ID_EDIT_PASTE
|
||||
Command8=ID_EDIT_UNDO
|
||||
Command9=ID_EDIT_CUT
|
||||
Command10=ID_EDIT_COPY
|
||||
Command11=ID_EDIT_PASTE
|
||||
Command12=ID_NEXT_PANE
|
||||
Command13=ID_PREV_PANE
|
||||
CommandCount=13
|
||||
|
||||
151
public/wintab/examples/mfc_demo/mfc_demo.cpp
Normal file
151
public/wintab/examples/mfc_demo/mfc_demo.cpp
Normal file
@@ -0,0 +1,151 @@
|
||||
// MFC_DEMO.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
|
||||
#include "MainFrm.h"
|
||||
#include "DEMODoc.h"
|
||||
#include "DEMOView.h"
|
||||
|
||||
#include <wintab.h>
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMFC_DEMOApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CMFC_DEMOApp)
|
||||
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG_MAP
|
||||
// Standard file based document commands
|
||||
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
|
||||
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp construction
|
||||
|
||||
CMFC_DEMOApp::CMFC_DEMOApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CMFC_DEMOApp object
|
||||
|
||||
CMFC_DEMOApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp initialization
|
||||
|
||||
BOOL CMFC_DEMOApp::InitInstance()
|
||||
{
|
||||
// Check if Wintab is available
|
||||
if (!WTInfo(0, 0, NULL)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef _AFXDLL
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
// Change the registry key under which our settings are stored.
|
||||
// You should modify this string to be something appropriate
|
||||
// such as the name of your company or organization.
|
||||
SetRegistryKey(_T("LCS/Telegraphics"));
|
||||
|
||||
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
|
||||
|
||||
// Register the application's document templates. Document templates
|
||||
// serve as the connection between documents, frame windows and views.
|
||||
|
||||
CSingleDocTemplate* pDocTemplate;
|
||||
pDocTemplate = new CSingleDocTemplate(
|
||||
IDR_MAINFRAME,
|
||||
RUNTIME_CLASS(CMFC_DEMODoc),
|
||||
RUNTIME_CLASS(CMainFrame), // main SDI frame window
|
||||
RUNTIME_CLASS(CMFC_DEMOView));
|
||||
AddDocTemplate(pDocTemplate);
|
||||
|
||||
// Parse command line for standard shell commands, DDE, file open
|
||||
CCommandLineInfo cmdInfo;
|
||||
ParseCommandLine(cmdInfo);
|
||||
|
||||
// Dispatch commands specified on the command line
|
||||
if (!ProcessShellCommand(cmdInfo))
|
||||
return FALSE;
|
||||
|
||||
// The one and only window has been initialized, so show and update it.
|
||||
m_pMainWnd->ShowWindow(SW_SHOW);
|
||||
m_pMainWnd->UpdateWindow();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAboutDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
// App command to run the dialog
|
||||
void CMFC_DEMOApp::OnAppAbout()
|
||||
{
|
||||
CAboutDlg aboutDlg;
|
||||
aboutDlg.DoModal();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp commands
|
||||
164
public/wintab/examples/mfc_demo/mfc_demo.dsp
Normal file
164
public/wintab/examples/mfc_demo/mfc_demo.dsp
Normal file
@@ -0,0 +1,164 @@
|
||||
# Microsoft Developer Studio Project File - Name="MFC_DEMO" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=MFC_DEMO - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "MFC_DEMO.MAK".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "MFC_DEMO.MAK" CFG="MFC_DEMO - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "MFC_DEMO - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "MFC_DEMO - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "MFC_DEMO - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 ..\..\lib\i386\wintab32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "MFC_DEMO - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /Gf /Gy /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /FR /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\lib\i386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "MFC_DEMO - Win32 Release"
|
||||
# Name "MFC_DEMO - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\demodoc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\demoview.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainFrm.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMO.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMO.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainFrm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMO.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMODoc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMOView.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\MFC_DEMO.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\MFC_DEMO.rc2
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\MFC_DEMODoc.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
29
public/wintab/examples/mfc_demo/mfc_demo.dsw
Normal file
29
public/wintab/examples/mfc_demo/mfc_demo.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "MFC_DEMO"=.\MFC_DEMO.DSP - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
50
public/wintab/examples/mfc_demo/mfc_demo.h
Normal file
50
public/wintab/examples/mfc_demo/mfc_demo.h
Normal file
@@ -0,0 +1,50 @@
|
||||
// MFC_DEMO.h : main header file for the MFC_DEMO application
|
||||
//
|
||||
|
||||
#if !defined(AFX_MFC_DEMO_H__B7D0AFE6_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MFC_DEMO_H__B7D0AFE6_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp:
|
||||
// See MFC_DEMO.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CMFC_DEMOApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CMFC_DEMOApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMFC_DEMOApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CMFC_DEMOApp)
|
||||
afx_msg void OnAppAbout();
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MFC_DEMO_H__B7D0AFE6_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
323
public/wintab/examples/mfc_demo/mfc_demo.rc
Normal file
323
public/wintab/examples/mfc_demo/mfc_demo.rc
Normal file
@@ -0,0 +1,323 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif\r\n"
|
||||
"#include ""res\\MFC_DEMO.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\MFC_DEMO.ico"
|
||||
IDR_MFC_DETYPE ICON DISCARDABLE "res\\DEMODoc.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
|
||||
MENUITEM "E&xit", ID_APP_EXIT
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About MFC_DEMO...", ID_APP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
|
||||
BEGIN
|
||||
"N", ID_FILE_NEW, VIRTKEY, CONTROL
|
||||
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
|
||||
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
|
||||
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
|
||||
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
|
||||
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
|
||||
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
|
||||
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
|
||||
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
|
||||
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
|
||||
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
|
||||
VK_F6, ID_NEXT_PANE, VIRTKEY
|
||||
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About MFC_DEMO"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||
LTEXT "MFC_DEMO Version 1.0",IDC_STATIC,40,10,119,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 1998 LCS/Telegraphics",IDC_STATIC,40,25,
|
||||
119,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "MFC_DEMO MFC Application\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "MFC_DEMO\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 1998\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "MFC_DEMO.EXE\0"
|
||||
VALUE "ProductName", "MFC_DEMO Application\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 210
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAINFRAME "MFC_DEMO\n\nMFC_DE\n\n\nMFCDEMO.Document\nMFC_DE Document"
|
||||
END
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_APP_TITLE "MFC_DEMO"
|
||||
AFX_IDS_IDLEMESSAGE "Ready"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_INDICATOR_EXT "EXT"
|
||||
ID_INDICATOR_CAPS "CAP"
|
||||
ID_INDICATOR_NUM "NUM"
|
||||
ID_INDICATOR_SCRL "SCRL"
|
||||
ID_INDICATOR_OVR "OVR"
|
||||
ID_INDICATOR_REC "REC"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_FILE_NEW "Create a new document\nNew"
|
||||
ID_FILE_OPEN "Open an existing document\nOpen"
|
||||
ID_FILE_CLOSE "Close the active document\nClose"
|
||||
ID_FILE_SAVE "Save the active document\nSave"
|
||||
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
|
||||
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_FILE_MRU_FILE1 "Open this document"
|
||||
ID_FILE_MRU_FILE2 "Open this document"
|
||||
ID_FILE_MRU_FILE3 "Open this document"
|
||||
ID_FILE_MRU_FILE4 "Open this document"
|
||||
ID_FILE_MRU_FILE5 "Open this document"
|
||||
ID_FILE_MRU_FILE6 "Open this document"
|
||||
ID_FILE_MRU_FILE7 "Open this document"
|
||||
ID_FILE_MRU_FILE8 "Open this document"
|
||||
ID_FILE_MRU_FILE9 "Open this document"
|
||||
ID_FILE_MRU_FILE10 "Open this document"
|
||||
ID_FILE_MRU_FILE11 "Open this document"
|
||||
ID_FILE_MRU_FILE12 "Open this document"
|
||||
ID_FILE_MRU_FILE13 "Open this document"
|
||||
ID_FILE_MRU_FILE14 "Open this document"
|
||||
ID_FILE_MRU_FILE15 "Open this document"
|
||||
ID_FILE_MRU_FILE16 "Open this document"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
|
||||
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_EDIT_CLEAR "Erase the selection\nErase"
|
||||
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
|
||||
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
|
||||
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
|
||||
ID_EDIT_FIND "Find the specified text\nFind"
|
||||
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
|
||||
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
|
||||
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
|
||||
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
|
||||
ID_EDIT_UNDO "Undo the last action\nUndo"
|
||||
ID_EDIT_REDO "Redo the previously undone action\nRedo"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCSIZE "Change the window size"
|
||||
AFX_IDS_SCMOVE "Change the window position"
|
||||
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
|
||||
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
|
||||
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
|
||||
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
|
||||
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCRESTORE "Restore the window to normal size"
|
||||
AFX_IDS_SCTASKLIST "Activate Task List"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif
|
||||
#include "res\MFC_DEMO.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
19
public/wintab/examples/mfc_demo/point.h
Normal file
19
public/wintab/examples/mfc_demo/point.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef POINT_H
|
||||
#define POINT_H
|
||||
|
||||
class point
|
||||
{
|
||||
public:
|
||||
long x, y;
|
||||
|
||||
point( void ) { ; };
|
||||
point( point const & p ) { x = p.x; y = p.y; };
|
||||
point( POINT const & p ) { x = p.x; y = p.y; };
|
||||
|
||||
bool operator < ( point const & r ) const { return x < r.x || (x == r.x && y < r.y); };
|
||||
bool operator > ( point const & r ) const { return !(*this < r); };
|
||||
bool operator == ( point const & r ) const { return x == r.x && y == r.y; };
|
||||
bool operator != ( point const & r ) const { return !(*this == r); };
|
||||
};
|
||||
|
||||
#endif POINT_H
|
||||
BIN
public/wintab/examples/mfc_demo/res/demodoc.ico
Normal file
BIN
public/wintab/examples/mfc_demo/res/demodoc.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/wintab/examples/mfc_demo/res/mfc_demo.ico
Normal file
BIN
public/wintab/examples/mfc_demo/res/mfc_demo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
13
public/wintab/examples/mfc_demo/res/mfc_demo.rc2
Normal file
13
public/wintab/examples/mfc_demo/res/mfc_demo.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MFC_DEMO.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
19
public/wintab/examples/mfc_demo/resource.h
Normal file
19
public/wintab/examples/mfc_demo/resource.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by MFC_DEMO.RC
|
||||
//
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDR_MFC_DETYPE 129
|
||||
#define IDD_ABOUTBOX 100
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#endif
|
||||
#endif
|
||||
6
public/wintab/examples/mfc_demo/stdafx.cpp
Normal file
6
public/wintab/examples/mfc_demo/stdafx.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// MFC_DEMO.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
24
public/wintab/examples/mfc_demo/stdafx.h
Normal file
24
public/wintab/examples/mfc_demo/stdafx.h
Normal file
@@ -0,0 +1,24 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__B7D0AFE8_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_STDAFX_H__B7D0AFE8_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__B7D0AFE8_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
Reference in New Issue
Block a user