Index: trunk/src/helpers/comctl.c
===================================================================
--- trunk/src/helpers/comctl.c	(revision 176)
+++ trunk/src/helpers/comctl.c	(revision 178)
@@ -823,18 +823,17 @@
                                 // center the icon in the bitmap
                                 // V0.9.16 (2001-10-15) [umoeller]
-                                POINTL ptlOfs;
-                                ptlOfs.x = (   (pa->rclIcon.xRight - pa->rclIcon.xLeft)
-                                             - pa->lIconSize
-                                           ) / 2;
-                                ptlOfs.y = (   (pa->rclIcon.yTop - pa->rclIcon.yBottom)
-                                             - pa->lIconSize
-                                           ) / 2;
-
-                                // paint icon into bitmap
-                                gpihIcon2Bitmap(hpsMem,
+
+                                // replaced call V0.9.19 (2002-06-18) [umoeller]
+                                gpihDrawPointer(hpsMem,
+                                                (   (pa->rclIcon.xRight - pa->rclIcon.xLeft)
+                                                  - pa->szlIcon.cx
+                                                ) / 2,
+                                                (   (pa->rclIcon.yTop - pa->rclIcon.yBottom)
+                                                  - pa->szlIcon.cy
+                                                ) / 2,
                                                 pa->hptr,
-                                                lBkgndColor,
-                                                &ptlOfs,
-                                                pa->lIconSize);
+                                                &pa->szlIcon,
+                                                NULL,       // no clipping
+                                                0);         // no mini
                             }
 
@@ -1001,5 +1000,6 @@
             WinQueryWindowRect(hwndStatic, &pa->rclIcon);
             pa->OldStaticProc = WinSubclassWindow(hwndStatic, ctl_fnwpBitmapStatic);
-            pa->lIconSize = WinQuerySysValue(HWND_DESKTOP, SV_CXICON);
+            pa->szlIcon.cx = WinQuerySysValue(HWND_DESKTOP, SV_CXICON);
+            pa->szlIcon.cy = WinQuerySysValue(HWND_DESKTOP, SV_CYICON);
         }
     }
Index: trunk/src/helpers/dialog.c
===================================================================
--- trunk/src/helpers/dialog.c	(revision 176)
+++ trunk/src/helpers/dialog.c	(revision 178)
@@ -2756,5 +2756,5 @@
         Icon = CONTROLDEF_ICON(NULLHANDLE, 0),
         Spacing = CONTROLDEF_TEXT(NULL, 0, 1, 1),
