Ejemplo n.º 1
0
VOID ClientPaint(HWND hwnd)
  {
  POINTL  pt;
  HPS     hps;
  RECTL   rcl;
  LONG lLen;
  LONG lCenter;

  WinInvalidateRect(hwnd,(PRECTL)NULL,FALSE);
  hps = WinBeginPaint(hwnd,(HPS)NULL,&rcl );
//  if (bShowingProgress)
//    rcl.yBottom = 60L;
  WinFillRect(hps,&rcl,CLR_WHITE);
  lCenter = (INITWIDTH / 2);
  if (bDebug)
    {
    GpiSetBackColor(hps,CLR_WHITE);
    GpiSetBackMix(hps,BM_OVERPAINT);

    GpiCreateLogFont(hps,NULL,3,&fattMsgFont);

    GpiSetColor(hps,CLR_BLACK);
    GpiSetCharSet(hps,3);
    pt.x = 10;

    if (szDebugLineOne[0] != 0)
      {
      pt.y = 82L;
      GpiCharStringAt(hps,&pt,strlen(szDebugLineOne),szDebugLineOne);
      }
    if (szDebugLineTwo[0] != 0)
      {
      pt.y = 62L;
      GpiCharStringAt(hps,&pt,strlen(szDebugLineTwo),szDebugLineTwo);
      }
    }
  else
    {
    GpiSetColor(hps,CLR_CYAN);
    GpiSetBackColor(hps,CLR_WHITE);
    GpiSetBackMix(hps,BM_OVERPAINT);


    GpiCreateLogFont(hps,
                     NULL,
                     2,
                    &fattBigFont);

    GpiSetCharSet(hps,2);
    pt.x = (lCenter - (10 * stBigCell.cx));
    pt.y = 60L;
    GpiCharStringAt(hps,&pt,21,"OS/tools Installation");
    }
  if (!bShowingProgress)
    PrintBanners(szBannerOne,szBannerTwo);
  WinEndPaint(hps);
  }
Ejemplo n.º 2
0
LONG ScaleFont(HPS hPS,	CHAR *pszFacename, LONG	lSize)

{
FATTRS fat;			   /* Font Attributes			*/
SIZEF  sizfxBox;		   /* Character	Size Holder		*/

		       /* Complete the font attributes structure to	*/
		       /* allow	the selection of the font requested	*/
		       /* within the print file	dialogue box		*/

memset(&fat, 0,	sizeof(FATTRS));
fat.usRecordLength  = (USHORT)sizeof(FATTRS);
fat.lMatch	    = SelectScalableFont(hPS, strcpy(fat.szFacename, pszFacename));
fat.usCodePage	    = (USHORT)850;

		       /* Create the required font and set the		*/
		       /* character size by changing the character box	*/
		       /* size.	 The sizing in TWIPS for a 12 pt font	*/
		       /* is 240, therefore a 10 pt font would be 200.	*/

GpiCreateLogFont(hPS, (PSTR8)NULL, 2L, &fat);
GpiSetCharSet(hPS, 2L);

sizfxBox.cx = sizfxBox.cy = MAKEFIXED(lSize * 2, 0);

GpiSetCharBox(hPS, &sizfxBox);

return(2L);
}
Ejemplo n.º 3
0
void setTNGfont(HPS hps)
{
    LONG         cFonts;
    LONG         lTemp = 0L;
    CHAR         fontName[25];
    FATTRS       fattrs;
    SIZEF        sizfCharBox;

    fattrs.usRecordLength  = sizeof(FATTRS);
    fattrs.fsSelection     = 0;
    fattrs.lMatch          = 0L;
    fattrs.idRegistry      = 0;
    fattrs.usCodePage      = 850;
    fattrs.lMaxBaselineExt = 0L;
    fattrs.lAveCharWidth   = 0L;
    fattrs.fsType          = 0;
    fattrs.fsFontUse       = FATTR_FONTUSE_OUTLINE;
    strcpy(fattrs.szFacename,TNG_FONT);

    cFonts = GpiQueryFonts(hps, QF_PUBLIC,fattrs.szFacename, &lTemp,
             (LONG) sizeof(FONTMETRICS), (PFONTMETRICS)NULL);
    if (cFonts==0)
    {
        strcpy(fattrs.szFacename,"Helvetica");
    }

    GpiCreateLogFont(hps, (PSTR8)NULL, fontId, &fattrs);
    GpiSetCharSet(hps,fontId);

    sizfCharBox.cx=MAKEFIXED(14,0);
    sizfCharBox.cy=MAKEFIXED(20,0); 
    GpiSetCharBox(hps,&sizfCharBox);
    GpiSetTextAlignment(hps,TA_CENTER,TA_TOP);
}
Ejemplo n.º 4
0
/****************************************************************************
 * InitFonts                                                                *
 *  - Retrieves font metrics then creates logical fonts.                    *
 *  - Recieves HPS for GpiQueryFonts call.                                  *
 ****************************************************************************/
