/**************/ /* .c */ /***************************************************************************** PROGRAM: .c Windows: Win 3.1 & WIN32 PURPOSE: Editor: Vesa Lappalainen 31.7.1994 PROJECT: dlgcpp.cpp tabcpp.def dlgcpp.rc ALI\tabhand.c ALI\mdialog.c *****************************************************************************/ #include #include "tabhand.h" #include "dlgcpp.rh" class laskuri { int i; HWND hWnd; int id; public: void setwnd(HWND h, int idn) {id=idn; hWnd = h;} laskuri(HWND h=0, int idn=0, int init=0) { i = init; setwnd(h,idn); } void add(void) { i++; SetDlgItemInt(hWnd,id,i,TRUE); } }; static laskuri las; /****************************************************************************/ TblDlgMAIN(NULL,"CppDlg",MsgTbl); /****************************************************************************/ static EVENT WM_command_CM_NAPPI(tMSGParam *msg) { (void)msg; las.add(); return 0; } static EVENT WM_initdialog(tMSGParam *msg) { las.setwnd(msg->hWnd,ID_LAS); return 0; } static EVENT WM_command_IDCANCEL(tMSGParam *msg) { (void)msg; PostQuitMessage(0); return 0; } /****************************************************************************/ /* Viestien käsittelytaulukko */ /****************************************************************************/ tMSGEntry MsgTbl[] = { EV_HANDLE_WM_CLOSE, { WM_COMMAND , CM_NAPPI , DoC , WM_command_CM_NAPPI }, /*a*/ { WM_INITDIALOG , DoC , DoC , WM_initdialog }, /*a*/ { WM_COMMAND , IDCANCEL , DoC , WM_command_IDCANCEL }, /*a*/ { 0 } }; /****************************************************************************/