/**************/ /* font3.c */ /***************************************************************************** PROGRAM: font3.c Windows: Win 3.1 & WIN32 PURPOSE: Fonttidialogi (merk. FD) Editor: Vesa Lappalainen 17.10.1995 PROJECT: font3.c, fontcol.rc, demo.def, ALI\tabhand.c, ALI\fontti.c, ALI\mjonot.c *****************************************************************************/ #define STRICT #include #include "tabhand.h" #include "fontti.h" /* FD */ #include "fontcol.h" /****************************************************************************/ TblClassSWindowMAIN("TblWndClass","ikoni","Fontit ja värit",MsgTbl,0); /* Käyttää automaattisesti "menu" -nimistä menua! */ /****************************************************************************/ static tOneFont GF; /* FD */ static EVENT WM_create(tMSGParam *msg) { (void)msg; return alusta_fontti(".\\font3.ini","FONT",&GF); } static EVENT WM_paint(tMSGParam *msg) /* # MAKE_DC # */ { valitse_fontti(msg->hDC,&GF); /* FD */ TextOut(msg->hDC, 10, 10, "Hello World!",12); return palauta_fontti(msg->hDC,&GF); /* FD */ } static EVENT WM_command_IDM_OPTIONS_FONT(tMSGParam *msg) { return vaihda_fontti(msg->hWnd,&GF,TRUE); /* FD */ } static EVENT WM_destroy(tMSGParam *msg) { (void)msg; poista_fontti(".\\font3.ini","FONT",&GF); /* FD */ PostQuitMessage(0); return 0; } /****************************************************************************/ /* Viestien käsittelytaulukko */ /****************************************************************************/ tMSGEntry MsgTbl[] = { { WM_CREATE , DoC , DoC , WM_create }, /*a*/ { WM_PAINT , DoC , DoC , WM_paint, MAKE_DC }, /*a*/ { WM_COMMAND , IDM_OPTIONS_FONT , DoC , WM_command_IDM_OPTIONS_FONT }, /*a*/ { WM_DESTROY , DoC , DoC , WM_destroy }, /*a*/ { 0 } }; /****************************************************************************/