#include #include #include #include #include "printw.h" #include "portable.h" #include "tabhand.h" #include "mdialog.h" #include "kysyint.h" /****************************************************************************/ TblClassWindowMAIN("TblWndClass","ikoni","Tikku-tausta",MsgTbl,0); /****************************************************************************/ /***************************************************************************/ static EVENT WM_destroy(tMSGParam *msg) { PostQuitMessage(msg->wParam); return 0; } /****************************************************************************/ /* KysyInt: */ /****************************************************************************/ /****************************************************************************/ static int luku = 0; static EVENT WM_paint(tMSGParam *msg) /* # MAKE_DC # */ { char s[80]; sprintf(s,"Luku oli %d, heksana 0x%02x.",luku,luku); SetTextStart(msg->hDC,10,10); printw(msg->hDC,s); return 0; } static EVENT WM_RButtonDown(tMSGParam *msg) { // DoModalDialogParam(msg->hWnd,"KysyInt",AskIntFunc,(LPARAM)(int far *)&luku); // DoModelessDialogParam(msg->hWnd,"KysyInt",AskIntFunc,(LPARAM)&luku); DoMultiModelessDialogParam(msg->hWnd,"KysyInt",AskIntFunc,(LPARAM)&luku); return 0; } static EVENT WM_command_CM_INT_CHANGE(tMSGParam *msg) { InvalidateRect(msg->hWnd,NULL,TRUE); return 0; } /****************************************************************************/ /* Viestien käsittelytaulukko */ /****************************************************************************/ tMSGEntry MsgTbl[] = { { WM_DESTROY , DoC , DoC , WM_destroy }, /*a*/ { WM_PAINT , DoC , DoC , WM_paint, MAKE_DC }, /*a*/ { WM_RBUTTONDOWN , DoC , DoC , WM_RButtonDown }, /*a*/ { WM_COMMAND , CM_INT_CHANGE , DoC , WM_command_CM_INT_CHANGE }, /*a*/ { 0 } }; /****************************************************************************/