Index: trunk/include/helpers/apps.h
===================================================================
--- trunk/include/helpers/apps.h	(revision 241)
+++ trunk/include/helpers/apps.h	(revision 242)
@@ -76,16 +76,9 @@
 
     #ifdef INCL_WINPROGRAMLIST
-        // additional PROG_* flags for appQueryAppType
-        // #define PROG_XWP_DLL            998      // dynamic link library
-                    // removed, PROG_DLL exists already
-                    // V0.9.16 (2001-10-06)
-
-        #define PROG_WIN32              990     // added V0.9.16 (2001-12-08) [umoeller]
+        // moved extra PROG_* defs to exeh.h V1.0.1 (2003-01-17) [umoeller]
 
         APIRET appQueryAppType(const char *pcszExecutable,
                                PULONG pulDosAppType,
                                PULONG pulWinAppType);
-
-        PCSZ appDescribeAppType(PROGCATEGORY progc);
 
         ULONG appIsWindowsApp(ULONG ulProgCategory);
Index: trunk/include/helpers/comctl.h
===================================================================
--- trunk/include/helpers/comctl.h	(revision 241)
+++ trunk/include/helpers/comctl.h	(revision 242)
@@ -1195,11 +1195,12 @@
 
     MRESULT ctlFormatExtFrame(HWND hwndFrame,
-                              PXFRAMECONTROLS pxfc,
+                              const XFRAMECONTROLS *pxfc,
                               MPARAM mp1,
                               MPARAM mp2);
 
