Article View: comp.os.ms-windows.programmer.misc
Article #2367Re: Need text display/editing tools
From: John Grant
Date: Wed, 27 Jan 1993 20:56
Date: Wed, 27 Jan 1993 20:56
36 lines
2020 bytes
2020 bytes
In article <1993Jan27.192821.13487@st-andrews.ac.uk> djm@st-andrews.ac.uk (David J McNally) writes: > >Hello all, > >I am developing an application (using Borland C++) in which I need a >window which contains text (read only) and this text may contain >multiple highlighted selections. Can this be done simply >with the Windows API or does this need complex text manipulation >and display code to be written? > >More generally, how do you get a text window in which you can >display (and/or edit) text which is not all in the same style >(e.g. different fonts/sizes/colours etc)? Are there third party >libraries (preferably with source) which provide this kind >of functionality? You are describing a full-fledged word processor app, complete with full font control. Good luck on this one :( I think the way they do it is with a whole bunch of TextOut calls with (x,y), specifying a different HFONT and (x,y) for each formatted string. You can choose options which will update or not the current (x,y) position, so that you know where you are at the end of each string. The reason that TextOut has a 'length of string' parameter is so that you don't have to terminate each substring with a NUL, assuming that the text buffer contains several sub-strings, each to be displayed in a different font. I shudder when I think of the code required to implement something like Word or WordPerfect for Windows. -- John A. Grant jagrant@emr1.emr.ca Airborne Geophysics Geological Survey of Canada, Ottawa
Technical Details
Message-ID:
<1993Jan27.205636.25188@emr1.emr.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.eng.gtefsd.com!gatech!rpi!utcsri!torn!nott!emr1!jagrantReferences:
<1993Jan27.192821.13487@st-andrews.ac.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools Path: arc1-ca.pugleaf.net!sparky!uunet!europa.eng.gtefsd.com!gatech!rpi!utcsri!torn!nott!emr1!jagrant From: jagrant@emr1.emr.ca (John Grant) Subject: Re: Need text display/editing tools Message-ID: <1993Jan27.205636.25188@emr1.emr.ca> Organization: Energy, Mines, and Resources, Ottawa References: <1993Jan27.192821.13487@st-andrews.ac.uk> Date: Wed, 27 Jan 1993 20:56:36 GMT Lines: 36