VOID InitFonts(HPS hps)
{
    CHAR       *cp;
    INT		i;
    LONG	cFonts;
    FATTRS	fat;
    FONTMETRICS afm[2];

    /* Get font metrics for both fonts. */
    cFonts = 2;
    GpiQueryFonts(hps, QF_PRIVATE, NULL, &cFonts,
	(LONG) sizeof(FONTMETRICS), (PFONTMETRICS) afm);

    /* Create both logical fonts. */
    for (i=0,cp=(CHAR *)&fat;i<sizeof(FATTRS);i++,cp++)
    	*cp=0;
    fat.usRecordLength = sizeof(FATTRS);
    fat.fsFontUse = FATTR_FONTUSE_NOMIX;
    for (i=0;i<2;i++) {
	/* Set up FATTRS structure */
	fat.fsSelection = afm[i].fsSelection;
	fat.lMatch = afm[i].lMatch;
	fat.idRegistry = afm[i].idRegistry;
	fat.usCodePage = afm[i].usCodePage;
	fat.fsType = afm[i].fsType;
	fat.lAveCharWidth = afm[i].lAveCharWidth;
	fat.lMaxBaselineExt = afm[i].lMaxBaselineExt;
	strcpy(fat.szFacename,afm[i].szFacename);
	if (fat.lMaxBaselineExt < afm[(i+1)%2].lMaxBaselineExt) {
	    iSizeSmall = (INT) fat.lMaxBaselineExt;
	    GpiCreateLogFont(hps, NULL, LCID_SMALL, &fat);
	    }
	else {
	    iSizeLarge = (INT) fat.lMaxBaselineExt;
	    GpiCreateLogFont(hps, NULL, LCID_LARGE, &fat);
	    }
	}
}
Ejemplo n.º 5
0
static void LboxDrawLine(HWND hwnd, OWNERITEM *item, RECTL *rcl, image_contents_screencode_t *line)
{
    const HPS hps = item->hps;
    const int name = WinDlgLboxSelectedItem(hwnd, DID_FONTNAME_LB);
    FATTRS font = { sizeof(FATTRS), 0, 0, "", 0, 0, 8, 8, 0, 0 };

    strcpy(font.szFacename, fnames[name]);

    GpiCreateLogFont(hps, NULL, 1, &font);
    GpiSetCharSet(hps, 1);
    GpiSetBackColor(hps, item->fsState ? CLR_DARKGRAY : CLR_WHITE);
    GpiSetColor(hps, item->fsState ? CLR_WHITE : CLR_DEFAULT);
    GpiCharStringPosAt(hps, (POINTL*)rcl, rcl, CHS_OPAQUE, line->length, line->line, NULL);
    GpiSetCharSet(hps, 0);
    GpiDeleteSetId(hps, 1);
}
/****************************************************************
 DefaultOutlineFont: Set an outline font which is sizeable.
****************************************************************/
void SetOutlineFont(HPS   hps,
                    short height)

