TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Harald Pollack
from: Jonathan de Boyne Pollard
date: 1999-11-16 13:48:23
subject: PROMPT $I in PMCMD

 JdBP>>>> Actually, what I need to do is to write a control window 
 JdBP>>>> that can be used to display coloured text, rather than 
 JdBP>>>> relying on a standard MLE control.

 JdBP>> Does anyone here in OS2PROG have any suggestions ?

 HP> And how about these ?
 HP>
 HP> hdc=WinOpenWindowDC(hwnd);
 HP>
hps=GpiCreatePS(hab,hdc,&sizel,PU_PELS|GPIF_DEFAULT|GPIT_MICRO|GPIA_ASSOC);
 HP> VioCreatePS(&hvps,SCREEN_HEIGHT,SCREEN_WIDTH,0,1,0);
 HP> VioAssociate(hdc,hvps);
 HP> ...

As I have said already, in a pure 32-bit application the option of a VIO
presentation space is not open to me.  In any case, it seems silly to have a
32-bit application relying on a 16-bit relic from OS/2 version 1.2 .

I'm looking for a solution that is 32-bit.  Therefore I'm looking for a
solution that uses the ordinary 32-bit Presentation Manager API.  There must
be an efficient way of drawing fixed-width text in multiple colours using the
GPI.

I've been wondering whether to use a memory PS, drawing into it when the
window contents are changed and blitting into the window's PS in a WM_PAINT
event.  But I'm worried about if I do so having to handle font and preparams
issues manually (which seem to be taken care of automatically when I use the
cached micro PS supplied by WinBeginPaint).

 ¯ JdeBP ®

--- FleetStreet 1.22 NR
* Origin: JdeBP's point, using Squish (2:257/609.3)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.