文件名称:PLC 编译器 用于转换梯形图
文件大小:846KB
文件格式:EXE
更新时间:2015-06-21 16:11:04
PLC 编译器
梯形图转换语句表,软件测试阶段
IMPLEMENT_DYNCREATE(VDisPlayView, CScrollView)
VDisPlayView::VDisPlayView()
{
//P_LIST cDatList;
EnableAutomation();
}
VDisPlayView::~VDisPlayView()
{
}
HFONT C_SetFont(UINT uFont)
{
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
if (hFont == NULL)
hFont = (HFONT)GetStockObject(ANSI_VAR_FONT);
return hFont ;
}
void VDisPlayView::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CScrollView::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(VDisPlayView, CScrollView)
ON_WM_CREATE()
// ON_WM_MOUSEMOVE()
ON_MESSAGE(WM_DRAWDATA, OnDrawData)
// ON_WM_MOUSEHWHEEL()
ON_WM_SIZE()
// ON_WM_MOUSELEAVE()
ON_WM_NCMOUSELEAVE()
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(VDisPlayView, CScrollView)
END_DISPATCH_MAP()
// Note: we add support for IID_IViScroll to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .IDL file.
// {C1771C4B-2FF0-46ED-A4FE-D381086A49E4}
static const IID IID_IViScroll =
{ 0xC1771C4B, 0x2FF0, 0x46ED, { 0xA4, 0xFE, 0xD3, 0x81, 0x8, 0x6A, 0x49, 0xE4 } };
BEGIN_INTERFACE_MAP(VDisPlayView, CScrollView)
INTERFACE_PART(VDisPlayView, IID_IViScroll, Dispatch)
END_INTERFACE_MAP()
// VDisPlayView drawing
void VDisPlayView::OnInitialUpdate()
{
//CScrollView::OnInitialUpdate();
//CSize sizeTotal;
// TODO: calculate the total size of this view
//sizeTotal.cx = sizeTotal.cy = 1000;
// SetScrollSizes(MM_TEXT, sizeTotal);
SetScrollSizes(MM_TEXT, CSize(VIEW_WIDTH,VIEW_HIGHT));
CScrollView::OnInitialUpdate();
}
//void VDisPlayView::OnDraw(CDC* pDC)
//{
// CDocument* pDoc = GetDocument();
//
//CAutoPanDoc* pDoc = GetDocument();
// ASSERT_VALID(pDoc);
//
// // Get the invalidated rectangle of the view, or in the case
// // of printing, the clipping region of the printer dc.
// CRect rectClip;
// CRect rectCloud;
// pDC->GetClipBox(&rectClip;);
// pDC->LPtoDP(&rectClip;);
// rectClip.InflateRect(1, 1); // avoid rounding to nothing
//
// // Note: CScrollView::OnPaint() will have already adjusted the
// // viewport origin before calling OnDraw(), to reflect the
// // currently scrolled position.
///* for(int x=0; x<1600; x+=50)
// {
// for(int y=0; y<1200; y+=50)
// {
// CRect rc(x,y, x+40, y+40);
// pDC->FillSolidRect(rc, RGB(x,y,x*y));
// }
// }*/
//
//
//
// // TODO: add draw code here
//}
// VDisPlayView diagnostics
#ifdef _DEBUG
void VDisPlayView::AssertValid() const
{
CScrollView::AssertValid();
}
#ifndef _WIN32_WCE
void VDisPlayView::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
#endif
#endif //_DEBUG
// VDisPlayView message handlers
int VDisPlayView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CScrollView::OnCreate(lpCreateStruct) == -1)
return -1;
m_pDC=new CClientDC(this);
uRowNumber=10000;//
uColNumber=4;
/* UINT uRowNumber ,uColNumber,
*uPerCol_Width,*uPerRow_height
,;*/
uPerCol_Width =new WORD[uColNumber];
uPerRow_height=new WORD[uRowNumber];
UINT i;
for(i=0;i