{FONTMETRICS    fm[80];
 static FATTRS  fat;
 static LONG    cFonts=0;
 LONG           ltemp=0;
 SIZEF          size;
 int            i;
 
 if (height<=2)
   return;

 if (cFonts==0) {
    GpiLoadFonts(WinQueryAnchorBlock(HWND_DESKTOP),"helv");
    cFonts= GpiQueryFonts(hps,QF_PUBLIC|QF_PRIVATE,"Helv",&ltemp,
                  sizeof(FONTMETRICS),(PFONTMETRICS)0);
    if (cFonts>sizeof(fm)/sizeof(FONTMETRICS))
      cFonts=sizeof(fm)/sizeof(FONTMETRICS);
    GpiQueryFonts(hps,QF_PUBLIC|QF_PRIVATE,"Helv",&cFonts,
                  sizeof(FONTMETRICS),fm);
    for (i=0; (!(fm[i].fsDefn&FM_DEFN_OUTLINE)) &&     //find outline and
              (!(fm[i].fsType&FM_TYPE_KERNING))  &&    //kerned if can
              (i<cFonts); i++);
    if (i==cFonts)
      for (i=0; (!(fm[i].fsDefn&FM_DEFN_OUTLINE))&&  // Find outline atleast
                (i<cFonts); i++);
    if (i==cFonts)
      i=0;

    fat.usRecordLength =sizeof(FATTRS);
    fat.lMatch         =fm[i].lMatch;
    fat.lMatch         =0;
    fat.fsFontUse      = FATTR_FONTUSE_OUTLINE;
    strcpy(fat.szFacename,fm[i].szFacename);
   }

 GpiCreateLogFont(hps,(PSTR8)0,1,&fat);
 GpiSetBackMix(hps,(LONG)BM_LEAVEALONE);
 GpiSetCharSet(hps,1);
 size.cx = MAKEFIXED(height,0);
 size.cy = MAKEFIXED(height,0);
 GpiSetCharBox(hps,&size);
 GpiSetTextAlignment(hps,TA_NORMAL_HORIZ,TA_BOTTOM);
}
Ejemplo n.º 7
0
static MRESULT EXPENTRY LinkLabelProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
    linkData *ld = (linkData *)WinQueryWindowULong( hwnd, QWL_USER );
    switch ( msg )
    {
    case WM_PAINT:
    {
        FONTMETRICS fm;
        FATTRS fat;
        HPS hps;
        ULONG style;
        char *text = (char *)malloc( MAXTEXTLEN );
        WinQueryWindowText( hwnd, MAXTEXTLEN, text);
        hps = WinBeginPaint( hwnd , 0L , 0L );
        GpiQueryFontMetrics( hps , sizeof( FONTMETRICS ) , &fm );
        memset( &fat , 0 , sizeof( fat ) );
        fat.usRecordLength = sizeof( FATTRS );
        fat.lMatch = fm.lMatch;
        fat.fsSelection = FATTR_SEL_UNDERSCORE;
        strcpy( fat.szFacename , fm.szFacename );
        GpiDeleteSetId( hps , 1 );
        GpiCreateLogFont( hps , 0 , 1 , &fat );
        GpiSetCharSet( hps , 1 );
        WinQueryWindowRect( hwnd , &ld->textRect );
        style = WinQueryWindowULong( hwnd, QWL_STYLE );
        style &= DT_LEFT|DT_CENTER|DT_RIGHT|DT_TOP|DT_VCENTER|DT_BOTTOM;
        WinDrawText( hps, -1, text, &ld->textRect,
                     CLR_BLUE, SYSCLR_DIALOGBACKGROUND,
                     style | DT_ERASERECT | DT_UNDERSCORE );
        WinDrawText( hps, -1, text, &ld->textRect,
                     CLR_BLUE, SYSCLR_DIALOGBACKGROUND,
                     style | DT_QUERYEXTENT | DT_UNDERSCORE );
        WinEndPaint( hps );
        free( text );
    }
    return (MRESULT)FALSE;

    case WM_MOUSEMOVE:
    {
        if ( handPtr != NULLHANDLE )
        {
            POINTL ptl;
            ptl.x = SHORT1FROMMP( mp1 );
            ptl.y = SHORT2FROMMP( mp1 );
            if ( WinPtInRect( WinQueryAnchorBlock( hwnd ), &ld->textRect, &ptl) )
            {
                WinSetPointer( HWND_DESKTOP, handPtr );
                return (MRESULT)FALSE;
            }
        }
    }
    break;

    case WM_BUTTON1CLICK:
    {
        PROGDETAILS pd;
        char *text;
        POINTL ptl;

        if ( strcmp( browserExe, "" ) == 0 )  break;

        ptl.x = SHORT1FROMMP( mp1 );
        ptl.y = SHORT2FROMMP( mp1 );
        if ( !WinPtInRect( WinQueryAnchorBlock( hwnd ), &ld->textRect, &ptl) )
            break;

        if ( ld->url == NULL )
        {
            text = (char *)malloc( MAXTEXTLEN );
            WinQueryWindowText( hwnd, MAXTEXTLEN, text);
        }
        else  text = strdup( ld->url );

        pd.Length          = sizeof( PROGDETAILS );
        pd.progt.progc     = PROG_DEFAULT;
        pd.progt.fbVisible = SHE_VISIBLE;
        pd.pszTitle        = NULL;
        pd.pszExecutable   = browserExe;
        pd.pszParameters   = NULL;
        pd.pszStartupDir   = ( browserDir[0] == 0 ) ? NULL : browserDir;
        pd.pszIcon         = NULL;
        pd.pszEnvironment  = NULL;
        pd.swpInitial.fl   = SWP_ACTIVATE;
        pd.swpInitial.cy   = 0;
        pd.swpInitial.cx   = 0;
        pd.swpInitial.y    = 0;
        pd.swpInitial.x    = 0;
        pd.swpInitial.hwndInsertBehind = HWND_TOP;
        pd.swpInitial.hwnd             = NULLHANDLE;
        pd.swpInitial.ulReserved1      = 0;
        pd.swpInitial.ulReserved2      = 0;
        WinStartApp( NULLHANDLE , &pd , text , NULL , 0 );
        free( text );
    }
    break;

    case WM_DESTROY:
        ld->labelProc( hwnd, msg, mp1, mp2 );
        if ( ld->url != NULL )  free( ld->url );
        free( ld );
        return (MRESULT)FALSE;
    }
    return ld->labelProc( hwnd, msg, mp1, mp2 );
}
Ejemplo n.º 8
0
/**************************************************************************
 *
 *  Name       : MyWindowProc
 *
 *  Description: The window procedure associated with the client area in
 *               the standard frame window. It processes all messages
 *               either sent or posted to the client area, depending on
 *               the message command and parameters.
 *
 *  Concepts   :
 *
 *  API's      :   WinLoadString
 *                 WinInvalidateRegion
 *                 WinPostMsg
 *                 WinDefWindowProc
 *                 WinBeginPaint
 *                 GpiSetColor
 *                 GpiSetBackColor
 *                 GpiSetBackMix
 *                 GpiCharStringAt
 *                 WinEndPaint
 *
 *  Parameters :  hwnd = window handle
 *                msg = message code
 *                mp1 = first message parameter
 *                mp2 = second message parameter
 *
 *  Return     :  depends on message sent
 *
 *************************************************************************/