-        InfoText = CONTROLDEF_TEXT_WORDBREAK(NULL, 10, 200),
+        InfoText = CONTROLDEF_TEXT_WORDBREAK(NULL, 10, MSGBOX_TEXTWIDTH),
         Buttons[] =
         {
Index: trunk/src/helpers/gpih.c
===================================================================
--- trunk/src/helpers/gpih.c	(revision 176)
+++ trunk/src/helpers/gpih.c	(revision 178)
@@ -1747,5 +1747,4 @@
     HPS     hpsMem;
     BITMAPINFOHEADER2 bmi;
-    // RECTL   rclSource;
 
     if (hbmSource)
@@ -2342,5 +2341,5 @@
 
 /*
- *@@ gpihIcon2Bitmap:
+ * gpihIcon2Bitmap:
  *      this paints the given icon/pointer into
  *      a bitmap. Note that if the bitmap is
@@ -2351,9 +2350,12 @@
  *      Returns FALSE upon errors.
  *
- *@@added V0.9.0 [umoeller]
- *@@changed V0.9.16 (2001-10-15) [umoeller]: added pptlLowerLeft
- *@@changed V0.9.16 (2001-10-15) [umoeller]: fixed inclusive/exclusive confusion (sigh...)
- *@@changed V0.9.19 (2002-06-13) [umoeller]: fixed funny colors when scaling
- */
+ *added V0.9.0 [umoeller]
+ *changed V0.9.16 (2001-10-15) [umoeller]: added pptlLowerLeft
+ *changed V0.9.16 (2001-10-15) [umoeller]: fixed inclusive/exclusive confusion (sigh...)
+ *changed V0.9.19 (2002-06-13) [umoeller]: fixed funny colors when scaling
+ *removed V0.9.19 (2002-06-18) [umoeller]
+ */
+
+#if 0
 
 BOOL gpihIcon2Bitmap(HPS hpsMem,         // in: target memory PS with bitmap selected into it
@@ -2449,4 +2451,261 @@
 }
 
+#endif
+
+/*
+ *@@ gpihDrawPointer:
+ *      replacement for WinDrawPointer that can do clipping.
+ *
+ *      To do clipping with WinDrawPointer, one has to
+ *      limit the clip rectangle for the current HPS,
+ *      which is quite an overhead. This function instead
+ *      allows for specifying a clip rectangle directly.
+ *      Besides, since it uses GpiWCBitBlt, it should
+ *      probably work with all types of device contexts.
+ *
+ *      This also replaces gpihIcon2Bitmap, which wasn't quite
+ *      working in the first place and couldn't to clipping
+ *      either.
+ *
+ *      If you don't need clipping and are drawing to the
+ *      screen only, this function has no advantage over
+ *      WinDrawPointer because it's presumably slower.
+ *
+ *      Flags presently supported in fl:
+ *
+ *      --  DP_MINI (not DP_MINIICON, as stated in PMREF):
+ *          use mini-icon.
+ *
+ *      Preconditions:
+ *
+ *      --  The hps is assumed to be in RGB mode.
+ *
+ *      Post conditions:
+ *
+ *      --  This uses GpiSet(Back)Color, so the foreground
+ *          and background colors are undefined after the
+ *          call.
+ *
+ *@@added V0.9.19 (2002-06-18) [umoeller]
+ */
+
+BOOL gpihDrawPointer(HPS hps,           // in: target presentation space
+                     LONG x,            // in: lower left target position of icon
+                     LONG y,            // in: lower left target position of icon
+                     HPOINTER hptr,     // in: icon to be drawn
+                     PSIZEL pszlIcon,   // in: icon size (req., should be sysvalues SV_CXICON, SV_CYICON always)
+                     PRECTL prclClip,   // in: clip rectangle (inclusive!) or NULL
+                     ULONG fl)          // in: DP_* flags
+{
+    POINTERINFO pi;
+
+    if (    (pszlIcon)
+         && (hptr)
+         && (WinQueryPointerInfo(hptr, &pi))
+       )
+    {
+        POINTL  aptl[4];
+        HBITMAP hbmThis;
+        BITMAPINFOHEADER2 bmi;
+
+        // A HPOINTER really consists of two bitmaps,
+        // one monochrome bitmap that has twice the icon
+        // height and contains an AND mask in the upper
+        // half and an XOR mask in the lower half, and
+        // a (probably color) bitmap with the regular
+        // icon height.
+
+        // Drawing the icon means (1) blitting the AND
+        // mask with ROP_SRCAND, (2) blitting the color
+        // bitmap with ROP_SRCPAINT, (3) blitting the
+        // XOR mask with ROP_SRCINVERT. Hence the slightly
+        // complicated code that follows.
+
+        /*
+         * 0)   preparations
+         */
+
+        // set up a bunch of variables that are used
+        // by the below calculations. We use cx|yIcon
+        // to quickly get the system icon dimensions
+        // and set up the clip offsets here too,
+        // if a clip rectangle is specified.
+
+        LONG    cxIcon = pszlIcon->cx,
+                cyIcon = pszlIcon->cy,
+                cySrc,
+                xRight,
+                yTop,
+        // clip "rectangle"... this is not really a
+        // recangle because it specifies _offsets_
+        // towards the center of the icon to be
+        // clipped
+                lClipLeft = 0,
+                lClipBottom = 0,
+                lClipRight = 0,
+                lClipTop = 0;
+
+        BOOL    fMini;
+
+        if (fMini = !!(fl & DP_MINI))
+        {
+            cxIcon /= 2;
+            cyIcon /= 2;
+        }
+
+        // target top right (inclusive)
+        xRight = x + cxIcon - 1;
+        yTop = y + cyIcon - 1;
+
+        if (prclClip)
+        {
+            // we have a clip rectangle:
+            // set up the clip offsets that are used
+            // in both the target and source coordinates
+            // for blitting
+            if (x < prclClip->xLeft)
+                lClipLeft = prclClip->xLeft - x;
+            if (xRight > prclClip->xRight)
+                lClipRight = xRight - prclClip->xRight;
+            if (y < prclClip->yBottom)
+                lClipBottom = prclClip->yBottom - y;
+            if (yTop > prclClip->yTop)
+                lClipTop = yTop - prclClip->yTop;
+        }
+
+        // set up target coordinates that are constant
+        // for all the three blits
+
+        // aptl[0]: target bottom-left
+        aptl[0].x = x + lClipLeft;
+        aptl[0].y = y + lClipBottom;
+
+        // aptl[1]: target top-right (inclusive!)
+        aptl[1].x = xRight - lClipRight;
+        aptl[1].y = yTop - lClipTop;
+
+        if (    (aptl[0].x < aptl[1].x)
+             && (aptl[0].y < aptl[1].y)
+           )
+        {
+            // colors are constant too
+            GpiSetColor(hps, RGBCOL_WHITE);
+            GpiSetBackColor(hps, RGBCOL_BLACK);
+
+            /*
+             * 1)   work on the AND image
+             *      (upper part of the monochrome image)
+             */
+
+            if (    (    (fMini)
+                      && (hbmThis = pi.hbmMiniPointer)
+                    )
+                 || (hbmThis = pi.hbmPointer)
+               )
+            {
+                bmi.cbFix = sizeof(bmi);
+                GpiQueryBitmapInfoHeader(hbmThis, &bmi);
+
+                // use only half the bitmap height
+                cySrc = bmi.cy / 2;
+
+                // aptl[2]: source bottom-left
+                aptl[2].x =   0
+                            + lClipLeft   * bmi.cx / cxIcon;
+                aptl[2].y =   cySrc
+                            + lClipBottom * cySrc / cyIcon;
+
+                // aptl[3]: source top-right (exclusive!)
+                aptl[3].x =   bmi.cx
+                            - lClipRight  * bmi.cx / cxIcon;
+                aptl[3].y =   bmi.cy
+                            - lClipTop    * cySrc / cyIcon;
+
+                GpiWCBitBlt(hps,        // target
+                            hbmThis,    // src bmp
+                            4L,         // must always be 4
+                            aptl,       // point array
+                            ROP_SRCAND,   // source AND target
+                            BBO_IGNORE);
+            }
+
+            /*
+             * 2)   paint the color image; the parts that
+             *      are to be transparent are black
+             */
+
+            if (    (    (fMini)
+                      && (hbmThis = pi.hbmMiniColor)
+                    )
+                 || (hbmThis = pi.hbmColor)
+               )
+            {
+                bmi.cbFix = sizeof(bmi);
+                GpiQueryBitmapInfoHeader(hbmThis, &bmi);
+
+                // aptl[2]: source bottom-left
+                aptl[2].x =   0
+                            + lClipLeft   * bmi.cx / cxIcon;
+                aptl[2].y =   0
+                            + lClipBottom * bmi.cy / cyIcon;
+
+                // aptl[3]: source top-right (exclusive!)
+                aptl[3].x =   bmi.cx
+                            - lClipRight  * bmi.cx / cxIcon;
+                aptl[3].y =   bmi.cy
+                            - lClipTop    * bmi.cy / cyIcon;
+
+                GpiWCBitBlt(hps,        // target
+                            hbmThis,    // src bmp
+                            4L,         // must always be 4
+                            aptl,       // point array
+                            ROP_SRCPAINT,
+                            BBO_IGNORE);
+            }
+
+            /*
+             *  3)  work on the XOR image:
+             *      (lower part of monochrome bitmap)
+             */
+
+            if (    (    (fMini)
+                      && (hbmThis = pi.hbmMiniPointer)
+                    )
+                 || (hbmThis = pi.hbmPointer)
+               )
+            {
+                bmi.cbFix = sizeof(bmi);
+                GpiQueryBitmapInfoHeader(hbmThis, &bmi);
+
+                // use only half the bitmap height
+                cySrc = bmi.cy / 2;
+
+                // aptl[2]: source bottom-left
+                aptl[2].x =   0
+                            + lClipLeft   * bmi.cx / cxIcon;
+                aptl[2].y =   0
+                            + lClipBottom * cySrc / cyIcon;
+
+                // aptl[3]: source top-right (exclusive!)
+                aptl[3].x =   bmi.cx
+                            - lClipRight  * bmi.cx / cxIcon;
+                aptl[3].y =   cySrc
+                            - lClipTop    * cySrc / cyIcon;
+
+                GpiWCBitBlt(hps,        // target
+                            hbmThis,    // src bmp
+                            4L,         // must always be 4
+                            aptl,       // point array
+                            ROP_SRCINVERT,   // source XOR target
+                            BBO_IGNORE);
+            }
+
+            return TRUE;
+        }
+    }
+
+    return FALSE;
+}
+
 /*
  *@@category: Helpers\PM helpers\GPI helpers\XBitmaps
Index: trunk/src/helpers/regexp.c
===================================================================
--- trunk/src/helpers/regexp.c	(revision 176)
+++ trunk/src/helpers/regexp.c	(revision 178)
@@ -2524,11 +2524,11 @@
  */
 
-BOOLEAN rxpMatch_fwd(const ERE * ere,
-                     int eremf,
+BOOLEAN rxpMatch_fwd(const ERE *ere,        // in: compiled ERE (from rxpCompile)
+                     int eremf,             // in: EREMF_* flags
                      const char *str,       // in: string to test
                      int pos,               // in: start position
                      int *pos_match,        // out: position of match
                      int *len_match,        // out: length of match
-                     ERE_MATCHINFO * mi)
+                     ERE_MATCHINFO *mi)     // out: match info (for rxpSubsWith)
 {
     int len = pos + strlen(str + pos);
@@ -2577,9 +2577,11 @@
  */
 
-BOOLEAN rxpMatch_bwd(const ERE * ere,
-                     int eremf,
-                     const char *str, int pos,
-                     int *pos_match, int *len_match,
-                     ERE_MATCHINFO * mi)
+BOOLEAN rxpMatch_bwd(const ERE *ere,        // in: compiled ERE (from rxpCompile)
+                     int eremf,             // in: EREMF_* flags
+                     const char *str,       // in: string to test
+                     int pos,               // in: start position
+                     int *pos_match,        // out: position of match
+                     int *len_match,        // out: length of match
+                     ERE_MATCHINFO * mi)    // out: match info (for rxpSubsWith)
 {
     int i;
@@ -2630,14 +2632,15 @@
  *@@ rxpSubsWith:
  *      perform a substitution based upon an earlier found match.
- */
-
-BOOLEAN rxpSubsWith(const char *str,    // Original string searched
-                    int pos, int len,   // Span of the entire match
-                    ERE_MATCHINFO * mi,     // Details of sub-spans of match
-                    const char *with,   // Specification of replacement
-                    char *out,  // Substituted string buffer
-                    int len_out,    // How much room in output buffer
-                    int *rc     // Error, if FALSE returned
-)
+ *      This allows for implementing a "find and replace" function.
+ */
+
+BOOLEAN rxpSubsWith(const char *str,    // in: original string searched (same as str given to rxpMatch_fwd)
+                    int pos,            // in: span of the entire match (pos_match from rxpMatch_fwd)
+                    int len,            // in: span of the entire match (len_match from rxpMatch_fwd)
+                    ERE_MATCHINFO *mi,  // in: details of match sub-spans (as from rxpMatch_fwd)
+                    const char *with,   // in: replacement string with \1 etc.
+                    char *out,          // out: buffer for string substitutions
+                    int len_out,        // in: sizeof *out
+                    int *rc)            // out: error, if FALSE returned
 {
     int i = 0;
Index: trunk/src/helpers/stringh.c
===================================================================
--- trunk/src/helpers/stringh.c	(revision 176)
+++ trunk/src/helpers/stringh.c	(revision 178)
@@ -1056,21 +1056,24 @@
  *@@ strhBeautifyTitle:
  *      replaces all line breaks (0xd, 0xa) with spaces.
+ *      Returns the new length of the string or 0 on
+ *      errors.
  *
  *@@changed V0.9.12 (2001-05-17) [pr]: multiple line break chars. end up as only 1 space
- */
-
-BOOL strhBeautifyTitle(PSZ psz)
-{
-    BOOL rc = FALSE;
-    CHAR *p = psz;
-
-    while(*p)
+ *@@changed V0.9.19 (2002-06-18) [umoeller]: now returning length
+ */
+
+ULONG strhBeautifyTitle(PSZ psz)
+{
+    ULONG   ulrc;
+    PSZ     p = psz;
+
+    while (*p)
+    {
         if (    (*p == '\r')
              || (*p == '\n')
            )
         {
-            rc = TRUE;
-            if (   (p != psz)
-                && (p[-1] == ' ')
+            if (    (p != psz)
+                 && (p[-1] == ' ')
                )
                 memmove(p, p + 1, strlen(p));
@@ -1080,6 +1083,49 @@
         else
             p++;
-
-    return rc;
+    }
+
+    return (p - psz);
+}
+
+/*
+ *@@ strhBeautifyTitle:
+ *      like strhBeautifyTitle, but copies into
+ *      a new buffer. More efficient.
+ *
+ *@@added V0.9.19 (2002-06-18) [umoeller]
+ */
+
+ULONG strhBeautifyTitle2(PSZ pszTarget,     // out: beautified string
+                         PCSZ pcszSource)   // in: string to be beautified (can be NULL)
+{
+    ULONG   ulrc;
+    PCSZ    pSource = pcszSource;
+    PSZ     pTarget = pszTarget;
+    CHAR    c;
+    if (!pcszSource)
+    {
+        *pszTarget = '\0';
+        return 0;
+    }
+
+    while (c = *pSource++)
+    {
+        if (    (c == '\r')
+             || (c == '\n')
+           )
+        {
+            if (    (pTarget == pszTarget)
+                 || (pTarget[-1] != ' ')
+               )
+                *pTarget++ = ' ';
+        }
+        else
+            *pTarget++ = c;
+    }
+
+    // null-terminate
+    *pTarget = '\0';
+
+    return (pTarget - pszTarget);
 }
 