-    VOID ctlCalcExtFrameRect(MPARAM mp1,
-                             MPARAM mp2,
-                             LONG lStatusBarHeight);
+    MRESULT ctlCalcExtFrameRect(HWND hwndFrame,
+                                const XFRAMECONTROLS *pxfc,
+                                MPARAM mp1,
+                                MPARAM mp2);
 
     HWND ctlCreateStatusBar(HWND hwndFrame,
@@ -1401,4 +1402,17 @@
     typedef CTLMAKECOLORRECT *PCTLMAKECOLORRECT;
 
+    /* ******************************************************************
+     *
+     *   Container control replacement
+     *
+     ********************************************************************/
+
+    #define WC_CCTL_CNR             "ComctlCnr"
+
+    MRESULT EXPENTRY fnwpCnr(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
+
+    BOOL ctlRegisterXCnr(HAB hab);
+
+
 #endif
 
Index: trunk/include/helpers/exeh.h
===================================================================
--- trunk/include/helpers/exeh.h	(revision 241)
+++ trunk/include/helpers/exeh.h	(revision 242)
@@ -7,4 +7,5 @@
  *            numbering.
  *
+ *@@include #define INCL_WINPROGRAMLIST         // for some funcs only
  *@@include #include <os2.h>
  *@@include #include "helpers\dosh.h"
@@ -231,5 +232,5 @@
     typedef struct _LXHEADER
     {
-        CHAR        achLX[2];           // 00: e32_magic  "LX" or "LE" magic
+        CHAR      achLX[2];             // 00: e32_magic  "LX" or "LE" magic
             // this is "LX" for 32-bit OS/2 programs, but
             // "LE" for MS-DOS progs which use this format
@@ -245,15 +246,27 @@
         ULONG     ulFlags;              // 10: e32_mflags module flags
                 #ifndef E32NOTP // do not conflict with toolkit exe defs
-                    #define E32NOTP          0x8000L        // Library Module - used as NENOTP
-                    #define E32NOLOAD        0x2000L        // Module not Loadable
-                    #define E32PMAPI         0x0300L        // Uses PM Windowing API
-                    #define E32PMW           0x0200L        // Compatible with PM Windowing
-                    #define E32NOPMW         0x0100L        // Incompatible with PM Windowing
-                    #define E32NOEXTFIX      0x0020L        // NO External Fixups in .EXE
-                    #define E32NOINTFIX      0x0010L        // NO Internal Fixups in .EXE
-                    #define E32SYSDLL        0x0008L        // System DLL, Internal Fixups discarded
-                    #define E32LIBINIT       0x0004L        // Per-Process Library Initialization
+                    #define E32NOTP          0x00008000L    // Library Module - used as NENOTP
+                    #define E32NOLOAD        0x00002000L    // Module not Loadable
+                    #define E32PMAPI         0x00000300L    // Uses PM Windowing API
+                    #define E32PMW           0x00000200L    // Compatible with PM Windowing
+                    #define E32NOPMW         0x00000100L    // Incompatible with PM Windowing
+                    #define E32NOEXTFIX      0x00000020L    // NO External Fixups in .EXE
+                    #define E32NOINTFIX      0x00000010L    // NO Internal Fixups in .EXE
+                    #define E32SYSDLL        0x00000008L    // System DLL, Internal Fixups discarded
+                    #define E32LIBINIT       0x00000004L    // Per-Process Library Initialization
                     #define E32LIBTERM       0x40000000L    // Per-Process Library Termination
-                    #define E32APPMASK       0x0300L        // Application Type Mask
+
+                    #define E32APPMASK       0x00000300L    // Application Type Mask
+
+                    // hiword defs added V1.0.1 (2003-01-17) [umoeller]
+                    #define E32PROTDLL       0x00010000L    // Protected memory library module *
+                    #define E32DEVICE        0x00020000L    // Device driver                   *
+                    #define E32MODEXE        0x00000000L    // .EXE module                     *
+                    #define E32MODDLL        0x00008000L    // .DLL module                     *
+                    #define E32MODPROTDLL    0x00018000L    // Protected memory library module *
+                    #define E32MODPDEV       0x00020000L    // Physical device driver          *
+                    #define E32MODVDEV       0x00028000L    // Virtual device driver           *
+                    #define E32MODMASK       0x00038000L    // Module type mask                *
+                    #define E32NOTMPSAFE     0x00080000L    // Process is multi-processor unsafe *
                 #endif
         ULONG     ulPageCount;          // 14: e32_mpages no. of pages in module
@@ -1243,4 +1256,22 @@
     APIRET exehQueryBldLevel(PEXECUTABLE pExec);
 
+    #ifdef INCL_WINPROGRAMLIST
+
+        // additional PROG_* flags for exehQueryProgType; moved these here
+        // from app.h V1.0.1 (2003-01-17) [umoeller]
+
+        // #define PROG_XWP_DLL            998      // dynamic link library
+                    // removed, PROG_DLL exists already
+                    // V0.9.16 (2001-10-06)
+
+        #define PROG_WIN32              990     // added V0.9.16 (2001-12-08) [umoeller]
+
+        APIRET exehQueryProgType(const EXECUTABLE *pExec,
+                                 PROGCATEGORY *pulProgType);
+
+        PCSZ exehDescribeProgType(PROGCATEGORY progc);
+
+    #endif
+
     /*
      *@@ FSYSMODULE:
Index: trunk/include/helpers/gpih.h
===================================================================
--- trunk/include/helpers/gpih.h	(revision 241)
+++ trunk/include/helpers/gpih.h	(revision 242)
@@ -194,4 +194,15 @@
                                               PCH pchString);
     typedef GPIHCHARSTRINGPOSAT *PGPIHCHARSTRINGPOSAT;
+
+    VOID XWPENTRY gpihCalcTextExtent(HPS hps,
+                                     PCSZ pcsz,
+                                     PLONG pcx,
+                                     PULONG pcLines);
+
+    VOID XWPENTRY gpihDrawString(HPS hps,
+                                 PCSZ pcsz,
+                                 PRECTL prcl,
+                                 ULONG fl,
+                                 PFONTMETRICS pfm);
 
     /*
Index: trunk/include/helpers/linklist.h
===================================================================
--- trunk/include/helpers/linklist.h	(revision 241)
+++ trunk/include/helpers/linklist.h	(revision 242)
@@ -134,7 +134,7 @@
                                           const char *function);
         typedef PLINKLIST XWPENTRY LSTCREATEDEBUG(BOOL fItemsFreeable,
-                                          const char *file,
-                                          unsigned long line,
-                                          const char *function);
+                                                  const char *file,
+                                                  unsigned long line,
+                                                  const char *function);
         typedef LSTCREATEDEBUG *PLSTCREATEDEBUG;
 
@@ -199,7 +199,15 @@
                                            unsigned long ulIndex);
     typedef PLISTNODE XWPENTRY LSTINSERTITEMBEFORE(PLINKLIST pList,
-                                           void* pNewItemData,
-                                           unsigned long ulIndex);
+                                                   void* pNewItemData,
+                                                   unsigned long ulIndex);
     typedef LSTINSERTITEMBEFORE *PLSTINSERTITEMBEFORE;
+
+    PLISTNODE XWPENTRY lstInsertItemAfterNode(PLINKLIST pList,
+                                              void* pNewItemData,
+                                              PLISTNODE pNodeInsertAfter);
+    typedef PLISTNODE XWPENTRY LSTINSERTITEMAFTERNODE(PLINKLIST pList,
+                                                      void* pNewItemData,
+                                                      PLISTNODE pNodeInsertAfter);
+    typedef LSTINSERTITEMAFTERNODE *PLSTINSERTITEMAFTERNODE;
 
     BOOL XWPENTRY lstRemoveNode(PLINKLIST pList, PLISTNODE pRemoveNode);
Index: trunk/include/helpers/nls.h
===================================================================
--- trunk/include/helpers/nls.h	(revision 241)
+++ trunk/include/helpers/nls.h	(revision 242)
@@ -90,5 +90,34 @@
         } COUNTRYSETTINGS, *PCOUNTRYSETTINGS;
 
-        VOID XWPENTRY nlsQueryCountrySettings(PCOUNTRYSETTINGS pcs);
+        /*
+         *@@ COUNTRYAMPM:
+         *
+         *@@added V1.0.1 (2003-01-17) [umoeller]
+         */
+
+        typedef struct _COUNTRYAMPM
+        {
+            CHAR            sz2359[10],
+                            sz1159[10];
+        } COUNTRYAMPM, *PCOUNTRYAMPM;
+
+        /*
+         *@@ COUNTRYSETTINGS:
+         *      second structure to finally get the AM/PM
+         *      stuff right too. I suspect people have used
+         *      this structure in XCenter DLLs and such so
+         *      I cannot easily change it... hence a second
+         *      one.
+         *
+         *@@changed V1.0.1 (2003-01-17) [umoeller]
+         */
+
+        typedef struct _COUNTRYSETTINGS2
+        {
+            COUNTRYSETTINGS cs;
+            COUNTRYAMPM     ampm;
+        } COUNTRYSETTINGS2, *PCOUNTRYSETTINGS2;
+
+        VOID XWPENTRY nlsQueryCountrySettings(PCOUNTRYSETTINGS2 pcs);
 
         PSZ XWPENTRY nlsThousandsULong(PSZ pszTarget, ULONG ul, CHAR cThousands);
@@ -103,17 +132,27 @@
                                        CHAR cThousands);
 
+        VOID XWPENTRY nlsDate(const COUNTRYSETTINGS2 *pcs2,
+                              PSZ pszDate,
+                              USHORT year,
+                              BYTE month,
+                              BYTE day);
+
+        VOID XWPENTRY nlsTime(const COUNTRYSETTINGS2 *pcs,
+                              PSZ pszTime,
+                              BYTE hours,
+                              BYTE minutes,
+                              BYTE seconds);
+
         VOID XWPENTRY nlsFileDate(PSZ pszBuf,
-                                  FDATE *pfDate,
-                                  ULONG ulDateFormat,
-                                  CHAR cDateSep);
+                                  const FDATE *pfDate,
+                                  const COUNTRYSETTINGS2 *pcs);
 
         VOID XWPENTRY nlsFileTime(PSZ pszBuf,
-                                  FTIME *pfTime,
-                                  ULONG ulTimeFormat,
-                                  CHAR cTimeSep);
+                                  const FTIME *pfTime,
+                                  const COUNTRYSETTINGS2 *pcs);
 
         VOID XWPENTRY nlsDateTime(PSZ pszDate,
                                   PSZ pszTime,
-                                  DATETIME *pDateTime,
+                                  const DATETIME *pDateTime,
                                   ULONG ulDateFormat,
                                   CHAR cDateSep,
@@ -122,5 +161,5 @@
         typedef VOID XWPENTRY NLSDATETIME(PSZ pszDate,
                                           PSZ pszTime,
-                                          DATETIME *pDateTime,
+                                          const DATETIME *pDateTime,
                                           ULONG ulDateFormat,
                                           CHAR cDateSep,
@@ -129,7 +168,17 @@
         typedef NLSDATETIME *PNLSDATETIME;
 
-        ULONG nlsUpper(PSZ psz);
+        VOID XWPENTRY nlsDateTime2(PSZ pszDate,
+                                   PSZ pszTime,
+                                   const DATETIME *pDateTime,
+                                   const COUNTRYSETTINGS2 *pcs2);
+        typedef VOID XWPENTRY NLSDATETIME2(PSZ pszDate,
+                                           PSZ pszTime,
+                                           const DATETIME *pDateTime,
+                                           const COUNTRYSETTINGS2 *pcs2);
+        typedef NLSDATETIME2 *PNLSDATETIME2;
 
     #endif
+
+    ULONG nlsUpper(PSZ psz);
 
 #endif
Index: trunk/include/helpers/standards.h
===================================================================
--- trunk/include/helpers/standards.h	(revision 241)
+++ trunk/include/helpers/standards.h	(revision 242)
@@ -126,4 +126,10 @@
     #define STOREIFMAX(a, b) if ((a) > (b)) { b = a; }
 
+    #ifdef _PMPRINTF_
+        #define PMPF_RECT(s, prect) _PmpfF(("%s: xLeft %d, xRight %d, yBottom %d, yTop %d", (s), (prect)->xLeft, (prect)->xRight, (prect)->yBottom, (prect)->yTop))
+    #else
+        #define PMPF_RECT(s, prect)
+    #endif
+
 #endif
 
Index: trunk/include/helpers/winh.h
===================================================================
--- trunk/include/helpers/winh.h	(revision 241)
+++ trunk/include/helpers/winh.h	(revision 242)
@@ -673,4 +673,11 @@
      ********************************************************************/
 
+    #define ID_VSCROLL      100
+    #define ID_HSCROLL      101
+
+    BOOL XWPENTRY winhCreateScrollBars(HWND hwndParent,
+                                       HWND *phwndV,
+                                       HWND *phwndH);
+
     BOOL XWPENTRY winhUpdateScrollBar(HWND hwndScrollBar,
                                       ULONG ulWinPels,
@@ -687,4 +694,15 @@
                                       ULONG msg,
                                       MPARAM mp2);
+
+    LONG XWPENTRY winhHandleScrollMsg2(HWND hwndScrollBar,
+                                       PLONG plCurPelsOfs,
+                                       LONG lWindowPels,
+                                       LONG lWorkareaPels,
+                                       USHORT usLineStepPels,
+                                       ULONG msg,
+                                       MPARAM mp2);
+    BOOL XWPENTRY winhScrollWindow(HWND hwnd2Scroll,
+                                   PRECTL prclClip,
+                                   PPOINTL pptlScroll);
 
     BOOL XWPENTRY winhProcessScrollChars(HWND hwndClient,
@@ -951,4 +969,8 @@
                                     ULONG ulID);
 
+    BOOL XWPENTRY winhSetParentAndOwner(HWND hwnd,
+                                        HWND hwndNewParent,
+                                        BOOL fRedraw);
+
     VOID XWPENTRY winhRepaintWindows(HWND hwndParent);
 
Index: trunk/include/private/cnr.h
===================================================================
--- trunk/include/private/cnr.h	(revision 242)
+++ trunk/include/private/cnr.h	(revision 242)
@@ -0,0 +1,194 @@
+/*
+ *@@sourcefile cnr.h.h:
+ *      private header file for cctl_cnr.c. See remarks there.
+ *
+ *      Note: Version numbering in this file relates to XWorkplace version
+ *            numbering.
+ */
+
+/*      Copyright (C) 2003 Ulrich Mller.
+ *      This file is part of the "XWorkplace helpers" source package.
+ *      This is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published
+ *      by the Free Software Foundation, in version 2 as it comes in the
+ *      "COPYING" file of the XWorkplace main distribution.
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ */
+
+#if __cplusplus
+extern "C" {
+#endif
+
+#ifndef PRIVATE_CNR_HEADER_INCLUDED
+    #define PRIVATE_CNR_HEADER_INCLUDED
+
+    /* ******************************************************************
+     *
+     *   Global stuff
+     *
+     ********************************************************************/
+
+    #define WC_CCTL_CNR_DETAILS     "ComctlCnrDtls"
+
+    extern const SYSCOLORSET G_scsCnr;
+
+    #define COLUMN_PADDING_X        7
+    #define COLUMN_PADDING_Y        3
+                // padding to apply between column border and column data
+
+    #define DEFAULT_BORDER_WIDTH    1
+                // default width of lines used for details and tree view lines
+
+    /*
+     *@@ DETAILCOLUMN:
+     *      private wrapper data around FIELDINFO.
+     */
+
+    typedef struct _DETAILCOLUMN
+    {
+        const FIELDINFO *pfi;           // ptr to fieldinfo for this column
+
+        LONG        cxTotal;            // current width of the column (excluding padding);
+                                        // -- if pfi->cxWidth == 0, this is the computed auto-size;
+                                        // -- otherwise this is a copy of the pfi->cxWidth value
+
+        LONG        cxWidestRecord;     // width of widest record data in this column (excluding padding)
+
+        SIZEL       szlTitleData;       // dimensions of title data (excluding padding)
+
+        LONG        xLeft;              // position of column in cnr workspace coordinates
+
+    } DETAILCOLUMN, *PDETAILCOLUMN;
+
+    /*
+     *@@ RECORDLISTITEM:
+     *      private wrapper data around an app's RECORDCORE
+     *      that is currently inserted somewhere.
+     *
+     *      We create both a list node and a tree node for
+     *      each record that is currently inserted.
+     */
+
+    typedef struct _RECORDLISTITEM
+    {
+        const RECORDCORE
+                    *precc,             // ptr to app's RECORDCORE buffer
+                    *preccParent;       // parent of record or NULL if root
+
+        SIZEL       szlContent;         // space that records needs in current cnr view
+                                        // (excluding padding)
+        SIZEL       szlBox;             // space that records needs in current cnr view
+                                        // (including padding)
+        LONG        yOfs;               // y offset of the top of this record's rectangle
+                                        // from the top of the cnr workspace. Positive
+                                        // values mean the record is further down.
+                                        // In Details view, the topmost record has an
+                                        // offset of 0.
+
+    } RECORDLISTITEM, *PRECORDLISTITEM;
+
+    /*
+     *@@ RECORDTREEITEM:
+     *      second private wrapper data around a
+     *      RECORDCORE that is currently inserted somewhere.
+     *
+     *      We create both a list node and a tree node for
+     *      each record that is currently inserted.
+     */
+
+    typedef struct _RECORDTREEITEM
+    {
+        TREE        Tree;               // ulKey is app's PRECORDCORE
+        PLISTNODE   pListNode;          // points to the LISTNODE corresponding to record
+    } RECORDTREEITEM, *PRECORDTREEITEM;
+
+    /*
+     *@@ CNRDATA:
+     *
+     */
+
+    typedef struct _CNRDATA
+    {
+        DEFWINDATA  dwdMain,
+                    dwdContent;
+
+        BOOL        fMiniRecords;
+
+        CNRINFO     CnrInfo;
+
+        LINKLIST    llAllocatedFIs;     // contains PFIELDINFO's that were allocated, auto-free
+        LINKLIST    llColumns;          // contains PDETAILCOLUMN's with FIELDINFO's that are
+                                        // currently inserted, auto-free
+
+        LINKLIST    llAllocatedRecs;    // contains PRECORDCORE's that were allocated, auto-free
+        LINKLIST    llRootRecords;      // contains PRECORDLISTITEM's with RECORDCORE's that are
+                                        // currently inserted at root level (i.e. have no parent
+                                        // record), auto-free
+        TREE        *RecordsTree;       // tree of _all_ currently inserted RECORDLISTITEM's;
+                                        // we use CnrInfo.cRecords for the tree count
+
+        // paint data
+        FONTMETRICS fm;
+        COUNTRYSETTINGS2 cs;
+
+        HWND        hwndDetails;        // child of main cnr window
+
+        HWND        hwndVScroll,        // child of hwndDetails
+                    hwndHScroll;
+
+        LONG        cxScrollBar,
+                    cyScrollBar;
+
+        LONG        cyColTitlesContent, // if CnrInfo.flWindowAttr & CA_DETAILSVIEWTITLES, height of
+                                        // column titles area (excluding padding and horz. separator)
+                    cyColTitlesBox;     // ... and including those
+
+        SIZEL       szlWorkarea;        // dimensions of cnr workarea (area that window scrolls over)
+
+        POINTL      ptlScrollOfs;       // scroll ofs: x = 0 means topmost, y = 0 means leftmost
+
+    } CNRDATA, *PCNRDATA;
+
+    // bits for WM_SEM2
+    #define DDFL_INVALIDATECOLUMNS     0x0001
+                // no. of columns changed
+
+    #define DDFL_INCALIDATERECORDS      0x0002
+
+    #define DDFL_WINDOWSIZECHANGED      0x0004
+
+    #define DDFL_WORKAREACHANGED        0x0008
+
+    #define DDFL_ALL                    0xFFFF
+
+    /* ******************************************************************
+     *
+     *   Cnr details view stuff
+     *
+     ********************************************************************/
+
+    VOID cnrDrawString(HPS hps,
+                       PCSZ pcsz,
+                       PRECTL prcl,
+                       ULONG fl,
+                       PFONTMETRICS pfm);
+
+    VOID cnrPresParamChanged(HWND hwnd,
+                             ULONG ulpp);
+
+    VOID cdtlRecalcDetails(PCNRDATA pData,
+                           HPS hps,
+                           PULONG pfl);
+
+    MRESULT EXPENTRY fnwpCnrDetails(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
+
+#endif
+
+#if __cplusplus
+}
+#endif
+