MRESULT EXPENTRY MyWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
  switch( msg )
  {
      case WM_TIMER: {
          WinInvalidateRegion( hwnd, 0L, FALSE );
          break;
        }
    case WM_CREATE:
      /*
       * Window initialization is performed here in WM_CREATE processing
       * WinLoadString loads strings from the resource file.
       */
      WinLoadString( hab, (HMODULE)0L, IDS_HELLO, STRINGLENGTH, szHello );
      WinLoadString( hab, (HMODULE)0L, IDS_1,     STRINGLENGTH, sz1     );
      WinLoadString( hab, (HMODULE)0L, IDS_2,     STRINGLENGTH, sz2     );
      WinLoadString( hab, (HMODULE)0L, IDS_3,     STRINGLENGTH, sz3     );
      strcpy( szString, szHello );      /* Copy text Hello into szString*/
      break;

    case WM_COMMAND:
      /*
       * When the user chooses option 1, 2, or 3 from the Options pull-
       * down, the text string is set to 1, 2, or 3, and
       * WinInvalidateRegion sends a WM_PAINT message.
       * When Exit is chosen, the application posts itself a WM_CLOSE
       * message.
       */
      {
      USHORT command;                   /* WM_COMMAND command value     */
      command = SHORT1FROMMP(mp1);      /* Extract the command value    */
      switch (command)
      {
        case ID_EXITPROG:
          WinPostMsg( hwnd, WM_CLOSE, (MPARAM)0, (MPARAM)0 );
          break;
        default:
          return WinDefWindowProc( hwnd, msg, mp1, mp2 );
      }

      break;
      }
    case WM_ERASEBACKGROUND:
      /*
       * Return TRUE to request PM to paint the window background
       * in SYSCLR_WINDOW.
       */
      return (MRESULT)( TRUE );
    case WM_PAINT:
      /*
       * Window contents are drawn here in WM_PAINT processing.
       */
      {
      HPS    hps;                       /* Presentation Space handle    */
      RECTL  rc;                        /* Rectangle coordinates        */
      POINTL pt;                        /* String screen coordinates    */
      POINTL pPos;
      LONG lColor,r,g,b;
      FATTRS fat;
      HPS shps = WinGetScreenPS(HWND_DESKTOP);
fat.usRecordLength = sizeof(FATTRS); /* sets size of structure   */
fat.fsSelection = 0;         /* uses default selection           */
fat.lMatch = 0L;             /* does not force match             */
fat.idRegistry = 0;          /* uses default registry            */
fat.usCodePage = 0;        /* code-page 850                    */
fat.lMaxBaselineExt = 14L;   /* requested font height is 12 pels */
fat.lAveCharWidth = 14L;     /* requested font width is 12 pels  */
fat.fsType = 0;              /* uses default type                */
fat.fsFontUse = FATTR_FONTUSE_NOMIX;/* doesn't mix with graphics */
strcpy(fat.szFacename ,"Courier");
      WinQueryPointerPos(HWND_DESKTOP, &pPos);
      hps = WinBeginPaint( hwnd, 0L, &rc );
      GpiCreateLogColorTable(shps, 0, LCOLF_RGB, 0, 0, NULL);
      GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL);
      pt.x = 10; pt.y = 27;             /* Set the text coordinates,    */
      lColor=GpiQueryPel(shps, &pPos);
      GpiSetBackColor( hps, 16777215);  /* its background and    */
      WinFillRect( hps, &rc, lColor);
      GpiSetBackMix( hps, BM_OVERPAINT );      /* how it mixes,         */
      b = lColor & 0x000000FF;
      lColor = lColor >> 8;
      g = lColor & 0x000000FF;
      lColor = lColor >> 8;
      r = lColor & 0x000000FF;
      WinReleasePS(shps);
      sprintf(szString,"Color: #%.2X%.2X%.2X",r,g,b);
      GpiCreateLogFont(hps, NULL, 1L, &fat);
      GpiSetCharSet(hps, 1L);
      GpiSetCharMode(hps, CM_MODE1);
      GpiCharStringAt( hps,&pt ,(LONG)strlen( szString ), szString );
      WinEndPaint( hps );                      /* Drawing is complete   */
      break;
      }
    case WM_CLOSE:
      WinPostMsg( hwnd, WM_QUIT, (MPARAM)0,(MPARAM)0 );/* Cause termination*/
      break;
    default:
      /*
       * Everything else comes here.  This call MUST exist
       * in your window procedure.
       */

      return WinDefWindowProc( hwnd, msg, mp1, mp2 );
  }
  return (MRESULT)FALSE;
} /* End of MyWindowProc */
Ejemplo n.º 9
0
void    _SelectFont( HPS ps ) {
//============================

    GpiCreateLogFont( ps, NULL, FIXED_FONT, &FontAttrs );
    GpiSetCharSet( ps, FIXED_FONT );
}
Ejemplo n.º 10
0
/*@ XFont :: XFont(XGraphicDevice * dev, const char *fontName, const SHORT size, const LONG options)
@group constructors/destructors
@remarks Construct a font
@parameters   <t 'ø' c=2>
            øXGraphicDevice * device      øowner
            øchar * fontName            øname of the font
            øSHORT size                  øsize
            øLONG options               øoptions
            </t>
*/
XFont :: XFont(XGraphicDevice * dev, const char *fontName, const SHORT size, const LONG options)
{
   // dev->fontId+=1;
   fontId = dev->fonts + 1;
   fontSize = size;
   LONG cFont;               /* Fonts Count   */
   LONG lFontsTotal = 0L;      /* Fonts Total Count   */
   LONG lXDeviceRes;         /* x Device Resolution  */
   LONG lYDeviceRes;         /* y Device Resolution  */
   PFONTMETRICS pfmSelect;      /* Font Metrics Pointer  */
   FATTRS fat;               /* Font Attributes   */
   register INT i;            /* Loop Counter   */

   LONG lNominalPointSize = size * 10;

   DevQueryCaps(dev->hdc, CAPS_HORIZONTAL_FONT_RES, 1L, &lXDeviceRes);
   DevQueryCaps(dev->hdc, CAPS_VERTICAL_FONT_RES, 1L, &lYDeviceRes);
   realSize = size;
   if ((cFont = GpiQueryFonts(dev->hps, QF_PUBLIC, (PSZ) fontName, &lFontsTotal, sizeof(FONTMETRICS), (PFONTMETRICS) NULL)) != 0L)
   {
      DosAllocMem((PPVOID) (PVOID) & pfmSelect, (ULONG) (sizeof(FONTMETRICS) * cFont), PAG_READ | PAG_WRITE | PAG_COMMIT);

      GpiQueryFonts(dev->hps, QF_PUBLIC, (PSZ) fontName, &cFont, sizeof(FONTMETRICS), pfmSelect);

      for (i = 0; i < (INT) cFont; i++)
         if ((pfmSelect[i].sXDeviceRes == (SHORT) lXDeviceRes) && (pfmSelect[i].sYDeviceRes == (SHORT) lYDeviceRes) && ((LONG) pfmSelect[i].sNominalPointSize == lNominalPointSize))
         {
            memset(&fat, 0, sizeof(FATTRS));
            fat.usRecordLength = sizeof(FATTRS);
            strcpy(fat.szFacename, fontName);
            fat.lMatch = pfmSelect[i].lMatch;
            fat.fsSelection = (USHORT) options;
            DosFreeMem((PVOID) pfmSelect);
            fixed = TRUE;
            GpiCreateLogFont(dev->hps, (PSTR8) NULL, fontId, &fat);
            dev->RegisterFont(this);
            dev->SetFont(this);
            return;
         }

      for (i = 0; i < (INT) cFont; i++)
         if ((pfmSelect[i].sXDeviceRes == 1000) && (pfmSelect[i].sYDeviceRes == 1000))
         {
            memset(&fat, 0, sizeof(FATTRS));
            fat.usRecordLength = sizeof(FATTRS);
            strcpy(fat.szFacename, fontName);
            fat.lMatch = pfmSelect[i].lMatch;
            fat.usCodePage = 850;
            fat.fsFontUse = FATTR_FONTUSE_OUTLINE | FATTR_FONTUSE_TRANSFORMABLE;
            fat.fsSelection = (USHORT) options;

            DosFreeMem((PVOID) pfmSelect);
            GpiCreateLogFont(dev->hps, (PSTR8) NULL, fontId, &fat);
            fontSize = lNominalPointSize;
            fixed = FALSE;
            dev->RegisterFont(this);
            dev->SetFont(this);
            return;
         }
      DosFreeMem((PVOID) pfmSelect);
   }
}
Ejemplo n.º 11
0
void ColumnPaint(SCREEN *pstScreen)
  {
  HPS hps;
  RECTL rclRect;
  WORD wChar;
  BOOL bLastWasNewLine = FALSE;
  WORD wDirection;
  LONG lReadIndex;
  WORD wFilterMask;
  BOOL bTestNewLine;
  WORD wNewLine;
  BOOL bWrap;
  BOOL bSkip;
  WORD wFunc;
  LONG lPacketCount;
  LONG lOldTop;

  DosRequestMutexSem(hmtxColGioBlockedSem,10000);
  WinInvalidateRect(pstScreen->hwndClient,(PRECTL)NULL,FALSE);
  hps = WinBeginPaint(pstScreen->hwndClient,(HPS)NULL,&rclRect);
  if (WinIsWindowShowing(pstScreen->hwndClient))
    {
    rclRect.yBottom = 0;
    rclRect.yTop = (pstScreen->lHeight + stCell.cy);
    rclRect.xLeft = 0;
    rclRect.xRight = (pstScreen->lWidth + stCell.cx);
    WinFillRect(hps,&rclRect,pstScreen->lBackgrndColor);
    if (pstScreen->wDirection == CS_WRITE)
      {
      if ((stRead.lBackgrndColor == stWrite.lBackgrndColor) && (stWrite.hwndScroll == (HWND)NULL))
        {
        rclRect.xRight = stWrite.rcl.xRight;
        rclRect.xLeft = stWrite.rcl.xRight - 1;
        rclRect.yBottom = 0;
        rclRect.yTop = stWrite.rcl.yTop;
        if (stWrite.lBackgrndColor == CLR_WHITE)
          WinFillRect(hps,&rclRect,CLR_BLACK);
        else
          WinFillRect(hps,&rclRect,(stWrite.lBackgrndColor ^ stWrite.lBackgrndColor));
        stWrite.rclDisp.xRight = (stWrite.lWidth + stCell.cx - 1);
        }
      else
        stWrite.rclDisp.xRight = (stWrite.lWidth + stCell.cx);
      }
    if (stCFG.fDisplaying & (DISP_DATA | DISP_FILE))
      {
      pstScreen->Pos.y = pstScreen->lHeight;
      pstScreen->Pos.x = 0;
      lReadIndex = pstScreen->lScrollIndex;
      pstScreen->rclDisp.xLeft = 0L;
      if (pstScreen->wDirection == CS_READ)
        GpiCreateLogFont(hps,(PSTR8)"HEXFONTS",2,&astFontAttributes[stCFG.wColReadFont]);
      else
        GpiCreateLogFont(hps,(PSTR8)"HEXFONTS",2,&astFontAttributes[stCFG.wColWriteFont]);
      GpiSetCharSet(hps,2);
      GpiSetColor(hps,pstScreen->lForegrndColor);
      if (pstScreen->bFilter)
        wFilterMask = (WORD)pstScreen->byDisplayMask;
      else
        wFilterMask = 0x00ff;
      wNewLine = (WORD)pstScreen->byNewLineChar;
      wDirection = pstScreen->wDirection;
      bTestNewLine = pstScreen->bTestNewLine;
      bSkip = pstScreen->bSkipBlankLines;
      bWrap = pstScreen->bWrap;
      lPacketCount = 0;
      while (lReadIndex < lScrollCount)
        {
        if (lPacketCount == 0)
          {
          wChar = pwScrollBuffer[lReadIndex];
          wFunc = (pwScrollBuffer[lReadIndex++] & 0x0ff00);
          switch (wFunc)
            {
            case CS_PACKET_DATA:
              lPacketCount = (wChar & 0x00ff);
              break;
            case CS_WRITE_IMM:
              if (wFunc != CS_READ)
                wFunc = CS_WRITE;
            case CS_READ_IMM:
              if (wFunc != CS_WRITE)
                wFunc = CS_READ;
            case CS_WRITE:
            case CS_READ:
              if (wFunc != wDirection)
                continue;
              wChar &= wFilterMask;
              if (bTestNewLine && (wChar == wNewLine))
                {
                if (bSkip && bLastWasNewLine)
                  continue;
                if (CharPrintable((BYTE *)&wChar,pstScreen))
                  if (bWrap || (pstScreen->Pos.x <= pstScreen->lWidth))
                    GpiCharStringAt(hps,&pstScreen->Pos,1,(BYTE *)&wChar);
                if (pstScreen->Pos.y <= 0)
                  break;
                pstScreen->Pos.y -= stCell.cy;
                bLastWasNewLine = TRUE;
                pstScreen->Pos.x = 0L;
                }
              else
                {
                if (CharPrintable((BYTE *)&wChar,pstScreen))
                  {
                  bLastWasNewLine = FALSE;
                  if (pstScreen->Pos.x <= pstScreen->lWidth)
                    {
                    GpiCharStringAt(hps,&pstScreen->Pos,1,(BYTE *)&wChar);
                    pstScreen->Pos.x += stCell.cx;
                    }
                  else
                    {
                    if (pstScreen->bWrap)
                      {
                      pstScreen->Pos.x  = 0;
                      pstScreen->Pos.y -= stCell.cy;
                      GpiCharStringAt(hps,&pstScreen->Pos,1,(BYTE *)&wChar);
                      pstScreen->Pos.x += stCell.cx;
                      }
                    if (pstScreen->Pos.y < 0 )
                      break;
                    }
                  }
                }
            }
          }
        else
          {
          lPacketCount--;
          lReadIndex++;
          }
        }
      }
    else
      {
//      pstScreen->lLeadRow = pstScreen->lHeight;
      pstScreen->Pos.y = pstScreen->lHeight;
      pstScreen->Pos.x = 0L;
      }
    }
  WinEndPaint(hps);
  DosReleaseMutexSem(hmtxColGioBlockedSem);
//  WinInvalidateRect(hwndStatus,(PRECTL)NULL,FALSE);
  }