Browse Prior Art Database

Implementation of Multiline Text Wrapping for Single Line OS/2 PM Controls

IP.com Disclosure Number: IPCOM000114980D
Original Publication Date: 1995-Feb-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 2 page(s) / 102K

Publishing Venue

IBM

Related People

Morgan, SA: AUTHOR [+3]

Abstract

OS/2* Presentation Manager* (PM) applications often use radiobutton and checkbox controls in dialog windows. As provided by PM, these controls present the radiobutton or checkbox bitmap, followed by a single line of text. This text is limited to 127 characters and is always painted on a single line.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 53% of the total text.

Implementation of Multiline Text Wrapping for Single Line OS/2 PM
Controls

      OS/2* Presentation Manager* (PM) applications often use
radiobutton and checkbox controls in dialog windows.  As provided by
PM, these controls present the radiobutton or checkbox bitmap,
followed by a single line of text.  This text is limited to 127
characters and is always painted on a single line.

      This is restrictive for applications that want to provide a
more detailed description in the text of these controls.  It can also
present problems during language translation, as the translated text
could be much longer than the original text.

      A better solution for presenting these controls is to allow
unlimited text length, with support for wrapping the text into
multiple lines.  The implementation of text wrapping for these
controls requires that five areas be addressed, each one keying off a
standard PM message:
  o  Internal data structures need to be created and maintained
during
      the life of the control.
       The WM_CREATE message is received when the control is being
      created.  At this time the necessary structure for storing such
      things as the control text in multiline format must be
allocated.
      A pointer to this structure can be stored in the control window
      words.
  o  The text must be broken into its separate line components when
      initially set and if changed at runtime.
       The WM_SETWINDOWPARAMS message is received when the text
      for the control is initially set and whenever it is changed by
      the application.  Upon receipt of this message, the application
      must determine how the text should be split.  There are several
      good techniques, but this disclosure assumes that the breaks in
      the text string are delimited by a special character reserved
for
      this purpose.
       These substrings should be stored in the internal memory
      previously allocated.  By storing the substrings, the
performance
      hit of having to parse the original text into substrings each
      time the control needs to be painted is eliminated.  The length
      of the longest substring and the count of substrings should
also
      be stored, as they are useful in performing some of the
      calculations for repainting and displaying of the cursor box.
  o  The wrapped text must be painted by the application.
       The WM_PAINT message is received when the text needs to be
      repainted.  Any required background repainting is done first
and
      is achieved by calling the WinFillRect API on the control text
      rectangle area with the background color.  The control
rectangle
      is obtained with the WinQueryWindowRect API.
       The painting of each line of the text (that is, each
      substring) must then be perform...