/**************/ /* cm5.c */ /***************************************************************************** PROGRAM: cm5c Windows: Win 3.1 & WIN32 PURPOSE: Testataan tulostusta Editor: Vesa Lappalainen 30.10.1994 PROJECT: cm5.c, ALI\def.def, ALI\tabhand.c, ALI\tulostus.c *****************************************************************************/ #include #include "tabhand.h" #include "tulostus.h" /****************************************************************************/ TblClassSWindowMAIN("OptWndClass",NULL,"Paina vasenta tulostaaksesi",MsgTbl,0); /****************************************************************************/ int ympyra(HDC hDC,int x, int y, int r) { int oldmode = SetMapMode(hDC,MM_LOMETRIC); POINT oldorg; SetWindowOrgEx(hDC,0,1000,&oldorg); /* Siirto 10 cm alas */ Ellipse(hDC,x-r,y-r,x+r,y+r); SetWindowOrgEx(hDC,-oldorg.x,-oldorg.y,NULL); SetMapMode(hDC,oldmode); return 0; } /****************************************************************************/ static EVENT WM_lbuttondown(tMSGParam *msg) { HDC hDC; if ( SetupPrinter(1) ) return 0; hDC = StartPrinting(msg->hWnd,0); ympyra(hDC,400,400,250); /* Yksiköt 1/10 mm */ StopPrinting(msg->hWnd,hDC); return 0; } static EVENT WM_paint(tMSGParam *msg) /* # MAKE_DC # */ { ympyra(msg->hDC,400,400,250); /* Yksiköt 1/10 mm */ return 0; } /****************************************************************************/ /* Viestien käsittelytaulukko */ /****************************************************************************/ tMSGEntry MsgTbl[] = { EV_HANDLE_WM_DESTROY, { WM_LBUTTONDOWN , DoC , DoC , WM_lbuttondown }, /*a*/ { WM_PAINT , DoC , DoC , WM_paint, MAKE_DC }, /*a*/ { 0 } }; /****************************************************************************/