home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5405 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  2.0 KB

  1. Xref: sparky comp.os.ms-windows.programmer.misc:5405 comp.os.ms-windows.programmer.tools:2247
  2. Newsgroups: comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools
  3. Path: sparky!uunet!europa.eng.gtefsd.com!gatech!rpi!utcsri!torn!nott!emr1!jagrant
  4. From: jagrant@emr1.emr.ca (John Grant)
  5. Subject: Re: Need text display/editing tools
  6. Message-ID: <1993Jan27.205636.25188@emr1.emr.ca>
  7. Organization: Energy, Mines, and Resources, Ottawa
  8. References: <1993Jan27.192821.13487@st-andrews.ac.uk>
  9. Date: Wed, 27 Jan 1993 20:56:36 GMT
  10. Lines: 36
  11.  
  12. In article <1993Jan27.192821.13487@st-andrews.ac.uk> djm@st-andrews.ac.uk (David J McNally) writes:
  13. >
  14. >Hello all,
  15. >
  16. >I am developing an application (using Borland C++) in which I need a
  17. >window which contains text (read only) and this text may contain
  18. >multiple highlighted selections.  Can this be done simply
  19. >with the Windows API or does this need complex text manipulation
  20. >and display code to be written?
  21. >
  22. >More generally, how do you get a text window in which you can
  23. >display (and/or edit) text which is not all in the same style
  24. >(e.g. different fonts/sizes/colours etc)?  Are there third party
  25. >libraries (preferably with source) which provide this kind
  26. >of functionality?
  27.     You are describing a full-fledged word processor app,
  28.     complete with full font control.  Good luck on this one :(
  29.  
  30.     I think the way they do it is with a whole bunch of
  31.     TextOut calls with (x,y), specifying a different HFONT
  32.     and (x,y) for each formatted string.  You can choose
  33.     options which will update or not the current (x,y)
  34.     position, so that you know where you are at the end
  35.     of each string.  The reason that TextOut has a 'length
  36.     of string' parameter is so that you don't have to
  37.     terminate each substring with a NUL, assuming that
  38.     the text buffer contains several sub-strings, each
  39.     to be displayed in a different font.
  40.  
  41.     I shudder when I think of the code required to implement
  42.     something like Word or WordPerfect for Windows.
  43.  
  44. -- 
  45. John A. Grant                        jagrant@emr1.emr.ca
  46. Airborne Geophysics
  47. Geological Survey of Canada, Ottawa
  48.