******************** * C4W2NTK TUTORIAL ******************** * This is a NTK emulation of the original C4W sample named: * \CLIP4WIN\SOURCE\COLOUR.PRG * * * The NTK make procedure is: * MKRAD COLOUR * * * I can't believe it's Clip4Win! * Powered by NTK - http://www.ntkproject.com ******************** //////////////////////////// // // Clip-4-Win colour demo // // Copyright (C) 1992 Skelton Software, Kendal Cottage, Hillam, Leeds, UK. // All Rights Reserved. // // // Compile: colour /n /w // Link: /se:600 colour winsetup,,,,clip4win.def // //////////////////////////// #include "windows.ch" // jnd: just add that for NTK #include "ntkmsg.ch" // Window messages def. #include "c4w2ntk.ch" // C4W msg def and NTK translations #include "ntkcmd.ch" // NTK rad msg and cmd def. (i.e. @...Say ) static hWnd, hInst, hPrevInst, nCmdShow static cAppName := "Clip-4-Win" function main() local ev, nColour, hDC, hBrush hWnd = WinSetup(cAppName, "Clip-4-Win colour demo") hInst = _GetInstance() do while .t. do while (ev := ChkEvent()) == EVENT_NONE enddo do case case ev == EVENT_REDRAW //NTK The followings have not been translated yet! //NTK: SetPos(0, 0) //NTK: ? ; ? " Press a key to choose a colour (or 'color')..." @ 0,0 SAY " Press a key to choose a colour (or 'color')..." case ev == EVENT_KEY nColour = NTK_ChooseColor() if nColour >= 0 // else user chose cancel/close or hit Esc hDC = GetDC(hWnd) hBrush = CreateHatchBrush(HS_DIAGCROSS, nColour) FillRect(hDC, 100, 100, 500, 300, hBrush) DeleteObject(hBrush) ReleaseDC(hWnd, hDC) endif case ev == EVENT_QUIT exit endcase enddo return 0