home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 4
/
BUGCD1997_05.BIN
/
aplic
/
clip4win
/
clip4win.exe
/
C4W30E.HUF
/
SOURCE
/
COLOUR2.PRG
< prev
next >
Wrap
Text File
|
1995-07-09
|
998b
|
45 lines
////////////////////////////
//
// Clip-4-Win colour demo (same as colour.prg, but using commands)
//
// Copyright (C) 1992 Skelton Software, Kendal Cottage, Hillam, Leeds, UK.
// All Rights Reserved.
//
// To build: c4wbuild colour2
//
////////////////////////////
#define WIN_WANT_ALL
#include "windows.ch"
#define NO_C4WCLASS
#include "commands.ch"
function main()
local oApp, oWnd
CREATE APPLICATION oApp WINDOW oWND TITLE "Clip-4-Win colour demo" ;
ON WM_PAINT OnPaint(oWnd) ;
ON WM_KEYDOWN OnKey(oWnd)
return nil
static function OnPaint(hWnd)
SetPos(0, 0)
? ; ? " Press a key to choose a colour (or 'color')..."
return nil
static function OnKey(hWnd)
local nColour := ChooseColor(), hDC, hBrush
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
return nil