First draft of a simple application to read a bitmap from a file in QSPI memory, and display it on the LPC4088 using the easyGUI library.

Dependencies:   DMBasicGUI DMSupport

Files at this revision

API Documentation at this revision

Comitter:
jmitc91516
Date:
Fri Jul 28 14:40:43 2017 +0000
Commit message:
Loads a bitmap file from a file in QSPI memory, and displays it.

Changed in this revision

DMBasicGUI.lib Show annotated file Show diff for this revision Revisions of this file
DMSupport.lib Show annotated file Show diff for this revision Revisions of this file
QSPIBitmap.cpp Show annotated file Show diff for this revision Revisions of this file
QSPIBitmap.h Show annotated file Show diff for this revision Revisions of this file
dm_board_config.h Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiComponents.h Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiDisplay.c Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiDisplay.h Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiGraph.h Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiGraph16.h Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiItems.h Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiLib.c Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiLib.h Show annotated file Show diff for this revision Revisions of this file
easyGUIFixed/GuiLibStruct.h Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/GuiConst.h Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/GuiFont.c Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/GuiFont.h Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/GuiStruct.c Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/GuiStruct.h Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/GuiVar.c Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/GuiVar.h Show annotated file Show diff for this revision Revisions of this file
easyGUIUpdated/VarInit.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DMBasicGUI.lib	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Embedded-Artists/code/DMBasicGUI/#1a7c743600e6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DMSupport.lib	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Embedded-Artists/code/DMSupport/#e1cb4dd9bfeb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QSPIBitmap.cpp	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,134 @@
+#include "QSPIBitmap.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include <fstream>
+
+
+
+
+// The default constructor exists purely to satisfy the compiler - it is not intended to be used
+QSPIBitmap::QSPIBitmap()
+{
+    name[0] = '\0';
+    
+    size = 0;
+    debugVar1 = 0;
+        
+    //data = NULL;
+    
+    bitmapLoaded = false;
+}
+
+QSPIBitmap::QSPIBitmap(char* bitmapName)
+{
+    strcpy(name, bitmapName);
+    
+    // Set these when we read the bitmap from the QSPI drive
+    size = 0;
+    debugVar1 = 0;
+    data = NULL;
+    
+    bitmapLoaded = GetBitmapFromQSPIDrive();
+}
+
+QSPIBitmap::~QSPIBitmap()
+{   
+    if(data) {
+        delete [] data;
+    }
+}
+
+bool QSPIBitmap::ReadBitmapSizeFile(void)
+{
+    char bitmapSizeFilename[200];
+    sprintf(bitmapSizeFilename, "/qspi/%s_BMP.size", name);
+    
+    char buff[50];
+    
+    FILE *fpsize = fopen(bitmapSizeFilename, "r");
+    if (fpsize != NULL) {
+        // We expect the size value to be 6 digits
+        fread(buff, 6, 1, fpsize);
+        fclose(fpsize);
+
+        buff[6] = '\0';
+        
+        sscanf(buff, "%d", &size);
+        
+        return true;
+    }
+    
+    // 'else'...
+    
+    return false;
+}
+
+bool QSPIBitmap::ReadBitmapDataFile(void)
+{
+    char bitmapDataFilename[200];
+    sprintf(bitmapDataFilename, "/qspi/%s_BMP.data", name);
+
+    FILE *fpdata = fopen(bitmapDataFilename, "rb");
+    if (fpdata != NULL) {
+        fread(data, size, 1, fpdata);
+        fclose(fpdata);
+        
+        return true;
+    }
+        
+    // 'else'...
+    
+    return false;
+}
+
+bool QSPIBitmap::GetBitmapFromQSPIDrive(void)
+{
+    //TODO: Raise exceptions(?) if any of the below fails
+    
+    debugVar1 = 1;
+    
+    if(ReadBitmapSizeFile()) {
+        debugVar1 = 3;
+    } else {
+        debugVar1 = 2;
+        return false;
+    }
+    
+    debugVar1 = 4;
+    
+    // Do not throw an exception if the allocation fails - just leave 'data' set to NULL
+    data = new (nothrow) GuiConst_INT8U[size + 10]; // Leave a small margin 'just in case'
+// TEST - what if the 'new' fails??
+// Answer - looks same as what Andrew saw at PittCon 2017
+    
+    if(data == NULL) {
+        return false;
+    }
+    
+    if(ReadBitmapDataFile()) {
+        debugVar1 = 5;
+    } else {
+        debugVar1 = 6;
+        return false;
+    }
+
+    debugVar1 = 7;
+    
+    return true;
+}
+
+void QSPIBitmap::DisplayAt(GuiConst_INT16S X, GuiConst_INT16S Y, GuiConst_INT32S transparentColour)
+{
+    if(bitmapLoaded) {    
+        GuiLib_ShowBitmapAt(data, X, Y, transparentColour);
+    } else {
+        char buff[100];
+        sprintf(buff, "Bitmap not loaded - size %d, debugVar1: %d", size, debugVar1);
+        
+        char bitmapSizeFilename[200];
+        sprintf(bitmapSizeFilename, "/qspi/%s_BMP.size", name);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QSPIBitmap.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,41 @@
+#ifndef QSPIBITMAP_H
+#define QSPIBITMAP_H
+
+#include "mbed.h"
+#include "DMBoard.h"
+
+#include "GuiLib.h"
+#include "GuiDisplay.h"
+
+#include "QSPIFileSystem.h"
+
+class QSPIBitmap
+{
+public:
+    QSPIBitmap();
+    
+    QSPIBitmap(char* bitmapName);
+        
+    ~QSPIBitmap();
+    
+    void DisplayAt(GuiConst_INT16S X, GuiConst_INT16S Y, GuiConst_INT32S transparentColour); 
+    
+    bool BitmapLoaded(void) { return bitmapLoaded; }
+    
+private:
+    char name[200];
+    
+    int size;
+    int debugVar1;
+    
+    GuiConst_INT8U* data;
+//    GuiConst_INT8U data[10000];
+    
+    bool ReadBitmapSizeFile(void);
+    bool ReadBitmapDataFile(void);
+    bool GetBitmapFromQSPIDrive(void);
+    bool bitmapLoaded;
+};
+
+
+#endif //QSPIBITMAP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dm_board_config.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,37 @@
+/*
+ *  Copyright 2014 Embedded Artists AB
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef DM_BOARD_CONFIG_H
+#define DM_BOARD_CONFIG_H
+
+// Template to use for the project-specific settings. Copy this file to your project,
+// rename it to dm_board_config.h and uncomment the wanted features below:
+
+// #define DM_BOARD_USE_USB_DEVICE
+// #define DM_BOARD_USE_USB_HOST
+// #define DM_BOARD_USE_MCI_FS
+#define DM_BOARD_USE_QSPI_FS
+#define DM_BOARD_USE_QSPI
+#define DM_BOARD_USE_DISPLAY
+#define DM_BOARD_USE_TOUCH
+// #define DM_BOARD_USE_ETHERNET
+#define DM_BOARD_USE_FAST_UART
+// #define DM_BOARD_USE_USBSERIAL_IN_RTOSLOG
+// #define DM_BOARD_DISABLE_STANDARD_PRINTF
+// #define DM_BOARD_ENABLE_MEASSURING_PINS
+#define DM_BOARD_USE_REGISTRY
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiComponents.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,4250 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2015 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                               v6.0.9.005                                 */
+/*                                                                          */
+/*     GuiLib.c include file - do NOT reference it in your linker setup     */
+/*                                                                          */
+/* ************************************************************************ */
+
+//------------------------------------------------------------------------------
+void GuiLib_ClearPositionCallbacks(void)
+{
+  GuiConst_INT16U I;
+
+  for (I = 0; I < GuiConst_POSCALLBACK_CNT; I++)
+    sgl.PosCallbacks[I].InUse = 0;
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_SetPositionCallbackFunc(
+   GuiConst_INT16U IndexNo,
+   void (*PosCallbackFunc) (GuiConst_INT16U IndexNo,
+                            GuiConst_INT16S X,
+                            GuiConst_INT16S Y))
+{
+  GuiConst_INT32S I, J;
+
+  J = -1;
+  for (I = 0; I < GuiConst_POSCALLBACK_CNT; I++)
+    if (sgl.PosCallbacks[I].IndexNo == IndexNo)
+    {
+      J = I;
+      break;
+    }
+  if (J == -1)
+    for (I = 0; I < GuiConst_POSCALLBACK_CNT; I++)
+      if (!sgl.PosCallbacks[I].InUse)
+      {
+        J = I;
+        break;
+      }
+
+  if (J >= 0)
+  {
+    sgl.PosCallbacks[J].InUse = 1;
+    sgl.PosCallbacks[J].PosCallbackFunc = PosCallbackFunc;
+    sgl.PosCallbacks[J].IndexNo = IndexNo;
+  }
+}
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+static void DrawCursorItem(
+   GuiConst_INT8U CursorVisible)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  GuiConst_INT16S RemCursorFieldNo, I;
+  PrefixLocate ItemMemory     RemMemory;
+  PrefixLocate ItemMemory  *PrefixLocate CursorMemory;
+  PrefixLocate GuiLib_ItemRec *CursorItem;
+
+  if (sgl.CursorInUse && (GuiLib_ActiveCursorFieldNo >= 0))
+  {
+    I = -1;
+    memcpy(&RemMemory, &sgl.Memory, sizeof(ItemMemory));
+    while ((I = AutoRedraw_GetCursor(GuiLib_ActiveCursorFieldNo, I)) != -1)
+    {
+      CursorItem = AutoRedraw_GetItem(I);
+      CursorMemory = AutoRedraw_GetItemMemory(I);
+
+      if ((CursorItem == NULL) || (CursorMemory == NULL))
+        return;
+
+      memcpy(&sgl.CurItem, CursorItem, sizeof(GuiLib_ItemRec));
+      memcpy(&sgl.Memory, CursorMemory, sizeof(ItemMemory));
+
+
+  #ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+      if ((sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_FIELDSCROLLBOX) &&
+          (sgl.ScrollBoxesAry[sgl.CurItem.CursorScrollBoxIndex].ScrollLineDataFunc != 0))
+        sgl.ScrollBoxesAry[sgl.CurItem.CursorScrollBoxIndex].ScrollLineDataFunc(
+           sgl.ScrollBoxesAry[sgl.CurItem.CursorScrollBoxIndex].MarkerStartLine[0]);
+  #endif // GuiConst_ITEM_SCROLLBOX_INUSE
+
+      if (!CursorVisible)
+      {
+        RemCursorFieldNo = GuiLib_ActiveCursorFieldNo;
+        GuiLib_ActiveCursorFieldNo = -1;
+      }
+      else
+        RemCursorFieldNo = 0;
+
+      sgl.SwapColors = 0;
+  #ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+      if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_FIELDSCROLLBOX)
+        ScrollBox_DrawScrollLine(sgl.CurItem.CursorScrollBoxIndex,
+           sgl.ScrollBoxesAry[sgl.CurItem.CursorScrollBoxIndex].MarkerStartLine[0]);
+      else
+  #endif // GuiConst_ITEM_SCROLLBOX_INUSE
+      {
+  #ifdef GuiConst_BITMAP_SUPPORT_ON
+        UpdateBackgroundBitmap();
+  #endif
+
+        DrawItem(GuiLib_COL_INVERT_IF_CURSOR);
+      }
+
+      if (!CursorVisible)
+        GuiLib_ActiveCursorFieldNo = RemCursorFieldNo;
+    }
+    memcpy(&sgl.Memory, &RemMemory, sizeof(ItemMemory));
+  }
+  #else // GuiConst_CURSOR_FIELDS_OFF
+  CursorVisible = 0;
+  #endif // GuiConst_CURSOR_FIELDS_OFF
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Cursor_Hide(void)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  GuiDisplay_Lock();
+  DrawCursorItem(0);
+  GuiDisplay_Unlock();
+  GuiLib_ActiveCursorFieldNo = -1;
+#endif // GuiConst_CURSOR_FIELDS_OFF
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_IsCursorFieldInUse(
+   GuiConst_INT16S AskCursorFieldNo)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  if (AskCursorFieldNo >= 0)
+  {
+    if (AutoRedraw_GetCursor(AskCursorFieldNo, -1) != -1)
+      return 1;
+  }
+
+  return 0;
+#else // GuiConst_CURSOR_FIELDS_OFF
+  return 0;
+#endif // GuiConst_CURSOR_FIELDS_OFF
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Cursor_Select(
+   GuiConst_INT16S NewCursorFieldNo)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  if (NewCursorFieldNo == -1)
+  {
+    GuiLib_Cursor_Hide();
+    return 0;
+  }
+  else if (NewCursorFieldNo >= 0)
+  {
+    if (AutoRedraw_GetCursor(NewCursorFieldNo, -1) != -1)
+    {
+      GuiDisplay_Lock();
+
+      DrawCursorItem(0);
+      GuiLib_ActiveCursorFieldNo = NewCursorFieldNo;
+      DrawCursorItem(1);
+
+      GuiDisplay_Unlock();
+
+      return 1;
+    }
+  }
+
+  return 0;
+#else
+  NewCursorFieldNo = 0;
+  return 0;
+#endif
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Cursor_Down(void)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  GuiConst_INT16S NewCursorFieldNo, Index;
+
+  Index = AutoRedraw_GetNextCursor(GuiLib_ActiveCursorFieldNo);
+
+  NewCursorFieldNo = AutoRedraw_GetCursorNumber(Index);
+
+#ifdef GuiConst_CURSOR_MODE_WRAP_AROUND
+  if ((NewCursorFieldNo == GuiLib_ActiveCursorFieldNo)
+   || (Index == -1))
+    return GuiLib_Cursor_Home();
+#else
+  if (Index == -1)
+    return 0;
+#endif
+
+  GuiLib_Cursor_Select(NewCursorFieldNo);
+
+  return 1;
+#else
+  return 0;
+#endif
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Cursor_Up(void)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  GuiConst_INT16S NewCursorFieldNo, Index;
+
+  Index = AutoRedraw_GetPrevCursor(GuiLib_ActiveCursorFieldNo);
+
+  NewCursorFieldNo = AutoRedraw_GetCursorNumber(Index);
+
+#ifdef GuiConst_CURSOR_MODE_WRAP_AROUND
+  if ((NewCursorFieldNo == GuiLib_ActiveCursorFieldNo)
+   || (Index == -1))
+    return GuiLib_Cursor_End();
+#else
+  if (Index == -1)
+    return 0;
+#endif
+
+  GuiLib_Cursor_Select(NewCursorFieldNo);
+
+  return 1;
+#else
+  return 0;
+#endif
+
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Cursor_Home(void)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  GuiConst_INT16S NewCursorFieldNo, Index;
+
+  Index = AutoRedraw_GetFirstCursor();
+
+  NewCursorFieldNo = AutoRedraw_GetCursorNumber(Index);
+
+  if (NewCursorFieldNo == GuiLib_ActiveCursorFieldNo)
+    return 0;
+
+  GuiLib_Cursor_Select(NewCursorFieldNo);
+
+  return 1;
+#else
+  return 0;
+#endif
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Cursor_End(void)
+{
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+  GuiConst_INT16S NewCursorFieldNo, Index;
+
+  Index = AutoRedraw_GetLastCursor();
+
+  NewCursorFieldNo = AutoRedraw_GetCursorNumber(Index);
+
+  if (NewCursorFieldNo == GuiLib_ActiveCursorFieldNo)
+    return 0;
+
+  GuiLib_Cursor_Select(NewCursorFieldNo);
+
+  return 1;
+#else
+  return 0;
+#endif
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+#endif // GuiConst_CURSOR_SUPPORT_ON
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+static void BlinkBox(void)
+{
+  if ((sgl.BlinkBoxRate) && (sgl.DisplayWriting))
+    GuiLib_InvertBox(sgl.BlinkBoxX1, sgl.BlinkBoxY1, sgl.BlinkBoxX2, sgl.BlinkBoxY2);
+  sgl.BlinkBoxInverted = !sgl.BlinkBoxInverted;
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_BlinkBoxStart(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INT16S Rate)
+{
+  GuiLib_BlinkBoxStop();
+  sgl.BlinkBoxX1 = X1;
+  sgl.BlinkBoxY1 = Y1;
+  sgl.BlinkBoxX2 = X2;
+  sgl.BlinkBoxY2 = Y2;
+  if (Rate < 1)
+    sgl.BlinkBoxRate = 1;
+  else
+    sgl.BlinkBoxRate = Rate;
+  sgl.BlinkBoxState = sgl.BlinkBoxRate;
+  sgl.BlinkBoxInverted = 0;
+  BlinkBox();
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_BlinkBoxStop(void)
+{
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  GuiConst_INT16U I;
+#endif
+
+  if (sgl.BlinkBoxRate && sgl.BlinkBoxInverted)
+    BlinkBox();
+  sgl.BlinkBoxRate = 0;
+
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  for (I = 0; I < GuiConst_BLINK_FIELDS_MAX; I++)
+    if (sgl.BlinkTextItems[I].InUse && sgl.BlinkTextItems[I].Active)
+      GuiLib_BlinkBoxMarkedItemStop(I);
+#endif
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_BlinkBoxMarkedItem(
+   GuiConst_INT16U BlinkFieldNo,
+   GuiConst_INT16U CharNo,
+   GuiConst_INT16S Rate)
+{
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  GuiConst_INT16S TextXOfs[GuiConst_MAX_TEXT_LEN + 2];
+  TextParRec TempTextPar;
+  GuiConst_INT8U TempPs;
+  GuiConst_INT16U CharCnt;
+  GuiConst_INT16U TempTextLength;
+  GuiConst_INT8U TempFormatFieldWidth;
+  GuiConst_INT8U TempFormatDecimals;
+  GuiConst_INT8U TempFormatAlignment;
+  GuiConst_INT8U TempFormatFormat;
+  #ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT32U PrefixRom TempOfs;
+  GuiConst_INT8U CharHeader[GuiLib_CHR_LINECTRL_OFS];
+  #else // GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U PrefixRom * TempPtr;
+  #endif // GuiConst_REMOTE_FONT_DATA
+  #ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+  GuiConst_INT8U CharHeader1[GuiLib_CHR_LINECTRL_OFS];
+  GuiConst_INT8U CharHeader2[GuiLib_CHR_LINECTRL_OFS];
+  GuiConst_INT16S TextCharLineStart[GuiConst_MAX_PARAGRAPH_LINE_CNT];
+  GuiConst_INT16S TextCharLineEnd[GuiConst_MAX_PARAGRAPH_LINE_CNT];
+  GuiConst_INT16S M;
+  GuiConst_INT16S LineCnt;
+  GuiConst_INT16S LineCnt2;
+  GuiConst_INT16S LineLen;
+  GuiConst_INT16S XStart, XEnd;
+  GuiConst_INT16S P2;
+  #endif // GuiConst_ITEM_TEXTBLOCK_INUSE
+  GuiConst_INT16S N;
+#ifndef GuiConst_CHARMODE_ANSI
+  GuiConst_INT16S P1;
+#endif
+  GuiConst_TEXT PrefixGeneric *CharPtr;
+  GuiConst_INT32S VarValue;
+  GuiConst_INT16S TextPixelLen;
+
+  if ((BlinkFieldNo >= GuiConst_BLINK_FIELDS_MAX) ||
+      !sgl.BlinkTextItems[BlinkFieldNo].InUse)
+    return;
+
+  if (sgl.BlinkTextItems[BlinkFieldNo].Active &&
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate &&
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted)
+  {
+    if (sgl.DisplayWriting)
+    {
+      GuiLib_InvertBox(sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1,
+                       sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1,
+                       sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2,
+                       sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY2);
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted =
+         !sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted;
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxLast =
+         sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted;
+    }
+  }
+
+  sgl.BlinkTextItems[BlinkFieldNo].Active = 0;
+  sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate = 0;
+
+  if ((BlinkFieldNo < GuiConst_BLINK_FIELDS_MAX) &&
+       sgl.BlinkTextItems[BlinkFieldNo].InUse)
+  {
+    sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 = sgl.BlinkTextItems[BlinkFieldNo].X1;
+    sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2 = sgl.BlinkTextItems[BlinkFieldNo].X2;
+    sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1 = sgl.BlinkTextItems[BlinkFieldNo].Y1;
+    sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY2 = sgl.BlinkTextItems[BlinkFieldNo].Y2;
+
+    if (sgl.BlinkTextItems[BlinkFieldNo].InUse)
+    {
+      TempTextPar = sgl.CurItem.TextPar[0];
+      TempTextLength = sgl.CurItem.TextLength[0];
+      TempFormatFieldWidth = sgl.CurItem.FormatFieldWidth;
+      TempFormatDecimals = sgl.CurItem.FormatDecimals;
+      TempFormatAlignment = sgl.CurItem.FormatAlignment;
+      TempFormatFormat = sgl.CurItem.FormatFormat;
+
+      sgl.CurItem.FormatFieldWidth = sgl.BlinkTextItems[BlinkFieldNo].FormatFieldWidth;
+      sgl.CurItem.FormatDecimals = sgl.BlinkTextItems[BlinkFieldNo].FormatDecimals;
+      sgl.CurItem.FormatAlignment = sgl.BlinkTextItems[BlinkFieldNo].FormatAlignment;
+      sgl.CurItem.FormatFormat = sgl.BlinkTextItems[BlinkFieldNo].FormatFormat;
+      sgl.CurItem.TextPar[0] = sgl.BlinkTextItems[BlinkFieldNo].TextPar;
+      CharCnt = sgl.BlinkTextItems[BlinkFieldNo].CharCnt;
+      sgl.CurItem.TextLength[0] = CharCnt;
+
+      SetCurFont(sgl.BlinkTextItems[BlinkFieldNo].TextPar.FontIndex);
+
+      if ((sgl.BlinkTextItems[BlinkFieldNo].ItemType == GuiLib_ITEM_TEXT) ||
+          (sgl.BlinkTextItems[BlinkFieldNo].ItemType == GuiLib_ITEM_TEXTBLOCK))
+      {
+#ifdef GuiConst_CHARMODE_UNICODE
+        ExtractUnicodeString(
+           (GuiConst_INT8U PrefixRom *)sgl.BlinkTextItems[BlinkFieldNo].TextPtr,
+            sgl.CurItem.TextLength[0]);
+  #ifdef GuiConst_ARAB_CHARS_INUSE
+        if (sgl.BlinkTextItems[BlinkFieldNo].TextPar.BitFlags &
+            GuiLib_BITFLAG_REVERSEWRITING)
+        {
+          CharCnt = ArabicCorrection(
+             sgl.UnicodeTextBuf, CharCnt,
+             (sgl.BlinkTextItems[BlinkFieldNo].TextPar.BitFlags &
+              GuiLib_BITFLAG_REVERSEWRITING) > 0);
+        }
+  #endif // GuiConst_ARAB_CHARS_INUSE
+#endif // GuiConst_CHARMODE_UNICODE
+
+#ifdef GuiConst_CHARMODE_UNICODE
+        CharPtr = (GuiConst_TEXT PrefixGeneric *)sgl.UnicodeTextBuf;
+#else // GuiConst_CHARMODE_UNICODE
+        CharPtr = (GuiConst_TEXT PrefixRom *)sgl.BlinkTextItems[BlinkFieldNo].TextPtr;
+#endif // GuiConst_CHARMODE_UNICODE
+        PrepareText(CharPtr,CharCnt,0);
+      }
+      else
+      {
+#ifdef GuiConst_DISP_VAR_NOW
+        displayVarNow = 1;
+#endif
+        if (sgl.BlinkTextItems[BlinkFieldNo].VarType == GuiLib_VAR_STRING)
+        {
+          CharPtr = (GuiConst_TEXT PrefixGeneric *)sgl.BlinkTextItems[BlinkFieldNo].TextPtr;
+#ifdef GuiConst_CHARMODE_ANSI
+          CharCnt = strlen(CharPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+          CharCnt = GuiLib_UnicodeStrLen((GuiConst_TEXT*)CharPtr);
+#else // GuiConst_CODEVISION_COMPILER
+          CharCnt = GuiLib_UnicodeStrLen(CharPtr);
+#endif // GuiConst_CODEVISION_COMPILER
+#endif // GuiConst_CHARMODE_ANSI
+        }
+        else
+        {
+          VarValue = ReadVar(sgl.BlinkTextItems[BlinkFieldNo].TextPtr,
+                             sgl.BlinkTextItems[BlinkFieldNo].VarType);
+
+          CharCnt =
+             DataNumStr(VarValue, sgl.BlinkTextItems[BlinkFieldNo].VarType, 0);
+
+#ifdef GuiConst_CHARMODE_ANSI
+          CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumTextStr;
+#else // GuiConst_CHARMODE_ANSI
+          for (P1=0; P1<=CharCnt; P1++)
+            sgl.VarNumUnicodeTextStr[P1] = sgl.VarNumTextStr[P1];
+          CharPtr = (GuiConst_TEXT *) sgl.VarNumUnicodeTextStr;
+#endif // GuiConst_CHARMODE_ANSI
+        }
+#ifdef GuiConst_CHARMODE_ANSI
+         strcpy(sgl.AnsiTextBuf, CharPtr);
+#else // GuiConst_CHARMODE_ANSI
+         GuiLib_UnicodeStrCpy(sgl.UnicodeTextBuf, CharPtr);
+#endif // GuiConst_CHARMODE_ANSI
+#ifdef   GuiConst_ARAB_CHARS_INUSE
+         if (sgl.BlinkTextItems[BlinkFieldNo].TextPar.BitFlags &
+             GuiLib_BITFLAG_REVERSEWRITING)
+         {
+           CharCnt = ArabicCorrection(
+              sgl.UnicodeTextBuf, CharCnt,
+             (sgl.BlinkTextItems[BlinkFieldNo].TextPar.BitFlags &
+              GuiLib_BITFLAG_REVERSEWRITING) > 0);
+         }
+#endif // GuiConst_ARAB_CHARS_INUSE
+#ifdef GuiConst_CHARMODE_ANSI
+         CharPtr = sgl.AnsiTextBuf;
+#else // GuiConst_CHARMODE_ANSI
+         CharPtr = sgl.UnicodeTextBuf;
+#endif // GuiConst_CHARMODE_ANSI
+         PrepareText(CharPtr, CharCnt,0);
+
+#ifdef GuiConst_DISP_VAR_NOW
+         displayVarNow = 0;
+#endif
+      }
+
+      if (CharNo > CharCnt)
+      {
+        SetCurFont(sgl.CurItem.TextPar[0].FontIndex);
+        sgl.CurItem.TextPar[0] = TempTextPar;
+        sgl.CurItem.TextLength[0] = TempTextLength;
+        sgl.CurItem.FormatFieldWidth = TempFormatFieldWidth;
+        sgl.CurItem.FormatDecimals = TempFormatDecimals;
+        sgl.CurItem.FormatAlignment = TempFormatAlignment;
+        sgl.CurItem.FormatFormat = TempFormatFormat;
+        return;
+      }
+
+      if(CharNo > 0)
+      {
+#ifdef GuiConst_BLINK_LF_COUNTS
+        if (*(CharPtr + (CharNo - 1)) != GuiLib_LINEFEED)
+#endif
+        {
+          sgl.BlinkTextItems[BlinkFieldNo].Active = 0;
+          sgl.BlinkTextItems[BlinkFieldNo].CharNo = CharNo;
+        }
+      }
+
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+      if ((sgl.BlinkTextItems[BlinkFieldNo].ItemType == GuiLib_ITEM_TEXTBLOCK)||
+          (sgl.BlinkTextItems[BlinkFieldNo].ItemType == GuiLib_ITEM_VARBLOCK))
+      {
+        if(CharNo > 0)
+        {
+          TextPixelLength(sgl.BlinkTextItems[BlinkFieldNo].TextPar.Ps,
+                          CharCnt, TextXOfs);
+
+          TextCharLineStart[0] = 0;
+          TextCharLineEnd[0] = -1;
+
+          LineCnt = 1 - sgl.BlinkTextItems[BlinkFieldNo].BlindLinesAtTop;
+          if (LineCnt >= 1)
+            LineCnt = 1;
+          LineCnt2 = 1;
+          P2 = 0;
+
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+          GuiLib_RemoteDataReadBlock(
+             (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[
+              sgl.TextCharNdx[TextCharLineStart[LineCnt2 - 1]]],
+              GuiLib_CHR_LINECTRL_OFS,
+              CharHeader2);
+#endif // GuiConst_REMOTE_FONT_DATA
+
+          while (P2 < CharCnt)
+          {
+            while ((P2 < CharCnt - 1) &&
+                !((ReadBytePtr(CharPtr + P2) == GuiLib_LINEFEED) ||
+                ((ReadBytePtr(CharPtr + P2) != ' ') && (ReadBytePtr(CharPtr + P2 + 1) == ' ')) ||
+                ((ReadBytePtr(CharPtr + P2) == '-') && (ReadBytePtr(CharPtr + P2 + 1) != ' '))))
+              P2++;
+
+            if (CalcCharsWidth(TextCharLineStart[LineCnt2 - 1], P2,
+                               TextXOfs, &XStart, &XEnd) >
+               (sgl.BlinkTextItems[BlinkFieldNo].X2 -
+                sgl.BlinkTextItems[BlinkFieldNo].X1 + 1))
+            {
+              if (TextCharLineEnd[LineCnt2 - 1] == -1)
+              {
+                TextCharLineEnd[LineCnt2 - 1] = P2;
+                TextCharLineStart[LineCnt2] = P2 + 1;
+                TextCharLineEnd[LineCnt2] = -1;
+              }
+              else
+              {
+                TextCharLineStart[LineCnt2] = TextCharLineEnd[LineCnt2 - 1] + 1;
+                while ((TextCharLineStart[LineCnt2] < P2) &&
+                       (ReadBytePtr(CharPtr + TextCharLineStart[LineCnt2]) ==
+                        ' '))
+                  TextCharLineStart[LineCnt2]++;
+                TextCharLineEnd[LineCnt2] = P2;
+              }
+              if (LineCnt >= GuiConst_MAX_PARAGRAPH_LINE_CNT)
+              {
+                P2 = CharCnt;
+                break;
+              }
+              LineCnt++;
+              if (LineCnt > 1)
+                LineCnt2 = LineCnt;
+              else
+                TextCharLineStart[LineCnt2 - 1] = TextCharLineStart[LineCnt2];
+            }
+            else
+              TextCharLineEnd[LineCnt2 - 1] = P2;
+            if (ReadBytePtr(CharPtr + P2) == GuiLib_LINEFEED)
+            {
+              TextCharLineEnd[LineCnt2 - 1] = P2 - 1;
+              TextCharLineStart[LineCnt2] = P2 + 1;
+              TextCharLineEnd[LineCnt2] = -1;
+              if (LineCnt >= GuiConst_MAX_PARAGRAPH_LINE_CNT)
+              {
+                P2 = CharCnt;
+                break;
+              }
+              LineCnt++;
+              if (LineCnt > 1)
+                LineCnt2 = LineCnt;
+              else
+                TextCharLineStart[LineCnt2 - 1] = TextCharLineStart[LineCnt2];
+            }
+            P2++;
+          }
+
+            if (sgl.BlinkTextItems[BlinkFieldNo].TextPar.BitFlags &
+                GuiLib_BITFLAG_REVERSEWRITING)
+            {
+              for (M = 0; M < LineCnt2 ; M++)
+              {
+                for (P2 = TextCharLineStart[M]; P2 <= (TextCharLineStart[M] +
+                   ((TextCharLineEnd[M] - TextCharLineStart[M] + 1) / 2) - 1);
+                     P2++)
+                {
+#ifdef GuiConst_REMOTE_FONT_DATA
+                  TempOfs = sgl.TextCharNdx[P2];
+                  sgl.TextCharNdx[P2] =
+                     sgl.TextCharNdx[TextCharLineEnd[M] - (P2 - TextCharLineStart[M])];
+                  sgl.TextCharNdx[TextCharLineEnd[M] - (P2 - TextCharLineStart[M])] =
+                     TempOfs;
+#else // GuiConst_REMOTE_FONT_DATA
+                  TempPtr = sgl.TextCharPtrAry[P2];
+                  sgl.TextCharPtrAry[P2] =
+                     (GuiConst_INT8U PrefixRom *)sgl.TextCharPtrAry[
+                     TextCharLineEnd[M] - (P2 - TextCharLineStart[M])];
+                  sgl.TextCharPtrAry[TextCharLineEnd[M] - (P2 - TextCharLineStart[M])] =
+                     (GuiConst_INT8U PrefixRom *)TempPtr;
+#endif // GuiConst_REMOTE_FONT_DATA
+                }
+              }
+              TextPixelLength(sgl.BlinkTextItems[BlinkFieldNo].TextPar.Ps,
+                              CharCnt, TextXOfs);
+            }
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+            if (sgl.BlinkTextItems[BlinkFieldNo].BlindLinesAtTop < 0)
+              sgl.BlinkTextItems[BlinkFieldNo].BlindLinesAtTop = 0;
+            sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1 -=
+               sgl.BlinkTextItems[BlinkFieldNo].TextBoxScrollPos -
+              (sgl.BlinkTextItems[BlinkFieldNo].TextBoxLineDist *
+               sgl.BlinkTextItems[BlinkFieldNo].BlindLinesAtTop);
+#endif // GuiConst_TEXTBOX_FIELDS_ON
+
+            switch (sgl.BlinkTextItems[BlinkFieldNo].TextBoxVertAlignment)
+            {
+             case GuiLib_ALIGN_CENTER:
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1 +=
+                  (sgl.BlinkTextItems[BlinkFieldNo].Y2 -
+                   sgl.BlinkTextItems[BlinkFieldNo].Y1 + 1 -
+                  (sgl.BlinkTextItems[BlinkFieldNo].YSize +
+                  (LineCnt2 - 1) *
+                   sgl.BlinkTextItems[BlinkFieldNo].TextBoxLineDist)) / 2;
+               break;
+
+             case GuiLib_ALIGN_RIGHT:
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1 +=
+                  sgl.BlinkTextItems[BlinkFieldNo].Y2 -
+                  sgl.BlinkTextItems[BlinkFieldNo].Y1 + 1 -
+                 (sgl.BlinkTextItems[BlinkFieldNo].YSize +
+                 (LineCnt2 - 1) *
+                  sgl.BlinkTextItems[BlinkFieldNo].TextBoxLineDist);
+               break;
+            }
+
+            for (N = 0; N < LineCnt2; N++)
+            {
+              if (((CharNo - 1) <= TextCharLineEnd[N])
+               && ((CharNo - 1) >= TextCharLineStart[N]))
+              {
+                if (sgl.BlinkTextItems[BlinkFieldNo].TextPar.BitFlags &
+                    GuiLib_BITFLAG_REVERSEWRITING)
+                  CharNo = TextCharLineStart[N] + TextCharLineEnd[N] + 2 - CharNo;
+
+                sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 =
+                   sgl.BlinkTextItems[BlinkFieldNo].X1;
+
+                LineLen = CalcCharsWidth(TextCharLineStart[N],
+                                         TextCharLineEnd[N],
+                                         TextXOfs,
+                                         &XStart,
+                                         &XEnd);
+                switch (sgl.BlinkTextItems[BlinkFieldNo].TextBoxHorzAlignment)
+                {
+                  case GuiLib_ALIGN_CENTER:
+                   sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +=
+                      (sgl.BlinkTextItems[BlinkFieldNo].X2 -
+                       sgl.BlinkTextItems[BlinkFieldNo].X1 + LineLen - 1) / 2;
+                   break;
+
+                  case GuiLib_ALIGN_RIGHT:
+                   sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +=
+                      sgl.BlinkTextItems[BlinkFieldNo].X2 -
+                      sgl.BlinkTextItems[BlinkFieldNo].X1 + LineLen - 1;
+                   break;
+                }
+
+                sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 -= XStart;
+                LineLen = CalcCharsWidth(CharNo - 1,
+                                         CharNo - 1,
+                                         TextXOfs,
+                                         &XStart,
+                                         &XEnd);
+                sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2 =
+                   sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 + XEnd;
+                sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 += XStart;
+                sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY2 =
+                   sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1 +
+                   sgl.BlinkTextItems[BlinkFieldNo].YSize - 1;
+
+                sgl.BlinkTextItems[BlinkFieldNo].Active = 1;
+                break;
+              }
+
+#ifndef GuiConst_BLINK_LF_COUNTS
+              if ((N+1) < LineCnt2)
+                if ((TextCharLineEnd[N]+1) != TextCharLineStart[N+1])
+                  CharNo++;
+#endif
+
+              sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1 +=
+                 sgl.BlinkTextItems[BlinkFieldNo].TextBoxLineDist;
+            }
+        }
+        else
+        {
+          sgl.BlinkTextItems[BlinkFieldNo].Active = 1;
+          sgl.BlinkTextItems[BlinkFieldNo].CharNo = CharNo;
+        }
+      }
+      else
+#endif // GuiConst_ITEM_TEXTBLOCK_INUSE
+      {
+        if (sgl.BlinkTextItems[BlinkFieldNo].TextPar.BitFlags &
+            GuiLib_BITFLAG_REVERSEWRITING)
+        {
+          for (N = 0; N < CharCnt / 2; N++)
+          {
+#ifdef GuiConst_REMOTE_FONT_DATA
+            TempOfs = sgl.TextCharNdx[N];
+            sgl.TextCharNdx[N] =
+               sgl.TextCharNdx[CharCnt - 1 - N];
+            sgl.TextCharNdx[CharCnt - 1 - N] =
+               TempOfs;
+#else
+            TempPtr = sgl.TextCharPtrAry[N];
+            sgl.TextCharPtrAry[N] = (GuiConst_INT8U PrefixRom *)
+               sgl.TextCharPtrAry[CharCnt - 1 - N];
+            sgl.TextCharPtrAry[CharCnt - 1 - N] =
+              (GuiConst_INT8U PrefixRom *)TempPtr;
+#endif
+          }
+          CharNo =  CharCnt + 1 - CharNo;
+        }
+
+        TextPixelLen = TextPixelLength(sgl.BlinkTextItems[BlinkFieldNo].TextPar.Ps,
+                          CharCnt, TextXOfs);
+
+        switch (sgl.BlinkTextItems[BlinkFieldNo].TextPar.Alignment)
+        {
+          case GuiLib_ALIGN_CENTER:
+            if (CharCnt > 0)
+                sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 -= TextPixelLen / 2;
+              break;
+          case GuiLib_ALIGN_RIGHT:
+            sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 -= TextPixelLen - 1;
+              break;
+        }
+
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2 = sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +
+           TextPixelLen - 1;
+
+        if (CharNo)
+        {
+          if (sgl.BlinkTextItems[BlinkFieldNo].TextPar.Ps == GuiLib_PS_OFF)
+          {
+            sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 =
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 + TextXOfs[CharNo-1] - 1;
+            sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2 =
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +
+               sgl.BlinkTextItems[BlinkFieldNo].XSize;
+          }
+          else if ((sgl.BlinkTextItems[BlinkFieldNo].TextPar.Ps == GuiLib_PS_NUM) &&
+                   (sgl.TextPsMode[CharNo - 1] == 0))
+          {
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 =
+                  sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 + TextXOfs[CharNo - 1] - 1;
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2 =
+                  sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +
+                  sgl.BlinkTextItems[BlinkFieldNo].PsNumWidth +
+                  sgl.BlinkTextItems[BlinkFieldNo].PsSpace;
+          }
+          else
+          {
+#ifdef GuiConst_REMOTE_FONT_DATA
+            GuiLib_RemoteDataReadBlock((GuiConst_INT32U PrefixRom)
+               GuiFont_ChPtrList[sgl.TextCharNdx[CharNo - 1]],
+               GuiLib_CHR_LINECTRL_OFS, CharHeader);
+            sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 =
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +
+               TextXOfs[CharNo-1] + CharHeader[GuiLib_CHR_XLEFT_OFS] - 1;
+#else
+            sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 =
+               sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 + TextXOfs[CharNo - 1] +
+               ReadBytePtr(sgl.TextCharPtrAry[CharNo - 1] +
+               GuiLib_CHR_XLEFT_OFS) - 1;
+#endif
+#ifdef GuiConst_REMOTE_FONT_DATA
+          sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2 =
+             sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +
+             CharHeader[GuiLib_CHR_XWIDTH_OFS] + 1;
+#else
+          sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2 =
+             sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1 +
+             ReadBytePtr(sgl.TextCharPtrAry[CharNo - 1] +
+             GuiLib_CHR_XWIDTH_OFS) + 1;
+#endif
+          }
+          sgl.BlinkTextItems[BlinkFieldNo].Active = 1;
+        }
+        else
+        {
+          sgl.BlinkTextItems[BlinkFieldNo].Active = 1;
+          sgl.BlinkTextItems[BlinkFieldNo].CharNo = CharNo;
+        }
+      }
+      SetCurFont(sgl.CurItem.TextPar[0].FontIndex);
+      sgl.CurItem.TextPar[0] = TempTextPar;
+      sgl.CurItem.TextLength[0] = TempTextLength;
+      sgl.CurItem.FormatFieldWidth = TempFormatFieldWidth;
+      sgl.CurItem.FormatDecimals = TempFormatDecimals;
+      sgl.CurItem.FormatAlignment = TempFormatAlignment;
+      sgl.CurItem.FormatFormat = TempFormatFormat;
+
+    }
+
+    if (sgl.BlinkTextItems[BlinkFieldNo].Active)
+    {
+      if (Rate < 1)
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate = 1;
+      else
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate = Rate;
+      if (sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate < 255)
+      {
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxState =
+           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate -
+          (sgl.RefreshClock % sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate);
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted =
+           ((sgl.RefreshClock / sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate) % 2) ==
+             0;
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxLast =
+           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted;
+        if (sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted && sgl.DisplayWriting)
+          GuiLib_InvertBox(sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1,
+                           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1,
+                           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2,
+                           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY2);
+      }
+      else
+      {
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxState =
+             sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate;
+        if (sgl.DisplayWriting)
+          GuiLib_InvertBox(sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1,
+                           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1,
+                           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2,
+                           sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY2);
+
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted =
+                        !sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted;
+        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxLast =
+                        sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted;
+      }
+    }
+  }
+#else // GuiConst_BLINK_FIELDS_OFF
+  gl.Dummy1_16U = BlinkFieldNo;   // To avoid compiler warning
+  gl.Dummy2_16U = CharNo;   // To avoid compiler warning
+  gl.Dummy1_16S = Rate;   // To avoid compiler warning
+#endif // GuiConst_BLINK_FIELDS_OFF
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_BlinkBoxMarkedItemStop(
+   GuiConst_INT16U BlinkFieldNo)
+{
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  if ((BlinkFieldNo >= GuiConst_BLINK_FIELDS_MAX) ||
+      !sgl.BlinkTextItems[BlinkFieldNo].InUse)
+    return;
+
+  if (sgl.BlinkTextItems[BlinkFieldNo].Active &&
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate &&
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted)
+  {
+    if (sgl.DisplayWriting)
+    {
+      GuiLib_InvertBox(sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX1,
+                       sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY1,
+                       sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxX2,
+                       sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxY2);
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted =
+         !sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted;
+      sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxLast =
+         sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxInverted;
+    }
+  }
+  sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate = 0;
+  sgl.BlinkTextItems[BlinkFieldNo].Active = 0;
+#else // GuiConst_BLINK_FIELDS_OFF
+  gl.Dummy1_16U = BlinkFieldNo;   // To avoid compiler warning
+#endif // GuiConst_BLINK_FIELDS_OFF
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_BlinkBoxMarkedItemUpdate(
+   GuiConst_INT16U BlinkFieldNo)
+{
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  if ((BlinkFieldNo >= GuiConst_BLINK_FIELDS_MAX) ||
+      !sgl.BlinkTextItems[BlinkFieldNo].InUse)
+    return;
+
+  if (sgl.BlinkTextItems[BlinkFieldNo].Active &&
+     ((sgl.BlinkTextItems[BlinkFieldNo].ItemType == GuiLib_ITEM_VAR) ||
+      (sgl.BlinkTextItems[BlinkFieldNo].ItemType == GuiLib_ITEM_VARBLOCK)))
+    GuiLib_BlinkBoxMarkedItem(
+       BlinkFieldNo,
+       sgl.BlinkTextItems[BlinkFieldNo].CharNo,
+       sgl.BlinkTextItems[BlinkFieldNo].BlinkBoxRate);
+#else // GuiConst_BLINK_FIELDS_OFF
+  gl.Dummy1_16U = BlinkFieldNo;   // To avoid compiler warning
+#endif // GuiConst_BLINK_FIELDS_OFF
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+#endif // GuiConst_BLINK_SUPPORT_ON
+
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_TouchCheck(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y)
+{
+  GuiConst_INT32S TouchSearch;
+  GuiConst_INT32S XX, YY;
+  GuiConst_INT32S XL, XR, YT, YB;
+  GuiConst_INT32S TouchArea;
+
+  if (sgl.TouchAdjustActive)
+  {
+    XX = 10 * (GuiConst_INT32S)X;
+    YY = 10 * (GuiConst_INT32S)Y;
+    XL = sgl.TouchAdjustXTL +
+       (YY - sgl.TouchAdjustYTL) * (sgl.TouchAdjustXBL - sgl.TouchAdjustXTL) /
+       (sgl.TouchAdjustYBL - sgl.TouchAdjustYTL);
+    XR = sgl.TouchAdjustXTR +
+       (YY - sgl.TouchAdjustYTR) * (sgl.TouchAdjustXBR - sgl.TouchAdjustXTR) /
+       (sgl.TouchAdjustYBR - sgl.TouchAdjustYTR);
+    YT = sgl.TouchAdjustYTL +
+       (XX - sgl.TouchAdjustXTL) * (sgl.TouchAdjustYTR - sgl.TouchAdjustYTL) /
+       (sgl.TouchAdjustXTR - sgl.TouchAdjustXTL);
+    YB = sgl.TouchAdjustYBL +
+       (XX - sgl.TouchAdjustXBL) * (sgl.TouchAdjustYBR - sgl.TouchAdjustYBL) /
+       (sgl.TouchAdjustXBR - sgl.TouchAdjustXBL);
+    sgl.TouchConvertX = GuiConst_DISPLAY_WIDTH * (XX - XL) / (XR - XL);
+    sgl.TouchConvertY = GuiConst_DISPLAY_HEIGHT * (YY - YT) / (YB - YT);
+  }
+  else
+  {
+    sgl.TouchConvertX = X;
+    sgl.TouchConvertY = Y;
+  }
+
+  TouchArea = -1;
+  if ((sgl.TouchConvertX >= 0) && (sgl.TouchConvertX < GuiConst_DISPLAY_WIDTH) &&
+      (sgl.TouchConvertY >= 0) && (sgl.TouchConvertY < GuiConst_DISPLAY_HEIGHT))
+    for (TouchSearch = 0; TouchSearch < sgl.TouchAreaCnt; TouchSearch++)
+      if ((sgl.TouchConvertX >= sgl.TouchAreas[TouchSearch].X1) &&
+          (sgl.TouchConvertX <= sgl.TouchAreas[TouchSearch].X2) &&
+          (sgl.TouchConvertY >= sgl.TouchAreas[TouchSearch].Y1) &&
+          (sgl.TouchConvertY <= sgl.TouchAreas[TouchSearch].Y2))
+      {
+        if (TouchArea == -1)
+          TouchArea = sgl.TouchAreas[TouchSearch].IndexNo;
+        else if (sgl.TouchAreas[TouchSearch].IndexNo < TouchArea)
+          TouchArea = sgl.TouchAreas[TouchSearch].IndexNo;
+      }
+  return TouchArea;
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_TouchGet(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S* TouchX,
+   GuiConst_INT16S* TouchY)
+{
+  GuiConst_INT32S Result;
+
+  Result = GuiLib_TouchCheck(X, Y);
+
+  *TouchX = sgl.TouchConvertX;
+  *TouchY = sgl.TouchConvertY;
+
+  return (Result);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_TouchAdjustReset(void)
+{
+  sgl.TouchAdjustActive = 0;
+  sgl.TouchAdjustInUse[0] = 0;
+  sgl.TouchAdjustInUse[1] = 0;
+  sgl.TouchAdjustInUse[2] = 0;
+  sgl.TouchAdjustInUse[3] = 0;
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_TouchAdjustSet(
+   GuiConst_INT16S XTrue,
+   GuiConst_INT16S YTrue,
+   GuiConst_INT16S XMeasured,
+   GuiConst_INT16S YMeasured)
+{
+  GuiConst_INT8U I;
+  GuiConst_INT32S XTL, YTL, XTR, YTR, XBL, YBL, XBR, YBR, XL, XR, YT, YB;
+
+  if (YTrue < GuiConst_DISPLAY_HEIGHT / 2)
+  {
+    if (XTrue < GuiConst_DISPLAY_WIDTH / 2)
+      I = 0;
+    else
+      I = 1;
+  }
+  else
+  {
+    if (XTrue < GuiConst_DISPLAY_WIDTH / 2)
+      I = 2;
+    else
+      I = 3;
+  }
+
+  sgl.TouchAdjustInUse[I] = 1;
+
+  sgl.TouchAdjustXTrue[I] = XTrue;
+  sgl.TouchAdjustYTrue[I] = YTrue;
+  sgl.TouchAdjustXMeasured[I] = XMeasured;
+  sgl.TouchAdjustYMeasured[I] = YMeasured;
+
+  if (sgl.TouchAdjustInUse[0] && sgl.TouchAdjustInUse[3])
+  {
+    sgl.TouchAdjustActive = 1;
+    if (!sgl.TouchAdjustInUse[1])
+    {
+      sgl.TouchAdjustInUse[1] = 1;
+      sgl.TouchAdjustXTrue[1] = sgl.TouchAdjustXTrue[3];
+      sgl.TouchAdjustYTrue[1] = sgl.TouchAdjustYTrue[0];
+      sgl.TouchAdjustXMeasured[1] = sgl.TouchAdjustXMeasured[3];
+      sgl.TouchAdjustYMeasured[1] = sgl.TouchAdjustYMeasured[0];
+    }
+    if (!sgl.TouchAdjustInUse[2])
+    {
+      sgl.TouchAdjustInUse[2] = 1;
+      sgl.TouchAdjustXTrue[2] = sgl.TouchAdjustXTrue[0];
+      sgl.TouchAdjustYTrue[2] = sgl.TouchAdjustYTrue[3];
+      sgl.TouchAdjustXMeasured[2] = sgl.TouchAdjustXMeasured[0];
+      sgl.TouchAdjustYMeasured[2] = sgl.TouchAdjustYMeasured[3];
+    }
+  }
+  else if (sgl.TouchAdjustInUse[1] && sgl.TouchAdjustInUse[2])
+  {
+    sgl.TouchAdjustActive = 1;
+    if (!sgl.TouchAdjustInUse[0])
+    {
+      sgl.TouchAdjustInUse[0] = 1;
+      sgl.TouchAdjustXTrue[0] = sgl.TouchAdjustXTrue[2];
+      sgl.TouchAdjustYTrue[0] = sgl.TouchAdjustYTrue[1];
+      sgl.TouchAdjustXMeasured[0] = sgl.TouchAdjustXMeasured[2];
+      sgl.TouchAdjustYMeasured[0] = sgl.TouchAdjustYMeasured[1];
+    }
+    if (!sgl.TouchAdjustInUse[3])
+    {
+      sgl.TouchAdjustInUse[3] = 1;
+      sgl.TouchAdjustXTrue[3] = sgl.TouchAdjustXTrue[1];
+      sgl.TouchAdjustYTrue[3] = sgl.TouchAdjustYTrue[2];
+      sgl.TouchAdjustXMeasured[3] = sgl.TouchAdjustXMeasured[1];
+      sgl.TouchAdjustYMeasured[3] = sgl.TouchAdjustYMeasured[2];
+    }
+  }
+
+  if (sgl.TouchAdjustActive)
+  {
+    XTL = (10 * sgl.TouchAdjustXMeasured[1]) - ((10 * sgl.TouchAdjustXTrue[1] *
+       (sgl.TouchAdjustXMeasured[1] - sgl.TouchAdjustXMeasured[0])) /
+       (sgl.TouchAdjustXTrue[1] - sgl.TouchAdjustXTrue[0]));
+    XTR = (10 * sgl.TouchAdjustXMeasured[0]) +
+       ((10 * (GuiConst_DISPLAY_WIDTH - sgl.TouchAdjustXTrue[0]) *
+       (sgl.TouchAdjustXMeasured[1] - sgl.TouchAdjustXMeasured[0])) /
+       (sgl.TouchAdjustXTrue[1] - sgl.TouchAdjustXTrue[0]));
+    XBL = (10 * sgl.TouchAdjustXMeasured[3]) - ((10 * sgl.TouchAdjustXTrue[3] *
+       (sgl.TouchAdjustXMeasured[3] - sgl.TouchAdjustXMeasured[2])) /
+       (sgl.TouchAdjustXTrue[3] - sgl.TouchAdjustXTrue[2]));
+    XBR = (10 * sgl.TouchAdjustXMeasured[2]) +
+       ((10 * (GuiConst_DISPLAY_WIDTH - sgl.TouchAdjustXTrue[2]) *
+       (sgl.TouchAdjustXMeasured[3] - sgl.TouchAdjustXMeasured[2])) /
+       (sgl.TouchAdjustXTrue[3] - sgl.TouchAdjustXTrue[2]));
+
+    YT = 5 * (sgl.TouchAdjustYTrue[0] + sgl.TouchAdjustYTrue[1]);
+    YB = 5 * (sgl.TouchAdjustYTrue[2] + sgl.TouchAdjustYTrue[3]);
+
+    sgl.TouchAdjustXTL = XBL - (YB * (XBL - XTL) / (YB - YT));
+    sgl.TouchAdjustXBL =
+       XTL + (((10 * GuiConst_DISPLAY_HEIGHT) - YT) * (XBL - XTL) / (YB - YT));
+    sgl.TouchAdjustXTR = XBR - (YB * (XBR - XTR) / (YB - YT));
+    sgl.TouchAdjustXBR =
+       XTR + (((10 * GuiConst_DISPLAY_HEIGHT) - YT) * (XBR - XTR) / (YB - YT));
+
+    YTL = (10 * sgl.TouchAdjustYMeasured[2]) - ((10 * sgl.TouchAdjustYTrue[2] *
+       (sgl.TouchAdjustYMeasured[2] - sgl.TouchAdjustYMeasured[0])) /
+       (sgl.TouchAdjustYTrue[2] - sgl.TouchAdjustYTrue[0]));
+    YBL = (10 * sgl.TouchAdjustYMeasured[0]) +
+       ((10 * (GuiConst_DISPLAY_HEIGHT - sgl.TouchAdjustYTrue[0]) *
+       (sgl.TouchAdjustYMeasured[2] - sgl.TouchAdjustYMeasured[0])) /
+       (sgl.TouchAdjustYTrue[2] - sgl.TouchAdjustYTrue[0]));
+    YTR = (10 * sgl.TouchAdjustYMeasured[3]) - ((10 * sgl.TouchAdjustYTrue[3] *
+       (sgl.TouchAdjustYMeasured[3] - sgl.TouchAdjustYMeasured[1])) /
+       (sgl.TouchAdjustYTrue[3] - sgl.TouchAdjustYTrue[1]));
+    YBR = (10 * sgl.TouchAdjustYMeasured[1]) +
+       ((10 * (GuiConst_DISPLAY_HEIGHT - sgl.TouchAdjustYTrue[1]) *
+       (sgl.TouchAdjustYMeasured[3] - sgl.TouchAdjustYMeasured[1])) /
+       (sgl.TouchAdjustYTrue[3] - sgl.TouchAdjustYTrue[1]));
+
+    XL = 5 * (sgl.TouchAdjustXTrue[0] + sgl.TouchAdjustXTrue[2]);
+    XR = 5 * (sgl.TouchAdjustXTrue[1] + sgl.TouchAdjustXTrue[3]);
+
+    sgl.TouchAdjustYTL = YTR - (XR * (YTR - YTL) / (XR - XL));
+    sgl.TouchAdjustYTR =
+       YTL + (((10 * GuiConst_DISPLAY_WIDTH) - XL) * (YTR - YTL) / (XR - XL));
+    sgl.TouchAdjustYBL = YBR - (XR * (YBR - YBL) / (XR - XL));
+    sgl.TouchAdjustYBR =
+       YBL + (((10 * GuiConst_DISPLAY_WIDTH) - XL) * (YBR - YBL) / (XR - XL));
+  }
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+#endif // GuiConst_ITEM_TOUCHAREA_INUSE
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+static void ScrollBox_ShowLineStruct(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U StructToCallIndex,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT8U ColorInvert)
+{
+  GuiLib_StructPtr StructToCall;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiConst_INT16S RemClippingX1, RemClippingY1, RemClippingX2, RemClippingY2;
+#endif //GuiConst_CLIPPING_SUPPORT_ON
+
+  if (StructToCallIndex != 0xFFFF)
+  {
+    sgl.DisplayLevel++;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    RemClippingX1 = sgl.CurItem.ClipRectX1;
+    RemClippingY1 = sgl.CurItem.ClipRectY1;
+    RemClippingX2 = sgl.CurItem.ClipRectX2;
+    RemClippingY2 = sgl.CurItem.ClipRectY2;
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+    memcpy(&sgl.CurItem, &sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxItem,
+       sizeof(GuiLib_ItemRec));
+    sgl.CurItem.RX = X;
+    sgl.CurItem.RY = Y;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    sgl.CurItem.ClipRectX1 = RemClippingX1;
+    sgl.CurItem.ClipRectY1 = RemClippingY1;
+    sgl.CurItem.ClipRectX2 = RemClippingX2;
+    sgl.CurItem.ClipRectY2 = RemClippingY2;
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+    StructToCall = (GuiLib_StructPtr)
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+       GetRemoteStructData(StructToCallIndex);
+#else // GuiConst_REMOTE_STRUCT_DATA
+       (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[StructToCallIndex]);
+#endif // GuiConst_REMOTE_STRUCT_DATA
+
+    if (ColorInvert == GuiLib_COL_INVERT_ON)
+    {
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].ContainsCursorFields)
+        ColorInvert = GuiLib_COL_INVERT_IF_CURSOR;
+#endif // GuiConst_CURSOR_SUPPORT_ON
+    }
+    else
+    {
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+      UpdateBackgroundBitmap();
+#endif
+    }
+
+    DrawStructure(StructToCall, ColorInvert);
+    ResetLayerBufPtr();
+    sgl.DisplayLevel--;
+  }
+}
+
+//------------------------------------------------------------------------------
+static void ScrollBox_ShowLineBlock(
+   GuiConst_INTCOLOR Color,
+   GuiConst_INT8U Transparent,
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  if (!Transparent)
+    GuiLib_FillBox(X1, Y1, X2, Y2, Color);
+}
+
+//------------------------------------------------------------------------------
+static void ScrollBox_ShowBarBlock(
+   GuiConst_INTCOLOR ForeColor,
+   GuiConst_INTCOLOR BackColor,
+   GuiConst_INT8U Thickness,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S SizeX,
+   GuiConst_INT16S SizeY)
+{
+  GuiConst_INT8U T;
+  GuiConst_INT16S BX1, BY1, BX2, BY2;
+
+  if (Thickness > 0)
+    for (T = 0; T < Thickness; T++)
+    {
+      BX1 = X + T;
+      BY1 = Y + T;
+      BX2 = X + SizeX - 1 - T;
+      BY2 = Y + SizeY - 1 - T;
+      GuiLib_Box(BX1, BY1, BX2, BY2, ForeColor);
+    }
+  BX1 = X + Thickness;
+  BY1 = Y + Thickness;
+  BX2 = X + SizeX - 1 - Thickness;
+  BY2 = Y + SizeY - 1 - Thickness;
+  GuiLib_FillBox(BX1, BY1, BX2, BY2, BackColor);
+}
+
+//------------------------------------------------------------------------------
+static void ScrollBox_SetTopLine(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+    GuiConst_INT16U LowerLimtA=0;
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0)
+  {
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+       sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] -
+       sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+    GuiLib_LIMIT_MINMAX(sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine,
+       LowerLimtA, sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+       sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines);
+  }
+  else
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+       sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] -
+       sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+}
+
+//------------------------------------------------------------------------------
+static void ScrollBox_DrawScrollLine(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16S LineNdx)
+{
+  GuiConst_INT16U N;
+  GuiConst_INT16S SX1, SY1;
+  GuiConst_INT16S X1, Y1, X2, Y2;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiConst_INT16S RemClippingX1, RemClippingY1, RemClippingX2, RemClippingY2;
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+  if ((LineNdx < sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine) ||
+      (LineNdx >= sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine +
+                  sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines))
+    return;
+
+  X1 = sgl.ScrollBoxesAry[ScrollBoxIndex].X1 +
+       sgl.ScrollBoxesAry[ScrollBoxIndex].LineOffsetX;
+  Y1 = sgl.ScrollBoxesAry[ScrollBoxIndex].Y1 +
+       sgl.ScrollBoxesAry[ScrollBoxIndex].LineOffsetY +
+       (LineNdx - sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine) *
+       sgl.ScrollBoxesAry[ScrollBoxIndex].LineVerticalOffset;
+  X2 = X1 + sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeX - 1;
+  Y2 = Y1 + sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeY - 1;
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  RemClippingX1 = sgl.CurItem.ClipRectX1;
+  RemClippingY1 = sgl.CurItem.ClipRectY1;
+  RemClippingX2 = sgl.CurItem.ClipRectX2;
+  RemClippingY2 = sgl.CurItem.ClipRectY2;
+  GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX1, X1, X2);
+  GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY1, Y1, Y2);
+  GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX2, X1, X2);
+  GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY2, Y1, Y2);
+  GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                     sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+  if ((LineNdx >= 0) &&
+      (LineNdx < sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines))
+  {
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollLineDataFunc(LineNdx);
+
+    SX1 = X1 + sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructOffsetX;
+    SY1 = Y1 + sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructOffsetY;
+    for (N = 0; N <= GuiConst_SCROLLITEM_MARKERS_MAX; N++)
+    {
+      if (N < GuiConst_SCROLLITEM_MARKERS_MAX)
+      {
+        if ((sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[N] >= 0) &&
+            (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[N] >= 1))
+        {
+          if ((LineNdx >= sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[N]) &&
+              (LineNdx <= (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[N] +
+               sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[N] - 1)))
+          {
+            ScrollBox_ShowLineBlock(
+               sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[N],
+               sgl.ScrollBoxesAry[ScrollBoxIndex].
+               MarkerColorTransparent[N], X1, Y1, X2, Y2);
+            switch (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerDrawingOrder[N])
+            {
+              case 0:
+                ScrollBox_ShowLineStruct(ScrollBoxIndex,
+                   sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructIndex, SX1, SY1,
+                   GuiLib_COL_INVERT_ON);
+                if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[N] !=
+                    0xFFFF)
+                  ScrollBox_ShowLineStruct(ScrollBoxIndex,
+                     sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[N],
+                     SX1, SY1, GuiLib_COL_INVERT_ON);
+                break;
+
+              case 1:
+                if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[N] !=
+                    0xFFFF)
+                  ScrollBox_ShowLineStruct(ScrollBoxIndex,
+                     sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[N],
+                     SX1, SY1, GuiLib_COL_INVERT_ON);
+                ScrollBox_ShowLineStruct(ScrollBoxIndex,
+                   sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructIndex, SX1, SY1,
+                   GuiLib_COL_INVERT_ON);
+                break;
+
+              case 2:
+                ScrollBox_ShowLineStruct(ScrollBoxIndex,
+                   sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructIndex, SX1, SY1,
+                   GuiLib_COL_INVERT_ON);
+                break;
+
+              case 3:
+                if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[N] !=
+                    0xFFFF)
+                  ScrollBox_ShowLineStruct(ScrollBoxIndex,
+                     sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[N],
+                     SX1, SY1, GuiLib_COL_INVERT_ON);
+                break;
+            }
+
+            break;
+          }
+        }
+      }
+      else
+      {
+        ScrollBox_ShowLineBlock(
+           sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor,
+           sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorTransparent,
+           X1, Y1, X2, Y2);
+        ScrollBox_ShowLineStruct(ScrollBoxIndex,
+           sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructIndex, SX1, SY1,
+           GuiLib_COL_INVERT_OFF);
+      }
+    }
+  }
+  else
+    ScrollBox_ShowLineBlock(sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor,
+       sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorTransparent,
+       X1, Y1, X2, Y2);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  sgl.CurItem.ClipRectX1 = RemClippingX1;
+  sgl.CurItem.ClipRectY1 = RemClippingY1;
+  sgl.CurItem.ClipRectX2 = RemClippingX2;
+  sgl.CurItem.ClipRectY2 = RemClippingY2;
+  GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                     sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_Init(
+   GuiConst_INT8U ScrollBoxIndex,
+   void (*DataFuncPtr) (GuiConst_INT16S LineIndex),
+   GuiConst_INT16S NoOfLines,
+   GuiConst_INT16S ActiveLine)
+{
+  GuiConst_INT16U StructToCallIndex;
+  GuiLib_StructPtr StructToCall;
+  GuiLib_ItemRec RemCurItem;
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  GuiConst_INT8U RemCursorInUse;
+#endif // GuiConst_CURSOR_SUPPORT_ON
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_READ) ||
+      (ActiveLine >= NoOfLines))
+    return (0);
+
+  memcpy(&RemCurItem, &sgl.CurItem, sizeof(GuiLib_ItemRec));
+
+  sgl.GlobalScrollBoxIndex = ScrollBoxIndex;
+
+  memcpy(&sgl.CurItem, &sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxItem,
+     sizeof(GuiLib_ItemRec));
+  StructToCallIndex = sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructIndex;
+  if (StructToCallIndex != 0xFFFF)
+  {
+    sgl.DisplayLevel++;
+    StructToCall = (GuiLib_StructPtr)
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+       GetRemoteStructData(StructToCallIndex);
+#else
+       (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[StructToCallIndex]);
+#endif
+    sgl.NextScrollLineReading = 1;
+    sgl.InitialDrawing = 1;
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+    RemCursorInUse = sgl.CursorInUse;
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ContainsCursorFields = 0;
+    sgl.CursorInUse = (GuiLib_ActiveCursorFieldNo >= 0);
+    sgl.CursorFieldFound = -1;
+    sgl.CursorActiveFieldFound = 0;
+#endif // GuiConst_CURSOR_SUPPORT_ON
+    DrawStructure(StructToCall, GuiLib_COL_INVERT_OFF);
+    ResetLayerBufPtr();
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+    sgl.InitialDrawing = 0;
+    if (sgl.CursorFieldFound == -1)
+    {
+      sgl.CursorInUse = 0;
+      GuiLib_ActiveCursorFieldNo = -1;
+    }
+    else
+    {
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ContainsCursorFields = 1;
+      if (sgl.CursorActiveFieldFound == 0)
+      {
+        GuiLib_ActiveCursorFieldNo = sgl.CursorFieldFound;
+
+        DrawCursorItem(1);
+      }
+    }
+    sgl.CursorInUse = sgl.CursorInUse | RemCursorInUse;
+#endif // GuiConst_CURSOR_SUPPORT_ON
+    sgl.NextScrollLineReading = 0;
+    sgl.DisplayLevel--;
+  }
+
+  SetCurFont(sgl.CurItem.TextPar[0].FontIndex);
+  if ((sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeY == 0) &&
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeY2 == 0))
+  {
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeY = sgl.CurFont->BaseLine;
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeY2 =
+       sgl.CurFont->YSize - sgl.CurFont->BaseLine - 1;
+  }
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiLib_SetClipping(sgl.CurItem.ClipRectX1,sgl.CurItem.ClipRectY1,
+                     sgl.CurItem.ClipRectX2,sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+  StructToCallIndex = sgl.ScrollBoxesAry[ScrollBoxIndex].MakeUpStructIndex;
+  if (StructToCallIndex != 0xFFFF)
+  {
+    sgl.DisplayLevel++;
+    memcpy(&sgl.CurItem, &sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxItem,
+       sizeof(GuiLib_ItemRec));
+    sgl.CurItem.RX = sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].X1;
+    sgl.CurItem.RY = sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].Y1;
+    StructToCall = (GuiLib_StructPtr)
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+       GetRemoteStructData(StructToCallIndex);
+#else
+       (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[StructToCallIndex]);
+#endif
+    DrawStructure(StructToCall,GuiLib_COL_INVERT_OFF);
+    ResetLayerBufPtr();
+    sgl.DisplayLevel--;
+  }
+
+  sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollLineDataFunc = DataFuncPtr;
+  sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] = ActiveLine;
+  sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine = ActiveLine;
+  sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines = NoOfLines;
+  if ((sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0) &&
+      (NoOfLines < sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines))
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines = NoOfLines;
+  sgl.ScrollBoxesAry[ScrollBoxIndex].InUse = GuiLib_SCROLL_STRUCTURE_USED;
+  ScrollBox_SetTopLine(ScrollBoxIndex);
+  GuiLib_ScrollBox_Redraw(ScrollBoxIndex);
+  sgl.ScrollBoxesAry[ScrollBoxIndex].LastScrollTopLine = 0xFFFF;
+
+  memcpy(&sgl.CurItem, &RemCurItem, sizeof(GuiLib_ItemRec));
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_Redraw(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+  GuiConst_INT16S N, ScrollStartLine, ScrollStopLine;
+  GuiLib_ItemRec RemCurItem;
+#ifndef GuiConst_SCROLLITEM_BAR_NONE
+#define GuiLib_SCROLL_REDRAW_VAR
+#else
+#ifndef GuiConst_SCROLLITEM_INDICATOR_NONE
+#define GuiLib_SCROLL_REDRAW_VAR
+#endif
+#endif
+#ifdef GuiLib_SCROLL_REDRAW_VAR
+  GuiLib_StructPtr StructToCall;
+  GuiConst_INT16U StructToCallIndex;
+  GuiConst_INT16S SX1, SY1;
+  GuiConst_INT16S X1, Y1;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiConst_INT16S SX2, SY2;
+  GuiConst_INT16S X2, Y2;
+  GuiConst_INT16S RemClippingX1, RemClippingY1, RemClippingX2, RemClippingY2;
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+#endif // GuiLib_SCROLL_REDRAW_VAR
+#ifndef GuiConst_SCROLLITEM_BAR_NONE
+  GuiConst_INT16S BarMarkerY;
+  GuiConst_INT16S BarMarkerHeight;
+  GuiConst_INT16S BarMarkerMovementDY;
+  GuiConst_INT32S N1, N2;
+#endif // GuiConst_SCROLLITEM_BAR_NONE
+  GuiConst_INT32S BackColor;
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED))
+    return (0);
+
+  memcpy(&RemCurItem, &sgl.CurItem, sizeof(GuiLib_ItemRec));
+
+  sgl.GlobalScrollBoxIndex = ScrollBoxIndex;
+
+  ScrollStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+  ScrollStopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine +
+     sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines - 1;
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].LastScrollTopLine ==
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine)
+  {
+    if ((sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine == -1) ||
+        (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] == -1))
+    {
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine !=
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0])
+      {
+        if (sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine == -1)
+        {
+          ScrollStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+          ScrollStopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+        }
+        else
+        {
+          ScrollStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine;
+          ScrollStopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine;
+        }
+      }
+    }
+    else if (sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine <
+             sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0])
+    {
+      ScrollStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine;
+      if (ScrollStartLine < sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine)
+        ScrollStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+      ScrollStopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+    }
+    else if (sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine >
+             sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0])
+    {
+      ScrollStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+      ScrollStopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine;
+      GuiLib_LIMIT_MAX(ScrollStartLine,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine +
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines - 1);
+    }
+  }
+
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollLineDataFunc != 0)
+    for (N = ScrollStartLine; N <= ScrollStopLine; N++)
+      ScrollBox_DrawScrollLine(ScrollBoxIndex, N);
+
+  sgl.ScrollBoxesAry[ScrollBoxIndex].LastScrollTopLine =
+     sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+  sgl.ScrollBoxesAry[ScrollBoxIndex].LastMarkerLine =
+     sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+
+#ifndef GuiConst_SCROLLITEM_BAR_NONE
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarType != GuiLib_MARKER_NONE)
+  {
+    SX1 = sgl.ScrollBoxesAry[ScrollBoxIndex].BarPositionX;
+    SY1 = sgl.ScrollBoxesAry[ScrollBoxIndex].BarPositionY;
+    X1 = SX1 + sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerLeftOffset;
+    Y1 = SY1 + sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTopOffset;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    SX2 = SX1 + sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX - 1;
+    SY2 = SY1 + sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeY - 1;
+    X2 = SX2 - sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerRightOffset;
+    Y2 = SY2 - sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBottomOffset;
+    RemClippingX1 = sgl.CurItem.ClipRectX1;
+    RemClippingY1 = sgl.CurItem.ClipRectY1;
+    RemClippingX2 = sgl.CurItem.ClipRectX2;
+    RemClippingY2 = sgl.CurItem.ClipRectY2;
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX1, SX1, SX2);
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY1, SY1, SY2);
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX2, SX1, SX2);
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY2, SY1, SY2);
+    GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                       sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+    StructToCallIndex = sgl.ScrollBoxesAry[ScrollBoxIndex].BarStructIndex;
+    if (StructToCallIndex != 0xFFFF)
+    {
+      ScrollBox_ShowBarBlock(
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor,
+         0,
+         SX1,
+         SY1,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeY);
+
+      sgl.DisplayLevel++;
+      memcpy(&sgl.CurItem,
+             &sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxItem,
+             sizeof(GuiLib_ItemRec));
+      sgl.CurItem.RX = SX1;
+      sgl.CurItem.RY = SY1;
+      StructToCall = (GuiLib_StructPtr)
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+         GetRemoteStructData(StructToCallIndex);
+#else
+         (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[StructToCallIndex]);
+#endif
+      DrawStructure(StructToCall, GuiLib_COL_INVERT_OFF);
+      ResetLayerBufPtr();
+      sgl.DisplayLevel--;
+    }
+    else
+      ScrollBox_ShowBarBlock(
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarThickness,
+         SX1,
+         SY1,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeY);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    sgl.CurItem.ClipRectX1 = RemClippingX1;
+    sgl.CurItem.ClipRectY1 = RemClippingY1;
+    sgl.CurItem.ClipRectX2 = RemClippingX2;
+    sgl.CurItem.ClipRectY2 = RemClippingY2;
+    GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                       sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines >
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines)
+    {
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      RemClippingX1 = sgl.CurItem.ClipRectX1;
+      RemClippingY1 = sgl.CurItem.ClipRectY1;
+      RemClippingX2 = sgl.CurItem.ClipRectX2;
+      RemClippingY2 = sgl.CurItem.ClipRectY2;
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX1, X1, X2);
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY1, Y1, Y2);
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX2, X1, X2);
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY2, Y1, Y2);
+      GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                         sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+      BarMarkerHeight = 0;
+      BarMarkerMovementDY = sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeY -
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBottomOffset -
+         sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTopOffset;
+
+      switch (sgl.ScrollBoxesAry[ScrollBoxIndex].BarType)
+      {
+        case GuiLib_MARKER_ICON:
+          sgl.CurFont = (GuiLib_FontRecPtr)ReadWord(GuiFont_FontList[
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconFont]);
+          BarMarkerHeight = sgl.CurFont->YSize;
+          break;
+
+        case GuiLib_MARKER_BITMAP:
+          BarMarkerHeight =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapHeight;
+          break;
+
+        case GuiLib_MARKER_FIXED_BLOCK:
+          BarMarkerHeight =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX -
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerLeftOffset -
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerRightOffset;
+          break;
+
+        case GuiLib_MARKER_VARIABLE_BLOCK:
+          BarMarkerHeight =
+             (((10 * BarMarkerMovementDY *
+             sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines) + 5) /
+             sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines) / 10;
+          GuiLib_LIMIT_MIN(BarMarkerHeight, 4);
+          break;
+      }
+
+      N1 = sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines;
+      N2 = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+      GuiLib_LIMIT_MINMAX(N2, 0, N1);
+      BarMarkerY = (((10 * (BarMarkerMovementDY - BarMarkerHeight) *
+         N2) + 5) / N1) / 10;
+
+      switch (sgl.ScrollBoxesAry[ScrollBoxIndex].BarType)
+      {
+        case GuiLib_MARKER_ICON:
+          sgl.CurItem.X1 = X1 + sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconOffsetX;
+          sgl.CurItem.Y1 = Y1 + BarMarkerY +
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconOffsetY +
+             sgl.CurFont->BaseLine;
+          sgl.CurItem.TextPar[0].FontIndex =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconFont;
+          sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT;
+          sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF;
+          sgl.CurItem.TextPar[0].BitFlags = 0;
+          sgl.CurItem.TextPar[0].BackBoxSizeX = 0;
+          sgl.CurItem.TextPar[0].BackBorderPixels = 0;
+          DrawText(sgl.ScrollBoxesAry[ScrollBoxIndex].BarIconPtr, 1, 0,
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor,
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor,
+             sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTransparent);
+          break;
+
+        case GuiLib_MARKER_BITMAP:
+          if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIsTransparent)
+            BackColor =
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapTranspColor;
+          else
+            BackColor = -1;
+          GuiLib_ShowBitmap(sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIndex,
+             X1, Y1 + BarMarkerY, BackColor);
+          break;
+
+        case GuiLib_MARKER_FIXED_BLOCK:
+        case GuiLib_MARKER_VARIABLE_BLOCK:
+          if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTransparent)
+            GuiLib_Box(X1, Y1 + BarMarkerY,
+               X1 + sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX -
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerLeftOffset -
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerRightOffset - 1,
+               Y1 + BarMarkerY + BarMarkerHeight - 1,
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor);
+          else
+            GuiLib_BorderBox(X1, Y1 + BarMarkerY,
+               X1 + sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX -
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerLeftOffset -
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerRightOffset - 1,
+               Y1 + BarMarkerY + BarMarkerHeight - 1,
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor,
+               sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor);
+          break;
+      }
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      sgl.CurItem.ClipRectX1 = RemClippingX1;
+      sgl.CurItem.ClipRectY1 = RemClippingY1;
+      sgl.CurItem.ClipRectX2 = RemClippingX2;
+      sgl.CurItem.ClipRectY2 = RemClippingY2;
+      GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                         sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+    }
+  }
+#endif
+
+#ifndef GuiConst_SCROLLITEM_INDICATOR_NONE
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType != GuiLib_INDICATOR_NONE)
+  {
+    SX1 = sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorPositionX;
+    SY1 = sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorPositionY;
+    X1 = SX1 + sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerLeftOffset;
+    Y1 = SY1 + sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTopOffset;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    SX2 = SX1 + sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeX - 1;
+    SY2 = SY1 + sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeY - 1;
+    X2 = SX2 - sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerRightOffset;
+    Y2 = SY2 - sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBottomOffset;
+    RemClippingX1 = sgl.CurItem.ClipRectX1;
+    RemClippingY1 = sgl.CurItem.ClipRectY1;
+    RemClippingX2 = sgl.CurItem.ClipRectX2;
+    RemClippingY2 = sgl.CurItem.ClipRectY2;
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX1, SX1, SX2);
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY1, SY1, SY2);
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX2, SX1, SX2);
+    GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY2, SY1, SY2);
+    GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                       sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+    StructToCallIndex = sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorStructIndex;
+    if (StructToCallIndex != 0xFFFF)
+    {
+      ScrollBox_ShowBarBlock(
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor,
+         0,
+         SX1,
+         SY1,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeX,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeY);
+
+      sgl.DisplayLevel++;
+      memcpy(&sgl.CurItem,
+             &sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxItem,
+             sizeof(GuiLib_ItemRec));
+      sgl.CurItem.RX = SX1;
+      sgl.CurItem.RY = SY1;
+      StructToCall = (GuiLib_StructPtr)
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+         GetRemoteStructData(StructToCallIndex);
+#else
+         (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[StructToCallIndex]);
+#endif
+      DrawStructure(StructToCall, GuiLib_COL_INVERT_OFF);
+      ResetLayerBufPtr();
+      sgl.DisplayLevel--;
+    }
+    else
+      ScrollBox_ShowBarBlock(
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorThickness,
+         SX1,
+         SY1,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeX,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeY);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    sgl.CurItem.ClipRectX1 = RemClippingX1;
+    sgl.CurItem.ClipRectY1 = RemClippingY1;
+    sgl.CurItem.ClipRectX2 = RemClippingX2;
+    sgl.CurItem.ClipRectY2 = RemClippingY2;
+    GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                       sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+    if ((sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine >= 0) &&
+        (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine >=
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine) &&
+        (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine <
+        (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine +
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines)))
+    {
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX1, X1, X2);
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY1, Y1, Y2);
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectX2, X1, X2);
+      GuiLib_LIMIT_MINMAX(sgl.CurItem.ClipRectY2, Y1, Y2);
+      GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                         sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+      switch (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType)
+      {
+        case GuiLib_MARKER_ICON:
+          sgl.CurFont = (GuiLib_FontRecPtr)ReadWord(GuiFont_FontList[
+             sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconFont]);
+          sgl.CurItem.X1 =
+             X1 + sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconOffsetX;
+          sgl.CurItem.Y1 =
+             Y1 + sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconOffsetY +
+             sgl.CurFont->BaseLine +
+             sgl.ScrollBoxesAry[ScrollBoxIndex].LineVerticalOffset *
+             (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine -
+             sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine);
+          sgl.CurItem.TextPar[0].FontIndex =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconFont;
+          sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT;
+          sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF;
+          sgl.CurItem.TextPar[0].BitFlags = 0;
+          sgl.CurItem.TextPar[0].BackBoxSizeX = 0;
+          sgl.CurItem.TextPar[0].BackBorderPixels = 0;
+          DrawText(sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorIconPtr, 1, 0,
+                   sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor,
+                   sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor,
+                   sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTransparent);
+          break;
+
+        case GuiLib_MARKER_BITMAP:
+          if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIsTransparent)
+            BackColor =
+               sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapTranspColor;
+          else
+            BackColor = -1;
+          GuiLib_ShowBitmap(
+             sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIndex,
+             X1, Y1 + sgl.ScrollBoxesAry[ScrollBoxIndex].LineVerticalOffset *
+             (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine -
+             sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine), BackColor);
+          break;
+      }
+    }
+  }
+#endif // GuiConst_SCROLLITEM_INDICATOR_NONE
+
+  memcpy(&sgl.CurItem, &RemCurItem, sizeof(GuiLib_ItemRec));
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_RedrawLine(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLine)
+{
+  GuiLib_ItemRec RemCurItem;
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED) ||
+      (ScrollLine > (sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1)) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollLineDataFunc == 0))
+    return (0);
+
+  memcpy(&RemCurItem, &sgl.CurItem, sizeof(GuiLib_ItemRec));
+  sgl.GlobalScrollBoxIndex = ScrollBoxIndex;
+
+  ScrollBox_DrawScrollLine(ScrollBoxIndex, ScrollLine);
+
+  memcpy(&sgl.CurItem, &RemCurItem, sizeof(GuiLib_ItemRec));
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_Close(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED))
+    return (0);
+
+  sgl.ScrollBoxesAry[ScrollBoxIndex].InUse = GuiLib_SCROLL_STRUCTURE_READ;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_Down(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+  GuiConst_INT16U ScrollBottomLine;
+  GuiConst_INT16S RemScrollTopLine;
+  GuiConst_INT16S RemMarkerStartLine;
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED))
+    return (0);
+
+  RemScrollTopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+  RemMarkerStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+
+  ScrollBottomLine = (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine +
+     sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines - 1);
+
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType)
+  {
+    if (ScrollBottomLine >= (sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1))
+    {
+      if ((sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 1)
+#ifdef GuiConst_SCROLL_MODE_WRAP_AROUND
+         || (sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 2)
+#endif
+                                                        )
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = 0;
+    }
+    else
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine++;
+  }
+  else if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] >= 0)
+  {
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0)
+    {
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] ==
+         (sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1))
+      {
+        if ((sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 1)
+#ifdef GuiConst_SCROLL_MODE_WRAP_AROUND
+           || (sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 2)
+#endif
+                                                          )
+        {
+          sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = 0;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] = 0;
+        }
+      }
+      else if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] <
+         ScrollBottomLine - sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs)
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0]++;
+      else
+      {
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine++;
+        GuiLib_LIMIT_MAX(sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine,
+           sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+           sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines);
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0]++;
+      }
+    }
+    else
+    {
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] ==
+         (sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1))
+      {
+        if ((sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 1)
+#ifdef GuiConst_SCROLL_MODE_WRAP_AROUND
+           || (sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 2)
+#endif
+                                                          )
+        {
+          sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+             -sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] = 0;
+        }
+      }
+      else
+      {
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine++;
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0]++;
+      }
+    }
+  }
+
+  if ((sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine != RemScrollTopLine) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] != RemMarkerStartLine))
+  {
+    GuiLib_ScrollBox_Redraw(ScrollBoxIndex);
+    return (1);
+  }
+  else
+    return (0);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_Up(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+  GuiConst_INT16S RemScrollTopLine;
+  GuiConst_INT16S RemMarkerStartLine;
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED))
+    return (0);
+
+  RemScrollTopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+  RemMarkerStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType)
+  {
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine == 0)
+    {
+      if ((sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 1)
+#ifdef GuiConst_SCROLL_MODE_WRAP_AROUND
+         || (sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 2)
+#endif
+                                                        )
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+           sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+           sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines;
+        GuiLib_LIMIT_MIN(sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine, 0);
+    }
+    else
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine--;
+  }
+  else if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] >= 0)
+  {
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0)
+    {
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] == 0)
+      {
+        if ((sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 1)
+#ifdef GuiConst_SCROLL_MODE_WRAP_AROUND
+           || (sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 2)
+#endif
+                                                          )
+        {
+          sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+             sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines;
+          GuiLib_LIMIT_MIN(sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine, 0);
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1;
+        }
+      }
+      else if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] >
+               sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine +
+               sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs)
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0]--;
+      else
+      {
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine--;
+        GuiLib_LIMIT_MIN(sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine, 0);
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0]--;
+      }
+    }
+    else
+    {
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] == 0)
+      {
+        if ((sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 1)
+#ifdef GuiConst_SCROLL_MODE_WRAP_AROUND
+           || (sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode == 2)
+#endif
+                                                          )
+        {
+          sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1 -
+             sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] =
+             sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1;
+        }
+      }
+      else
+      {
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine--;
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0]--;
+      }
+    }
+  }
+
+  if ((sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine != RemScrollTopLine) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] != RemMarkerStartLine))
+  {
+    GuiLib_ScrollBox_Redraw(ScrollBoxIndex);
+    return (1);
+  }
+  else
+    return (0);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_Home(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+  GuiConst_INT16S RemScrollTopLine;
+  GuiConst_INT16S RemMarkerStartLine;
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED))
+    return (0);
+
+  RemScrollTopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+  RemMarkerStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType)
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = 0;
+  else
+  {
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0)
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = 0;
+    else
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+         -sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] >= 0)
+      sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] = 0;
+  }
+
+  if ((sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine != RemScrollTopLine) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] != RemMarkerStartLine))
+  {
+    GuiLib_ScrollBox_Redraw(ScrollBoxIndex);
+    return (1);
+  }
+  else
+    return (0);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_End(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+  GuiConst_INT16S RemScrollTopLine;
+  GuiConst_INT16S RemMarkerStartLine;
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED))
+    return (0);
+
+  RemScrollTopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+  RemMarkerStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType)
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = GuiLib_GET_MAX(
+       sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+       sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines, 0);
+  else
+  {
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0)
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = GuiLib_GET_MAX(
+         sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines, 0);
+    else
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+         sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1 -
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] >= 0)
+      sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] =
+         sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1;
+  }
+
+  if ((sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine != RemScrollTopLine) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] != RemMarkerStartLine))
+  {
+    GuiLib_ScrollBox_Redraw(ScrollBoxIndex);
+    return (1);
+  }
+  else
+    return (0);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_To_Line(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16S NewLine)
+{
+  GuiConst_INT16S RemScrollTopLine;
+  GuiConst_INT16S RemMarkerStartLine;
+  GuiConst_INT16S TopLine;
+  GuiConst_INT16S LowerLimtA = 0;
+
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED) ||
+      (NewLine >= sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines))
+    return(0);
+
+  RemScrollTopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine;
+  RemMarkerStartLine = sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0];
+
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType)
+  {
+    TopLine = sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+              sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines;
+    GuiLib_LIMIT_MIN(TopLine, 0);
+    if (NewLine > TopLine)
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = TopLine;
+    else
+      sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine = NewLine;
+  }
+  else if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0)
+  {
+    if ((NewLine != -1) &&
+        ((NewLine < sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine) ||
+        (NewLine >= (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine +
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines))))
+    {
+      if (NewLine > (sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+          sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines +
+          sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs))
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+           sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+           sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines;
+      else
+        sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+           NewLine - sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+
+      GuiLib_LIMIT_MINMAX(sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine,
+         NewLine - sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines + 1,
+         NewLine + sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines - 1);
+      GuiLib_LIMIT_MINMAX(sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine, LowerLimtA,
+         sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+         sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines);
+    }
+  }
+  else
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+       NewLine - sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs;
+  sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] = NewLine;
+
+  if ((sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine != RemScrollTopLine) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[0] != RemMarkerStartLine))
+  {
+    GuiLib_ScrollBox_Redraw(ScrollBoxIndex);
+    return (1);
+  }
+  else
+    return (0);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_SetLineMarker(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLineMarkerIndex,
+   GuiConst_INT16S StartLine,
+   GuiConst_INT16U Size)
+{
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED) ||
+      (ScrollLineMarkerIndex >= GuiConst_SCROLLITEM_MARKERS_MAX) ||
+      (StartLine >= sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines))
+    return (0);
+
+  sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[ScrollLineMarkerIndex] =
+     GuiLib_GET_MINMAX(StartLine, -1,
+     (GuiConst_INT16S)sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1);
+  if ((ScrollLineMarkerIndex == 0) && (Size > 1))
+    Size = 1;
+  sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[ScrollLineMarkerIndex] = Size;
+  if (ScrollLineMarkerIndex == 0)
+    ScrollBox_SetTopLine(ScrollBoxIndex);
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT16S GuiLib_ScrollBox_GetActiveLine(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLineMarkerIndex)
+{
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED) ||
+      (ScrollLineMarkerIndex >= GuiConst_SCROLLITEM_MARKERS_MAX))
+    return (-1);
+
+  return (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[ScrollLineMarkerIndex]);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT16S GuiLib_ScrollBox_GetActiveLineCount(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLineMarkerIndex)
+{
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED) ||
+      (ScrollLineMarkerIndex >= GuiConst_SCROLLITEM_MARKERS_MAX))
+    return (-1);
+
+  return (sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[ScrollLineMarkerIndex]);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_SetIndicator(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16S StartLine)
+{
+#ifdef GuiConst_SCROLLITEM_INDICATOR_NONE
+  gl.Dummy1_8U = ScrollBoxIndex;   // To avoid compiler warning
+  gl.Dummy1_16S = StartLine;   // To avoid compiler warning
+  return (0);
+#else
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED) ||
+      (StartLine >= sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines))
+    return (0);
+
+  sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine = GuiLib_GET_MINMAX(
+     StartLine, -1,
+     (GuiConst_INT16S)sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines - 1);
+
+  return (1);
+#endif
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_ScrollBox_SetTopLine(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16S TopLine)
+{
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED) ||
+      (TopLine >= sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines))
+    return (0);
+
+  if (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode == 0)
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine =
+       GuiLib_GET_MINMAX(TopLine, 0,
+       sgl.ScrollBoxesAry[ScrollBoxIndex].NumberOfLines -
+       sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines);
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT16S GuiLib_ScrollBox_GetTopLine(
+   GuiConst_INT8U ScrollBoxIndex)
+{
+  if ((ScrollBoxIndex >= GuiConst_SCROLLITEM_BOXES_MAX) ||
+      (sgl.ScrollBoxesAry[ScrollBoxIndex].InUse != GuiLib_SCROLL_STRUCTURE_USED))
+    return (-1);
+
+  return (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollTopLine);
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+#endif // GuiConst_ITEM_SCROLLBOX_INUSE
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+//------------------------------------------------------------------------------
+static void Graph_SetClipping(
+   GuiConst_INT8U GraphIndex)
+{
+  GuiLib_SetClipping(sgl.GraphAry[GraphIndex].GraphItem.ClipRectX1,
+                     sgl.GraphAry[GraphIndex].GraphItem.ClipRectY1,
+                     sgl.GraphAry[GraphIndex].GraphItem.ClipRectX2,
+                     sgl.GraphAry[GraphIndex].GraphItem.ClipRectY2);
+}
+
+//------------------------------------------------------------------------------
+static void Graph_ResetClipping(void)
+{
+  GuiLib_ResetClipping();
+}
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+//------------------------------------------------------------------------------
+static void Graph_CalcScaleX(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  GuiConst_INT32S D1,D2;
+
+  D1 = (sgl.GraphAry[GraphIndex].GraphItem.X2 -
+       sgl.GraphAry[GraphIndex].GraphItem.X1 -
+       sgl.GraphAry[GraphIndex].OriginOffsetX);
+  D1 = D1 * 10000;
+  D2 = (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].NumbersMaxValue -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].NumbersMinValue);
+  D1 = D1/D2;
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Scale = D1;
+}
+
+//------------------------------------------------------------------------------
+static void Graph_CalcScaleY(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  GuiConst_INT32S D1,D2;
+
+  D1 = (sgl.GraphAry[GraphIndex].GraphItem.Y2 -
+       sgl.GraphAry[GraphIndex].GraphItem.Y1-
+       sgl.GraphAry[GraphIndex].OriginOffsetY);
+  D1 = D1 * 10000;
+  D2 = (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].NumbersMaxValue -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].NumbersMinValue);
+  D1 = D1/D2;
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Scale= D1;
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT32S Graph_CalcNumbersMaxValue(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex,
+   GuiConst_INT8U AxisType)
+{
+  GuiConst_INT32S MV;
+
+  MV = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][AxisType].NumbersMaxValue;
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][AxisType].TicksMinor)
+    MV -= sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][AxisType].NumbersAtEnd *
+          sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][AxisType].NumbersStepMinor;
+  else if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][AxisType].TicksMajor)
+    MV -= sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][AxisType].NumbersAtEnd *
+          sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][AxisType].NumbersStepMajor;
+  return(MV);
+}
+
+//------------------------------------------------------------------------------
+static void Graph_DrawXAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  GuiConst_INT16S X, Y;
+  GuiConst_INT16S DX, DY;
+  GuiConst_INT32S TX, TY;
+  #ifdef GuiConst_FLOAT_SUPPORT_ON
+  double TDX;
+  #endif
+  GuiConst_INT32S F;
+  GuiConst_INT16S HW;
+  GuiConst_INT32S MV;
+  GuiConst_INT16U StrLen;
+  GuiConst_INT16U I;
+  GuiConst_INT8U Align;
+
+  Y = sgl.GraphAry[GraphIndex].OrigoY +
+      sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Offset;
+
+  MV = Graph_CalcNumbersMaxValue(GraphIndex, AxisIndex, GuiLib_GRAPHAXIS_X);
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Line)
+  {
+    X = sgl.GraphAry[GraphIndex].GraphItem.X2 -
+        sgl.GraphAry[GraphIndex].GraphItem.X1 + 1;
+    for (I = 0; I < sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y]; I++)
+      if (sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].Offset < X)
+        X = sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].Offset;
+    X += sgl.GraphAry[GraphIndex].OriginOffsetX;
+    if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+        LineNegative)
+      GuiLib_FillBox(sgl.GraphAry[GraphIndex].GraphItem.X1,
+                     Y,
+                     sgl.GraphAry[GraphIndex].GraphItem.X1 + X - 1,
+                     Y,
+                     sgl.GraphAry[GraphIndex].ForeColor);
+    if ((sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y] > 1) &&
+         sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         LineBetweenAxes)
+      GuiLib_FillBox(sgl.GraphAry[GraphIndex].GraphItem.X1 + X - 1,
+                     Y,
+                     sgl.GraphAry[GraphIndex].GraphItem.X1 +
+                     sgl.GraphAry[GraphIndex].OriginOffsetX,
+                     Y,
+                     sgl.GraphAry[GraphIndex].ForeColor);
+    GuiLib_FillBox(sgl.GraphAry[GraphIndex].GraphItem.X1 +
+                   sgl.GraphAry[GraphIndex].OriginOffsetX,
+                   Y,
+                   sgl.GraphAry[GraphIndex].GraphItem.X2,
+                   Y,
+                   sgl.GraphAry[GraphIndex].ForeColor);
+  }
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Arrow)
+  {
+    DX = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         ArrowLength;
+    HW = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         ArrowWidth / 2;
+    for (DY = -HW; DY <= HW; DY++)
+      GuiLib_Line(sgl.GraphAry[GraphIndex].GraphItem.X2 - DX,
+                  Y + DY,
+                  sgl.GraphAry[GraphIndex].GraphItem.X2,
+                  Y,
+                  sgl.GraphAry[GraphIndex].ForeColor);
+  }
+
+  Graph_CalcScaleX(GraphIndex, AxisIndex);
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].TicksMajor)
+  {
+    HW = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         TicksMajorWidth / 2;
+    TX = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         NumbersMinValue;
+    F = TX % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+             NumbersStepMajor;
+    if (F != 0)
+    {
+      TX -= F;
+      if (TX < sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+               NumbersMinValue)
+        TX += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+              NumbersStepMajor;
+    }
+    while (TX <= MV)
+    {
+      DX = sgl.GraphAry[GraphIndex].OrigoX + ((TX -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+           NumbersMinValue) *
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Scale) /
+           10000;
+      if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+          NumbersAtOrigo ||
+         (TX != sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+                NumbersMinValue))
+        GuiLib_FillBox(
+           DX - HW,
+           Y,
+           DX - HW +
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+           TicksMajorWidth - 1,
+           Y + sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+           TicksMajorLength - 1,
+           sgl.GraphAry[GraphIndex].ForeColor);
+      TX += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+            NumbersStepMajor;
+    }
+  }
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].TicksMinor)
+  {
+    HW = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         TicksMinorWidth / 2;
+    TX = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         NumbersMinValue;
+    F = TX % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+             NumbersStepMinor;
+    if (F != 0)
+    {
+      TX -= F;
+      if (TX < sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+               NumbersMinValue)
+        TX += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+              NumbersStepMinor;
+    }
+    while (TX <= MV)
+    {
+      DX = sgl.GraphAry[GraphIndex].OrigoX + ((TX -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+           NumbersMinValue) *
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Scale) /
+           10000;
+      if ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+          NumbersAtOrigo ||
+         (TX != sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+                NumbersMinValue)) &&
+         ((!sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+            TicksMajor) ||
+         (TX % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+               NumbersStepMajor != 0)))
+        GuiLib_FillBox(
+           DX - HW,
+           Y,
+           DX - HW +
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+           TicksMinorWidth - 1,
+           Y + sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+           TicksMinorLength - 1,
+           sgl.GraphAry[GraphIndex].ForeColor);
+      TX += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+            NumbersStepMinor;
+    }
+  }
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Numbers)
+  {
+    memcpy(&sgl.CurItem, &sgl.GraphAry[GraphIndex].GraphItem, sizeof(GuiLib_ItemRec));
+
+    DY = Y;
+    if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+       TicksMajor)
+      DY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         TicksMajorLength;
+    SetCurFont(sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].FontIndex);
+    DY += ReadByte(sgl.CurFont->BaseLine);
+    DY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+       NumbersOffset;
+
+    TX = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+       NumbersMinValue;
+    F = TX % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+             NumbersStepMajor;
+    if (F != 0)
+    {
+      TX -= F;
+      if (TX < sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+               NumbersMinValue)
+        TX += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+              NumbersStepMajor;
+    }
+    switch (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].FormatAlignment)
+    {
+      case GuiLib_FORMAT_ALIGNMENT_LEFT:
+        Align = GuiLib_ALIGN_LEFT;
+        break;
+      case GuiLib_FORMAT_ALIGNMENT_CENTER:
+        Align = GuiLib_ALIGN_CENTER;
+        break;
+      case GuiLib_FORMAT_ALIGNMENT_RIGHT:
+        Align = GuiLib_ALIGN_RIGHT;
+        break;
+    }
+    while (TX <= MV)
+    {
+      DX = sgl.GraphAry[GraphIndex].OrigoX + ((TX -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+           NumbersMinValue) *
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Scale) /
+           10000;
+      if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+          NumbersAtOrigo ||
+         (TX != sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+                NumbersMinValue))
+      {
+        #ifdef GuiConst_FLOAT_SUPPORT_ON
+        TDX = TX;
+        #endif
+        GuiLib_DrawVar(
+           DX,
+           DY,
+           sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].FontIndex,
+           #ifdef GuiConst_FLOAT_SUPPORT_ON
+           &TDX,
+           GuiLib_VAR_DOUBLE,
+           #else
+           &TX,
+           GuiLib_VAR_SIGNED_LONG,
+           #endif
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].FormatFormat,
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].FormatFieldWidth,
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].FormatAlignment,
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].FormatDecimals,
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+              BitFlags & GuiLib_BITFLAG_FORMATSHOWSIGN) > 0),
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+              BitFlags & GuiLib_BITFLAG_FORMATZEROPADDING) > 0),
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+              BitFlags & GuiLib_BITFLAG_FORMATTRAILINGZEROS) > 0),
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+              BitFlags & GuiLib_BITFLAG_FORMATTHOUSANDSSEP) > 0),
+           Align,
+           sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].Ps,
+           1,   // Transparent
+           ((sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].BitFlags &
+            GuiLib_BITFLAG_UNDERLINE) > 0),
+           0,
+           0,
+           0,
+           0,
+           sgl.GraphAry[GraphIndex].GraphItem.ForeColor,
+           sgl.GraphAry[GraphIndex].GraphItem.BackColor);
+      }
+      TX += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+         NumbersStepMajor;
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+static void Graph_DrawYAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  GuiConst_INT16S X, Y;
+  GuiConst_INT16S DX, DY;
+  GuiConst_INT32S TX, TY;
+  #ifdef GuiConst_FLOAT_SUPPORT_ON
+  double TDY;
+  #endif
+  GuiConst_INT32S F;
+  GuiConst_INT16S HW;
+  GuiConst_INT32S MV;
+  GuiConst_INT16U StrLen;
+  GuiConst_INT16U I;
+  GuiConst_INT8U Align;
+
+  X = sgl.GraphAry[GraphIndex].OrigoX +
+      sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Offset;
+
+  MV = Graph_CalcNumbersMaxValue(GraphIndex, AxisIndex, GuiLib_GRAPHAXIS_Y);
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Line)
+  {
+    Y = 0;
+    for (I = 0; I < sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X]; I++)
+      if (sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].Offset > Y)
+        Y = sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].Offset;
+    Y = sgl.GraphAry[GraphIndex].OriginOffsetY - Y;
+    if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+        LineNegative)
+      GuiLib_FillBox(X,
+                     sgl.GraphAry[GraphIndex].GraphItem.Y2 - Y,
+                     X,
+                     sgl.GraphAry[GraphIndex].GraphItem.Y2,
+                     sgl.GraphAry[GraphIndex].ForeColor);
+    if ((sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X] > 1) &&
+         sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         LineBetweenAxes)
+      GuiLib_FillBox(X,
+                     sgl.GraphAry[GraphIndex].GraphItem.Y2 -
+                     sgl.GraphAry[GraphIndex].OriginOffsetY,
+                     X,
+                     sgl.GraphAry[GraphIndex].GraphItem.Y2 - Y,
+                     sgl.GraphAry[GraphIndex].ForeColor);
+    GuiLib_FillBox(X,
+                   sgl.GraphAry[GraphIndex].GraphItem.Y1,
+                   X,
+                   sgl.GraphAry[GraphIndex].GraphItem.Y2 -
+                   sgl.GraphAry[GraphIndex].OriginOffsetY,
+                   sgl.GraphAry[GraphIndex].ForeColor);
+  }
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Arrow)
+  {
+    DY = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         ArrowLength;
+    HW = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         ArrowWidth / 2;
+    for (DX = -HW; DX <= HW; DX++)
+      GuiLib_Line(X - DX,
+                  sgl.GraphAry[GraphIndex].GraphItem.Y1 + DY,
+                  X,
+                  sgl.GraphAry[GraphIndex].GraphItem.Y1,
+                  sgl.GraphAry[GraphIndex].ForeColor);
+  }
+
+  Graph_CalcScaleY(GraphIndex, AxisIndex);
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].TicksMajor)
+  {
+    HW = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         TicksMajorWidth / 2;
+    TY = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         NumbersMinValue;
+    F = TY % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+             NumbersStepMajor;
+    if (F != 0)
+    {
+      TY -= F;
+      if (TY < sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+               NumbersMinValue)
+        TY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+              NumbersStepMajor;
+    }
+    while (TY <= MV)
+    {
+      DY = sgl.GraphAry[GraphIndex].OrigoY - ((TY -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+           NumbersMinValue) *
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Scale) /
+           10000;
+      if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+          NumbersAtOrigo ||
+         (TY != sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+                NumbersMinValue))
+        GuiLib_FillBox(
+           X - sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+           TicksMajorLength + 1,
+           DY - HW,
+           X,
+           DY - HW +
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+           TicksMajorWidth - 1,
+           sgl.GraphAry[GraphIndex].ForeColor);
+      TY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+            NumbersStepMajor;
+    }
+  }
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].TicksMinor)
+  {
+    HW = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         TicksMinorWidth / 2;
+    TY = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         NumbersMinValue;
+    F = TY % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+             NumbersStepMinor;
+    if (F != 0)
+    {
+      TY -= F;
+      if (TY < sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+               NumbersMinValue)
+        TY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+              NumbersStepMinor;
+    }
+    while (TY <= MV)
+    {
+      DY = sgl.GraphAry[GraphIndex].OrigoY - ((TY -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+           NumbersMinValue) *
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Scale) /
+           10000;
+      if ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+          NumbersAtOrigo ||
+         (TY != sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+                NumbersMinValue)) &&
+         ((!sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+          TicksMajor) ||
+         (TY % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+               NumbersStepMajor != 0)))
+        GuiLib_FillBox(
+           X - sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+           TicksMinorLength + 1,
+           DY - HW,
+           X,
+           DY - HW +
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+           TicksMinorWidth - 1,
+           sgl.GraphAry[GraphIndex].ForeColor);
+      TY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+            NumbersStepMinor;
+    }
+  }
+
+  if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Numbers)
+  {
+    memcpy(&sgl.CurItem, &sgl.GraphAry[GraphIndex].GraphItem, sizeof(GuiLib_ItemRec));
+
+    SetCurFont(sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].FontIndex);
+
+    sgl.CurItem.TextPar[0].BitFlags =
+       sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].BitFlags;
+    sgl.CurItem.FormatFieldWidth =
+       sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatFieldWidth;
+    sgl.CurItem.FormatDecimals =
+       sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatDecimals;
+    sgl.CurItem.FormatAlignment =
+       sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatAlignment;
+    sgl.CurItem.FormatFormat =
+       sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatFormat;
+
+    DX = X;
+    if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+       TicksMajor)
+      DX -= sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         TicksMajorLength;
+    DX -= sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+       NumbersOffset;
+
+    TY = sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+       NumbersMinValue;
+    F = TY % sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+             NumbersStepMajor;
+    if (F != 0)
+    {
+      TY -= F;
+      if (TY < sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+               NumbersMinValue)
+        TY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+              NumbersStepMajor;
+    }
+    switch (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatAlignment)
+    {
+      case GuiLib_FORMAT_ALIGNMENT_LEFT:
+        Align = GuiLib_ALIGN_LEFT;
+        break;
+      case GuiLib_FORMAT_ALIGNMENT_CENTER:
+        Align = GuiLib_ALIGN_CENTER;
+        break;
+      case GuiLib_FORMAT_ALIGNMENT_RIGHT:
+        Align = GuiLib_ALIGN_RIGHT;
+        break;
+    }
+    while (TY <= MV)
+    {
+      DY = sgl.GraphAry[GraphIndex].OrigoY - ((TY -
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+           NumbersMinValue) *
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Scale) /
+           10000;
+      if (sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+          NumbersAtOrigo ||
+         (TY != sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+                NumbersMinValue))
+      {
+        #ifdef GuiConst_FLOAT_SUPPORT_ON
+        TDY = TY;
+        #endif
+        GuiLib_DrawVar(
+           DX,
+           DY + GuiLib_FONT_MID_Y(ReadByte(sgl.CurFont->BaseLine),
+                                  ReadByte(sgl.CurFont->TopLine)),
+           sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].FontIndex,
+           #ifdef GuiConst_FLOAT_SUPPORT_ON
+           &TDY,
+           GuiLib_VAR_DOUBLE,
+           #else
+           &TY,
+           GuiLib_VAR_SIGNED_LONG,
+           #endif
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatFormat,
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatFieldWidth,
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatAlignment,
+           sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].FormatDecimals,
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+              BitFlags & GuiLib_BITFLAG_FORMATSHOWSIGN) > 0),
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+              BitFlags & GuiLib_BITFLAG_FORMATZEROPADDING) > 0),
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+              BitFlags & GuiLib_BITFLAG_FORMATTRAILINGZEROS) > 0),
+           ((sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+              BitFlags & GuiLib_BITFLAG_FORMATTHOUSANDSSEP) > 0),
+           Align,
+           sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].Ps,
+           1,   // Transparent
+           ((sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].BitFlags &
+              GuiLib_BITFLAG_UNDERLINE) > 0),
+           0,
+           0,
+           0,
+           0,
+           sgl.GraphAry[GraphIndex].GraphItem.ForeColor,
+           sgl.GraphAry[GraphIndex].GraphItem.BackColor);
+      }
+      TY += sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+         NumbersStepMajor;
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+static void Graph_DrawDataPoint(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex,
+   GuiConst_INT16U DataIndex,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S LastX,
+   GuiConst_INT16S LastY)
+{
+  GuiConst_INT16S DX1, DY1;
+  GuiConst_INT16S DX2, DY2;
+  GuiConst_INT16S HW;
+  GuiConst_INT16S AY;
+
+  switch (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Representation)
+  {
+    case GuiLib_GRAPH_DATATYPE_DOT:
+      if (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Thickness == 0)
+        GuiLib_Circle(
+           X, Y,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].BackColor,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].BackColor);
+      else if (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].
+               Thickness == 1)
+        GuiLib_Circle(
+           X, Y,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].BackColor);
+      else
+      {
+        GuiLib_Circle(
+           X, Y,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor);
+        GuiLib_Circle(
+           X, Y,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width-
+              sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Thickness,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].BackColor,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].BackColor);
+      }
+      break;
+
+    case GuiLib_GRAPH_DATATYPE_LINE:
+      if (DataIndex ==
+          sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataFirst)
+        GuiLib_Dot(
+           X, Y,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor);
+      else
+        GuiLib_Line(
+           LastX, LastY,
+           X, Y,
+           sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor);
+      break;
+
+    case GuiLib_GRAPH_DATATYPE_BAR:
+      AY = sgl.GraphAry[GraphIndex].OrigoY +
+           sgl.GraphAry[GraphIndex].GraphAxes[0][GuiLib_GRAPHAXIS_X].Offset;
+      DX2 = X + (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width / 2);
+      DX1 = DX2 - sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width + 1;
+      if (DX1 > DX2)
+        DX1 = DX2;
+      DY1 = AY;
+      DY2 = Y;
+      if (Y < AY)
+        DY1--;
+      if (Y != AY)
+      {
+        if (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Thickness == 0)
+        {
+          if (!sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].
+               BackColorTransparent)
+            GuiLib_FillBox(
+               DX1, DY1,
+               DX2, DY2,
+               sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].BackColor);
+        }
+        else
+        {
+          OrderCoord(&DX1, &DX2);
+          OrderCoord(&DY1, &DY2);
+          DrawBorderBox(
+             DX1, DY1,
+             DX2, DY2,
+             sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor,
+             sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].BackColor,
+             sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].
+                BackColorTransparent,
+             sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Thickness);
+        }
+      }
+      break;
+
+    case GuiLib_GRAPH_DATATYPE_CROSS:
+      HW = sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width;
+      DX1 = X - HW;
+      DY1 = Y - HW;
+      DX2 = X + HW;
+      DY2 = Y + HW;
+      GuiLib_Line(
+         DX1, Y,
+         DX2, Y,
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor);
+      GuiLib_Line(
+         X, DY1,
+         X, DY2,
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor);
+      break;
+
+    case GuiLib_GRAPH_DATATYPE_X:
+      HW = sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Width;
+      DX1 = X - HW;
+      DY1 = Y - HW;
+      DX2 = X + HW;
+      DY2 = Y + HW;
+      GuiLib_Line(
+         DX1, DY1,
+         DX2, DY2,
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor);
+      GuiLib_Line(
+         DX1, DY2,
+         DX2, DY1,
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].ForeColor);
+      break;
+  }
+}
+
+//------------------------------------------------------------------------------
+static void Graph_DrawDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex)
+{
+  GuiConst_INT16S DX = 0, DY = 0;
+  GuiConst_INT16S LastDX, LastDY;
+  GuiConst_INT32S TX, TY;
+  GuiConst_INT16U DataIndex;
+  GuiConst_INT16U DataCount;
+
+  Graph_CalcScaleX(GraphIndex,
+                   sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX);
+  Graph_CalcScaleY(GraphIndex,
+                   sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY);
+
+  DataIndex = sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataFirst;
+  for (DataCount = 1;
+       DataCount <= sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount;
+       DataCount++)
+  {
+    TX =
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[DataIndex].X;
+    TY =
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[DataIndex].Y;
+
+    LastDX = DX;
+    LastDY = DY;
+    DX = sgl.GraphAry[GraphIndex].OrigoX + ((TX -
+         sgl.GraphAry[GraphIndex].GraphAxes[
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX]
+         [GuiLib_GRAPHAXIS_X].NumbersMinValue) *
+         sgl.GraphAry[GraphIndex].GraphAxes[
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX]
+         [GuiLib_GRAPHAXIS_X].Scale) / 10000;
+    DY = sgl.GraphAry[GraphIndex].OrigoY - ((TY -
+         sgl.GraphAry[GraphIndex].GraphAxes[
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY]
+         [GuiLib_GRAPHAXIS_Y].NumbersMinValue) *
+         sgl.GraphAry[GraphIndex].GraphAxes[
+         sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY]
+         [GuiLib_GRAPHAXIS_Y].Scale) / 10000;
+
+    Graph_DrawDataPoint(
+       GraphIndex,
+       DataSetIndex,
+       DataIndex,
+       DX, DY,
+       LastDX, LastDY);
+
+    if (DataIndex >= sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount)
+      DataIndex = 0;
+    else
+      DataIndex++;
+  }
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_Close(
+   GuiConst_INT8U GraphIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].InUse = GuiLib_GRAPH_STRUCTURE_UNDEF;
+  sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X] = 0;
+  sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y] = 0;
+  sgl.GraphAry[GraphIndex].GraphDataSetCnt = 0;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_AddDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex,
+   GuiConst_INT8U XAxisIndex,
+   GuiConst_INT8U YAxisIndex,
+   GuiLib_GraphDataPoint *DataPtr,
+   GuiConst_INT16U DataSize,
+   GuiConst_INT16U DataCount,
+   GuiConst_INT16U DataFirst)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((DataSetIndex >= GuiConst_GRAPH_DATASETS_MAX) ||
+      (DataSetIndex >= sgl.GraphAry[GraphIndex].GraphDataSetCnt))
+    return (0);
+  if (DataCount > DataSize)
+    return (0);
+  if (DataFirst >= DataSize)
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr = DataPtr;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataSize = DataSize;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataFirst = DataFirst;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount = DataCount;
+  if ((XAxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (XAxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X]))
+    XAxisIndex = 0;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX = XAxisIndex;
+  if ((YAxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (YAxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y]))
+    YAxisIndex = 0;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY = YAxisIndex;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_RemoveDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((DataSetIndex >= GuiConst_GRAPH_DATASETS_MAX) ||
+      (DataSetIndex >= sgl.GraphAry[GraphIndex].GraphDataSetCnt))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount = 0;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataSize = 0;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_AddDataPoint(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex,
+   GuiConst_INT32S X,
+   GuiConst_INT32S Y)
+{
+  GuiConst_INT16U I;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((DataSetIndex >= GuiConst_GRAPH_DATASETS_MAX) ||
+      (DataSetIndex >= sgl.GraphAry[GraphIndex].GraphDataSetCnt))
+    return (0);
+  if (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount >=
+      sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataSize)
+    return (0);
+
+  I = (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataFirst +
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount) %
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataSize;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount++;
+
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[I].X = X;
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[I].Y = Y;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_ShowDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((DataSetIndex >= GuiConst_GRAPH_DATASETS_MAX) ||
+      (DataSetIndex >= sgl.GraphAry[GraphIndex].GraphDataSetCnt))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Visible = 1;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_HideDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((DataSetIndex >= GuiConst_GRAPH_DATASETS_MAX) ||
+      (DataSetIndex >= sgl.GraphAry[GraphIndex].GraphDataSetCnt))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Visible = 0;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_ShowXAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X]))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Visible = 1;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_HideXAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X]))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].Visible = 0;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_ShowYAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y]))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Visible = 1;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_HideYAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y]))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].Visible = 0;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_SetXAxisRange(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex,
+   GuiConst_INT32S MinValue,
+   GuiConst_INT32S MaxValue)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X]))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+     NumbersMinValue = MinValue;
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_X].
+     NumbersMaxValue = MaxValue;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_SetYAxisRange(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex,
+   GuiConst_INT32S MinValue,
+   GuiConst_INT32S MaxValue)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y]))
+    return (0);
+
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+     NumbersMinValue = MinValue;
+  sgl.GraphAry[GraphIndex].GraphAxes[AxisIndex][GuiLib_GRAPHAXIS_Y].
+     NumbersMaxValue = MaxValue;
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_ResetXAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex)
+{
+  GuiConst_INT8U AxisIndex1,AxisIndex2;
+  GuiConst_INT8U I;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if (AxisIndex == -1)
+  {
+    AxisIndex1 = 0;
+    AxisIndex2 = sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X] - 1;
+  }
+  else if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X]))
+    return (0);
+  else
+  {
+    AxisIndex1 = AxisIndex;
+    AxisIndex2 = AxisIndex;
+  }
+
+  for (I = AxisIndex1; I <= AxisIndex2; I++)
+  {
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].NumbersMinValue =
+       sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].NumbersMinValueOrg;
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].NumbersMaxValue =
+       sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].NumbersMaxValueOrg;
+  }
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_OffsetXAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex,
+   GuiConst_INT32S Offset)
+{
+  GuiConst_INT8U AxisIndex1,AxisIndex2;
+  GuiConst_INT8U I;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if (AxisIndex == -1)
+  {
+    AxisIndex1 = 0;
+    AxisIndex2 = sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X] - 1;
+  }
+  else if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X]))
+    return (0);
+  else
+  {
+    AxisIndex1 = AxisIndex;
+    AxisIndex2 = AxisIndex;
+  }
+
+  for (I = AxisIndex1; I <= AxisIndex2; I++)
+  {
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].NumbersMinValue += Offset;
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].NumbersMaxValue += Offset;
+  }
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_ResetYAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex)
+{
+  GuiConst_INT8U AxisIndex1,AxisIndex2;
+  GuiConst_INT8U I;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if (AxisIndex == -1)
+  {
+    AxisIndex1 = 0;
+    AxisIndex2 = sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y] - 1;
+  }
+  else if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y]))
+    return (0);
+  else
+  {
+    AxisIndex1 = AxisIndex;
+    AxisIndex2 = AxisIndex;
+  }
+
+  for (I = AxisIndex1; I <= AxisIndex2; I++)
+  {
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].NumbersMinValue =
+       sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].NumbersMinValueOrg;
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].NumbersMaxValue =
+       sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].NumbersMaxValueOrg;
+  }
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_OffsetYAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex,
+   GuiConst_INT32S Offset)
+{
+  GuiConst_INT8U AxisIndex1,AxisIndex2;
+  GuiConst_INT8U I;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if (AxisIndex == -1)
+  {
+    AxisIndex1 = 0;
+    AxisIndex2 = sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y] - 1;
+  }
+  else if ((AxisIndex >= GuiConst_GRAPH_AXES_MAX) ||
+      (AxisIndex >= sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y]))
+    return (0);
+  else
+  {
+    AxisIndex1 = AxisIndex;
+    AxisIndex2 = AxisIndex;
+  }
+
+  for (I = AxisIndex1; I <= AxisIndex2; I++)
+  {
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].NumbersMinValue += Offset;
+    sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].NumbersMaxValue += Offset;
+  }
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_Redraw(
+   GuiConst_INT8U GraphIndex)
+{
+  GuiConst_INT16S I;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_SetClipping(GraphIndex);
+#endif
+
+  GuiLib_Graph_DrawAxes(GraphIndex);
+
+  for (I = sgl.GraphAry[GraphIndex].GraphDataSetCnt - 1; I >= 0; I--)
+    GuiLib_Graph_DrawDataSet(GraphIndex, I);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_ResetClipping();
+#endif
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_DrawAxes(
+   GuiConst_INT8U GraphIndex)
+{
+  GuiConst_INT16S I;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_SetClipping(GraphIndex);
+#endif
+
+  if (!(sgl.GraphAry[GraphIndex].GraphItem.TextPar[0].BitFlags &
+        GuiLib_BITFLAG_TRANSPARENT))
+    GuiLib_FillBox(sgl.GraphAry[GraphIndex].GraphItem.X1,
+                   sgl.GraphAry[GraphIndex].GraphItem.Y1,
+                   sgl.GraphAry[GraphIndex].GraphItem.X2,
+                   sgl.GraphAry[GraphIndex].GraphItem.Y2,
+                   sgl.GraphAry[GraphIndex].GraphItem.BackColor);
+
+  for (I = sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_X] - 1;
+       I >= 0; I--)
+    if (sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_X].Visible)
+      Graph_DrawXAxis(GraphIndex, I);
+
+  for (I = sgl.GraphAry[GraphIndex].GraphAxesCnt[GuiLib_GRAPHAXIS_Y] - 1;
+       I >= 0; I--)
+    if (sgl.GraphAry[GraphIndex].GraphAxes[I][GuiLib_GRAPHAXIS_Y].Visible)
+      Graph_DrawYAxis(GraphIndex, I);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_ResetClipping();
+#endif
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_DrawDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex)
+{
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((DataSetIndex >= GuiConst_GRAPH_DATASETS_MAX) ||
+      (DataSetIndex >= sgl.GraphAry[GraphIndex].GraphDataSetCnt))
+    return (0);
+  if (!sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Visible)
+    return (0);
+  if (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataSize == 0)
+    return (0);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_SetClipping(GraphIndex);
+#endif
+
+  Graph_DrawDataSet(GraphIndex, DataSetIndex);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_ResetClipping();
+#endif
+
+  return (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Graph_DrawDataPoint(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex,
+   GuiConst_INT16U DataIndex)
+{
+  GuiConst_INT16S Y;
+  GuiConst_INT16S DX, DY;
+  GuiConst_INT16S LastDX, LastDY;
+  GuiConst_INT32S TX, TY;
+
+  if ((GraphIndex >= GuiConst_GRAPH_MAX) ||
+      (sgl.GraphAry[GraphIndex].InUse != GuiLib_GRAPH_STRUCTURE_USED))
+    return (0);
+  if ((DataSetIndex >= GuiConst_GRAPH_DATASETS_MAX) ||
+      (DataSetIndex >= sgl.GraphAry[GraphIndex].GraphDataSetCnt))
+    return (0);
+  if (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataSize == 0)
+    return (0);
+  if (!sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Visible)
+    return (0);
+  if (DataIndex >= sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount)
+    return (0);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_SetClipping(GraphIndex);
+#endif
+
+  Graph_CalcScaleX(GraphIndex,
+                   sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX);
+  Graph_CalcScaleY(GraphIndex,
+                   sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY);
+
+  TX = sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[DataIndex].X;
+  TY = sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[DataIndex].Y;
+  DX = sgl.GraphAry[GraphIndex].OrigoX + ((TX -
+       sgl.GraphAry[GraphIndex].GraphAxes[
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX]
+       [GuiLib_GRAPHAXIS_X].NumbersMinValue) *
+       sgl.GraphAry[GraphIndex].GraphAxes[
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX]
+       [GuiLib_GRAPHAXIS_X].Scale) / 10000;
+  DY = sgl.GraphAry[GraphIndex].OrigoY - ((TY -
+       sgl.GraphAry[GraphIndex].GraphAxes[
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY]
+       [GuiLib_GRAPHAXIS_Y].NumbersMinValue) *
+       sgl.GraphAry[GraphIndex].GraphAxes[
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY]
+       [GuiLib_GRAPHAXIS_Y].Scale) / 10000;
+  if (sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].Representation ==
+      GuiLib_GRAPH_DATATYPE_LINE)
+  {
+    if (DataIndex == 0)
+      DataIndex = sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataCount - 1;
+    else
+      DataIndex--;
+
+    TX =
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[DataIndex].X;
+    TY =
+       sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].DataPtr[DataIndex].Y;
+    LastDX = sgl.GraphAry[GraphIndex].OrigoX + ((TX -
+            sgl.GraphAry[GraphIndex].GraphAxes[
+            sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX]
+            [GuiLib_GRAPHAXIS_X].NumbersMinValue) *
+            sgl.GraphAry[GraphIndex].GraphAxes[
+            sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexX]
+            [GuiLib_GRAPHAXIS_X].Scale) / 10000;
+    LastDY = sgl.GraphAry[GraphIndex].OrigoY - ((TY -
+             sgl.GraphAry[GraphIndex].GraphAxes[
+             sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY]
+             [GuiLib_GRAPHAXIS_Y].NumbersMinValue) *
+             sgl.GraphAry[GraphIndex].GraphAxes[
+             sgl.GraphAry[GraphIndex].GraphDataSets[DataSetIndex].AxisIndexY]
+             [GuiLib_GRAPHAXIS_Y].Scale) / 10000;
+  }
+  else
+  {
+    LastDX = DX;
+    LastDY = DY;
+  }
+
+  Graph_DrawDataPoint(
+     GraphIndex,
+     DataSetIndex,
+     DataIndex,
+     DX, DY,
+     LastDX, LastDY);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  Graph_ResetClipping();
+#endif
+
+  return (1);
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+#endif // GuiConst_ITEM_GRAPH_INUSE
+
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+static GuiConst_INT16S IndexOfGraphicsLayer(
+   GuiConst_INT16S GraphicsLayerIndex)
+{
+  GuiConst_INT16S I;
+
+  if (GraphicsLayerIndex == GuiLib_GRAPHICS_LAYER_BASE)
+    return(GuiLib_GRAPHICS_LAYER_BASE);
+  else if (GraphicsLayerIndex == GuiLib_GRAPHICS_LAYER_PREVIOUS)
+  {
+    if (sgl.GraphicsLayerLifoCnt <= 1)
+      return(GuiLib_GRAPHICS_LAYER_BASE);
+    else
+      return(sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt - 2]);
+  }
+  else if (GraphicsLayerIndex == GuiLib_GRAPHICS_LAYER_CURRENT)
+  {
+    if (sgl.GraphicsLayerLifoCnt > 0)
+      return(sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt - 1]);
+    else
+      return(GuiLib_GRAPHICS_LAYER_BASE);
+  }
+  else if (GraphicsLayerIndex < 0)
+    return(GuiLib_GRAPHICS_LAYER_BASE);
+  else if (sgl.GraphicsLayerLifoCnt <= 1)
+    return(GuiLib_GRAPHICS_LAYER_BASE);
+  for (I = 0; I < sgl.GraphicsLayerLifoCnt; I++)
+    if (sgl.GraphicsLayerLifo[I] == GraphicsLayerIndex)
+      return(GraphicsLayerIndex);
+  return(GuiLib_GRAPHICS_LAYER_BASE);
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT8U GraphicsLayer_Push(
+   GuiConst_INT8U GraphicsLayerIndex)
+{
+  GuiConst_INT16S I;
+
+  if (GraphicsLayerIndex >= GuiConst_GRAPHICS_LAYER_MAX)
+    return(0);
+  if (sgl.GraphicsLayerList[GraphicsLayerIndex].InUse != GuiLib_GRAPHICS_LAYER_USED)
+    return(0);
+  if (sgl.GraphicsLayerLifoCnt == GuiConst_GRAPHICS_LAYER_MAX)
+    return(0);
+  for (I = 0; I < sgl.GraphicsLayerLifoCnt; I++)
+    if (sgl.GraphicsLayerLifo[I] == GraphicsLayerIndex)
+      return(0);
+
+  sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt] = GraphicsLayerIndex;
+  sgl.GraphicsLayerLifoCnt++;
+  sgl.GraphicsLayerList[GraphicsLayerIndex].BaseAddress =
+   &sgl.LayerBuf[(GuiConst_INT32U)ReadWord(
+   GuiStruct_GraphicsLayerOfs[GraphicsLayerIndex])];
+
+  sgl.CurLayerBufPtr = sgl.GraphicsLayerList[GraphicsLayerIndex].BaseAddress;
+  sgl.CurLayerLineSize = sgl.GraphicsLayerList[GraphicsLayerIndex].LineSize;
+  sgl.CurLayerWidth = sgl.GraphicsLayerList[GraphicsLayerIndex].Width;
+  sgl.CurLayerHeight = sgl.GraphicsLayerList[GraphicsLayerIndex].Height;
+  sgl.CurLayerBytes =
+     sgl.GraphicsLayerList[GraphicsLayerIndex].Height *
+     sgl.GraphicsLayerList[GraphicsLayerIndex].LineSize;
+  sgl.BaseLayerDrawing = 0;
+
+  return(1);
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT8U GraphicsLayer_Pop(
+   GuiConst_INT16S GraphicsLayerIndex)
+{
+  GuiConst_INT16S I;
+
+  if (GraphicsLayerIndex == GuiLib_GRAPHICS_LAYER_BASE)
+    sgl.GraphicsLayerLifoCnt = 0;
+  else if ((GraphicsLayerIndex == GuiLib_GRAPHICS_LAYER_PREVIOUS) &&
+           (sgl.GraphicsLayerLifoCnt > 0))
+  {
+    sgl.GraphicsLayerLifoCnt--;
+    GraphicsLayerIndex = sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt - 1];
+  }
+  else if (GraphicsLayerIndex < 0)
+    return(0);
+  else if (sgl.GraphicsLayerLifoCnt <= 1)
+    return(0);
+  else
+  {
+    for (I = sgl.GraphicsLayerLifoCnt - 2; I >= 0; I--)
+      if (sgl.GraphicsLayerLifo[I] == GraphicsLayerIndex)
+      {
+        sgl.GraphicsLayerLifoCnt = I + 1;
+        break;
+      }
+    if (I == -1)
+      return(0);
+  }
+
+  if (sgl.GraphicsLayerLifoCnt == 0)
+    ResetLayerBufPtr();
+  else
+  {
+    sgl.CurLayerBufPtr = sgl.GraphicsLayerList[GraphicsLayerIndex].BaseAddress;
+    sgl.CurLayerLineSize = sgl.GraphicsLayerList[GraphicsLayerIndex].LineSize;
+    sgl.CurLayerWidth = sgl.GraphicsLayerList[GraphicsLayerIndex].Width;
+    sgl.CurLayerHeight = sgl.GraphicsLayerList[GraphicsLayerIndex].Height;
+    sgl.CurLayerBytes =
+       sgl.GraphicsLayerList[GraphicsLayerIndex].Height *
+       sgl.GraphicsLayerList[GraphicsLayerIndex].LineSize;
+    sgl.BaseLayerDrawing = 0;
+  }
+
+  return(1);
+}
+
+//------------------------------------------------------------------------------
+static void GraphicsLayer_Copy(
+   GuiConst_INT8U *DestAddress,
+   GuiConst_INT16U DestLineSize,
+   GuiConst_INT16S DestX,
+   GuiConst_INT16S DestY,
+   GuiConst_INT8U *SourceAddress,
+   GuiConst_INT16U SourceLineSize,
+   GuiConst_INT16S SourceX,
+   GuiConst_INT16S SourceY,
+   GuiConst_INT16U Width,
+   GuiConst_INT16U Height)
+{
+  GuiConst_INT16S LineSize;
+
+  SourceAddress +=
+     SourceY * SourceLineSize + GuiConst_PIXEL_BYTE_SIZE * SourceX;
+  DestAddress += DestY * DestLineSize + GuiConst_PIXEL_BYTE_SIZE * DestX;
+  LineSize = GuiConst_PIXEL_BYTE_SIZE * Width;
+  while (Height > 0)
+  {
+    memcpy(DestAddress, SourceAddress, LineSize);
+    SourceAddress += SourceLineSize;
+    DestAddress += DestLineSize;
+    Height--;
+  }
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_GraphicsFilter_Init(
+   GuiConst_INT8U GraphicsFilterIndex,
+   void (*FilterFuncPtr)
+     (GuiConst_INT8U *DestAddress,
+      GuiConst_INT16U DestLineSize,
+      GuiConst_INT8U *SourceAddress,
+      GuiConst_INT16U SourceLineSize,
+      GuiConst_INT16U Width,
+      GuiConst_INT16U Height,
+      GuiConst_INT32S FilterPars[10]))
+{
+  if (GraphicsFilterIndex >= GuiConst_GRAPHICS_FILTER_MAX)
+    return (0);
+
+  sgl.GraphicsFilterList[GraphicsFilterIndex].GraphicsFilterFunc = FilterFuncPtr;
+
+  return (1);
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+#endif // GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+GuiConst_INT16S *TextBox_Scroll_GetPosRec(GuiConst_INT8U TextBoxIndex)
+{
+  GuiConst_INT16S I;
+  GuiConst_INT16S *result = NULL;
+
+  for (I=0;I<GuiConst_TEXTBOX_FIELDS_MAX;I++)
+  {
+    if (sgl.TextBoxScrollPositions[I].index == TextBoxIndex)
+    {
+      result = &sgl.TextBoxScrollPositions[I].pos;
+      break;
+    }
+  }
+
+  return result;
+}
+//------------------------------------------------------------------------------
+static GuiConst_INT16S TextBox_Scroll_CalcEndPos(
+   GuiLib_ItemRec PrefixLocate *TextBoxItem,
+   GuiConst_INT8U PerLine)
+{
+  GuiConst_INT16S H;
+
+  H = TextBoxItem->Y2 -
+      TextBoxItem->Y1 + 1;
+  if (PerLine)
+    return (TextBoxItem->CompPars.CompTextBox.LineDist *
+       (TextBoxItem->CompPars.CompTextBox.Lines -
+       (H / TextBoxItem->CompPars.CompTextBox.LineDist)));
+  else
+    return (TextBoxItem->CompPars.CompTextBox.Lines *
+       TextBoxItem->CompPars.CompTextBox.LineDist - H);
+}
+#endif // GuiConst_TEXTBOX_FIELDS_ON
+
+//------------------------------------------------------------------------------
+static GuiConst_INT8U TextBox_Scroll_To(
+   GuiConst_INT8U TextBoxIndex,
+   GuiConst_INT16S NewPos,
+   GuiConst_INT8U PerLine,
+   GuiConst_INT8U AbsoluteMove)
+{
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  GuiLib_ItemRec PrefixLocate *TextBoxItem;
+  GuiConst_INT16S TextBox;
+  GuiConst_INT16S PrefixLocate *ScrollPos;
+
+  TextBox = AutoRedraw_GetTextBox(TextBoxIndex, -1);
+
+  if (TextBox == -1)
+    return (0);
+
+  TextBoxItem = AutoRedraw_GetItem(TextBox);
+
+  if (TextBoxItem == NULL)
+    return (0);
+  else
+  {
+    ScrollPos = TextBox_Scroll_GetPosRec(TextBoxIndex);
+
+    if (ScrollPos == NULL)
+      return (0);
+
+    if (PerLine)
+      NewPos *= TextBoxItem->CompPars.CompTextBox.LineDist;
+
+    switch (AbsoluteMove)
+    {
+      case 0:
+        *ScrollPos += NewPos;
+        break;
+
+      case 1:
+        *ScrollPos = NewPos;
+        break;
+
+      case 2:
+        *ScrollPos = TextBox_Scroll_CalcEndPos(TextBoxItem, PerLine);
+        break;
+    }
+
+    TextBoxItem->CompPars.CompTextBox.ScrollPos = *ScrollPos;
+
+    memcpy(&sgl.CurItem, TextBoxItem, sizeof(GuiLib_ItemRec));
+
+    GuiDisplay_Lock();
+
+    sgl.DisplayLevel = 0;
+    sgl.SwapColors = 0;
+    DrawItem(GuiLib_COL_INVERT_OFF);
+
+    GuiDisplay_Unlock();
+    return (1);
+  }
+#else
+  gl.Dummy1_8U = TextBoxIndex;   // To avoid compiler warning
+  gl.Dummy1_16S = NewPos;   // To avoid compiler warning
+  gl.Dummy2_8U = PerLine;   // To avoid compiler warning
+  gl.Dummy3_8U = AbsoluteMove;   // To avoid compiler warning
+  return (0);
+#endif
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Up(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, -1, 1, 0));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Down(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, 1, 1, 0));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Home(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, 0, 1, 1));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_End(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, 0, 1, 2));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_To_Line(
+   GuiConst_INT8U TextBoxIndex,
+   GuiConst_INT16S NewLine)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, NewLine, 1, 1));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Up_Pixel(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, -1, 0, 0));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Down_Pixel(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, 1, 0, 0));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Home_Pixel(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, 0, 0, 1));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_End_Pixel(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, 0, 0, 2));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_To_PixelLine(
+   GuiConst_INT8U TextBoxIndex,
+   GuiConst_INT16S NewPixelLine)
+{
+  return (TextBox_Scroll_To(TextBoxIndex, NewPixelLine, 0, 1));
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT8U TextBox_Scroll_Get_Pos(
+   GuiConst_INT8U TextBoxIndex,
+   GuiConst_INT8U PerLine)
+{
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  GuiConst_INT16S P;
+  GuiLib_ItemRec PrefixLocate*TextBoxItem;
+  GuiConst_INT16S TextBox;
+  GuiConst_INT16S PrefixLocate *ScrollPos;
+
+  TextBox = AutoRedraw_GetTextBox(TextBoxIndex, -1);
+
+  if (TextBox == -1)
+    return (GuiLib_TEXTBOX_SCROLL_ILLEGAL_NDX);
+
+  TextBoxItem = AutoRedraw_GetItem(TextBox);
+
+  if (TextBoxItem == NULL)
+    return (GuiLib_TEXTBOX_SCROLL_ILLEGAL_NDX);
+
+  ScrollPos = TextBox_Scroll_GetPosRec(TextBoxIndex);
+
+  if (ScrollPos == NULL)
+    return (GuiLib_TEXTBOX_SCROLL_ILLEGAL_NDX);
+
+  P = TextBox_Scroll_CalcEndPos(TextBoxItem, PerLine);
+  if (*ScrollPos == 0)
+    return (GuiLib_TEXTBOX_SCROLL_AT_HOME);
+  else if (*ScrollPos == P)
+    return (GuiLib_TEXTBOX_SCROLL_AT_END);
+  else if (*ScrollPos < 0)
+    return (GuiLib_TEXTBOX_SCROLL_ABOVE_HOME);
+  else if (*ScrollPos > P)
+    return (GuiLib_TEXTBOX_SCROLL_BELOW_END);
+  else
+    return (GuiLib_TEXTBOX_SCROLL_INSIDE_BLOCK);
+
+#else
+  gl.Dummy1_8U = TextBoxIndex;   // To avoid compiler warning
+  gl.Dummy2_8U = PerLine;   // To avoid compiler warning
+  return (GuiLib_TEXTBOX_SCROLL_ILLEGAL_NDX);
+#endif
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Get_Pos(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_Get_Pos(TextBoxIndex, 1));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_Get_Pos_Pixel(
+   GuiConst_INT8U TextBoxIndex)
+{
+  return (TextBox_Scroll_Get_Pos(TextBoxIndex, 0));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_TextBox_Scroll_FitsInside(
+   GuiConst_INT8U TextBoxIndex)
+{
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  GuiLib_ItemRec PrefixLocate *TextBoxItem;
+  GuiConst_INT16S TextBox;
+  GuiConst_INT16S PrefixLocate *ScrollPos;
+
+  TextBox = AutoRedraw_GetTextBox(TextBoxIndex, -1);
+
+  if (TextBox == -1)
+    return (0);
+
+  TextBoxItem = AutoRedraw_GetItem(TextBox);
+
+  if (TextBoxItem == NULL)
+    return (0);
+
+  return (TextBox_Scroll_CalcEndPos(TextBoxItem, 0) < 0);
+#else
+  gl.Dummy1_8U = TextBoxIndex;   // To avoid compiler warning
+  return (0);
+#endif
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_SetButtonDisabledColor(GuiConst_INTCOLOR PixelColor)
+{
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+  sgl.ButtonColorOverride = GuiLib_TRUE;
+  sgl.DisabledButtonColor = PixelColor;
+#endif
+
+  return PixelColor;
+}
+//------------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiDisplay.c	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,742 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2014 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                       easyGUI display driver unit                        */
+/*                               v6.0.23.002                                */
+/*                                                                          */
+/* ************************************************************************ */
+
+#include "GuiConst.h"
+#include "GuiDisplay.h"
+#include "GuiLib.h"
+#include <stdlib.h>
+
+#define WANT_DOUBLE_BUFFERING // Also in GuiGraph16.h, GuiLib.c - *** all three must match ***
+
+#define USE_WAIT_MS
+#ifdef USE_WAIT_MS
+extern void EasyGUIWaitMs(GuiConst_INT32U msec); // in main.cpp
+#endif
+
+extern void SetupQSPIBitmapArray(int stageNumber); // In main.cpp
+
+// Make FRAME_ADDRESS able to be set at runtime, not hardcoded
+static unsigned long frameAddress = 0L;
+// Global function (actually called from the main function, in main.cpp) 
+// to set the frame address at startup
+void GuiDisplay_SetFrameAddress(void *newFrameAddress)
+{
+    // C/C++ is not happy copying a pointer value direct to an unsigned long
+    union {
+        void *ptrValue;
+        unsigned long ulValue;
+    } frameAddressUnion;
+    
+    frameAddressUnion.ptrValue = newFrameAddress;
+    
+    frameAddress = frameAddressUnion.ulValue;
+}
+
+// Select LCD controller type by removing double slashes
+//
+// Many of the drivers listed here supports more than one display controller.
+// To find your driver simply make a text search in this file. Omit eventual
+// letters after the display controller type number. Example: For an NJU6450A
+// display controller make a search for "NJU6450" - make sure it is a plain
+// text search, not a word search.
+//
+// If your display controller is not found you can contact support at
+// sales@ibissolutions.com. We will then quickly supply a driver for it.
+//
+// You only need to use the relevant display driver, all others may be deleted.
+// Make a copy of this file before modifying it.
+//
+// -----------------------------------------------------------------------------
+// #define LCD_CONTROLLER_TYPE_AT32AP7000
+// #define LCD_CONTROLLER_TYPE_AT91RM9200_ST7565
+// #define LCD_CONTROLLER_TYPE_AT91SAM9263
+// #define LCD_CONTROLLER_TYPE_BVGP
+// #define LCD_CONTROLLER_TYPE_D51E5TA7601
+// #define LCD_CONTROLLER_TYPE_F5529
+// #define LCD_CONTROLLER_TYPE_FLEVIPER
+// #define LCD_CONTROLLER_TYPE_FSA506
+// #define LCD_CONTROLLER_TYPE_H8S2378
+// #define LCD_CONTROLLER_TYPE_HD61202_2H
+// #define LCD_CONTROLLER_TYPE_HD61202_4H
+// #define LCD_CONTROLLER_TYPE_HD61202_2H2V
+// #define LCD_CONTROLLER_TYPE_HX8238_AT32AP7000
+// #define LCD_CONTROLLER_TYPE_HX8238_TMP92CH21
+// #define LCD_CONTROLLER_TYPE_HX8312
+// #define LCD_CONTROLLER_TYPE_HX8345
+// #define LCD_CONTROLLER_TYPE_HX8346
+// #define LCD_CONTROLLER_TYPE_HX8347
+// #define LCD_CONTROLLER_TYPE_HX8347G
+// #define LCD_CONTROLLER_TYPE_HX8352A
+// #define LCD_CONTROLLER_TYPE_ILI9341
+// #define LCD_CONTROLLER_TYPE_K70
+// #define LCD_CONTROLLER_TYPE_LC7981
+// #define LCD_CONTROLLER_TYPE_LS027
+// #define LCD_CONTROLLER_TYPE_LS044
+// #define LCD_CONTROLLER_TYPE_LH155BA
+// #define LCD_CONTROLLER_TYPE_LH75401
+// #define LCD_CONTROLLER_TYPE_LH7A400
+// #define LCD_CONTROLLER_TYPE_LPC1788
+// #define LCD_CONTROLLER_TYPE_LPC1850
+// #define LCD_CONTROLLER_TYPE_LPC2478
+// #define LCD_CONTROLLER_TYPE_LPC3230
+#define LCD_CONTROLLER_TYPE_LPC408X
+// #define LCD_CONTROLLER_TYPE_MPC5606S
+// #define LCD_CONTROLLER_TYPE_MX257
+// #define LCD_CONTROLLER_TYPE_NJU6450A
+// #define LCD_CONTROLLER_TYPE_NT39016D
+// #define LCD_CONTROLLER_TYPE_NT75451
+// #define LCD_CONTROLLER_TYPE_OTM2201A
+// #define LCD_CONTROLLER_TYPE_PCF8548
+// #define LCD_CONTROLLER_TYPE_PCF8813
+// #define LCD_CONTROLLER_TYPE_PIC24FJ256
+// #define LCD_CONTROLLER_TYPE_PXA320
+// #define LCD_CONTROLLER_TYPE_R61509
+// #define LCD_CONTROLLER_TYPE_R61526
+// #define LCD_CONTROLLER_TYPE_R61580
+// #define LCD_CONTROLLER_TYPE_RA8822
+// #define LCD_CONTROLLER_TYPE_RA8875
+// #define LCD_CONTROLLER_TYPE_S1D13505
+// #define LCD_CONTROLLER_TYPE_S1D13506
+// #define LCD_CONTROLLER_TYPE_S1D13700
+// #define LCD_CONTROLLER_TYPE_S1D13705
+// #define LCD_CONTROLLER_TYPE_S1D13706
+// #define LCD_CONTROLLER_TYPE_S1D13715
+// #define LCD_CONTROLLER_TYPE_S1D13743
+// #define LCD_CONTROLLER_TYPE_S1D13748
+// #define LCD_CONTROLLER_TYPE_S1D13781
+// #define LCD_CONTROLLER_TYPE_S1D13781_DIRECT
+// #define LCD_CONTROLLER_TYPE_S1D13A04
+// #define LCD_CONTROLLER_TYPE_S1D13A05
+// #define LCD_CONTROLLER_TYPE_S1D15721
+// #define LCD_CONTROLLER_TYPE_S6B0741
+// #define LCD_CONTROLLER_TYPE_S6B33BL
+// #define LCD_CONTROLLER_TYPE_S6D0139
+// #define LCD_CONTROLLER_TYPE_S6E63D6
+// #define LCD_CONTROLLER_TYPE_SBN1661_2H_SBN0080
+// #define LCD_CONTROLLER_TYPE_SED1335
+// #define LCD_CONTROLLER_TYPE_SEPS525
+// #define LCD_CONTROLLER_TYPE_SH1101A
+// #define LCD_CONTROLLER_TYPE_SH1123
+// #define LCD_CONTROLLER_TYPE_SPFD5408
+// #define LCD_CONTROLLER_TYPE_SPLC502
+// #define LCD_CONTROLLER_TYPE_SSD0323
+// #define LCD_CONTROLLER_TYPE_SSD1289
+// #define LCD_CONTROLLER_TYPE_SSD1305
+// #define LCD_CONTROLLER_TYPE_SSD1322
+// #define LCD_CONTROLLER_TYPE_SSD1339
+// #define LCD_CONTROLLER_TYPE_SSD1815
+// #define LCD_CONTROLLER_TYPE_SSD1815_2H
+// #define LCD_CONTROLLER_TYPE_SSD1848
+// #define LCD_CONTROLLER_TYPE_SSD1858
+// #define LCD_CONTROLLER_TYPE_SSD1926
+// #define LCD_CONTROLLER_TYPE_SSD1963
+// #define LCD_CONTROLLER_TYPE_SSD2119
+// #define LCD_CONTROLLER_TYPE_ST7529
+// #define LCD_CONTROLLER_TYPE_ST7541
+// #define LCD_CONTROLLER_TYPE_ST7561
+// #define LCD_CONTROLLER_TYPE_ST7565
+// #define LCD_CONTROLLER_TYPE_ST7586
+// #define LCD_CONTROLLER_TYPE_ST7637
+// #define LCD_CONTROLLER_TYPE_ST7715
+// #define LCD_CONTROLLER_TYPE_ST7920
+// #define LCD_CONTROLLER_TYPE_STM32F429
+// #define LCD_CONTROLLER_TYPE_T6963
+// #define LCD_CONTROLLER_TYPE_TLS8201
+// #define LCD_CONTROLLER_TYPE_TMPA900
+// #define LCD_CONTROLLER_TYPE_TS7390
+// #define LCD_CONTROLLER_TYPE_UC1608
+// #define LCD_CONTROLLER_TYPE_UC1610
+// #define LCD_CONTROLLER_TYPE_UC1611
+// #define LCD_CONTROLLER_TYPE_UC1617
+// #define LCD_CONTROLLER_TYPE_UC1698
+// #define LCD_CONTROLLER_TYPE_UPD161607
+// #define LCD_CONTROLLER_TYPE_UC1701
+
+// ============================================================================
+//
+// COMMON PART - NOT DEPENDENT ON DISPLAY CONTROLLER TYPE
+//
+// Do not delete this part of the GuiDisplay.c file.
+//
+// If your operating system uses pre-emptive execution, i.e. it interrupts tasks
+// at random instances, and transfers control to other tasks, display writing
+// must be protected from this, by writing code for the two protection
+// functions:
+//
+//   o  GuiDisplay_Lock     Prevent the OS from switching tasks
+//   o  GuiDisplay_Unlock   Open up normal task execution again
+//
+// If your operating system does not use pre-emptive execution, i.e. if you
+// must specifically release control in one tasks in order for other tasks to
+// be serviced, or if you don't employ an operating system at all, you can just
+// leave the two protection functions empty. Failing to write proper code for
+// the protection functions will result in a system with unpredictable
+// behavior.
+//
+// ============================================================================
+
+void GuiDisplay_Lock (void)
+{
+}
+
+void GuiDisplay_Unlock (void)
+{
+}
+
+// ============================================================================
+//
+// DISPLAY DRIVER PART
+//
+// You only need to use the relevant display driver, all others may be deleted.
+// Modify the driver so that it fits your specific hardware.
+// Make a copy of this file before modifying it.
+//
+// ============================================================================
+
+#ifdef LCD_CONTROLLER_TYPE_LPC408X
+
+// ============================================================================
+//
+// LPC408x MICROCONTROLLER WITH BUILT-IN DISPLAY CONTROLLER
+//
+// This driver uses internal LCD controller of LPC408x microcontroller.
+// LCD driver of LPC408x in 24 bit RGB parallel interface for TFT type
+// display or 4bit parallel interface for STN type display.
+// Graphic modes up to 1024x768 pixels.
+//
+// Compatible display controllers:
+//   None
+//
+// easyGUI setup should be (Parameters window, Display controller tab page):
+//   Horizontal bytes
+//   Bit 0 at right
+//   Number of color planes: 1
+//   Color mode: Grayscale, palette or RGB
+//   Color depth: 1 bit (B/W), 8 bits, 16 bits, 24 bits
+//   Display orientation: Normal, Upside down, 90 degrees left, 90 degrees right
+//   Display words with reversed bytes: Off
+//   Number of display controllers, horizontally: 1
+//   Number of display controllers, vertically: 1
+//
+// Port addresses (Px.x) must be altered to correspond to your microcontroller
+// hardware and compiler syntax.
+//
+// ============================================================================
+
+// Hardware connection for TFT display
+// LPC408x                        generic TFT display
+// LCD_FP               -         VSYNC
+// LCD_LP               -         HSYNC
+// LCD_LE               -         Line End
+// LCD_DCLK             -         Pixel CLK
+// LCD_ENAB_M           -         DATA_ENABLE
+// LCD_VD[0-7]          -         R0-R7 (for 16bit RGB mode connect R0,R1,R2 to 0)
+// LCD_VD[8-15]         -         G0-G7 (for 16bit RGB mode connect G0,G1 to 0)
+// LCD_VD[16-23]        -         B0-B7 (for 16bit RGB mode connect B0,B1,B2 to 0)
+
+// Hardware connection for STN display
+// LCD_PWR              -         DISP
+// LCD_DCLK             -         CL2
+// LCD_FP               -         Frame Pulse
+// LCD_LP               -         Line Sync Pulse
+// LCD_LE               -         Line End
+// LCD_VD[3:0]          -         UD[3:0]
+
+// Power Control registers
+#define PCONP          (*(volatile unsigned long *)0x400FC0C4)
+// LCD controller power control bit
+#define PCLCD          0
+
+// Pin setup registers (IOCON)
+#define IOCON_P0_4         (*(volatile unsigned long *)0x4002C010)
+#define IOCON_P0_5         (*(volatile unsigned long *)0x4002C014)
+#define IOCON_P0_6         (*(volatile unsigned long *)0x4002C018)
+#define IOCON_P0_7         (*(volatile unsigned long *)0x4002C01C)
+#define IOCON_P0_8         (*(volatile unsigned long *)0x4002C020)
+#define IOCON_P0_9         (*(volatile unsigned long *)0x4002C024)
+#define IOCON_P1_20        (*(volatile unsigned long *)0x4002C0D0)
+#define IOCON_P1_21        (*(volatile unsigned long *)0x4002C0D4)
+#define IOCON_P1_22        (*(volatile unsigned long *)0x4002C0D8)
+#define IOCON_P1_23        (*(volatile unsigned long *)0x4002C0DC)
+#define IOCON_P1_24        (*(volatile unsigned long *)0x4002C0E0)
+#define IOCON_P1_25        (*(volatile unsigned long *)0x4002C0E4)
+#define IOCON_P1_26        (*(volatile unsigned long *)0x4002C0E8)
+#define IOCON_P1_27        (*(volatile unsigned long *)0x4002C0EC)
+#define IOCON_P1_28        (*(volatile unsigned long *)0x4002C0F0)
+#define IOCON_P1_29        (*(volatile unsigned long *)0x4002C0F4)
+#define IOCON_P2_0         (*(volatile unsigned long *)0x4002C100)
+#define IOCON_P2_1         (*(volatile unsigned long *)0x4002C104)
+#define IOCON_P2_2         (*(volatile unsigned long *)0x4002C108)
+#define IOCON_P2_3         (*(volatile unsigned long *)0x4002C10C)
+#define IOCON_P2_4         (*(volatile unsigned long *)0x4002C110)
+#define IOCON_P2_5         (*(volatile unsigned long *)0x4002C114)
+#define IOCON_P2_6         (*(volatile unsigned long *)0x4002C118)
+#define IOCON_P2_7         (*(volatile unsigned long *)0x4002C11C)
+#define IOCON_P2_8         (*(volatile unsigned long *)0x4002C120)
+#define IOCON_P2_9         (*(volatile unsigned long *)0x4002C124)
+#define IOCON_P2_11        (*(volatile unsigned long *)0x4002C12C)
+#define IOCON_P2_12        (*(volatile unsigned long *)0x4002C130)
+#define IOCON_P2_13        (*(volatile unsigned long *)0x4002C134)
+#define IOCON_P4_28        (*(volatile unsigned long *)0x4002C270)
+#define IOCON_P4_29        (*(volatile unsigned long *)0x4002C274)
+
+// LCD Port Enable
+#define LCDPE           1
+
+// LCD controller registers
+// LCD configuration register
+#define LCD_CFG         (*(volatile unsigned long *)0x400FC1B8)
+
+// LCD Controller Base Address
+#define LCD_BASE       0x20088000
+
+// Horizontal Timing Control
+#define LCD_TIMH       (*(volatile unsigned long *)(LCD_BASE+0x000))
+// Vertical Timing Control
+#define LCD_TIMV       (*(volatile unsigned long *)(LCD_BASE+0x004))
+// Clock and Signal Polarity Control register
+#define LCD_POL        (*(volatile unsigned long *)(LCD_BASE+0x008))
+// Line End Control register
+#define LCD_LE         (*(volatile unsigned long *)(LCD_BASE+0x00C))
+// Upper Panel Frame Base Address register
+#define LCD_UPBASE     (*(volatile unsigned long *)(LCD_BASE+0x010))
+// Lower Panel Frame Base Address register
+#define LCD_LPBASE     (*(volatile unsigned long *)(LCD_BASE+0x014))
+// LCD Control register
+#define LCD_CTRL       (*(volatile unsigned long *)(LCD_BASE+0x018))
+// Interrupt Mask register
+#define LCD_INTMSK     (*(volatile unsigned long *)(LCD_BASE+0x01C))
+// Raw Interrupt Status register
+#define LCD_INTRAW     (*(volatile unsigned long *)(LCD_BASE+0x020))
+// Masked Interrupt Status register
+#define LCD_INTSTAT    (*(volatile unsigned long *)(LCD_BASE+0x024))
+// Interrupt Clear register
+#define LCD_INTCLR     (*(volatile unsigned long *)(LCD_BASE+0x028))
+// Upper Panel Current Address Value register
+#define LCD_UPCURR     (*(volatile unsigned long *)(LCD_BASE+0x02C))
+// Lower Panel Current Address Value register
+#define LCD_LPCURR     (*(volatile unsigned long *)(LCD_BASE+0x030))
+// 256x16-bit Color Palette registers
+#define LCD_PAL        (*(volatile unsigned long *)(LCD_BASE+0x200))
+// Cursor Image registers
+#define CRSR_IMG       (*(volatile unsigned long *)(LCD_BASE+0x800))
+// Cursor Control register
+#define CRSR_CTRL      (*(volatile unsigned long *)(LCD_BASE+0xC00))
+
+// LCD controller enable bit
+#define LCDEN          0
+// LCD controller power bit
+#define LCDPWR         11
+// Bypass pixel clock divider - for TFT display must be 1
+#ifdef GuiConst_COLOR_DEPTH_1
+#define BCD            0
+#else
+#define BCD            1
+#endif
+// Adjust these values according your display
+// PLL clock prescaler selection - only odd numbers 0,1,3,5,..255
+// 0 - PLL/1, 1 - PLL/2, 3 - PLL/4
+#define PLLDIV         0
+// LCD panel clock prescaler selection,  range 0 - 31
+// LCD freq = MCU freq /(CLKDIV+1)
+#define CLKDIV         7
+// Horizontal back porch in pixels, range 3 - 256
+#ifdef GuiConst_COLOR_DEPTH_1
+#define HBP            5
+#else
+#define HBP            40
+#endif
+// Horizontal front porch in pixels, range 3 - 256
+#ifdef GuiConst_COLOR_DEPTH_1
+#define HFP            5
+#else
+#define HFP            79
+#endif
+// Horizontal synchronization pulse width in pixels, range 3 - 256
+#ifdef GuiConst_COLOR_DEPTH_1
+#define HSW            3
+#else
+#define HSW            48
+#endif
+// Pixels-per-line in pixels, must be multiple of 16
+#define PPL            GuiConst_DISPLAY_WIDTH_HW
+// Vertical back porch in lines, range 1 - 256
+#ifdef GuiConst_COLOR_DEPTH_1
+#define VBP            2
+#else
+#define VBP            29
+#endif
+// Vertical front porch in lines, range 1 - 256
+#ifdef GuiConst_COLOR_DEPTH_1
+#define VFP            2
+#else
+#define VFP            40
+#endif
+// Vertical synchronization pulse width in lines, range 1 - 31
+#ifdef GuiConst_COLOR_DEPTH_1
+#define VSW            1
+#else
+#define VSW            3
+#endif
+// Lines per panel
+#define LPP            GuiConst_BYTE_LINES
+// Clocks per line
+#ifdef GuiConst_COLOR_DEPTH_1
+#define CPL            GuiConst_DISPLAY_WIDTH_HW/4
+#else
+#define CPL            GuiConst_DISPLAY_WIDTH_HW
+#endif
+// Invert output enable
+// 0 = LCDENAB output pin is active HIGH in TFT mode
+// 1 = LCDENAB output pin is active LOW in TFT mode
+#define IOE            0
+// Invert panel clock
+// 0 = Data is driven on the LCD data lines on the rising edge of LCDDCLK
+// 1 = Data is driven on the LCD data lines on the falling edge of LCDDCLK
+#define IPC            0
+// Invert horizontal synchronization
+// 0 = LCDLP pin is active HIGH and inactive LOW
+// 1 = LCDLP pin is active LOW and inactive HIGH
+#ifdef GuiConst_COLOR_DEPTH_1
+#define IHS            0
+#else
+#define IHS            1
+#endif
+// IVS Invert vertical synchronization
+// 0 = LCDFP pin is active HIGH and inactive LOW
+// 1 = LCDFP pin is active LOW and inactive HIGH
+#ifdef GuiConst_COLOR_DEPTH_1
+#define IVS            0
+#else
+#define IVS            1
+#endif
+// Lower five bits of panel clock divisor
+#define PCD_LO         2
+// CLKSEL Clock Select
+// 0 = the clock source for the LCD block is CCLK
+// 1 = the clock source for the LCD block is LCD_DCLK
+#define CLKSEL         0
+
+/****************************************************************************/
+/* IMPORTANT!!!                                                             */
+/****************************************************************************/
+// Set start address of frame buffer in RAM memory
+// 0x4000 0000 - 0x4000 FFFF RAM (64 kB)
+// 0x8000 0000 - 0x80FF FFFF Static memory bank 0 (16 MB)
+// 0x8100 0000 - 0x81FF FFFF Static memory bank 1 (16 MB)
+// 0xA000 0000 - 0xAFFF FFFF Dynamic memory bank 0 (256 MB)
+// 0xB000 0000 - 0xBFFF FFFF Dynamic memory bank 1 (256 MB)
+//#define FRAME_ADDRESS  0xA0000008
+//#define FRAME_ADDRESS  0xA00017D8 // As of 26 Oct 2016
+#define FRAME_ADDRESS (frameAddress) // Use the static variable set at the top of this file
+/****************************************************************************/
+
+// Address of pallete registers
+#define PALETTE_RAM_ADDR LCD_PAL
+
+// Delay routine
+// This constant must be adjusted according to speed of microcontroller
+#define ONE_MS               100
+// Param msec is delay in miliseconds
+void millisecond_delay(GuiConst_INT32U msec)
+{
+#ifdef USE_WAIT_MS
+  EasyGUIWaitMs(msec);
+#else
+  GuiConst_INT32U j;
+
+  for (j = 0; j < (ONE_MS * msec) ; j++);
+#endif
+}
+
+// Initialises the module and the display
+void GuiDisplay_Init (void)
+{
+//  return; // Test - do we need any display initialisation here? Let the BIOS do it?
+          // No flickering - but red and blue reversed (again)
+// So - can we reinstate some of the code in this function, and get the red and blue 
+// the correct way round without flickering?
+//#define ALLOW_LPC4088_INIT
+// Now allowing initialisation of the LCD control register even with ALLOW_LPC4088_INIT not #defined.
+// This appears to have eliminated the flickering while keeping the red and blue components 
+// the correct way round.
+  
+  GuiConst_INT32U i;
+#ifdef GuiConst_COLOR_DEPTH_24
+  GuiConst_INT32U *framePtr;
+#else
+#ifdef GuiConst_COLOR_DEPTH_16
+  GuiConst_INT16U *framePtr;
+#else
+  GuiConst_INT32U PaletteData;
+  GuiConst_INT8U *framePtr;
+  GuiConst_INT32U * pDst;
+#endif
+#endif
+
+//  SetupQSPIBitmapArray(1);
+
+/**************************************************/
+/* Carefully adjust the IO pins for your system   */
+/* Following settings for TFT panel 16/24 bit     */
+/**************************************************/
+
+/* *** DEBUG *** COMMENT OUT THIS BLOCK OF CODE - WHAT HAPPENS?
+// PI         SETTING     RGB888      RGB565
+  IOCON_P1_29  |= 7;   // BLUE7       BLUE4
+  IOCON_P1_28  |= 7;   // BLUE6       BLUE3
+  IOCON_P1_27  |= 7;   // BLUE5       BLUE2
+  IOCON_P1_26  |= 7;   // BLUE4       BLUE1
+  IOCON_P2_13  |= 7;   // BLUE3       BLUE0
+  //IOCON_P2_12  |= 7;   // BLUE2       -       !! Comment out for RGB565
+  //IOCON_P0_9   |= 7;   // BLUE1       -       !! Comment out for RGB565
+  //IOCON_P0_8   |= 7;   // BLUE0       -       !! Comment out for RGB565
+  IOCON_P1_25  |= 7;   // GREEN7      GREEN5
+  IOCON_P1_24  |= 7;   // GREEN6      GREEN4
+  IOCON_P1_23  |= 7;   // GREEN5      GREEN3
+  IOCON_P1_22  |= 7;   // GREEN4      GREEN2
+  IOCON_P1_21  |= 7;   // GREEN3      GREEN1
+  IOCON_P1_20  |= 7;   // GREEN2      GREEN0
+  //IOCON_P0_7   |= 7;   // GREEN1      -       !! Comment out for RGB565
+  //IOCON_P0_6   |= 7;   // GREEN0      -       !! Comment out for RGB565
+  IOCON_P2_9   |= 7;   // RED7        RED4
+  IOCON_P2_8   |= 7;   // RED6        RED3
+  IOCON_P2_7   |= 7;   // RED5        RED2
+  IOCON_P2_6   |= 7;   // RED4        RED1
+  //IOCON_P4_29  |= 7;   // RED3        -       !! Comment out for RGB565
+  IOCON_P2_12  |= 5;   // -           RED0  !! Comment out for RGB888 !!
+  //IOCON_P4_28  |= 7;   // RED2        -       !! Comment out for RGB565
+  //IOCON_P0_5   |= 7;   // RED1        -       !! Comment out for RGB565
+  //IOCON_P0_4   |= 7;   // RED0        -       !! Comment out for RGB565
+  IOCON_P2_5   |= 7;   // LCD_LP      LCD_LP
+  IOCON_P2_4   |= 7;   // LCD_ENAB_M  LCD_ENAB_M
+  IOCON_P2_3   |= 7;   // LCD_FP      LCD_FP
+  IOCON_P2_2   |= 7;   // LCD_DCLK    LCD_DCLK
+  IOCON_P2_1   |= 7;   // LCD_LE      LCD_LE
+  IOCON_P2_0   |= 7;   // LCD_PWR     LCD_PWR
+  IOCON_P2_11  |= 7;   // LCD_CLKIN   LCD_CLKIN
+*/ // DEBUG - ANSWER - *** EVERYTHING STILL APPEARS TO WORK ***
+
+/**************************************************/
+
+//  SetupQSPIBitmapArray(2);
+  
+#ifdef ALLOW_LPC4088_INIT
+  // Disable power
+  LCD_CTRL &= ~(1 << LCDEN);
+  millisecond_delay(100);
+  LCD_CTRL &= ~(1 << LCDPWR);
+  
+  // ====================================
+  // Initialize Clock(PLL),EMC and SDRAM!
+  // ====================================
+
+  // Enable LCD controller
+  PCONP |= 1<<PCLCD;
+
+  // LCD Configuration init pixel clock
+  LCD_CFG |= (CLKDIV);
+
+  // Horizontal Timing register
+  LCD_TIMH |= ((HBP-1) << 24)|((HFP-1) << 16)|((HSW-1) << 8)|((PPL/16-1) << 2);
+
+  // Vertical Timing register
+  LCD_TIMV |= (VBP << 24)|(VFP << 16)|((VSW-1) << 10)|(LPP-1);
+
+  // Clock and Signal Polarity register
+  LCD_POL |= (BCD << 26)|((CPL-1) << 16)|(IOE << 14)|(IPC << 13)|
+             (IHS << 12)|(IVS << 11)|(CLKSEL << 5)| PCD_LO;
+
+  LCD_LE = 0;
+  LCD_INTMSK = 0;
+
+#endif // ALLOW_LPC4088_INIT
+// If we include the initialisation of the LCD control register,
+// does this get red and blue the correct way round without flickering?
+
+  // LCD Control register
+#ifdef GuiConst_COLOR_DEPTH_24
+  // TFT single panel,24bit, normal output
+  LCD_CTRL = 0x0000002A;
+#else
+#ifdef GuiConst_COLOR_DEPTH_16
+  // TFT single panel,16bit, normal output (BGR)
+  LCD_CTRL = 0x0000102C;
+#else
+#ifdef GuiConst_COLOR_DEPTH_8
+  // TFT single panel,8bit, normal output
+  LCD_CTRL = 0x00000026;
+#else
+  // STN single panel, monochrome, 4bit bus, normal output
+  LCD_CTRL = 0x00000010;
+#endif
+#endif
+#endif
+
+
+#ifdef GuiConst_COLOR_DEPTH_24
+  framePtr = (GuiConst_INT32U *)FRAME_ADDRESS;
+#else
+#ifdef GuiConst_COLOR_DEPTH_16
+  framePtr = (GuiConst_INT16U *)FRAME_ADDRESS;
+#else
+  framePtr = (GuiConst_INT8U *)FRAME_ADDRESS;
+  pDst = (GuiConst_INT32U *)PALETTE_RAM_ADDR;
+  for (i = 0; i < 128; i++)
+  {
+#ifdef GuiConst_COLOR_DEPTH_1
+    PaletteData = 0xFFFF0000;
+#else
+    PaletteData = GuiStruct_Palette[2*i][0];
+    PaletteData |= (GuiConst_INT32U)GuiStruct_Palette[2*i][1]<<8;
+    PaletteData |= (GuiConst_INT32U)GuiStruct_Palette[2*i+1][0]<<16;
+    PaletteData |= (GuiConst_INT32U)GuiStruct_Palette[2*i+1][1]<<24;
+#endif
+    *pDst++ = PaletteData;
+  }
+#endif
+#endif
+
+  // Clear frame buffer by copying the data into frame buffer
+#ifdef GuiConst_COLOR_DEPTH_24
+  for (i = 0; i < GuiConst_DISPLAY_BYTES/3; i++)
+    *framePtr++ = 0x00000000; // Color
+#else
+#ifdef GuiConst_COLOR_DEPTH_16
+    for (i = 0; i < GuiConst_DISPLAY_BYTES/2; i++)
+    *framePtr++ = 0x0000; // Color
+#else
+  for (i = 0; i < GuiConst_DISPLAY_BYTES; i++)
+    *framePtr++ = 0x00;  // Color
+#endif
+#endif
+
+//  LCD_CFG = 0;
+
+  millisecond_delay(100);
+  // Power-up sequence
+  LCD_CTRL |= 1<<LCDEN;
+  // Apply contrast voltage to LCD panel
+  // (not controlled or supplied by the LCD controller)
+  millisecond_delay(100);
+  LCD_CTRL |= 1<<LCDPWR;
+
+  // Set start address of frame buffer in RAM memory
+  LCD_LPBASE = FRAME_ADDRESS;
+  LCD_UPBASE = FRAME_ADDRESS;
+}
+
+#ifdef WANT_DOUBLE_BUFFERING
+// *** Need complete GuiDisplay_Refresh ***
+
+// Refreshes display buffer to display
+void GuiDisplay_Refresh (void)
+{
+  GuiConst_INT32U Pixel, X, Y, LastByte;
+#ifdef GuiConst_COLOR_DEPTH_24
+  GuiConst_INT32U *framePtr;
+#else
+#ifdef GuiConst_COLOR_DEPTH_16
+  GuiConst_INT16U *framePtr;
+#else
+  // Valid also for monochrome STN display
+  GuiConst_INT8U *framePtr;
+#endif
+#endif
+
+  GuiDisplay_Lock ();
+
+  // Walk through all lines
+  for (Y = 0; Y < GuiConst_BYTE_LINES; Y++)
+  {
+    if (GuiLib_DisplayRepaint[Y].ByteEnd >= 0)
+    // Something to redraw in this line
+    {
+#ifdef GuiConst_COLOR_DEPTH_24
+      // Set video ram base address
+      framePtr = (GuiConst_INT32U *)FRAME_ADDRESS;
+      // Pointer offset calculation
+      framePtr += Y * GuiConst_BYTES_PR_LINE/3 +
+                  GuiLib_DisplayRepaint[Y].ByteBegin;
+      // Set amount of data to be changed
+      LastByte = GuiConst_BYTES_PR_LINE/3 - 1;
+#else
+#ifdef GuiConst_COLOR_DEPTH_16
+      // Set video ram base address
+      framePtr = (GuiConst_INT16U *)FRAME_ADDRESS;
+      // Pointer offset calculation
+      framePtr += Y * GuiConst_BYTES_PR_LINE/2 +
+                  GuiLib_DisplayRepaint[Y].ByteBegin;
+      // Set amount of data to be changed
+      LastByte = GuiConst_BYTES_PR_LINE/2 - 1;
+#else
+      // Valid also for monochrome STN display
+      // Set video ram base address
+      framePtr = (GuiConst_INT8U *)FRAME_ADDRESS;
+      // Pointer offset calculation
+      framePtr += Y * GuiConst_BYTES_PR_LINE +
+                  GuiLib_DisplayRepaint[Y].ByteBegin;
+      // Set amount of data to be changed
+      LastByte = GuiConst_BYTES_PR_LINE - 1;
+#endif
+#endif
+      if (GuiLib_DisplayRepaint[Y].ByteEnd < LastByte)
+        LastByte = GuiLib_DisplayRepaint[Y].ByteEnd;
+
+      // Write data for one line to framebuffer from GuiLib_DisplayBuf
+#ifdef GuiConst_COLOR_DEPTH_24
+      for (X = GuiLib_DisplayRepaint[Y].ByteBegin * 3;
+               X <= (LastByte * 3 + 2);
+               X = X + 3)
+      {
+        Pixel = GuiLib_DisplayBuf[Y][X];
+        Pixel |= (GuiConst_INT32U)GuiLib_DisplayBuf[Y][X+1]<<8;
+        Pixel |= (GuiConst_INT32U)GuiLib_DisplayBuf[Y][X+2]<<16;
+        *framePtr++ = Pixel;
+      }
+#else
+#ifdef GuiConst_COLOR_DEPTH_16
+      for (X = GuiLib_DisplayRepaint[Y].ByteBegin; X <= LastByte; X++)
+      {
+        *framePtr++ = GuiLib_DisplayBuf.Words[Y][X];
+      }
+#else
+      // Valid also for monochrome STN display
+      for (X = GuiLib_DisplayRepaint[Y].ByteBegin; X <= LastByte; X++)
+        *framePtr++ = GuiLib_DisplayBuf[Y][X];
+#endif
+#endif
+      // Reset repaint parameters
+      GuiLib_DisplayRepaint[Y].ByteEnd = -1;
+    }
+  }
+  GuiDisplay_Unlock ();
+}
+
+#else // WANT_DOUBLE_BUFFERING
+
+// We are already writing direct to the display - 
+// GuiDisplay_Refresh does not need to do anything
+// (but other code still expects it to exist)
+void GuiDisplay_Refresh (void)
+{
+}
+
+#endif // WANT_DOUBLE_BUFFERING
+
+#endif // LCD_CONTROLLER_TYPE_LPC408X
+
+// ============================================================================
+//
+// DISPLAY DRIVER PART ENDS
+//
+// ============================================================================
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiDisplay.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,33 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2014 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                       easyGUI display driver unit                        */
+/*                               v6.0.23.002                                */
+/*                                                                          */
+/* ************************************************************************ */
+
+#ifndef __GUIDISPLAY_H
+#define __GUIDISPLAY_H
+
+#ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
+extern "C" {
+#endif
+
+#include "GuiConst.h"
+#ifndef GuiConst_CODEVISION_COMPILER
+#include "GuiLib.h"
+#endif
+
+extern void GuiDisplay_Lock (void);
+extern void GuiDisplay_Unlock (void);
+extern void GuiDisplay_Init (void);
+extern void GuiDisplay_Refresh (void);
+
+#ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiGraph.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,1750 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2015 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                         Graphics include library                         */
+/*                               v6.0.9.005                                 */
+/*                                                                          */
+/*     GuiLib.c include file - do NOT reference it in your linker setup     */
+/*                                                                          */
+/* ************************************************************************ */
+
+//==============================================================================
+#define GuiLib_DEG              10
+#define GuiLib_DEG360           360 * GuiLib_DEG
+
+#define GuiLib_RAD              4096
+#define GuiLib_RAD_QUARTER_PI   3217
+#define GuiLib_RAD_HALF_PI      6434
+#define GuiLib_RAD_PI           12868
+#define GuiLib_RAD_2_PI         25736
+#define GuiLib_RAD_TO_DEG       573
+
+//==============================================================================
+
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_DegToRad(
+   GuiConst_INT32S Angle)
+{
+  return ((GuiLib_RAD * Angle) / GuiLib_RAD_TO_DEG);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_RadToDeg(
+   GuiConst_INT32S Angle)
+{
+  return ((GuiLib_RAD_TO_DEG * Angle) / GuiLib_RAD);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_SinRad(
+   GuiConst_INT32S Angle)
+{
+  GuiConst_INT32S A, B, X2;
+
+  Angle %= GuiLib_RAD_2_PI;
+
+  if (Angle > GuiLib_RAD_PI)
+    X2 = GuiLib_RAD_2_PI - Angle;
+  else
+    X2 = Angle;
+  if (X2 > GuiLib_RAD_HALF_PI)
+    X2 = GuiLib_RAD_PI - X2;
+
+  A = ((((X2 * X2) >> 12) * X2) / 6) >> 12;
+  B = ((((A * X2) >> 12) * X2) / 20) >> 12;
+  B = X2 - A + B - ((((B * X2) / 42) * X2) >> 24);
+
+  if (Angle > GuiLib_RAD_PI)
+    return (-B);
+  else
+    return (B);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_SinDeg(
+   GuiConst_INT32S Angle)
+{
+  return (GuiLib_SinRad(GuiLib_DegToRad(Angle)));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_CosRad(
+   GuiConst_INT32S Angle)
+{
+  GuiConst_INT32S A, B, C, X2;
+
+  Angle %= GuiLib_RAD_2_PI;
+
+  if (Angle > GuiLib_RAD_PI)
+    Angle = GuiLib_RAD_2_PI - Angle;
+  if (Angle > GuiLib_RAD_HALF_PI)
+    X2 = GuiLib_RAD_PI - Angle;
+  else
+    X2 = Angle;
+
+  A = (X2 * X2) >> 13;
+  B = ((((A * X2) >> 12) * X2) / 12) >> 12;
+  C = (((B * X2) / 30) * X2) >> 24;
+  C = GuiLib_RAD - A + B - C + (((((C * X2) / 8) * X2) / 7) >> 24);
+  if (Angle > GuiLib_RAD_HALF_PI)
+    return (-C);
+  else
+    return (C);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32S GuiLib_CosDeg(
+   GuiConst_INT32S Angle)
+{
+  return (GuiLib_CosRad(GuiLib_DegToRad(Angle)));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_Sqrt(
+   GuiConst_INT32U X)
+{
+  GuiConst_INT32U X1, X2;
+
+  if (X == 0)
+    return (0);
+
+  X1 = (X / 2) + 1;
+  X2 = (X1 + (X / X1)) / 2;
+  while (X2 < X1)
+  {
+    X1 = X2;
+    X2 = (X1 + (X / X1)) / 2;
+  }
+  return (X1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_GetRedRgbColor(
+   GuiConst_INT32U RgbColor)
+{
+  return (RgbColor & 0x000000FF);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_SetRedRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT8U RedColor)
+{
+  return ((RgbColor & 0x00FFFF00) | RedColor);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_GetGreenRgbColor(
+   GuiConst_INT32U RgbColor)
+{
+  return (GuiConst_INT8U)((RgbColor & 0x0000FF00) >> 8);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_SetGreenRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT8U GreenColor)
+{
+  return ((RgbColor & 0x00FF00FF) | ((GuiConst_INT32U)GreenColor << 8));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_GetBlueRgbColor(
+   GuiConst_INT32U RgbColor)
+{
+  return (GuiConst_INT8U)((RgbColor & 0x00FF0000) >> 16);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_SetBlueRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT8U BlueColor)
+{
+  return ((RgbColor & 0xFF00FFFF) | ((GuiConst_INT32U)BlueColor << 16));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_RgbToPixelColor(
+   GuiConst_INT32U RgbColor)
+{
+#ifdef GuiConst_COLOR_MODE_GRAY
+  return ((GuiConst_COLOR_MAX *
+     (GuiConst_INT16U)GuiLib_RgbColorToGrayScale(RgbColor)) / 255);
+#else
+#ifdef GuiConst_COLOR_MODE_PALETTE
+  GuiConst_INT16U ColorR, ColorG, ColorB;
+  GuiConst_INT16U I, I2, byte, shift;
+  GuiConst_INT16U Rating, NewRating;
+  GuiConst_INT32U PColor;
+
+  ColorR = RgbColor & 0x000000FF;
+  ColorG = (RgbColor & 0x0000FF00) >> 8;
+  ColorB = (RgbColor & 0x00FF0000) >> 16;
+#ifndef GuiConst_COLOR_RGB_STANDARD
+  ColorR = (GuiConst_COLORCODING_R_MAX * ColorR) / 255;
+  ColorG = (GuiConst_COLORCODING_G_MAX * ColorG) / 255;
+  ColorB = (GuiConst_COLORCODING_B_MAX * ColorB) / 255;
+#endif
+  Rating = 0xFFFF;
+  for (I = 0; I < GuiConst_PALETTE_SIZE; I++)
+  {
+    PColor = 0;
+    for (byte=0,shift=0;byte < GuiConst_COLOR_BYTE_SIZE; byte++, shift +=8)
+      PColor |= ((GuiConst_INT32U)GuiStruct_Palette[I][byte] << shift);
+
+    NewRating =
+       abs(ColorR - ((PColor & GuiConst_COLORCODING_R_MASK) >>
+       GuiConst_COLORCODING_R_START)) +
+       abs(ColorG - ((PColor & GuiConst_COLORCODING_G_MASK) >>
+       GuiConst_COLORCODING_G_START)) +
+       abs(ColorB - ((PColor & GuiConst_COLORCODING_B_MASK) >>
+       GuiConst_COLORCODING_B_START));
+    if (NewRating < Rating)
+    {
+      Rating = NewRating;
+      I2 = I;
+    }
+  }
+  return (I2);
+#else
+#ifdef GuiConst_COLOR_RGB_STANDARD
+  return (RgbColor);
+#else
+  return ((((GuiConst_COLORCODING_R_MAX *
+     (RgbColor & 0x000000FF)) / 255) << GuiConst_COLORCODING_R_START) |
+     (((GuiConst_COLORCODING_G_MAX *
+     ((RgbColor & 0x0000FF00) >> 8)) / 255) << GuiConst_COLORCODING_G_START) |
+     (((GuiConst_COLORCODING_B_MAX *
+     ((RgbColor & 0x00FF0000) >> 16)) / 255) << GuiConst_COLORCODING_B_START));
+#endif
+#endif
+#endif
+}
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_Rgb888ToPixelColor(
+   GuiConst_INT8U Red, GuiConst_INT8U Green, GuiConst_INT8U Blue)
+{
+#ifdef GuiConst_COLOR_MODE_GRAY
+  return ((GuiConst_COLOR_MAX *
+     (GuiConst_INT16U)GuiLib_Rgb888ColorToGrayScale(Red, Green, Blue)) / 255);
+#else
+#ifdef GuiConst_COLOR_MODE_PALETTE
+  GuiConst_INT16U ColorR, ColorG, ColorB;
+  GuiConst_INT16U I, I2, byte, shift;
+  GuiConst_INT16U Rating, NewRating;
+  GuiConst_INT32U PColor;
+
+  ColorR = Red;
+  ColorG = Green;
+  ColorB = Blue;
+#ifndef GuiConst_COLOR_RGB_STANDARD
+  ColorR = (GuiConst_COLORCODING_R_MAX * ColorR) / 255;
+  ColorG = (GuiConst_COLORCODING_G_MAX * ColorG) / 255;
+  ColorB = (GuiConst_COLORCODING_B_MAX * ColorB) / 255;
+#endif
+  Rating = 0xFFFF;
+  for (I = 0; I < GuiConst_PALETTE_SIZE; I++)
+  {
+    PColor = 0;
+    for (byte=0,shift=0;byte < GuiConst_COLOR_BYTE_SIZE; byte++, shift +=8)
+      PColor |= ((GuiConst_INT32U)GuiStruct_Palette[I][byte] << shift);
+
+    NewRating =
+       abs(ColorR - ((PColor & GuiConst_COLORCODING_R_MASK) >>
+       GuiConst_COLORCODING_R_START)) +
+       abs(ColorG - ((PColor & GuiConst_COLORCODING_G_MASK) >>
+       GuiConst_COLORCODING_G_START)) +
+       abs(ColorB - ((PColor & GuiConst_COLORCODING_B_MASK) >>
+       GuiConst_COLORCODING_B_START));
+    if (NewRating < Rating)
+    {
+      Rating = NewRating;
+      I2 = I;
+    }
+  }
+  return (I2);
+#else
+#ifdef GuiConst_COLOR_RGB_STANDARD
+  return (Red | (Green << 8) | (Blue << 16));
+#else
+  return ((((GuiConst_COLORCODING_R_MAX * Red) / 255)
+              << GuiConst_COLORCODING_R_START) |
+          (((GuiConst_COLORCODING_G_MAX * Green) / 255)
+              << GuiConst_COLORCODING_G_START) |
+          (((GuiConst_COLORCODING_B_MAX * Blue) / 255)
+              << GuiConst_COLORCODING_B_START));
+#endif
+#endif
+#endif
+}
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_PixelToRgbColor(
+   GuiConst_INTCOLOR PixelColor)
+{
+#ifdef GuiConst_COLOR_MODE_GRAY
+  GuiConst_INT16U GrayValue;
+
+  GrayValue = (255 * PixelColor) / GuiConst_COLOR_MAX;
+  return (GuiLib_GrayScaleToRgbColor((GuiConst_INT8U)GrayValue));
+#else
+  GuiConst_INT32U PColor;
+#ifdef GuiConst_COLOR_MODE_PALETTE
+  GuiConst_INT16U byte, shift;
+#endif
+#ifndef GuiConst_COLOR_RGB_STANDARD
+  GuiConst_INT32U ColorR, ColorG, ColorB;
+#endif
+
+#ifdef GuiConst_COLOR_MODE_PALETTE
+  PColor = 0;
+  for (byte=0,shift=0;byte < GuiConst_COLOR_BYTE_SIZE; byte++, shift +=8)
+    PColor |= ((GuiConst_INT32U)GuiStruct_Palette[PixelColor][byte] << shift);
+#else
+  PColor = PixelColor;
+#endif
+
+#ifdef GuiConst_COLOR_RGB_STANDARD
+  return (PColor);
+#else
+  ColorR =
+     (PColor & GuiConst_COLORCODING_R_MASK) >> GuiConst_COLORCODING_R_START;
+  ColorG =
+     (PColor & GuiConst_COLORCODING_G_MASK) >> GuiConst_COLORCODING_G_START;
+  ColorB =
+     (PColor & GuiConst_COLORCODING_B_MASK) >> GuiConst_COLORCODING_B_START;
+  ColorR = (255 * ColorR) / GuiConst_COLORCODING_R_MAX;
+  ColorG = (255 * ColorG) / GuiConst_COLORCODING_G_MAX;
+  ColorB = (255 * ColorB) / GuiConst_COLORCODING_B_MAX;
+  return (ColorR | (ColorG << 8) | (ColorB << 16));
+#endif
+#endif
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_RgbColorToGrayScale(
+   GuiConst_INT32U RgbColor)
+{
+  return (((RgbColor & 0x000000FF) +
+     ((RgbColor & 0x0000FF00) >> 8) +
+     ((RgbColor & 0x00FF0000) >> 16)) / 3);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_Rgb888ColorToGrayScale(
+   GuiConst_INT8U Red, GuiConst_INT8U Green, GuiConst_INT8U Blue)
+{
+  return ((Red + Green + Blue) / 3);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_GrayScaleToRgbColor(
+   GuiConst_INT8U GrayValue)
+{
+  return ((GuiConst_INT32U)GrayValue |
+         ((GuiConst_INT32U)GrayValue << 8) |
+         ((GuiConst_INT32U)GrayValue << 16));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_PixelColorToGrayScale(
+   GuiConst_INTCOLOR PixelColor)
+{
+  return (GuiLib_RgbColorToGrayScale(GuiLib_PixelToRgbColor(PixelColor)));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_GrayScaleToPixelColor(
+   GuiConst_INT8U GrayValue)
+{
+  return (GuiLib_RgbToPixelColor(GuiLib_GrayScaleToRgbColor(GrayValue)));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_BrightenRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount)
+{
+  GuiConst_INT32U ColorR, ColorG, ColorB;
+
+  if (Amount == 0)
+    return (RgbColor);
+  else
+  {
+    ColorR = 255 - ((GuiConst_INT32U)(255 - GuiLib_GetRedRgbColor(RgbColor)) *
+       (1000 - Amount) / 1000);
+    ColorG = 255 - ((GuiConst_INT32U)(255 - GuiLib_GetGreenRgbColor(RgbColor)) *
+       (1000 - Amount) / 1000);
+    ColorB = 255 - ((GuiConst_INT32U)(255 - GuiLib_GetBlueRgbColor(RgbColor)) *
+       (1000 - Amount) / 1000);
+    return (ColorR | (ColorG << 8) | (ColorB << 16));
+  }
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_BrightenPixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount)
+{
+  return (GuiLib_RgbToPixelColor(
+     GuiLib_BrightenRgbColor(GuiLib_PixelToRgbColor(PixelColor), Amount)));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_DarkenRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount)
+{
+  GuiConst_INT32U ColorR, ColorG, ColorB;
+
+  if (Amount == 0)
+    return (RgbColor);
+  else
+  {
+    ColorR = (GuiConst_INT32U)GuiLib_GetRedRgbColor(RgbColor) *
+       (1000 - Amount) / 1000;
+    ColorG = (GuiConst_INT32U)GuiLib_GetGreenRgbColor(RgbColor) *
+       (1000 - Amount) / 1000;
+    ColorB = (GuiConst_INT32U)GuiLib_GetBlueRgbColor(RgbColor) *
+       (1000 - Amount) / 1000;
+    return (ColorR | (ColorG << 8) | (ColorB << 16));
+  }
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_DarkenPixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount)
+{
+  return (GuiLib_RgbToPixelColor(
+     GuiLib_DarkenRgbColor(GuiLib_PixelToRgbColor(PixelColor), Amount)));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_MiddleRgbColor(
+   GuiConst_INT32U RgbColor1,
+   GuiConst_INT32U RgbColor2,
+   GuiConst_INT16U Amount)
+{
+  GuiConst_INT32S ColorR, ColorG, ColorB;
+
+  if (Amount == 0)
+    return (RgbColor1);
+  else if (Amount >= 1000)
+    return (RgbColor2);
+  else
+  {
+    ColorR = (GuiConst_INT32U)GuiLib_GetRedRgbColor(RgbColor1);
+    ColorR = ColorR + (((GuiConst_INT32S)Amount *
+       ((GuiConst_INT32S)GuiLib_GetRedRgbColor(RgbColor2) - ColorR)) / 1000);
+    ColorG = (GuiConst_INT32U)GuiLib_GetGreenRgbColor(RgbColor1);
+    ColorG = ColorG + (((GuiConst_INT32S)Amount *
+       ((GuiConst_INT32S)GuiLib_GetGreenRgbColor(RgbColor2) - ColorG)) / 1000);
+    ColorB = (GuiConst_INT32U)GuiLib_GetBlueRgbColor(RgbColor1);
+    ColorB = ColorB + (((GuiConst_INT32S)Amount *
+       ((GuiConst_INT32S)GuiLib_GetBlueRgbColor(RgbColor2) - ColorB)) / 1000);
+    return (ColorR | (ColorG << 8) | (ColorB << 16));
+  }
+}
+
+// -----------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_MiddlePixelColor(
+   GuiConst_INTCOLOR PixelColor1,
+   GuiConst_INTCOLOR PixelColor2,
+   GuiConst_INT16U Amount)
+{
+  return (GuiLib_RgbToPixelColor(
+     GuiLib_MiddleRgbColor(GuiLib_PixelToRgbColor(PixelColor1),
+                           GuiLib_PixelToRgbColor(PixelColor2),
+                           Amount)));
+}
+
+// -----------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_DesaturateRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount)
+{
+  GuiConst_INT32U GrayValue;
+  GuiConst_INT32U ColorDesat;
+
+  GrayValue = (GuiConst_INT32U)GuiLib_RgbColorToGrayScale(RgbColor);
+  ColorDesat = GrayValue | (GrayValue << 8) | (GrayValue << 16);
+  return (GuiLib_MiddleRgbColor(RgbColor, ColorDesat, Amount));
+}
+
+// -----------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_DesaturatePixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount)
+{
+  return (GuiLib_RgbToPixelColor(
+     GuiLib_DesaturateRgbColor(GuiLib_PixelToRgbColor(PixelColor), Amount)));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT32U GuiLib_AccentuateRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount)
+{
+  if (Amount == 0)
+    return (RgbColor);
+  else if (GuiLib_RgbColorToGrayScale(RgbColor) <= 127)
+    return (GuiLib_BrightenRgbColor(RgbColor, Amount));
+  else
+    return (GuiLib_DarkenRgbColor(RgbColor, Amount));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_AccentuatePixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount)
+{
+  return (GuiLib_RgbToPixelColor(
+     GuiLib_AccentuateRgbColor(GuiLib_PixelToRgbColor(PixelColor), Amount)));
+}
+
+//------------------------------------------------------------------------------
+void Ellipse(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U Radius1,
+   GuiConst_INT16U Radius2,
+   GuiConst_INT32S BorderColor,
+   GuiConst_INT32S FillColor,
+   GuiConst_INT8U Q1,
+   GuiConst_INT8U Q2,
+   GuiConst_INT8U Q3,
+   GuiConst_INT8U Q4)
+{
+  GuiConst_INT16S PX, PY;
+  GuiConst_INT16S L1, L2, LP1, LP2, LX, LY;
+  GuiConst_INT16S PX2, PY2;
+  GuiConst_INTCOLOR BColor;
+  GuiConst_INT8U Filling, LFilling, First;
+  GuiConst_INT16S R1, R2;
+  GuiConst_INT32S R22;
+  GuiConst_INT8U Q12, Q34, Q14, Q23, Qfull;
+
+  Filling = (FillColor != GuiLib_NO_COLOR);
+  if (BorderColor == GuiLib_NO_COLOR)
+  {
+    if (!Filling)
+      return;
+    else
+      BColor = (GuiConst_INTCOLOR)FillColor;
+  }
+  else
+    BColor = (GuiConst_INTCOLOR)BorderColor;
+
+  Q12 = (Q1 || Q2);
+  Q34 = (Q3 || Q4);
+  Q14 = (Q1 || Q4);
+  Q23 = (Q2 || Q3);
+  Qfull = Q1 & Q2 & Q3 & Q4;
+  if (!(Q12 || Q34))
+    return;
+
+  if (Radius1 == 0)
+  {
+    if (Qfull)
+      GuiLib_VLine(X, Y - Radius2, Y + Radius2, BColor);
+    else if (Q12)
+      GuiLib_VLine(X, Y, Y + Radius2, BColor);
+    else
+      GuiLib_VLine(X, Y - Radius2, Y, BColor);
+  }
+  else if (Radius2 == 0)
+  {
+    if (Qfull)
+      GuiLib_HLine(X - Radius1, X + Radius1, Y, BColor);
+    else if (Q14)
+      GuiLib_HLine(X, X + Radius1, Y, BColor);
+    else
+      GuiLib_HLine(X - Radius1, X, Y, BColor);
+  }
+  else if (Radius1 == 1)
+  {
+    PY = Radius2 / 2;
+    if (Q23)
+    {
+      if (Q2 && Q3)
+        GuiLib_VLine(X - 1, Y - PY, Y + PY, BColor);
+      else if (Q2)
+        GuiLib_VLine(X - 1, Y, Y + PY, BColor);
+      else
+        GuiLib_VLine(X - 1, Y - PY, Y, BColor);
+    }
+    if (Q34)
+      GuiLib_VLine(X, Y - Radius2, Y - PY - 1, BColor);
+    if (Filling)
+    {
+      if (Q12 && Q34)
+        GuiLib_VLine(X, Y - PY, Y + PY, (GuiConst_INTCOLOR)FillColor);
+      else if (Q12)
+        GuiLib_VLine(X, Y, Y + PY, (GuiConst_INTCOLOR)FillColor);
+      else
+        GuiLib_VLine(X, Y - PY, Y, (GuiConst_INTCOLOR)FillColor);
+    }
+    if (Q12)
+      GuiLib_VLine(X, Y + PY + 1, Y + Radius2, BColor);
+    if (Q14)
+    {
+      if (Q1 && Q4)
+        GuiLib_VLine(X + 1, Y - PY, Y + PY, BColor);
+      else if (Q1)
+        GuiLib_VLine(X + 1, Y, Y + PY, BColor);
+      else
+        GuiLib_VLine(X + 1, Y - PY, Y, BColor);
+    }
+  }
+  else if (Radius2 == 1)
+  {
+    PX = Radius1 / 2;
+    if (Q34)
+    {
+      if (Q3 && Q4)
+        GuiLib_HLine(X - PX, X + PX, Y - 1, BColor);
+      else if (Q4)
+        GuiLib_HLine(X, X + PX, Y - 1, BColor);
+      else
+        GuiLib_HLine(X - PX, X, Y - 1, BColor);
+    }
+    if (Q23)
+      GuiLib_HLine(X - Radius1, X - PX - 1, Y, BColor);
+    if (Filling)
+    {
+      if (Q14 && Q23)
+        GuiLib_HLine(X - PX, X + PX, Y, (GuiConst_INTCOLOR)FillColor);
+      else if (Q14)
+        GuiLib_HLine(X, X + PX, Y, (GuiConst_INTCOLOR)FillColor);
+      else
+        GuiLib_HLine(X - PX, X, Y, (GuiConst_INTCOLOR)FillColor);
+    }
+    if (Q14)
+      GuiLib_HLine(X + PX + 1, X + Radius1, Y, BColor);
+    if (Q12)
+    {
+      if (Q1 && Q2)
+        GuiLib_HLine(X - PX, X + PX, Y + 1, BColor);
+      else if (Q1)
+        GuiLib_HLine(X, X + PX, Y + 1, BColor);
+      else
+        GuiLib_HLine(X - PX, X, Y + 1, BColor);
+    }
+  }
+  else
+  {
+    R1 = Radius1 << 3;
+    R2 = Radius2 << 3;
+
+    if (Radius1 >= Radius2)
+    {
+      R22 = (GuiConst_INT32S)R2 * R2;
+
+      PX = 0;
+      First = 1;
+      for (PY = R2 - 4; PY >= 4; PY -= 8)
+      {
+        PX2 = PX + 8;
+        PX = (GuiConst_INT16S)((R1 * GuiLib_Sqrt((0x00000400 -
+           ((((GuiConst_INT32S)PY * (PY + 3)) << 10) / R22)) << 8)) >> 9) + 1;
+        LY = (PY + 4) >> 3;
+        if (First)
+        {
+          L1 = X - (PX >> 3);
+          L2 = X + (PX >> 3);
+          if (Q12)
+          {
+            if (Q1 && Q2)
+              GuiLib_HLine(L1, L2, Y + LY, BColor);
+            else if (Q1)
+              GuiLib_HLine(X, L2, Y + LY, BColor);
+            else
+              GuiLib_HLine(L1, X, Y + LY, BColor);
+          }
+          if (Q34)
+          {
+            if (Q3 && Q4)
+              GuiLib_HLine(L1, L2, Y - LY, BColor);
+            else if (Q4)
+              GuiLib_HLine(X, L2, Y - LY, BColor);
+            else
+              GuiLib_HLine(L1, X, Y - LY, BColor);
+          }
+          First = 0;
+        }
+        else
+        {
+          LP1 = X - (PX2 >> 3);
+          LP2 = X + (PX2 >> 3);
+          L1 = X - (PX >> 3);
+          L2 = X + (PX >> 3);
+          if (LP1 < L1)
+          {
+            LP1 = L1;
+            LP2 = L2;
+          }
+          LFilling = Filling & (LP2 - LP1 >= 2);
+
+          if (Q12)
+          {
+            if (Q2)
+              GuiLib_HLine(L1, LP1, Y + LY, BColor);
+            if (LFilling)
+            {
+              if (Q1 && Q2)
+                GuiLib_HLine(LP1 + 1, LP2 - 1, Y + LY,
+                   (GuiConst_INTCOLOR)FillColor);
+              else if (Q1)
+                GuiLib_HLine(X, LP2 - 1, Y + LY, (GuiConst_INTCOLOR)FillColor);
+              else
+                GuiLib_HLine(LP1 + 1, X, Y + LY, (GuiConst_INTCOLOR)FillColor);
+            }
+            if (Q1)
+              GuiLib_HLine(LP2, L2, Y + LY, BColor);
+          }
+          if (Q34)
+          {
+            if (Q3)
+              GuiLib_HLine(L1, LP1, Y - LY, BColor);
+            if (LFilling)
+            {
+              if (Q3 && Q4)
+                GuiLib_HLine(LP1 + 1, LP2 - 1, Y - LY,
+                   (GuiConst_INTCOLOR)FillColor);
+              else if (Q4)
+                GuiLib_HLine(X, LP2 - 1, Y - LY, (GuiConst_INTCOLOR)FillColor);
+              else
+                GuiLib_HLine(LP1 + 1, X, Y - LY, (GuiConst_INTCOLOR)FillColor);
+            }
+            if (Q4)
+              GuiLib_HLine(LP2, L2, Y - LY, BColor);
+          }
+        }
+      }
+      L1 = (PX + 8) >> 3;
+      if (L1 > Radius1)
+        L1 = Radius1;
+
+      if (Q23)
+        GuiLib_HLine(X - Radius1, X - L1, Y, BColor);
+      if (Filling & (L1 >= 1))
+      {
+        if (Q14 && Q23)
+          GuiLib_HLine(X - L1 + 1, X + L1 - 1, Y, (GuiConst_INTCOLOR)FillColor);
+        else if (Q14)
+          GuiLib_HLine(X, X + L1 - 1, Y, (GuiConst_INTCOLOR)FillColor);
+        else
+          GuiLib_HLine(X - L1 + 1, X, Y, (GuiConst_INTCOLOR)FillColor);
+      }
+      if (Q14)
+        GuiLib_HLine(X + L1, X + Radius1, Y, BColor);
+    }
+    else
+    {
+      R22 = (GuiConst_INT32S)R1 * R1;
+
+      PY = 0;
+      First = 1;
+      for (PX = R1 - 4; PX >= 4; PX -= 8)
+      {
+        PY2 = PY + 8;
+        PY = (GuiConst_INT16S)((R2 * GuiLib_Sqrt((0x00000400 -
+           ((((GuiConst_INT32S)PX * (PX + 3)) << 10) / R22)) << 8)) >> 9) + 1;
+        LX = (PX + 4) >> 3;
+        if (First)
+        {
+          L1 = Y - (PY >> 3);
+          L2 = Y + (PY >> 3);
+          if (Q14)
+          {
+            if (Q1 && Q4)
+              GuiLib_VLine(X + LX, L1, L2, BColor);
+            else if (Q1)
+              GuiLib_VLine(X + LX, Y, L2, BColor);
+            else
+              GuiLib_VLine(X + LX, L1, Y, BColor);
+          }
+          if (Q23)
+          {
+            if (Q2 && Q3)
+              GuiLib_VLine(X - LX, L1, L2, BColor);
+            else if (Q2)
+              GuiLib_VLine(X - LX, Y, L2, BColor);
+            else
+              GuiLib_VLine(X - LX, L1, Y, BColor);
+          }
+          First = 0;
+        }
+        else
+        {
+          LP1 = Y - (PY2 >> 3);
+          LP2 = Y + (PY2 >> 3);
+          L1 = Y - (PY >> 3);
+          L2 = Y + (PY >> 3);
+          if (LP1 < L1)
+          {
+            LP1 = L1;
+            LP2 = L2;
+          }
+          LFilling = Filling & (LP2 - LP1 >= 2);
+
+          if (Q14)
+          {
+            if (Q4)
+              GuiLib_VLine(X + LX, L1, LP1, BColor);
+            if (LFilling)
+            {
+              if (Q1 && Q4)
+                GuiLib_VLine(X + LX, LP1 + 1, LP2 - 1,
+                   (GuiConst_INTCOLOR)FillColor);
+              else if (Q1)
+                GuiLib_VLine(X + LX, Y, LP2 - 1, (GuiConst_INTCOLOR)FillColor);
+              else
+                GuiLib_VLine(X + LX, LP1 + 1, Y, (GuiConst_INTCOLOR)FillColor);
+            }
+            if (Q1)
+              GuiLib_VLine(X + LX, LP2, L2, BColor);
+          }
+          if (Q23)
+          {
+            if (Q3)
+              GuiLib_VLine(X - LX, L1, LP1, BColor);
+            if (LFilling)
+            {
+              if (Q2 && Q3)
+                GuiLib_VLine(X - LX, LP1 + 1, LP2 - 1,
+                   (GuiConst_INTCOLOR)FillColor);
+              else if (Q2)
+                GuiLib_VLine(X - LX, Y, LP2 - 1, (GuiConst_INTCOLOR)FillColor);
+              else
+                GuiLib_VLine(X - LX, LP1 + 1, Y, (GuiConst_INTCOLOR)FillColor);
+            }
+            if (Q2)
+              GuiLib_VLine(X - LX, LP2, L2, BColor);
+          }
+        }
+      }
+      L1 = (PY + 8) >> 3;
+      if (L1 > Radius2)
+        L1 = Radius2;
+
+      if (Q34)
+        GuiLib_VLine(X, Y - Radius2, Y - L1, BColor);
+      if (Filling & (L1 >= 1))
+      {
+        if (Q12 && Q34)
+          GuiLib_VLine(X, Y - L1 + 1, Y + L1 - 1, (GuiConst_INTCOLOR)FillColor);
+        else if (Q12)
+          GuiLib_VLine(X, Y, Y + L1 - 1, (GuiConst_INTCOLOR)FillColor);
+        else
+          GuiLib_VLine(X, Y - L1 + 1, Y, (GuiConst_INTCOLOR)FillColor);
+      }
+      if (Q12)
+        GuiLib_VLine(X, Y + L1, Y + Radius2, BColor);
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+void Circle(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U Radius,
+   GuiConst_INTCOLOR Color,
+   GuiConst_INT8U S0,
+   GuiConst_INT8U S1,
+   GuiConst_INT8U S2,
+   GuiConst_INT8U S3,
+   GuiConst_INT8U S4,
+   GuiConst_INT8U S5,
+   GuiConst_INT8U S6,
+   GuiConst_INT8U S7,
+   GuiConst_INT8U IF)
+{
+  GuiConst_INT16S PX, PY, PX2;
+  GuiConst_INT16S L1, L2, LP1, LP2, LX, LY, LX2;
+  GuiConst_INT8U First;
+  GuiConst_INT16S R;
+  GuiConst_INT32S R2;
+
+  if (!(S0 || S1 || S2 || S3 || S4 || S5 || S6 || S7))
+    return;
+  if (Radius == 0)
+    return;
+
+  if (Radius == 1)
+  {
+    if (S7 || S0)
+      GuiLib_Dot(X + 1, Y, Color);
+    if (S1 || S2)
+      GuiLib_Dot(X, Y + 1, Color);
+    if (S3 || S4)
+      GuiLib_Dot(X - 1, Y, Color);
+    if (S5 || S6)
+      GuiLib_Dot(X, Y - 1, Color);
+  }
+  else
+  {
+    R = Radius << 3;
+    R2 = (GuiConst_INT32S)R * R;
+    First = 1;
+    PX = 0;
+
+    for (PY = R - 4; PY >= R / 2; PY -= 8)
+    {
+      PX2 = PX + 8;
+      PX = (GuiConst_INT16S)((R * GuiLib_Sqrt((0x00000400 -
+         ((((GuiConst_INT32S)PY * (PY + 3)) << 10) / R2)) << 8)) >> 9) + 1;
+      LX2 = (PX2 + 4) >> 3;
+      LX = (PX + 4) >> 3;
+      LY = (PY + 4) >> 3;
+      if (First)
+      {
+        if (S1 || S2)
+        {
+          if (S1)
+            L2 = X + LX;
+          else
+            L2 = X;
+          if (S2)
+            L1 = X - LX;
+          else
+            L1 = X;
+          GuiLib_HLine(L1, L2, Y + LY, Color);
+          if (IF)
+            GuiLib_HLine(L1, L2, Y + LY - 1, Color);
+        }
+        if (S5 || S6)
+        {
+          if (S5)
+            L1 = X - LX;
+          else
+            L1 = X;
+          if (S6)
+            L2 = X + LX;
+          else
+            L2 = X;
+          GuiLib_HLine(L1, L2, Y - LY, Color);
+          if (IF)
+            GuiLib_HLine(L1, L2, Y - LY +1, Color);
+        }
+
+        if (S3 || S4)
+        {
+          if (S3)
+            L2 = Y + LX;
+          else
+            L2 = Y;
+          if (S4)
+            L1 = Y - LX;
+          else
+            L1 = Y;
+          GuiLib_VLine(X - LY, L1, L2, Color);
+          if (IF)
+            GuiLib_VLine(X - LY + 1, L1, L2, Color);
+        }
+        if (S7 || S0)
+        {
+          if (S7)
+            L1 = Y - LX;
+          else
+            L1 = Y;
+          if (S0)
+            L2 = Y + LX;
+          else
+            L2 = Y;
+          GuiLib_VLine(X + LY, L1, L2, Color);
+          if (IF)
+            GuiLib_VLine(X + LY - 1, L1, L2, Color);
+        }
+
+        First = 0;
+      }
+      else if (LX < LY)
+      {
+        LP1 = X - LX2;
+        LP2 = X + LX2;
+        L1 = X - LX;
+        L2 = X + LX;
+
+        if (S1)
+        {
+          GuiLib_HLine(LP2, L2, Y + LY, Color);
+          if (IF)
+            GuiLib_HLine(LP2, L2, Y + LY - 1, Color);
+        }
+        if (S2)
+        {
+          GuiLib_HLine(L1, LP1, Y + LY, Color);
+          if (IF)
+            GuiLib_HLine(L1, LP1, Y + LY - 1, Color);
+        }
+
+        if (S5)
+        {
+          GuiLib_HLine(L1, LP1, Y - LY, Color);
+          if (IF)
+            GuiLib_HLine(L1, LP1, Y - LY + 1, Color);
+        }
+        if (S6)
+        {
+          GuiLib_HLine(LP2, L2, Y - LY, Color);
+          if (IF)
+            GuiLib_HLine(LP2, L2, Y - LY + 1, Color);
+        }
+
+        LP1 = Y - LX2;
+        LP2 = Y + LX2;
+        L1 = Y - LX;
+        L2 = Y + LX;
+
+        if (S7)
+        {
+          GuiLib_VLine(X + LY, L1, LP1, Color);
+          if (IF)
+            GuiLib_VLine(X + LY - 1, L1, LP1, Color);
+        }
+        if (S0)
+        {
+          GuiLib_VLine(X + LY, LP2, L2, Color);
+          if (IF)
+            GuiLib_VLine(X + LY - 1, LP2, L2, Color);
+        }
+
+        if (S3)
+        {
+          GuiLib_VLine(X - LY, LP2, L2, Color);
+          if (IF)
+            GuiLib_VLine(X - LY + 1, LP2, L2, Color);
+        }
+        if (S4)
+        {
+          GuiLib_VLine(X - LY, L1, LP1, Color);
+          if (IF)
+            GuiLib_VLine(X - LY + 1, L1, LP1, Color);
+        }
+      }
+      else
+      {
+        if (S0)
+        {
+          GuiLib_Dot(X + LY, Y + LX2, Color);
+          if (IF)
+            GuiLib_Dot(X + LY - 1, Y + LX2, Color);
+        }
+        if (S1)
+        {
+          GuiLib_Dot(X + LX2, Y + LY, Color);
+          if (IF)
+            GuiLib_Dot(X + LX2, Y + LY - 1, Color);
+        }
+        if (S2)
+        {
+          GuiLib_Dot(X - LX2, Y + LY, Color);
+          if (IF)
+            GuiLib_Dot(X - LX2, Y + LY - 1, Color);
+        }
+        if (S3)
+        {
+          GuiLib_Dot(X - LY, Y + LX2, Color);
+          if (IF)
+            GuiLib_Dot(X - LY + 1, Y + LX2, Color);
+        }
+        if (S4)
+        {
+          GuiLib_Dot(X - LY, Y - LX2, Color);
+          if (IF)
+            GuiLib_Dot(X - LY + 1, Y - LX2, Color);
+        }
+        if (S5)
+        {
+          GuiLib_Dot(X - LX2, Y - LY, Color);
+          if (IF)
+            GuiLib_Dot(X - LX2, Y - LY + 1, Color);
+        }
+        if (S6)
+        {
+          GuiLib_Dot(X + LX2, Y - LY, Color);
+          if (IF)
+            GuiLib_Dot(X + LX2, Y - LY + 1, Color);
+        }
+        if (S7)
+        {
+          GuiLib_Dot(X + LY, Y - LX2, Color);
+          if (IF)
+            GuiLib_Dot(X + LY - 1, Y - LX2, Color);
+        }
+
+        break;
+      }
+    }
+
+    if (S7 || S0)
+      GuiLib_Dot(X + Radius, Y, Color);
+    if (S3 || S4)
+      GuiLib_Dot(X - Radius, Y, Color);
+  }
+}
+
+//------------------------------------------------------------------------------
+void FilledCircle(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U Radius,
+   GuiConst_INTCOLOR Color)
+{
+  GuiConst_INT16S PX, PY, PX2;
+  GuiConst_INT16S LX, LY, LXY, LX2;
+  GuiConst_INT16S R;
+  GuiConst_INT32S R2;
+
+  if (Radius == 0)
+    return;
+
+  if (Radius == 1)
+  {
+    GuiLib_Dot(X, Y - 1, Color);
+    GuiLib_HLine(X - 1, X + 1, Y, Color);
+    GuiLib_Dot(X, Y + 1, Color);
+  }
+  else
+  {
+    R = Radius << 3;
+    R2 = (GuiConst_INT32S)R * R;
+    LXY = (707 * (GuiConst_INT32S)Radius) / 1000;
+    PX = 0;
+    LY = 0;
+
+    for (PY = R - 4; PY >= R / 2; PY -= 8)
+    {
+      PX2 = PX + 8;
+      PX = (GuiConst_INT16S)((R * GuiLib_Sqrt((0x00000400 -
+         ((((GuiConst_INT32S)PY * (PY + 3)) << 10) / R2)) << 8)) >> 9) + 1;
+      LX2 = (PX2 + 4) >> 3;
+      LX = (PX + 4) >> 3;
+      LY = (PY + 4) >> 3;
+
+      if (LX < LY)
+      {
+        GuiLib_HLine(X - LX, X + LX, Y + LY, Color);
+        GuiLib_HLine(X - LX, X + LX, Y - LY, Color);
+
+        if (LX > LXY)
+          LX = LXY;
+        GuiLib_VLine(X - LY, Y - LX, Y + LX, Color);
+        GuiLib_VLine(X + LY, Y - LX, Y + LX, Color);
+      }
+      else
+      {
+        GuiLib_HLine(X - LX2, X + LX2, Y - LY, Color);
+        GuiLib_HLine(X - LX2, X + LX2, Y + LY, Color);
+        GuiLib_VLine(X - LY, Y - LX2, Y + LX2, Color);
+        GuiLib_VLine(X + LY, Y - LX2, Y + LX2, Color);
+
+        break;
+      }
+    }
+    GuiLib_FillBox(X - LY + 1, Y - LY + 1, X + LY - 1, Y + LY - 1, Color);
+  }
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Circle(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U Radius,
+   GuiConst_INT32S BorderColor,
+   GuiConst_INT32S FillColor)
+{
+  Ellipse(X, Y, Radius, Radius, BorderColor, FillColor, 1, 1, 1, 1);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Ellipse(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U Radius1,
+   GuiConst_INT16U Radius2,
+   GuiConst_INT32S BorderColor,
+   GuiConst_INT32S FillColor)
+{
+  Ellipse(X, Y, Radius1, Radius2, BorderColor, FillColor, 1, 1, 1, 1);
+}
+
+//==============================================================================
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+//------------------------------------------------------------------------------
+void GuiLib_ResetClipping(void)
+{
+  sgl.ClippingTotal = 0;
+  SetClipping(
+     0, 0, GuiConst_DISPLAY_WIDTH_HW - 1, GuiConst_DISPLAY_HEIGHT_HW - 1);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_SetClipping(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  sgl.ClippingTotal = ((X1 > X2) || (Y1 > Y2));
+
+  GuiLib_COORD_ADJUST(X1, Y1);
+  GuiLib_COORD_ADJUST(X2, Y2);
+  OrderCoord(&X1, &X2);
+  OrderCoord(&Y1, &Y2);
+
+  SetClipping(X1, Y1, X2, Y2);
+}
+#endif
+
+//------------------------------------------------------------------------------
+void GuiLib_ResetDisplayRepaint(void)
+{
+  GuiConst_INT16S LineNo;
+
+  if (!sgl.BaseLayerDrawing)
+    return;
+
+  for (LineNo = 0; LineNo < GuiConst_BYTE_LINES; LineNo++)
+  {
+    GuiLib_DisplayRepaint[LineNo].ByteEnd = -1;
+    #ifdef GuiConst_VNC_REMOTE_SUPPORT_ON
+    GuiLib_VncRepaint[LineNo].ByteEnd = -1;
+    #endif
+  }
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_MarkDisplayBoxRepaint(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  if (!sgl.BaseLayerDrawing)
+    return;
+
+  GuiLib_COORD_ADJUST(X1, Y1);
+  GuiLib_COORD_ADJUST(X2, Y2);
+  OrderCoord(&X1, &X2);
+  OrderCoord(&Y1, &Y2);
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (CheckRect (&X1, &Y1, &X2, &Y2))
+#endif
+    MarkDisplayBoxRepaint(X1, Y1, X2, Y2);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_ClearDisplay(void)
+{
+  ClearDisplay();
+  MarkDisplayBoxRepaint(
+     0, 0, GuiConst_DISPLAY_WIDTH_HW - 1, GuiConst_DISPLAY_HEIGHT_HW - 1);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Dot(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INTCOLOR Color)
+{
+  GuiLib_COORD_ADJUST(X, Y);
+  GuiLib_COLOR_ADJUST(Color);
+
+  MakeDot(X, Y, Color);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INTCOLOR GuiLib_GetDot(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y)
+{
+  GuiLib_COORD_ADJUST(X, Y);
+
+  return (ReadDot(X, Y));
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Line(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color)
+{
+  GuiConst_INT16S X, Y;
+  GuiConst_INT16S PX1, PY1, PX2, PY2;
+  GuiConst_INT16S RemCoord;
+  GuiConst_INT32S Slope;
+  GuiConst_INT16S Offset, NewOffset;
+  GuiConst_INT16U OffsetCnt;
+  GuiConst_INT16S OffsetDir;
+
+  GuiLib_COORD_ADJUST(X1, Y1);
+  GuiLib_COORD_ADJUST(X2, Y2);
+  GuiLib_COLOR_ADJUST(Color);
+
+  if (X1 == X2)
+  {
+    OrderCoord(&Y1, &Y2);
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    if (CheckRect (&X1, &Y1, &X2, &Y2))
+#endif
+    {
+      VertLine(X1, Y1, Y2, Color);
+      MarkDisplayBoxRepaint(X1, Y1, X1, Y2);
+    }
+  }
+  else if (Y1 == Y2)
+  {
+    OrderCoord(&X1, &X2);
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    if (CheckRect (&X1, &Y1, &X2, &Y2))
+#endif
+    {
+      HorzLine(X1, X2, Y1, Color);
+      MarkDisplayBoxRepaint(X1, Y1, X2, Y1);
+    }
+  }
+  else
+  {
+    Slope = labs ((10000 * (GuiConst_INT32S) (Y2 - Y1))) /
+       labs ((GuiConst_INT32S) (X2 - X1));
+
+    if (Slope <= 10000)
+    {
+      if (OrderCoord(&X1, &X2))
+        SwapCoord(&Y1, &Y2);
+
+      X = 0;
+      Offset = 0;
+      RemCoord = 0;
+      OffsetCnt = 0;
+      if (Y1 < Y2)
+        OffsetDir = 1;
+      else
+        OffsetDir = -1;
+      do
+      {
+        NewOffset = (((GuiConst_INT32S) X * Slope) + 5000) / 10000;
+        if (((X > 0) && (NewOffset != Offset)) || (X > X2 - X1))
+        {
+          PX1 = X1 + RemCoord;
+          PY1 = Y1 + OffsetDir * Offset;
+          PX2 = PX1 + OffsetCnt - 1;
+          if (OffsetCnt == 1)
+            MakeDot(PX1, PY1, Color);
+          else
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+               if (CheckRect (&PX1, &PY1, &PX2, &PY1))
+#endif
+          {
+            HorzLine(PX1, PX2, PY1, Color);
+            MarkDisplayBoxRepaint(PX1, PY1, PX2, PY1);
+          }
+          OffsetCnt = 1;
+          RemCoord = X;
+
+          if (X > X2 - X1)
+            return;
+        }
+        else
+          OffsetCnt++;
+
+        Offset = NewOffset;
+        X++;
+      }
+      while (1);
+    }
+    else
+    {
+      if (OrderCoord(&Y1, &Y2))
+        SwapCoord(&X1, &X2);
+
+      Y = 0;
+      Offset = 0;
+      RemCoord = 0;
+      OffsetCnt = 0;
+      if (X1 < X2)
+        OffsetDir = 1;
+      else
+        OffsetDir = -1;
+      do
+      {
+        NewOffset = (((GuiConst_INT32S) Y * 10000) + (Slope / 2)) / Slope;
+        if (((Y > 0) && (NewOffset != Offset)) || (Y > Y2 - Y1))
+        {
+          PX1 = X1 + OffsetDir * Offset;
+          PY1 = Y1 + RemCoord;
+          PY2 = PY1 + OffsetCnt - 1;
+          if (OffsetCnt == 1)
+            MakeDot(PX1, PY1, Color);
+          else
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+               if (CheckRect (&PX1, &PY1, &PX1, &PY2))
+#endif
+          {
+            VertLine(PX1, PY1, PY2, Color);
+            MarkDisplayBoxRepaint(PX1, PY1, PX1, PY2);
+          }
+          OffsetCnt = 1;
+          RemCoord = Y;
+
+          if (Y > Y2 - Y1)
+            return;
+        }
+        else
+          OffsetCnt++;
+
+        Offset = NewOffset;
+        Y++;
+      }
+      while (1);
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_LinePattern(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INT8U LinePattern,
+   GuiConst_INTCOLOR Color)
+{
+  GuiConst_INT16S X,Y;
+  GuiConst_INT32S Slope;
+  GuiConst_INT16S Offset;
+  GuiConst_INT8U MaskTemp;
+  GuiConst_INT8U MaskCtr = 0;
+  GuiConst_INT8U Vertical;
+
+  GuiLib_COORD_ADJUST(X1, Y1);
+  GuiLib_COORD_ADJUST(X2, Y2);
+  GuiLib_COLOR_ADJUST(Color);
+
+  Vertical = (X1 == X2);
+  if (Vertical)
+    Offset = 0;
+  else
+    Slope = labs ((10000 * (GuiConst_INT32S)(Y2 - Y1))) /
+            labs ((GuiConst_INT32S)(X2 - X1));
+
+  if (Vertical || (Slope > 10000))
+  {
+    if (OrderCoord(&Y1, &Y2))
+      SwapCoord(&X1, &X2);
+
+    for (Y = 0; Y <= Y2 - Y1; Y++)
+    {
+      if (MaskCtr == 0 )
+      {
+        MaskCtr = 8;
+        MaskTemp = LinePattern;
+      }
+      if (MaskTemp & 0x01)
+      {
+        if (!Vertical)
+          Offset = (((GuiConst_INT32S) Y * 10000) + (Slope / 2)) / Slope;
+        if (X1 < X2)
+          MakeDot(X1 + Offset, Y1 + Y, Color);
+        else
+          MakeDot(X1 - Offset, Y1 + Y, Color);
+      }
+      MaskTemp >>= 1;
+      MaskCtr--;
+    }
+  }
+  else
+  {
+    if (OrderCoord(&X1, &X2))
+      SwapCoord(&Y1, &Y2);
+
+    for (X = 0; X <= X2 - X1; X++)
+    {
+      if (MaskCtr == 0 )
+      {
+        MaskCtr = 8;
+        MaskTemp = LinePattern;
+      }
+
+      if (MaskTemp & 0x01)
+      {
+        Offset = (((GuiConst_INT32S) X * Slope) + 5000) / 10000;
+        if (Y1 < Y2)
+          MakeDot(X1 + X, Y1 + Offset, Color);
+        else
+          MakeDot(X1 + X, Y1 - Offset, Color);
+      }
+      MaskTemp >>= 1;
+      MaskCtr--;
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_HLine(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y,
+   GuiConst_INTCOLOR Color)
+{
+  GuiLib_Line(X1, Y, X2, Y, Color);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_VLine(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color)
+{
+  GuiLib_Line(X, Y1, X, Y2, Color);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Box(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color)
+{
+  GuiConst_INT16S X1C;
+  GuiConst_INT16S Y1C;
+  GuiConst_INT16S X2C;
+  GuiConst_INT16S Y2C;
+
+  GuiLib_COORD_ADJUST(X1, Y1);
+  GuiLib_COORD_ADJUST(X2, Y2);
+  GuiLib_COLOR_ADJUST(Color);
+
+  OrderCoord(&X1, &X2);
+  OrderCoord(&Y1, &Y2);
+
+  X1C = X1;
+  Y1C = Y1;
+  X2C = X2;
+  Y2C = Y2;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (CheckRect(&X1C, &Y1C, &X2C, &Y2C))
+#endif
+  {
+    MarkDisplayBoxRepaint(X1C, Y1C, X2C, Y2C);
+    X1C = X1;
+    Y1C = Y1;
+    X2C = X1;
+    Y2C = Y2;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    if (CheckRect(&X1C, &Y1C, &X1C, &Y2C))
+#endif
+      VertLine(X1C, Y1C, Y2C, Color);
+    X1C = X2;
+    Y1C = Y1;
+    X2C = X2;
+    Y2C = Y2;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    if (CheckRect(&X2C, &Y1C, &X2C, &Y2C))
+#endif
+      VertLine(X2C, Y1C, Y2C, Color);
+    if (X2 - X1 > 1)
+    {
+      X1C = X1 + 1;
+      Y1C = Y1;
+      X2C = X2 - 1;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      if (CheckRect(&X1C, &Y1C, &X2C, &Y1C))
+#endif
+        HorzLine(X1C, X2C, Y1C, Color);
+      X1C = X1 + 1;
+      Y1C = Y2;
+      X2C = X2 - 1;
+      Y2C = Y2;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      if (CheckRect(&X1C, &Y2C, &X2C, &Y2C))
+#endif
+        HorzLine(X1C, X2C, Y2C, Color);
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_FillBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color)
+{
+  GuiLib_COORD_ADJUST(X1, Y1);
+  GuiLib_COORD_ADJUST(X2, Y2);
+  GuiLib_COLOR_ADJUST(Color);
+
+  OrderCoord(&X1, &X2);
+  OrderCoord(&Y1, &Y2);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (CheckRect (&X1, &Y1, &X2, &Y2))
+#endif
+  {
+    MarkDisplayBoxRepaint(X1, Y1, X2, Y2);
+#ifdef GuiConst_BYTE_HORIZONTAL
+    while (Y1 <= Y2)
+    {
+      HorzLine(X1, X2, Y1, Color);
+      Y1++;
+    }
+#else
+    while (X1 <= X2)
+    {
+      VertLine(X1, Y1, Y2, Color);
+      X1++;
+    }
+#endif
+  }
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_BorderBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR BorderColor,
+   GuiConst_INTCOLOR FillColor)
+{
+  GuiLib_Box(X1, Y1, X2, Y2, BorderColor);
+  OrderCoord(&X1, &X2);
+  OrderCoord(&Y1, &Y2);
+  if (((X2 - X1) >= 2) && ((Y2 - Y1) >= 2))
+    GuiLib_FillBox(X1+1, Y1+1, X2-1, Y2-1, FillColor);
+}
+
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+//------------------------------------------------------------------------------
+static void ReadBitmapSizes(
+   GuiConst_INT16U BitmapIndex)
+{
+#ifndef GuiConst_REMOTE_BITMAP_DATA
+   GuiConst_INT8U PrefixRom * PixelDataPtr;
+#endif
+
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+  if (BitmapIndex != sgl.CurRemoteBitmap)
+  {
+    GuiLib_RemoteDataReadBlock(
+       (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex],
+       (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex + 1] -
+       (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex],
+       sgl.GuiLib_RemoteBitmapBuffer);
+    sgl.CurRemoteBitmap = BitmapIndex;
+  }
+  sgl.BitmapSizeX = (GuiConst_INT16S)sgl.GuiLib_RemoteBitmapBuffer[0] +
+                    256*(GuiConst_INT16S)sgl.GuiLib_RemoteBitmapBuffer[1];
+  sgl.BitmapSizeY = (GuiConst_INT16S)sgl.GuiLib_RemoteBitmapBuffer[2] +
+                    256*(GuiConst_INT16S)sgl.GuiLib_RemoteBitmapBuffer[3];
+#else
+  PixelDataPtr =
+     (GuiConst_INT8U PrefixRom *)ReadWord(GuiStruct_BitmapPtrList[BitmapIndex]);
+
+  sgl.BitmapSizeX = (GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+  sgl.BitmapSizeX += 256*(GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+  sgl.BitmapSizeY = (GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+  sgl.BitmapSizeY += 256*(GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+#endif
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_ShowBitmap(
+   GuiConst_INT16U BitmapIndex,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT32S TranspColor)
+{
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+  if (BitmapIndex != sgl.CurRemoteBitmap)
+  {
+    GuiLib_RemoteDataReadBlock(
+       (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex],
+       (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex + 1] -
+       (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex],
+       sgl.GuiLib_RemoteBitmapBuffer);
+    sgl.CurRemoteBitmap = BitmapIndex;
+  }
+  ShowBitmapArea(&sgl.GuiLib_RemoteBitmapBuffer[0],
+     X, Y, 0, 0, 0, 0, TranspColor, GuiLib_FULL_BITMAP);
+#else
+  ShowBitmapArea(
+     (GuiConst_INT8U PrefixRom *)ReadWord(GuiStruct_BitmapPtrList[BitmapIndex]),
+      X, Y, 0, 0, 0, 0, TranspColor, GuiLib_FULL_BITMAP);
+#endif
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_ShowBitmapAt(
+   GuiConst_INT8U * BitmapPtr,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT32S TranspColor)
+{
+  ShowBitmapArea(
+     BitmapPtr, X, Y, 0, 0, 0, 0, TranspColor, GuiLib_FULL_BITMAP);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_ShowBitmapArea(
+   GuiConst_INT16U BitmapIndex,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S AX1,
+   GuiConst_INT16S AY1,
+   GuiConst_INT16S AX2,
+   GuiConst_INT16S AY2,
+   GuiConst_INT32S TranspColor)
+{
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+  if (BitmapIndex != sgl.CurRemoteBitmap)
+  {
+    GuiLib_RemoteDataReadBlock(
+     (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex],
+     (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex + 1] -
+     (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[BitmapIndex],
+     sgl.GuiLib_RemoteBitmapBuffer);
+  sgl.CurRemoteBitmap = BitmapIndex;
+  }
+  ShowBitmapArea(&sgl.GuiLib_RemoteBitmapBuffer[0],
+   X, Y, AX1, AY1, AX2, AY2, TranspColor, GuiLib_AREA_BITMAP);
+#else
+  ShowBitmapArea(
+     (GuiConst_INT8U PrefixRom *)ReadWord(GuiStruct_BitmapPtrList[BitmapIndex]),
+      X, Y, AX1, AY1, AX2, AY2, TranspColor, GuiLib_AREA_BITMAP);
+#endif
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_ShowBitmapAreaAt(
+   GuiConst_INT8U * BitmapPtr,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S AX1,
+   GuiConst_INT16S AY1,
+   GuiConst_INT16S AX2,
+   GuiConst_INT16S AY2,
+   GuiConst_INT32S TranspColor)
+{
+  ShowBitmapArea(
+     BitmapPtr, X, Y, AX1, AY1, AX2, AY2, TranspColor, GuiLib_AREA_BITMAP);
+}
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiGraph16.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,972 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2015 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*        12/15/16 bit (4096/32K/64K color) graphics primitives library     */
+/*                               v6.0.9.005                                 */
+/*                                                                          */
+/*     GuiLib.c include file - do NOT reference it in your linker setup     */
+/*                                                                          */
+/* ************************************************************************ */
+
+//------------------------------------------------------------------------------
+#define WANT_DOUBLE_BUFFERING // Also in GuiDisplay.c, GuiLib.c - *** all three must match ***
+#ifdef WANT_DOUBLE_BUFFERING
+//DisplayBufUnion GuiLib_DisplayBuf;
+// Experiment - what if we put GuiLib_DisplayBuf at a specific location - but not the display?
+//DisplayBufUnion GuiLib_DisplayBuf __attribute__((at(0xA00BB810))); // Result of second DMBoard->display->allocateFramebuffer() call
+DisplayBufUnion GuiLib_DisplayBuf __attribute__((at(0xA00BCFE0))); // Result of second DMBoard->display->allocateFramebuffer() call (as of 26 Oct 2016)
+#else // Want to write direct to the display
+//DisplayBufUnion GuiLib_DisplayBuf __attribute__((at(0xA0000008))); // Result of first DMBoard->display->allocateFramebuffer() call
+DisplayBufUnion GuiLib_DisplayBuf __attribute__((at(0xA00017D8))); // Result of first DMBoard->display->allocateFramebuffer() call (as of 26 Oct 2016)
+                                                                   // Must be same as FRAME_ADDRESS in GuiDisplay.h
+#endif
+
+//==============================================================================
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+//------------------------------------------------------------------------------
+static void SetClipping(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  if (X1 < 0)
+    X1 = 0;
+  if (Y1 < 0)
+    Y1 = 0;
+  if (X2 > (GuiConst_INT16S)sgl.CurLayerWidth - 1)
+    X2 = (GuiConst_INT16S)sgl.CurLayerWidth - 1;
+  if (Y2 > (GuiConst_INT16S)sgl.CurLayerHeight - 1)
+    Y2 = (GuiConst_INT16S)sgl.CurLayerHeight - 1;
+
+  sgl.ClippingX1 = X1;
+  sgl.ClippingY1 = Y1;
+  sgl.ClippingX2 = X2;
+  sgl.ClippingY2 = Y2;
+}
+#endif
+
+//------------------------------------------------------------------------------
+static void MarkDisplayBoxRepaint(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  if (!sgl.BaseLayerDrawing)
+    return;
+
+  while (Y1 <= Y2)
+  {
+    if ((GuiLib_DisplayRepaint[Y1].ByteEnd == -1) ||
+        (X1 < GuiLib_DisplayRepaint[Y1].ByteBegin))
+      GuiLib_DisplayRepaint[Y1].ByteBegin = X1;
+    if (X2 > GuiLib_DisplayRepaint[Y1].ByteEnd)
+      GuiLib_DisplayRepaint[Y1].ByteEnd = X2;
+    #ifdef GuiConst_VNC_REMOTE_SUPPORT_ON
+    if ((GuiLib_VncRepaint[Y1].ByteEnd == -1) ||
+        (X1 < GuiLib_VncRepaint[Y1].ByteBegin))
+      GuiLib_VncRepaint[Y1].ByteBegin = X1;
+    if (X2 > GuiLib_VncRepaint[Y1].ByteEnd)
+      GuiLib_VncRepaint[Y1].ByteEnd = X2;
+    #endif
+
+    Y1++;
+  }
+}
+
+//------------------------------------------------------------------------------
+static void ClearDisplay(void)
+{
+  int X,Y;
+  GuiConst_INT16U *PixelPtr;
+
+  PixelPtr = (GuiConst_INT16U*)sgl.CurLayerBufPtr;
+  for (Y = 0; Y < (GuiConst_INT16S)sgl.CurLayerHeight; Y++)
+    for (X = 0; X < (GuiConst_INT16S)sgl.CurLayerWidth; X++)
+    {
+      *PixelPtr = GuiConst_PIXEL_OFF;
+      PixelPtr++;
+    }
+}
+
+//------------------------------------------------------------------------------
+static void MakeDot(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INTCOLOR Color)
+{
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (CheckRect (&X, &Y, &X, &Y))
+#endif
+  {
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+    *((GuiConst_INT16U*)sgl.CurLayerBufPtr +
+      (GuiConst_INT32U)Y * sgl.CurLayerWidth + (GuiConst_INT32U)X) =
+       (Color << 8 ) | (Color >> 8);
+#else
+    *((GuiConst_INT16U*)sgl.CurLayerBufPtr +
+      (GuiConst_INT32U)Y * sgl.CurLayerWidth + (GuiConst_INT32U)X) = Color;
+#endif
+    MarkDisplayBoxRepaint(X, Y, X, Y);
+  }
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INTCOLOR ReadDot(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y)
+{
+  GuiConst_INT16U *PixelPtr;
+
+  if ((X < 0) || (X >= (GuiConst_INT16S)sgl.CurLayerWidth) ||
+      (Y < 0) || (Y >= (GuiConst_INT16S)sgl.CurLayerHeight))
+    return (0);
+  else
+  {
+    PixelPtr = (GuiConst_INT16U*)sgl.CurLayerBufPtr +
+               (GuiConst_INT32U)Y * sgl.CurLayerWidth + (GuiConst_INT32U)X;
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+    return ((*PixelPtr << 8) | (*PixelPtr >> 8));
+#else
+    return (*PixelPtr);
+#endif
+  }
+}
+
+//------------------------------------------------------------------------------
+static void HorzLine(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y,
+   GuiConst_INTCOLOR Color)
+{
+  GuiConst_INT16U *PixelPtr;
+
+  PixelPtr = (GuiConst_INT16U*)sgl.CurLayerBufPtr +
+             (GuiConst_INT32U)Y * sgl.CurLayerWidth + (GuiConst_INT32U)X1;
+  while (X1 <= X2)
+  {
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+    *PixelPtr = (Color << 8) | (Color >> 8);
+#else
+    *PixelPtr = Color;
+#endif
+    PixelPtr++;
+    X1++;
+  }
+}
+
+//------------------------------------------------------------------------------
+static void VertLine(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color)
+{
+  GuiConst_INT16U *PixelPtr;
+
+  PixelPtr = (GuiConst_INT16U*)sgl.CurLayerBufPtr +
+             (GuiConst_INT32U)Y1 * sgl.CurLayerWidth + (GuiConst_INT32U)X;
+  while (Y1 <= Y2)
+  {
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+    *PixelPtr = (Color << 8) | (Color >> 8);
+#else
+    *PixelPtr = Color;
+#endif
+    Y1++;
+    PixelPtr += sgl.CurLayerWidth;
+  }
+}
+
+//------------------------------------------------------------------------------
+static void DrawChar(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiLib_FontRecPtr Font,
+#ifdef GuiConst_REMOTE_FONT_DATA
+   GuiConst_INT32S CharNdx,
+#else
+   GuiConst_INT8U PrefixRom * CharPtr,
+#endif
+   GuiConst_INTCOLOR Color,
+   GuiConst_INT8U FullPixelFill)
+{
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U *PixelData;
+  GuiConst_INT8U * CharPtr;
+#else
+  GuiConst_INT8U PrefixRom *PixelData;
+#endif
+  GuiConst_INT8U PixelPattern;
+  GuiConst_INT16S N;
+  GuiConst_INT8U YHeight;
+  GuiConst_INT8U PixN;
+  GuiConst_INT16S Bx;
+  GuiConst_INT16S PY, Y2;
+  GuiConst_INT8U PixelLineSize;
+#ifndef GuiConst_FONT_UNCOMPRESSED
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U *LineCtrl;
+#else
+  GuiConst_INT8U PrefixRom *LineCtrl;
+#endif
+  GuiConst_INT8U LineCtrlByte;
+  GuiConst_INT16S LineRepeat;
+  GuiConst_INT16S M;
+  GuiConst_INT8U Finished;
+  GuiConst_INT16U *PixelPtr;
+#endif
+#ifdef GuiConst_ADV_FONTS_ON
+  GuiConst_INT8U PixelShade, PixelShadeInv;
+  GuiConst_INTCOLOR PixelColor;
+  GuiConst_INT8U PixelR, PixelG, PixelB;
+  GuiConst_INT8U ColorR, ColorG, ColorB;
+#endif
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (sgl.ClippingTotal)
+    return;
+#endif
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+  if (CharNdx != sgl.CurRemoteFont)
+  {
+    GuiLib_RemoteDataReadBlock(
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[CharNdx],
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[CharNdx + 1] -
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[CharNdx],
+       sgl.GuiLib_RemoteFontBuffer);
+    sgl.CurRemoteFont = CharNdx;
+  }
+  CharPtr = &sgl.GuiLib_RemoteFontBuffer[0];
+#endif
+
+  if ((*(CharPtr + GuiLib_CHR_XWIDTH_OFS) == 0) ||
+      (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) == 0))
+    return;
+
+  GuiLib_COORD_ADJUST(X, Y);
+  GuiLib_COLOR_ADJUST(Color);
+
+  gl.Dummy1_8U = Font->LineSize;   // To avoid compiler warning
+#ifdef GuiConst_FONT_UNCOMPRESSED
+  PixelLineSize = Font->LineSize;
+  #ifdef GuiConst_ROTATED_90DEGREE
+  YHeight = Font->XSize;
+  #else
+  YHeight = Font->YSize;
+  #endif
+  PixelData = CharPtr + GuiLib_CHR_LINECTRL_OFS + 1;
+#else
+  #ifdef GuiConst_ROTATED_90DEGREE
+  PixelLineSize = *(CharPtr + GuiLib_CHR_YHEIGHT_OFS);
+  YHeight = *(CharPtr + GuiLib_CHR_XWIDTH_OFS);
+  #else
+  PixelLineSize = *(CharPtr + GuiLib_CHR_XWIDTH_OFS);
+  YHeight = *(CharPtr + GuiLib_CHR_YHEIGHT_OFS);
+  #endif
+  LineCtrl = CharPtr + GuiLib_CHR_LINECTRL_OFS;
+  N = (YHeight + 7) / 8;
+  if (N == 0)
+    N++;
+  PixelData = LineCtrl + N;
+#ifdef GuiConst_ADV_FONTS_ON
+  if (Font->ColorDepth == 4)
+    PixelLineSize = (PixelLineSize + 1) / 2;
+  else
+#endif
+    PixelLineSize = (PixelLineSize + 7) / 8;
+#endif
+
+#ifdef GuiConst_FONT_UNCOMPRESSED
+
+#ifdef GuiConst_ROTATED_OFF
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= Font->XSize - 1;
+  Y -= Font->YSize - 1;
+    #else
+  X -= Font->XSize - 1;
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  Y -= Font->YSize - 1;
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_90DEGREE_RIGHT
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= Font->YSize - 1;
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= Font->YSize - 1;
+  Y -= Font->XSize - 1;
+    #else
+  Y -= Font->XSize - 1;
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_UPSIDEDOWN
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifndef GuiConst_MIRRORED_VERTICALLY
+  Y -= Font->YSize - 1;
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= Font->XSize - 1;
+    #else
+  X -= Font->XSize - 1;
+  Y -= Font->YSize - 1;
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_90DEGREE_LEFT
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  Y -= Font->XSize - 1;
+    #else
+  X -= Font->YSize - 1;
+  Y -= Font->XSize - 1;
+    #endif
+  #else
+    #ifndef GuiConst_MIRRORED_VERTICALLY
+  X -= Font->YSize - 1;
+    #endif
+  #endif
+#endif
+
+#else
+
+#ifdef GuiConst_ROTATED_OFF
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+  Y -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+    #else
+  X -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+  Y += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+  Y -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+    #else
+  X += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+  Y += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_90DEGREE_RIGHT
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+  Y += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+    #else
+  X += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+  Y += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+  Y -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+    #else
+  X += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+  Y -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_UPSIDEDOWN
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+  Y += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+    #else
+  X += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+  Y -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+  Y += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+    #else
+  X -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+  Y -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_90DEGREE_LEFT
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+  Y -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+    #else
+  X -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+  Y -= (*(CharPtr + GuiLib_CHR_XWIDTH_OFS) +
+        *(CharPtr + GuiLib_CHR_XLEFT_OFS) - 1);
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X += *(CharPtr + GuiLib_CHR_YTOP_OFS);
+  Y += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+    #else
+  X -= (*(CharPtr + GuiLib_CHR_YHEIGHT_OFS) +
+        *(CharPtr + GuiLib_CHR_YTOP_OFS) - 1);
+  Y += *(CharPtr + GuiLib_CHR_XLEFT_OFS);
+    #endif
+  #endif
+#endif
+
+#endif
+
+#ifdef GuiConst_ADV_FONTS_ON
+  ColorR = (Color & GuiConst_COLORCODING_R_MASK) >>
+     GuiConst_COLORCODING_R_START;
+  ColorG = (Color & GuiConst_COLORCODING_G_MASK) >>
+     GuiConst_COLORCODING_G_START;
+  ColorB = (Color & GuiConst_COLORCODING_B_MASK) >>
+     GuiConst_COLORCODING_B_START;
+#endif
+
+  PY = 0;
+#ifndef GuiConst_FONT_UNCOMPRESSED
+  LineCtrlByte = *LineCtrl;
+  LineCtrlByte >>= 1;
+  LineCtrl++;
+#endif
+  while (PY < YHeight)
+  {
+#ifndef GuiConst_FONT_UNCOMPRESSED
+    LineRepeat = 0;
+    do
+    {
+      LineRepeat++;
+      Finished = (((LineCtrlByte & 0x01) == 0) || (PY >= YHeight - 1));
+
+      PY++;
+      if (PY % 8 == 7)
+      {
+        LineCtrlByte = *LineCtrl;
+        LineCtrl++;
+      }
+      else
+        LineCtrlByte >>= 1;
+    }
+    while (!Finished);
+#endif
+
+#ifdef GuiConst_ADV_FONTS_ON
+    if (Font->ColorDepth == 4)
+      Bx = X;
+    else
+#endif
+      Bx = X;
+
+    for (N = 0; N < PixelLineSize; N++)
+    {
+      PixelPattern = *PixelData;
+
+      if (PixelPattern != 0)
+      {
+#ifdef GuiConst_ADV_FONTS_ON
+        if (Font->ColorDepth == 4)
+        {
+          for (PixN = 0; PixN < 2; PixN++)
+          {
+            if (PixN == 0)
+              PixelShade = PixelPattern & 0x0F;
+            else
+              PixelShade = (PixelPattern & 0xF0) >> 4;
+            if (FullPixelFill && (PixelShade > 0))
+              PixelShade = 0x0F;
+            if (
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+                (Bx + PixN >= sgl.ClippingX1) && (Bx + PixN <= sgl.ClippingX2) &&
+#endif
+               (PixelShade > 0))
+            {
+              PixelShadeInv = 15 - PixelShade;
+              Y2 = Y;
+              PixelPtr = (GuiConst_INT16U*)sgl.CurLayerBufPtr +
+                         (GuiConst_INT32U)Y2 * sgl.CurLayerWidth +
+                         (GuiConst_INT32U)(Bx + PixN);
+#ifndef GuiConst_FONT_UNCOMPRESSED
+              for (M = 0; M < LineRepeat; M++)
+#endif
+              {
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+                if ((Y2 >= sgl.ClippingY1) && (Y2 <= sgl.ClippingY2))
+#endif
+                {
+                  if (PixelShade == 0x0F)
+                  {
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+                    *PixelPtr = (Color << 8) | (Color >> 8);
+#else
+                    *PixelPtr = Color;
+#endif
+                  }
+                  else
+                  {
+                    PixelColor = *PixelPtr;
+                    PixelR = (PixelColor & GuiConst_COLORCODING_R_MASK) >>
+                       GuiConst_COLORCODING_R_START;
+                    PixelG = (PixelColor & GuiConst_COLORCODING_G_MASK) >>
+                       GuiConst_COLORCODING_G_START;
+                    PixelB = (PixelColor & GuiConst_COLORCODING_B_MASK) >>
+                       GuiConst_COLORCODING_B_START;
+                    PixelR = (PixelShade * ColorR + PixelShadeInv * PixelR) / 15;
+                    PixelG = (PixelShade * ColorG + PixelShadeInv * PixelG) / 15;
+                    PixelB = (PixelShade * ColorB + PixelShadeInv * PixelB) / 15;
+                    PixelColor = (PixelR << GuiConst_COLORCODING_R_START) |
+                                (PixelG << GuiConst_COLORCODING_G_START) |
+                                (PixelB << GuiConst_COLORCODING_B_START);
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+                    *PixelPtr = ((PixelColor>>8)&0xFF) | ((PixelColor<<8)&0xFF00);
+#else
+                    *PixelPtr = PixelColor;
+#endif
+                  }
+                }
+                Y2++;
+                PixelPtr += sgl.CurLayerWidth;
+              }
+            }
+          }
+        }
+        else
+  #endif
+        {
+          for (PixN = 0; PixN < 8; PixN++)
+          {
+            if (
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+                (Bx + PixN >= sgl.ClippingX1) && (Bx + PixN <= sgl.ClippingX2) &&
+#endif
+               ((PixelPattern >> (7-PixN)) & 0x01))
+            {
+              Y2 = Y;
+              PixelPtr = (GuiConst_INT16U*)sgl.CurLayerBufPtr +
+                         (GuiConst_INT32U)Y2 * sgl.CurLayerWidth +
+                         (GuiConst_INT32U)(Bx + PixN);
+#ifndef GuiConst_FONT_UNCOMPRESSED
+              for (M = 0; M < LineRepeat; M++)
+#endif
+              {
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+                if ((Y2 >= sgl.ClippingY1) && (Y2 <= sgl.ClippingY2))
+#endif
+                {
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+                  *PixelPtr = (Color << 8) | (Color >> 8);
+#else
+                  *PixelPtr = Color;
+#endif
+                }
+                Y2++;
+                PixelPtr += sgl.CurLayerWidth;
+              }
+            }
+          }
+        }
+      }
+
+      PixelData++;
+#ifdef GuiConst_ADV_FONTS_ON
+      if (Font->ColorDepth == 4)
+        Bx+=2;
+      else
+#endif
+        Bx+=8;
+    }
+
+#ifdef GuiConst_FONT_UNCOMPRESSED
+    PY++;
+    Y++;
+#else
+    Y += LineRepeat;
+#endif
+  }
+}
+
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+
+#define RenderPix                                                              \
+{                                                                              \
+  *PixelPtr2 = *PixelDataPtr2;                                                 \
+  PixelPtr2++;                                                                 \
+  *PixelPtr2 = *(PixelDataPtr2 + 1);                                           \
+  PixelPtr2++;                                                                 \
+}
+
+//------------------------------------------------------------------------------
+static void ShowBitmapArea(
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+   GuiConst_INT8U * PixelDataPtr,
+#else
+   GuiConst_INT8U PrefixRom * PixelDataPtr,
+#endif
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INT32S TranspColor,
+   GuiConst_INT8U BitmapType)
+{
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+   GuiConst_INT8U * PixelDataPtr2;
+#else
+   GuiConst_INT8U PrefixRom * PixelDataPtr2;
+#endif
+  GuiConst_INT16S SizeX;
+  GuiConst_INT16S SizeY;
+  GuiConst_INT8U *PixelPtr1, *PixelPtr2;
+  GuiConst_INT16S I;
+  GuiConst_INT16U Cnt, CntPix;
+  GuiConst_INT8U Diff;
+#ifdef GuiConst_BITMAP_COMPRESSED
+  GuiConst_INT16U Offset;
+  GuiConst_INT16S DX;
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+   GuiConst_INT8U * RemPixelDataPtr;
+   GuiConst_INT8U * LinePixelDataPtr;
+#else
+   GuiConst_INT8U PrefixRom * RemPixelDataPtr;
+   GuiConst_INT8U PrefixRom * LinePixelDataPtr;
+#endif
+#endif
+
+#ifdef GuiConst_DISPLAY_BIG_ENDIAN
+  TranspColor = ((TranspColor&0xFF)<<8)|((TranspColor&0xFF00)>>8);
+#endif
+
+  SizeX = (GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+  SizeX += 256*(GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+  SizeY = (GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+  SizeY += 256*(GuiConst_INT16S)*PixelDataPtr;
+  PixelDataPtr++;
+
+#ifdef GuiConst_ROTATED_90DEGREE
+  sgl.BitmapWriteX2 = X + SizeY - 1;
+  sgl.BitmapWriteY2 = Y + SizeX - 1;
+#else
+  sgl.BitmapWriteX2 = X + SizeX - 1;
+  sgl.BitmapWriteY2 = Y + SizeY - 1;
+#endif
+
+  GuiLib_COORD_ADJUST(X, Y);
+  GuiLib_COLOR_ADJUST_TRANSP(TranspColor);
+
+  if (BitmapType == GuiLib_AREA_BITMAP)
+  {
+    GuiLib_COORD_ADJUST(X1, Y1);
+    GuiLib_COORD_ADJUST(X2, Y2);
+    OrderCoord(&X1, &X2);
+    OrderCoord(&Y1, &Y2);
+  }
+
+#ifdef GuiConst_ROTATED_OFF
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= SizeX - 1;
+  Y -= SizeY - 1;
+    #else
+  X -= SizeX - 1;
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  Y -= SizeY - 1;
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_90DEGREE_RIGHT
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= SizeX - 1;
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= SizeX - 1;
+  Y -= SizeY - 1;
+    #else
+  Y -= SizeY - 1;
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_UPSIDEDOWN
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifndef GuiConst_MIRRORED_VERTICALLY
+  Y -= SizeY - 1;
+    #endif
+  #else
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  X -= SizeX - 1;
+    #else
+  X -= SizeX - 1;
+  Y -= SizeY - 1;
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_ROTATED_90DEGREE_LEFT
+  #ifdef GuiConst_MIRRORED_HORIZONTALLY
+    #ifdef GuiConst_MIRRORED_VERTICALLY
+  Y -= SizeY - 1;
+    #else
+  X -= SizeX - 1;
+  Y -= SizeY - 1;
+    #endif
+  #else
+    #ifndef GuiConst_MIRRORED_VERTICALLY
+  X -= SizeX - 1;
+    #endif
+  #endif
+#endif
+
+  if (BitmapType == GuiLib_AREA_BITMAP)
+  {
+    if ((X1 > X + SizeX - 1) || (X2 < X) || (Y1 > Y + SizeY - 1) || (Y2 < Y))
+      return;
+    if (X1 < X)
+      X1 = X;
+    if (X2 > X + SizeX - 1)
+      X2 = X + SizeX - 1;
+    if (Y1 < Y)
+      Y1 = Y;
+    if (Y2 > Y + SizeY - 1)
+      Y2 = Y + SizeY - 1;
+  }
+  else
+  {
+    X2 = X + SizeX - 1;
+    Y2 = Y + SizeY - 1;
+
+    OrderCoord(&X, &X2);
+    OrderCoord(&Y, &Y2);
+
+    X1 = X;
+    Y1 = Y;
+  }
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (!CheckRect(&X1, &Y1, &X2, &Y2))
+    return;
+#endif
+
+  MarkDisplayBoxRepaint(X1, Y1, X2, Y2);   // Before changing Y1
+
+#ifdef GuiConst_BITMAP_COMPRESSED
+  while (Y < Y1)
+  {
+    Offset = (GuiConst_INT16U)*PixelDataPtr;
+    PixelDataPtr++;
+    Offset += 256 * (GuiConst_INT16U)*PixelDataPtr;
+    PixelDataPtr++;
+    if (Offset != 0)
+    {
+      LinePixelDataPtr = PixelDataPtr;
+      PixelDataPtr += Offset - 2;
+    }
+
+    Y++;
+  }
+  DX = X1 - X;
+#else
+  PixelDataPtr += 2 * (SizeX * (Y1 - Y) + (X1 - X));
+  Diff = 1;
+#endif
+  PixelPtr1 = sgl.CurLayerBufPtr +
+              (GuiConst_INT32U)Y1 * sgl.CurLayerLineSize + (GuiConst_INT32U)(2 * X1);
+  while (Y1 <= Y2)
+  {
+    PixelPtr2 = PixelPtr1;
+
+#ifdef GuiConst_BITMAP_COMPRESSED
+    Offset = (GuiConst_INT16U)*PixelDataPtr;
+    PixelDataPtr++;
+    Offset += 256 * (GuiConst_INT16U)*PixelDataPtr;
+    PixelDataPtr++;
+    if (Offset == 0)
+    {
+      RemPixelDataPtr = PixelDataPtr;
+      PixelDataPtr = LinePixelDataPtr;
+    }
+    else
+      LinePixelDataPtr = PixelDataPtr;
+
+    Cnt = 0;
+    X = DX;
+    while (X > 0)
+    {
+      Diff = *PixelDataPtr;
+      Cnt = Diff & 0x7F;
+      Diff >>= 7;
+      PixelDataPtr++;
+
+      if (X >= Cnt)
+      {
+        if (Diff)
+          PixelDataPtr += 2 * Cnt;
+        else
+          PixelDataPtr += 2;
+        X -= Cnt;
+        Cnt = 0;
+      }
+      else
+      {
+        if (Diff)
+          PixelDataPtr += 2 * X;
+        Cnt -= X;
+        X = 0;
+      }
+    }
+#endif
+
+    PixelDataPtr2 = PixelDataPtr;
+    for (X = X1; X <= X2; X++)
+    {
+#ifdef GuiConst_BITMAP_COMPRESSED
+      if (Cnt == 0)
+      {
+        Diff = *PixelDataPtr2;
+        Cnt = Diff & 0x7F;
+        Diff >>= 7;
+        PixelDataPtr2++;
+      }
+      CntPix = GuiLib_GET_MIN(Cnt, X2 - X + 1);
+      Cnt -= CntPix;
+#else
+      CntPix = X2 - X + 1;
+#endif
+      X += CntPix - 1;
+
+      if (Diff)
+      {
+        if (TranspColor == -1)
+        {
+          CopyBytes(PixelPtr2, PixelDataPtr2, 2 * CntPix);
+          PixelPtr2 += 2 * CntPix;
+          PixelDataPtr2 += 2 * CntPix;
+        }
+        else
+        {
+          while (CntPix > 0)
+          {
+            if (*(GuiConst_INT16U*)PixelDataPtr2 ==
+               (GuiConst_INT16U)TranspColor)
+              PixelPtr2 += 2;
+            else
+            {
+              RenderPix;
+            }
+
+            CntPix--;
+            PixelDataPtr2 += 2;
+          }
+        }
+      }
+#ifdef GuiConst_BITMAP_COMPRESSED
+      else
+      {
+        if ((TranspColor == -1) ||
+           (*(GuiConst_INT16U*)PixelDataPtr2 != (GuiConst_INT16U)TranspColor))
+        {
+          while (CntPix > 0)
+          {
+            RenderPix;
+            CntPix--;
+          }
+        }
+        else
+          PixelPtr2 += 2 * CntPix;
+
+        PixelDataPtr2 += 2;
+      }
+
+      if ((X > X2) && Diff)
+        PixelDataPtr2 += 2 * (X - X2);
+      Cnt = 0;
+#endif
+    }
+
+#ifdef GuiConst_BITMAP_COMPRESSED
+    if (Offset == 0)
+      PixelDataPtr = RemPixelDataPtr;
+    else
+      PixelDataPtr = LinePixelDataPtr + Offset - 2;
+#else
+    PixelDataPtr += 2 * SizeX;
+#endif
+
+    Y1++;
+    PixelPtr1 += sgl.CurLayerLineSize;
+  }
+}
+#endif
+
+//==============================================================================
+
+//------------------------------------------------------------------------------
+void GuiLib_InvertBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  GuiConst_INT16S X;
+  GuiConst_INT16U *PixelPtr;
+  GuiConst_INT32U DeltaLineSize;
+
+  GuiLib_COORD_ADJUST(X1, Y1);
+  GuiLib_COORD_ADJUST(X2, Y2);
+
+  OrderCoord(&X1, &X2);
+  OrderCoord(&Y1, &Y2);
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (CheckRect (&X1, &Y1, &X2, &Y2))
+#endif
+  {
+    MarkDisplayBoxRepaint(X1, Y1, X2, Y2);
+
+    PixelPtr = (GuiConst_INT16U*)sgl.CurLayerBufPtr +
+               (GuiConst_INT32U)Y1 * sgl.CurLayerWidth + (GuiConst_INT32U)X1;
+    DeltaLineSize = sgl.CurLayerWidth - (GuiConst_INT32U)(X2 - X1 + 1);
+    while (Y1 <= Y2)
+    {
+      for (X = X1; X <= X2; X++)
+      {
+        *PixelPtr = ~*PixelPtr;
+        PixelPtr++;
+      }
+      Y1++;
+      PixelPtr += DeltaLineSize;
+    }
+  }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiItems.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,5704 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2015 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                               v6.0.9.005                                 */
+/*                                                                          */
+/*     GuiLib.c include file - do NOT reference it in your linker setup     */
+/*                                                                          */
+/* ************************************************************************ */
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+static GuiConst_INT8U GetItemByte(
+   GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr)
+{
+  GuiConst_INT8U D;
+#ifdef GuiConst_AVRGCC_COMPILER
+  D = ReadBytePtr(*ItemDataPtrPtr);
+#else
+#ifdef GuiConst_AVR_COMPILER_FLASH_RAM
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+#else
+#ifdef GuiConst_ICC_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr;
+  ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+#else
+  D = **ItemDataPtrPtr;
+#endif
+#endif
+#endif
+#endif
+  (*ItemDataPtrPtr)++;
+  return (D);
+}
+//------------------------------------------------------------------------------
+static GuiConst_INT16S GetItemWord(
+   GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr)
+{
+  GuiConst_INT16U D;
+
+#ifdef GuiConst_AVRGCC_COMPILER
+  D = ReadBytePtr(*ItemDataPtrPtr);
+  (*ItemDataPtrPtr)++;
+  D += 0x0100 * (GuiConst_INT16U)ReadBytePtr(*ItemDataPtrPtr);
+#else
+#ifdef GuiConst_AVR_COMPILER_FLASH_RAM
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x0100 * (*ItemFlashPtr);
+#else
+#ifdef GuiConst_ICC_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x0100 * (*ItemFlashPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr;
+  ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x0100 * (*ItemFlashPtr);
+#else
+  D = **ItemDataPtrPtr;
+  (*ItemDataPtrPtr)++;
+  D += 0x0100 * (GuiConst_INT16U)**ItemDataPtrPtr;
+#endif
+#endif
+#endif
+#endif
+  (*ItemDataPtrPtr)++;
+  return ((GuiConst_INT16S) D);
+}
+//------------------------------------------------------------------------------
+#ifdef GuiLib_COLOR_BYTESIZE_3
+static GuiConst_INT32S GetItemTriple(
+   GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr)
+{
+  GuiConst_INT32U D;
+
+#ifdef GuiConst_AVRGCC_COMPILER
+  D = ReadBytePtr(*ItemDataPtrPtr);
+  (*ItemDataPtrPtr)++;
+  D += 0x00000100 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr);
+  (*ItemDataPtrPtr)++;
+  D += 0x00010000 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr);
+#else
+#ifdef GuiConst_AVR_COMPILER_FLASH_RAM
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00000100 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00010000 * (*ItemFlashPtr);
+#else
+#ifdef GuiConst_ICC_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00000100 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00010000 * (*ItemFlashPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr;
+  ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00000100 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00010000 * (*ItemFlashPtr);
+#else
+  D = **ItemDataPtrPtr;
+  (*ItemDataPtrPtr)++;
+  D += 0x00000100 * (GuiConst_INT32U)**ItemDataPtrPtr;
+  (*ItemDataPtrPtr)++;
+  D += 0x00010000 * (GuiConst_INT32U)**ItemDataPtrPtr;
+#endif
+#endif
+#endif
+#endif
+  (*ItemDataPtrPtr)++;
+  return ((GuiConst_INT32S) D);
+}
+#endif
+
+#ifdef GuiLib_GETITEMLONG
+//------------------------------------------------------------------------------
+static GuiConst_INT32S GetItemLong(
+   GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr)
+{
+  GuiConst_INT32U D;
+
+#ifdef GuiConst_AVRGCC_COMPILER
+  D = ReadBytePtr(*ItemDataPtrPtr);
+  (*ItemDataPtrPtr)++;
+  D += 0x00000100 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr);
+  (*ItemDataPtrPtr)++;
+  D += 0x00010000 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr);
+  (*ItemDataPtrPtr)++;
+  D += 0x01000000 * (GuiConst_INT32U)ReadBytePtr(*ItemDataPtrPtr);
+#else
+#ifdef GuiConst_AVR_COMPILER_FLASH_RAM
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00000100 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00010000 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x01000000 * (*ItemFlashPtr);
+#else
+#ifdef GuiConst_ICC_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr =
+     (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00000100 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00010000 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x01000000 * (*ItemFlashPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+  GuiConst_INT8U PrefixRom * ItemFlashPtr;
+  ItemFlashPtr = (GuiConst_INT8U PrefixRom *)*ItemDataPtrPtr;
+  D = *ItemFlashPtr;
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00000100 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x00010000 * (*ItemFlashPtr);
+  (*ItemDataPtrPtr)++;
+  ItemFlashPtr++;
+  D += 0x01000000 * (*ItemFlashPtr);
+#else
+  D = **ItemDataPtrPtr;
+  (*ItemDataPtrPtr)++;
+  D += 0x00000100 * (GuiConst_INT32U)**ItemDataPtrPtr;
+  (*ItemDataPtrPtr)++;
+  D += 0x00010000 * (GuiConst_INT32U)**ItemDataPtrPtr;
+  (*ItemDataPtrPtr)++;
+  D += 0x01000000 * (GuiConst_INT32U)**ItemDataPtrPtr;
+#endif
+#endif
+#endif
+#endif
+  (*ItemDataPtrPtr)++;
+  return ((GuiConst_INT32S) D);
+}
+#endif
+
+//------------------------------------------------------------------------------
+#ifdef GuiLib_COLOR_BYTESIZE_1
+#define GetItemColor GetItemByte
+#endif
+#ifdef GuiLib_COLOR_BYTESIZE_2
+#define GetItemColor GetItemWord
+#endif
+#ifdef GuiLib_COLOR_BYTESIZE_3
+#define GetItemColor GetItemTriple
+#endif
+
+//------------------------------------------------------------------------------
+GuiConst_TEXT PrefixGeneric *GetItemTextPtr(GuiConst_INT8U index)
+{
+#ifndef GuiConst_REMOTE_TEXT_DATA
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  GuiConst_INT16U TxtReadSize;
+#endif
+#endif
+
+  if (index > 2)
+    return NULL;
+
+#ifdef GuiConst_REMOTE_TEXT_DATA
+  sgl.CurItem.TextLength[index] = GetRemoteText(sgl.CurItem.TextIndex[index]);
+  sgl.CurItem.TextPtr[index] = &sgl.GuiLib_RemoteTextBuffer[0];
+
+#else
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+
+  TxtReadSize = sgl.CurItem.TextLength[index] + 1;
+#ifndef GuiConst_CHARMODE_ANSI
+  TxtReadSize *= 2;
+#endif
+
+  GuiLib_RemoteDataReadBlock(sgl.CurItem.TextOffset[index],
+                             TxtReadSize,
+                             (GuiConst_INT8U PrefixGeneric*)&sgl.GuiLib_RemoteStructText);
+  sgl.CurItem.TextPtr[index] = (GuiConst_TEXT PrefixGeneric*)&sgl.GuiLib_RemoteStructText;
+#endif
+#endif // GuiConst_REMOTE_TEXT_DATA
+
+  return sgl.CurItem.TextPtr[index];
+
+
+}
+
+//------------------------------------------------------------------------------
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+#define GuiItem_TEMP_PTR_NEEDED
+#endif
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+#ifndef GuiItem_TEMP_PTR_NEEDED
+#define GuiItem_TEMP_PTR_NEEDED
+#endif
+#endif
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+#ifndef GuiItem_TEMP_PTR_NEEDED
+#define GuiItem_TEMP_PTR_NEEDED
+#endif
+#endif
+
+static void DrawItem(
+   GuiConst_INT8U ColorInvert)
+{
+  GuiConst_INT16U StructToCallIndex;
+  GuiConst_INT32S VarValue;
+  GuiConst_INT16S I, N;
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+  GuiConst_INT8U CheckmarkMode;
+#endif
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+  GuiConst_INT16S RemYMemory;
+#endif
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+  GuiConst_INT8U DisabledGlyphColorInUse;
+  GuiConst_INT8U DisabledTextColorInUse;
+  GuiConst_INT16S CX, CY;
+  GuiConst_INT16S RemX1, RemY1;
+  GuiConst_INT16S GX1, GX2, GY1, GY2;
+  GuiConst_INTCOLOR ButtonColor;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiConst_INT16S RemClippingX1, RemClippingY1, RemClippingX2, RemClippingY2;
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+#endif
+  GuiConst_INT16U StrLen;
+#ifdef GuiItem_TEMP_PTR_NEEDED
+  TextParRec TempTextPar;
+#endif
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  GuiConst_INT8U IsCursorField;
+  GuiConst_INT8U FoundActiveCursorField;
+#endif
+  GuiConst_INTCOLOR ForeColor;
+  GuiConst_INTCOLOR BackColor;
+  GuiConst_INT8U BackColorTransp;
+  GuiConst_INT32S BackColor2;
+#ifndef GuiConst_CHARMODE_ANSI
+  GuiConst_INT16U P;
+#endif
+  GuiConst_TEXT PrefixGeneric *CharPtr;
+  GuiConst_INT16S X1, X2, Y1, Y2;
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  GuiConst_INT16S CX1, CX2, CY1, CY2;
+  GuiConst_INT16S Y;
+  GuiConst_INT16S SourceLayerIndexNo;
+  GuiConst_INT16S DestLayerIndexNo;
+  GuiConst_INT8U PrefixLocate *DestAddress;
+  GuiConst_INT16U DestLineSize;
+  GuiConst_INT16S DestX;
+  GuiConst_INT16S DestY;
+  GuiConst_INT16U DestWidth;
+  GuiConst_INT16U DestHeight;
+  GuiConst_INT8U PrefixLocate *SourceAddress;
+  GuiConst_INT16U SourceLineSize;
+  GuiConst_INT16S SourceX;
+  GuiConst_INT16S SourceY;
+  GuiConst_INT16U SourceWidth;
+  GuiConst_INT16U SourceHeight;
+  GuiConst_INT32S FilterPars[10];
+#endif
+#ifdef GuiConst_ITEM_STRUCTCOND_INUSE
+  GuiConst_INT8U FirstRound;
+#endif
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+  GuiConst_INT32S TouchSearch;
+  GuiConst_INT32S TouchIndex;
+#endif
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  GuiConst_INT16S found;
+  GuiConst_INT16S PrefixLocate *ScrollPos;
+#endif
+
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+  if (!sgl.InitialDrawing)
+  {
+    sgl.CoordOrigoX = sgl.CurItem.CoordOrigoX;
+    sgl.CoordOrigoY = sgl.CurItem.CoordOrigoY;
+  }
+#endif
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (!sgl.InitialDrawing && sgl.DisplayWriting)
+    GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                       sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif
+
+  SetCurFont(sgl.CurItem.TextPar[0].FontIndex);
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  IsCursorField = (sgl.CursorInUse && (sgl.CurItem.CursorFieldNo >= 0));
+  FoundActiveCursorField =
+     (IsCursorField && (GuiLib_ActiveCursorFieldNo == sgl.CurItem.CursorFieldNo));
+  if (FoundActiveCursorField)
+    sgl.CursorActiveFieldFound = 1;
+#endif
+
+  sgl.AutoRedrawSaveIndex = -1;
+
+  if ((sgl.InitialDrawing) || (sgl.AutoRedrawUpdate == GuiLib_TRUE))
+  {
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+    if ((sgl.CurItem.CursorFieldNo >= 0) && (sgl.CursorFieldFound == -1))
+      sgl.CursorFieldFound = sgl.CurItem.CursorFieldNo;
+
+    if (IsCursorField)
+    {
+      sgl.CurItem.CursorFieldLevel++;
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+      if (sgl.NextScrollLineReading)
+      {
+        sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FIELDSCROLLBOX;
+        sgl.CurItem.CursorScrollBoxIndex = sgl.GlobalScrollBoxIndex;
+      }
+      else
+#endif
+        sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FIELDSCROLLBOX;
+
+#ifndef GuiConst_CURSOR_FIELDS_OFF
+      if (!(sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_AUTOREDRAWFIELD))
+        sgl.AutoRedrawSaveIndex = AutoRedraw_InsertCursor(&sgl.CurItem, 0, sgl.DisplayLevel);
+#endif
+    }
+#endif // GuiConst_CURSOR_SUPPORT_ON
+
+    if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_AUTOREDRAWFIELD)
+    {
+      sgl.AutoRedrawSaveIndex = AutoRedraw_Insert(&sgl.CurItem, 0, sgl.DisplayLevel);
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+      if (IsCursorField)
+        AutoRedraw_SetAsCursor(sgl.AutoRedrawSaveIndex);
+#endif // GuiConst_CURSOR_SUPPORT_ON
+    }
+  }
+
+  switch (ColorInvert)
+  {
+    case GuiLib_COL_INVERT_OFF:
+      sgl.SwapColors = 0;
+      break;
+
+    case GuiLib_COL_INVERT_ON:
+      sgl.SwapColors = 1;
+      break;
+
+    case GuiLib_COL_INVERT_IF_CURSOR:
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+      if (FoundActiveCursorField)
+        sgl.SwapColors = 1;
+#else
+      sgl.SwapColors = 0;
+#endif
+      break;
+  }
+  if (sgl.SwapColors)
+  {
+    ForeColor = sgl.CurItem.BarForeColor;
+    BackColor = sgl.CurItem.BarBackColor;
+    BackColorTransp =
+       ((sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_BARTRANSPARENT) > 0);
+  }
+  else
+  {
+    ForeColor = sgl.CurItem.ForeColor;
+    BackColor = sgl.CurItem.BackColor;
+    BackColorTransp =
+       ((sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_TRANSPARENT) > 0);
+  }
+
+  sgl.CurItem.Drawn = 0;
+  switch (sgl.CurItem.ItemType)
+  {
+    case GuiLib_ITEM_CLEARAREA:
+      if (sgl.DisplayWriting)
+      {
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        X2 = sgl.CurItem.X2;
+        Y2 = sgl.CurItem.Y2;
+        OrderCoord(&X1, &X2);
+        OrderCoord(&Y1, &Y2);
+        if (!BackColorTransp)
+          GuiLib_FillBox(X1, Y1, X2, Y2, BackColor);
+        UpdateDrawLimits(X1, Y1, X2, Y2);
+      }
+
+      break;
+
+    case GuiLib_ITEM_TEXT:
+      if (sgl.DisplayWriting)
+      {
+        if (sgl.CurItem.TextPar[0].BackBoxSizeX > 0)
+        {
+          DrawBackBox(BackColor, BackColorTransp, 0);
+          UpdateDrawLimits(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2);
+        }
+
+        DRAW_ROM_TEXT(GetItemTextPtr(0),
+                      sgl.CurItem.TextLength[0],
+                      0,
+                      ForeColor,
+                      BackColor,
+                      BackColorTransp);
+
+        UpdateDrawLimits(sgl.FontWriteX1, sgl.FontWriteY1, sgl.FontWriteX2, sgl.FontWriteY2);
+      }
+
+      break;
+
+    case GuiLib_ITEM_TEXTBLOCK:
+      if (sgl.DisplayWriting)
+      {
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+        ScrollPos = TextBox_Scroll_GetPosRec(
+            sgl.CurItem.CompPars.CompTextBox.ScrollIndex);
+
+        if (ScrollPos != NULL)
+          sgl.CurItem.CompPars.CompTextBox.ScrollPos = *ScrollPos;
+#endif
+        DRAW_ROM_TEXTBLOCK(GetItemTextPtr(0),
+                           sgl.CurItem.TextLength[0],
+                           0,
+                           ForeColor,
+                           BackColor,
+                           BackColorTransp);
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+        if (ScrollPos != NULL)
+          *ScrollPos = sgl.CurItem.CompPars.CompTextBox.ScrollPos;
+#endif
+
+        UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1, sgl.CurItem.X2, sgl.CurItem.Y2);
+#endif
+      }
+
+      break;
+
+    case GuiLib_ITEM_VAR:
+      if (sgl.DisplayWriting)
+      {
+#ifdef GuiConst_DISP_VAR_NOW
+        displayVarNow = 1;
+#endif
+
+        if (sgl.CurItem.TextPar[0].BackBoxSizeX > 0)
+        {
+          DrawBackBox(BackColor, BackColorTransp, 0);
+          UpdateDrawLimits(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2);
+        }
+
+        if (sgl.CurItem.VarPtr != 0)
+        {
+          if (sgl.CurItem.VarType == GuiLib_VAR_STRING)
+          {
+            CharPtr = (GuiConst_TEXT PrefixGeneric *)sgl.CurItem.VarPtr;
+#ifdef GuiConst_CHARMODE_ANSI
+            StrLen = strlen(CharPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+            StrLen = GuiLib_UnicodeStrLen((GuiConst_TEXT*)CharPtr);
+#else
+            StrLen = GuiLib_UnicodeStrLen(CharPtr);
+#endif
+#endif
+          }
+          else
+          {
+            VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+            StrLen = DataNumStr(VarValue, sgl.CurItem.VarType, 0);
+#ifdef GuiConst_CHARMODE_ANSI
+            CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumTextStr;
+#else
+            for (P = 0; P <= StrLen; P++)
+              sgl.VarNumUnicodeTextStr[P] = sgl.VarNumTextStr[P];
+            CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumUnicodeTextStr;
+#endif
+          }
+
+#ifdef GuiConst_CHARMODE_ANSI
+          strcpy(sgl.AnsiTextBuf, CharPtr);
+          DrawText(sgl.AnsiTextBuf,
+                   StrLen,
+                   0,
+                   ForeColor,
+                   BackColor,
+                   BackColorTransp);
+#else
+          GuiLib_UnicodeStrCpy(sgl.UnicodeTextBuf, CharPtr);
+          DrawText(sgl.UnicodeTextBuf,
+                   StrLen,
+                   0,
+                   ForeColor,
+                   BackColor,
+                   BackColorTransp);
+#endif
+        }
+
+#ifdef GuiConst_DISP_VAR_NOW
+        displayVarNow = 0;
+#endif
+
+        UpdateDrawLimits(sgl.FontWriteX1, sgl.FontWriteY1, sgl.FontWriteX2, sgl.FontWriteY2);
+      }
+
+      break;
+
+    case GuiLib_ITEM_VARBLOCK:
+      if (sgl.DisplayWriting)
+      {
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+#ifdef GuiConst_DISP_VAR_NOW
+        displayVarNow = 1;
+#endif
+
+        if (sgl.CurItem.VarPtr != 0)
+        {
+          if (sgl.CurItem.VarType == GuiLib_VAR_STRING)
+          {
+            CharPtr = (GuiConst_TEXT PrefixGeneric *)sgl.CurItem.VarPtr;
+#ifdef GuiConst_CHARMODE_ANSI
+            StrLen = strlen(CharPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+            StrLen = GuiLib_UnicodeStrLen((GuiConst_TEXT*)CharPtr);
+#else
+            StrLen = GuiLib_UnicodeStrLen(CharPtr);
+#endif
+#endif
+          }
+          else
+          {
+            VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+            StrLen = DataNumStr(VarValue, sgl.CurItem.VarType, 0);
+#ifdef GuiConst_CHARMODE_ANSI
+            CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumTextStr;
+#else
+            for (P = 0; P <= StrLen; P++)
+              sgl.VarNumUnicodeTextStr[P] = sgl.VarNumTextStr[P];
+            CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumUnicodeTextStr;
+#endif
+          }
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+        ScrollPos = TextBox_Scroll_GetPosRec(
+            sgl.CurItem.CompPars.CompTextBox.ScrollIndex);
+
+        if (ScrollPos != NULL)
+          sgl.CurItem.CompPars.CompTextBox.ScrollPos = *ScrollPos;
+#endif
+
+#ifdef GuiConst_CHARMODE_ANSI
+          strcpy(sgl.AnsiTextBuf, CharPtr);
+          DrawTextBlock(sgl.AnsiTextBuf,
+                        StrLen,
+                        0,
+                        ForeColor,
+                        BackColor,
+                        BackColorTransp);
+#else
+          GuiLib_UnicodeStrCpy(sgl.UnicodeTextBuf, CharPtr);
+          DrawTextBlock(sgl.UnicodeTextBuf,
+                        StrLen,
+                        0,
+                        ForeColor,
+                        BackColor,
+                        BackColorTransp);
+#endif
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+        if (ScrollPos != NULL)
+          *ScrollPos = sgl.CurItem.CompPars.CompTextBox.ScrollPos;
+#endif
+
+        }
+
+#ifdef GuiConst_DISP_VAR_NOW
+        displayVarNow = 0;
+#endif
+
+        UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1, sgl.CurItem.X2, sgl.CurItem.Y2);
+#endif
+      }
+
+      break;
+
+    case GuiLib_ITEM_DOT:
+      if (sgl.DisplayWriting)
+      {
+        GuiLib_Dot(sgl.CurItem.X1, sgl.CurItem.Y1, ForeColor);
+        UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1, sgl.CurItem.X1, sgl.CurItem.Y1);
+      }
+
+      break;
+
+    case GuiLib_ITEM_LINE:
+      if (sgl.DisplayWriting)
+      {
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        X2 = sgl.CurItem.X2;
+        Y2 = sgl.CurItem.Y2;
+        if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_PATTERNEDLINE)
+          GuiLib_LinePattern(X1, Y1, X2, Y2, sgl.CurItem.LinePattern, ForeColor);
+        else
+          GuiLib_Line(X1, Y1, X2, Y2, ForeColor);
+        UpdateDrawLimits(X1, Y1, X2, Y2);
+      }
+      break;
+
+    case GuiLib_ITEM_FRAME:
+      if (sgl.DisplayWriting)
+      {
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        X2 = sgl.CurItem.X2;
+        Y2 = sgl.CurItem.Y2;
+        OrderCoord(&X1, &X2);
+        OrderCoord(&Y1, &Y2);
+        if (sgl.CurItem.FrameThickness == 0)
+          N = sgl.ThicknessMemory;
+        else
+          N = sgl.CurItem.FrameThickness;
+        DrawBorderBox(X1, Y1, X2, Y2, ForeColor, BackColor, BackColorTransp, N);
+        UpdateDrawLimits(X1, Y1, X2, Y2);
+      }
+
+      break;
+
+    case GuiLib_ITEM_ROUNDEDFRAME:
+      if (sgl.DisplayWriting)
+      {
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        X2 = sgl.CurItem.X2;
+        Y2 = sgl.CurItem.Y2;
+        OrderCoord(&X1, &X2);
+        OrderCoord(&Y1, &Y2);
+
+        if (BackColorTransp)
+          BackColor2 = GuiLib_NO_COLOR;
+        else
+          BackColor2 = BackColor;
+
+        if (sgl.CurItem.R1 <= 0)
+          DrawBorderBox(
+             X1, Y1, X2, Y2,
+             ForeColor, BackColor, BackColorTransp, 1);
+        else
+        {
+          Ellipse(
+             X1 + sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, BackColor2, 0, 0, 1, 0);
+          if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0)
+          {
+            GuiLib_HLine(X1 + sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y1, ForeColor);
+            if (!BackColorTransp)
+              GuiLib_FillBox(
+                 X1 + sgl.CurItem.R1, Y1 + 1, X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1,
+                 BackColor);
+          }
+          Ellipse(
+             X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, BackColor2, 0, 0, 0, 1);
+          if (Y2 - Y1 + 1 - 2 * sgl.CurItem.R1 > 0)
+          {
+            GuiLib_VLine(X1, Y1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, ForeColor);
+            if (!BackColorTransp)
+              GuiLib_FillBox(
+                 X1 + 1, Y1 + sgl.CurItem.R1, X2 - 1, Y2 - sgl.CurItem.R1, BackColor);
+            GuiLib_VLine(X2 , Y1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, ForeColor);
+          }
+          Ellipse(
+             X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, BackColor2, 0, 1, 0, 0);
+          if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0)
+          {
+            if (!BackColorTransp)
+              GuiLib_FillBox(
+                 X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y2 - 1,
+                 BackColor);
+            GuiLib_HLine(X1 + sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y2, ForeColor);
+          }
+          Ellipse(
+             X2 - sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, BackColor2, 1, 0, 0, 0);
+        }
+      }
+      break;
+
+    case GuiLib_ITEM_BLOCK:
+      if (sgl.DisplayWriting)
+      {
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        X2 = sgl.CurItem.X2;
+        Y2 = sgl.CurItem.Y2;
+        OrderCoord(&X1, &X2);
+        OrderCoord(&Y1, &Y2);
+        GuiLib_FillBox(X1, Y1, X2, Y2, ForeColor);
+        UpdateDrawLimits(X1, Y1, X2, Y2);
+      }
+
+      break;
+
+    case GuiLib_ITEM_ROUNDEDBLOCK:
+      if (sgl.DisplayWriting)
+      {
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        X2 = sgl.CurItem.X2;
+        Y2 = sgl.CurItem.Y2;
+        OrderCoord(&X1, &X2);
+        OrderCoord(&Y1, &Y2);
+
+        if (sgl.CurItem.R1 <= 0)
+          GuiLib_FillBox(X1, Y1, X2, Y2, ForeColor);
+        else
+        {
+          Ellipse(
+             X1 + sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, ForeColor, 0, 0, 1, 0);
+          if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0)
+            GuiLib_FillBox(
+               X1 + sgl.CurItem.R1, Y1, X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1,
+               ForeColor);
+          Ellipse(
+             X2 - sgl.CurItem.R1, Y1 + sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, ForeColor, 0, 0, 0, 1);
+          if (Y2 - Y1 + 1 - 2 * sgl.CurItem.R1 > 0)
+            GuiLib_FillBox(X1, Y1 + sgl.CurItem.R1, X2, Y2 - sgl.CurItem.R1, ForeColor);
+          Ellipse(
+             X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, ForeColor, 0, 1, 0, 0);
+          if (X2 - X1 + 1 - 2 * sgl.CurItem.R1 > 0)
+            GuiLib_FillBox(
+               X1 + sgl.CurItem.R1, Y2 - sgl.CurItem.R1, X2 - sgl.CurItem.R1, Y2,
+               ForeColor);
+          Ellipse(
+             X2 - sgl.CurItem.R1, Y2 - sgl.CurItem.R1, sgl.CurItem.R1, sgl.CurItem.R1,
+             ForeColor, ForeColor, 1, 0, 0, 0);
+        }
+      }
+      break;
+
+    case GuiLib_ITEM_CIRCLE:
+      if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0))
+      {
+        if (BackColorTransp)
+          BackColor2 = GuiLib_NO_COLOR;
+        else
+          BackColor2 = BackColor;
+        if ((sgl.CurItem.FrameThickness == 0xFF) &&
+           !(sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CIRCLE_IF))
+        {
+          Ellipse(sgl.CurItem.X1 + sgl.CurItem.R1,
+                  sgl.CurItem.Y1,
+                  sgl.CurItem.R1,
+                  sgl.CurItem.R1,
+                  ForeColor, BackColor2,
+                  1, 1, 1, 1);
+          UpdateDrawLimits(sgl.CurItem.X1,
+                           sgl.CurItem.Y1 - sgl.CurItem.R1,
+                           sgl.CurItem.X1 + 2 * sgl.CurItem.R1,
+                           sgl.CurItem.Y1 + sgl.CurItem.R1);
+        }
+        else
+        {
+          Circle(sgl.CurItem.X1 + sgl.CurItem.R1,
+                 sgl.CurItem.Y1,
+                 sgl.CurItem.R1,
+                 ForeColor,
+                 sgl.CurItem.FrameThickness & 0x01,
+                 sgl.CurItem.FrameThickness & 0x02,
+                 sgl.CurItem.FrameThickness & 0x04,
+                 sgl.CurItem.FrameThickness & 0x08,
+                 sgl.CurItem.FrameThickness & 0x10,
+                 sgl.CurItem.FrameThickness & 0x20,
+                 sgl.CurItem.FrameThickness & 0x40,
+                 sgl.CurItem.FrameThickness & 0x80,
+                 sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CIRCLE_IF);
+          X1 = sgl.CurItem.X1 + sgl.CurItem.R1;
+          Y1 = sgl.CurItem.Y1;
+          X2 = sgl.CurItem.X1 + sgl.CurItem.R1;
+          Y2 = sgl.CurItem.Y1;
+          if (sgl.CurItem.FrameThickness & 0xC3)
+            X2 += sgl.CurItem.R1;
+          if (sgl.CurItem.FrameThickness & 0x3C)
+            X1 -= sgl.CurItem.R1;
+          if (sgl.CurItem.FrameThickness & 0xF0)
+            Y1 -= sgl.CurItem.R1;
+          if (sgl.CurItem.FrameThickness & 0x0F)
+            Y2 += sgl.CurItem.R1;
+          UpdateDrawLimits(X1, Y1, X2, Y2);
+        }
+      }
+      break;
+
+    case GuiLib_ITEM_QUARTERCIRCLE:
+      if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0))
+      {
+        if (BackColorTransp)
+          BackColor2 = GuiLib_NO_COLOR;
+        else
+          BackColor2 = BackColor;
+
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        Ellipse(X1 + sgl.CurItem.R1,
+                Y1,
+                sgl.CurItem.R1,
+                sgl.CurItem.R1,
+                ForeColor, BackColor2,
+                (sgl.CurItem.FrameThickness == 0),
+                (sgl.CurItem.FrameThickness == 1),
+                (sgl.CurItem.FrameThickness == 2),
+                (sgl.CurItem.FrameThickness == 3));
+
+        switch (sgl.CurItem.FrameThickness)
+        {
+          case 1:
+            X1 += sgl.CurItem.R1;
+            break;
+          case 2:
+            X1 += sgl.CurItem.R1;
+            Y1 += sgl.CurItem.R1;
+            break;
+          case 3:
+            Y1 += sgl.CurItem.R1;
+            break;
+        }
+        UpdateDrawLimits(sgl.CurItem.X1,
+                         sgl.CurItem.Y1,
+                         sgl.CurItem.X1 + sgl.CurItem.R1,
+                         sgl.CurItem.Y1 + sgl.CurItem.R1);
+      }
+      break;
+
+    case GuiLib_ITEM_ELLIPSE:
+      if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0) && (sgl.CurItem.R2 >= 0))
+      {
+        if (BackColorTransp)
+          BackColor2 = GuiLib_NO_COLOR;
+        else
+          BackColor2 = BackColor;
+        Ellipse(sgl.CurItem.X1 + sgl.CurItem.R1,
+                sgl.CurItem.Y1,
+                sgl.CurItem.R1,
+                sgl.CurItem.R2,
+                ForeColor, BackColor2, 1, 1, 1, 1);
+
+        UpdateDrawLimits(sgl.CurItem.X1,
+                         sgl.CurItem.Y1 - sgl.CurItem.R2,
+                         sgl.CurItem.X1 + 2 * sgl.CurItem.R1,
+                         sgl.CurItem.Y1 + sgl.CurItem.R2);
+      }
+      break;
+
+    case GuiLib_ITEM_QUARTERELLIPSE:
+      if (sgl.DisplayWriting && (sgl.CurItem.R1 >= 0) && (sgl.CurItem.R2 >= 0))
+      {
+        if (BackColorTransp)
+          BackColor2 = GuiLib_NO_COLOR;
+        else
+          BackColor2 = BackColor;
+
+        X1 = sgl.CurItem.X1;
+        Y1 = sgl.CurItem.Y1;
+        Ellipse(X1 + sgl.CurItem.R1,
+                Y1,
+                sgl.CurItem.R1,
+                sgl.CurItem.R2,
+                ForeColor, BackColor2,
+                (sgl.CurItem.FrameThickness == 0),
+                (sgl.CurItem.FrameThickness == 1),
+                (sgl.CurItem.FrameThickness == 2),
+                (sgl.CurItem.FrameThickness == 3));
+
+        switch (sgl.CurItem.FrameThickness)
+        {
+          case 1:
+            X1 += sgl.CurItem.R1;
+            break;
+          case 2:
+            X1 += sgl.CurItem.R1;
+            Y1 += sgl.CurItem.R2;
+            break;
+          case 3:
+            Y1 += sgl.CurItem.R2;
+            break;
+        }
+        UpdateDrawLimits(sgl.CurItem.X1,
+                         sgl.CurItem.Y1,
+                         sgl.CurItem.X1 + sgl.CurItem.R1,
+                         sgl.CurItem.Y1 + sgl.CurItem.R2);
+      }
+      break;
+
+    case GuiLib_ITEM_BITMAP:
+    case GuiLib_ITEM_BACKGROUND:
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+      if (sgl.DisplayWriting)
+      {
+        if (sgl.CommonByte6 & 0x02)
+          BackColor2 = sgl.CurItem.CompPars.CompBitmap.TranspColor;
+        else
+          BackColor2 = -1;
+        GuiLib_ShowBitmap(sgl.CurItem.StructToCallIndex,
+                          sgl.CurItem.X1,
+                          sgl.CurItem.Y1,
+                          BackColor2);
+        UpdateDrawLimits(sgl.CurItem.X1, sgl.CurItem.Y1,
+                         sgl.BitmapWriteX2, sgl.BitmapWriteY2);
+      }
+
+      if (sgl.CurItem.ItemType == GuiLib_ITEM_BACKGROUND)
+      {
+        sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].InUse = 1;
+        sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].Index =
+           sgl.CurItem.StructToCallIndex;
+        sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].X = sgl.CurItem.X1;
+        sgl.BackgrBitmapAry[sgl.GlobalBackgrBitmapIndex].Y = sgl.CurItem.Y1;
+        if (sgl.GlobalBackgrBitmapIndex < GuiConst_MAX_BACKGROUND_BITMAPS - 1)
+          sgl.GlobalBackgrBitmapIndex++;
+      }
+#endif
+
+      break;
+
+    case GuiLib_ITEM_ACTIVEAREA:
+      if (sgl.DisplayWriting)
+      {
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+        if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CLIPPING)
+        {
+          sgl.CurItem.ClipRectX1 = sgl.CurItem.X1;
+          sgl.CurItem.ClipRectY1 = sgl.CurItem.Y1;
+          sgl.CurItem.ClipRectX2 = sgl.CurItem.X2;
+          sgl.CurItem.ClipRectY2 = sgl.CurItem.Y2;
+          sgl.ActiveAreaX1 = sgl.CurItem.X1;
+          sgl.ActiveAreaY1 = sgl.CurItem.Y1;
+          sgl.ActiveAreaX2 = sgl.CurItem.X2;
+          sgl.ActiveAreaY2 = sgl.CurItem.Y2;
+          OrderCoord(&sgl.ActiveAreaX1, &sgl.ActiveAreaX2);
+          OrderCoord(&sgl.ActiveAreaY1, &sgl.ActiveAreaY2);
+#ifdef GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING
+          if (sgl.ActiveAreaX1 < sgl.DisplayActiveAreaX1)
+            sgl.ActiveAreaX1 = sgl.DisplayActiveAreaX1;
+          if (sgl.ActiveAreaY1 < sgl.DisplayActiveAreaY1)
+            sgl.ActiveAreaY1 = sgl.DisplayActiveAreaY1;
+          if (sgl.ActiveAreaX2 > sgl.DisplayActiveAreaX2)
+            sgl.ActiveAreaX2 = sgl.DisplayActiveAreaX2;
+          if (sgl.ActiveAreaY2 > sgl.DisplayActiveAreaY2)
+            sgl.ActiveAreaY2 = sgl.DisplayActiveAreaY2;
+#endif
+          GuiLib_SetClipping(sgl.ActiveAreaX1, sgl.ActiveAreaY1,
+                             sgl.ActiveAreaX2, sgl.ActiveAreaY2);
+        }
+#endif
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+        if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_ACTIVEAREARELCOORD)
+        {
+          sgl.CurItem.ClipRectX1 += sgl.CoordOrigoX;
+          sgl.CurItem.ClipRectY1 += sgl.CoordOrigoY;
+          sgl.CurItem.ClipRectX2 += sgl.CoordOrigoX;
+          sgl.CurItem.ClipRectY2 += sgl.CoordOrigoY;
+        }
+#endif
+#endif
+
+        sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+        sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+        if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_ACTIVEAREARELCOORD)
+        {
+          sgl.CoordOrigoX += sgl.CurItem.X1;
+          sgl.CoordOrigoY += sgl.CurItem.Y1;
+        }
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+        sgl.CurItem.CoordOrigoX = sgl.CoordOrigoX;
+        sgl.CurItem.CoordOrigoY = sgl.CoordOrigoY;
+#endif
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+        sgl.CurItem.ClipRectX1 -= sgl.CoordOrigoX;
+        sgl.CurItem.ClipRectY1 -= sgl.CoordOrigoY;
+        sgl.CurItem.ClipRectX2 -= sgl.CoordOrigoX;
+        sgl.CurItem.ClipRectY2 -= sgl.CoordOrigoY;
+#endif
+#endif
+      }
+      break;
+
+    case GuiLib_ITEM_CLIPRECT:
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      if (sgl.DisplayWriting)
+      {
+        if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CLIPPING)
+        {
+          sgl.CurItem.ClipRectX1 = sgl.CurItem.X1;
+          sgl.CurItem.ClipRectY1 = sgl.CurItem.Y1;
+          sgl.CurItem.ClipRectX2 = sgl.CurItem.X2;
+          sgl.CurItem.ClipRectY2 = sgl.CurItem.Y2;
+        }
+        StartClipping(
+           (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_CLIPPING) != 0);
+      }
+#endif
+      break;
+
+    case GuiLib_ITEM_STRUCTURE:
+    case GuiLib_ITEM_STRUCTARRAY:
+    case GuiLib_ITEM_STRUCTCOND:
+      if (sgl.DisplayWriting && (sgl.CurItem.TextPar[0].BackBoxSizeX > 0))
+      {
+        DrawBackBox(BackColor, BackColorTransp, 0);
+        UpdateDrawLimits(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2);
+      }
+
+      StructToCallIndex = sgl.CurItem.StructToCallIndex;
+      if (sgl.CurItem.ItemType == GuiLib_ITEM_STRUCTARRAY)
+      {
+        if (StructToCallIndex != 0xFFFF)
+        {
+          VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+
+          I = sgl.CurItem.CompPars.StructCall.IndexCount;
+          while (I > 0)
+          {
+            if (ReadWord(GuiStruct_StructNdxList[StructToCallIndex]) ==
+                VarValue)
+              break;
+
+            StructToCallIndex++;
+            I--;
+          }
+          if (I == 0)
+          {
+            if (ReadWord(GuiStruct_StructNdxList[sgl.CurItem.StructToCallIndex]) == 0xFFFF)
+              StructToCallIndex = sgl.CurItem.StructToCallIndex;
+            else
+              StructToCallIndex = 0xFFFF;
+          }
+        }
+      }
+#ifdef GuiConst_ITEM_STRUCTCOND_INUSE
+      else if (sgl.CurItem.ItemType == GuiLib_ITEM_STRUCTCOND)
+      {
+        VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+
+        I = sgl.CurItem.CompPars.StructCall.IndexCount - 1;
+        FirstRound = 1;
+        while (I >= 0)
+        {
+          if ((VarValue >= sgl.CurItem.CompPars.StructCall.IndexFirst[I]) &&
+              (VarValue <= sgl.CurItem.CompPars.StructCall.IndexLast[I]) &&
+              ((sgl.CurItem.CompPars.StructCall.IndexFirst[I] ==
+                sgl.CurItem.CompPars.StructCall.IndexLast[I]) ||
+              !FirstRound))
+          {
+            StructToCallIndex = sgl.CurItem.CompPars.StructCall.CallIndex[I];
+            break;
+          }
+
+          I--;
+
+          if ((I == -1) && FirstRound)
+          {
+            FirstRound = 0;
+            I = sgl.CurItem.CompPars.StructCall.IndexCount - 1;
+          }
+        }
+      }
+#endif
+      DrawSubStruct(StructToCallIndex, ColorInvert, 0);
+      break;
+
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+    case GuiLib_ITEM_TOUCHAREA:
+      TouchIndex = -1;
+      for (TouchSearch = 0; TouchSearch < sgl.TouchAreaCnt; TouchSearch++)
+        if (sgl.TouchAreas[TouchSearch].IndexNo ==
+            sgl.CurItem.CompPars.CompTouch.AreaNo)
+        {
+          TouchIndex = TouchSearch;
+          break;
+        }
+      if (TouchIndex == -1)
+      {
+        TouchIndex = sgl.TouchAreaCnt;
+        sgl.TouchAreaCnt++;
+      }
+      sgl.TouchAreas[TouchIndex].IndexNo = sgl.CurItem.CompPars.CompTouch.AreaNo;
+      sgl.TouchAreas[TouchIndex].X1 = sgl.CurItem.X1;
+      sgl.TouchAreas[TouchIndex].Y1 = sgl.CurItem.Y1;
+      sgl.TouchAreas[TouchIndex].X2 = sgl.CurItem.X2;
+      sgl.TouchAreas[TouchIndex].Y2 = sgl.CurItem.Y2;
+      OrderCoord(&sgl.TouchAreas[TouchIndex].X1, &sgl.TouchAreas[TouchIndex].X2);
+      OrderCoord(&sgl.TouchAreas[TouchIndex].Y1, &sgl.TouchAreas[TouchIndex].Y2);
+
+      break;
+#endif
+
+    case GuiLib_ITEM_POSCALLBACK:
+      for (I = 0; I < GuiConst_POSCALLBACK_CNT; I++)
+        if (sgl.PosCallbacks[I].InUse &&
+           (sgl.PosCallbacks[I].IndexNo == sgl.CurItem.PosCallbackNo) &&
+           (sgl.PosCallbacks[I].PosCallbackFunc != 0))
+        {
+          (*sgl.PosCallbacks[I].PosCallbackFunc)(sgl.CurItem.PosCallbackNo,
+                                                 sgl.CurItem.X1,
+                                                 sgl.CurItem.Y1);
+          break;
+        }
+      break;
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+    case GuiLib_ITEM_SCROLLBOX:
+      break;
+#endif
+
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+    case GuiLib_ITEM_CHECKBOX:
+      PrepareInternalStruct();
+
+      GuiVarCompInt1 = sgl.CurItem.CompPars.CompCheckBox.Size;
+      sgl.Memory.C[0] = ForeColor;
+
+      Y2 = sgl.CurItem.Y1 + sgl.CurItem.CompPars.CompCheckBox.Size - 1;
+      switch (sgl.CurItem.CompPars.CompCheckBox.Style)
+      {
+        case GuiLib_CHECKBOX_FLAT:
+          if (BackColorTransp)
+            DrawSubStruct(GuiStructCOMP_CBFLATTRANSP, 0, 1);
+          else
+            DrawSubStruct(GuiStructCOMP_CBFLAT, 0, 1);
+          break;
+        case GuiLib_CHECKBOX_3D:
+          DrawSubStruct(GuiStructCOMP_CB3D, 0, 1);
+          if (!BackColorTransp)
+            DrawSubStruct(GuiStructCOMP_CB3DINNER, 0, 1);
+          break;
+        case GuiLib_CHECKBOX_ICON:
+          TempTextPar = sgl.CurItem.TextPar[0];
+          SetCurFont(sgl.CurItem.CompPars.CompCheckBox.IconFont);
+          sgl.CurItem.X1 = sgl.CurItem.X1 + sgl.CurItem.CompPars.CompCheckBox.IconOffsetX;
+          sgl.CurItem.Y1 = sgl.CurItem.Y1 + sgl.CurItem.CompPars.CompCheckBox.IconOffsetY;
+          sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT;
+          sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF;
+          sgl.CurItem.TextPar[0].BitFlags = 0;
+          sgl.CurItem.TextPar[0].BackBoxSizeX = 0;
+          sgl.CurItem.TextPar[0].BackBorderPixels = 0;
+          DrawText(sgl.CurItem.CompPars.CompCheckBox.IconPtr,
+                   1,
+                   0,
+                   ForeColor,
+                   BackColor,
+                   BackColorTransp);
+          Y2 = sgl.FontWriteY2;
+          sgl.CurItem.TextPar[0] = TempTextPar;
+          break;
+        case GuiLib_CHECKBOX_BITMAP:
+          if (sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent)
+            BackColor2 = sgl.CurItem.CompPars.CompCheckBox.BitmapTranspColor;
+          else
+            BackColor2 = -1;
+          GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompCheckBox.BitmapIndex,
+                            sgl.CurItem.X1, sgl.CurItem.Y1,
+                            BackColor2);
+          break;
+      }
+
+      if ((sgl.CurItem.VarPtr != 0) && (sgl.CurItem.VarType != GuiLib_VAR_STRING))
+      {
+        VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+
+        if (VarValue != 0)
+          CheckmarkMode = 1;
+        else if ((sgl.CurItem.CompPars.CompCheckBox.Style == GuiLib_CHECKBOX_NONE) &&
+                 (!BackColorTransp))
+          CheckmarkMode = 2;
+        else
+          CheckmarkMode = 0;
+
+        if (CheckmarkMode > 0)
+        {
+          GuiVarCompInt1 = sgl.CurItem.CompPars.CompCheckBox.Size;
+          if (CheckmarkMode == 1)
+            sgl.Memory.C[0] = sgl.CurItem.CompPars.CompCheckBox.MarkColor;
+          else
+            sgl.Memory.C[0] = BackColor;
+
+          switch (sgl.CurItem.CompPars.CompCheckBox.MarkStyle)
+          {
+            case GuiLib_CHECKBOX_MARK_CHECKED:
+              GuiVarCompInt1 =
+                     (sgl.CurItem.CompPars.CompCheckBox.Size / 2) -
+                     ((sgl.CurItem.CompPars.CompCheckBox.Size - 6) / 6);
+              GuiVarCompInt2 =
+                     (sgl.CurItem.CompPars.CompCheckBox.Size /
+                      2) +
+                     ((sgl.CurItem.CompPars.CompCheckBox.Size - 8) / 6);
+              GuiVarCompInt3 = GuiVarCompInt2 -
+                     ((sgl.CurItem.CompPars.CompCheckBox.Size - 1) / 5);
+              GuiVarCompInt4 = -GuiVarCompInt3;
+              GuiVarCompInt5 = -((GuiVarCompInt3 - 1) / 2);
+              if (((sgl.CurItem.CompPars.CompCheckBox.Style ==
+                    GuiLib_CHECKBOX_FLAT) ||
+                   (sgl.CurItem.CompPars.CompCheckBox.Style ==
+                    GuiLib_CHECKBOX_3D) ||
+                   (sgl.CurItem.CompPars.CompCheckBox.Style ==
+                    GuiLib_CHECKBOX_NONE)) &&
+                   (sgl.CurItem.CompPars.CompCheckBox.Size <= 10))
+                DrawSubStruct(GuiStructCOMP_CBMCHSMALL, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_CBMCHBIG, 0, 1);
+              break;
+            case GuiLib_CHECKBOX_MARK_CROSSED:
+              if ((sgl.CurItem.CompPars.CompCheckBox.Style ==
+                   GuiLib_CHECKBOX_FLAT) &&
+                  (sgl.CurItem.CompPars.CompCheckBox.Size <= 8))
+                DrawSubStruct(GuiStructCOMP_CBMCRFLSMALL, 0, 1);
+              else if (((sgl.CurItem.CompPars.CompCheckBox.Style ==
+                         GuiLib_CHECKBOX_3D) ||
+                        (sgl.CurItem.CompPars.CompCheckBox.Style ==
+                         GuiLib_CHECKBOX_NONE)) &&
+                       (sgl.CurItem.CompPars.CompCheckBox.Size <= 8))
+                DrawSubStruct(GuiStructCOMP_CBMCR3DSMALL, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_CBMCRBIG, 0, 1);
+              break;
+            case GuiLib_CHECKBOX_MARK_FILLED:
+              if (sgl.CurItem.CompPars.CompCheckBox.Style == GuiLib_CHECKBOX_FLAT)
+                DrawSubStruct(GuiStructCOMP_CBMFIFLAT, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_CBMFI3D, 0, 1);
+              break;
+            case GuiLib_CHECKBOX_MARK_ICON:
+              TempTextPar = sgl.CurItem.TextPar[0];
+              SetCurFont(sgl.CurItem.CompPars.CompCheckBox.MarkIconFont);
+              sgl.CurItem.X1 = sgl.CurItem.X1 +
+                               sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX;
+              sgl.CurItem.Y1 = Y2 +
+                               sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY;
+              sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT;
+              sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF;
+              sgl.CurItem.TextPar[0].BitFlags = 0;
+              sgl.CurItem.TextPar[0].BackBoxSizeX = 0;
+              sgl.CurItem.TextPar[0].BackBorderPixels = 0;
+              if (CheckmarkMode == 1)
+                DrawText(sgl.CurItem.CompPars.CompCheckBox.MarkIconPtr,
+                         1,
+                         0,
+                         sgl.CurItem.CompPars.CompCheckBox.MarkColor,
+                         0,
+                         1);
+              else
+                DrawText(sgl.CurItem.CompPars.CompCheckBox.MarkIconPtr,
+                         1,
+                         0,
+                         BackColor,
+                         0,
+                         2);
+              sgl.CurItem.TextPar[0] = TempTextPar;
+              break;
+            case GuiLib_CHECKBOX_MARK_BITMAP:
+              if (CheckmarkMode == 1)
+              {
+                if (sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent)
+                  BackColor2 = sgl.CurItem.CompPars.CompCheckBox.MarkBitmapTranspColor;
+                else
+                  BackColor2 = -1;
+                GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIndex,
+                                  sgl.CurItem.X1 +
+                                  sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX,
+                                  sgl.CurItem.Y1 +
+                                  sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY,
+                                  BackColor2);
+              }
+              else
+              {
+                ReadBitmapSizes(sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIndex);
+                GuiLib_FillBox(sgl.CurItem.X1, sgl.CurItem.Y1,
+                               sgl.CurItem.X1 + sgl.BitmapSizeX -1, sgl.CurItem.Y1 + sgl.BitmapSizeY - 1,
+                               BackColor);
+              }
+              break;
+          }
+        }
+      }
+      break;
+#endif
+
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+    case GuiLib_ITEM_RADIOBUTTON:
+      PrepareInternalStruct();
+
+      X1 = sgl.CurItem.X1;
+      Y1 = sgl.CurItem.Y1;
+      RemYMemory = sgl.Memory.Y[GuiLib_MEMORY_CNT];
+
+      if ((sgl.CurItem.VarPtr != 0) &&
+          (sgl.CurItem.VarType != GuiLib_VAR_STRING))
+        VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+      else
+        VarValue = -1;
+
+      for (N = 0; N < sgl.CurItem.CompPars.CompRadioButton.Count; N++)
+      {
+        GuiVarCompInt1 = sgl.CurItem.CompPars.CompRadioButton.Size;
+        sgl.Memory.C[0] = ForeColor;
+        switch (sgl.CurItem.CompPars.CompRadioButton.Style)
+        {
+          case GuiLib_RADIOBUTTON_FLAT:
+            if (BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_RBFLATTRANSP, 0, 1);
+            else
+              DrawSubStruct(GuiStructCOMP_RBFLAT, 0, 1);
+            break;
+          case GuiLib_RADIOBUTTON_3D:
+            if (!BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_RB3DINNER, 0, 1);
+            DrawSubStruct(GuiStructCOMP_RB3D, 0, 1);
+            break;
+          case GuiLib_RADIOBUTTON_ICON:
+            TempTextPar = sgl.CurItem.TextPar[0];
+            SetCurFont(sgl.CurItem.CompPars.CompRadioButton.IconFont);
+            sgl.CurItem.X1 = X1 + sgl.CurItem.CompPars.CompRadioButton.IconOffsetX;
+            sgl.CurItem.Y1 = Y1 + sgl.CurItem.CompPars.CompRadioButton.IconOffsetY +
+                         sgl.CurFont->BaseLine;
+            sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT;
+            sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF;
+            sgl.CurItem.TextPar[0].BitFlags = 0;
+            sgl.CurItem.TextPar[0].BackBoxSizeX = 0;
+            sgl.CurItem.TextPar[0].BackBorderPixels = 0;
+            DrawText(sgl.CurItem.CompPars.CompRadioButton.IconPtr,
+                     1,
+                     0,
+                     ForeColor,
+                     BackColor,
+                     BackColorTransp);
+            sgl.CurItem.TextPar[0] = TempTextPar;
+            break;
+          case GuiLib_RADIOBUTTON_BITMAP:
+            if (sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent)
+              BackColor2 = sgl.CurItem.CompPars.CompRadioButton.BitmapTranspColor;
+            else
+              BackColor2 = -1;
+            GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompRadioButton.BitmapIndex,
+                              X1, Y1,
+                              BackColor2);
+            break;
+        }
+
+        if (VarValue == N)
+        {
+          GuiVarCompInt1 = sgl.CurItem.CompPars.CompRadioButton.Size;
+          GuiVarCompInt2 = sgl.CurItem.CompPars.CompRadioButton.Size - 3;
+          if (sgl.CurItem.CompPars.CompRadioButton.Style ==
+              GuiLib_RADIOBUTTON_FLAT)
+            GuiVarCompInt2++;
+          sgl.Memory.C[0] = sgl.CurItem.CompPars.CompRadioButton.MarkColor;
+          switch (sgl.CurItem.CompPars.CompRadioButton.MarkStyle)
+          {
+            case GuiLib_RADIOBUTTON_MARK_STANDARD:
+              if (GuiVarCompInt1 <= 1)
+                DrawSubStruct(GuiStructCOMP_RBMSQUA, 0, 1);
+              else if (sgl.CurItem.CompPars.CompRadioButton.Style ==
+                       GuiLib_RADIOBUTTON_FLAT)
+                DrawSubStruct(GuiStructCOMP_RBMFLAT, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_RBM3D, 0, 1);
+              break;
+            case GuiLib_RADIOBUTTON_MARK_ICON:
+              TempTextPar = sgl.CurItem.TextPar[0];
+              SetCurFont(sgl.CurItem.CompPars.CompRadioButton.MarkIconFont);
+              sgl.CurItem.X1 = X1 + sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX;
+              sgl.CurItem.Y1 = Y1 + sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY +
+                           sgl.CurFont->BaseLine;
+              sgl.CurItem.TextPar[0].Alignment = GuiLib_ALIGN_LEFT;
+              sgl.CurItem.TextPar[0].Ps = GuiLib_PS_OFF;
+              sgl.CurItem.TextPar[0].BitFlags = 0;
+              sgl.CurItem.TextPar[0].BackBoxSizeX = 0;
+              sgl.CurItem.TextPar[0].BackBorderPixels = 0;
+              DrawText(sgl.CurItem.CompPars.CompRadioButton.MarkIconPtr,
+                       1,
+                       0,
+                       ForeColor,
+                       BackColor,
+                       BackColorTransp);
+              sgl.CurItem.TextPar[0] = TempTextPar;
+              break;
+            case GuiLib_RADIOBUTTON_MARK_BITMAP:
+              if (sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent)
+                BackColor2 = sgl.CurItem.CompPars.CompRadioButton.MarkBitmapTranspColor;
+              else
+                BackColor2 = -1;
+              GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIndex,
+                                X1 +
+                                sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX,
+                                Y1 +
+                                sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY,
+                                BackColor2);
+              break;
+          }
+        }
+
+        Y1 += sgl.CurItem.CompPars.CompRadioButton.InterDistance;
+        sgl.Memory.Y[GuiLib_MEMORY_CNT] +=
+           sgl.CurItem.CompPars.CompRadioButton.InterDistance;
+      }
+
+      sgl.Memory.Y[GuiLib_MEMORY_CNT] = RemYMemory;
+      break;
+#endif
+
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+    case GuiLib_ITEM_BUTTON:
+      PrepareInternalStruct();
+
+      X1 = sgl.CurItem.X1;
+      Y1 = sgl.CurItem.Y1;
+      X2 = sgl.CurItem.X2;
+      Y2 = sgl.CurItem.Y2;
+      RemX1 = sgl.CurItem.X1;
+      RemY1 = sgl.CurItem.Y1;
+
+      GuiVarCompInt1 = X2 - X1 + 1;
+      GuiVarCompInt2 = Y2 - Y1 + 1;
+      GuiVarCompInt3 = sgl.CurItem.R1;
+      GuiVarCompInt4 = GuiVarCompInt1 - sgl.CurItem.R1;
+      GuiVarCompInt5 = GuiVarCompInt2 - sgl.CurItem.R1;
+
+      sgl.Memory.C[0] = ForeColor;
+      sgl.Memory.C[1] = BackColor;
+
+      if (sgl.ButtonColorOverride == GuiLib_TRUE)
+        sgl.Memory.C[2] = sgl.DisabledButtonColor;
+      else
+        sgl.Memory.C[2] = GuiLib_DesaturatePixelColor(BackColor,800);
+
+      if ((sgl.CurItem.VarPtr != 0) &&
+          (sgl.CurItem.VarType != GuiLib_VAR_STRING))
+      {
+        VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+        if ((VarValue < GuiLib_BUTTON_STATE_UP) ||
+            (VarValue > GuiLib_BUTTON_STATE_DISABLED))
+          VarValue = GuiLib_BUTTON_STATE_UP;
+      }
+      else
+        VarValue = GuiLib_BUTTON_STATE_UP;
+
+      DisabledGlyphColorInUse = 0;
+      DisabledTextColorInUse = 0;
+      switch (sgl.CurItem.CompPars.CompButton.BodyStyle)
+      {
+        case GuiLib_BUTTON_BODY_FLAT:
+          switch (VarValue)
+          {
+            case 0 :
+              if (sgl.CurItem.R1 == 0)
+                DrawSubStruct(GuiStructCOMP_BUFLAT0, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_BUFLATR0, 0, 1);
+              break;
+            case 1 :
+              if (sgl.CurItem.R1 == 0)
+                DrawSubStruct(GuiStructCOMP_BUFLAT1, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_BUFLATR1, 0, 1);
+              break;
+            case 2 :
+              if (sgl.CurItem.R1 == 0)
+                DrawSubStruct(GuiStructCOMP_BUFLAT2, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_BUFLATR2, 0, 1);
+              DisabledGlyphColorInUse =
+                 (sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x02);
+              DisabledTextColorInUse =
+                 (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x08);
+              break;
+          }
+          break;
+        case GuiLib_BUTTON_BODY_3D:
+          switch (VarValue)
+          {
+            case 0 :
+              if (sgl.CurItem.R1 == 0)
+                DrawSubStruct(GuiStructCOMP_BU3D0, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_BU3DR0, 0, 1);
+              break;
+            case 1 :
+              if (sgl.CurItem.R1 == 0)
+                DrawSubStruct(GuiStructCOMP_BU3D1, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_BU3DR1, 0, 1);
+              break;
+            case 2 :
+              if (sgl.CurItem.R1 == 0)
+                DrawSubStruct(GuiStructCOMP_BU3D2, 0, 1);
+              else
+                DrawSubStruct(GuiStructCOMP_BU3DR2, 0, 1);
+              DisabledGlyphColorInUse =
+                 !(sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x02);
+              DisabledTextColorInUse =
+                 !(sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x08);
+              break;
+          }
+          break;
+        case GuiLib_BUTTON_BODY_ICON:
+          TempTextPar = sgl.CurItem.TextPar[VarValue];
+          SetCurFont(sgl.CurItem.CompPars.CompButton.BodyIconFont[VarValue]);
+          sgl.CurItem.X1 =
+             X1 +
+             sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[VarValue];
+          sgl.CurItem.Y1 =
+             Y1 +
+             sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[VarValue] +
+             sgl.CurFont->BaseLine;
+          sgl.CurItem.TextPar[VarValue].Alignment = GuiLib_ALIGN_LEFT;
+          sgl.CurItem.TextPar[VarValue].Ps = GuiLib_PS_OFF;
+          sgl.CurItem.TextPar[VarValue].BitFlags = 0;
+          sgl.CurItem.TextPar[VarValue].BackBoxSizeX = 0;
+          sgl.CurItem.TextPar[VarValue].BackBorderPixels = 0;
+          DrawText(sgl.CurItem.CompPars.CompButton.BodyIconPtr[VarValue],
+                   1,
+                   VarValue,
+                   ForeColor,
+                   BackColor,
+                   BackColorTransp);
+          sgl.CurItem.TextPar[VarValue] = TempTextPar;
+          X1 = sgl.FontWriteX1;
+          Y1 = sgl.FontWriteY1;
+          X2 = sgl.FontWriteX2;
+          Y2 = sgl.FontWriteY2;
+          break;
+        case GuiLib_BUTTON_BODY_BITMAP:
+          if (sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[VarValue])
+            BackColor2 =
+               sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[VarValue];
+          else
+            BackColor2 = -1;
+          GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[VarValue],
+                            X1, Y1,
+                            BackColor2);
+          X2 = sgl.BitmapWriteX2;
+          Y2 = sgl.BitmapWriteY2;
+          break;
+      }
+
+      CX = (X1 + X2) / 2;
+      CY = (Y1 + Y2) / 2;
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      RemClippingX1 = sgl.CurItem.ClipRectX1;
+      RemClippingY1 = sgl.CurItem.ClipRectY1;
+      RemClippingX2 = sgl.CurItem.ClipRectX2;
+      RemClippingY2 = sgl.CurItem.ClipRectY2;
+      sgl.CurItem.ClipRectX1 = GuiLib_GET_MAX(sgl.CurItem.ClipRectX1, X1);
+      sgl.CurItem.ClipRectY1 = GuiLib_GET_MAX(sgl.CurItem.ClipRectY1, Y1);
+      sgl.CurItem.ClipRectX2 = GuiLib_GET_MIN(sgl.CurItem.ClipRectX2, X2);
+      sgl.CurItem.ClipRectY2 = GuiLib_GET_MIN(sgl.CurItem.ClipRectY2, Y2);
+      GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                         sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+      if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_TEXT)
+      {
+        switch (sgl.CurItem.CompPars.CompButton.Layout)
+        {
+          case GuiLib_BUTTON_LAYOUT_GLYPH:
+            GX1 = CX;
+            GY1 = CY;
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHLEFT:
+            GX1 = X1 + GuiLib_GET_MIN((Y2 - Y1) / 2, (X2 - X1) / 4);
+            GY1 = CY;
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHRIGHT:
+            GX1 = X2 - GuiLib_GET_MIN((Y2 - Y1) / 2, (X2 - X1) / 4);
+            GY1 = CY;
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHTOP:
+            GX1 = CX;
+            GY1 = Y1 + ((Y2 - Y1) / 4);
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHBOTTOM:
+            GX1 = CX;
+            GY1 = Y2 - ((Y2 - Y1) / 4);
+            break;
+        }
+        switch (sgl.CurItem.CompPars.CompButton.GlyphStyle)
+        {
+          case GuiLib_BUTTON_GLYPH_ICON:
+            TempTextPar = sgl.CurItem.TextPar[VarValue];
+            SetCurFont(sgl.CurItem.CompPars.CompButton.GlyphIconFont[VarValue]);
+            sgl.CurItem.X1 =
+               GX1 +
+               sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[VarValue];
+            sgl.CurItem.Y1 =
+               GY1 +
+               sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[VarValue] +
+               GuiLib_FONT_MID_Y(sgl.CurFont->BaseLine, sgl.CurFont->TopLine);
+            sgl.CurItem.TextPar[VarValue].Alignment = GuiLib_ALIGN_CENTER;
+            sgl.CurItem.TextPar[VarValue].Ps = GuiLib_PS_OFF;
+            sgl.CurItem.TextPar[VarValue].BitFlags = 0;
+            sgl.CurItem.TextPar[VarValue].BackBoxSizeX = 0;
+            sgl.CurItem.TextPar[VarValue].BackBorderPixels = 0;
+            if (DisabledGlyphColorInUse)
+              ButtonColor = GuiLib_MiddlePixelColor(
+                 sgl.CurItem.CompPars.CompButton.GlyphIconColor[VarValue],
+                 sgl.Memory.C[2],
+                 800);
+            else
+              ButtonColor = sgl.CurItem.CompPars.CompButton.GlyphIconColor[VarValue];
+            DrawText(sgl.CurItem.CompPars.CompButton.GlyphIconPtr[VarValue],
+                     1,
+                     VarValue,
+                     ButtonColor,
+                     0,
+                     GuiLib_TRUE);
+            sgl.CurItem.TextPar[VarValue] = TempTextPar;
+            GX1 = sgl.FontWriteX1;
+            GY1 = sgl.FontWriteY1;
+            GX2 = sgl.FontWriteX2;
+            GY2 = sgl.FontWriteY2;
+            break;
+          case GuiLib_BUTTON_GLYPH_BITMAP:
+            ReadBitmapSizes(sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[VarValue]);
+            GX1 -= sgl.BitmapSizeX / 2;
+            GY1 -= sgl.BitmapSizeY / 2;
+
+            GX1 += sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[VarValue];
+            GY1 += sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[VarValue];
+            if (sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[VarValue])
+              BackColor2 = sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[VarValue];
+            else
+              BackColor2 = -1;
+            GuiLib_ShowBitmap(sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[VarValue],
+                              GX1, GY1,
+                              BackColor2);
+            GX2 = sgl.BitmapWriteX2;
+            GY2 = sgl.BitmapWriteY2;
+            break;
+        }
+      }
+
+      if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_GLYPH)
+      {
+        TempTextPar = sgl.CurItem.TextPar[VarValue];
+        SetCurFont(sgl.CurItem.TextPar[VarValue].FontIndex);
+        switch (sgl.CurItem.CompPars.CompButton.Layout)
+        {
+          case GuiLib_BUTTON_LAYOUT_TEXT:
+            sgl.CurItem.X1 = CX;
+            sgl.CurItem.Y1 = CY;
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHLEFT:
+            sgl.CurItem.X1 = X2 - ((X2 - GX2 + 1) / 2);
+            sgl.CurItem.Y1 = CY;
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHRIGHT:
+            sgl.CurItem.X1 = X1 + ((GX1 - X1 + 1) / 2);
+            sgl.CurItem.Y1 = CY;
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHTOP:
+            sgl.CurItem.X1 = CX;
+            sgl.CurItem.Y1 = Y2 - ((Y2 - GY2 + 1) / 2);
+            break;
+          case GuiLib_BUTTON_LAYOUT_GLYPHBOTTOM:
+            sgl.CurItem.X1 = CX;
+            sgl.CurItem.Y1 = Y1 + ((GY1 - Y1 + 1) / 2);
+            break;
+        }
+        sgl.CurItem.Y1 +=
+           GuiLib_FONT_MID_Y(sgl.CurFont->BaseLine, sgl.CurFont->TopLine);
+        sgl.CurItem.TextPar[VarValue].Alignment = GuiLib_ALIGN_CENTER;
+        sgl.CurItem.TextPar[VarValue].BitFlags = 0;
+        sgl.CurItem.TextPar[VarValue].BackBoxSizeX = 0;
+        sgl.CurItem.TextPar[VarValue].BackBorderPixels = 0;
+        if (DisabledTextColorInUse)
+          ButtonColor = GuiLib_MiddlePixelColor(
+             sgl.CurItem.CompPars.CompButton.TextColor[VarValue],
+             sgl.Memory.C[2],
+             800);
+        else
+          ButtonColor = sgl.CurItem.CompPars.CompButton.TextColor[VarValue];
+        DRAW_ROM_TEXT(GetItemTextPtr(VarValue),
+                      sgl.CurItem.TextLength[VarValue],
+                      VarValue,
+                      ButtonColor,
+                      0,
+                      GuiLib_TRUE);
+        sgl.CurItem.TextPar[VarValue] = TempTextPar;
+      }
+
+      sgl.CurItem.X1 = RemX1;
+      sgl.CurItem.Y1 = RemY1;
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      sgl.CurItem.ClipRectX1 = RemClippingX1;
+      sgl.CurItem.ClipRectY1 = RemClippingY1;
+      sgl.CurItem.ClipRectX2 = RemClippingX2;
+      sgl.CurItem.ClipRectY2 = RemClippingY2;
+      GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                         sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+
+      break;
+#endif
+
+#ifdef GuiConst_ITEM_PANEL_INUSE
+    case GuiLib_ITEM_PANEL:
+      PrepareInternalStruct();
+
+      X1 = sgl.CurItem.X1;
+      Y1 = sgl.CurItem.Y1;
+      X2 = sgl.CurItem.X2;
+      Y2 = sgl.CurItem.Y2;
+      OrderCoord(&X1, &X2);
+      OrderCoord(&Y1, &Y2);
+
+      GuiVarCompInt1 = X2 - X1 + 1;
+      GuiVarCompInt2 = Y2 - Y1 + 1;
+      GuiVarCompInt3 = sgl.CurItem.R1;
+      GuiVarCompInt4 = GuiVarCompInt1 - sgl.CurItem.R1;
+      GuiVarCompInt5 = GuiVarCompInt2 - sgl.CurItem.R1;
+
+      sgl.Memory.C[0] = ForeColor;
+      switch (sgl.CurItem.CompPars.CompPanel.Style)
+      {
+        case GuiLib_PANEL_FLAT:
+          if (sgl.CurItem.R1 == 0)
+          {
+            if (BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_PAFLATTRANSP, 0, 1);
+            else
+              DrawSubStruct(GuiStructCOMP_PAFLAT, 0, 1);
+          }
+          else
+          {
+            if (BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_PAFLATTRANSPR, 0, 1);
+            else
+              DrawSubStruct(GuiStructCOMP_PAFLATR, 0, 1);
+          }
+          break;
+
+        case GuiLib_PANEL_3D_RAISED:
+          if (sgl.CurItem.R1 == 0)
+          {
+            if (!BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1);
+            DrawSubStruct(GuiStructCOMP_PA3DRAIS, 0, 1);
+          }
+          else
+          {
+            if (!BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_PA3DINNERR, 0, 1);
+            DrawSubStruct(GuiStructCOMP_PA3DRAISR, 0, 1);
+          }
+          break;
+
+        case GuiLib_PANEL_3D_LOWERED:
+          if (sgl.CurItem.R1 == 0)
+          {
+            if (!BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1);
+            DrawSubStruct(GuiStructCOMP_PA3DLOW, 0, 1);
+          }
+          else
+          {
+            if (!BackColorTransp)
+              DrawSubStruct(GuiStructCOMP_PA3DINNERR, 0, 1);
+            DrawSubStruct(GuiStructCOMP_PA3DLOWR, 0, 1);
+          }
+          break;
+
+        case GuiLib_PANEL_EMBOSSED_RAISED:
+          if (!BackColorTransp)
+            DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1);
+          DrawSubStruct(GuiStructCOMP_PAEMBRAIS, 0, 1);
+          break;
+
+        case GuiLib_PANEL_EMBOSSED_LOWERED:
+          if (!BackColorTransp)
+            DrawSubStruct(GuiStructCOMP_PA3DINNER, 0, 1);
+          DrawSubStruct(GuiStructCOMP_PAEMBLOW, 0, 1);
+          break;
+      }
+      break;
+#endif
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+    case GuiLib_ITEM_GRAPH:
+      break;
+#endif
+
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+    case GuiLib_ITEM_GRAPHICSLAYER:
+#ifdef GuiLib_LAYERS_SUPPORTED
+      if (sgl.DisplayWriting)
+      {
+        sgl.LayerOrigoX = 0;
+        sgl.LayerOrigoY = 0;
+        sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+        sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+
+        X1 = sgl.CurItem.X1;
+        X2 = sgl.CurItem.X2;
+        Y1 = sgl.CurItem.Y1;
+        Y2 = sgl.CurItem.Y2;
+        GuiLib_COORD_ADJUST(X1, Y1);
+        GuiLib_COORD_ADJUST(X2, Y2);
+        OrderCoord(&X1, &X2);
+        OrderCoord(&Y1, &Y2);
+
+        switch (sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].SizeMode)
+        {
+          case GuiLib_GRAPHICS_LAYER_SIZE_COORD:
+            X1 = GuiLib_GET_MINMAX(X1, 0, GuiConst_DISPLAY_WIDTH_HW - 1);
+            Y1 = GuiLib_GET_MINMAX(Y1, 0, GuiConst_DISPLAY_HEIGHT_HW - 1);
+            X2 = GuiLib_GET_MINMAX(X2, 0, GuiConst_DISPLAY_WIDTH_HW - 1);
+            Y2 = GuiLib_GET_MINMAX(Y2, 0, GuiConst_DISPLAY_HEIGHT_HW - 1);
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X = GuiLib_GET_MINMAX(
+               X1, 0, GuiConst_DISPLAY_WIDTH_HW);
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y = GuiLib_GET_MINMAX(
+               Y1, 0, GuiConst_DISPLAY_HEIGHT_HW);
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width = X2 - X1 + 1;
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height = Y2 - Y1 + 1;
+            break;
+
+          case GuiLib_GRAPHICS_LAYER_SIZE_SCREEN:
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X = 0;
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y = 0;
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width =
+               GuiConst_DISPLAY_WIDTH_HW;
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height =
+               GuiConst_DISPLAY_HEIGHT_HW;
+            break;
+
+          case GuiLib_GRAPHICS_LAYER_SIZE_CLIP:
+            CX1 = sgl.CurItem.ClipRectX1;
+            CX2 = sgl.CurItem.ClipRectX2;
+            CY1 = sgl.CurItem.ClipRectY1;
+            CY2 = sgl.CurItem.ClipRectY2;
+            GuiLib_COORD_ADJUST(CX1, CY1);
+            GuiLib_COORD_ADJUST(CX2, CY2);
+            OrderCoord(&CX1, &CX2);
+            OrderCoord(&CY1, &CY2);
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X = CX1;
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y = CY1;
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width = CX2 - CX1 + 1;
+            sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height = CY2 - CY1 + 1;
+            break;
+        }
+        sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].LineSize =
+             GuiConst_PIXEL_BYTE_SIZE *
+             sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width;
+        sgl.CurItem.ClipRectX1 = 0;
+        sgl.CurItem.ClipRectY1 = 0;
+        sgl.CurItem.ClipRectX2 =
+           sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width - 1;
+        sgl.CurItem.ClipRectY2 =
+           sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height - 1;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+        StartClipping(1);
+#endif
+        sgl.LayerOrigoX = -sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X;
+        sgl.LayerOrigoY = -sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y;
+        sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+        sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+
+        if (GraphicsLayer_Push(sgl.GlobalGraphicsLayerIndex))
+        {
+          switch (sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].InitMode)
+          {
+            case GuiLib_GRAPHICS_LAYER_INIT_NONE:
+              break;
+
+            case GuiLib_GRAPHICS_LAYER_INIT_COL:
+              GuiLib_FillBox(
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X +
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width - 1,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y +
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height - 1,
+                 BackColor);
+              break;
+
+            case GuiLib_GRAPHICS_LAYER_INIT_COPY:
+              GraphicsLayer_Copy(
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].BaseAddress,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].LineSize,
+                 0,
+                 0,
+#ifdef GuiConst_DISPLAY_BUFFER_EASYGUI
+#ifdef GuiLib_COLOR_UNIT_16
+                 (GuiConst_INT8U*)GuiLib_DisplayBuf.Bytes,
+#else
+                 (GuiConst_INT8U*)GuiLib_DisplayBuf,
+#endif
+#else // GuiConst_DISPLAY_BUFFER_EASYGUI
+                 0,
+#endif // GuiConst_DISPLAY_BUFFER_EASYGUI
+                 GuiConst_BYTES_PR_LINE,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].X,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Y,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Width,
+                 sgl.GraphicsLayerList[sgl.GlobalGraphicsLayerIndex].Height);
+              break;
+          }
+        }
+      }
+#endif
+      break;
+
+    case GuiLib_ITEM_GRAPHICSFILTER:
+#ifdef GuiLib_LAYERS_SUPPORTED
+      if (sgl.DisplayWriting)
+      {
+        sgl.LayerOrigoX = 0;
+        sgl.LayerOrigoY = 0;
+        sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+        sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+
+        SourceLayerIndexNo = IndexOfGraphicsLayer(
+           sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].SourceLayerIndexNo);
+        DestLayerIndexNo = IndexOfGraphicsLayer(
+           sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].DestLayerIndexNo);
+        if (SourceLayerIndexNo != DestLayerIndexNo)
+        {
+          if (SourceLayerIndexNo == GuiLib_GRAPHICS_LAYER_BASE)
+          {
+#ifdef GuiConst_DISPLAY_BUFFER_EASYGUI
+#ifdef GuiLib_COLOR_UNIT_16
+            SourceAddress = &(GuiLib_DisplayBuf.Bytes[0][0]);
+#else
+  #ifdef GuiConst_COLOR_DEPTH_2
+    #ifdef GuiConst_BYTE_HORIZONTAL
+      #ifdef GuiConst_COLOR_PLANES_2
+            SourceAddress = &(GuiLib_DisplayBuf[0][0][0]);
+      #else
+            SourceAddress = &(GuiLib_DisplayBuf[0][0]);
+      #endif
+    #else
+      #ifdef GuiConst_COLOR_PLANES_2
+            SourceAddress = &(GuiLib_DisplayBuf[0][0][0]);
+      #else
+            SourceAddress = &(GuiLib_DisplayBuf[0][0]);
+      #endif
+    #endif
+  #else
+            SourceAddress = &(GuiLib_DisplayBuf[0][0]);
+  #endif
+#endif // GuiLib_COLOR_UNIT_16
+#else // GuiConst_DISPLAY_BUFFER_EASYGUI
+            SourceAddress = 0;
+#endif // GuiConst_DISPLAY_BUFFER_EASYGUI
+            SourceLineSize = GuiConst_BYTES_PR_LINE;
+            SourceX = 0;
+            SourceY = 0;
+            SourceWidth = GuiConst_DISPLAY_WIDTH_HW;
+            SourceHeight = GuiConst_DISPLAY_HEIGHT_HW;
+          }
+          else
+          {
+            SourceAddress = sgl.GraphicsLayerList[SourceLayerIndexNo].BaseAddress;
+            SourceLineSize = sgl.GraphicsLayerList[SourceLayerIndexNo].LineSize;
+            SourceX = sgl.GraphicsLayerList[SourceLayerIndexNo].X;
+            SourceY = sgl.GraphicsLayerList[SourceLayerIndexNo].Y;
+            SourceWidth = sgl.GraphicsLayerList[SourceLayerIndexNo].Width;
+            SourceHeight = sgl.GraphicsLayerList[SourceLayerIndexNo].Height;
+          }
+          if (DestLayerIndexNo == GuiLib_GRAPHICS_LAYER_BASE)
+          {
+#ifdef GuiConst_DISPLAY_BUFFER_EASYGUI
+#ifdef GuiLib_COLOR_UNIT_16
+            DestAddress = &(GuiLib_DisplayBuf.Bytes[0][0]);
+#else
+  #ifdef GuiConst_COLOR_DEPTH_2
+    #ifdef GuiConst_BYTE_HORIZONTAL
+      #ifdef GuiConst_COLOR_PLANES_2
+            DestAddress = &(GuiLib_DisplayBuf[0][0][0]);
+      #else
+            DestAddress = &(GuiLib_DisplayBuf[0][0]);
+      #endif
+    #else
+      #ifdef GuiConst_COLOR_PLANES_2
+            DestAddress = &(GuiLib_DisplayBuf[0][0][0]);
+      #else
+            DestAddress = &(GuiLib_DisplayBuf[0][0]);
+      #endif
+    #endif
+  #else
+            DestAddress = &(GuiLib_DisplayBuf[0][0]);
+  #endif
+#endif
+#else // GuiConst_DISPLAY_BUFFER_EASYGUI
+            DestAddress = 0;
+#endif // GuiConst_DISPLAY_BUFFER_EASYGUI
+            DestLineSize = GuiConst_BYTES_PR_LINE;
+            DestX = SourceX;
+            DestY = SourceY;
+            DestWidth = SourceWidth;
+            DestHeight = SourceHeight;
+          }
+          else
+          {
+            DestAddress = sgl.GraphicsLayerList[DestLayerIndexNo].BaseAddress;
+            DestLineSize = sgl.GraphicsLayerList[DestLayerIndexNo].LineSize;
+            DestX = sgl.GraphicsLayerList[DestLayerIndexNo].X;
+            DestY = sgl.GraphicsLayerList[DestLayerIndexNo].Y;
+            DestWidth = sgl.GraphicsLayerList[DestLayerIndexNo].Width;
+            DestHeight = sgl.GraphicsLayerList[DestLayerIndexNo].Height;
+          }
+
+          if ((DestX <= SourceX) && (DestY <= SourceY) &&
+              (DestX + DestWidth >= SourceX + SourceWidth) &&
+              (DestY + DestHeight >= SourceY + SourceHeight) &&
+              (sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].
+               GraphicsFilterFunc != 0))
+          {
+            if (DestLayerIndexNo != GuiLib_GRAPHICS_LAYER_BASE)
+            {
+              DestX = SourceX - DestX;
+              DestY = SourceY - DestY;
+            }
+            if (SourceLayerIndexNo != GuiLib_GRAPHICS_LAYER_BASE)
+            {
+              SourceX = 0;
+              SourceY = 0;
+            }
+
+            for (I = 0; I <= 9; I++)
+            {
+              if (sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParVarType[I] ==
+                  GuiLib_VAR_NONE)
+                FilterPars[I] =
+                   sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParValueNum[I];
+              else
+                FilterPars[I] = ReadVar(
+                   sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParVarPtr[I],
+                   sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ParVarType[I]);
+            }
+            sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].GraphicsFilterFunc(
+               DestAddress + DestY * DestLineSize +
+                  DestX * GuiConst_PIXEL_BYTE_SIZE,
+               DestLineSize,
+               SourceAddress + SourceY * SourceLineSize +
+                  SourceX * GuiConst_PIXEL_BYTE_SIZE,
+               SourceLineSize,
+               sgl.GraphicsLayerList[SourceLayerIndexNo].Width,
+               sgl.GraphicsLayerList[SourceLayerIndexNo].Height,
+               FilterPars);
+          }
+
+          GraphicsLayer_Pop(
+             sgl.GraphicsFilterList[sgl.GlobalGraphicsFilterIndex].ContAtLayerIndexNo);
+          MarkDisplayBoxRepaint(
+             DestX,
+             DestY,
+             DestX + sgl.GraphicsLayerList[SourceLayerIndexNo].Width - 1,
+             DestY + sgl.GraphicsLayerList[SourceLayerIndexNo].Height - 1);
+        }
+        else
+          GraphicsLayer_Pop(GuiLib_GRAPHICS_LAYER_BASE);
+
+        if (sgl.BaseLayerDrawing)
+        {
+          sgl.LayerOrigoX = 0;
+          sgl.LayerOrigoY = 0;
+        }
+        else
+        {
+          I = sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt - 1];
+          sgl.LayerOrigoX = -sgl.GraphicsLayerList[I].X;
+          sgl.LayerOrigoY = -sgl.GraphicsLayerList[I].Y;
+        }
+        sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+        sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+
+        if (sgl.BaseLayerDrawing)
+        {
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+          StartClipping(0);
+#endif
+        }
+        else
+        {
+          I = sgl.GraphicsLayerLifo[sgl.GraphicsLayerLifoCnt - 1];
+          sgl.CurItem.ClipRectX1 = 0;
+          sgl.CurItem.ClipRectY1 = 0;
+          sgl.CurItem.ClipRectX2 = sgl.GraphicsLayerList[I].Width - 1;
+          sgl.CurItem.ClipRectY2 = sgl.GraphicsLayerList[I].Height - 1;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+          StartClipping(1);
+#endif
+        }
+      }
+#endif
+      break;
+#endif
+  }
+
+  if (sgl.CurItem.UpdateType == GuiLib_UPDATE_ON_CHANGE)
+    if ((sgl.InitialDrawing) || (sgl.AutoRedrawUpdate == GuiLib_TRUE))
+      AutoRedraw_UpdateOnChange(sgl.AutoRedrawSaveIndex);
+
+  if (sgl.AutoRedrawSaveIndex >= 0)
+    AutoRedraw_UpdateDrawn(sgl.AutoRedrawSaveIndex, &sgl.CurItem);
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  if (((sgl.CurItem.ItemType == GuiLib_ITEM_TEXTBLOCK) ||
+       (sgl.CurItem.ItemType == GuiLib_ITEM_VARBLOCK)) &&
+       (sgl.CurItem.CompPars.CompTextBox.ScrollIndex != 0xFF))
+  {
+    found = AutoRedraw_GetTextBox(
+                  sgl.CurItem.CompPars.CompTextBox.ScrollIndex, -1);
+    if (found == -1)
+    {
+      if (sgl.AutoRedrawSaveIndex >= 0)
+        AutoRedraw_SetAsTextBox(sgl.AutoRedrawSaveIndex);
+      else
+        AutoRedraw_InsertTextBox(&sgl.CurItem, 0, sgl.DisplayLevel);
+    }
+
+    found = 0;
+
+    for (N = 0; N < GuiConst_TEXTBOX_FIELDS_MAX; N++)
+    {
+      if (sgl.TextBoxScrollPositions[N].index ==
+          sgl.CurItem.CompPars.CompTextBox.ScrollIndex)
+      {
+        found = 1;
+        break;
+      }
+    }
+
+    if (found == 0)
+    {
+      for (N = 0; N < GuiConst_TEXTBOX_FIELDS_MAX; N++)
+      {
+        if (sgl.TextBoxScrollPositions[N].index == -1)
+        {
+          sgl.TextBoxScrollPositions[N].index =
+            sgl.CurItem.CompPars.CompTextBox.ScrollIndex;
+          sgl.TextBoxScrollPositions[N].pos =
+            sgl.CurItem.CompPars.CompTextBox.ScrollPos;
+            break;
+        }
+      }
+    }
+  }
+#endif
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  if (sgl.InitialDrawing && IsCursorField)
+    sgl.CurItem.CursorFieldLevel--;
+
+  if ((ColorInvert == GuiLib_COL_INVERT_IF_CURSOR) && FoundActiveCursorField)
+    sgl.SwapColors = 0;
+#endif
+
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+  if (!sgl.InitialDrawing)
+  {
+    sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+    sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+  }
+#endif
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  if (!sgl.InitialDrawing && sgl.DisplayWriting)
+    GuiLib_ResetClipping();
+#endif
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+static void ReadItem(GuiConst_INT16S LanguageIndex)
+{
+  GuiConst_INT16S X;
+  GuiConst_INT16S N;
+  GuiConst_INT16S I,J;
+  GuiConst_INTCOLOR TmpForeColor, TmpBackColor;
+  GuiConst_INTCOLOR PrefixLocate *ColVarPtr;
+  GuiConst_INT16U ColVarPtrIdx, PtrIdx;
+  GuiConst_INT16U TmpColIdx;
+  GuiConst_INT16U TmpForeColIdx;
+#ifdef GuiConst_ADV_CONTROLS
+  GuiConst_INT16U TmpBackColIdx;
+#endif
+  GuiConst_INT8U B1;
+  GuiConst_INT16U W1;
+#ifdef GuiConst_REMOTE_TEXT_DATA
+  GuiConst_INT16U Ti;
+#endif
+  GuiConst_INT16U TxtSize;
+#ifndef GuiConst_REMOTE_TEXT_DATA
+  GuiConst_INT16U TxtSum1, TxtSum2;
+#endif
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  GuiConst_INT16U TxtReadSize;
+#endif
+#ifdef GuiConst_BLINK_SUPPORT_ON
+  GuiConst_INT8S BS2;
+#endif
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+  GuiConst_INT8U ScrollBoxIndex;
+#ifndef GuiConst_SCROLLITEM_BAR_NONE
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+  GuiConst_INT8U * PixelDataPtr;
+  GuiConst_INT8U BitmapHeader[4];
+#else
+  GuiConst_INT8U PrefixRom * PixelDataPtr;
+#endif // GuiConst_REMOTE_BITMAP_DATA
+#endif // GuiConst_SCROLLITEM_BAR_NONE
+#endif // GuiConst_ITEM_SCROLLBOX_INUSE
+#ifdef GuiConst_ADV_COMPONENTS
+  GuiConst_INT8U L;
+#endif
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+  GuiConst_INT8U GraphIndex;
+  GuiConst_INT8U Axis;
+  GuiConst_INT8U B;
+#endif
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  GuiConst_INT8U GraphicsLayerIndex;
+  GuiConst_INT8U GraphicsFilterIndex;
+#endif
+#ifdef GuiConst_ITEM_STRUCTCOND_INUSE
+  GuiConst_INT16U CondI;
+#endif
+  GuiConst_INT8U ColMemoryFore;
+  GuiConst_INT8U ColMemoryBack;
+
+  sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_INUSE;
+
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+  if (sgl.DisplayLevel == 0)
+  {
+    sgl.CurItem.CoordOrigoX = sgl.CoordOrigoX;
+    sgl.CurItem.CoordOrigoY = sgl.CoordOrigoY;
+  }
+#endif
+
+  sgl.CommonByte0 = GetItemByte(&sgl.ItemDataPtr);
+  sgl.CommonByte1 = GetItemByte(&sgl.ItemDataPtr);
+  sgl.CommonByte2 = GetItemByte(&sgl.ItemDataPtr);
+  sgl.CommonByte3 = GetItemByte(&sgl.ItemDataPtr);
+  sgl.CommonByte4 = GetItemByte(&sgl.ItemDataPtr);
+  sgl.CommonByte5 = GetItemByte(&sgl.ItemDataPtr);
+  sgl.CommonByte6 = GetItemByte(&sgl.ItemDataPtr);
+  sgl.CommonByte7 = GetItemByte(&sgl.ItemDataPtr);
+
+  sgl.CurItem.ItemType = sgl.CommonByte0 & 0x3F;
+  if (sgl.CurItem.ItemType < 32)
+    sgl.ItemTypeBit1 = (GuiConst_INT32U)0x00000001 << (sgl.CurItem.ItemType & 0x1F);
+  else
+    sgl.ItemTypeBit1 = 0;
+  if (sgl.CurItem.ItemType >= 32)
+    sgl.ItemTypeBit2 = (GuiConst_INT32U)0x00000001 << (sgl.CurItem.ItemType - 32);
+  else
+    sgl.ItemTypeBit2 = 0;
+
+  if (sgl.CommonByte7 & 0x20)
+  {
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+    if (B1 & 0x01)
+      sgl.CurItem.ForeColorEnhance = GetItemWord(&sgl.ItemDataPtr);
+    if (B1 & 0x02)
+      sgl.CurItem.BackColorEnhance = GetItemWord(&sgl.ItemDataPtr);
+    if (B1 & 0x04)
+      sgl.CurItem.BarForeColorEnhance = GetItemWord(&sgl.ItemDataPtr);
+    if (B1 & 0x08)
+      sgl.CurItem.BarBackColorEnhance = GetItemWord(&sgl.ItemDataPtr);
+  }
+  else
+  {
+    sgl.CurItem.ForeColorEnhance = 0;
+    sgl.CurItem.BackColorEnhance = 0;
+    sgl.CurItem.BarForeColorEnhance = 0;
+    sgl.CurItem.BarBackColorEnhance = 0;
+  }
+  if (sgl.CommonByte7 & 0x40)
+  {
+    ColMemoryFore = GetItemByte(&sgl.ItemDataPtr);
+    ColMemoryBack = GetItemByte(&sgl.ItemDataPtr);
+  }
+  else
+  {
+    ColMemoryFore = 0;
+    ColMemoryBack = 0;
+  }
+
+  TmpForeColor = sgl.CurItem.ForeColor;
+  TmpForeColIdx = sgl.CurItem.ForeColorIndex;
+
+  TmpBackColor = sgl.CurItem.BackColor;
+#ifdef GuiConst_ADV_CONTROLS
+  TmpBackColIdx = sgl.CurItem.BackColorIndex;
+#endif
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_DOT +
+                           GuiLib_ITEMBIT_LINE +
+                           GuiLib_ITEMBIT_FRAME +
+                           GuiLib_ITEMBIT_BLOCK +
+                           GuiLib_ITEMBIT_CIRCLE +
+                           GuiLib_ITEMBIT_ELLIPSE +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK +
+                           GuiLib_ITEMBIT_SCROLLBOX +
+                           GuiLib_ITEMBIT_GRAPH)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                           GuiLib_ITEMBIT_ROUNDEDBLOCK +
+                           GuiLib_ITEMBIT_QUARTERCIRCLE +
+                           GuiLib_ITEMBIT_QUARTERELLIPSE +
+                           GuiLib_ITEMBIT_CHECKBOX +
+                           GuiLib_ITEMBIT_RADIOBUTTON +
+                           GuiLib_ITEMBIT_BUTTON +
+                           GuiLib_ITEMBIT_EDITBOX +
+                           GuiLib_ITEMBIT_PANEL +
+                           GuiLib_ITEMBIT_MEMO +
+                           GuiLib_ITEMBIT_LISTBOX +
+                           GuiLib_ITEMBIT_COMBOBOX +
+                           GuiLib_ITEMBIT_SCROLLAREA +
+                           GuiLib_ITEMBIT_PROGRESSBAR +
+                           GuiLib_ITEMBIT_STRUCTCOND)))
+  {
+    B1 = ColMemoryFore & 0x03;
+    if (B1)
+    {
+      sgl.CurItem.ForeColor = sgl.Memory.C[B1-1];
+      sgl.CurItem.ForeColorIndex = sgl.ColMemoryIndex[B1-1];
+    }
+    else
+    {
+      TmpColIdx = sgl.CurItem.ForeColorIndex;
+      sgl.CurItem.ForeColorIndex = 0xFFFF;
+      switch (sgl.CommonByte3 & 0x07)
+      {
+        case GuiLib_COLOR_FORE:
+          sgl.CurItem.ForeColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.CurItem.ForeColor = GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.CurItem.ForeColor = (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.CurItem.ForeColor = TmpBackColor;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.CurItem.ForeColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+          {
+            sgl.CurItem.ForeColor = GuiConst_PIXEL_ON;
+          }
+          else
+          {
+            sgl.CurItem.ForeColor = *ColVarPtr;
+            sgl.CurItem.ForeColorIndex = ColVarPtrIdx;
+          }
+          break;
+        default:
+          sgl.CurItem.ForeColorIndex = TmpColIdx;
+          break;
+      }
+    }
+    if (sgl.CurItem.ForeColorEnhance > 0)
+      sgl.CurItem.ForeColor = GuiLib_BrightenPixelColor(
+         sgl.CurItem.ForeColor, sgl.CurItem.ForeColorEnhance);
+    else if (sgl.CurItem.ForeColorEnhance < 0)
+      sgl.CurItem.ForeColor = GuiLib_DarkenPixelColor(
+         sgl.CurItem.ForeColor, -sgl.CurItem.ForeColorEnhance);
+
+    B1 = ColMemoryFore & 0x30;
+    if (B1)
+    {
+      sgl.CurItem.BarForeColor = sgl.Memory.C[B1-1];
+      sgl.CurItem.BarForeColorIndex = sgl.ColMemoryIndex[B1-1];
+    }
+    else
+    {
+      TmpColIdx = sgl.CurItem.BarForeColorIndex;
+      sgl.CurItem.BarForeColorIndex = 0xFFFF;
+      switch ((sgl.CommonByte5 >> 1) & 0x07)
+      {
+        case GuiLib_COLOR_FORE:
+          sgl.CurItem.BarForeColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.CurItem.BarForeColor = GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.CurItem.BarForeColor = (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.CurItem.BarForeColor = sgl.CurItem.BackColor;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.CurItem.BarForeColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+          {
+            sgl.CurItem.BarForeColor = GuiConst_PIXEL_ON;
+          }
+          else
+          {
+            sgl.CurItem.BarForeColor = *ColVarPtr;
+            sgl.CurItem.BarForeColorIndex = ColVarPtrIdx;
+          }
+          break;
+        default:
+          sgl.CurItem.BarForeColorIndex = TmpColIdx;
+          break;
+      }
+    }
+    if (sgl.CurItem.BarForeColorEnhance > 0)
+      sgl.CurItem.BarForeColor = GuiLib_BrightenPixelColor(
+         sgl.CurItem.BarForeColor, sgl.CurItem.BarForeColorEnhance);
+    else if (sgl.CurItem.BarForeColorEnhance < 0)
+      sgl.CurItem.BarForeColor = GuiLib_DarkenPixelColor(
+         sgl.CurItem.BarForeColor, -sgl.CurItem.BarForeColorEnhance);
+  }
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CLEARAREA +
+                           GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_FRAME +
+                           GuiLib_ITEMBIT_CIRCLE +
+                           GuiLib_ITEMBIT_ELLIPSE +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK +
+                           GuiLib_ITEMBIT_SCROLLBOX +
+                           GuiLib_ITEMBIT_GRAPH +
+                           GuiLib_ITEMBIT_GRAPHICSLAYER)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                           GuiLib_ITEMBIT_QUARTERCIRCLE +
+                           GuiLib_ITEMBIT_QUARTERELLIPSE +
+                           GuiLib_ITEMBIT_CHECKBOX +
+                           GuiLib_ITEMBIT_RADIOBUTTON +
+                           GuiLib_ITEMBIT_BUTTON +
+                           GuiLib_ITEMBIT_EDITBOX +
+                           GuiLib_ITEMBIT_PANEL +
+                           GuiLib_ITEMBIT_MEMO +
+                           GuiLib_ITEMBIT_LISTBOX +
+                           GuiLib_ITEMBIT_COMBOBOX +
+                           GuiLib_ITEMBIT_SCROLLAREA +
+                           GuiLib_ITEMBIT_PROGRESSBAR +
+                           GuiLib_ITEMBIT_STRUCTCOND)))
+  {
+    B1 = ColMemoryBack & 0x03;
+    if (B1)
+    {
+      sgl.CurItem.BackColor = sgl.Memory.C[B1-1];
+      sgl.CurItem.BackColorIndex = sgl.ColMemoryIndex[B1-1];
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT;
+    }
+    else
+    {
+      TmpColIdx = sgl.CurItem.BackColorIndex;
+      sgl.CurItem.BackColorIndex = 0xFFFF;
+      switch ((sgl.CommonByte3 >> 3) & 0x07)
+      {
+        case GuiLib_COLOR_FORE:
+          sgl.CurItem.BackColor = GuiConst_PIXEL_ON;
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.CurItem.BackColor = GuiConst_PIXEL_OFF;
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.CurItem.BackColor = GetItemColor(&sgl.ItemDataPtr);
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT;
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.CurItem.BackColor = TmpForeColor;
+          sgl.CurItem.BackColorIndex = TmpForeColIdx;
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_TRANSPARENT;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.CurItem.BackColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT;
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+          {
+            sgl.CurItem.BackColor = GuiConst_PIXEL_ON;
+          }
+          else
+          {
+            sgl.CurItem.BackColor = *ColVarPtr;
+            sgl.CurItem.BackColorIndex = ColVarPtrIdx;
+          }
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSPARENT;
+          break;
+        default:
+          sgl.CurItem.BackColorIndex = TmpColIdx;
+          break;
+      }
+    }
+    if (sgl.CurItem.BackColorEnhance > 0)
+      sgl.CurItem.BackColor = GuiLib_BrightenPixelColor(
+         sgl.CurItem.BackColor, sgl.CurItem.BackColorEnhance);
+    else if (sgl.CurItem.BackColorEnhance < 0)
+      sgl.CurItem.BackColor = GuiLib_DarkenPixelColor(
+         sgl.CurItem.BackColor, -sgl.CurItem.BackColorEnhance);
+
+    B1 = ColMemoryBack & 0x30;
+    if (B1)
+    {
+      sgl.CurItem.BarBackColor = sgl.Memory.C[B1-1];
+      sgl.CurItem.BarBackColorIndex = sgl.ColMemoryIndex[B1-1];
+    }
+    else
+    {
+      TmpColIdx = sgl.CurItem.BarBackColorIndex;
+      sgl.CurItem.BarBackColorIndex = 0xFFFF;
+      switch ((sgl.CommonByte5 >> 4) & 0x07)
+      {
+        case GuiLib_COLOR_FORE:
+          sgl.CurItem.BarBackColor = GuiConst_PIXEL_ON;
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.CurItem.BarBackColor = GuiConst_PIXEL_OFF;
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.CurItem.BarBackColor = GetItemColor(&sgl.ItemDataPtr);
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT;
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT;
+          sgl.CurItem.BarBackColor = sgl.CurItem.ForeColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_BARTRANSPARENT;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.CurItem.BarBackColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT;
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+          {
+            sgl.CurItem.BarBackColor = GuiConst_PIXEL_ON;
+          }
+          else
+          {
+            sgl.CurItem.BarBackColor = *ColVarPtr;
+            sgl.CurItem.BarBackColorIndex = ColVarPtrIdx;
+          }
+          sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BARTRANSPARENT;
+          break;
+        default:
+          sgl.CurItem.BarBackColorIndex = TmpColIdx;
+          break;
+      }
+    }
+    if (sgl.CurItem.BarBackColorEnhance > 0)
+      sgl.CurItem.BarBackColor = GuiLib_BrightenPixelColor(
+         sgl.CurItem.BarBackColor, sgl.CurItem.BarBackColorEnhance);
+    else if (sgl.CurItem.BarBackColorEnhance < 0)
+      sgl.CurItem.BarBackColor = GuiLib_DarkenPixelColor(
+         sgl.CurItem.BarBackColor, -sgl.CurItem.BarBackColorEnhance);
+  }
+
+#ifdef GuiConst_COLOR_DEPTH_1
+  #ifdef GuiConst_BITMAP_SUPPORT_ON
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_BITMAP +
+                           GuiLib_ITEMBIT_BACKGROUND)) &&
+      (sgl.CommonByte6 & 0x02))
+    sgl.CurItem.CompPars.CompBitmap.TranspColor = (sgl.CommonByte6 >> 2) & 0x01;
+  #endif
+#else
+  #ifdef GuiConst_BITMAP_SUPPORT_ON
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_BITMAP +
+                           GuiLib_ITEMBIT_BACKGROUND)) &&
+      (sgl.CommonByte6 & 0x02))
+  {
+    sgl.CurItem.CompPars.CompBitmap.TranspColor = GetItemColor(&sgl.ItemDataPtr);
+  }
+  #endif
+#endif
+
+  B1 = ColMemoryFore & 0x0C;
+  if (B1)
+  {
+    sgl.Memory.C[B1 - 1] = sgl.CurItem.ForeColor;
+    sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.ForeColorIndex;
+  }
+  B1 = ColMemoryFore & 0xC0;
+  if (B1)
+  {
+    sgl.Memory.C[B1 - 1] = sgl.CurItem.BarForeColor;
+    sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.BarForeColorIndex;
+  }
+  B1 = ColMemoryBack & 0x0C;
+  if (B1)
+  {
+    sgl.Memory.C[B1 - 1] = sgl.CurItem.BackColor;
+    sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.BackColorIndex;
+  }
+  B1 = ColMemoryBack & 0xC0;
+  if (B1)
+  {
+    sgl.Memory.C[B1 - 1] = sgl.CurItem.BarBackColor;
+    sgl.ColMemoryIndex[B1 - 1] = sgl.CurItem.BarBackColorIndex;
+  }
+
+  if (sgl.CommonByte0 & 0x40)
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+  else
+    B1 = 0;
+  sgl.X1MemoryRead = B1 & 0x03;
+  sgl.X1MemoryWrite = (B1 >> 2) & 0x03;
+  sgl.Y1MemoryRead = (B1 >> 4) & 0x03;
+  sgl.Y1MemoryWrite = (B1 >> 6) & 0x03;
+  if (sgl.CommonByte0 & 0x80)
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+  else
+    B1 = 0;
+  sgl.X2MemoryRead = B1 & 0x03;
+  sgl.X2MemoryWrite = (B1 >> 2) & 0x03;
+  sgl.Y2MemoryRead = (B1 >> 4) & 0x03;
+  sgl.Y2MemoryWrite = (B1 >> 6) & 0x03;
+  if (sgl.CommonByte7 & 0x01)
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+  else
+    B1 = 0;
+  sgl.R1MemoryRead = B1 & 0x03;
+  sgl.R1MemoryWrite = (B1 >> 2) & 0x03;
+  sgl.R2MemoryRead = (B1 >> 4) & 0x03;
+  sgl.R2MemoryWrite = (B1 >> 6) & 0x03;
+  if (sgl.CommonByte7 & 0x80)
+  {
+    if (sgl.X1MemoryRead)
+      sgl.X1MemoryRead += GuiLib_MEMORY_CNT;
+    if (sgl.X1MemoryWrite)
+      sgl.X1MemoryWrite += GuiLib_MEMORY_CNT;
+    if (sgl.Y1MemoryRead)
+      sgl.Y1MemoryRead += GuiLib_MEMORY_CNT;
+    if (sgl.Y1MemoryWrite)
+      sgl.Y1MemoryWrite += GuiLib_MEMORY_CNT;
+    if (sgl.X2MemoryRead)
+      sgl.X2MemoryRead += GuiLib_MEMORY_CNT;
+    if (sgl.X2MemoryWrite)
+      sgl.X2MemoryWrite += GuiLib_MEMORY_CNT;
+    if (sgl.Y2MemoryRead)
+      sgl.Y2MemoryRead += GuiLib_MEMORY_CNT;
+    if (sgl.Y2MemoryWrite)
+      sgl.Y2MemoryWrite += GuiLib_MEMORY_CNT;
+    if (sgl.R1MemoryRead)
+      sgl.R1MemoryRead += GuiLib_MEMORY_CNT;
+    if (sgl.R1MemoryWrite)
+      sgl.R1MemoryWrite += GuiLib_MEMORY_CNT;
+    if (sgl.R2MemoryRead)
+      sgl.R2MemoryRead += GuiLib_MEMORY_CNT;
+    if (sgl.R2MemoryWrite)
+      sgl.R2MemoryWrite += GuiLib_MEMORY_CNT;
+  }
+
+  if (sgl.CommonByte6 & 0x01)
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+  else
+    B1 = 0;
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND)))
+    sgl.CurItem.TextPar[0].BackBorderPixels = B1;
+  else
+    sgl.CurItem.TextPar[0].BackBorderPixels = 0;
+
+  if (sgl.CommonByte6 & 0x08)
+  {
+    N = GetItemWord(&sgl.ItemDataPtr);
+    sgl.CurItem.TextPar[0].BackBoxSizeY1 = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.TextPar[0].BackBoxSizeY2 = GetItemByte(&sgl.ItemDataPtr);
+  }
+  else
+    N = 0;
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND)))
+    sgl.CurItem.TextPar[0].BackBoxSizeX = N;
+  else
+    sgl.CurItem.TextPar[0].BackBoxSizeX = 0;
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+  if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_SCROLLBOX)
+  {
+    if (sgl.NextScrollLineReading)
+      if (sgl.CommonByte6 & 0x08)
+      {
+        sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].LineSizeX =
+           sgl.CurItem.TextPar[0].BackBoxSizeX;
+        sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].LineSizeY =
+           sgl.CurItem.TextPar[0].BackBoxSizeY1;
+        sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].LineSizeY2 =
+           sgl.CurItem.TextPar[0].BackBoxSizeY2;
+      }
+  }
+#endif
+
+  sgl.X1Mode = sgl.CommonByte1 & 0x03;
+  sgl.Y1Mode = (sgl.CommonByte1 >> 2) & 0x03;
+  sgl.X2Mode = (sgl.CommonByte1 >> 4) & 0x03;
+  sgl.Y2Mode = (sgl.CommonByte1 >> 6) & 0x03;
+  sgl.R1Mode = (sgl.CommonByte7 >> 1) & 0x03;
+  sgl.R2Mode = (sgl.CommonByte7 >> 3) & 0x03;
+
+  if (sgl.CommonByte2 & 0x01)
+    sgl.ItemX1 = GetItemWord(&sgl.ItemDataPtr);
+  else
+    sgl.ItemX1 = 0;
+  if (sgl.CommonByte2 & 0x02)
+    sgl.ItemY1 = GetItemWord(&sgl.ItemDataPtr);
+  else
+    sgl.ItemY1 = 0;
+  if (sgl.CommonByte2 & 0x04)
+    sgl.ItemX2 = GetItemWord(&sgl.ItemDataPtr);
+  else
+    sgl.ItemX2 = 0;
+  if (sgl.CommonByte2 & 0x08)
+    sgl.ItemY2 = GetItemWord(&sgl.ItemDataPtr);
+  else
+    sgl.ItemY2 = 0;
+  if (sgl.CommonByte6 & 0x10)
+    sgl.ItemR1 = GetItemWord(&sgl.ItemDataPtr);
+  else
+    sgl.ItemR1 = 0;
+  if (sgl.CommonByte6 & 0x20)
+    sgl.ItemR2 = GetItemWord(&sgl.ItemDataPtr);
+  else
+    sgl.ItemR2 = 0;
+
+  if (sgl.CommonByte2 & 0x10)
+  {
+    sgl.X1VarIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (sgl.X1VarIdx >= GuiStruct_VarPtrCnt)
+      sgl.X1VarIdx = 0;
+  }
+  if (sgl.CommonByte2 & 0x20)
+  {
+    sgl.Y1VarIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (sgl.Y1VarIdx >= GuiStruct_VarPtrCnt)
+      sgl.Y1VarIdx = 0;
+  }
+  if (sgl.CommonByte2 & 0x40)
+  {
+    sgl.X2VarIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (sgl.X2VarIdx >= GuiStruct_VarPtrCnt)
+      sgl.X2VarIdx = 0;
+  }
+  if (sgl.CommonByte2 & 0x80)
+  {
+    sgl.Y2VarIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (sgl.Y2VarIdx >= GuiStruct_VarPtrCnt)
+      sgl.Y2VarIdx = 0;
+  }
+  if (sgl.CommonByte6 & 0x40)
+  {
+    sgl.R1VarIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (sgl.R1VarIdx >= GuiStruct_VarPtrCnt)
+      sgl.R1VarIdx = 0;
+  }
+  if (sgl.CommonByte6 & 0x80)
+  {
+    sgl.R2VarIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (sgl.R2VarIdx >= GuiStruct_VarPtrCnt)
+      sgl.R2VarIdx = 0;
+  }
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CLEARAREA +
+                           GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_LINE +
+                           GuiLib_ITEMBIT_FRAME +
+                           GuiLib_ITEMBIT_BLOCK +
+                           GuiLib_ITEMBIT_CIRCLE +
+                           GuiLib_ITEMBIT_ELLIPSE +
+                           GuiLib_ITEMBIT_BITMAP +
+                           GuiLib_ITEMBIT_BACKGROUND +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_ACTIVEAREA +
+                           GuiLib_ITEMBIT_CLIPRECT +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK +
+                           GuiLib_ITEMBIT_TOUCHAREA +
+                           GuiLib_ITEMBIT_SCROLLBOX +
+                           GuiLib_ITEMBIT_GRAPH +
+                           GuiLib_ITEMBIT_GRAPHICSLAYER)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                           GuiLib_ITEMBIT_ROUNDEDBLOCK +
+                           GuiLib_ITEMBIT_QUARTERCIRCLE +
+                           GuiLib_ITEMBIT_QUARTERELLIPSE +
+                           GuiLib_ITEMBIT_CHECKBOX +
+                           GuiLib_ITEMBIT_RADIOBUTTON +
+                           GuiLib_ITEMBIT_BUTTON +
+                           GuiLib_ITEMBIT_EDITBOX +
+                           GuiLib_ITEMBIT_PANEL +
+                           GuiLib_ITEMBIT_MEMO +
+                           GuiLib_ITEMBIT_LISTBOX +
+                           GuiLib_ITEMBIT_COMBOBOX +
+                           GuiLib_ITEMBIT_SCROLLAREA +
+                           GuiLib_ITEMBIT_PROGRESSBAR +
+                           GuiLib_ITEMBIT_STRUCTCOND)))
+  {
+    B1 = (sgl.CommonByte3 >> 6) & 0x03;
+    if (B1 != GuiLib_ALIGN_NOCHANGE)
+      sgl.CurItem.TextPar[0].Alignment = B1;
+  }
+
+  B1 = sgl.CommonByte4 & 0x03;
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_EDITBOX +
+                           GuiLib_ITEMBIT_MEMO +
+                           GuiLib_ITEMBIT_LISTBOX +
+                           GuiLib_ITEMBIT_COMBOBOX +
+                           GuiLib_ITEMBIT_PROGRESSBAR +
+                           GuiLib_ITEMBIT_STRUCTCOND)))
+  {
+    if (B1 != GuiLib_PS_NOCHANGE)
+      sgl.CurItem.TextPar[0].Ps = B1;
+  }
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_EDITBOX +
+                           GuiLib_ITEMBIT_MEMO +
+                           GuiLib_ITEMBIT_LISTBOX +
+                           GuiLib_ITEMBIT_COMBOBOX +
+                           GuiLib_ITEMBIT_PROGRESSBAR +
+                           GuiLib_ITEMBIT_STRUCTCOND)))
+  {
+    if (sgl.CommonByte4 & 0x10)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_UNDERLINE;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_UNDERLINE;
+  }
+  else if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_LINE +
+                               GuiLib_ITEMBIT_CIRCLE))
+  {
+    if (sgl.CommonByte4 & 0x10)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_PATTERNEDLINE;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_PATTERNEDLINE;
+  }
+
+  if (sgl.CommonByte4 & 0x20)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_AUTOREDRAWFIELD;
+  else
+    sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_AUTOREDRAWFIELD;
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  if (sgl.CommonByte4 & 0x40)
+    sgl.CurItem.CursorFieldNo = GetItemByte(&sgl.ItemDataPtr);
+  else
+    sgl.CurItem.CursorFieldNo = -1;
+#endif
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+  if (sgl.CommonByte5 & 0x01)
+    BS2 = GetItemByte(&sgl.ItemDataPtr);
+  else
+    BS2 = -1;
+  if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                          GuiLib_ITEMBIT_TEXTBLOCK +
+                          GuiLib_ITEMBIT_VAR +
+                          GuiLib_ITEMBIT_VARBLOCK))
+    sgl.CurItem.BlinkFieldNo = BS2;
+  else
+    sgl.CurItem.BlinkFieldNo = -1;
+#endif
+
+  if (sgl.CommonByte4 & 0x80)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_TRANSLATION;
+  else
+    sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_TRANSLATION;
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON)))
+  {
+    if (sgl.CommonByte5 & 0x80)
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+    else
+    {
+      if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_VAR +
+                               GuiLib_ITEMBIT_VARBLOCK)) ||
+          (sgl.CommonByte4 & 0x80))
+        I = LanguageIndex;
+      else
+        I = 0;
+      B1 = ReadByte(GuiFont_LanguageTextDir[I]);
+    }
+  }
+  else
+    B1 = 0;
+  if (B1)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_REVERSEWRITING;
+  else
+    sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_REVERSEWRITING;
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_LINE)) &&
+      (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_PATTERNEDLINE))
+    sgl.CurItem.LinePattern = GetItemByte(&sgl.ItemDataPtr);
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+  if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                          GuiLib_ITEMBIT_TEXTBLOCK +
+                          GuiLib_ITEMBIT_VAR +
+                          GuiLib_ITEMBIT_VARBLOCK))
+  {
+    if (sgl.CommonByte5 & 0x01)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_BLINKTEXTFIELD;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_BLINKTEXTFIELD;
+  }
+#endif
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON)))
+    sgl.CurItem.TextCnt = GetItemByte(&sgl.ItemDataPtr);
+  else
+    sgl.CurItem.TextCnt = 1;
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK +
+                           GuiLib_ITEMBIT_SCROLLBOX +
+                           GuiLib_ITEMBIT_GRAPH)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON +
+                           GuiLib_ITEMBIT_EDITBOX +
+                           GuiLib_ITEMBIT_LISTBOX +
+                           GuiLib_ITEMBIT_COMBOBOX +
+                           GuiLib_ITEMBIT_PROGRESSBAR +
+                           GuiLib_ITEMBIT_STRUCTCOND)))
+  {
+    if (sgl.CurItem.ItemType == GuiLib_ITEM_BUTTON)
+      J = 3;
+    else
+      J = 1;
+    for (I = 0; I < J; I++)
+    {
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      if (B1 != 0xFF)
+        sgl.CurItem.TextPar[I].FontIndex = B1 + 1;
+    }
+  }
+
+  if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXTBLOCK +
+                          GuiLib_ITEMBIT_VARBLOCK))
+  {
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+    sgl.CurItem.CompPars.CompTextBox.ScrollPos = 0;
+    sgl.CurItem.CompPars.CompTextBox.ScrollIndex = GetItemByte(&sgl.ItemDataPtr);
+#else
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+#endif
+  }
+
+  sgl.CurItem.UpdateType = GuiLib_AUTOREDRAW_MODE;
+
+  if (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_CHECKBOX +
+                          GuiLib_ITEMBIT_RADIOBUTTON +
+                          GuiLib_ITEMBIT_BUTTON +
+                          GuiLib_ITEMBIT_EDITBOX +
+                          GuiLib_ITEMBIT_LISTBOX +
+                          GuiLib_ITEMBIT_COMBOBOX +
+                          GuiLib_ITEMBIT_PROGRESSBAR))
+  {
+    PtrIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (PtrIdx >= GuiStruct_VarPtrCnt)
+      PtrIdx = 0;
+
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_AUTOREDRAWFIELD;
+    sgl.CurItem.UpdateType = GuiLib_UPDATE_ON_CHANGE;
+    sgl.CurItem.VarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[PtrIdx]);
+    sgl.CurItem.VarType = ReadByte(GuiStruct_VarTypeList[PtrIdx]);
+  }
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_VAR +
+                           GuiLib_ITEMBIT_VARBLOCK)) ||
+      (sgl.ItemTypeBit2 &  GuiLib_ITEMBIT_STRUCTCOND))
+  {
+    PtrIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (PtrIdx >= GuiStruct_VarPtrCnt)
+      PtrIdx = 0;
+
+    sgl.CurItem.UpdateType = GuiLib_AUTOREDRAW_MODE;
+    sgl.CurItem.VarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[PtrIdx]);
+    sgl.CurItem.VarType = ReadByte(GuiStruct_VarTypeList[PtrIdx]);
+
+  }
+
+#ifdef GuiConst_AUTOREDRAW_ON_CHANGE
+  if ((sgl.CommonByte4 & 0x20) &&
+     ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK +
+                           GuiLib_ITEMBIT_DOT +
+                           GuiLib_ITEMBIT_LINE +
+                           GuiLib_ITEMBIT_FRAME +
+                           GuiLib_ITEMBIT_BLOCK +
+                           GuiLib_ITEMBIT_CIRCLE +
+                           GuiLib_ITEMBIT_ELLIPSE +
+                           GuiLib_ITEMBIT_BITMAP +
+                           GuiLib_ITEMBIT_BACKGROUND +
+                           GuiLib_ITEMBIT_STRUCTURE)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                           GuiLib_ITEMBIT_ROUNDEDBLOCK +
+                           GuiLib_ITEMBIT_QUARTERCIRCLE +
+                           GuiLib_ITEMBIT_QUARTERELLIPSE))))
+  {
+    PtrIdx = GetItemWord(&sgl.ItemDataPtr);
+    if (PtrIdx >= GuiStruct_VarPtrCnt)
+      PtrIdx = 0;
+
+    sgl.CurItem.UpdateType = GuiLib_AUTOREDRAW_MODE;
+    sgl.CurItem.VarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[PtrIdx]);
+    sgl.CurItem.VarType = ReadByte(GuiStruct_VarTypeList[PtrIdx]);
+  }
+#endif
+
+  if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_FRAME +
+                          GuiLib_ITEMBIT_CIRCLE +
+                          GuiLib_ITEMBIT_ELLIPSE))
+  {
+    sgl.CurItem.FrameThickness = GetItemByte(&sgl.ItemDataPtr);
+  }
+
+  if (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_QUARTERCIRCLE +
+                          GuiLib_ITEMBIT_QUARTERELLIPSE))
+  {
+    sgl.CurItem.FrameThickness = GetItemByte(&sgl.ItemDataPtr) % 4;
+  }
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_STRUCTARRAY)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND)))
+    sgl.CurItem.CompPars.StructCall.IndexCount = GetItemWord(&sgl.ItemDataPtr);
+
+#ifdef GuiConst_ITEM_STRUCTCOND_INUSE
+  if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_STRUCTCOND)
+  {
+    for (CondI = 0; CondI < sgl.CurItem.CompPars.StructCall.IndexCount; CondI++)
+    {
+      sgl.CurItem.CompPars.StructCall.IndexFirst[CondI] = GetItemWord(&sgl.ItemDataPtr);
+      sgl.CurItem.CompPars.StructCall.IndexLast[CondI] = GetItemWord(&sgl.ItemDataPtr);
+      sgl.CurItem.CompPars.StructCall.CallIndex[CondI] = GetItemWord(&sgl.ItemDataPtr);
+    }
+  }
+#endif
+
+  if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_ACTIVEAREA +
+                          GuiLib_ITEMBIT_CLIPRECT))
+  {
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+    if (B1 & 0x01)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_CLIPPING;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_CLIPPING;
+    if (B1 & 0x02)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_ACTIVEAREARELCOORD;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_ACTIVEAREARELCOORD;
+  }
+
+  if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_FORMATTER)
+  {
+    sgl.CurItem.FormatFormat = GetItemByte(&sgl.ItemDataPtr);
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+    if (B1 & 0x01)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATSHOWSIGN;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATSHOWSIGN;
+    if (B1 & 0x02)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATZEROPADDING;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATZEROPADDING;
+    sgl.CurItem.FormatAlignment = (B1 >> 2) & 0x03;
+    if (B1 & 0x10)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATTRAILINGZEROS;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATTRAILINGZEROS;
+    if (B1 & 0x20)
+      sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATTHOUSANDSSEP;
+    else
+      sgl.CurItem.TextPar[0].BitFlags &= ~GuiLib_BITFLAG_FORMATTHOUSANDSSEP;
+    sgl.CurItem.FormatFieldWidth = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.FormatDecimals = GetItemByte(&sgl.ItemDataPtr);
+  }
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_STRUCTURE +
+                           GuiLib_ITEMBIT_STRUCTARRAY +
+                           GuiLib_ITEMBIT_BITMAP +
+                           GuiLib_ITEMBIT_BACKGROUND)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_STRUCTCOND)))
+    sgl.CurItem.StructToCallIndex = GetItemWord(&sgl.ItemDataPtr);
+
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+  if (sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXTBLOCK +
+                          GuiLib_ITEMBIT_VARBLOCK))
+  {
+    sgl.CurItem.CompPars.CompTextBox.HorzAlignment = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.CompPars.CompTextBox.VertAlignment = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.CompPars.CompTextBox.LineDist = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.CompPars.CompTextBox.LineDistRelToFont = GetItemByte(&sgl.ItemDataPtr);
+  }
+#endif
+
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+  if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_TOUCHAREA)
+    sgl.CurItem.CompPars.CompTouch.AreaNo = GetItemWord(&sgl.ItemDataPtr);
+#endif
+
+  if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_POSCALLBACK)
+    sgl.CurItem.PosCallbackNo = GetItemWord(&sgl.ItemDataPtr);
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+  if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_SCROLLBOX)
+  {
+    ScrollBoxIndex = GetItemByte(&sgl.ItemDataPtr);
+    sgl.GlobalScrollBoxIndex = ScrollBoxIndex;
+    sgl.ScrollBoxesAry[ScrollBoxIndex].InUse = GuiLib_SCROLL_STRUCTURE_READ;
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType = GetItemByte(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].MakeUpStructIndex =
+       GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollVisibleLines =
+       GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineVerticalOffset =
+       GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineOffsetX = GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineOffsetY = GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeX = GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineSizeY = GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructIndex = GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructOffsetX =
+       GetItemWord(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineStructOffsetY =
+       GetItemWord(&sgl.ItemDataPtr);
+    B1 = GetItemByte(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorTransparent = 0;
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = 0xFFFF;
+
+    switch (B1)
+    {
+      case GuiLib_COLOR_NOCHANGE:
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = sgl.CurItem.ForeColor;
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = sgl.CurItem.ForeColorIndex;
+        break;
+      case GuiLib_COLOR_FORE:
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = GuiConst_PIXEL_ON;
+        break;
+      case GuiLib_COLOR_BACK:
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = GuiConst_PIXEL_OFF;
+        break;
+      case GuiLib_COLOR_OTHER:
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = (GuiConst_INTCOLOR)
+           GetItemColor(&sgl.ItemDataPtr);
+        break;
+      case GuiLib_COLOR_INVERT:
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = TmpForeColor;
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = TmpForeColIdx;
+        break;
+      case GuiLib_COLOR_TRANSP:
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorTransparent = 1;
+        break;
+      case GuiLib_COLOR_TABLE:
+        sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor =
+           GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+        break;
+      case GuiLib_COLOR_VAR:
+        ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+        if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+          ColVarPtrIdx = 0;
+        ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+        if (ColVarPtr == 0)
+          sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = GuiConst_PIXEL_ON;
+        else
+        {
+          sgl.ScrollBoxesAry[ScrollBoxIndex].LineColor = *ColVarPtr;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].LineColorIndex = ColVarPtrIdx;
+        }
+        break;
+    }
+    sgl.ScrollBoxesAry[ScrollBoxIndex].WrapMode = GetItemByte(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollStartOfs = GetItemByte(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollMode = GetItemByte(&sgl.ItemDataPtr);
+    sgl.ScrollBoxesAry[ScrollBoxIndex].LineMarkerCount = GetItemByte(&sgl.ItemDataPtr);
+    for (L = 0; L < sgl.ScrollBoxesAry[ScrollBoxIndex].LineMarkerCount; L++)
+    {
+      sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = 0xFFFF;
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = sgl.CurItem.BackColor;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = sgl.CurItem.BackColorIndex;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = GuiConst_PIXEL_ON;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = GuiConst_PIXEL_OFF;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = (GuiConst_INTCOLOR)
+             GetItemColor(&sgl.ItemDataPtr);
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0;
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = TmpForeColor;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = TmpForeColIdx;
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 1;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0;
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = GuiConst_PIXEL_ON;
+          else
+          {
+            sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColor[L] = *ColVarPtr;
+            sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorIndex[L] = ColVarPtrIdx;
+          }
+          sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerColorTransparent[L] = 0;
+          break;
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStructIndex[L] =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerDrawingOrder[L] =
+         GetItemByte(&sgl.ItemDataPtr);
+      if (L || (sgl.ScrollBoxesAry[ScrollBoxIndex].ScrollBoxType))
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[L] = 0;
+      else
+        sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerSize[L] = 1;
+      sgl.ScrollBoxesAry[ScrollBoxIndex].MarkerStartLine[L] = 0;
+    }
+
+    sgl.ScrollBoxesAry[ScrollBoxIndex].BarType = GetItemByte(&sgl.ItemDataPtr);
+#ifndef GuiConst_SCROLLITEM_BAR_NONE
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarType != GuiLib_MARKER_NONE)
+    {
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMode = GetItemByte(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarPositionX = GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarPositionY = GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeX = GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarSizeY = GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarStructIndex = GetItemWord(&sgl.ItemDataPtr);
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1 & 0x07)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = sgl.CurItem.ForeColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = (GuiConst_INTCOLOR)
+             GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = TmpBackColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarForeColor = *ColVarPtr;
+          break;
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarTransparent = 0;
+      switch ((B1 & 0x38) >> 3)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = sgl.CurItem.ForeColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = (GuiConst_INTCOLOR)
+             GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = TmpForeColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarTransparent = 1;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarBackColor = *ColVarPtr;
+          break;
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarThickness = GetItemByte(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerLeftOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerRightOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTopOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBottomOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarIconPtr =
+         (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+#ifdef GuiConst_CHARMODE_ANSI
+      sgl.ItemDataPtr++;
+#else
+      sgl.ItemDataPtr += 2;
+#endif
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconFont =
+         GetItemByte(&sgl.ItemDataPtr) + 1;
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconOffsetX =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerIconOffsetY =
+         GetItemWord(&sgl.ItemDataPtr);
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1 & 0x07)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = sgl.CurItem.ForeColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor =
+             GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor =
+             (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = TmpBackColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerForeColor = *ColVarPtr;
+          break;
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTransparent = 0;
+      switch ((B1 & 0x38) >> 3)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = sgl.CurItem.BackColor;
+          break;
+
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = GuiConst_PIXEL_ON;
+          break;
+
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor =
+             GuiConst_PIXEL_OFF;
+          break;
+
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor =
+             (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = TmpForeColor;
+          break;
+
+        case GuiLib_COLOR_TRANSP:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerTransparent = 1;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBackColor = *ColVarPtr;
+          break;
+      }
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarType == GuiLib_MARKER_BITMAP)
+      {
+        sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIndex =
+           GetItemWord(&sgl.ItemDataPtr);
+#ifdef GuiConst_REMOTE_BITMAP_DATA
+        GuiLib_RemoteDataReadBlock(
+           (GuiConst_INT32U PrefixRom)GuiStruct_BitmapPtrList[
+           sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIndex], 4,
+           BitmapHeader);
+        PixelDataPtr = &BitmapHeader[0] + 2;
+#else
+        PixelDataPtr = (GuiConst_INT8U PrefixRom *)ReadWord(GuiStruct_BitmapPtrList[
+           sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIndex]) + 2;
+#endif
+        sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapHeight =
+           (GuiConst_INT16S)*PixelDataPtr;
+        PixelDataPtr++;
+        sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapHeight +=
+           256*(GuiConst_INT16S)*PixelDataPtr;
+        B1 = GetItemByte(&sgl.ItemDataPtr);
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+        sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIsTransparent =
+           (B1 & 0x01);
+        if (sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIsTransparent)
+#ifdef GuiConst_COLOR_DEPTH_1
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapTranspColor =
+             (B1 >> 1) & 0x01;
+#else
+          sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapTranspColor =
+             GetItemColor(&sgl.ItemDataPtr);
+#endif
+#else
+        sgl.ScrollBoxesAry[ScrollBoxIndex].BarMarkerBitmapIsTransparent = 0;
+#endif
+      }
+    }
+#endif
+
+    sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType = GetItemByte(&sgl.ItemDataPtr);
+#ifndef GuiConst_SCROLLITEM_INDICATOR_NONE
+    if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType != GuiLib_INDICATOR_NONE)
+    {
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMode = GetItemByte(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorPositionX =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorPositionY =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeX =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorSizeY =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorStructIndex =
+          GetItemWord(&sgl.ItemDataPtr);
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1 & 0x07)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = sgl.CurItem.ForeColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor =
+             GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor =
+             (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = TmpBackColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorForeColor = *ColVarPtr;
+          break;
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorTransparent = 0;
+      switch ((B1 & 0x38) >> 3)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = sgl.CurItem.BackColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor =
+              GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor =
+             (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = TmpForeColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorTransparent = 1;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorBackColor = *ColVarPtr;
+          break;
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorThickness =
+         GetItemByte(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerLeftOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerRightOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTopOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBottomOffset =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorIconPtr =
+         (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+#ifdef GuiConst_CHARMODE_ANSI
+      sgl.ItemDataPtr++;
+#else
+      sgl.ItemDataPtr += 2;
+#endif
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconFont =
+         GetItemByte(&sgl.ItemDataPtr) + 1;
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconOffsetX =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerIconOffsetY =
+         GetItemWord(&sgl.ItemDataPtr);
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1 & 0x07)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor =
+             sgl.CurItem.ForeColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor =
+             GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor =
+             GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor =
+             (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor =
+             TmpBackColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerForeColor = *ColVarPtr;
+          break;
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTransparent = 0;
+      switch ((B1 & 0x38) >> 3)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor =
+             sgl.CurItem.BackColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor =
+             GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor =
+             GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor =
+             (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor =
+             TmpForeColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerTransparent = 1;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = GuiConst_PIXEL_ON;
+          else
+            sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBackColor = *ColVarPtr;
+          break;
+      }
+      if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorType == GuiLib_MARKER_BITMAP)
+      {
+        sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIndex =
+           GetItemWord(&sgl.ItemDataPtr);
+        B1 = GetItemByte(&sgl.ItemDataPtr);
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+        sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIsTransparent =
+           (B1 & 0x01);
+        if (sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIsTransparent)
+#ifdef GuiConst_COLOR_DEPTH_1
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapTranspColor =
+             (B1 >> 1) & 0x01;
+#else
+          sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapTranspColor =
+             GetItemColor(&sgl.ItemDataPtr);
+#endif
+#else
+        sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorMarkerBitmapIsTransparent = 0;
+#endif
+      }
+      sgl.ScrollBoxesAry[ScrollBoxIndex].IndicatorLine = -1;
+    }
+#endif
+  }
+#endif
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+  if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_GRAPH)
+  {
+    GraphIndex = GetItemByte(&sgl.ItemDataPtr);
+    sgl.GlobalGraphIndex = GraphIndex;
+
+    sgl.GraphAry[GraphIndex].InUse = GuiLib_GRAPH_STRUCTURE_USED;
+    sgl.GraphAry[GraphIndex].OriginOffsetX = GetItemWord(&sgl.ItemDataPtr);
+    sgl.GraphAry[GraphIndex].OriginOffsetY = GetItemWord(&sgl.ItemDataPtr);
+    sgl.GraphAry[GraphIndex].ForeColor = sgl.CurItem.ForeColor;
+    sgl.GraphAry[GraphIndex].BackColor = sgl.CurItem.BackColor;
+
+    for (Axis = GuiLib_GRAPHAXIS_X; Axis <= GuiLib_GRAPHAXIS_Y; Axis++)
+    {
+      sgl.GraphAry[GraphIndex].GraphAxesCnt[Axis] = GetItemByte(&sgl.ItemDataPtr);
+      for (L = 0; L < sgl.GraphAry[GraphIndex].GraphAxesCnt[Axis]; L++)
+      {
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags = 0;
+        B = GetItemByte(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Visible = 1;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Line = B & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].LineBetweenAxes = (B >> 7) & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].LineNegative = (B >> 1) & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Arrow = (B >> 2) & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMajor = (B >> 3) & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMinor = (B >> 4) & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Numbers = (B >> 5) & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersAtOrigo = (B >> 6) & 0x01;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Offset =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].ArrowLength =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].ArrowWidth =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMajorLength =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMajorWidth =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMinorLength =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].TicksMinorWidth =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMinValue =
+           GetItemLong(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMinValueOrg =
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMinValue;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMaxValue =
+           GetItemLong(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMaxValueOrg =
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersMaxValue;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersStepMajor =
+           GetItemLong(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersStepMinor =
+           GetItemLong(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersOffset =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].NumbersAtEnd =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatFieldWidth =
+           GetItemByte(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatDecimals =
+           GetItemByte(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatAlignment =
+           GetItemByte(&sgl.ItemDataPtr);
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].FormatFormat =
+           GetItemByte(&sgl.ItemDataPtr);
+        B = GetItemByte(&sgl.ItemDataPtr);
+        if (B & 0x01)
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATSHOWSIGN;
+        else
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATSHOWSIGN;
+        if (B & 0x02)
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATZEROPADDING;
+        else
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATZEROPADDING;
+        if (B & 0x04)
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATTRAILINGZEROS;
+        else
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATTRAILINGZEROS;
+        if (B & 0x08)
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags |= GuiLib_BITFLAG_FORMATTHOUSANDSSEP;
+        else
+          sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].BitFlags &= ~GuiLib_BITFLAG_FORMATTHOUSANDSSEP;
+        sgl.GraphAry[GraphIndex].GraphAxes[L][Axis].Scale = 10000;
+      }
+    }
+
+    sgl.GraphAry[GraphIndex].GraphDataSetCnt = GetItemByte(&sgl.ItemDataPtr);
+    for (L = 0; L < sgl.GraphAry[GraphIndex].GraphDataSetCnt; L++)
+    {
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].DataSize = 0;
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].DataFirst = 0;
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].DataCount = 0;
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].AxisIndexX = 0;
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].AxisIndexY = 0;
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].Visible = 1;
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].Representation =
+         GetItemByte(&sgl.ItemDataPtr);
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].Width =
+         GetItemWord(&sgl.ItemDataPtr);
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].Thickness =
+         GetItemWord(&sgl.ItemDataPtr);
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1 & 0x07)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = sgl.CurItem.ForeColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = (GuiConst_INTCOLOR)
+             GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = TmpBackColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = GuiConst_PIXEL_ON;
+          else
+            sgl.GraphAry[GraphIndex].GraphDataSets[L].ForeColor = *ColVarPtr;
+          break;
+      }
+      sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColorTransparent = 0;
+      switch ((B1 & 0x38) >> 3)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = sgl.CurItem.BackColor;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = GuiConst_PIXEL_ON;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = GuiConst_PIXEL_OFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = (GuiConst_INTCOLOR)
+             GetItemColor(&sgl.ItemDataPtr);
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = TmpForeColor;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColorTransparent = 1;
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+            sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = GuiConst_PIXEL_ON;
+          else
+            sgl.GraphAry[GraphIndex].GraphDataSets[L].BackColor = *ColVarPtr;
+          break;
+      }
+    }
+  }
+#endif
+
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_GRAPHICSLAYER)
+  {
+    GraphicsLayerIndex = GetItemByte(&sgl.ItemDataPtr);
+    sgl.GlobalGraphicsLayerIndex = GraphicsLayerIndex;
+
+    sgl.GraphicsLayerList[GraphicsLayerIndex].InUse = GuiLib_GRAPHICS_LAYER_USED;
+    sgl.GraphicsLayerList[GraphicsLayerIndex].SizeMode = GetItemByte(&sgl.ItemDataPtr);
+    sgl.GraphicsLayerList[GraphicsLayerIndex].InitMode = GetItemByte(&sgl.ItemDataPtr);
+  }
+
+  if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_GRAPHICSFILTER)
+  {
+    GraphicsFilterIndex = GetItemByte(&sgl.ItemDataPtr);
+    sgl.GlobalGraphicsFilterIndex = GraphicsFilterIndex;
+
+    sgl.GraphicsFilterList[GraphicsFilterIndex].InUse = GuiLib_GRAPHICS_FILTER_USED;
+    sgl.GraphicsFilterList[GraphicsFilterIndex].SourceLayerIndexNo =
+       GetItemWord(&sgl.ItemDataPtr);
+    sgl.GraphicsFilterList[GraphicsFilterIndex].DestLayerIndexNo =
+       GetItemWord(&sgl.ItemDataPtr);
+    sgl.GraphicsFilterList[GraphicsFilterIndex].ContAtLayerIndexNo =
+       GetItemWord(&sgl.ItemDataPtr);
+    for (I = 0; I <= 9; I++)
+    {
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      if (B1 == 0)
+      {
+        sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarType[I] = GuiLib_VAR_NONE;
+        sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarPtr[I] = 0;
+        sgl.GraphicsFilterList[GraphicsFilterIndex].ParValueNum[I] =
+           GetItemLong(&sgl.ItemDataPtr);
+      }
+      else
+      {
+        PtrIdx = GetItemWord(&sgl.ItemDataPtr);
+        if (PtrIdx >= GuiStruct_VarPtrCnt)
+          PtrIdx = 0;
+
+        sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarType[I] =
+            ReadByte(GuiStruct_VarTypeList[PtrIdx]);
+        sgl.GraphicsFilterList[GraphicsFilterIndex].ParVarPtr[I] =
+            (void*)ReadWord(GuiStruct_VarPtrList[PtrIdx]);
+        sgl.GraphicsFilterList[GraphicsFilterIndex].ParValueNum[I] = 0;
+      }
+    }
+  }
+#endif
+
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+  if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_CHECKBOX)
+  {
+    sgl.CurItem.CompPars.CompCheckBox.Style = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.CompPars.CompCheckBox.Size = GetItemByte(&sgl.ItemDataPtr);
+    switch (sgl.CurItem.CompPars.CompCheckBox.Style)
+    {
+      case GuiLib_CHECKBOX_ICON:
+        sgl.CurItem.CompPars.CompCheckBox.IconPtr =
+           (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+  #ifdef GuiConst_CHARMODE_ANSI
+        sgl.ItemDataPtr++;
+  #else
+        sgl.ItemDataPtr += 2;
+  #endif
+        sgl.CurItem.CompPars.CompCheckBox.IconFont = GetItemByte(&sgl.ItemDataPtr) + 1;
+        sgl.CurItem.CompPars.CompCheckBox.IconOffsetX = GetItemWord(&sgl.ItemDataPtr);
+        sgl.CurItem.CompPars.CompCheckBox.IconOffsetY = GetItemWord(&sgl.ItemDataPtr);
+        break;
+      case GuiLib_CHECKBOX_BITMAP:
+        sgl.CurItem.CompPars.CompCheckBox.BitmapIndex = GetItemWord(&sgl.ItemDataPtr);
+        B1 = GetItemByte(&sgl.ItemDataPtr);
+  #ifdef GuiConst_BITMAP_SUPPORT_ON
+        sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent = (B1 & 0x01);
+        if (sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent)
+  #ifdef GuiConst_COLOR_DEPTH_1
+          sgl.CurItem.CompPars.CompCheckBox.BitmapTranspColor = (B1 >> 1) & 0x01;
+  #else
+          sgl.CurItem.CompPars.CompCheckBox.BitmapTranspColor =
+             GetItemColor(&sgl.ItemDataPtr);
+  #endif
+  #else
+        sgl.CurItem.CompPars.CompCheckBox.BitmapIsTransparent = 0;
+  #endif
+        break;
+    }
+
+    sgl.CurItem.CompPars.CompCheckBox.MarkStyle = GetItemByte(&sgl.ItemDataPtr);
+    if (sgl.CurItem.CompPars.CompCheckBox.MarkStyle != GuiLib_CHECKBOX_MARK_BITMAP)
+    {
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1 & 0x07)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.CurItem.CompPars.CompCheckBox.MarkColor = sgl.CurItem.ForeColor;
+          sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = sgl.CurItem.ForeColorIndex;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.CurItem.CompPars.CompCheckBox.MarkColor = GuiConst_PIXEL_ON;
+          sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.CurItem.CompPars.CompCheckBox.MarkColor = GuiConst_PIXEL_OFF;
+          sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.CurItem.CompPars.CompCheckBox.MarkColor = (GuiConst_INTCOLOR)
+             GetItemColor(&sgl.ItemDataPtr);
+          sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.CurItem.CompPars.CompCheckBox.MarkColor = TmpBackColor;
+          sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = TmpBackColIdx;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.CurItem.CompPars.CompCheckBox.MarkColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+          {
+            sgl.CurItem.CompPars.CompCheckBox.MarkColor = GuiConst_PIXEL_ON;
+            sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = 0xFFFF;
+          }
+          else
+          {
+            sgl.CurItem.CompPars.CompCheckBox.MarkColor = *ColVarPtr;
+            sgl.CurItem.CompPars.CompCheckBox.MarkColorIndex = ColVarPtrIdx;
+          }
+          break;
+      }
+    }
+    switch (sgl.CurItem.CompPars.CompCheckBox.MarkStyle)
+    {
+      case GuiLib_CHECKBOX_MARK_ICON:
+        sgl.CurItem.CompPars.CompCheckBox.MarkIconPtr =
+           (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+  #ifdef GuiConst_CHARMODE_ANSI
+        sgl.ItemDataPtr++;
+  #else
+        sgl.ItemDataPtr += 2;
+  #endif
+        sgl.CurItem.CompPars.CompCheckBox.MarkIconFont =
+           GetItemByte(&sgl.ItemDataPtr) + 1;
+        sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY =
+           GetItemWord(&sgl.ItemDataPtr);
+        break;
+      case GuiLib_CHECKBOX_MARK_BITMAP:
+        sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIndex =
+           GetItemWord(&sgl.ItemDataPtr);
+        B1 = GetItemByte(&sgl.ItemDataPtr);
+  #ifdef GuiConst_BITMAP_SUPPORT_ON
+        sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent = (B1 & 0x01);
+        if (sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent)
+  #ifdef GuiConst_COLOR_DEPTH_1
+          sgl.CurItem.CompPars.CompCheckBox.MarkBitmapTranspColor =
+             (B1 >> 1) & 0x01;
+  #else
+          sgl.CurItem.CompPars.CompCheckBox.MarkBitmapTranspColor =
+             GetItemColor(&sgl.ItemDataPtr);
+  #endif
+  #else
+        sgl.CurItem.CompPars.CompCheckBox.MarkBitmapIsTransparent = 0;
+  #endif
+        sgl.CurItem.CompPars.CompCheckBox.MarkOffsetX =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.CurItem.CompPars.CompCheckBox.MarkOffsetY =
+           GetItemWord(&sgl.ItemDataPtr);
+        break;
+    }
+  }
+#endif
+
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+  if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_RADIOBUTTON)
+  {
+    sgl.CurItem.CompPars.CompRadioButton.Style = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.CompPars.CompRadioButton.Size = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.CompPars.CompRadioButton.Count = GetItemByte(&sgl.ItemDataPtr);
+    sgl.CurItem.CompPars.CompRadioButton.InterDistance = GetItemWord(&sgl.ItemDataPtr);
+    switch (sgl.CurItem.CompPars.CompRadioButton.Style)
+    {
+      case GuiLib_RADIOBUTTON_ICON:
+        sgl.CurItem.CompPars.CompRadioButton.IconPtr =
+           (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+  #ifdef GuiConst_CHARMODE_ANSI
+        sgl.ItemDataPtr++;
+  #else
+        sgl.ItemDataPtr += 2;
+  #endif
+        sgl.CurItem.CompPars.CompRadioButton.IconFont = GetItemByte(&sgl.ItemDataPtr) + 1;
+        sgl.CurItem.CompPars.CompRadioButton.IconOffsetX = GetItemWord(&sgl.ItemDataPtr);
+        sgl.CurItem.CompPars.CompRadioButton.IconOffsetY = GetItemWord(&sgl.ItemDataPtr);
+        break;
+      case GuiLib_RADIOBUTTON_BITMAP:
+        sgl.CurItem.CompPars.CompRadioButton.BitmapIndex = GetItemWord(&sgl.ItemDataPtr);
+        B1 = GetItemByte(&sgl.ItemDataPtr);
+  #ifdef GuiConst_BITMAP_SUPPORT_ON
+        sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent = (B1 & 0x01);
+        if (sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent)
+  #ifdef GuiConst_COLOR_DEPTH_1
+          sgl.CurItem.CompPars.CompRadioButton.BitmapTranspColor = (B1 >> 1) & 0x01;
+  #else
+          sgl.CurItem.CompPars.CompRadioButton.BitmapTranspColor =
+             GetItemColor(&sgl.ItemDataPtr);
+  #endif
+  #else
+        sgl.CurItem.CompPars.CompRadioButton.BitmapIsTransparent = 0;
+  #endif
+        break;
+    }
+
+    sgl.CurItem.CompPars.CompRadioButton.MarkStyle = GetItemByte(&sgl.ItemDataPtr);
+    if (sgl.CurItem.CompPars.CompRadioButton.MarkStyle != GuiLib_RADIOBUTTON_MARK_BITMAP)
+    {
+      B1 = GetItemByte(&sgl.ItemDataPtr);
+      switch (B1 & 0x07)
+      {
+        case GuiLib_COLOR_NOCHANGE:
+          sgl.CurItem.CompPars.CompRadioButton.MarkColor = sgl.CurItem.ForeColor;
+          sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = sgl.CurItem.ForeColorIndex;
+          break;
+        case GuiLib_COLOR_FORE:
+          sgl.CurItem.CompPars.CompRadioButton.MarkColor = GuiConst_PIXEL_ON;
+          sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_BACK:
+          sgl.CurItem.CompPars.CompRadioButton.MarkColor = GuiConst_PIXEL_OFF;
+          sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_OTHER:
+          sgl.CurItem.CompPars.CompRadioButton.MarkColor = (GuiConst_INTCOLOR)
+             GetItemColor(&sgl.ItemDataPtr);
+          sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_INVERT:
+          sgl.CurItem.CompPars.CompRadioButton.MarkColor = TmpBackColor;
+          sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = TmpBackColIdx;
+          break;
+        case GuiLib_COLOR_TRANSP:
+          break;
+        case GuiLib_COLOR_TABLE:
+          sgl.CurItem.CompPars.CompRadioButton.MarkColor =
+             GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+          sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF;
+          break;
+        case GuiLib_COLOR_VAR:
+          ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+          if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+            ColVarPtrIdx = 0;
+          ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+          if (ColVarPtr == 0)
+          {
+            sgl.CurItem.CompPars.CompRadioButton.MarkColor = GuiConst_PIXEL_ON;
+            sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = 0xFFFF;
+          }
+          else
+          {
+            sgl.CurItem.CompPars.CompRadioButton.MarkColor = *ColVarPtr;
+            sgl.CurItem.CompPars.CompRadioButton.MarkColorIndex = ColVarPtrIdx;
+          }
+          break;
+      }
+    }
+    switch (sgl.CurItem.CompPars.CompRadioButton.MarkStyle)
+    {
+      case GuiLib_RADIOBUTTON_MARK_ICON:
+        sgl.CurItem.CompPars.CompRadioButton.MarkIconPtr =
+           (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+  #ifdef GuiConst_CHARMODE_ANSI
+        sgl.ItemDataPtr++;
+  #else
+        sgl.ItemDataPtr += 2;
+  #endif
+        sgl.CurItem.CompPars.CompRadioButton.MarkIconFont =
+           GetItemByte(&sgl.ItemDataPtr) + 1;
+        sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY =
+           GetItemWord(&sgl.ItemDataPtr);
+        break;
+      case GuiLib_RADIOBUTTON_MARK_BITMAP:
+        sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIndex =
+           GetItemWord(&sgl.ItemDataPtr);
+        B1 = GetItemByte(&sgl.ItemDataPtr);
+  #ifdef GuiConst_BITMAP_SUPPORT_ON
+        sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent = (B1 & 0x01);
+        if (sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent)
+  #ifdef GuiConst_COLOR_DEPTH_1
+          sgl.CurItem.CompPars.CompRadioButton.MarkBitmapTranspColor =
+             (B1 >> 1) & 0x01;
+  #else
+          sgl.CurItem.CompPars.CompRadioButton.MarkBitmapTranspColor =
+             GetItemColor(&sgl.ItemDataPtr);
+  #endif
+  #else
+        sgl.CurItem.CompPars.CompRadioButton.MarkBitmapIsTransparent = 0;
+  #endif
+        sgl.CurItem.CompPars.CompRadioButton.MarkOffsetX =
+           GetItemWord(&sgl.ItemDataPtr);
+        sgl.CurItem.CompPars.CompRadioButton.MarkOffsetY =
+           GetItemWord(&sgl.ItemDataPtr);
+        break;
+    }
+  }
+#endif
+
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+  if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_BUTTON)
+  {
+    sgl.CurItem.CompPars.CompButton.Layout = GetItemByte(&sgl.ItemDataPtr);
+
+    sgl.CurItem.CompPars.CompButton.BodyStyle = GetItemByte(&sgl.ItemDataPtr);
+    if ((sgl.CurItem.CompPars.CompButton.BodyStyle == GuiLib_BUTTON_BODY_ICON) ||
+        (sgl.CurItem.CompPars.CompButton.BodyStyle == GuiLib_BUTTON_BODY_BITMAP))
+    {
+      sgl.CurItem.CompPars.CompButton.BodyLikeUp = GetItemByte(&sgl.ItemDataPtr);
+      for (I = 0; I < 3; I++)
+        if ((I == 0) ||
+           ((I == 1) && !(sgl.CurItem.CompPars.CompButton.BodyLikeUp & 0x01)) ||
+           ((I == 2) && !(sgl.CurItem.CompPars.CompButton.BodyLikeUp & 0x02)))
+        {
+          switch (sgl.CurItem.CompPars.CompButton.BodyStyle)
+          {
+            case GuiLib_BUTTON_BODY_ICON:
+              sgl.CurItem.CompPars.CompButton.BodyIconPtr[I] =
+                 (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+        #ifdef GuiConst_CHARMODE_ANSI
+              sgl.ItemDataPtr++;
+        #else
+              sgl.ItemDataPtr += 2;
+        #endif
+              sgl.CurItem.CompPars.CompButton.BodyIconFont[I] =
+                 GetItemByte(&sgl.ItemDataPtr) + 1;
+              sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              break;
+            case GuiLib_BUTTON_BODY_BITMAP:
+              sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              B1 = GetItemByte(&sgl.ItemDataPtr);
+        #ifdef GuiConst_BITMAP_SUPPORT_ON
+              sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I] =
+                 (B1 & 0x01);
+              if (sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I])
+        #ifdef GuiConst_COLOR_DEPTH_1
+                sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[I] =
+                   (B1 >> 1) & 0x01;
+        #else
+                sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[I] =
+                   GetItemColor(&sgl.ItemDataPtr);
+        #endif
+        #else
+              sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I] = 0;
+        #endif
+              break;
+          }
+        }
+        else
+        {
+          switch (sgl.CurItem.CompPars.CompButton.BodyStyle)
+          {
+            case GuiLib_BUTTON_BODY_ICON:
+              sgl.CurItem.CompPars.CompButton.BodyIconPtr[I] =
+                 sgl.CurItem.CompPars.CompButton.BodyIconPtr[0];
+              sgl.CurItem.CompPars.CompButton.BodyIconFont[I] =
+                 sgl.CurItem.CompPars.CompButton.BodyIconFont[0];
+              sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[I] =
+                 sgl.CurItem.CompPars.CompButton.BodyIconOffsetX[0];
+              sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[I] =
+                 sgl.CurItem.CompPars.CompButton.BodyIconOffsetY[0];
+              break;
+            case GuiLib_BUTTON_BODY_BITMAP:
+              sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[I] =
+                 sgl.CurItem.CompPars.CompButton.BodyBitmapIndex[0];
+              sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[I] =
+                 sgl.CurItem.CompPars.CompButton.BodyBitmapIsTransparent[0];
+              sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[I] =
+                 sgl.CurItem.CompPars.CompButton.BodyBitmapTranspColor[0];
+              break;
+          }
+        }
+    }
+
+    if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_GLYPH)
+    {
+      sgl.CurItem.CompPars.CompButton.TextLikeUp = GetItemByte(&sgl.ItemDataPtr);
+      for (I = 0; I < 3; I++)
+      {
+        if ((I == 0) ||
+           ((I == 1) && !(sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x04)) ||
+           ((I == 2) && !(sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x08)))
+        {
+          B1 = GetItemByte(&sgl.ItemDataPtr);
+          switch (B1 & 0x07)
+          {
+            case GuiLib_COLOR_NOCHANGE:
+              sgl.CurItem.CompPars.CompButton.TextColor[I] = sgl.CurItem.ForeColor;
+              sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = sgl.CurItem.ForeColorIndex;
+              break;
+            case GuiLib_COLOR_FORE:
+              sgl.CurItem.CompPars.CompButton.TextColor[I] = GuiConst_PIXEL_ON;
+              sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF;
+              break;
+            case GuiLib_COLOR_BACK:
+              sgl.CurItem.CompPars.CompButton.TextColor[I] = GuiConst_PIXEL_OFF;
+              sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF;
+              break;
+            case GuiLib_COLOR_OTHER:
+              sgl.CurItem.CompPars.CompButton.TextColor[I] =
+                 (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+              sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF;
+              break;
+            case GuiLib_COLOR_INVERT:
+              sgl.CurItem.CompPars.CompButton.TextColor[I] = TmpBackColor;
+              sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = TmpBackColIdx;
+              break;
+            case GuiLib_COLOR_TRANSP:
+              break;
+            case GuiLib_COLOR_TABLE:
+              sgl.CurItem.CompPars.CompButton.TextColor[I] =
+                 GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+              sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF;
+              break;
+            case GuiLib_COLOR_VAR:
+              ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+              if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+                ColVarPtrIdx = 0;
+              ColVarPtr = (GuiConst_INTCOLOR*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+              if (ColVarPtr == 0)
+              {
+                sgl.CurItem.CompPars.CompButton.TextColor[I] = GuiConst_PIXEL_ON;
+                sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = 0xFFFF;
+              }
+              else
+              {
+                sgl.CurItem.CompPars.CompButton.TextColor[I] = *ColVarPtr;
+                sgl.CurItem.CompPars.CompButton.TextColorIndex[I] = ColVarPtrIdx;
+              }
+              break;
+          }
+
+          B1 = GetItemByte(&sgl.ItemDataPtr);
+          if (B1 & 0x04)
+            sgl.CurItem.TextPar[I].BitFlags |= GuiLib_BITFLAG_UNDERLINE;
+          else
+            sgl.CurItem.TextPar[I].BitFlags &= ~GuiLib_BITFLAG_UNDERLINE;
+          B1 = B1 & 0x03;
+          if (B1 != GuiLib_PS_NOCHANGE)
+            sgl.CurItem.TextPar[I].Ps = B1;
+        }
+        else
+        {
+          sgl.CurItem.CompPars.CompButton.TextColor[I] =
+             sgl.CurItem.CompPars.CompButton.TextColor[0];
+          sgl.CurItem.TextPar[I] = sgl.CurItem.TextPar[0];
+        }
+      }
+    }
+
+    if (sgl.CurItem.CompPars.CompButton.Layout != GuiLib_BUTTON_LAYOUT_TEXT)
+    {
+      sgl.CurItem.CompPars.CompButton.GlyphStyle = GetItemByte(&sgl.ItemDataPtr);
+      sgl.CurItem.CompPars.CompButton.GlyphLikeUp = GetItemByte(&sgl.ItemDataPtr);
+      for (I = 0; I < 3; I++)
+        if ((I == 0) ||
+           ((I == 1) && !(sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x01)) ||
+           ((I == 2) && !(sgl.CurItem.CompPars.CompButton.GlyphLikeUp & 0x02)))
+        {
+          switch (sgl.CurItem.CompPars.CompButton.GlyphStyle)
+          {
+            case GuiLib_BUTTON_GLYPH_ICON:
+              B1 = GetItemByte(&sgl.ItemDataPtr);
+              switch (B1 & 0x07)
+              {
+                case GuiLib_COLOR_NOCHANGE:
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = sgl.CurItem.ForeColor;
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = sgl.CurItem.ForeColorIndex;
+                  break;
+                case GuiLib_COLOR_FORE:
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = GuiConst_PIXEL_ON;
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF;
+                  break;
+                case GuiLib_COLOR_BACK:
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = GuiConst_PIXEL_OFF;
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF;
+                  break;
+                case GuiLib_COLOR_OTHER:
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] =
+                     (GuiConst_INTCOLOR)GetItemColor(&sgl.ItemDataPtr);
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF;
+                  break;
+                case GuiLib_COLOR_INVERT:
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = TmpBackColor;
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = TmpBackColIdx;
+                  break;
+                case GuiLib_COLOR_TRANSP:
+                  break;
+                case GuiLib_COLOR_TABLE:
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] =
+                     GuiStruct_ColorTable[GetItemByte(&sgl.ItemDataPtr)];
+                  sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF;
+                  break;
+                case GuiLib_COLOR_VAR:
+                  ColVarPtrIdx = GetItemWord(&sgl.ItemDataPtr);
+                  if (ColVarPtrIdx >= GuiStruct_VarPtrCnt)
+                    ColVarPtrIdx = 0;
+                  ColVarPtr = (GuiConst_INTCOLOR*)ReadWord(GuiStruct_VarPtrList[ColVarPtrIdx]);
+                  if (ColVarPtr == 0)
+                  {
+                    sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = GuiConst_PIXEL_ON;
+                    sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = 0xFFFF;
+                  }
+                  else
+                  {
+                    sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] = *ColVarPtr;
+                    sgl.CurItem.CompPars.CompButton.GlyphIconColorIndex[I] = ColVarPtrIdx;
+                  }
+                  break;
+              }
+
+              sgl.CurItem.CompPars.CompButton.GlyphIconPtr[I] =
+                 (GuiConst_TEXT PrefixRom *)sgl.ItemDataPtr;
+        #ifdef GuiConst_CHARMODE_ANSI
+              sgl.ItemDataPtr++;
+        #else
+              sgl.ItemDataPtr += 2;
+        #endif
+              sgl.CurItem.CompPars.CompButton.GlyphIconFont[I] =
+                 GetItemByte(&sgl.ItemDataPtr) + 1;
+              sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              break;
+            case GuiLib_BUTTON_GLYPH_BITMAP:
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              B1 = GetItemByte(&sgl.ItemDataPtr);
+        #ifdef GuiConst_BITMAP_SUPPORT_ON
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I] =
+                 (B1 & 0x01);
+              if (sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I])
+        #ifdef GuiConst_COLOR_DEPTH_1
+                sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[I] =
+                   (B1 >> 1) & 0x01;
+        #else
+                sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[I] =
+                   GetItemColor(&sgl.ItemDataPtr);
+        #endif
+        #else
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I] = 0;
+        #endif
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[I] =
+                 GetItemWord(&sgl.ItemDataPtr);
+              break;
+          }
+        }
+        else
+        {
+          switch (sgl.CurItem.CompPars.CompButton.GlyphStyle)
+          {
+            case GuiLib_BUTTON_GLYPH_ICON:
+              sgl.CurItem.CompPars.CompButton.GlyphIconColor[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphIconColor[0];
+              sgl.CurItem.CompPars.CompButton.GlyphIconPtr[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphIconPtr[0];
+              sgl.CurItem.CompPars.CompButton.GlyphIconFont[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphIconFont[0];
+              sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphIconOffsetX[0];
+              sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphIconOffsetY[0];
+              break;
+            case GuiLib_BUTTON_GLYPH_BITMAP:
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphBitmapIndex[0];
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphBitmapIsTransparent[0];
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphBitmapTranspColor[0];
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetX[0];
+              sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[I] =
+                 sgl.CurItem.CompPars.CompButton.GlyphBitmapOffsetY[0];
+              break;
+          }
+        }
+    }
+  }
+#endif
+
+#ifdef GuiConst_ITEM_PANEL_INUSE
+  if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_PANEL)
+  {
+    sgl.CurItem.CompPars.CompPanel.Style = GetItemByte(&sgl.ItemDataPtr);
+  }
+#endif
+
+  if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_TEXT +
+                           GuiLib_ITEMBIT_TEXTBLOCK)) ||
+      (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_BUTTON)))
+  {
+    if (sgl.CommonByte4 & 0x80)
+    {
+#ifdef GuiConst_LANGUAGE_ALL_ACTIVE
+      N = GuiConst_LANGUAGE_CNT;
+      W1 = LanguageIndex;
+#else
+      N = GuiConst_LANGUAGE_ACTIVE_CNT;
+      W1 = ReadWord(GuiFont_LanguageIndex[LanguageIndex]);
+#endif
+    }
+    else
+    {
+      N = 1;
+      W1 = 0;
+    }
+
+    J = 0;
+    for (I = 0; I < sgl.CurItem.TextCnt; I++)
+    {
+#ifndef GuiConst_REMOTE_TEXT_DATA
+      TxtSum1 = 0;
+      TxtSum2 = 0;
+#endif
+      for (X = 0; X < N; X++)
+      {
+#ifdef GuiConst_REMOTE_TEXT_DATA
+        Ti = GetItemWord(&sgl.ItemDataPtr);
+        if (X == W1)
+        {
+          sgl.CurItem.TextLength[J] = GetRemoteText(Ti);
+          sgl.CurItem.TextIndex[J] = Ti;
+          sgl.CurItem.TextPtr[J] = &sgl.GuiLib_RemoteTextBuffer[0];
+        }
+#else
+        TxtSize = GetItemByte(&sgl.ItemDataPtr);
+        if (TxtSize == 0xFF)
+          TxtSize = GetItemWord(&sgl.ItemDataPtr);
+
+        if (X == W1)
+        {
+          sgl.CurItem.TextLength[J] = GuiLib_GET_MIN(TxtSize, GuiConst_MAX_TEXT_LEN);
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+          TxtReadSize = sgl.CurItem.TextLength[J] + 1;
+#ifndef GuiConst_CHARMODE_ANSI
+          TxtReadSize *= 2;
+#endif
+#endif
+        }
+
+        TxtSize++;
+#ifndef GuiConst_CHARMODE_ANSI
+        TxtSize *= 2;
+#endif
+
+#ifndef GuiConst_REMOTE_TEXT_DATA
+        if (X < W1)
+          TxtSum1 += TxtSize;
+        else
+          TxtSum2 += TxtSize;
+#endif
+#endif // GuiConst_REMOTE_TEXT_DATA
+      }
+
+#ifndef GuiConst_REMOTE_TEXT_DATA
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+      sgl.RemoteStructOffset += TxtSum1;
+      GuiLib_RemoteDataReadBlock(
+         sgl.RemoteStructOffset,
+         TxtReadSize,
+         (GuiConst_INT8U*)&sgl.GuiLib_RemoteStructText);
+      sgl.CurItem.TextOffset[J] = sgl.RemoteStructOffset;
+      sgl.CurItem.TextPtr[J] = (GuiConst_TEXT PrefixGeneric *)&sgl.GuiLib_RemoteStructText;
+      sgl.RemoteStructOffset += TxtSum2;
+#else
+      sgl.ItemDataPtr += TxtSum1;
+      sgl.CurItem.TextPtr[J] = (GuiConst_TEXT PrefixGeneric *)(sgl.ItemDataPtr);
+      sgl.ItemDataPtr += TxtSum2;
+#endif
+#endif // GuiConst_REMOTE_TEXT_DATA
+
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+      if ((sgl.ItemTypeBit2 & GuiLib_ITEMBIT_BUTTON) &&
+         (((I == 0) && (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x01)) ||
+          ((I == 1) && (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x02))))
+        J++;
+#endif
+      J++;
+    }
+
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+    if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_BUTTON)
+    {
+      if (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x01)
+      {
+        sgl.CurItem.TextLength[1] = sgl.CurItem.TextLength[0];
+        sgl.CurItem.TextPtr[1] = sgl.CurItem.TextPtr[0];
+
+#ifdef GuiConst_REMOTE_TEXT_DATA
+        sgl.CurItem.TextIndex[1] = sgl.CurItem.TextIndex[0];
+#else
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+        sgl.CurItem.TextOffset[1] = sgl.CurItem.TextOffset[0];
+#endif
+#endif
+
+      }
+      if (sgl.CurItem.CompPars.CompButton.TextLikeUp & 0x02)
+      {
+        sgl.CurItem.TextLength[2] = sgl.CurItem.TextLength[0];
+        sgl.CurItem.TextPtr[2] = sgl.CurItem.TextPtr[0];
+
+#ifdef GuiConst_REMOTE_TEXT_DATA
+        sgl.CurItem.TextIndex[2] = sgl.CurItem.TextIndex[0];
+#else
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+        sgl.CurItem.TextOffset[2] = sgl.CurItem.TextOffset[0];
+#endif
+#endif
+      }
+    }
+#endif
+  }
+}
+//------------------------------------------------------------------------------
+static GuiConst_INT16S VarStrCmp(
+   GuiConst_INT8U PrefixLocate *S1,
+   GuiConst_INT8U PrefixLocate *S2)
+{
+  GuiConst_INT16S len = 0;
+
+#ifdef GuiConst_CHARMODE_ANSI
+  do
+  {
+    if ((*S1 == 0) && (*S2 == 0))
+      return (0);
+
+    else if (*S1 == 0)
+      return (-1);
+    else if (*S2 == 0)
+      return (1);
+    else if (*S1 < *S2)
+      return (-1);
+    else if (*S1 > *S2)
+      return (1);
+    S1++;
+    S2++;
+  }
+  while ((len++) < GuiConst_AUTOREDRAW_MAX_VAR_SIZE);
+#else
+  GuiConst_INT16U T1, T2, T3;
+
+  do
+  {
+    T1 = *S1++;
+    T3 = *S1++;
+    T1 |= T3 << 8;
+
+    T2 = *S2++;
+    T3 = *S2++;
+    T2 |= T3 << 8;
+
+    if (T1 < T2)
+      return (-1);
+    else if (T1 > T2)
+      return (1);
+    else if (T1 == 0)
+      return (0);
+  }
+  while ((len++) < GuiConst_AUTOREDRAW_MAX_VAR_SIZE);
+#endif
+  return (1);
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_Init(void)
+{
+  GuiConst_INT16S I;
+
+  for (I=0;I<GuiConst_MAX_DYNAMIC_ITEMS;I++)
+  {
+    sgl.AutoRedraw[I].Next = -1;
+    sgl.AutoRedraw[I].Prev = -1;
+    sgl.AutoRedraw[I].Valid = ITEM_NONE;
+  }
+
+  sgl.AutoRedrawCount = 0;
+  sgl.AutoRedrawFirst = -1;
+  sgl.AutoRedrawLast = -1;
+  sgl.AutoRedrawCount = 0;
+  sgl.AutoRedrawParent = -1;
+  sgl.AutoRedrawUpdate = GuiLib_FALSE;
+  sgl.AutoRedrawInsertPoint = GuiConst_MAX_DYNAMIC_ITEMS;
+  sgl.AutoRedrawLatest = -1;
+
+  return;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_Reset(void)
+{
+  sgl.AutoRedrawNext = sgl.AutoRedrawFirst;
+
+  return sgl.AutoRedrawNext;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_GetNext(GuiConst_INT16S I)
+{
+  GuiConst_INT16S N, result;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return -1;
+
+  result = -1;
+
+  N = sgl.AutoRedraw[I].Next;
+  while ((N >= 0) && (N < GuiConst_MAX_DYNAMIC_ITEMS))
+  {
+    if ((sgl.AutoRedraw[N].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW)
+    {
+      result = N;
+      break;
+    }
+    else if (sgl.AutoRedraw[N].Valid == ITEM_NONE)
+      break;
+    else
+    {
+      N = sgl.AutoRedraw[N].Next;
+      if ((N < 0) || (N >= GuiConst_MAX_DYNAMIC_ITEMS))
+        break;
+    }
+  }
+
+  return result;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT8S AutoRedraw_ItemIsStruct(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return GuiLib_FALSE;
+
+  if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW)
+  {
+    if ((sgl.AutoRedraw[I].Item.ItemType == GuiLib_ITEM_STRUCTARRAY) ||
+        (sgl.AutoRedraw[I].Item.ItemType == GuiLib_ITEM_STRUCTCOND))
+      return GuiLib_TRUE;
+    else
+      return GuiLib_FALSE;
+  }
+  else
+    return GuiLib_FALSE;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT8S AutoRedraw_GetLevel(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return -1;
+
+  if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW)
+    return sgl.AutoRedraw[I].Level;
+  else
+    return 0;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_Add(PrefixLocate GuiLib_ItemRec * PrefixLocate Item, GuiConst_INT16S Struct, GuiConst_INT8U Level)
+{
+  GuiConst_INT16S I, N;
+
+  I = -1;
+
+  if (sgl.AutoRedrawCount < GuiConst_MAX_DYNAMIC_ITEMS)
+  {
+
+    if (sgl.AutoRedrawFirst == -1)
+    {
+      I = 0;
+      sgl.AutoRedrawFirst = 0;
+      sgl.AutoRedrawLast  = -1;
+      sgl.AutoRedrawNext  = 0;
+    }
+    else
+    {
+      for (N=0;N<GuiConst_MAX_DYNAMIC_ITEMS;N++)
+      {
+        if (sgl.AutoRedraw[N].Valid == ITEM_NONE)
+        {
+          I = N;
+          break;
+        }
+      }
+    }
+
+    if (I >= 0)
+    {
+      sgl.AutoRedraw[I].Next = -1;
+      sgl.AutoRedraw[I].Prev = sgl.AutoRedrawLast;
+      sgl.AutoRedraw[I].Valid = ITEM_AUTOREDRAW;
+      sgl.AutoRedraw[I].Parent = sgl.AutoRedrawParent;
+      sgl.AutoRedraw[I].Level  = Level;
+      memcpy(&sgl.AutoRedraw[I].Item, Item, sizeof(GuiLib_ItemRec));
+      memcpy(&sgl.AutoRedraw[I].Memory, &sgl.Memory, sizeof(ItemMemory));
+
+      if ((sgl.AutoRedrawLast >= 0)
+       && (sgl.AutoRedrawLast < GuiConst_MAX_DYNAMIC_ITEMS))
+        sgl.AutoRedraw[sgl.AutoRedrawLast].Next = I;
+
+      sgl.AutoRedrawCount++;
+      sgl.AutoRedrawLast = I;
+      sgl.AutoRedrawLatest = I;
+    }
+
+  }
+
+  return I;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_Insert(PrefixLocate GuiLib_ItemRec * PrefixLocate Item,
+          GuiConst_INT16S Struct,
+          GuiConst_INT8U Level)
+{
+  GuiConst_INT16S I, N;
+
+  if ((sgl.AutoRedrawFirst == -1) ||
+      (sgl.AutoRedrawInsertPoint >= GuiConst_MAX_DYNAMIC_ITEMS))
+  {
+    return AutoRedraw_Add(Item, Struct, Level);
+  }
+
+  if (sgl.AutoRedrawCount < GuiConst_MAX_DYNAMIC_ITEMS)
+  {
+    I = -1;
+
+    for (N=0;N<GuiConst_MAX_DYNAMIC_ITEMS;N++)
+    {
+      if (sgl.AutoRedraw[N].Valid == ITEM_NONE)
+      {
+        I = N;
+        break;
+      }
+    }
+  }
+  else
+    return -1;
+
+  if (I >= 0)
+  {
+    if (sgl.AutoRedrawInsertPoint < 0)
+    {
+      sgl.AutoRedraw[I].Next = sgl.AutoRedrawFirst;
+      sgl.AutoRedraw[I].Prev = -1;
+    }
+    else
+    {
+      sgl.AutoRedraw[I].Next = sgl.AutoRedraw[sgl.AutoRedrawInsertPoint].Next;
+      sgl.AutoRedraw[I].Prev = sgl.AutoRedrawInsertPoint;
+      sgl.AutoRedraw[sgl.AutoRedraw[I].Prev].Next = I;
+    }
+
+    if (sgl.AutoRedraw[I].Next != -1)
+      sgl.AutoRedraw[sgl.AutoRedraw[I].Next].Prev = I;
+
+    sgl.AutoRedraw[I].Valid = ITEM_AUTOREDRAW;
+    sgl.AutoRedraw[I].Parent = sgl.AutoRedrawParent;
+    sgl.AutoRedraw[I].Level  = Level;
+
+    memcpy(&sgl.AutoRedraw[I].Item, Item, sizeof(GuiLib_ItemRec));
+    memcpy(&sgl.AutoRedraw[I].Memory, &sgl.Memory, sizeof(ItemMemory));
+
+    if (sgl.AutoRedraw[I].Next == -1)
+      sgl.AutoRedrawLast = I;
+
+    if (sgl.AutoRedraw[I].Prev == -1)
+      sgl.AutoRedrawFirst = I;
+
+    sgl.AutoRedrawInsertPoint = I;
+    sgl.AutoRedrawLatest = I;
+    sgl.AutoRedrawCount++;
+  }
+
+  return I;
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_UpdateDrawn(GuiConst_INT16S I, PrefixLocate GuiLib_ItemRec * PrefixLocate Item)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return;
+
+  if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+  {
+    sgl.AutoRedraw[I].Item.Drawn   = Item->Drawn;
+    sgl.AutoRedraw[I].Item.DrawnX1 = Item->DrawnX1;
+    sgl.AutoRedraw[I].Item.DrawnY1 = Item->DrawnY1;
+    sgl.AutoRedraw[I].Item.DrawnX2 = Item->DrawnX2;
+    sgl.AutoRedraw[I].Item.DrawnY2 = Item->DrawnY2;
+  }
+
+  return;
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_Delete(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return;
+
+  if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+  {
+    if (sgl.AutoRedrawLast == I)
+      sgl.AutoRedrawLast = sgl.AutoRedraw[I].Prev;
+
+    if (sgl.AutoRedrawFirst == I)
+      sgl.AutoRedrawFirst = sgl.AutoRedraw[I].Next;
+
+    if (sgl.AutoRedraw[I].Prev != -1)
+      sgl.AutoRedraw[sgl.AutoRedraw[I].Prev].Next = sgl.AutoRedraw[I].Next;
+
+    if (sgl.AutoRedraw[I].Next != -1)
+      sgl.AutoRedraw[sgl.AutoRedraw[I].Next].Prev = sgl.AutoRedraw[I].Prev;
+
+    sgl.AutoRedraw[I].Next = -1;
+    sgl.AutoRedraw[I].Prev = -1;
+    sgl.AutoRedraw[I].Valid = ITEM_NONE;
+
+    sgl.AutoRedrawCount--;
+  }
+
+  return;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_DeleteStruct(GuiConst_INT16S Struct_id)
+{
+  GuiConst_INT16S I, N, X;
+
+  I = sgl.AutoRedrawFirst;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return -1;
+
+  if ((Struct_id < 0) || (Struct_id >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return -1;
+
+  if (sgl.AutoRedraw[Struct_id].Valid == ITEM_NONE)
+    return -1;
+
+  while (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+  {
+    N = sgl.AutoRedraw[I].Next;
+    if (sgl.AutoRedraw[I].Parent == Struct_id)
+    {
+      X = AutoRedraw_DeleteStruct(I);
+      if ((X >= 0) && (X < GuiConst_MAX_DYNAMIC_ITEMS))
+        N = sgl.AutoRedraw[X].Next;
+    }
+
+    I = N;
+
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      break;
+  }
+
+  sgl.AutoRedrawInsertPoint = sgl.AutoRedraw[Struct_id].Prev;
+
+  AutoRedraw_Delete(Struct_id);
+
+  if (sgl.AutoRedrawInsertPoint >= 0)
+    return sgl.AutoRedrawInsertPoint;
+  else
+    return sgl.AutoRedrawFirst;
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_Destroy(void)
+{
+  GuiConst_INT16S I;
+
+  for (I=0;I<GuiConst_MAX_DYNAMIC_ITEMS;I++)
+  {
+    sgl.AutoRedraw[I].Next = -1;
+    sgl.AutoRedraw[I].Prev = -1;
+    sgl.AutoRedraw[I].Valid = ITEM_NONE;
+  }
+
+  sgl.AutoRedrawCount = 0;
+  sgl.AutoRedrawFirst = -1;
+  sgl.AutoRedrawLast = -1;
+  sgl.AutoRedrawCount = 0;
+  sgl.AutoRedrawParent = -1;
+  sgl.AutoRedrawUpdate = GuiLib_FALSE;
+  sgl.AutoRedrawInsertPoint = GuiConst_MAX_DYNAMIC_ITEMS;
+  sgl.AutoRedrawLatest = -1;
+
+  return;
+}
+//------------------------------------------------------------------------------
+PrefixLocate GuiLib_ItemRec *AutoRedraw_GetItem(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return NULL;
+  else
+    return &sgl.AutoRedraw[I].Item;
+}
+//------------------------------------------------------------------------------
+PrefixLocate ItemMemory *AutoRedraw_GetItemMemory(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return NULL;
+  else
+    return &sgl.AutoRedraw[I].Memory;
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_UpdateOnChange(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return;
+
+  if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW)
+  {
+    sgl.AutoRedraw[I].ValueSize = 0;
+
+    if (sgl.AutoRedraw[I].Item.UpdateType == GuiLib_UPDATE_ON_CHANGE)
+    {
+      if (sgl.AutoRedraw[I].Item.VarPtr != 0)
+      {
+        switch (sgl.AutoRedraw[I].Item.VarType)
+        {
+          case GuiLib_VAR_BOOL:
+          case GuiLib_VAR_UNSIGNED_CHAR:
+          case GuiLib_VAR_SIGNED_CHAR:
+            sgl.AutoRedraw[I].ValueSize = 1;
+            break;
+
+          case GuiLib_VAR_UNSIGNED_INT:
+          case GuiLib_VAR_SIGNED_INT:
+            sgl.AutoRedraw[I].ValueSize = 2;
+            break;
+
+          case GuiLib_VAR_UNSIGNED_LONG:
+          case GuiLib_VAR_SIGNED_LONG:
+          case GuiLib_VAR_FLOAT:
+            sgl.AutoRedraw[I].ValueSize = 4;
+            break;
+
+          case GuiLib_VAR_DOUBLE:
+            sgl.AutoRedraw[I].ValueSize = 8;
+            break;
+
+          case GuiLib_VAR_COLOR:
+            sgl.AutoRedraw[I].ValueSize =
+               GuiConst_PIXEL_BYTE_SIZE;
+            break;
+
+          case GuiLib_VAR_STRING:
+            sgl.AutoRedraw[I].ValueSize =
+               GuiLib_AUTOREDRAW_MAX_VAR_SIZE;
+            break;
+
+          default:
+            sgl.AutoRedraw[I].ValueSize = 0;
+        }
+        if (sgl.AutoRedraw[I].ValueSize > 0)
+        {
+          memcpy(&sgl.AutoRedraw[I].Value[0],
+                  sgl.AutoRedraw[I].Item.VarPtr,
+                  sgl.AutoRedraw[I].ValueSize);
+        }
+      }
+    }
+  }
+
+  return;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT8S RefreshColorVariable(GuiConst_INTCOLOR PrefixLocate *comp, GuiConst_INT16U idx)
+{
+  GuiConst_INTCOLOR PrefixLocate *ColVarPtr;
+  GuiConst_INTCOLOR ColVal;
+  GuiConst_INT8S    changed = GuiLib_FALSE;
+
+  if (idx != 0xFFFF)
+  {
+    if (idx < GuiStruct_VarPtrCnt)
+    {
+      ColVarPtr = (GuiConst_INTCOLOR PrefixLocate *)ReadWord(GuiStruct_VarPtrList[idx]);
+      if (ColVarPtr != 0)
+      {
+        ColVal = *ColVarPtr;
+        if (*comp != ColVal)
+        {
+          *comp = ColVal;
+          changed = GuiLib_TRUE;
+        }
+      }
+    }
+  }
+
+  return changed;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT8S AutoRedraw_VarChanged(GuiConst_INT16S I)
+{
+  GuiLib_ItemRecPtr Item;
+  GuiConst_INT16S VarChange;
+  GuiConst_INT8S  changed;
+
+  changed = GuiLib_FALSE;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return changed;
+
+  if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW)
+  {
+    Item = &sgl.AutoRedraw[I].Item;
+    if (Item->UpdateType == GuiLib_UPDATE_ON_CHANGE)
+    {
+      if ((Item->TextPar[0].BitFlags & GuiLib_BITFLAG_INUSE) &&
+          (Item->VarPtr != 0))
+      {
+        VarChange = 0;
+        if (sgl.AutoRedraw[I].ValueSize > 0)
+        {
+          if (Item->VarType == GuiLib_VAR_STRING)
+            VarChange = VarStrCmp(&sgl.AutoRedraw[I].Value[0],
+               (GuiConst_INT8U PrefixLocate *)Item->VarPtr);
+          else
+            VarChange =
+               memcmp(&sgl.AutoRedraw[I].Value[0],
+                       Item->VarPtr,
+                       sgl.AutoRedraw[I].ValueSize);
+        }
+        if ((sgl.AutoRedraw[I].ValueSize == 0) || (VarChange != 0))
+          changed = GuiLib_TRUE;
+      }
+    }
+    else
+      changed = GuiLib_TRUE;
+
+    changed |= RefreshColorVariable(&Item->ForeColor, Item->ForeColorIndex);
+    changed |= RefreshColorVariable(&Item->BackColor, Item->BackColorIndex);
+    changed |= RefreshColorVariable(&Item->BarForeColor, Item->BarForeColorIndex);
+    changed |= RefreshColorVariable(&Item->BarBackColor, Item->BarBackColorIndex);
+
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+    if (Item->ItemType == GuiLib_ITEM_RADIOBUTTON)
+      changed |= RefreshColorVariable(&Item->CompPars.CompRadioButton.MarkColor,
+                           Item->CompPars.CompRadioButton.MarkColorIndex);
+#endif
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+    if (Item->ItemType == GuiLib_ITEM_CHECKBOX)
+      changed |= RefreshColorVariable(&Item->CompPars.CompCheckBox.MarkColor,
+                           Item->CompPars.CompCheckBox.MarkColorIndex);
+#endif
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+    if (Item->ItemType == GuiLib_ITEM_BUTTON)
+    {
+      GuiConst_INT32S state;
+
+      if ((sgl.CurItem.VarPtr != 0) &&
+          (sgl.CurItem.VarType != GuiLib_VAR_STRING))
+      {
+        state = ReadVar(Item->VarPtr, Item->VarType);
+        if ((state < GuiLib_BUTTON_STATE_UP) ||
+            (state > GuiLib_BUTTON_STATE_DISABLED))
+          state = GuiLib_BUTTON_STATE_UP;
+      }
+      else
+        state = GuiLib_BUTTON_STATE_UP;
+
+
+      changed |= RefreshColorVariable(&Item->CompPars.CompButton.TextColor[state],
+                           Item->CompPars.CompButton.TextColorIndex[state]);
+
+      changed |= RefreshColorVariable(&Item->CompPars.CompButton.GlyphIconColor[state],
+                           Item->CompPars.CompButton.GlyphIconColorIndex[state]);
+    }
+#endif
+  }
+
+  return changed;
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_UpdateVar(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return;
+
+  if ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW)
+  {
+    if (sgl.AutoRedraw[I].Item.UpdateType == GuiLib_UPDATE_ON_CHANGE)
+    {
+      if ((sgl.AutoRedraw[I].Item.TextPar[0].BitFlags & GuiLib_BITFLAG_INUSE) &&
+          (sgl.AutoRedraw[I].Item.VarPtr != 0))
+      {
+        if (sgl.AutoRedraw[I].ValueSize > 0)
+        {
+          memcpy(&sgl.AutoRedraw[I].Value[0],
+                  sgl.AutoRedraw[I].Item.VarPtr,
+                  sgl.AutoRedraw[I].ValueSize);
+        }
+      }
+    }
+  }
+
+  return;
+}
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_InsertTextBox(PrefixLocate GuiLib_ItemRec * PrefixLocate Item,
+                  GuiConst_INT16S Struct,
+                  GuiConst_INT8U Level)
+{
+  GuiConst_INT16S I;
+
+  I = AutoRedraw_Insert(Item, Struct, Level);
+
+  if (I != -1)
+    sgl.AutoRedraw[I].Valid = ITEM_TEXTBOX;
+
+  return I;
+}//------------------------------------------------------------------------------
+void AutoRedraw_SetAsTextBox(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return;
+
+  if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    sgl.AutoRedraw[I].Valid |= ITEM_TEXTBOX;
+
+  return;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_GetTextBox(GuiConst_INT8S T, GuiConst_INT16S I)
+{
+  if (I == -1)
+  {
+    I = sgl.AutoRedrawFirst;
+
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      return -1;
+  }
+  else
+  {
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      return -1;
+
+    if (sgl.AutoRedraw[I].Valid == ITEM_NONE)
+      return -1;
+
+    I = sgl.AutoRedraw[I].Next;
+
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      return -1;
+  }
+
+  while (I != -1)
+  {
+    if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    {
+      if ((sgl.AutoRedraw[I].Valid & ITEM_TEXTBOX) == ITEM_TEXTBOX)
+      {
+        if (sgl.AutoRedraw[I].Item.CompPars.CompTextBox.ScrollIndex == T)
+          break;
+      }
+      I = sgl.AutoRedraw[I].Next;
+    }
+    else
+      return -1;
+  }
+
+  return I;
+}
+
+#endif // GuiConst_TEXTBOX_FIELDS_ON
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_InsertCursor(PrefixLocate GuiLib_ItemRec * PrefixLocate Item,
+                  GuiConst_INT16S Struct,
+                  GuiConst_INT8U Level)
+{
+  GuiConst_INT16S I;
+
+  I = AutoRedraw_Insert(Item, Struct, Level);
+
+  if (I != -1)
+    sgl.AutoRedraw[I].Valid = ITEM_CURSOR;
+
+  return I;
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_SetAsCursor(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return;
+
+  if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    sgl.AutoRedraw[I].Valid |= ITEM_CURSOR;
+
+  return;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_IsOnlyCursor(GuiConst_INT16S I)
+{
+  GuiConst_INT16S ret = GuiLib_FALSE;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return ret;
+
+  if (sgl.AutoRedraw[I].Valid == ITEM_CURSOR)
+    ret = GuiLib_TRUE;
+
+  return ret;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_GetCursor(GuiConst_INT8S C, GuiConst_INT16S I)
+{
+  if (I == -1)
+  {
+    I = sgl.AutoRedrawFirst;
+
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      return -1;
+  }
+  else
+  {
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      return -1;
+
+    if (sgl.AutoRedraw[I].Valid == ITEM_NONE)
+      return -1;
+
+    I = sgl.AutoRedraw[I].Next;
+
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      return -1;
+  }
+
+  while (I != -1)
+  {
+    if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    {
+      if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR)
+      {
+        if (sgl.AutoRedraw[I].Item.CursorFieldNo == C)
+          break;
+      }
+      I = sgl.AutoRedraw[I].Next;
+    }
+    else
+      return -1;
+  }
+
+  return I;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT8S AutoRedraw_GetCursorNumber(GuiConst_INT16S I)
+{
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return -1;
+
+  if (sgl.AutoRedraw[I].Valid & ITEM_CURSOR)
+    return sgl.AutoRedraw[I].Item.CursorFieldNo;
+
+  return -1;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_GetFirstCursor(void)
+{
+  GuiConst_INT16S I, result;
+  GuiConst_INT8S C;
+
+  I = sgl.AutoRedrawFirst;
+  C = 0x7F;
+
+  result = -1;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return result;
+
+  while (I != -1)
+  {
+    if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    {
+      if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR)
+      {
+        if (sgl.AutoRedraw[I].Item.CursorFieldNo < C)
+        {
+          C = sgl.AutoRedraw[I].Item.CursorFieldNo;
+          result = I;
+        }
+      }
+      I = sgl.AutoRedraw[I].Next;
+    }
+    else
+      return -1;
+  }
+
+  return result;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_GetLastCursor(void)
+{
+  GuiConst_INT16S I, result;
+  GuiConst_INT8S C;
+
+  I = sgl.AutoRedrawFirst;
+  C = 0;
+
+  result = -1;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return result;
+
+  while (I != -1)
+  {
+    if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    {
+      if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR)
+      {
+        if (sgl.AutoRedraw[I].Item.CursorFieldNo > C)
+        {
+          C = sgl.AutoRedraw[I].Item.CursorFieldNo;
+          result = I;
+        }
+      }
+      I = sgl.AutoRedraw[I].Next;
+    }
+    else
+      return -1;
+  }
+
+  return result;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_GetNextCursor(GuiConst_INT8S C)
+{
+  GuiConst_INT16S I, result;
+  GuiConst_INT8S closest;
+
+  I = sgl.AutoRedrawFirst;
+  closest = 0x7f;
+
+  result = -1;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return result;
+
+  while (I != -1)
+  {
+    if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    {
+      if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR)
+      {
+        if ((sgl.AutoRedraw[I].Item.CursorFieldNo > C)
+         && (sgl.AutoRedraw[I].Item.CursorFieldNo <= closest))
+        {
+          closest = sgl.AutoRedraw[I].Item.CursorFieldNo;
+          result = I;
+        }
+      }
+      I = sgl.AutoRedraw[I].Next;
+    }
+    else
+      return -1;
+  }
+
+  return result;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_GetPrevCursor(GuiConst_INT8S C)
+{
+  GuiConst_INT16S I, result;
+  GuiConst_INT8S closest;
+
+  I = sgl.AutoRedrawFirst;
+  closest = 0;
+
+  result = -1;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return result;
+
+  while (I != -1)
+  {
+    if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    {
+      if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR)
+      {
+        if ((sgl.AutoRedraw[I].Item.CursorFieldNo < C)
+         && (sgl.AutoRedraw[I].Item.CursorFieldNo >= closest))
+        {
+          closest = sgl.AutoRedraw[I].Item.CursorFieldNo;
+          result = I;
+        }
+      }
+      I = sgl.AutoRedraw[I].Next;
+    }
+    else
+      return -1;
+  }
+
+  return result;
+}
+//------------------------------------------------------------------------------
+GuiConst_INT16S AutoRedraw_CheckCursorInheritance(GuiConst_INT16S N)
+{
+  GuiConst_INT16S I, J, result;
+  GuiConst_INT16S cursor_id;
+
+  if (GuiLib_ActiveCursorFieldNo < 0)
+    return -1;
+
+  if ((N < 0) || (N >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return -1;
+
+  if (sgl.AutoRedraw[N].Valid == ITEM_NONE)
+    return -1;
+
+  I = sgl.AutoRedraw[N].Parent;
+  result = 1;
+
+  while (result == 1)
+  {
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    {
+      result = -1;
+      break;
+    }
+
+    if (sgl.AutoRedraw[I].Valid != ITEM_NONE)
+    {
+      if ((sgl.AutoRedraw[I].Valid & ITEM_CURSOR) == ITEM_CURSOR)
+      {
+        cursor_id = sgl.AutoRedraw[I].Item.CursorFieldNo;
+
+        if (cursor_id == GuiLib_ActiveCursorFieldNo)
+        {
+          result = 0;
+          break;
+        }
+      }
+      J = sgl.AutoRedraw[I].Parent;
+      if (J == I)
+        result = -1;
+      I = J;
+    }
+    else
+    {
+      result = -1;
+      break;
+    }
+
+  }
+
+  return result;
+}
+//------------------------------------------------------------------------------
+void AutoRedraw_ResetCursor(void)
+{
+  GuiConst_INT16S I;
+
+  I = sgl.AutoRedrawFirst;
+
+  if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+    return;
+
+  while ((sgl.AutoRedraw[I].Valid & ITEM_AUTOREDRAW) == ITEM_AUTOREDRAW)
+  {
+    sgl.AutoRedraw[I].Item.CursorFieldNo = GuiLib_NO_CURSOR;
+
+    I = sgl.AutoRedraw[I].Next;
+    if ((I < 0) || (I >= GuiConst_MAX_DYNAMIC_ITEMS))
+      break;
+  }
+
+  return;
+}
+#endif // GuiConst_CURSOR_SUPPORT_ON
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiLib.c	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,4965 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2015 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                               v6.0.9.005                                 */
+/*                                                                          */
+/* ************************************************************************ */
+
+
+
+//------------------------------------------------------------------------------
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+#include "GuiLibStruct.h"
+#ifdef GuiConst_VNC_REMOTE_SUPPORT_ON
+#include "GuiVnc.h"
+#endif
+#include <string.h>
+#include <stdlib.h>
+
+#ifndef GuiConst_PC_V6_0_9
+If your compiler sees this text you are using a wrong version of the easyGUI
+library. Version numbers of the easyGUI PC application and c library must match.
+Only exception is GuiDisplay.c/h (your display driver), which can be kept from
+version to version.
+#endif
+
+#define WANT_DOUBLE_BUFFERING // Also in GuiGraph16.h, GuiDisplay.c - *** all three must match ***
+
+
+#define GuiLib_CHR_PSLEFT_OFS              0
+#define GuiLib_CHR_PSRIGHT_OFS             5
+#define GuiLib_CHR_XLEFT_OFS               10
+#define GuiLib_CHR_XWIDTH_OFS              11
+#define GuiLib_CHR_YTOP_OFS                12
+#define GuiLib_CHR_YHEIGHT_OFS             13
+#define GuiLib_CHR_LINECTRL_OFS            14
+#define GuiLib_CHR_PS_TOP_OFS              0
+#define GuiLib_CHR_PS_MID_OFS              1
+#define GuiLib_CHR_PS_MIDBASE_OFS          2
+#define GuiLib_CHR_PS_BASE_OFS             3
+#define GuiLib_CHR_PS_BOTTOM_OFS           4
+
+
+
+#ifdef GuiConst_ARAB_CHARS_INUSE
+#define GuiLib_ARAB_LIGATURES_CNT          4
+const GuiConst_INT16U GuiLib_ARAB_LIGATURES[GuiLib_ARAB_LIGATURES_CNT][3] =
+   {{0x0644, 0x0622, 0xFEF5},
+    {0x0644, 0x0623, 0xFEF7},
+    {0x0644, 0x0625, 0xFEF9},
+    {0x0644, 0x0627, 0xFEFB}};
+
+#define GuiLib_ARAB_CHAR_PRI_MIN           0x0622
+#define GuiLib_ARAB_CHAR_PRI_MAX           0x06D6
+#define GuiLib_ARAB_CHAR_SEC_MIN           0xFB50
+#define GuiLib_ARAB_CHAR_SEC_MAX           0xFEF4
+#define GuiLib_ARAB_CHAR_TYPE_ISO          0
+#define GuiLib_ARAB_CHAR_TYPE_FIN          1
+#define GuiLib_ARAB_CHAR_TYPE_INI          2
+#define GuiLib_ARAB_CHAR_TYPE_MED          3
+#define GuiLib_ARAB_CHAR_ISOFIN            0x02
+#define GuiLib_ARAB_CHAR_ISOFININIMED      0x04
+#define GuiLib_ARAB_CHAR_DIACRITIC         0x0A
+#define GuiLib_ARAB_CHAR_CONVERT_CNT       83
+
+const GuiConst_INT16U GuiLib_ARAB_CHAR_CONVERT[GuiLib_ARAB_CHAR_CONVERT_CNT][3] =
+   {{0x0622, 0xFE81, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0623, 0xFE83, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0624, 0xFE85, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0625, 0xFE87, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0626, 0xFE89, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0627, 0xFE8D, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0628, 0xFE8F, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0629, 0xFE93, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x062A, 0xFE95, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x062B, 0xFE99, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x062C, 0xFE9D, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x062D, 0xFEA1, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x062E, 0xFEA5, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x062F, 0xFEA9, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0630, 0xFEAB, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0631, 0xFEAD, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0632, 0xFEAF, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0633, 0xFEB1, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0634, 0xFEB5, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0635, 0xFEB9, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0636, 0xFEBD, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0637, 0xFEC1, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0638, 0xFEC5, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0639, 0xFEC9, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x063A, 0xFECD, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0641, 0xFED1, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0642, 0xFED5, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0643, 0xFED9, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0644, 0xFEDD, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0645, 0xFEE1, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0646, 0xFEE5, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0647, 0xFEE9, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0648, 0xFEED, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0649, 0xFEEF, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x064A, 0xFEF1, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x064E, 0xFE76, GuiLib_ARAB_CHAR_DIACRITIC},
+    {0x064F, 0xFE78, GuiLib_ARAB_CHAR_DIACRITIC},
+    {0x0650, 0xFE7A, GuiLib_ARAB_CHAR_DIACRITIC},
+    {0x0651, 0xFE7C, GuiLib_ARAB_CHAR_DIACRITIC},
+    {0x0652, 0xFE7E, GuiLib_ARAB_CHAR_DIACRITIC},
+    {0x0671, 0xFB50, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0679, 0xFB66, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x067A, 0xFB5E, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x067B, 0xFB52, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x067E, 0xFB56, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x067F, 0xFB62, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0680, 0xFB5A, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0683, 0xFB76, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0684, 0xFB72, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0686, 0xFB7A, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0687, 0xFB7E, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x0688, 0xFB88, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x068C, 0xFB84, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x068D, 0xFB82, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x068E, 0xFB86, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0691, 0xFB8C, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x0698, 0xFB8A, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06A4, 0xFB6A, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06A6, 0xFB6E, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06A9, 0xFB8E, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06AD, 0xFBD3, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06AF, 0xFB92, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06B1, 0xFB9A, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06B3, 0xFB96, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06BA, 0xFB9E, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06BB, 0xFBA0, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06BE, 0xFBAA, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06C0, 0xFBA4, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06C1, 0xFBA6, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06C5, 0xFBE0, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06C6, 0xFBD9, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06C7, 0xFBD7, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06C8, 0xFBDB, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06C9, 0xFBE2, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06CB, 0xFBDE, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06CC, 0xFBFC, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06D0, 0xFBE4, GuiLib_ARAB_CHAR_ISOFININIMED},
+    {0x06D2, 0xFBAE, GuiLib_ARAB_CHAR_ISOFIN},
+    {0x06D3, 0xFBB0, GuiLib_ARAB_CHAR_ISOFIN},
+    {     0, 0xFEF5, GuiLib_ARAB_CHAR_ISOFIN},
+    {     0, 0xFEF7, GuiLib_ARAB_CHAR_ISOFIN},
+    {     0, 0xFEF9, GuiLib_ARAB_CHAR_ISOFIN},
+    {     0, 0xFEFB, GuiLib_ARAB_CHAR_ISOFIN}};
+#endif
+
+//------------------------------------------------------------------------------
+//----------------------X-----------------------
+
+GuiLib_DisplayLineRec GuiLib_DisplayRepaint[GuiConst_BYTE_LINES];
+#ifdef GuiConst_VNC_REMOTE_SUPPORT_ON
+GuiLib_DisplayLineRec GuiLib_VncRepaint[GuiConst_BYTE_LINES];
+#endif // GuiConst_VNC_REMOTE_SUPPORT_ON
+
+#ifdef GuiConst_REMOTE_DATA
+void (*GuiLib_RemoteDataReadBlock) (
+      GuiConst_INT32U SourceOffset,
+      GuiConst_INT32U SourceSize,
+      GuiConst_INT8U * TargetAddr);
+#endif // GuiConst_REMOTE_DATA
+#ifdef GuiConst_REMOTE_TEXT_DATA
+void (*GuiLib_RemoteTextReadBlock) (
+      GuiConst_INT32U SourceOffset,
+      GuiConst_INT32U SourceSize,
+      void * TargetAddr);
+#endif // GuiConst_REMOTE_TEXT_DATA
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+GuiConst_INT16S GuiLib_ActiveCursorFieldNo;
+#endif
+#ifdef GuiConst_ALLOW_UPSIDEDOWN_AT_RUNTIME
+GuiConst_INT8U GuiLib_DisplayUpsideDown;
+#endif
+
+GuiConst_INT16S GuiLib_CurStructureNdx;
+GuiConst_INT16S GuiLib_LanguageIndex;
+
+PrefixLocate GuiLib_GLOBAL gl;
+static PrefixLocate GuiLib_STATIC sgl;
+
+
+//==============================================================================
+#ifdef GuiConst_ALLOW_UPSIDEDOWN_AT_RUNTIME
+  #define GuiLib_COORD_ADJUST(X, Y)                                            \
+  {                                                                            \
+    if (GuiLib_DisplayUpsideDown)                                              \
+    {                                                                          \
+      X = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoX - X;                 \
+      Y = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoY - Y;                \
+    }                                                                          \
+    else                                                                       \
+    {                                                                          \
+      X = sgl.CoordOrigoX + X;                                                 \
+      Y = sgl.CoordOrigoY + Y;                                                 \
+    }                                                                          \
+  }
+
+  #define GuiLib_MIRROR_BITS(B)                                                \
+  {                                                                            \
+    B = (((B & 0x80) >> 7) | ((B & 0x40) >> 5) |                               \
+         ((B & 0x20) >> 3) | ((B & 0x10) >> 1) |                               \
+         ((B & 0x08) << 1) | ((B & 0x04) << 3) |                               \
+         ((B & 0x02) << 5) | ((B & 0x01) << 7));                               \
+  }
+#else
+  #ifdef GuiConst_ROTATED_OFF
+    #ifdef GuiConst_MIRRORED_HORIZONTALLY
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoX - X;             \
+          Y = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoY - Y;            \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoX - X;             \
+          Y = sgl.CoordOrigoY + Y;                                             \
+        }
+      #endif
+    #else
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoY - Y;            \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = sgl.CoordOrigoY + Y;                                             \
+        }
+      #endif
+    #endif
+  #endif
+  #ifdef GuiConst_ROTATED_90DEGREE_RIGHT
+    #ifdef GuiConst_MIRRORED_HORIZONTALLY
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoY - Y;             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = sgl.CoordOrigoY + Y;                                             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #endif
+    #else
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoX - X;            \
+          Y = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoY - Y;             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoX - X;            \
+          Y = sgl.CoordOrigoY + Y;                                             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #endif
+    #endif
+  #endif
+  #ifdef GuiConst_ROTATED_UPSIDEDOWN
+    #ifdef GuiConst_MIRRORED_HORIZONTALLY
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = sgl.CoordOrigoY + Y;                                             \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoY - Y;            \
+        }
+      #endif
+    #else
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoX - X;             \
+          Y = sgl.CoordOrigoY + Y;                                             \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoX - X;             \
+          Y = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoY - Y;            \
+        }
+      #endif
+    #endif
+  #endif
+  #ifdef GuiConst_ROTATED_90DEGREE_LEFT
+    #ifdef GuiConst_MIRRORED_HORIZONTALLY
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoX - X;            \
+          Y = sgl.CoordOrigoY + Y;                                             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = GuiConst_DISPLAY_HEIGHT_HW - 1 - sgl.CoordOrigoX - X;            \
+          Y = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoY - Y;             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #endif
+    #else
+      #ifdef GuiConst_MIRRORED_VERTICALLY
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = sgl.CoordOrigoY + Y;                                             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #else
+        #define GuiLib_COORD_ADJUST(X, Y)                                      \
+        {                                                                      \
+          X = sgl.CoordOrigoX + X;                                             \
+          Y = GuiConst_DISPLAY_WIDTH_HW - 1 - sgl.CoordOrigoY - Y;             \
+          SwapCoord(&X, &Y);                                                   \
+        }
+      #endif
+    #endif
+  #endif
+#endif
+
+#define GuiLib_FONT_MID_Y(BaseLine, TopLine) ((BaseLine - TopLine + 1) / 2)
+
+#ifdef GuiConst_COLOR_DEPTH_1
+#define GuiLib_COLOR_ADJUST(C)  C &= 0x01;
+#endif
+#ifdef GuiConst_COLOR_DEPTH_2
+#define GuiLib_COLOR_ADJUST(C)  C &= 0x03;
+#endif
+#ifdef GuiConst_COLOR_DEPTH_4
+#define GuiLib_COLOR_ADJUST(C)  C &= 0x0F;
+#endif
+#ifdef GuiConst_COLOR_DEPTH_5
+#define GuiLib_COLOR_ADJUST(C)  C = (C & 0x1F) << 3;
+#endif
+#ifndef GuiLib_COLOR_ADJUST
+#define GuiLib_COLOR_ADJUST_TRANSP(C)
+#define GuiLib_COLOR_ADJUST(C)
+#else
+#define GuiLib_COLOR_ADJUST_TRANSP(C) if (C != -1)  GuiLib_COLOR_ADJUST(C)
+#endif
+//----------------------X-----------------------
+#define GuiLib_GET_MIN(A, B) ((A) > (B) ? (B) : (A))
+#define GuiLib_GET_MAX(A, B) ((A) > (B) ? (A) : (B))
+#define GuiLib_GET_MINMAX(X, A, B) ((X) > (A) ? (GuiLib_GET_MIN(X,B)) : (A))
+#define GuiLib_LIMIT_MIN(X, A) if (X < A) X = A
+#define GuiLib_LIMIT_MAX(X, B) if (X > B) X = B
+#define GuiLib_LIMIT_MINMAX(X, A, B)                                           \
+{                                                                              \
+  if (X < A)                                                                   \
+    X = A;                                                                     \
+  else if ((B < A) && (X > A))                                                 \
+    X = A;                                                                     \
+  else if ((B >= A) && (X > B))                                                \
+    X = B;                                                                     \
+}
+
+//==============================================================================
+
+//------------------------------------------------------------------------------
+static GuiConst_INT16S CopyBytes(GuiConst_INT8U *dst, GuiConst_INT8U *src, GuiConst_INT32S size)
+{
+  GuiConst_INT32S i;
+  GuiConst_INT8U *d, *s;
+
+  if (size < 0)
+    return -1;
+
+  if (size > GuiConst_DISPLAY_BYTES)
+    return -1;
+
+  d = (GuiConst_INT8U *)dst;
+  s = (GuiConst_INT8U *)src;
+
+  for (i=0;i<size;i++)
+    *d++ = *s++;
+
+  return 0;
+}
+//------------------------------------------------------------------------------
+static void SwapCoord(
+   GuiConst_INT16S * X1,
+   GuiConst_INT16S * X2)
+{
+  GuiConst_INT16S Tmp;
+
+  Tmp = *X1;
+  *X1 = *X2;
+  *X2 = Tmp;
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT8U OrderCoord(
+   GuiConst_INT16S * X1,
+   GuiConst_INT16S * X2)
+{
+  if (*X1 > *X2)
+  {
+    SwapCoord (X1, X2);
+    return (1);
+  }
+  else
+    return (0);
+}
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+//------------------------------------------------------------------------------
+static GuiConst_INT8U CheckRect(
+   GuiConst_INT16S * X1,
+   GuiConst_INT16S * Y1,
+   GuiConst_INT16S * X2,
+   GuiConst_INT16S * Y2)
+{
+  if (sgl.ClippingTotal ||
+     (*X1 > sgl.ClippingX2) || (*X2 < sgl.ClippingX1) ||
+     (*Y1 > sgl.ClippingY2) || (*Y2 < sgl.ClippingY1))
+    return (0);
+  else
+  {
+    if (*X1 < sgl.ClippingX1)
+      *X1 = sgl.ClippingX1;
+    if (*X2 > sgl.ClippingX2)
+      *X2 = sgl.ClippingX2;
+    if (*Y1 < sgl.ClippingY1)
+      *Y1 = sgl.ClippingY1;
+    if (*Y2 > sgl.ClippingY2)
+      *Y2 = sgl.ClippingY2;
+    return (1);
+  }
+}
+#endif
+
+//==============================================================================
+
+#ifdef GuiConst_COLOR_DEPTH_1
+  #ifdef GuiConst_BYTE_HORIZONTAL
+    #include "GuiGraph1H.c"
+  #else
+    #include "GuiGraph1V.c"
+  #endif
+#endif
+#ifdef GuiConst_COLOR_DEPTH_2
+  #ifdef GuiConst_BYTE_HORIZONTAL
+    #ifdef GuiConst_COLOR_PLANES_2
+      #include "GuiGraph2H2P.c"
+    #else
+      #include "GuiGraph2H.c"
+    #endif
+  #else
+    #ifdef GuiConst_COLOR_PLANES_2
+      #include "GuiGraph2V2P.c"
+    #else
+      #include "GuiGraph2V.c"
+    #endif
+  #endif
+#endif
+#ifdef GuiConst_COLOR_DEPTH_4
+  #ifdef GuiConst_BYTE_HORIZONTAL
+    #include "GuiGraph4H.c"
+  #else
+    #include "GuiGraph4V.c"
+  #endif
+#endif
+#ifdef GuiConst_COLOR_DEPTH_5
+  #include "GuiGraph5.c"
+#endif
+#ifdef GuiConst_COLOR_DEPTH_8
+  #include "GuiGraph8.c"
+#endif
+#ifdef GuiConst_COLOR_DEPTH_12
+  #include "GuiGraph16.c"
+#endif
+#ifdef GuiConst_COLOR_DEPTH_15
+  #include "GuiGraph16.c"
+#endif
+#ifdef GuiConst_COLOR_DEPTH_16
+  #include "GuiGraph16.h"
+#endif
+#ifdef GuiConst_COLOR_DEPTH_18
+  #include "GuiGraph24.c"
+#endif
+#ifdef GuiConst_COLOR_DEPTH_24
+  #include "GuiGraph24.h"
+#endif
+#ifdef GuiConst_COLOR_DEPTH_32
+  #include "GuiGraph32.c"
+#endif
+
+#include "GuiGraph.h"
+#ifdef GuiConst_ADV_GRAPHICS_ON
+//#include "GuiGraphAdv.c"
+#endif
+
+//==============================================================================
+static void DrawStructure(GuiLib_StructPtr Structure, GuiConst_INT8U ColorInvert) PrefixReentrant;
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+static void DrawCursorItem(GuiConst_INT8U CursorVisible);
+#endif
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+static void ScrollBox_DrawScrollLine(GuiConst_INT8U ScrollBoxIndex, GuiConst_INT16S LineNdx);
+#endif
+
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+static GuiConst_INT16S IndexOfGraphicsLayer(GuiConst_INT16S GraphicsLayerIndex);
+static GuiConst_INT8U GraphicsLayer_Push(GuiConst_INT8U GraphicsLayerIndex);
+static GuiConst_INT8U GraphicsLayer_Pop(GuiConst_INT16S GraphicsLayerIndex);
+static void GraphicsLayer_Copy(
+   GuiConst_INT8U *DestAddress,
+   GuiConst_INT16U DestLineSize,
+   GuiConst_INT16S DestX,
+   GuiConst_INT16S DestY,
+   GuiConst_INT8U *SourceAddress,
+   GuiConst_INT16U SourceLineSize,
+   GuiConst_INT16S SourceX,
+   GuiConst_INT16S SourceY,
+   GuiConst_INT16U Width,
+   GuiConst_INT16U Height);
+#endif
+
+//==============================================================================
+
+//------------------------------------------------------------------------------
+static void ResetLayerBufPtr(void)
+{
+#ifdef GuiConst_DISPLAY_BUFFER_EASYGUI
+#ifdef GuiLib_COLOR_UNIT_16
+  sgl.CurLayerBufPtr = &(GuiLib_DisplayBuf.Bytes[0][0]);
+#else
+  #ifdef GuiConst_COLOR_DEPTH_2
+    #ifdef GuiConst_BYTE_HORIZONTAL
+      #ifdef GuiConst_COLOR_PLANES_2
+  sgl.CurLayerBufPtr = &(GuiLib_DisplayBuf[0][0][0]);
+      #else
+  sgl.CurLayerBufPtr = &(GuiLib_DisplayBuf[0][0]);
+      #endif
+    #else // GuiConst_BYTE_HORIZONTAL
+      #ifdef GuiConst_COLOR_PLANES_2
+  sgl.CurLayerBufPtr = &(GuiLib_DisplayBuf[0][0][0]);
+      #else
+  sgl.CurLayerBufPtr = &(GuiLib_DisplayBuf[0][0]);
+      #endif
+    #endif // GuiConst_BYTE_HORIZONTAL
+  #else // GuiConst_COLOR_DEPTH_2
+  sgl.CurLayerBufPtr = &(GuiLib_DisplayBuf[0][0]);
+  #endif // GuiConst_COLOR_DEPTH_2
+#endif // GuiLib_COLOR_UNIT_16
+#else // GuiConst_DISPLAY_BUFFER_EASYGUI
+  sgl.CurLayerBufPtr = 0;
+#endif // GuiConst_DISPLAY_BUFFER_EASYGUI
+
+  sgl.CurLayerLineSize = GuiConst_BYTES_PR_LINE;
+  sgl.CurLayerWidth = GuiConst_DISPLAY_WIDTH_HW;
+  sgl.CurLayerHeight = GuiConst_DISPLAY_HEIGHT_HW;
+  sgl.CurLayerBytes = GuiConst_DISPLAY_BYTES;
+  sgl.BaseLayerDrawing = 1;
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Init(void)
+{
+  sgl.RefreshClock = 0;
+
+  ResetLayerBufPtr();
+
+  AutoRedraw_Init();
+
+#ifdef GuiConst_DISPLAY_ACTIVE_AREA
+#ifdef GuiConst_DISPLAY_ACTIVE_AREA_COO_REL
+  sgl.DisplayOrigoX = GuiConst_DISPLAY_ACTIVE_AREA_X1;
+  sgl.DisplayOrigoY = GuiConst_DISPLAY_ACTIVE_AREA_Y1;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  sgl.DisplayActiveAreaX1 = 0;
+  sgl.DisplayActiveAreaY1 = 0;
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+#ifdef GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING
+  sgl.DisplayActiveAreaX2 =
+     GuiConst_DISPLAY_ACTIVE_AREA_X2 - GuiConst_DISPLAY_ACTIVE_AREA_X1;
+  sgl.DisplayActiveAreaY2 =
+     GuiConst_DISPLAY_ACTIVE_AREA_Y2 - GuiConst_DISPLAY_ACTIVE_AREA_Y1;
+#else // GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING
+  sgl.DisplayActiveAreaX2 =
+     GuiConst_DISPLAY_WIDTH - GuiConst_DISPLAY_ACTIVE_AREA_X1 - 1;
+  sgl.DisplayActiveAreaY2 =
+     GuiConst_DISPLAY_HEIGHT - GuiConst_DISPLAY_ACTIVE_AREA_Y1 - 1;
+#endif // GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING
+#else // GuiConst_DISPLAY_ACTIVE_AREA_COO_REL
+  sgl.DisplayOrigoX = 0;
+  sgl.DisplayOrigoY = 0;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+#ifdef GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING
+  sgl.DisplayActiveAreaX1 = GuiConst_DISPLAY_ACTIVE_AREA_X1;
+  sgl.DisplayActiveAreaY1 = GuiConst_DISPLAY_ACTIVE_AREA_Y1;
+  sgl.DisplayActiveAreaX2 = GuiConst_DISPLAY_ACTIVE_AREA_X2;
+  sgl.DisplayActiveAreaY2 = GuiConst_DISPLAY_ACTIVE_AREA_Y2;
+#else // GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING
+  sgl.DisplayActiveAreaX1 = 0;
+  sgl.DisplayActiveAreaY1 = 0;
+  sgl.DisplayActiveAreaX2 = GuiConst_DISPLAY_WIDTH - 1;
+  sgl.DisplayActiveAreaY2 = GuiConst_DISPLAY_HEIGHT - 1;
+#endif // GuiConst_DISPLAY_ACTIVE_AREA_CLIPPING
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+#endif // GuiConst_DISPLAY_ACTIVE_AREA_COO_REL
+#else // GuiConst_DISPLAY_ACTIVE_AREA
+  sgl.DisplayOrigoX = 0;
+  sgl.DisplayOrigoY = 0;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  sgl.DisplayActiveAreaX1 = 0;
+  sgl.DisplayActiveAreaY1 = 0;
+  sgl.DisplayActiveAreaX2 = GuiConst_DISPLAY_WIDTH - 1;
+  sgl.DisplayActiveAreaY2 = GuiConst_DISPLAY_HEIGHT - 1;
+#endif // GuiConst_CLIPPING_SUPPORT_ON
+#endif // GuiConst_DISPLAY_ACTIVE_AREA
+
+#ifdef GuiConst_ADV_GRAPHICS_ON
+//  GuiLib_AG_Init();
+#endif
+
+  GuiDisplay_Init();
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiLib_ResetClipping();
+#endif
+  GuiLib_ResetDisplayRepaint();
+  GuiLib_Clear();
+
+  sgl.DisplayWriting = 1;
+  sgl.InitialDrawing = 0;
+  sgl.TopLevelStructure = 0;
+  sgl.SwapColors = 0;
+  GuiLib_SetLanguage(0);
+#ifdef GuiConst_BLINK_SUPPORT_ON
+  sgl.BlinkBoxRate = 0;
+#endif
+  sgl.InvertBoxOn = 0;
+  sgl.DrawingLevel = 0;
+  GuiLib_CurStructureNdx = -1;
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+  GuiLib_TouchAdjustReset();
+#endif
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+  sgl.ButtonColorOverride = GuiLib_FALSE;
+  sgl.DisabledButtonColor = 0;
+#endif
+#ifdef GuiConst_REMOTE_DATA
+  GuiLib_RemoteDataReadBlock = 0;
+  #ifdef GuiConst_REMOTE_TEXT_DATA
+  GuiLib_RemoteTextReadBlock = 0;
+  sgl.CurRemoteText = -1;
+  sgl.RemoteTextTableOfs = -1;
+  #endif
+  #ifdef GuiConst_REMOTE_FONT_DATA
+  sgl.CurRemoteFont = -1;
+  #endif
+  #ifdef GuiConst_REMOTE_BITMAP_DATA
+  sgl.CurRemoteBitmap = -1;
+  #endif
+#endif
+
+#ifdef GuiConst_VNC_REMOTE_SUPPORT_ON
+  GuiVnc_Init();
+#endif
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Clear(void)
+{
+  GuiConst_INT16S I;
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  GuiConst_INT16S N;
+#endif
+
+  GuiLib_ClearDisplay();
+
+  GuiLib_CurStructureNdx = -1;
+
+  AutoRedraw_Destroy();
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  sgl.CursorInUse = 0;
+  GuiLib_ActiveCursorFieldNo = -1;
+#endif
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  for (I = 0; I < GuiConst_BLINK_FIELDS_MAX; I++)
+  {
+    sgl.BlinkTextItems[I].InUse = 0;
+    sgl.BlinkTextItems[I].Active = 0;
+  }
+#endif
+#endif
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+  sgl.TouchAreaCnt = 0;
+#endif
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  for (I = 0; I < GuiConst_TEXTBOX_FIELDS_MAX; I++)
+    sgl.TextBoxScrollPositions[I].index = -1;
+#endif
+
+  sgl.LayerOrigoX = 0;
+  sgl.LayerOrigoY = 0;
+
+  sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+  sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+  sgl.NextScrollLineReading = 0;
+  sgl.GlobalScrollBoxIndex = 0;
+  for (I = 0; I < GuiConst_SCROLLITEM_BOXES_MAX; I++)
+  {
+    sgl.ScrollBoxesAry[I].X1 = 0;
+    sgl.ScrollBoxesAry[I].Y1 = 0;
+    sgl.ScrollBoxesAry[I].InUse = GuiLib_SCROLL_STRUCTURE_UNDEF;
+    sgl.ScrollBoxesAry[I].ScrollTopLine = 0;
+    sgl.ScrollBoxesAry[I].LastScrollTopLine = 0;
+    sgl.ScrollBoxesAry[I].LastMarkerLine = 0;
+    sgl.ScrollBoxesAry[I].ScrollActiveLine = 0;
+    sgl.ScrollBoxesAry[I].NumberOfLines = 0;
+  }
+#endif
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+  sgl.GlobalGraphIndex = 0;
+  for (I = 0; I < GuiConst_GRAPH_MAX; I++)
+  {
+    sgl.GraphAry[I].InUse = GuiLib_GRAPH_STRUCTURE_UNDEF;
+    sgl.GraphAry[I].GraphAxesCnt[GuiLib_GRAPHAXIS_X] = 0;
+    sgl.GraphAry[I].GraphAxesCnt[GuiLib_GRAPHAXIS_Y] = 0;
+    sgl.GraphAry[I].GraphDataSetCnt = 0;
+  }
+#endif
+
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  GraphicsLayer_Pop(GuiLib_GRAPHICS_LAYER_BASE);
+  for (I = 0; I < GuiConst_GRAPHICS_LAYER_MAX; I++)
+    sgl.GraphicsLayerLifo[I] = -1;
+  sgl.GraphicsLayerLifoCnt = 0;
+  sgl.GlobalGraphicsLayerIndex = 0;
+  for (I = 0; I < GuiConst_GRAPHICS_LAYER_MAX; I++)
+  {
+    sgl.GraphicsLayerList[I].InUse = GuiLib_GRAPHICS_LAYER_UNDEF;
+    sgl.GraphicsLayerList[I].SizeMode = 0;
+    sgl.GraphicsLayerList[I].InitMode = 0;
+  }
+  sgl.GlobalGraphicsFilterIndex = 0;
+  for (I = 0; I < GuiConst_GRAPHICS_FILTER_MAX; I++)
+  {
+    sgl.GraphicsFilterList[I].InUse = GuiLib_GRAPHICS_FILTER_UNDEF;
+    sgl.GraphicsFilterList[I].GraphicsFilterFunc = 0;
+    sgl.GraphicsFilterList[I].SourceLayerIndexNo = GuiLib_GRAPHICS_LAYER_BASE;
+    sgl.GraphicsFilterList[I].DestLayerIndexNo = GuiLib_GRAPHICS_LAYER_BASE;
+    sgl.GraphicsFilterList[I].ContAtLayerIndexNo = GuiLib_GRAPHICS_LAYER_BASE;
+    for (N = 0; N <= 9; N++)
+    {
+      sgl.GraphicsFilterList[I].ParVarType[N] = 0;
+      sgl.GraphicsFilterList[I].ParVarPtr[N] = 0;
+      sgl.GraphicsFilterList[I].ParValueNum[N] = 0;
+    }
+  }
+#endif
+
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  sgl.GlobalBackgrBitmapIndex = 0;
+  for (I = 0; I < GuiConst_MAX_BACKGROUND_BITMAPS; I++)
+  {
+    sgl.BackgrBitmapAry[I].InUse = 0;
+    sgl.BackgrBitmapAry[I].Index = 0;
+    sgl.BackgrBitmapAry[I].X = 0;
+    sgl.BackgrBitmapAry[I].Y = 0;
+  }
+#endif
+
+  GuiLib_ClearPositionCallbacks();
+}
+
+// Groupstart CHARS
+
+#ifdef GuiConst_CHARMODE_UNICODE
+//------------------------------------------------------------------------------
+GuiConst_INT16U GuiLib_UnicodeStrLen(
+   GuiConst_TEXT PrefixLocate *S)
+{
+  GuiConst_INT16U StrLen;
+
+  StrLen = 0;
+  while (*S != 0)
+  {
+    StrLen++;
+    S++;
+  }
+  return (StrLen);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_StrAnsiToUnicode(
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_CHAR PrefixLocate *S1)
+{
+  do
+  {
+    *S2 = (GuiConst_TEXT)(*S1);
+    *S2 &= 0x00ff;
+    if (*S1 == 0)
+      return;
+    S1++;
+    S2++;
+  }
+  while (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT16S GuiLib_UnicodeStrCmp(
+   GuiConst_TEXT PrefixLocate *S1,
+   GuiConst_TEXT PrefixLocate *S2)
+{
+  do
+  {
+    if ((*S1 == 0) && (*S2 == 0))
+      return (0);
+
+    else if (*S1 == 0)
+      return (-1);
+    else if (*S2 == 0)
+      return (1);
+    else if (*S1 < *S2)
+      return (-1);
+    else if (*S1 > *S2)
+      return (1);
+    S1++;
+    S2++;
+  }
+  while (1);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT16S GuiLib_UnicodeStrNCmp(
+   GuiConst_TEXT PrefixLocate *S1,
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_INT16U StrLen)
+{
+  while (StrLen > 0)
+  {
+    if ((*S1 == 0) && (*S2 == 0))
+      return (0);
+    else if (*S1 == 0)
+      return (-1);
+    else if (*S2 == 0)
+      return (1);
+    else if (*S1 < *S2)
+      return (-1);
+    else if (*S1 > *S2)
+      return (1);
+    S1++;
+    S2++;
+    StrLen--;
+  }
+  return (0);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_UnicodeStrCpy(
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_TEXT PrefixLocate *S1)
+{
+  do
+  {
+    *S2 = *S1;
+    if (*S1 == 0)
+      return;
+    S1++;
+    S2++;
+  }
+  while (1);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_UnicodeStrNCpy(
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_TEXT PrefixLocate *S1,
+   GuiConst_INT16U StrLen)
+{
+  while (StrLen > 0)
+  {
+    *S2 = *S1;
+    if (*S1 != 0)
+      S1++;
+    S2++;
+    StrLen--;
+  }
+}
+#endif // GuiConst_CHARMODE_UNICODE
+
+//------------------------------------------------------------------------------
+static void ConvertIntToStr(
+   GuiConst_INT32U num,
+   GuiConst_CHAR PrefixLocate *string,
+   GuiConst_INT32U base)
+{
+  #define BUFFER_SIZE 11
+
+  GuiConst_INT8U digits[16] =
+     { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70 };
+  GuiConst_CHAR buffer[BUFFER_SIZE];
+  GuiConst_INT8U bufferLen;
+  GuiConst_INT8U i;
+
+  bufferLen = 0;
+  do
+  {
+    i = num % base;
+    buffer[bufferLen++] = digits[i];
+    num /= base;
+  }
+  while ((num != 0) && (bufferLen < BUFFER_SIZE));
+
+  if (bufferLen <= GuiConst_MAX_VARNUM_TEXT_LEN)
+    while (bufferLen-- > 0)
+      *string++ = buffer[bufferLen];
+
+  *string = '\0';
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT16S CharDist(
+   GuiConst_INT16U ChPos1,
+   GuiConst_INT16U ChPos2,
+   GuiConst_INT8U Ps)
+{
+  GuiConst_INT16S Result, D;
+#ifndef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U PrefixRom *Ps1;
+  GuiConst_INT8U PrefixRom *Ps2;
+#endif
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U CharHeader1[GuiLib_CHR_LINECTRL_OFS];
+  GuiConst_INT8U CharHeader2[GuiLib_CHR_LINECTRL_OFS];
+#endif
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+  if (Ps == GuiLib_PS_OFF)
+    return (sgl.CurFont->XSize);
+  else if ((Ps == GuiLib_PS_ON) || (Ps == GuiLib_PS_NUM))
+  {
+    GuiLib_RemoteDataReadBlock(
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[ChPos1]],
+       GuiLib_CHR_LINECTRL_OFS, CharHeader1);
+    GuiLib_RemoteDataReadBlock(
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[ChPos2]],
+       GuiLib_CHR_LINECTRL_OFS, CharHeader2);
+    if ((Ps == GuiLib_PS_ON) || (sgl.TextPsMode[ChPos1] && sgl.TextPsMode[ChPos2]))
+    {
+      Result = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_TOP_OFS] -
+          CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_TOP_OFS];
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_MID_OFS] -
+          CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_MID_OFS];
+      if (D > Result)
+        Result = D;
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_MIDBASE_OFS] -
+          CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_MIDBASE_OFS];
+      if (D > Result)
+        Result = D;
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_BASE_OFS] -
+          CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_BASE_OFS];
+      if (D > Result)
+        Result = D;
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_BOTTOM_OFS] -
+          CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_BOTTOM_OFS];
+      if (D > Result)
+        Result = D;
+      return (Result + sgl.CurFont->PsSpace + 1);
+    }
+    else if (sgl.TextPsMode[ChPos1])
+    {
+      Result = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_TOP_OFS];
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_MID_OFS];
+      if (D > Result)
+        Result = D;
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_MIDBASE_OFS];
+      if (D > Result)
+        Result = D;
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_BASE_OFS];
+      if (D > Result)
+        Result = D;
+      D = CharHeader1[GuiLib_CHR_PSRIGHT_OFS + GuiLib_CHR_PS_BOTTOM_OFS];
+      if (D > Result)
+        Result = D;
+      return (Result + sgl.CurFont->PsSpace + 1);
+    }
+    else if (sgl.TextPsMode[ChPos2])
+    {
+      Result = CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_TOP_OFS];
+      D = CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_MID_OFS];
+      if (D < Result)
+        Result = D;
+      D = CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_MIDBASE_OFS];
+      if (D < Result)
+        Result = D;
+      D = CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_BASE_OFS];
+      if (D < Result)
+        Result = D;
+      D = CharHeader2[GuiLib_CHR_PSLEFT_OFS + GuiLib_CHR_PS_BOTTOM_OFS];
+      if (D < Result)
+        Result = D;
+      return (sgl.CurFont->PsNumWidth - Result + sgl.CurFont->PsSpace);
+    }
+    else
+      return (sgl.CurFont->PsNumWidth + sgl.CurFont->PsSpace);
+  }
+  else
+    return (0);
+#else
+  if (Ps == GuiLib_PS_OFF)
+    return (ReadByte(sgl.CurFont->XSize));
+  else if ((Ps == GuiLib_PS_ON) || (Ps == GuiLib_PS_NUM))
+  {
+    if ((Ps == GuiLib_PS_ON) || (sgl.TextPsMode[ChPos1] && sgl.TextPsMode[ChPos2]))
+    {
+      Ps1 = sgl.TextCharPtrAry[ChPos1] + GuiLib_CHR_PSRIGHT_OFS;
+      Ps2 = sgl.TextCharPtrAry[ChPos2] + GuiLib_CHR_PSLEFT_OFS;
+      Result = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_TOP_OFS)) -
+         (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_TOP_OFS));
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_MID_OFS)) -
+          (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_MID_OFS));
+      if (D > Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_MIDBASE_OFS)) -
+          (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_MIDBASE_OFS));
+      if (D > Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_BASE_OFS)) -
+          (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_BASE_OFS));
+      if (D > Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_BOTTOM_OFS)) -
+          (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_BOTTOM_OFS));
+      if (D > Result)
+        Result = D;
+      return (Result + ReadByte(sgl.CurFont->PsSpace) + 1);
+    }
+    else if (sgl.TextPsMode[ChPos1])
+    {
+      Ps1 = sgl.TextCharPtrAry[ChPos1] + GuiLib_CHR_PSRIGHT_OFS;
+      Result = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_TOP_OFS));
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_MID_OFS));
+      if (D > Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_MIDBASE_OFS));
+      if (D > Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_BASE_OFS));
+      if (D > Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps1 + GuiLib_CHR_PS_BOTTOM_OFS));
+      if (D > Result)
+        Result = D;
+      return (Result + ReadByte(sgl.CurFont->PsSpace) + 1);
+    }
+    else if (sgl.TextPsMode[ChPos2])
+    {
+      Ps2 = sgl.TextCharPtrAry[ChPos2] + GuiLib_CHR_PSLEFT_OFS;
+      Result = (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_TOP_OFS));
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_MID_OFS));
+      if (D < Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_MIDBASE_OFS));
+      if (D < Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_BASE_OFS));
+      if (D < Result)
+        Result = D;
+      D = (GuiConst_INT16S)(ReadBytePtr(Ps2 + GuiLib_CHR_PS_BOTTOM_OFS));
+      if (D < Result)
+        Result = D;
+      return (ReadByte(sgl.CurFont->PsNumWidth) - Result +
+              ReadByte(sgl.CurFont->PsSpace));
+    }
+    else
+      return (ReadByte(sgl.CurFont->PsNumWidth) +
+         ReadByte(sgl.CurFont->PsSpace));
+  }
+  else
+    return (0);
+#endif
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT16S TextPixelLength(
+   GuiConst_INT8U Ps,
+   GuiConst_INT16U CharCnt,
+   GuiConst_INT16S *TextXOfs)
+{
+  GuiConst_INT16U P;
+  GuiConst_INT16S L;
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U CharHeader1[GuiLib_CHR_LINECTRL_OFS + 1];
+  GuiConst_INT8U CharHeader2[GuiLib_CHR_LINECTRL_OFS + 1];
+#endif
+
+  if (CharCnt == 0)
+    return (0);
+  else
+  {
+#ifdef GuiConst_REMOTE_FONT_DATA
+    GuiLib_RemoteDataReadBlock(
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[0]],
+       GuiLib_CHR_LINECTRL_OFS + 1, CharHeader1);
+    GuiLib_RemoteDataReadBlock(
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[CharCnt - 1]],
+       GuiLib_CHR_LINECTRL_OFS + 1, CharHeader2);
+#endif
+
+    if (sgl.TextPsMode[0])
+    {
+#ifdef GuiConst_REMOTE_FONT_DATA
+      if (CharHeader1[GuiLib_CHR_LINECTRL_OFS] & 0x01)
+        L = -(GuiConst_INT16S)CharHeader1[GuiLib_CHR_PSLEFT_OFS];
+      else
+        L = -(GuiConst_INT16S)CharHeader1[GuiLib_CHR_XLEFT_OFS];
+#else
+      if (ReadBytePtr(sgl.TextCharPtrAry[0] + GuiLib_CHR_LINECTRL_OFS) & 0x01)
+        L = -(GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[0] +
+           GuiLib_CHR_PSLEFT_OFS));
+      else
+        L = -(GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[0] +
+         GuiLib_CHR_XLEFT_OFS));
+#endif
+    }
+    else
+      L = 0;
+
+    if (TextXOfs != NULL)
+      TextXOfs[0] = L;
+
+    for (P = 0; P < CharCnt - 1; P++)
+    {
+      L += CharDist (P, P + 1, Ps);
+      if (TextXOfs != NULL)
+        TextXOfs[P + 1] = L;
+    }
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+    if (sgl.TextPsMode[CharCnt - 1])
+    {
+      if (CharHeader2[GuiLib_CHR_LINECTRL_OFS] & 0x01)
+        L += (GuiConst_INT16S)CharHeader2[GuiLib_CHR_PSRIGHT_OFS] + 1;
+      else
+        L += (GuiConst_INT16S)CharHeader2[GuiLib_CHR_XLEFT_OFS] +
+             (GuiConst_INT16S)CharHeader2[GuiLib_CHR_XWIDTH_OFS];
+    }
+    else if (Ps == GuiLib_PS_NUM)
+    {
+      if (CharHeader2[GuiLib_CHR_LINECTRL_OFS] & 0x01)
+        L += (GuiConst_INT16S)CharHeader2[GuiLib_CHR_PSRIGHT_OFS] + 1;
+      else
+        L += sgl.CurFont->PsNumWidth + sgl.CurFont->PsSpace;
+    }
+    else
+      L += sgl.CurFont->XSize;
+#else
+    if (sgl.TextPsMode[CharCnt - 1])
+    {
+      if (ReadBytePtr(sgl.TextCharPtrAry[CharCnt - 1] + GuiLib_CHR_LINECTRL_OFS) & 0x01)
+        L += (GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[CharCnt - 1] +
+              GuiLib_CHR_PSRIGHT_OFS)) + 1;
+      else
+        L += ReadBytePtr(sgl.TextCharPtrAry[CharCnt - 1] + GuiLib_CHR_XLEFT_OFS) +
+          ReadBytePtr(sgl.TextCharPtrAry[CharCnt - 1] + GuiLib_CHR_XWIDTH_OFS);
+    }
+    else if (Ps == GuiLib_PS_NUM)
+    {
+      if (ReadBytePtr(sgl.TextCharPtrAry[CharCnt - 1] +
+          GuiLib_CHR_LINECTRL_OFS) & 0x01)
+        L += (GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[CharCnt - 1] +
+              GuiLib_CHR_PSRIGHT_OFS)) + 1;
+      else
+        L += ReadByte(sgl.CurFont->PsNumWidth) +
+           ReadByte(sgl.CurFont->PsSpace);
+    }
+    else
+      L += ReadByte(sgl.CurFont->XSize);
+#endif
+    if (TextXOfs != NULL)
+      TextXOfs[CharCnt] = L;
+    return (L);
+  }
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT16U CalcCharsWidth(
+   GuiConst_INT16U CharPos1,
+   GuiConst_INT16U CharPos2,
+   GuiConst_INT16S *TextXOfs,
+   GuiConst_INT16S *pXStart,
+   GuiConst_INT16S *pXEnd)
+{
+  GuiConst_INT16S X1;
+  GuiConst_INT16S X2;
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U CharHeader1[GuiLib_CHR_LINECTRL_OFS+1];
+  GuiConst_INT8U CharHeader2[GuiLib_CHR_LINECTRL_OFS+1];
+
+  GuiLib_RemoteDataReadBlock(
+     (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[CharPos1]],
+      GuiLib_CHR_LINECTRL_OFS+1, CharHeader1);
+  GuiLib_RemoteDataReadBlock(
+     (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[CharPos2]],
+      GuiLib_CHR_LINECTRL_OFS+1, CharHeader2);
+
+  if (sgl.TextPsMode[CharPos1])
+  {
+    if (CharHeader1[GuiLib_CHR_LINECTRL_OFS] & 0x01)
+      X1 = TextXOfs[CharPos1] +
+           (GuiConst_INT16S)CharHeader1[GuiLib_CHR_PSLEFT_OFS];
+    else
+      X1 = TextXOfs[CharPos1] +
+           (GuiConst_INT16S)CharHeader1[GuiLib_CHR_XLEFT_OFS];
+  }
+  else
+    X1 = TextXOfs[CharPos1];
+  if (sgl.TextPsMode[CharPos2])
+  {
+    if (CharHeader2[GuiLib_CHR_LINECTRL_OFS] & 0x01)
+      X2 = TextXOfs[CharPos2] +
+           (GuiConst_INT16S)CharHeader2[GuiLib_CHR_PSRIGHT_OFS];
+    else
+      X2 = TextXOfs[CharPos2] +
+           (GuiConst_INT16S)CharHeader1[GuiLib_CHR_XLEFT_OFS] +
+           (GuiConst_INT16S)CharHeader2[GuiLib_CHR_XWIDTH_OFS] - 1;
+  }
+  else
+    X2 = TextXOfs[CharPos2] + sgl.CurFont->XSize - 1;
+#else
+  if (sgl.TextPsMode[CharPos1])
+  {
+    if (ReadBytePtr(sgl.TextCharPtrAry[CharPos1] +
+        GuiLib_CHR_LINECTRL_OFS) & 0x01)
+      X1 = TextXOfs[CharPos1] +
+           (GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[CharPos1] +
+            GuiLib_CHR_PSLEFT_OFS));
+    else
+      X1 = TextXOfs[CharPos1] +
+           (GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[CharPos1] +
+            GuiLib_CHR_XLEFT_OFS));
+  }
+  else
+    X1 = TextXOfs[CharPos1];
+  if (sgl.TextPsMode[CharPos2])
+  {
+    if (ReadBytePtr(sgl.TextCharPtrAry[CharPos2] +
+        GuiLib_CHR_LINECTRL_OFS) & 0x01)
+      X2 = TextXOfs[CharPos2] +
+           (GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[CharPos2] +
+            GuiLib_CHR_PSRIGHT_OFS));
+    else
+      X2 = TextXOfs[CharPos2] +
+           (GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[CharPos2] +
+            GuiLib_CHR_XLEFT_OFS)) +
+           (GuiConst_INT16S)(ReadBytePtr(sgl.TextCharPtrAry[CharPos2] +
+            GuiLib_CHR_XWIDTH_OFS)) - 1;
+  }
+  else
+    X2 = TextXOfs[CharPos2] + sgl.CurFont->XSize - 1;
+#endif
+
+  *pXStart = X1;
+  *pXEnd = X2;
+  return(X2 - X1 + 1);
+}
+
+#ifdef GuiConst_CHARMODE_UNICODE
+//------------------------------------------------------------------------------
+static GuiConst_INT32U GetCharNdx(
+   GuiLib_FontRecPtr Font,
+   GuiConst_INT16U CharCode)
+{
+  GuiConst_INT32U CharNdx,CharNdx1,CharNdx2;
+  GuiConst_INT32U ReturnValue;
+
+  CharNdx1 = ReadWord(Font->FirstCharNdx) + 1;
+  CharNdx2 = CharNdx1 + ReadWord(Font->CharCount) - 1;
+
+  ReturnValue = 0;
+
+  do
+  {
+    CharNdx = CharNdx1 + ((CharNdx2 - CharNdx1) >> 1);
+
+    if (ReadWord(GuiFont_ChUnicodeList[CharNdx]) == CharCode)
+    {
+      ReturnValue = CharNdx;
+      break;
+    }
+
+    if (CharNdx1 == CharNdx2)
+    {
+      ReturnValue = ReadWord(Font->FirstCharNdx);
+      break;
+    }
+
+    if (ReadWord(GuiFont_ChUnicodeList[CharNdx]) > CharCode)
+      CharNdx2 = CharNdx - 1;
+    else
+      CharNdx1 = CharNdx + 1;
+
+    if (CharNdx1 > CharNdx2)
+    {
+      ReturnValue = ReadWord(Font->FirstCharNdx);
+      break;
+    }
+  }
+  while (1);
+
+  return ReturnValue;
+}
+#endif
+
+//------------------------------------------------------------------------------
+static void PrepareText(
+   GuiConst_TEXT PrefixGeneric *CharPtr,
+   GuiConst_INT16U CharCnt,
+   GuiConst_INT8U TextNdx)
+{
+  GuiConst_INT16S P;
+#ifdef GuiConst_CHARMODE_ANSI
+  GuiConst_INT8U CharCode;
+#else
+  GuiConst_INT16U CharCode;
+  GuiConst_INT16U CharNdx;
+#endif
+
+  if (CharCnt > GuiConst_MAX_TEXT_LEN)
+    CharCnt = GuiConst_MAX_TEXT_LEN;
+
+  for (P = 0; P < CharCnt; P++)
+  {
+#ifdef GuiConst_CHARMODE_ANSI
+
+#ifdef GuiConst_AVRGCC_COMPILER
+    if (displayVarNow)
+      CharCode = (unsigned GuiConst_CHAR) *CharPtr;
+    else
+      CharCode = (unsigned GuiConst_CHAR) ReadBytePtr(CharPtr);
+#else
+#ifdef GuiConst_ICC_COMPILER
+    if (displayVarNow)
+      CharCode = (unsigned GuiConst_CHAR) *CharPtr;
+    else
+      CharCode = *((GuiConst_INT8U PrefixRom *)CharPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+    if (displayVarNow)
+      CharCode = (unsigned GuiConst_CHAR) *CharPtr;
+    else
+      CharCode = *((GuiConst_INT8U PrefixRom *)CharPtr);
+#else
+#ifdef GuiConst_RENESAS_COMPILER_FAR
+    if (displayVarNow)
+      CharCode = (unsigned GuiConst_CHAR) *CharPtr;
+    else
+      CharCode = *((GuiConst_INT8U PrefixRom *)CharPtr);
+#else
+      CharCode = (unsigned GuiConst_TEXT) *CharPtr;
+#endif // GuiConst_RENESAS_COMPILER_FAR
+#endif // GuiConst_CODEVISION_COMPILER
+#endif // GuiConst_ICC_COMPILER
+#endif // GuiConst_AVRGCC_COMPILER
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+    if ((CharCode < sgl.CurFont->FirstChar) ||
+        (CharCode > sgl.CurFont->LastChar))
+      sgl.TextCharNdx[P] = sgl.CurFont->IllegalCharNdx;
+    else
+    {
+      sgl.TextCharNdx[P] =
+         sgl.CurFont->FirstCharNdx + (GuiConst_INT16U)CharCode -
+         (GuiConst_INT16U)sgl.CurFont->FirstChar;
+
+      if ((GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[P] + 1] -
+          (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[sgl.TextCharNdx[P]] == 0)
+        sgl.TextCharNdx[P] = sgl.CurFont->IllegalCharNdx;
+    }
+#else // GuiConst_REMOTE_FONT_DATA
+    if ((CharCode < ReadByte(sgl.CurFont->FirstChar)) ||
+        (CharCode > ReadByte(sgl.CurFont->LastChar)))
+      sgl.TextCharPtrAry[P] = (GuiConst_INT8U*)ReadWord(
+         GuiFont_ChPtrList[ReadWord(sgl.CurFont->IllegalCharNdx)]);
+    else
+      sgl.TextCharPtrAry[P] = (GuiConst_INT8U*)ReadWord(
+         GuiFont_ChPtrList[ReadWord(sgl.CurFont->FirstCharNdx) +
+         (GuiConst_INT16U)CharCode -
+         (GuiConst_INT16U)ReadByte(sgl.CurFont->FirstChar)]);
+#endif // GuiConst_REMOTE_FONT_DATA
+
+    if (sgl.CurItem.TextPar[TextNdx].Ps == GuiLib_PS_ON)
+      sgl.TextPsMode[P] = 1;
+    else if (sgl.CurItem.TextPar[TextNdx].Ps == GuiLib_PS_NUM)
+    {
+      if (((CharCode >= '0') && (CharCode <= '9')) ||
+         (CharCode == ' ') || (CharCode == '+') || (CharCode == '-') ||
+         (CharCode == '*') || (CharCode == '/') || (CharCode == '='))
+        sgl.TextPsMode[P] = 0;
+      else
+        sgl.TextPsMode[P] = 1;
+    }
+    else
+      sgl.TextPsMode[P] = 0;
+
+#else // GuiConst_CHARMODE_ANSI
+    CharCode = *((PrefixLocate GuiConst_INT16U*)CharPtr);
+    CharNdx = GetCharNdx(sgl.CurFont, CharCode);
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+    sgl.TextCharNdx[P] = CharNdx;
+#else
+    sgl.TextCharPtrAry[P] =
+       (GuiConst_INT8U PrefixRom *)ReadWord(GuiFont_ChPtrList[CharNdx]);
+#endif
+
+    if (sgl.CurItem.TextPar[TextNdx].Ps == GuiLib_PS_ON)
+      sgl.TextPsMode[P] = 1;
+    else if ((sgl.CurItem.TextPar[TextNdx].Ps == GuiLib_PS_NUM) && (CharNdx > 0))
+    {
+      if (((CharCode >= '0') && (CharCode <= '9')) ||
+         (CharCode == ' ') || (CharCode == '+') || (CharCode == '-') ||
+         (CharCode == '*') || (CharCode == '/') || (CharCode == '='))
+        sgl.TextPsMode[P] = 0;
+      else
+        sgl.TextPsMode[P] = 1;
+    }
+    else
+      sgl.TextPsMode[P] = 0;
+#endif // GuiConst_CHARMODE_ANSI
+    CharPtr++;
+  }
+}
+
+#ifdef GuiConst_ARAB_CHARS_INUSE
+//------------------------------------------------------------------------------
+static GuiConst_INT16U ArabicCorrection(
+   GuiConst_TEXT PrefixGeneric *CharPtr,
+   GuiConst_INT16U CharCnt,
+   GuiConst_INT8U RightToLeftWriting)
+{
+  GuiConst_INT16S I, J, P;
+  GuiConst_INT16U CharCode;
+  GuiConst_INT16U CharCode2;
+  GuiConst_TEXT PrefixLocate *CharPtr2;
+  GuiConst_TEXT PrefixLocate *CharPtrA;
+  GuiConst_TEXT PrefixLocate *CharPtrB;
+
+  if (!RightToLeftWriting)
+    return CharCnt;
+
+  CharPtr2 = CharPtr;
+
+  for (P = 0; P < CharCnt; P++)
+  {
+    CharCode = *((GuiConst_INT16U*)CharPtr);
+    switch (CharCode)
+    {
+      case 40:
+        *((GuiConst_INT16U*)CharPtr) = 41;
+        break;
+      case 41:
+        *((GuiConst_INT16U*)CharPtr) = 40;
+        break;
+
+      case 91:
+        *((GuiConst_INT16U*)CharPtr) = 93;
+        break;
+      case 93:
+        *((GuiConst_INT16U*)CharPtr) = 91;
+        break;
+
+      case 123:
+        *((GuiConst_INT16U*)CharPtr) = 125;
+        break;
+      case 125:
+        *((GuiConst_INT16U*)CharPtr) = 123;
+        break;
+    }
+
+    CharPtr++;
+  }
+
+  P = 0;
+  CharPtr = CharPtr2;
+  do
+  {
+    CharCode = *((GuiConst_INT16U*)CharPtr);
+    CharPtrA = CharPtr;
+    CharPtr++;
+    CharCode2 = *((GuiConst_INT16U*)CharPtr);
+
+    for (I = 0; I < GuiLib_ARAB_LIGATURES_CNT; I++)
+      if ((CharCode == GuiLib_ARAB_LIGATURES[I][0]) &&
+          (CharCode2 == GuiLib_ARAB_LIGATURES[I][1]))
+      {
+        *((GuiConst_INT16U*)CharPtrA) = GuiLib_ARAB_LIGATURES[I][2];
+        CharPtrA = CharPtr;
+        CharPtrB = CharPtrA;
+        CharPtrB++;
+        CharCnt--;
+        for (J = P + 1; J < CharCnt; J++)
+        {
+          *((GuiConst_INT16U*)CharPtrA) = *((GuiConst_INT16U*)CharPtrB);
+          CharPtrA++;
+          CharPtrB++;
+        }
+        *((GuiConst_INT16U*)CharPtrA) = 0;
+        break;
+      }
+
+    P++;
+  }
+  while (P < CharCnt - 1);
+
+  CharPtr = CharPtr2;
+  for (P = 0; P < CharCnt; P++)
+  {
+    CharCode = *((GuiConst_INT16U*)CharPtr);
+
+    for (I = 0; I < GuiLib_ARAB_CHAR_CONVERT_CNT; I++)
+      if ((CharCode == GuiLib_ARAB_CHAR_CONVERT[I][0]) && (CharCode > 0))
+      {
+        *((GuiConst_INT16U*)CharPtr) = GuiLib_ARAB_CHAR_CONVERT[I][1];
+        break;
+      }
+
+    CharPtr++;
+  }
+
+  gl.ArabicCharJoiningModeIndex[0] = -1;
+  CharPtr = CharPtr2;
+  for (P = 0; P < CharCnt; P++)
+  {
+    CharCode = *((GuiConst_INT16U*)CharPtr);
+
+    gl.ArabicCharJoiningModeIndex[P + 1] = -1;
+    for (I = 0; I < GuiLib_ARAB_CHAR_CONVERT_CNT; I++)
+      if ((CharCode >= GuiLib_ARAB_CHAR_CONVERT[I][1]) &&
+          (CharCode <= GuiLib_ARAB_CHAR_CONVERT[I][1] +
+          (GuiLib_ARAB_CHAR_CONVERT[I][2] & 7) - 1))
+      {
+        gl.ArabicCharJoiningModeIndex[P + 1] = I;
+        break;
+      }
+
+    CharPtr++;
+  }
+  gl.ArabicCharJoiningModeIndex[CharCnt + 1] = -1;
+
+  for (P = 0; P < CharCnt + 2; P++)
+  {
+    if (gl.ArabicCharJoiningModeIndex[P] == -1)
+      gl.ArabicCharJoiningMode[P] = GuiLib_ARAB_CHAR_TYPE_ISO;
+    else
+      gl.ArabicCharJoiningMode[P] =
+         GuiLib_ARAB_CHAR_CONVERT[gl.ArabicCharJoiningModeIndex[P]][2];
+  }
+
+  CharPtr = CharPtr2;
+  for (P = 0; P < CharCnt; P++)
+  {
+    CharCode = *((GuiConst_INT16U*)CharPtr);
+
+    I = P;
+    while (gl.ArabicCharJoiningMode[I] == GuiLib_ARAB_CHAR_DIACRITIC)
+      I--;
+    gl.ArabicCharJoiningModeBefore = gl.ArabicCharJoiningMode[I];
+    I = P + 2;
+    while (gl.ArabicCharJoiningMode[I] == GuiLib_ARAB_CHAR_DIACRITIC)
+      I++;
+    gl.ArabicCharJoiningModeAfter = gl.ArabicCharJoiningMode[I];
+
+    switch (gl.ArabicCharJoiningMode[P + 1])
+    {
+      case GuiLib_ARAB_CHAR_ISOFIN:
+        if (gl.ArabicCharJoiningModeBefore == GuiLib_ARAB_CHAR_ISOFININIMED)
+          *((GuiConst_INT16U*)CharPtr) =
+             GuiLib_ARAB_CHAR_CONVERT[gl.ArabicCharJoiningModeIndex[P + 1]][1] +
+             GuiLib_ARAB_CHAR_TYPE_FIN;
+        break;
+
+      case GuiLib_ARAB_CHAR_ISOFININIMED:
+        if ((gl.ArabicCharJoiningModeAfter == GuiLib_ARAB_CHAR_ISOFIN) ||
+            (gl.ArabicCharJoiningModeAfter == GuiLib_ARAB_CHAR_ISOFININIMED))
+        {
+          if (gl.ArabicCharJoiningModeBefore == GuiLib_ARAB_CHAR_ISOFININIMED)
+            *((GuiConst_INT16U*)CharPtr) =
+               GuiLib_ARAB_CHAR_CONVERT[gl.ArabicCharJoiningModeIndex[P + 1]][1] +
+               GuiLib_ARAB_CHAR_TYPE_MED;
+          else
+            *((GuiConst_INT16U*)CharPtr) =
+               GuiLib_ARAB_CHAR_CONVERT[gl.ArabicCharJoiningModeIndex[P + 1]][1] +
+               GuiLib_ARAB_CHAR_TYPE_INI;
+        }
+        else if (gl.ArabicCharJoiningModeBefore == GuiLib_ARAB_CHAR_ISOFININIMED)
+          *((GuiConst_INT16U*)CharPtr) =
+             GuiLib_ARAB_CHAR_CONVERT[gl.ArabicCharJoiningModeIndex[P + 1]][1] +
+             GuiLib_ARAB_CHAR_TYPE_FIN;
+        break;
+
+      case GuiLib_ARAB_CHAR_DIACRITIC:
+        if (((gl.ArabicCharJoiningMode[P + 2] == GuiLib_ARAB_CHAR_ISOFIN) ||
+             (gl.ArabicCharJoiningMode[P + 2] == GuiLib_ARAB_CHAR_ISOFININIMED)) &&
+            (gl.ArabicCharJoiningMode[P] == GuiLib_ARAB_CHAR_ISOFININIMED))
+          *((GuiConst_INT16U*)CharPtr) =
+             GuiLib_ARAB_CHAR_CONVERT[gl.ArabicCharJoiningModeIndex[P + 1]][1] + 1;
+        break;
+    }
+
+    CharPtr++;
+  }
+
+  return (CharCnt);
+}
+#endif
+
+// Groupend CHARS
+// Groupstart DRAW
+
+//------------------------------------------------------------------------------
+static void ResetDrawLimits(void)
+{
+  gl.Drawn = 0;
+  gl.DrawnX1 = 0x7FFF;
+  gl.DrawnY1 = 0x7FFF;
+  gl.DrawnX2 = 0x8000;
+  gl.DrawnY2 = 0x8000;
+}
+
+//------------------------------------------------------------------------------
+static void UpdateDrawLimits(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  sgl.CurItem.Drawn = 1;
+  sgl.CurItem.DrawnX1 = X1;
+  sgl.CurItem.DrawnY1 = Y1;
+  sgl.CurItem.DrawnX2 = X2;
+  sgl.CurItem.DrawnY2 = Y2;
+
+  gl.Drawn = 1;
+  gl.DrawnX1 = GuiLib_GET_MIN(gl.DrawnX1, X1);
+  gl.DrawnY1 = GuiLib_GET_MIN(gl.DrawnY1, Y1);
+  gl.DrawnX2 = GuiLib_GET_MAX(gl.DrawnX2, X2);
+  gl.DrawnY2 = GuiLib_GET_MAX(gl.DrawnY2, Y2);
+}
+
+//------------------------------------------------------------------------------
+static void DrawBorderBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR BorderColor,
+   GuiConst_INTCOLOR FillColor,
+   GuiConst_INT8U FillTransparent,
+   GuiConst_INT16U BorderThickness)
+{
+  if (BorderThickness == 1)
+    GuiLib_Box(X1, Y1, X2, Y2, BorderColor);
+  else
+  {
+    GuiLib_FillBox(X1, Y1, X1 + BorderThickness - 1, Y2, BorderColor);
+    GuiLib_FillBox(X2 - BorderThickness + 1, Y1, X2, Y2, BorderColor);
+    GuiLib_FillBox(X1, Y1, X2, Y1 + BorderThickness - 1, BorderColor);
+    GuiLib_FillBox(X1, Y2 - BorderThickness + 1, X2, Y2, BorderColor);
+  }
+  if ((!FillTransparent) &&
+     (X2 - X1 >= 2 * BorderThickness) &&
+     (Y2 - Y1 >= 2 * BorderThickness))
+    GuiLib_FillBox(X1 + BorderThickness,
+                   Y1 + BorderThickness,
+                   X2 - BorderThickness,
+                   Y2 - BorderThickness,
+                   FillColor);
+}
+
+//------------------------------------------------------------------------------
+static void SetBackColorBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INT8U TextNdx)
+{
+  sgl.BbX1 = X1;
+  sgl.BbY1 = Y1;
+  sgl.BbX2 = X2;
+  sgl.BbY2 = Y2;
+
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_LEFT) != 0)
+    sgl.BbX1--;
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_RIGHT) != 0)
+    sgl.BbX2++;
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_TOP) != 0)
+    sgl.BbY1--;
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_BOTTOM) != 0)
+    sgl.BbY2++;
+}
+
+//------------------------------------------------------------------------------
+static void SetBackBox(
+   GuiConst_INT8U TextNdx)
+{
+  GuiConst_INT16S L;
+
+  L = sgl.CurItem.TextPar[TextNdx].BackBoxSizeX;
+  sgl.BbX1 = sgl.CurItem.X1;
+  sgl.BbX2 = sgl.CurItem.X1 + L - 1;
+
+  if (sgl.CurItem.TextPar[TextNdx].Alignment == GuiLib_ALIGN_CENTER)
+  {
+    sgl.BbX1 -= L / 2;
+    sgl.BbX2 -= L / 2;
+  }
+  else if (sgl.CurItem.TextPar[TextNdx].Alignment == GuiLib_ALIGN_RIGHT)
+  {
+    sgl.BbX1 -= L - 1;
+    sgl.BbX2 -= L - 1;
+  }
+
+  if (sgl.CurItem.TextPar[TextNdx].BackBoxSizeY1 > 0)
+    sgl.BbY1 = sgl.CurItem.Y1 - sgl.CurItem.TextPar[TextNdx].BackBoxSizeY1;
+  else
+    sgl.BbY1 = sgl.CurItem.Y1 - ReadByte(sgl.CurFont->BaseLine);
+  if (sgl.CurItem.TextPar[TextNdx].BackBoxSizeY2 > 0)
+    sgl.BbY2 = sgl.CurItem.Y1 + sgl.CurItem.TextPar[TextNdx].BackBoxSizeY2;
+  else
+    sgl.BbY2 = sgl.CurItem.Y1 - ReadByte(sgl.CurFont->BaseLine) +
+       ReadByte(sgl.CurFont->YSize) - 1;
+
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_LEFT) != 0)
+    sgl.BbX1--;
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_RIGHT) != 0)
+    sgl.BbX2++;
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_TOP) != 0)
+    sgl.BbY1--;
+  if ((sgl.CurItem.TextPar[TextNdx].BackBorderPixels & GuiLib_BBP_BOTTOM) != 0)
+    sgl.BbY2++;
+}
+
+//------------------------------------------------------------------------------
+static void DrawBackBox(
+   GuiConst_INTCOLOR BoxColor,
+   GuiConst_INT8U Transparent,
+   GuiConst_INT8U TextNdx)
+{
+  SetBackBox(TextNdx);
+
+  if (!Transparent)
+    GuiLib_FillBox(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2, BoxColor);
+}
+
+//------------------------------------------------------------------------------
+#ifdef GuiConst_CHARMODE_ANSI
+  #ifdef GuiConst_ICC_COMPILER
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        DrawText((GuiConst_TEXT *)ChPtr,                                       \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #else
+  #ifdef GuiConst_CODEVISION_COMPILER
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        DrawText((GuiConst_TEXT *)ChPtr,                                       \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #else
+  #ifdef GuiConst_RENESAS_COMPILER_FAR
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        DrawText((GuiConst_TEXT PrefixLocate *)ChPtr,                         \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #else
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        DrawText((GuiConst_TEXT PrefixRom *)ChPtr,                             \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #endif
+  #endif
+  #endif
+#else
+  #ifdef GuiConst_ICC_COMPILER
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        ExtractUnicodeString((GuiConst_INT8U *)ChPtr, ChCnt);                  \
+        DrawText((GuiConst_TEXT *)&sgl.UnicodeTextBuf,                         \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #else
+  #ifdef GuiConst_CODEVISION_COMPILER
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        ExtractUnicodeString((GuiConst_INT8U *)ChPtr, ChCnt);                  \
+        DrawText((GuiConst_TEXT *)sgl.UnicodeTextBuf,                          \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #else
+  #ifdef GuiConst_RENESAS_COMPILER_FAR
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        ExtractUnicodeString((GuiConst_INT8U PrefixLocate *)ChPtr, ChCnt);    \
+        DrawText((GuiConst_TEXT PrefixLocate *)sgl.UnicodeTextBuf,            \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #else
+#define DRAW_ROM_TEXT(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)       \
+        ExtractUnicodeString((GuiConst_INT8U PrefixRom *)ChPtr, ChCnt);        \
+        DrawText((GuiConst_TEXT *)&sgl.UnicodeTextBuf,                         \
+                  ChCnt,                                                       \
+                  TxtNdx,                                                      \
+                  FColor,                                                      \
+                  BColor,                                                      \
+                  Transparent);
+  #endif
+  #endif
+#endif
+#endif
+
+//------------------------------------------------------------------------------
+static void DrawText(
+   GuiConst_TEXT PrefixGeneric *CharPtr,
+   GuiConst_INT16U CharCount,
+   GuiConst_INT8U TextNdx,
+   GuiConst_INTCOLOR ForeColor,
+   GuiConst_INTCOLOR BackColor,
+   GuiConst_INT8U Transparent)
+{
+  GuiConst_INT16S P, N;
+  GuiConst_INT16U CharCnt;
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT32U PrefixRom TempOfs;
+#else
+  GuiConst_INT8U PrefixRom * TempPtr;
+#endif
+  GuiConst_INT8U  TempPsMode;
+  GuiConst_INT16S TextPixelLen;
+  GuiConst_INT16S X1, Y1, X2, Y2;
+  GuiConst_INT16S  TextXOfs[GuiConst_MAX_TEXT_LEN + 2];
+
+#ifdef GuiConst_ARAB_CHARS_INUSE
+  CharCnt = ArabicCorrection(CharPtr,
+                             CharCount,
+                            (sgl.CurItem.TextPar[TextNdx].BitFlags &
+               GuiLib_BITFLAG_REVERSEWRITING) > 0);
+#else
+  CharCnt = CharCount;
+#endif
+  PrepareText(CharPtr, CharCnt, TextNdx);
+
+  if (sgl.CurItem.TextPar[TextNdx].BitFlags & GuiLib_BITFLAG_REVERSEWRITING)
+  {
+    for (N = 0; N < CharCnt / 2; N++)
+    {
+#ifdef GuiConst_REMOTE_FONT_DATA
+      TempOfs = sgl.TextCharNdx[N];
+      sgl.TextCharNdx[N] = sgl.TextCharNdx[CharCnt - 1 - N];
+      sgl.TextCharNdx[CharCnt - 1 - N] = TempOfs;
+#else
+      TempPtr = sgl.TextCharPtrAry[N];
+      sgl.TextCharPtrAry[N] =
+         (GuiConst_INT8U PrefixRom *)sgl.TextCharPtrAry[CharCnt - 1 - N];
+      sgl.TextCharPtrAry[CharCnt - 1 - N] = (GuiConst_INT8U PrefixRom *)TempPtr;
+#endif
+      TempPsMode = sgl.TextPsMode[N];
+      sgl.TextPsMode[N] = sgl.TextPsMode[CharCnt - 1 - N];
+      sgl.TextPsMode[CharCnt - 1 - N] = TempPsMode;
+    }
+  }
+
+  TextPixelLen = TextPixelLength(sgl.CurItem.TextPar[TextNdx].Ps,
+                                 CharCnt,
+                                 TextXOfs);
+
+  X1 = sgl.CurItem.X1;
+  switch (sgl.CurItem.TextPar[TextNdx].Alignment)
+  {
+    case GuiLib_ALIGN_CENTER:
+      if (CharCnt > 0)
+        X1 -= TextPixelLen / 2;
+      break;
+
+    case GuiLib_ALIGN_RIGHT:
+      X1 -= TextPixelLen - 1;
+      break;
+  }
+  Y1 = sgl.CurItem.Y1 - ReadByte(sgl.CurFont->BaseLine);
+  X2 = X1 + TextPixelLen - 1;
+  Y2 = Y1 + ReadByte(sgl.CurFont->YSize) - 1;
+
+  sgl.FontWriteX1 = X1;
+  sgl.FontWriteY1 = Y1;
+  sgl.FontWriteX2 = X2;
+  sgl.FontWriteY2 = Y2;
+
+  if (sgl.DisplayWriting)
+  {
+    if (CharCnt > 0)
+    {
+      if ((Transparent == 0) && (sgl.CurItem.TextPar[TextNdx].BackBoxSizeX == 0))
+      {
+        SetBackColorBox(X1, Y1, X2, Y2, TextNdx);
+        GuiLib_FillBox(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2, BackColor);
+      }
+
+      for (P = 0; P < CharCnt; P++)
+#ifdef GuiConst_REMOTE_FONT_DATA
+        DrawChar(X1 + TextXOfs[P], Y1, sgl.CurFont, sgl.TextCharNdx[P], ForeColor, (Transparent == 2));
+#else
+        DrawChar(X1 + TextXOfs[P], Y1, sgl.CurFont, sgl.TextCharPtrAry[P], ForeColor, (Transparent == 2));
+#endif
+    }
+
+    if ((sgl.CurItem.TextPar[TextNdx].BitFlags & GuiLib_BITFLAG_UNDERLINE) &&
+        (CharCnt > 0))
+      GuiLib_FillBox(X1, Y1 + ReadByte(sgl.CurFont->Underline1), X2,
+         Y1 + ReadByte(sgl.CurFont->Underline2), ForeColor);
+
+    GuiLib_MarkDisplayBoxRepaint(X1, Y1, X2, Y2);
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+    if ((sgl.CurItem.TextPar[TextNdx].BitFlags & GuiLib_BITFLAG_BLINKTEXTFIELD) &&
+        (sgl.CurItem.BlinkFieldNo < GuiConst_BLINK_FIELDS_MAX))
+    {
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].InUse = 1;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].BlinkBoxInverted = 0;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].ItemType = sgl.CurItem.ItemType;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].CharCnt = CharCnt;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].TextPar = sgl.CurItem.TextPar[TextNdx];
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].FormatFieldWidth =
+         sgl.CurItem.FormatFieldWidth;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].FormatDecimals =
+         sgl.CurItem.FormatDecimals;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].FormatAlignment =
+         sgl.CurItem.FormatAlignment;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].FormatFormat = sgl.CurItem.FormatFormat;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].VarType = sgl.CurItem.VarType;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].XSize =
+      ReadByte(sgl.CurFont->XSize);
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].PsNumWidth =
+      ReadByte(sgl.CurFont->PsNumWidth);
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].PsSpace =
+      ReadByte(sgl.CurFont->PsSpace);
+      if (sgl.CurItem.ItemType == GuiLib_ITEM_TEXT)
+        sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].TextPtr =
+           sgl.CurItem.TextPtr[TextNdx];
+      else
+        sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].TextPtr =
+           (GuiConst_TEXT*)sgl.CurItem.VarPtr;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].X1 = sgl.CurItem.X1;
+      sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].X2 = sgl.CurItem.X2;
+      if (sgl.CurItem.TextPar[TextNdx].BackBoxSizeX > 0)
+      {
+        if (sgl.CurItem.TextPar[TextNdx].BackBoxSizeY1 > 0)
+          sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].Y1 =
+             sgl.CurItem.Y1 - sgl.CurItem.TextPar[TextNdx].BackBoxSizeY1;
+        else
+          sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].Y1 =
+        sgl.CurItem.Y1 - ReadByte(sgl.CurFont->BaseLine);
+        if (sgl.CurItem.TextPar[TextNdx].BackBoxSizeY1 > 0)
+          sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].Y2 =
+             sgl.CurItem.Y1 + sgl.CurItem.TextPar[TextNdx].BackBoxSizeY2;
+        else
+          sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].Y2 =
+          sgl.CurItem.Y1 - ReadByte(sgl.CurFont->BaseLine) +
+                ReadByte(sgl.CurFont->YSize) - 1;
+      }
+      else
+      {
+        sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].Y1 = Y1;
+        sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].Y2 = Y2;
+      }
+    }
+#endif
+#endif
+  }
+}
+
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+
+//------------------------------------------------------------------------------
+#ifdef GuiConst_CHARMODE_ANSI
+  #ifdef GuiConst_ICC_COMPILER
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        DrawTextBlock((GuiConst_TEXT *)ChPtr,                                  \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #else
+  #ifdef GuiConst_CODEVISION_COMPILER
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        DrawTextBlock((GuiConst_TEXT *)ChPtr,                                  \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #else
+  #ifdef GuiConst_RENESAS_COMPILER_FAR
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        DrawTextBlock((GuiConst_TEXT PrefixLocate *)ChPtr,                     \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #else
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        DrawTextBlock((GuiConst_TEXT PrefixRom *)ChPtr,                        \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #endif
+  #endif
+  #endif
+#else
+  #ifdef GuiConst_ICC_COMPILER
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        ExtractUnicodeString((GuiConst_INT8U *)ChPtr, ChCnt);                  \
+        DrawTextBlock((GuiConst_TEXT *)&sgl.UnicodeTextBuf,                    \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #else
+  #ifdef GuiConst_CODEVISION_COMPILER
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        ExtractUnicodeString((GuiConst_INT8U *)ChPtr, ChCnt);                  \
+        DrawTextBlock((GuiConst_TEXT *)sgl.UnicodeTextBuf,                     \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #else
+  #ifdef GuiConst_RENESAS_COMPILER_FAR
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        ExtractUnicodeString((GuiConst_INT8U PrefixLocate *)ChPtr, ChCnt);     \
+        DrawTextBlock((GuiConst_TEXT PrefixLocate *)sgl.UnicodeTextBuf,        \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #else
+#define DRAW_ROM_TEXTBLOCK(ChPtr, ChCnt, TxtNdx, FColor, BColor, Transparent)  \
+        ExtractUnicodeString((GuiConst_INT8U PrefixRom *)ChPtr, ChCnt);        \
+        DrawTextBlock((GuiConst_TEXT *)&sgl.UnicodeTextBuf,                    \
+                       ChCnt,                                                  \
+                       TxtNdx,                                                 \
+                       FColor,                                                 \
+                       BColor,                                                 \
+                       Transparent);
+  #endif
+  #endif
+#endif
+#endif
+
+//------------------------------------------------------------------------------
+static void DrawTextBlock(
+   GuiConst_TEXT PrefixGeneric *CharPtr,
+   GuiConst_INT16U CharCnt,
+   GuiConst_INT8U TextNdx,
+   GuiConst_INTCOLOR ForeColor,
+   GuiConst_INTCOLOR BackColor,
+   GuiConst_INT8U Transparent)
+{
+  GuiConst_INT16S X1, Y1, X2, Y2;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiConst_INT16S CX1, CX2;
+#endif
+  GuiConst_INT16S CY1, CY2;
+  GuiConst_INT16S TextXOfs[GuiConst_MAX_TEXT_LEN + 2];
+  GuiConst_INT16S TextCharLineStart[GuiConst_MAX_PARAGRAPH_LINE_CNT + 1];
+  GuiConst_INT16S TextCharLineEnd[GuiConst_MAX_PARAGRAPH_LINE_CNT + 1];
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiConst_INT16S RemClipX1, RemClipY1, RemClipX2, RemClipY2;
+#endif
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  GuiConst_INT16S BlinkNo;
+#endif
+#endif
+  GuiConst_INT16S PixWidth;
+  GuiConst_INT16S N, P, M, F;
+  GuiConst_INT16S LineLen;
+  GuiConst_INT16S LineCnt;
+  GuiConst_INT16S LineCnt2;
+  GuiConst_INT16S BlindLinesAtTop;
+  GuiConst_INT16S XPos, YPos;
+  GuiConst_INT16S XStart, XEnd;
+  GuiConst_INT8U  TempPsMode;
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT32U PrefixRom TempOfs;
+  GuiConst_INT8U CharHeader1[GuiLib_CHR_LINECTRL_OFS];
+  GuiConst_INT8U CharHeader2[GuiLib_CHR_LINECTRL_OFS];
+#else
+  GuiConst_INT8U PrefixRom * TempPtr;
+#endif
+
+  X1 = sgl.CurItem.X1;
+  Y1 = sgl.CurItem.Y1;
+  X2 = sgl.CurItem.X2;
+  Y2 = sgl.CurItem.Y2;
+  sgl.FontWriteX1 = X1;
+  sgl.FontWriteY1 = Y1;
+  sgl.FontWriteX2 = X2;
+  sgl.FontWriteY2 = Y2;
+
+  PixWidth = 0;
+
+  if (sgl.DisplayWriting)
+  {
+    if (!Transparent && (sgl.CurItem.TextPar[TextNdx].BackBoxSizeX == 0))
+    {
+      SetBackColorBox(X1, Y1, X2, Y2, TextNdx);
+      GuiLib_FillBox(sgl.BbX1, sgl.BbY1, sgl.BbX2, sgl.BbY2, BackColor);
+    }
+
+    if (sgl.CurItem.CompPars.CompTextBox.LineDistRelToFont)
+    {
+      sgl.CurItem.CompPars.CompTextBox.LineDist +=sgl.CurFont->YSize;
+      sgl.CurItem.CompPars.CompTextBox.LineDistRelToFont = 0;
+    }
+
+    LineCnt = 0;
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+    sgl.CurItem.CompPars.CompTextBox.Lines = 1;
+#endif
+    if (CharCnt > 0)
+    {
+      PixWidth = X2 - X1 + 1;
+
+#ifdef GuiConst_ARAB_CHARS_INUSE
+      CharCnt =
+         ArabicCorrection(CharPtr,
+                          CharCnt,
+                          (sgl.CurItem.TextPar[TextNdx].BitFlags &
+                           GuiLib_BITFLAG_REVERSEWRITING) > 0);
+#endif
+      PrepareText(CharPtr, CharCnt, TextNdx);
+      TextPixelLength(sgl.CurItem.TextPar[TextNdx].Ps,
+                      CharCnt,
+                      TextXOfs);
+
+      TextCharLineStart[0] = 0;
+      TextCharLineEnd[0] = -1;
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+      if (sgl.CurItem.CompPars.CompTextBox.ScrollIndex == 0xFF)
+        BlindLinesAtTop = 0;
+      else
+        BlindLinesAtTop = sgl.CurItem.CompPars.CompTextBox.ScrollPos /
+           sgl.CurItem.CompPars.CompTextBox.LineDist;
+#else
+      BlindLinesAtTop = 0;
+#endif
+      LineCnt = 1 - BlindLinesAtTop;
+      if (LineCnt >= 1)
+        LineCnt = 1;
+      LineCnt2 = 1;
+      P = 0;
+#ifdef GuiConst_REMOTE_FONT_DATA
+      GuiLib_RemoteDataReadBlock(
+         (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[
+         sgl.TextCharNdx[TextCharLineStart[LineCnt2 - 1]]],
+         GuiLib_CHR_LINECTRL_OFS,
+         CharHeader2);
+#endif
+      while (P < CharCnt)
+      {
+        while ((P < CharCnt - 1) &&
+           !((ReadBytePtr(CharPtr + P) == GuiLib_LINEFEED) ||
+           ((ReadBytePtr(CharPtr + P) != ' ') &&
+           (ReadBytePtr(CharPtr + P + 1) == ' ')) ||
+           ((ReadBytePtr(CharPtr + P) == '-') &&
+           (ReadBytePtr(CharPtr + P + 1) != ' '))))
+          P++;
+
+        F = 0;
+
+        if (CalcCharsWidth(TextCharLineStart[LineCnt2 - 1], P,
+                           TextXOfs, &XStart, &XEnd) > PixWidth)
+        {
+          if (TextCharLineEnd[LineCnt2 - 1] == -1)
+          {
+            if (ReadBytePtr(CharPtr + P) == GuiLib_LINEFEED)
+            {
+              TextCharLineEnd[LineCnt2 - 1] = P - 1;
+              F = 1;
+            }
+            else
+              TextCharLineEnd[LineCnt2 - 1] = P;
+
+            TextCharLineStart[LineCnt2] = P + 1;
+            TextCharLineEnd[LineCnt2] = -1;
+          }
+          else
+          {
+            TextCharLineStart[LineCnt2] = TextCharLineEnd[LineCnt2 - 1] + 1;
+            while ((TextCharLineStart[LineCnt2] < P) &&
+               (ReadBytePtr(CharPtr + TextCharLineStart[LineCnt2]) == ' '))
+              TextCharLineStart[LineCnt2]++;
+            TextCharLineEnd[LineCnt2] = P;
+          }
+          if (LineCnt >= GuiConst_MAX_PARAGRAPH_LINE_CNT)
+          {
+            P = CharCnt;
+            break;
+          }
+          LineCnt++;
+          if (LineCnt > 1)
+            LineCnt2 = LineCnt;
+          else
+          {
+            TextCharLineStart[LineCnt2 - 1] = TextCharLineStart[LineCnt2];
+            TextCharLineEnd[LineCnt2 - 1] = TextCharLineEnd[LineCnt2];
+          }
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+          sgl.CurItem.CompPars.CompTextBox.Lines++;
+#endif
+        }
+        else
+          TextCharLineEnd[LineCnt2 - 1] = P;
+
+        if ((ReadBytePtr(CharPtr + P) == GuiLib_LINEFEED) &&
+            (F == 0))
+        {
+          TextCharLineEnd[LineCnt2 - 1] = P - 1;
+          TextCharLineStart[LineCnt2] = P + 1;
+          TextCharLineEnd[LineCnt2] = -1;
+
+          if (LineCnt >= GuiConst_MAX_PARAGRAPH_LINE_CNT)
+          {
+            P = CharCnt;
+            break;
+          }
+          LineCnt++;
+          if (LineCnt > 1)
+            LineCnt2 = LineCnt;
+          else
+          {
+            TextCharLineStart[LineCnt2 - 1] = TextCharLineStart[LineCnt2];
+            TextCharLineEnd[LineCnt2 - 1] = TextCharLineEnd[LineCnt2];
+          }
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+          sgl.CurItem.CompPars.CompTextBox.Lines++;
+#endif
+        }
+
+        P++;
+      }
+    }
+
+    if (LineCnt >= 1)
+    {
+      if (sgl.CurItem.TextPar[TextNdx].BitFlags & GuiLib_BITFLAG_REVERSEWRITING)
+      {
+        for (M = 0; M < LineCnt ; M++)
+        {
+          for (P = TextCharLineStart[M]; P <= (TextCharLineStart[M] +
+             ((TextCharLineEnd[M] - TextCharLineStart[M] + 1) / 2) - 1); P++)
+          {
+#ifdef GuiConst_REMOTE_FONT_DATA
+            TempOfs = sgl.TextCharNdx[P];
+            sgl.TextCharNdx[P] =
+               sgl.TextCharNdx[TextCharLineEnd[M] - (P - TextCharLineStart[M])];
+            sgl.TextCharNdx[TextCharLineEnd[M] - (P - TextCharLineStart[M])] =
+               TempOfs;
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+            TempPtr = &sgl.TextCharPtrAry[P];
+#else
+            TempPtr = sgl.TextCharPtrAry[P];
+#endif
+            sgl.TextCharPtrAry[P] = (GuiConst_INT8U PrefixRom *)
+               sgl.TextCharPtrAry[TextCharLineEnd[M] - (P - TextCharLineStart[M])];
+            sgl.TextCharPtrAry[TextCharLineEnd[M] - (P - TextCharLineStart[M])] =
+               (GuiConst_INT8U PrefixRom *)TempPtr;
+#endif
+            TempPsMode = sgl.TextPsMode[P];
+            sgl.TextPsMode[P] =
+               sgl.TextPsMode[TextCharLineEnd[M] - (P - TextCharLineStart[M])];
+            sgl.TextPsMode[TextCharLineEnd[M] - (P - TextCharLineStart[M])] =
+               TempPsMode;
+          }
+        }
+        TextPixelLength(sgl.CurItem.TextPar[TextNdx].Ps,
+                        CharCnt,
+                        TextXOfs);
+      }
+
+      CY1 = Y1;
+      CY2 = Y2;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      CX1 = X1;
+      CX2 = X2;
+      RemClipX1 = sgl.CurItem.ClipRectX1;
+      RemClipY1 = sgl.CurItem.ClipRectY1;
+      RemClipX2 = sgl.CurItem.ClipRectX2;
+      RemClipY2 = sgl.CurItem.ClipRectY2;
+      if (RemClipX1 > CX1)
+        CX1 = RemClipX1;
+      if (RemClipY1 > CY1)
+        CY1 = RemClipY1;
+      if (RemClipX2 < CX2)
+        CX2 = RemClipX2;
+      if (RemClipY2 < CY2)
+        CY2 = RemClipY2;
+      GuiLib_SetClipping(CX1, CY1, CX2, CY2);
+#endif
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+      if ((sgl.CurItem.TextPar[TextNdx].BitFlags & GuiLib_BITFLAG_BLINKTEXTFIELD) &&
+          (sgl.CurItem.BlinkFieldNo < GuiConst_BLINK_FIELDS_MAX))
+      {
+        BlinkNo = sgl.CurItem.BlinkFieldNo;
+        sgl.BlinkTextItems[BlinkNo].InUse = 1;
+        sgl.BlinkTextItems[BlinkNo].ItemType = sgl.CurItem.ItemType;
+        sgl.BlinkTextItems[BlinkNo].VarType = sgl.CurItem.VarType;
+        sgl.BlinkTextItems[BlinkNo].CharCnt = CharCnt;
+        sgl.BlinkTextItems[BlinkNo].TextPar = sgl.CurItem.TextPar[TextNdx];
+        sgl.BlinkTextItems[BlinkNo].XSize = sgl.CurFont->XSize;
+        sgl.BlinkTextItems[BlinkNo].YSize = sgl.CurFont->YSize;
+        sgl.BlinkTextItems[BlinkNo].PsNumWidth = sgl.CurFont->PsNumWidth;
+        sgl.BlinkTextItems[BlinkNo].PsSpace = sgl.CurFont->PsSpace;
+        if (sgl.CurItem.ItemType == GuiLib_ITEM_TEXTBLOCK)
+          sgl.BlinkTextItems[BlinkNo].TextPtr = sgl.CurItem.TextPtr[TextNdx];
+        else
+          sgl.BlinkTextItems[BlinkNo].TextPtr = (GuiConst_TEXT*)sgl.CurItem.VarPtr;
+        sgl.BlinkTextItems[BlinkNo].X1 = X1;
+        sgl.BlinkTextItems[BlinkNo].X2 = X2;
+        sgl.BlinkTextItems[BlinkNo].Y1 = Y1;
+        sgl.BlinkTextItems[BlinkNo].Y2 = Y2;
+        sgl.BlinkTextItems[BlinkNo].LineCnt = LineCnt;
+        sgl.BlinkTextItems[BlinkNo].TextBoxLineDist =
+           sgl.CurItem.CompPars.CompTextBox.LineDist;
+        sgl.BlinkTextItems[BlinkNo].BlindLinesAtTop = BlindLinesAtTop;
+        sgl.BlinkTextItems[BlinkNo].FormatFieldWidth = sgl.CurItem.FormatFieldWidth;
+        sgl.BlinkTextItems[BlinkNo].FormatDecimals = sgl.CurItem.FormatDecimals;
+        sgl.BlinkTextItems[BlinkNo].FormatAlignment = sgl.CurItem.FormatAlignment;
+        sgl.BlinkTextItems[BlinkNo].FormatFormat = sgl.CurItem.FormatFormat;
+        sgl.BlinkTextItems[BlinkNo].TextBoxHorzAlignment =
+           sgl.CurItem.CompPars.CompTextBox.HorzAlignment;
+        sgl.BlinkTextItems[BlinkNo].TextBoxVertAlignment =
+           sgl.CurItem.CompPars.CompTextBox.VertAlignment;
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+        sgl.BlinkTextItems[BlinkNo].TextBoxScrollPos =
+           sgl.CurItem.CompPars.CompTextBox.ScrollPos;
+#endif
+      }
+      else
+        BlinkNo = -1;
+#endif
+#endif
+
+      YPos = Y1;
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+      if (BlindLinesAtTop < 0)
+        BlindLinesAtTop = 0;
+      YPos -= sgl.CurItem.CompPars.CompTextBox.ScrollPos -
+             (sgl.CurItem.CompPars.CompTextBox.LineDist * BlindLinesAtTop);
+#endif
+
+      N = ReadByte(sgl.CurFont->YSize) +
+         (LineCnt - 1) * sgl.CurItem.CompPars.CompTextBox.LineDist;
+      switch (sgl.CurItem.CompPars.CompTextBox.VertAlignment)
+      {
+        case GuiLib_ALIGN_CENTER:
+          YPos += (Y2 - Y1 + 1 - N) / 2;
+          break;
+
+        case GuiLib_ALIGN_RIGHT:
+          YPos += Y2 - Y1 + 1 - N;
+          break;
+      }
+
+      for (N = 0; N < LineCnt; N++)
+      {
+        if (TextCharLineEnd[N] >= TextCharLineStart[N])
+        {
+          XPos = X1;
+
+          LineLen = CalcCharsWidth(TextCharLineStart[N],
+                                   TextCharLineEnd[N],
+                                   TextXOfs,
+                                   &XStart,
+                                   &XEnd);
+          switch (sgl.CurItem.CompPars.CompTextBox.HorzAlignment)
+          {
+            case GuiLib_ALIGN_CENTER:
+              XPos += (PixWidth - LineLen) / 2;
+              break;
+
+            case GuiLib_ALIGN_RIGHT:
+              XPos += PixWidth - LineLen;
+              break;
+          }
+
+          if (sgl.CurItem.TextPar[TextNdx].BitFlags & GuiLib_BITFLAG_UNDERLINE)
+            GuiLib_FillBox(XPos, YPos + ReadByte(sgl.CurFont->Underline1),
+               XPos + LineLen - 1, YPos + ReadByte(sgl.CurFont->Underline2),
+               ForeColor);
+
+          XPos -= XStart;
+          if ((YPos + sgl.CurFont->YSize >= CY1) && (YPos <= CY2))
+            for (P = TextCharLineStart[N]; P <= TextCharLineEnd[N]; P++)
+#ifdef GuiConst_REMOTE_FONT_DATA
+              DrawChar(
+                 XPos + TextXOfs[P], YPos, sgl.CurFont, sgl.TextCharNdx[P], ForeColor, 0);
+#else
+              DrawChar(XPos + TextXOfs[P], YPos, sgl.CurFont, sgl.TextCharPtrAry[P],
+                 ForeColor, 0);
+#endif
+        }
+        YPos += sgl.CurItem.CompPars.CompTextBox.LineDist;
+      }
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+      GuiLib_SetClipping(RemClipX1, RemClipY1, RemClipX2, RemClipY2);
+#endif
+    }
+    GuiLib_MarkDisplayBoxRepaint(X1, Y1, X2, Y2);
+  }
+}
+#endif
+// Groupend DRAW
+
+#ifdef GuiConst_FLOAT_SUPPORT_ON
+static float Floor(float X)
+{
+  GuiConst_INT32S I;
+
+  I = X - 2;
+  while(++I <= X - 1);
+  return I;
+}
+#endif
+
+//------------------------------------------------------------------------------
+static GuiConst_INT32S ReadVar(
+   void PrefixLocate *VarPtr,
+   GuiConst_INT8U VarType)
+{
+#ifdef GuiConst_FLOAT_SUPPORT_ON
+  GuiConst_INT32S tmp;
+  GuiConst_INT8U i;
+  double dfactor;
+  double dx;
+  float ffactor;
+  float fx;
+#endif
+
+  if (VarPtr == 0)
+    return (0);
+  else
+  {
+    if (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP)
+    {
+#ifdef GuiConst_FLOAT_SUPPORT_ON
+      if ((VarType == GuiLib_VAR_FLOAT) || (VarType == GuiLib_VAR_DOUBLE))
+        sgl.VarExponent = 0;
+      else
+#endif
+        sgl.CurItem.FormatFormat = GuiLib_FORMAT_DEC;
+    }
+    switch (VarType)
+    {
+      case GuiLib_VAR_BOOL:
+        if (*(GuiConst_INT8U PrefixLocate *) VarPtr == 0)
+          return (0);
+        else
+          return (1);
+
+      case GuiLib_VAR_UNSIGNED_CHAR:
+        return (*(GuiConst_INT8U PrefixLocate *) VarPtr);
+
+      case GuiLib_VAR_SIGNED_CHAR:
+        return (*(GuiConst_INT8S PrefixLocate *) VarPtr);
+
+      case GuiLib_VAR_UNSIGNED_INT:
+        return (*(GuiConst_INT16U PrefixLocate *) VarPtr);
+
+      case GuiLib_VAR_SIGNED_INT:
+        return (*(GuiConst_INT16S PrefixLocate *) VarPtr);
+
+      case GuiLib_VAR_UNSIGNED_LONG:
+        return (*(GuiConst_INT32U PrefixLocate *) VarPtr);
+
+      case GuiLib_VAR_SIGNED_LONG:
+        return (*(GuiConst_INT32S PrefixLocate *) VarPtr);
+
+      case GuiLib_VAR_COLOR:
+        return (*(GuiConst_INTCOLOR PrefixLocate *) VarPtr);
+
+      case GuiLib_VAR_FLOAT:
+#ifdef GuiConst_FLOAT_SUPPORT_ON
+        fx = *(float PrefixLocate *) VarPtr;
+        if (fx < 0)
+          fx = -fx;
+        if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP) && (fx != 0))
+        {
+          while (Floor(fx + 0.5) > 10)
+          {
+            fx /= 10;
+            sgl.VarExponent++;
+          }
+          while (Floor(fx) < 1)
+          {
+            fx *= 10;
+            sgl.VarExponent--;
+          }
+        }
+        if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_DEC) ||
+            (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP))
+        {
+          ffactor=1.0;
+          for (i = 0; i < sgl.CurItem.FormatDecimals ; i++)
+            ffactor *= 10.0;
+          tmp = (GuiConst_INT32S) (fx * ffactor);
+          ffactor *= 100.0;
+          if (((GuiConst_INT32S) (fx * ffactor) - (tmp * 100)) >= 45)
+            tmp++;
+          if (*(float PrefixLocate *) VarPtr < 0)
+            tmp = -tmp;
+        }
+        else
+          tmp = (GuiConst_INT32S) *(float PrefixLocate *) VarPtr;
+        return (tmp);
+#else
+        return (0);
+#endif
+
+      case GuiLib_VAR_DOUBLE:
+#ifdef GuiConst_FLOAT_SUPPORT_ON
+        dx = *(double PrefixLocate *) VarPtr;
+        if (dx < 0)
+          dx = -dx;
+        if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP) && (dx != 0))
+        {
+          while (dx > 10)
+          {
+            dx /= 10;
+            sgl.VarExponent++;
+          }
+          while (dx < 1)
+          {
+            dx *= 10;
+            sgl.VarExponent--;
+          }
+        }
+        if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_DEC) ||
+            (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP))
+        {
+          dfactor=1.0;
+          for (i = 0; i < sgl.CurItem.FormatDecimals ; i++)
+            dfactor *= 10.0;
+          tmp = (GuiConst_INT32S) (dx * dfactor);
+          dfactor *= 100.0;
+          if (((GuiConst_INT32S) (dx * dfactor) - (tmp * 100)) >= 45)
+            tmp++;
+          if (*(double PrefixLocate *) VarPtr < 0)
+            tmp = -tmp;
+        }
+        else
+          tmp = (GuiConst_INT32S) dx;
+        return (tmp);
+#else
+        return (0);
+#endif
+
+      default:
+        return (0);
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+static GuiConst_INT8U DataNumStr(
+   GuiConst_INT32S DataValue,
+   GuiConst_INT8U VarType,
+   GuiConst_INT8U TextNdx)
+{
+  GuiConst_CHAR *S1;
+  GuiConst_INT8U StrLen, L;
+  GuiConst_INT16S I, N, P;
+  GuiConst_INT8U Offset;
+  GuiConst_INT8U Sign;
+  GuiConst_INT8U ShowSign;
+  GuiConst_INT8U ZeroPadding;
+  GuiConst_INT8U TrailingZeros;
+  GuiConst_INT8U ThousandsSeparator;
+  GuiConst_INT8U Time;
+  GuiConst_INT16S TT1, TT2, TT3;
+  GuiConst_INT8U am;
+  GuiConst_INT8U DecimalsPos;
+#ifdef GuiConst_FLOAT_SUPPORT_ON
+  GuiConst_CHAR ExponentStr[5];
+#endif
+
+  sgl.VarNumTextStr[0] = 0;
+  am = 0;
+
+  Sign = 0;
+  switch (VarType)
+  {
+    case GuiLib_VAR_BOOL:
+    case GuiLib_VAR_UNSIGNED_CHAR:
+      if (DataValue > 255)
+        DataValue = 255;
+      else if (DataValue < 0)
+        DataValue = 0;
+      break;
+
+    case GuiLib_VAR_SIGNED_CHAR:
+      if (DataValue > 127)
+        DataValue = 127;
+      else if (DataValue < -128)
+        DataValue = -128;
+      if (DataValue < 0)
+        Sign = 1;
+      break;
+
+    case GuiLib_VAR_UNSIGNED_INT:
+      if (DataValue > 65535)
+        DataValue = 65535;
+      else if (DataValue < 0)
+        DataValue = 0;
+      break;
+
+    case GuiLib_VAR_SIGNED_INT:
+      if (DataValue > 32767)
+        DataValue = 32767;
+      else if (DataValue < -32768)
+        DataValue = -32768;
+      if (DataValue < 0)
+        Sign = 1;
+      break;
+
+    case GuiLib_VAR_SIGNED_LONG:
+    case GuiLib_VAR_FLOAT:
+    case GuiLib_VAR_DOUBLE:
+      if (DataValue < 0)
+        Sign = 1;
+      break;
+
+    case GuiLib_VAR_COLOR:
+      if (DataValue < 0)
+          DataValue = 0;
+#if GuiConst_PIXEL_BYTE_SIZE == 1
+      if (DataValue > 255)
+        DataValue = 255;
+#elif GuiConst_PIXEL_BYTE_SIZE == 2
+      if (DataValue > 65535)
+        DataValue = 65535;
+#elif GuiConst_PIXEL_BYTE_SIZE == 3
+      if (DataValue > 16777215)
+        DataValue = 16777215;
+#endif
+      break;
+  }
+
+  if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_DEC) ||
+      (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP))
+    DecimalsPos = sgl.CurItem.FormatDecimals;
+  else
+    DecimalsPos = 0;
+  Time = ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_MMSS) ||
+          (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMM_24) ||
+          (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_24) ||
+          (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMM_12_ampm) ||
+          (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_ampm) ||
+          (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMM_12_AMPM) ||
+          (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_AMPM));
+  if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_DEC) ||
+      (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP))
+    ShowSign = ((sgl.CurItem.TextPar[TextNdx].BitFlags &
+                 GuiLib_BITFLAG_FORMATSHOWSIGN) > 0);
+  else
+  {
+    Sign = 0;
+    ShowSign = 0;
+  }
+  if (sgl.CurItem.FormatAlignment == GuiLib_FORMAT_ALIGNMENT_RIGHT)
+    ZeroPadding = ((sgl.CurItem.TextPar[TextNdx].BitFlags &
+                    GuiLib_BITFLAG_FORMATZEROPADDING) > 0);
+  else
+    ZeroPadding = 0;
+  if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_DEC) ||
+      (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP))
+    TrailingZeros = ((sgl.CurItem.TextPar[TextNdx].BitFlags &
+                      GuiLib_BITFLAG_FORMATTRAILINGZEROS) > 0);
+  else
+    TrailingZeros = 0;
+  if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_DEC) ||
+      (sgl.CurItem.FormatFormat == GuiLib_FORMAT_HEX_POSTFIX_H) ||
+      (sgl.CurItem.FormatFormat == GuiLib_FORMAT_HEX_PREFIX_0X) ||
+      (sgl.CurItem.FormatFormat == GuiLib_FORMAT_HEX_CLEAN))
+    ThousandsSeparator = ((sgl.CurItem.TextPar[TextNdx].BitFlags &
+                           GuiLib_BITFLAG_FORMATTHOUSANDSSEP) > 0);
+  else
+    ThousandsSeparator = 0;
+
+  if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_DEC) ||
+      (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP))
+  {
+    if (Sign)
+      ConvertIntToStr(-DataValue, sgl.VarNumTextStr, 10);
+    else
+      ConvertIntToStr(DataValue, sgl.VarNumTextStr, 10);
+  }
+
+  else if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_HEX_POSTFIX_H) ||
+           (sgl.CurItem.FormatFormat == GuiLib_FORMAT_HEX_PREFIX_0X) ||
+           (sgl.CurItem.FormatFormat == GuiLib_FORMAT_HEX_CLEAN))
+  {
+    ConvertIntToStr(DataValue, sgl.VarNumTextStr, 16);
+    S1 = sgl.VarNumTextStr;
+    StrLen = 0;
+    while (*S1 != 0)
+    {
+      if ((*S1 >= 'a') && (*S1 <= 'f'))
+        *S1 -= 32;
+      S1++;
+      StrLen++;
+    }
+    if (DataValue < 0)
+    {
+      while ((StrLen > 1) && (StrLen >= sgl.CurItem.FormatFieldWidth))
+      {
+        if (sgl.VarNumTextStr[0] == 'F')
+        {
+          for (N = 0; N < StrLen; N++)
+            sgl.VarNumTextStr[N] = sgl.VarNumTextStr[N + 1];
+          sgl.VarNumTextStr[StrLen] = 0;
+          StrLen--;
+        }
+        else
+          break;
+      }
+
+    }
+    if (StrLen >= GuiConst_MAX_VARNUM_TEXT_LEN)
+      return (0);
+
+    switch (sgl.CurItem.FormatFormat)
+    {
+      case GuiLib_FORMAT_HEX_POSTFIX_H:
+        if (StrLen < GuiConst_MAX_VARNUM_TEXT_LEN - 1)
+        {
+          #ifdef GuiConst_CODEVISION_COMPILER
+          strcatf(sgl.VarNumTextStr, "h");
+          #else
+          strcat(sgl.VarNumTextStr, "h");
+          #endif
+        }
+        break;
+      case GuiLib_FORMAT_HEX_PREFIX_0X:
+        if (StrLen < GuiConst_MAX_VARNUM_TEXT_LEN - 2)
+        {
+          for (N = StrLen - 1; N >= 0; N--)
+            sgl.VarNumTextStr[N + 2] = sgl.VarNumTextStr[N];
+          sgl.VarNumTextStr[0] = '0';
+          sgl.VarNumTextStr[1] = 'x';
+        }
+        break;
+    }
+  }
+
+  else if (Time)
+  {
+    if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_24) ||
+        (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_ampm) ||
+        (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_AMPM))
+    {
+      DataValue %= 360000;
+      TT1 = DataValue / 3600;
+      TT2 = (DataValue % 3600) / 60;
+      TT3 = DataValue % 60;
+    }
+    else
+    {
+      DataValue %= 6000;
+      TT1 = DataValue / 60;
+      TT2 = DataValue % 60;
+      TT3 = -1;
+    }
+
+    if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMM_12_ampm) ||
+        (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_ampm) ||
+        (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMM_12_AMPM) ||
+        (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_AMPM))
+    {
+      am = ((TT1%24) < 12);
+      TT1 %= 12;
+      if (TT1 == 0)
+        TT1 = 12;
+    }
+    else
+      am = 0;   // To avoid compiler warning
+
+    if (ZeroPadding && (TT1 < 10))
+#ifdef GuiConst_CODEVISION_COMPILER
+      strcatf(sgl.VarNumTextStr, "0");
+#else
+      strcat(sgl.VarNumTextStr, "0");
+#endif
+    ConvertIntToStr(TT1, sgl.VarNumTextStr + strlen(sgl.VarNumTextStr), 10);
+
+#ifdef GuiConst_CODEVISION_COMPILER
+    strcatf(sgl.VarNumTextStr, ":");
+#else
+    strcat(sgl.VarNumTextStr, ":");
+#endif
+
+    if (TT2 < 10)
+#ifdef GuiConst_CODEVISION_COMPILER
+      strcatf(sgl.VarNumTextStr, "0");
+#else
+      strcat(sgl.VarNumTextStr, "0");
+#endif
+    ConvertIntToStr(TT2, sgl.VarNumTextStr + strlen(sgl.VarNumTextStr), 10);
+
+    if (TT3 >= 0)
+    {
+#ifdef GuiConst_CODEVISION_COMPILER
+      strcatf(sgl.VarNumTextStr, ":");
+#else
+      strcat(sgl.VarNumTextStr, ":");
+#endif
+
+      if (TT3 < 10)
+#ifdef GuiConst_CODEVISION_COMPILER
+        strcatf(sgl.VarNumTextStr, "0");
+#else
+        strcat(sgl.VarNumTextStr, "0");
+#endif
+      ConvertIntToStr(TT3, sgl.VarNumTextStr + strlen(sgl.VarNumTextStr), 10);
+    }
+
+    if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMM_12_ampm) ||
+        (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_ampm))
+    {
+      if (am)
+#ifdef GuiConst_CODEVISION_COMPILER
+        strcatf(sgl.VarNumTextStr, "am");
+#else
+        strcat(sgl.VarNumTextStr, "am");
+#endif
+      else
+#ifdef GuiConst_CODEVISION_COMPILER
+        strcatf(sgl.VarNumTextStr, "pm");
+#else
+        strcat(sgl.VarNumTextStr, "pm");
+#endif
+    }
+    else if ((sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMM_12_AMPM) ||
+             (sgl.CurItem.FormatFormat == GuiLib_FORMAT_TIME_HHMMSS_12_AMPM))
+    {
+      if (am)
+#ifdef GuiConst_CODEVISION_COMPILER
+        strcatf(sgl.VarNumTextStr, "AM");
+#else
+        strcat(sgl.VarNumTextStr, "AM");
+#endif
+      else
+#ifdef GuiConst_CODEVISION_COMPILER
+        strcatf(sgl.VarNumTextStr, "PM");
+#else
+        strcat(sgl.VarNumTextStr, "PM");
+#endif
+    }
+  }
+  else
+    return (0);
+
+  StrLen = 0;
+  S1 = sgl.VarNumTextStr;
+  while (*S1 != 0)
+  {
+    StrLen++;
+    S1++;
+  }
+
+  if (DecimalsPos > 0)
+  {
+    L = DecimalsPos + 1;
+    if (StrLen < L)
+    {
+      if (L > GuiConst_MAX_VARNUM_TEXT_LEN)
+        return (0);
+      for (N = 1; N <= StrLen; N++)
+        sgl.VarNumTextStr[L - N] = sgl.VarNumTextStr[StrLen - N];
+      for (N = 0; N < L - StrLen; N++)
+        sgl.VarNumTextStr[N] = '0';
+
+      StrLen = L;
+    }
+
+    if ((!TrailingZeros) && (!Time) && (VarType != GuiLib_VAR_BOOL))
+    {
+      L = StrLen;
+      for (N = L - 1; N > L - sgl.CurItem.FormatDecimals; N--)
+        if (sgl.VarNumTextStr[N] == '0')
+        {
+          DecimalsPos--;
+          StrLen--;
+        }
+        else
+          break;
+    }
+
+    if (StrLen >= GuiConst_MAX_VARNUM_TEXT_LEN)
+      return (0);
+    P = StrLen - DecimalsPos;
+    for (N = StrLen; N > P; N--)
+      sgl.VarNumTextStr[N] = sgl.VarNumTextStr[N - 1];
+    if (ReadByte(GuiFont_DecimalChar[GuiLib_LanguageIndex]) == GuiLib_DECIMAL_PERIOD)
+      sgl.VarNumTextStr[P] = '.';
+    else
+      sgl.VarNumTextStr[P] = ',';
+    StrLen++;
+    sgl.VarNumTextStr[StrLen] = 0;
+  }
+  else
+    P = StrLen;
+
+  if (ThousandsSeparator)
+  {
+    I = 0;
+    while (P > 0)
+    {
+      if ((I > 0) && (I % 3 ==0 ))
+      {
+        for (N = StrLen; N > P; N--)
+          sgl.VarNumTextStr[N] = sgl.VarNumTextStr[N - 1];
+        if (ReadByte(GuiFont_DecimalChar[GuiLib_LanguageIndex]) == GuiLib_DECIMAL_PERIOD)
+          sgl.VarNumTextStr[P] = ',';
+        else
+          sgl.VarNumTextStr[P] = '.';
+        StrLen++;
+        if (StrLen >= GuiConst_MAX_VARNUM_TEXT_LEN)
+          return (0);
+        sgl.VarNumTextStr[StrLen] = 0;
+      }
+      I++;
+      P--;
+    }
+  }
+
+  if (Sign || ShowSign)
+  {
+    if (StrLen > GuiConst_MAX_VARNUM_TEXT_LEN)
+      return (0);
+    for (N = StrLen; N >= 1; N--)
+      sgl.VarNumTextStr[N] = sgl.VarNumTextStr[N - 1];
+    if (Sign)
+      sgl.VarNumTextStr[0] = '-';
+    else
+      sgl.VarNumTextStr[0] = '+';
+    StrLen++;
+    sgl.VarNumTextStr[StrLen] = 0;
+  }
+
+#ifdef GuiConst_FLOAT_SUPPORT_ON
+  if (sgl.CurItem.FormatFormat == GuiLib_FORMAT_EXP)
+  {
+    N = sgl.VarExponent;
+    if (N < 0)
+      N = -N;
+    ConvertIntToStr(N, ExponentStr, 10);
+    S1 = ExponentStr;
+    N = 0;
+    while (*S1 != 0)
+    {
+      S1++;
+      N++;
+    }
+    if (N == 1)
+      I = 2;
+    else
+      I = N;
+    if (StrLen + 2 + I >= GuiConst_MAX_VARNUM_TEXT_LEN)
+      return (0);
+#ifdef GuiConst_CODEVISION_COMPILER
+    strcatf(sgl.VarNumTextStr, "E");
+#else
+    strcat(sgl.VarNumTextStr, "E");
+#endif
+    StrLen++;
+    if (sgl.VarExponent >= 0)
+#ifdef GuiConst_CODEVISION_COMPILER
+      strcatf(sgl.VarNumTextStr, "+");
+#else
+      strcat(sgl.VarNumTextStr, "+");
+#endif
+    else
+#ifdef GuiConst_CODEVISION_COMPILER
+      strcatf(sgl.VarNumTextStr, "-");
+#else
+      strcat(sgl.VarNumTextStr, "-");
+#endif
+    StrLen++;
+    if (N == 1)
+    {
+#ifdef GuiConst_CODEVISION_COMPILER
+      strcatf(sgl.VarNumTextStr, "0");
+#else
+      strcat(sgl.VarNumTextStr, "0");
+#endif
+      StrLen++;
+    }
+    strcat(sgl.VarNumTextStr, ExponentStr);
+    StrLen += N;
+  }
+#endif
+
+  if (sgl.CurItem.FormatFieldWidth > 0)
+  {
+    if (StrLen > sgl.CurItem.FormatFieldWidth)
+    {
+      for (N = 0; N < sgl.CurItem.FormatFieldWidth; N++)
+        sgl.VarNumTextStr[N] = '-';
+    }
+    else
+    {
+      if (sgl.CurItem.FormatFieldWidth > GuiConst_MAX_VARNUM_TEXT_LEN)
+        return (0);
+      if (ZeroPadding && (!Time))
+      {
+        if ((sgl.VarNumTextStr[0] == '-') || (sgl.VarNumTextStr[0] == '+'))
+          Offset = 1;
+        else
+          Offset = 0;
+        for (N = 1; N <= StrLen - Offset; N++)
+          sgl.VarNumTextStr[sgl.CurItem.FormatFieldWidth - N] =
+            sgl.VarNumTextStr[StrLen - N];
+        for (N = 0; N < sgl.CurItem.FormatFieldWidth - StrLen; N++)
+          sgl.VarNumTextStr[N + Offset] = '0';
+      }
+      else if (sgl.CurItem.FormatAlignment == GuiLib_FORMAT_ALIGNMENT_LEFT)
+      {
+        for (N = StrLen; N < sgl.CurItem.FormatFieldWidth; N++)
+          sgl.VarNumTextStr[N] = ' ';
+      }
+      else if (sgl.CurItem.FormatAlignment == GuiLib_FORMAT_ALIGNMENT_CENTER)
+      {
+        Offset = (sgl.CurItem.FormatFieldWidth - StrLen) / 2;
+        if (Offset > 0)
+        {
+          for (N = StrLen - 1; N >= 0; N--)
+            sgl.VarNumTextStr[N + Offset] = sgl.VarNumTextStr[N];
+          for (N = 0; N < Offset; N++)
+            sgl.VarNumTextStr[N] = ' ';
+        }
+        Offset = sgl.CurItem.FormatFieldWidth - StrLen - Offset;
+        if (Offset > 0)
+          for (N = sgl.CurItem.FormatFieldWidth - Offset;
+               N < sgl.CurItem.FormatFieldWidth; N++)
+            sgl.VarNumTextStr[N] = ' ';
+      }
+      else if (sgl.CurItem.FormatAlignment == GuiLib_FORMAT_ALIGNMENT_RIGHT)
+      {
+        for (N = 1; N <= StrLen; N++)
+          sgl.VarNumTextStr[sgl.CurItem.FormatFieldWidth - N] =
+            sgl.VarNumTextStr[StrLen - N];
+        for (N = 0; N < sgl.CurItem.FormatFieldWidth - StrLen; N++)
+          sgl.VarNumTextStr[N] = ' ';
+      }
+    }
+    sgl.VarNumTextStr[sgl.CurItem.FormatFieldWidth] = 0;
+    return (sgl.CurItem.FormatFieldWidth);
+  }
+  else
+  {
+    sgl.VarNumTextStr[StrLen] = 0;
+    return (StrLen);
+  }
+}
+
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+//------------------------------------------------------------------------------
+static GuiLib_StructPtr GetRemoteStructData(
+   GuiConst_INT32S StructIndex)
+{
+  sgl.RemoteStructOffset =
+     (GuiConst_INT32U PrefixRom)GuiStruct_StructPtrList[StructIndex];
+  GuiLib_RemoteDataReadBlock(
+     sgl.RemoteStructOffset,
+     1,
+     sgl.GuiLib_RemoteStructBuffer);
+  sgl.RemoteStructOffset++;
+  return((GuiLib_StructPtr)&sgl.GuiLib_RemoteStructBuffer[0]);
+}
+
+#ifdef GuiConst_REMOTE_TEXT_DATA
+//------------------------------------------------------------------------------
+static GuiConst_INT16U GetRemoteText(
+   GuiConst_INT16U TextIndex)
+{
+  GuiConst_INT32S TextOfs;
+
+  if (TextIndex != sgl.CurRemoteText)
+  {
+    if (sgl.RemoteTextTableOfs == -1)
+      GuiLib_RemoteTextReadBlock(4, 4, &sgl.RemoteTextTableOfs);
+
+    GuiLib_RemoteTextReadBlock(sgl.RemoteTextTableOfs + 6 * TextIndex, 4, &TextOfs);
+    GuiLib_RemoteTextReadBlock(
+       sgl.RemoteTextTableOfs + 6 * TextIndex + 4, 2, &sgl.RemoteTextLen);
+
+#ifdef GuiConst_CHARMODE_ANSI
+    GuiLib_RemoteTextReadBlock(TextOfs, sgl.RemoteTextLen, sgl.GuiLib_RemoteTextBuffer);
+#else
+    GuiLib_RemoteTextReadBlock(TextOfs, 2 * sgl.RemoteTextLen, sgl.GuiLib_RemoteTextBuffer);
+#endif
+    sgl.CurRemoteText = TextIndex;
+  }
+  return(sgl.RemoteTextLen);
+}
+#endif
+
+#endif
+
+#ifdef GuiConst_CHARMODE_UNICODE
+//------------------------------------------------------------------------------
+static void ExtractUnicodeString(
+   GuiConst_INT8U PrefixLocate *ItemTextPtr,
+   GuiConst_INT16U TextLength)
+{
+  GuiConst_INT16U P;
+
+  for (P = 0; P < TextLength; P++)
+    sgl.UnicodeTextBuf[P] = GetItemWord(&ItemTextPtr);
+  sgl.UnicodeTextBuf[TextLength] = 0;
+}
+#endif
+
+//------------------------------------------------------------------------------
+static void SetCurFont(
+   GuiConst_INT8U FontIndex)
+{
+  if (FontIndex >= GuiFont_FontCnt)
+    sgl.CurFont = (GuiLib_FontRecPtr)ReadWord(GuiFont_FontList[0]);
+  else
+    sgl.CurFont = (GuiLib_FontRecPtr)ReadWord(GuiFont_FontList[FontIndex]);
+}
+
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+//------------------------------------------------------------------------------
+static void UpdateBackgroundBitmap(void)
+{
+  GuiConst_INT8U BackgroundOn;
+  GuiConst_INT16U BackgroundX1, BackgroundY1, BackgroundX2, BackgroundY2;
+  GuiConst_INT16S N;
+
+  for (N = 0; N < GuiConst_MAX_BACKGROUND_BITMAPS; N++)
+    if (sgl.BackgrBitmapAry[N].InUse)
+    {
+      BackgroundOn = 0;
+      switch (sgl.CurItem.ItemType)
+      {
+        case GuiLib_ITEM_TEXT:
+        case GuiLib_ITEM_VAR:
+          BackgroundOn = 1;
+          if (sgl.CurItem.TextPar[0].BackBoxSizeX == 0)
+          {
+            BackgroundX1 = sgl.CurItem.DrawnX1;
+            BackgroundY1 = sgl.CurItem.DrawnY1;
+            BackgroundX2 = sgl.CurItem.DrawnX2;
+            BackgroundY2 = sgl.CurItem.DrawnY2;
+          }
+          else
+          {
+            SetCurFont(sgl.CurItem.TextPar[0].FontIndex);
+            SetBackBox(0);
+            BackgroundX1 = sgl.BbX1;
+            BackgroundY1 = sgl.BbY1;
+            BackgroundX2 = sgl.BbX2;
+            BackgroundY2 = sgl.BbY2;
+          }
+          break;
+
+        case GuiLib_ITEM_STRUCTURE:
+        case GuiLib_ITEM_STRUCTARRAY:
+        case GuiLib_ITEM_STRUCTCOND:
+          if (sgl.CurItem.Drawn)
+          {
+            BackgroundOn = 1;
+            BackgroundX1 = sgl.CurItem.DrawnX1;
+            BackgroundY1 = sgl.CurItem.DrawnY1;
+            BackgroundX2 = sgl.CurItem.DrawnX2;
+            BackgroundY2 = sgl.CurItem.DrawnY2;
+          }
+          break;
+
+        case GuiLib_ITEM_TEXTBLOCK:
+        case GuiLib_ITEM_VARBLOCK:
+        case GuiLib_ITEM_CHECKBOX:
+        case GuiLib_ITEM_BUTTON:
+        case GuiLib_ITEM_EDITBOX:
+        case GuiLib_ITEM_PANEL:
+        case GuiLib_ITEM_MEMO:
+        case GuiLib_ITEM_LISTBOX:
+        case GuiLib_ITEM_COMBOBOX:
+        case GuiLib_ITEM_SCROLLBOX:
+        case GuiLib_ITEM_SCROLLAREA:
+        case GuiLib_ITEM_PROGRESSBAR:
+          if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_TRANSPARENT)
+          {
+            BackgroundOn = 1;
+            SetBackColorBox(sgl.CurItem.X1, sgl.CurItem.Y1,
+                            sgl.CurItem.X2, sgl.CurItem.Y2,
+                            0);
+            BackgroundX1 = sgl.BbX1;
+            BackgroundY1 = sgl.BbY1;
+            BackgroundX2 = sgl.BbX2;
+            BackgroundY2 = sgl.BbY2;
+          }
+          break;
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+        case GuiLib_ITEM_RADIOBUTTON:
+          if (sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_TRANSPARENT)
+          {
+            BackgroundOn = 1;
+            SetBackColorBox(sgl.CurItem.X1,
+                            sgl.CurItem.Y1,
+                            sgl.CurItem.X2,
+                            sgl.CurItem.Y2 +
+                              (sgl.CurItem.CompPars.CompRadioButton.Count - 1) *
+                               sgl.CurItem.CompPars.CompRadioButton.InterDistance,
+                            0);
+            BackgroundX1 = sgl.BbX1;
+            BackgroundY1 = sgl.BbY1;
+            BackgroundX2 = sgl.BbX2;
+            BackgroundY2 = sgl.BbY2;
+          }
+          break;
+#endif
+      }
+      if (BackgroundOn)
+        GuiLib_ShowBitmapArea(sgl.BackgrBitmapAry[N].Index,
+           sgl.BackgrBitmapAry[N].X, sgl.BackgrBitmapAry[N].Y,
+           BackgroundX1, BackgroundY1, BackgroundX2, BackgroundY2, -1);
+    }
+}
+#endif
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+//------------------------------------------------------------------------------
+static void StartClipping(
+   GuiConst_INT8U Clipping)
+{
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+  sgl.CurItem.ClipRectX1 += sgl.CoordOrigoX;
+  sgl.CurItem.ClipRectY1 += sgl.CoordOrigoY;
+  sgl.CurItem.ClipRectX2 += sgl.CoordOrigoX;
+  sgl.CurItem.ClipRectY2 += sgl.CoordOrigoY;
+#endif
+  if (Clipping)
+  {
+    OrderCoord(&sgl.CurItem.ClipRectX1, &sgl.CurItem.ClipRectX2);
+    OrderCoord(&sgl.CurItem.ClipRectY1, &sgl.CurItem.ClipRectY2);
+    if (sgl.CurItem.ClipRectX1 < sgl.ActiveAreaX1)
+      sgl.CurItem.ClipRectX1 = sgl.ActiveAreaX1;
+    if (sgl.CurItem.ClipRectY1 < sgl.ActiveAreaY1)
+      sgl.CurItem.ClipRectY1 = sgl.ActiveAreaY1;
+    if (sgl.CurItem.ClipRectX2 > sgl.ActiveAreaX2)
+      sgl.CurItem.ClipRectX2 = sgl.ActiveAreaX2;
+    if (sgl.CurItem.ClipRectY2 > sgl.ActiveAreaY2)
+      sgl.CurItem.ClipRectY2 = sgl.ActiveAreaY2;
+  }
+  else
+  {
+    sgl.CurItem.ClipRectX1 = sgl.ActiveAreaX1;
+    sgl.CurItem.ClipRectY1 = sgl.ActiveAreaY1;
+    sgl.CurItem.ClipRectX2 = sgl.ActiveAreaX2;
+    sgl.CurItem.ClipRectY2 = sgl.ActiveAreaY2;
+  }
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+  sgl.CurItem.ClipRectX1 -= sgl.CoordOrigoX;
+  sgl.CurItem.ClipRectY1 -= sgl.CoordOrigoY;
+  sgl.CurItem.ClipRectX2 -= sgl.CoordOrigoX;
+  sgl.CurItem.ClipRectY2 -= sgl.CoordOrigoY;
+#endif
+  GuiLib_SetClipping(sgl.CurItem.ClipRectX1, sgl.CurItem.ClipRectY1,
+                     sgl.CurItem.ClipRectX2, sgl.CurItem.ClipRectY2);
+}
+#endif
+
+//------------------------------------------------------------------------------
+static void PrepareInternalStruct(void)
+{
+  sgl.Memory.X[GuiLib_MEMORY_CNT] = sgl.CurItem.X1;
+  sgl.Memory.Y[GuiLib_MEMORY_CNT] = sgl.CurItem.Y1;
+}
+
+//------------------------------------------------------------------------------
+static void DrawSubStruct(
+   GuiConst_INT16U SubStructIndex,
+   GuiConst_INT8U ColorInvert,
+   GuiConst_INT8U SubInt)
+{
+  GuiLib_ItemRec RemCurItem;
+  GuiLib_StructPtr StructToCall;
+  GuiConst_INT8U RemBackBox;
+  GuiConst_INT16S RemBbX1, RemBbX2;
+  GuiConst_INT16S RemBbY1, RemBbY2;
+  GuiConst_INT8U RemDrawn;
+  GuiConst_INT16S RemDrawnX1, RemDrawnY1, RemDrawnX2, RemDrawnY2;
+  GuiConst_INT16S RemAutoRedrawSaveIndex;
+  GuiConst_INT16S RemAutoRedrawParent;
+  GuiConst_INT16S RemAutoRedrawLatest;
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  GuiConst_INT32U RemRemoteStructOffset;
+#endif
+
+  if (SubStructIndex != 0xFFFF)
+  {
+    RemAutoRedrawParent = sgl.AutoRedrawParent;
+    RemAutoRedrawLatest = sgl.AutoRedrawLatest;
+
+    sgl.AutoRedrawParent = sgl.AutoRedrawLatest;
+
+    if (SubInt)
+      memcpy(&RemCurItem, &sgl.CurItem, sizeof(GuiLib_ItemRec));
+
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+    RemRemoteStructOffset = sgl.RemoteStructOffset;
+#endif
+    RemBackBox = (sgl.CurItem.TextPar[0].BackBoxSizeX);
+    RemBbX1 = sgl.BbX1;
+    RemBbX2 = sgl.BbX2;
+    RemBbY1 = sgl.BbY1;
+    RemBbY2 = sgl.BbY2;
+    RemDrawn = gl.Drawn;
+    RemDrawnX1 = gl.DrawnX1;
+    RemDrawnY1 = gl.DrawnY1;
+    RemDrawnX2 = gl.DrawnX2;
+    RemDrawnY2 = gl.DrawnY2;
+    ResetDrawLimits();
+    RemAutoRedrawSaveIndex = sgl.AutoRedrawSaveIndex;
+
+    sgl.DisplayLevel++;
+    StructToCall =
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+       GetRemoteStructData(SubStructIndex);
+#else
+       (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[SubStructIndex]);
+#endif
+    DrawStructure(StructToCall, ColorInvert);
+    sgl.DisplayLevel--;
+
+    if (RemBackBox)
+    {
+      sgl.CurItem.Drawn = 1;
+      sgl.CurItem.DrawnX1 = RemBbX1;
+      sgl.CurItem.DrawnY1 = RemBbY1;
+      sgl.CurItem.DrawnX2 = RemBbX2;
+      sgl.CurItem.DrawnY2 = RemBbY2;
+
+      gl.DrawnX1 = GuiLib_GET_MIN(sgl.BbX1, RemDrawnX1);
+      gl.DrawnY1 = GuiLib_GET_MIN(sgl.BbY1, RemDrawnY1);
+      gl.DrawnX2 = GuiLib_GET_MAX(sgl.BbX2, RemDrawnX2);
+      gl.DrawnY2 = GuiLib_GET_MAX(sgl.BbY2, RemDrawnY2);
+    }
+    else if (gl.Drawn)
+    {
+      sgl.CurItem.Drawn = 1;
+      sgl.CurItem.DrawnX1 = gl.DrawnX1;
+      sgl.CurItem.DrawnY1 = gl.DrawnY1;
+      sgl.CurItem.DrawnX2 = gl.DrawnX2;
+      sgl.CurItem.DrawnY2 = gl.DrawnY2;
+
+      gl.DrawnX1 = GuiLib_GET_MIN(gl.DrawnX1, RemDrawnX1);
+      gl.DrawnY1 = GuiLib_GET_MIN(gl.DrawnY1, RemDrawnY1);
+      gl.DrawnX2 = GuiLib_GET_MAX(gl.DrawnX2, RemDrawnX2);
+      gl.DrawnY2 = GuiLib_GET_MAX(gl.DrawnY2, RemDrawnY2);
+    }
+    else
+    {
+      gl.Drawn = RemDrawn;
+      gl.DrawnX1 = RemDrawnX1;
+      gl.DrawnY1 = RemDrawnY1;
+      gl.DrawnX2 = RemDrawnX2;
+      gl.DrawnY2 = RemDrawnY2;
+    }
+    sgl.AutoRedrawSaveIndex = RemAutoRedrawSaveIndex;
+
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+    sgl.RemoteStructOffset = RemRemoteStructOffset;
+#endif
+
+    if (SubInt)
+      memcpy(&sgl.CurItem, &RemCurItem, sizeof(GuiLib_ItemRec));
+
+    sgl.AutoRedrawLatest = RemAutoRedrawLatest;
+    sgl.AutoRedrawParent = RemAutoRedrawParent;
+  }
+}
+
+#include "GuiItems.h"
+
+//------------------------------------------------------------------------------
+static void DrawStructure(
+   GuiLib_StructPtr Structure,
+   GuiConst_INT8U ColorInvert) PrefixReentrant
+{
+  GuiConst_INT16S ItemNdx;
+  GuiConst_INT16S X, RemAutoRedrawLatest;
+  void PrefixLocate *XVarPtr;
+  void PrefixLocate *YVarPtr;
+  GuiConst_INT8U ItemCnt;
+  GuiConst_INT8U PrefixLocate *LocalItemDataPtr;
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  GuiConst_INT16S I;
+#endif
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  GuiConst_INT8U ItemSizeBuf[2];
+  GuiConst_INT16U ItemSize;
+#endif
+
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  LocalItemDataPtr = sgl.GuiLib_RemoteStructBuffer;
+#else
+  LocalItemDataPtr = (GuiConst_INT8U PrefixLocate *)Structure;
+#endif
+  ItemCnt = GetItemByte(&LocalItemDataPtr);
+
+  for (ItemNdx = 0; ItemNdx < ItemCnt; ItemNdx++)
+  {
+    RemAutoRedrawLatest = sgl.AutoRedrawLatest;
+
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+    GuiLib_RemoteDataReadBlock(
+       sgl.RemoteStructOffset,
+       2,
+       (GuiConst_INT8U*)&ItemSizeBuf);
+    ItemSize = (256 * (GuiConst_INT16U)ItemSizeBuf[1]) + ItemSizeBuf[0];
+    sgl.RemoteStructOffset += 2;
+    GuiLib_RemoteDataReadBlock(
+       sgl.RemoteStructOffset,
+       ItemSize,
+       sgl.GuiLib_RemoteItemBuffer);
+    sgl.RemoteStructOffset += ItemSize;
+    LocalItemDataPtr = &sgl.GuiLib_RemoteItemBuffer[0];
+#endif
+
+    sgl.ItemDataPtr = LocalItemDataPtr;
+    ReadItem(GuiLib_LanguageIndex);
+    LocalItemDataPtr = sgl.ItemDataPtr;
+
+    if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CLEARAREA +
+                             GuiLib_ITEMBIT_TEXT +
+                             GuiLib_ITEMBIT_TEXTBLOCK +
+                             GuiLib_ITEMBIT_DOT +
+                             GuiLib_ITEMBIT_LINE +
+                             GuiLib_ITEMBIT_FRAME +
+                             GuiLib_ITEMBIT_BLOCK +
+                             GuiLib_ITEMBIT_CIRCLE +
+                             GuiLib_ITEMBIT_ELLIPSE +
+                             GuiLib_ITEMBIT_BITMAP +
+                             GuiLib_ITEMBIT_BACKGROUND +
+                             GuiLib_ITEMBIT_STRUCTURE +
+                             GuiLib_ITEMBIT_STRUCTARRAY +
+                             GuiLib_ITEMBIT_ACTIVEAREA +
+                             GuiLib_ITEMBIT_CLIPRECT +
+                             GuiLib_ITEMBIT_VAR +
+                             GuiLib_ITEMBIT_VARBLOCK +
+                             GuiLib_ITEMBIT_TOUCHAREA +
+                             GuiLib_ITEMBIT_SCROLLBOX +
+                             GuiLib_ITEMBIT_GRAPH +
+                             GuiLib_ITEMBIT_GRAPHICSLAYER)) ||
+        (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                             GuiLib_ITEMBIT_ROUNDEDBLOCK +
+                             GuiLib_ITEMBIT_QUARTERCIRCLE +
+                             GuiLib_ITEMBIT_QUARTERELLIPSE +
+                             GuiLib_ITEMBIT_CHECKBOX +
+                             GuiLib_ITEMBIT_RADIOBUTTON +
+                             GuiLib_ITEMBIT_BUTTON +
+                             GuiLib_ITEMBIT_EDITBOX +
+                             GuiLib_ITEMBIT_PANEL +
+                             GuiLib_ITEMBIT_MEMO +
+                             GuiLib_ITEMBIT_LISTBOX +
+                             GuiLib_ITEMBIT_COMBOBOX +
+                             GuiLib_ITEMBIT_SCROLLAREA +
+                             GuiLib_ITEMBIT_PROGRESSBAR +
+                             GuiLib_ITEMBIT_STRUCTCOND +
+                             GuiLib_ITEMBIT_POSCALLBACK)))
+    {
+      if (sgl.CommonByte2 & 0x10)
+      {
+        XVarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[sgl.X1VarIdx]);
+        sgl.X1VarType = ReadByte(GuiStruct_VarTypeList[sgl.X1VarIdx]);
+      }
+      else
+        XVarPtr = 0;
+      if (XVarPtr != 0)
+        sgl.ItemX1 += ReadVar(XVarPtr, sgl.X1VarType);
+      if (sgl.X1MemoryRead > 0)
+        sgl.ItemX1 += sgl.Memory.X[sgl.X1MemoryRead - 1];
+      if (sgl.X1Mode == GuiLib_COOR_REL)
+        sgl.ItemX1 += sgl.CurItem.RX;
+      else if (sgl.X1Mode == GuiLib_COOR_REL_1)
+        sgl.ItemX1 += sgl.CurItem.RX1;
+      else if (sgl.X1Mode == GuiLib_COOR_REL_2)
+        sgl.ItemX1 += sgl.CurItem.RX2;
+      if (sgl.X1MemoryWrite > 0)
+        sgl.Memory.X[sgl.X1MemoryWrite - 1] = sgl.ItemX1;
+      sgl.CurItem.X1 = sgl.ItemX1;
+
+      if (sgl.CommonByte2 & 0x20)
+      {
+        YVarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[sgl.Y1VarIdx]);
+        sgl.Y1VarType = ReadByte(GuiStruct_VarTypeList[sgl.Y1VarIdx]);
+      }
+      else
+        YVarPtr = 0;
+      if (YVarPtr != 0)
+        sgl.ItemY1 += ReadVar(YVarPtr, sgl.Y1VarType);
+      if (sgl.Y1MemoryRead > 0)
+        sgl.ItemY1 += sgl.Memory.Y[sgl.Y1MemoryRead - 1];
+      if (sgl.Y1Mode == GuiLib_COOR_REL)
+        sgl.ItemY1 += sgl.CurItem.RY;
+      else if (sgl.Y1Mode == GuiLib_COOR_REL_1)
+        sgl.ItemY1 += sgl.CurItem.RY1;
+      else if (sgl.Y1Mode == GuiLib_COOR_REL_2)
+        sgl.ItemY1 += sgl.CurItem.RY2;
+      if (sgl.Y1MemoryWrite > 0)
+        sgl.Memory.Y[sgl.Y1MemoryWrite - 1] = sgl.ItemY1;
+      sgl.CurItem.Y1 = sgl.ItemY1;
+
+      sgl.CurItem.RX = sgl.CurItem.X1;
+      sgl.CurItem.RY = sgl.CurItem.Y1;
+    }
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+    if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_SCROLLBOX)
+    {
+      sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].X1 = sgl.CurItem.X1;
+      sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].Y1 = sgl.CurItem.Y1;
+      sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].BackColor = sgl.CurItem.BackColor;
+
+#ifndef GuiConst_SCROLLITEM_BAR_NONE
+      if ((sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].BarMode & 0x03) ==
+         GuiLib_COOR_REL)
+        sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].BarPositionX += sgl.CurItem.X1;
+      if (((sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].BarMode >> 2) & 0x03) ==
+         GuiLib_COOR_REL)
+        sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].BarPositionY += sgl.CurItem.Y1;
+#endif
+#ifndef GuiConst_SCROLLITEM_INDICATOR_NONE
+      if ((sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].IndicatorMode & 0x03) ==
+         GuiLib_COOR_REL)
+        sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].IndicatorPositionX += sgl.CurItem.X1;
+      if (((sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].IndicatorMode >> 2) & 0x03) ==
+         GuiLib_COOR_REL)
+        sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].IndicatorPositionY += sgl.CurItem.Y1;
+#endif
+    }
+#endif
+
+    if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CLEARAREA +
+                             GuiLib_ITEMBIT_TEXTBLOCK +
+                             GuiLib_ITEMBIT_VARBLOCK +
+                             GuiLib_ITEMBIT_LINE +
+                             GuiLib_ITEMBIT_FRAME +
+                             GuiLib_ITEMBIT_BLOCK +
+                             GuiLib_ITEMBIT_BITMAP +
+                             GuiLib_ITEMBIT_BACKGROUND +
+                             GuiLib_ITEMBIT_ACTIVEAREA +
+                             GuiLib_ITEMBIT_CLIPRECT +
+                             GuiLib_ITEMBIT_TOUCHAREA +
+                             GuiLib_ITEMBIT_GRAPH +
+                             GuiLib_ITEMBIT_GRAPHICSLAYER)) ||
+        (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                             GuiLib_ITEMBIT_ROUNDEDBLOCK +
+                             GuiLib_ITEMBIT_BUTTON +
+                             GuiLib_ITEMBIT_EDITBOX +
+                             GuiLib_ITEMBIT_PANEL +
+                             GuiLib_ITEMBIT_MEMO +
+                             GuiLib_ITEMBIT_LISTBOX +
+                             GuiLib_ITEMBIT_COMBOBOX +
+                             GuiLib_ITEMBIT_SCROLLAREA +
+                             GuiLib_ITEMBIT_PROGRESSBAR)))
+    {
+      if (sgl.CommonByte2 & 0x40)
+      {
+        XVarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[sgl.X2VarIdx]);
+        sgl.X2VarType = ReadByte(GuiStruct_VarTypeList[sgl.X2VarIdx]);
+      }
+      else
+        XVarPtr = 0;
+      if (XVarPtr != 0)
+        sgl.ItemX2 += ReadVar(XVarPtr, sgl.X2VarType);
+      if (sgl.X2MemoryRead > 0)
+        sgl.ItemX2 += sgl.Memory.X[sgl.X2MemoryRead - 1];
+      if (sgl.X2Mode == GuiLib_COOR_REL)
+        sgl.ItemX2 += sgl.CurItem.X1;
+      else if (sgl.X2Mode == GuiLib_COOR_REL_1)
+        sgl.ItemX2 += sgl.CurItem.RX1;
+      else if (sgl.X2Mode == GuiLib_COOR_REL_2)
+        sgl.ItemX2 += sgl.CurItem.RX2;
+      if (sgl.X2MemoryWrite > 0)
+        sgl.Memory.X[sgl.X2MemoryWrite - 1] = sgl.ItemX2;
+      sgl.CurItem.X2 = sgl.ItemX2;
+
+      if (sgl.CommonByte2 & 0x80)
+      {
+        YVarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[sgl.Y2VarIdx]);
+        sgl.Y2VarType = ReadByte(GuiStruct_VarTypeList[sgl.Y2VarIdx]);
+      }
+      else
+        YVarPtr = 0;
+      if (YVarPtr != 0)
+        sgl.ItemY2 += ReadVar(YVarPtr, sgl.Y2VarType);
+      if (sgl.Y2MemoryRead > 0)
+        sgl.ItemY2 += sgl.Memory.Y[sgl.Y2MemoryRead - 1];
+      if (sgl.Y2Mode == GuiLib_COOR_REL)
+        sgl.ItemY2 += sgl.CurItem.Y1;
+      else if (sgl.Y2Mode == GuiLib_COOR_REL_1)
+        sgl.ItemY2 += sgl.CurItem.RY1;
+      else if (sgl.Y2Mode == GuiLib_COOR_REL_2)
+        sgl.ItemY2 += sgl.CurItem.RY2;
+      if (sgl.Y2MemoryWrite > 0)
+        sgl.Memory.Y[sgl.Y2MemoryWrite - 1] = sgl.ItemY2;
+      sgl.CurItem.Y2 = sgl.ItemY2;
+    }
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+    else if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_CHECKBOX)
+    {
+      switch (sgl.CurItem.CompPars.CompCheckBox.Style)
+      {
+        case GuiLib_CHECKBOX_FLAT:
+        case GuiLib_CHECKBOX_3D:
+        case GuiLib_CHECKBOX_NONE:
+          sgl.CurItem.X2 = sgl.CurItem.X1 +
+                           sgl.CurItem.CompPars.CompCheckBox.Size - 1;
+          sgl.CurItem.Y2 = sgl.CurItem.Y1 +
+                           sgl.CurItem.CompPars.CompCheckBox.Size - 1;
+          break;
+        case GuiLib_CHECKBOX_ICON:
+          sgl.CurItem.X2 = sgl.CurItem.X1;
+          sgl.CurItem.Y2 = sgl.CurItem.Y1;
+          break;
+        case GuiLib_CHECKBOX_BITMAP:
+          sgl.CurItem.X2 = sgl.CurItem.X1;
+          sgl.CurItem.Y2 = sgl.CurItem.Y1;
+          break;
+      }
+    }
+#endif
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+    else if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_RADIOBUTTON)
+    {
+      switch (sgl.CurItem.CompPars.CompRadioButton.Style)
+      {
+        case GuiLib_RADIOBUTTON_FLAT:
+        case GuiLib_RADIOBUTTON_3D:
+          sgl.CurItem.X2 = sgl.CurItem.X1 +
+                           2 * sgl.CurItem.CompPars.CompRadioButton.Size;
+          sgl.CurItem.Y2 = sgl.CurItem.Y1 +
+                           2 * sgl.CurItem.CompPars.CompRadioButton.Size;
+          break;
+        case GuiLib_RADIOBUTTON_ICON:
+          sgl.CurItem.X2 = sgl.CurItem.X1;
+          sgl.CurItem.Y2 = sgl.CurItem.Y1;
+          break;
+        case GuiLib_RADIOBUTTON_BITMAP:
+          sgl.CurItem.X2 = sgl.CurItem.X1;
+          sgl.CurItem.Y2 = sgl.CurItem.Y1;
+          break;
+      }
+    }
+#endif
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+    else if (sgl.ItemTypeBit2 & GuiLib_ITEMBIT_BUTTON)
+    {
+      sgl.CurItem.X2 = sgl.CurItem.X1;
+      sgl.CurItem.Y2 = sgl.CurItem.Y1;
+    }
+#endif
+
+    if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CIRCLE +
+                             GuiLib_ITEMBIT_ELLIPSE)) ||
+        (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                             GuiLib_ITEMBIT_ROUNDEDBLOCK +
+                             GuiLib_ITEMBIT_QUARTERCIRCLE +
+                             GuiLib_ITEMBIT_QUARTERELLIPSE +
+                             GuiLib_ITEMBIT_BUTTON +
+                             GuiLib_ITEMBIT_PANEL)))
+    {
+      if (sgl.CommonByte6 & 0x40)
+      {
+        XVarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[sgl.R1VarIdx]);
+        sgl.R1VarType = ReadByte(GuiStruct_VarTypeList[sgl.R1VarIdx]);
+      }
+      else
+        XVarPtr = 0;
+      if (XVarPtr != 0)
+        sgl.ItemR1 += ReadVar(XVarPtr, sgl.R1VarType);
+      if (sgl.R1MemoryRead > 0)
+        sgl.ItemR1 += sgl.Memory.X[sgl.R1MemoryRead - 1];
+      if (sgl.R1Mode == GuiLib_COOR_REL)
+        sgl.ItemR1 += sgl.CurItem.X1;
+      else if (sgl.R1Mode == GuiLib_COOR_REL_1)
+        sgl.ItemR1 += sgl.CurItem.RX1;
+      else if (sgl.R1Mode == GuiLib_COOR_REL_2)
+        sgl.ItemR1 += sgl.CurItem.RX2;
+      if (sgl.R1MemoryWrite > 0)
+        sgl.Memory.X[sgl.R1MemoryWrite - 1] = sgl.ItemR1;
+      sgl.CurItem.R1 = sgl.ItemR1;
+    }
+
+    if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_ELLIPSE)) ||
+        (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_QUARTERELLIPSE)))
+    {
+      if (sgl.CommonByte6 & 0x80)
+      {
+        YVarPtr = (void PrefixLocate *)ReadWord(GuiStruct_VarPtrList[sgl.R2VarIdx]);
+        sgl.R2VarType = ReadByte(GuiStruct_VarTypeList[sgl.R2VarIdx]);
+      }
+      else
+        YVarPtr = 0;
+      if (YVarPtr != 0)
+        sgl.ItemR2 += ReadVar(YVarPtr, sgl.R2VarType);
+      if (sgl.R2MemoryRead > 0)
+        sgl.ItemR2 += sgl.Memory.Y[sgl.R2MemoryRead - 1];
+      if (sgl.R2Mode == GuiLib_COOR_REL)
+        sgl.ItemR2 += sgl.CurItem.Y1;
+      else if (sgl.R2Mode == GuiLib_COOR_REL_1)
+        sgl.ItemR2 += sgl.CurItem.RY1;
+      else if (sgl.R2Mode == GuiLib_COOR_REL_2)
+        sgl.ItemR2 += sgl.CurItem.RY2;
+      if (sgl.R2MemoryWrite > 0)
+        sgl.Memory.Y[sgl.R2MemoryWrite - 1] = sgl.ItemR2;
+      sgl.CurItem.R2 = sgl.ItemR2;
+    }
+
+    if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CLEARAREA +
+                             GuiLib_ITEMBIT_TEXTBLOCK +
+                             GuiLib_ITEMBIT_VARBLOCK +
+                             GuiLib_ITEMBIT_LINE +
+                             GuiLib_ITEMBIT_FRAME +
+                             GuiLib_ITEMBIT_BLOCK +
+                             GuiLib_ITEMBIT_BITMAP +
+                             GuiLib_ITEMBIT_BACKGROUND +
+                             GuiLib_ITEMBIT_ACTIVEAREA +
+                             GuiLib_ITEMBIT_CLIPRECT +
+                             GuiLib_ITEMBIT_TOUCHAREA +
+                             GuiLib_ITEMBIT_GRAPH +
+                             GuiLib_ITEMBIT_GRAPHICSLAYER)) ||
+        (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_ROUNDEDFRAME +
+                             GuiLib_ITEMBIT_ROUNDEDBLOCK +
+                             GuiLib_ITEMBIT_CHECKBOX +
+                             GuiLib_ITEMBIT_RADIOBUTTON +
+                             GuiLib_ITEMBIT_BUTTON +
+                             GuiLib_ITEMBIT_EDITBOX +
+                             GuiLib_ITEMBIT_PANEL +
+                             GuiLib_ITEMBIT_MEMO +
+                             GuiLib_ITEMBIT_LISTBOX +
+                             GuiLib_ITEMBIT_COMBOBOX +
+                             GuiLib_ITEMBIT_SCROLLAREA +
+                             GuiLib_ITEMBIT_PROGRESSBAR)))
+    {
+      X = sgl.CurItem.X2 - sgl.CurItem.X1;
+      if (sgl.CurItem.TextPar[0].Alignment == GuiLib_ALIGN_CENTER)
+      {
+        sgl.CurItem.X1 -= X / 2;
+        sgl.CurItem.X2 -= X / 2;
+      }
+      else if (sgl.CurItem.TextPar[0].Alignment == GuiLib_ALIGN_RIGHT)
+      {
+        sgl.CurItem.X1 -= X;
+        sgl.CurItem.X2 -= X;
+      }
+    }
+    else if ((sgl.ItemTypeBit1 & (GuiLib_ITEMBIT_CIRCLE +
+                                  GuiLib_ITEMBIT_ELLIPSE)) ||
+             (sgl.ItemTypeBit2 & (GuiLib_ITEMBIT_QUARTERCIRCLE +
+                                  GuiLib_ITEMBIT_QUARTERELLIPSE)))
+    {
+      if (sgl.CurItem.TextPar[0].Alignment == GuiLib_ALIGN_CENTER)
+        sgl.CurItem.X1 -= sgl.CurItem.R1;
+      else if (sgl.CurItem.TextPar[0].Alignment == GuiLib_ALIGN_RIGHT)
+        sgl.CurItem.X1 -= 2 * sgl.CurItem.R1;
+    }
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+    if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_SCROLLBOX)
+      memcpy(&sgl.ScrollBoxesAry[sgl.GlobalScrollBoxIndex].ScrollBoxItem, &sgl.CurItem,
+         sizeof(GuiLib_ItemRec));
+#endif
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+    if (sgl.ItemTypeBit1 & GuiLib_ITEMBIT_GRAPH)
+    {
+      memcpy(&sgl.GraphAry[sgl.GlobalGraphIndex].GraphItem, &sgl.CurItem,
+         sizeof(GuiLib_ItemRec));
+      OrderCoord(&sgl.GraphAry[sgl.GlobalGraphIndex].GraphItem.X1,
+                 &sgl.GraphAry[sgl.GlobalGraphIndex].GraphItem.X2);
+      OrderCoord(&sgl.GraphAry[sgl.GlobalGraphIndex].GraphItem.Y1,
+                 &sgl.GraphAry[sgl.GlobalGraphIndex].GraphItem.Y2);
+      sgl.GraphAry[sgl.GlobalGraphIndex].OrigoX =
+         sgl.GraphAry[sgl.GlobalGraphIndex].GraphItem.X1 +
+         sgl.GraphAry[sgl.GlobalGraphIndex].OriginOffsetX;
+      sgl.GraphAry[sgl.GlobalGraphIndex].OrigoY =
+         sgl.GraphAry[sgl.GlobalGraphIndex].GraphItem.Y2 -
+         sgl.GraphAry[sgl.GlobalGraphIndex].OriginOffsetY;
+    }
+#endif
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+    if (sgl.NextScrollLineReading)
+      sgl.DisplayWriting = 0;
+    else
+#endif
+      sgl.DisplayWriting = 1;
+    DrawItem(ColorInvert);
+
+    sgl.DisplayWriting = 1;
+
+    switch (sgl.CurItem.ItemType)
+    {
+      case GuiLib_ITEM_TEXT:
+      case GuiLib_ITEM_VAR:
+        sgl.CurItem.RX1 = sgl.FontWriteX1;
+        sgl.CurItem.RY1 = sgl.FontWriteY1;
+        sgl.CurItem.RX2 = sgl.FontWriteX2 + 1;
+        sgl.CurItem.RY2 = sgl.FontWriteY2;
+        break;
+      case GuiLib_ITEM_DOT:
+        sgl.CurItem.RX1 = sgl.CurItem.X1;
+        sgl.CurItem.RY1 = sgl.CurItem.Y1;
+        sgl.CurItem.RX2 = sgl.CurItem.X1 + 1;
+        sgl.CurItem.RY2 = sgl.CurItem.Y1;
+        break;
+      case GuiLib_ITEM_CIRCLE:
+      case GuiLib_ITEM_QUARTERCIRCLE:
+        sgl.CurItem.RX1 = sgl.CurItem.X1;
+        sgl.CurItem.RY1 = sgl.CurItem.Y1 - sgl.CurItem.R1;
+        sgl.CurItem.RX2 = sgl.CurItem.X1 + (2 * sgl.CurItem.R1) + 1;
+        sgl.CurItem.RY2 = sgl.CurItem.Y1 + sgl.CurItem.R1;
+        break;
+      case GuiLib_ITEM_ELLIPSE:
+      case GuiLib_ITEM_QUARTERELLIPSE:
+        sgl.CurItem.RX1 = sgl.CurItem.X1;
+        sgl.CurItem.RY1 = sgl.CurItem.Y1 - sgl.CurItem.R2;
+        sgl.CurItem.RX2 = sgl.CurItem.X1 + (2 * sgl.CurItem.R1) + 1;
+        sgl.CurItem.RY2 = sgl.CurItem.Y1 + sgl.CurItem.R2;
+        break;
+      case GuiLib_ITEM_CLEARAREA:
+      case GuiLib_ITEM_LINE:
+      case GuiLib_ITEM_FRAME:
+      case GuiLib_ITEM_ROUNDEDFRAME:
+      case GuiLib_ITEM_BLOCK:
+      case GuiLib_ITEM_ROUNDEDBLOCK:
+      case GuiLib_ITEM_BITMAP:
+      case GuiLib_ITEM_BACKGROUND:
+      case GuiLib_ITEM_ACTIVEAREA:
+      case GuiLib_ITEM_CLIPRECT:
+      case GuiLib_ITEM_TEXTBLOCK:
+      case GuiLib_ITEM_VARBLOCK:
+      case GuiLib_ITEM_CHECKBOX:
+      case GuiLib_ITEM_BUTTON:
+      case GuiLib_ITEM_EDITBOX:
+      case GuiLib_ITEM_PANEL:
+      case GuiLib_ITEM_MEMO:
+      case GuiLib_ITEM_LISTBOX:
+      case GuiLib_ITEM_COMBOBOX:
+      case GuiLib_ITEM_SCROLLAREA:
+      case GuiLib_ITEM_PROGRESSBAR:
+      case GuiLib_ITEM_TOUCHAREA:
+      case GuiLib_ITEM_SCROLLBOX:
+      case GuiLib_ITEM_GRAPH:
+      case GuiLib_ITEM_GRAPHICSLAYER:
+        sgl.CurItem.RX1 = sgl.CurItem.X1;
+        sgl.CurItem.RY1 = sgl.CurItem.Y1;
+        sgl.CurItem.RX2 = sgl.CurItem.X2 + 1;
+        sgl.CurItem.RY2 = sgl.CurItem.Y2;
+        break;
+      case GuiLib_ITEM_POSCALLBACK:
+        sgl.CurItem.RX1 = sgl.CurItem.X1;
+        sgl.CurItem.RY1 = sgl.CurItem.Y1;
+        sgl.CurItem.RX2 = sgl.CurItem.X1;
+        sgl.CurItem.RY2 = sgl.CurItem.Y1;
+        break;
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+      case GuiLib_ITEM_RADIOBUTTON:
+        sgl.CurItem.RX1 = sgl.CurItem.X1;
+        sgl.CurItem.RY1 = sgl.CurItem.Y1;
+        sgl.CurItem.RX2 = sgl.CurItem.X2 + 1;
+        sgl.CurItem.RY2 = sgl.CurItem.Y2 +
+                         (sgl.CurItem.CompPars.CompRadioButton.Count - 1) *
+                          sgl.CurItem.CompPars.CompRadioButton.InterDistance;
+        break;
+#endif
+    }
+
+    sgl.AutoRedrawLatest = RemAutoRedrawLatest;
+  }
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_ShowScreen(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16S CursorFieldToShow,
+   GuiConst_INT8U ResetAutoRedraw)
+{
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+  GuiConst_INT16S M;
+#endif
+  GuiConst_INT16S N;
+  GuiLib_StructPtr StructureToCall;
+
+  GuiDisplay_Lock();
+
+  GuiLib_CurStructureNdx = StructureNdx;
+  StructureToCall =
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+     GetRemoteStructData(StructureNdx);
+#else
+     (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[StructureNdx]);
+#endif
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  sgl.CursorFieldFound = -1;
+  sgl.CursorActiveFieldFound = 0;
+  GuiLib_ActiveCursorFieldNo = CursorFieldToShow;
+  sgl.CursorInUse = (GuiLib_ActiveCursorFieldNo >= 0);
+#else
+  gl.Dummy1_16S = CursorFieldToShow;   // To avoid compiler warning
+#endif
+
+  if ((GuiLib_StructPtr)StructureToCall != 0)
+  {
+    sgl.CurItem.X1 = 0;
+    sgl.CurItem.Y1 = 0;
+    sgl.CurItem.X2 = 0;
+    sgl.CurItem.Y2 = 0;
+    sgl.CurItem.R1 = 0;
+    sgl.CurItem.R2 = 0;
+
+    sgl.CurItem.RX = 0;
+    sgl.CurItem.RY = 0;
+    sgl.CurItem.RX1 = 0;
+    sgl.CurItem.RY1 = 0;
+    sgl.CurItem.RX2 = 0;
+    sgl.CurItem.RY2 = 0;
+
+    for (N = 0; N < 2 * GuiLib_MEMORY_CNT; N++)
+    {
+      sgl.Memory.X[N] = 0;
+      sgl.Memory.Y[N] = 0;
+    }
+    for (N = 0; N < GuiLib_MEMORY_CNT; N++)
+      sgl.Memory.C[N] = 0;
+    sgl.ThicknessMemory = 1;
+
+    sgl.CurItem.ForeColor = GuiConst_PIXEL_ON;
+    sgl.CurItem.BackColor = GuiConst_PIXEL_OFF;
+    sgl.CurItem.BarForeColor = GuiConst_PIXEL_OFF;
+    sgl.CurItem.BarBackColor = GuiConst_PIXEL_ON;
+    sgl.CurItem.ForeColorIndex = 0xFFFF;
+    sgl.CurItem.BackColorIndex = 0xFFFF;
+    sgl.CurItem.BarForeColorIndex = 0xFFFF;
+    sgl.CurItem.BarBackColorIndex = 0xFFFF;
+
+
+    for (N = 0; N < 3; N++)
+    {
+      sgl.CurItem.TextPar[N].BitFlags = GuiLib_BITFLAG_TRANSPARENT;
+      sgl.CurItem.TextPar[N].Alignment = GuiLib_ALIGN_LEFT;
+      sgl.CurItem.TextPar[N].BackBoxSizeX = 0;
+      sgl.CurItem.TextPar[N].FontIndex = 0;
+      sgl.CurItem.TextPar[N].Ps = GuiLib_PS_ON;
+    }
+
+    sgl.CurItem.FormatFieldWidth = 10;
+    sgl.CurItem.FormatDecimals = 0;
+    sgl.CurItem.FormatAlignment = GuiLib_FORMAT_ALIGNMENT_RIGHT;
+    sgl.CurItem.FormatFormat = GuiLib_FORMAT_DEC;
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+    for (N = 0; N < GuiConst_BLINK_FIELDS_MAX; N++)
+    {
+      sgl.BlinkTextItems[N].InUse = 0;
+      sgl.BlinkTextItems[N].Active = 0;
+    }
+#endif
+#endif
+
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+    sgl.TouchAreaCnt = 0;
+#endif
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+    for (M = 0; M < GuiConst_SCROLLITEM_BOXES_MAX; M++)
+    {
+      sgl.ScrollBoxesAry[M].InUse = GuiLib_SCROLL_STRUCTURE_UNDEF;
+      for (N = 0; N < GuiConst_SCROLLITEM_MARKERS_MAX; N++)
+      {
+        sgl.ScrollBoxesAry[M].MarkerColor[N] = GuiConst_PIXEL_ON;
+        sgl.ScrollBoxesAry[M].MarkerColorTransparent[N] = 1;
+      }
+    }
+#endif
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+    for (N = 0; N < GuiConst_GRAPH_MAX; N++)
+      sgl.GraphAry[N].InUse = GuiLib_GRAPH_STRUCTURE_UNDEF;
+#endif
+
+    sgl.BaseLayerDrawing = 1;
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+    GraphicsLayer_Pop(GuiLib_GRAPHICS_LAYER_BASE);
+    for (N = 0; N < GuiConst_GRAPHICS_LAYER_MAX; N++)
+    {
+      sgl.GraphicsLayerList[N].InUse = GuiLib_GRAPHICS_LAYER_UNDEF;
+      sgl.GraphicsFilterList[N].InUse = GuiLib_GRAPHICS_FILTER_UNDEF;
+    }
+#endif
+
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+    sgl.GlobalBackgrBitmapIndex = 0;
+    for (N = 0; N < GuiConst_MAX_BACKGROUND_BITMAPS; N++)
+      sgl.BackgrBitmapAry[N].InUse = 0;
+#endif
+
+    if (ResetAutoRedraw)
+      AutoRedraw_Destroy();
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+    else
+      AutoRedraw_ResetCursor();
+#endif
+
+    sgl.DrawingLevel = 0;
+    sgl.TopLevelStructure = 0;
+
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+    sgl.CurItem.CompPars.CompTextBox.ScrollIndex = 0;
+    sgl.CurItem.CompPars.CompTextBox.ScrollPos = 0;
+    for (N = 0; N < GuiConst_TEXTBOX_FIELDS_MAX; N++)
+      sgl.TextBoxScrollPositions[N].index = -1;
+#endif
+
+    sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+    sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    sgl.CurItem.ClipRectX1 = sgl.DisplayActiveAreaX1;
+    sgl.CurItem.ClipRectY1 = sgl.DisplayActiveAreaY1;
+    sgl.CurItem.ClipRectX2 = sgl.DisplayActiveAreaX2;
+    sgl.CurItem.ClipRectY2 = sgl.DisplayActiveAreaY2;
+    sgl.ActiveAreaX1 = sgl.DisplayActiveAreaX1;
+    sgl.ActiveAreaY1 = sgl.DisplayActiveAreaY1;
+    sgl.ActiveAreaX2 = sgl.DisplayActiveAreaX2;
+    sgl.ActiveAreaY2 = sgl.DisplayActiveAreaY2;
+    if (sgl.DisplayWriting)
+    {
+      if ((sgl.DisplayActiveAreaX1 != 0) || (sgl.DisplayActiveAreaY1 != 0) ||
+          (sgl.DisplayActiveAreaX2 != GuiConst_DISPLAY_WIDTH - 1) ||
+          (sgl.DisplayActiveAreaY2 != GuiConst_DISPLAY_HEIGHT - 1))
+        GuiLib_SetClipping(sgl.DisplayActiveAreaX1, sgl.DisplayActiveAreaY1,
+                           sgl.DisplayActiveAreaX2, sgl.DisplayActiveAreaY2);
+      else
+        GuiLib_ResetClipping();
+    }
+#endif
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+    sgl.CurItem.CursorFieldLevel = 0;
+#endif
+    sgl.DisplayLevel = 0;
+    sgl.InitialDrawing = 1;
+    sgl.SwapColors = 0;
+    DrawStructure((GuiLib_StructPtr) StructureToCall,
+                   GuiLib_COL_INVERT_IF_CURSOR);
+    ResetLayerBufPtr();
+    sgl.InitialDrawing = 0;
+    sgl.CoordOrigoX = sgl.DisplayOrigoX + sgl.LayerOrigoX;
+    sgl.CoordOrigoY = sgl.DisplayOrigoY + sgl.LayerOrigoY;
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+    if (sgl.DisplayWriting)
+      GuiLib_ResetClipping();
+#endif
+  }
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  if (sgl.CursorFieldFound == -1)
+  {
+    sgl.CursorInUse = 0;
+    GuiLib_ActiveCursorFieldNo = -1;
+  }
+  else if (sgl.CursorInUse)
+  {
+    if (sgl.CursorActiveFieldFound == 0)
+    {
+      GuiLib_ActiveCursorFieldNo = sgl.CursorFieldFound;
+
+      DrawCursorItem(1);
+    }
+  }
+#endif
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+  sgl.BlinkBoxInverted = 0;
+#endif
+
+  GuiDisplay_Unlock();
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT16S CheckLanguageIndex(
+   GuiConst_INT16S LanguageIndex)
+{
+  if ((LanguageIndex < 0) || (LanguageIndex > GuiConst_LANGUAGE_CNT - 1))
+    LanguageIndex = 0;
+
+#ifdef GuiConst_LANGUAGE_SOME_ACTIVE
+  if (!ReadByte(GuiFont_LanguageActive[LanguageIndex]))
+    LanguageIndex = GuiConst_LANGUAGE_FIRST;
+#endif
+
+  return(LanguageIndex);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_TEXT PrefixLocate *GuiLib_GetTextLanguagePtr(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16U TextNo,
+   GuiConst_INT16S LanguageIndex)
+{
+  GuiConst_INT16U I;
+  GuiConst_INT16S ItemNdx;
+  GuiConst_INT8U ItemCnt;
+  GuiLib_StructPtr StructureToCall;
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  GuiConst_INT8U ItemSizeBuf[2];
+  GuiConst_INT16U ItemSize;
+#endif
+
+  StructureToCall =
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+     GetRemoteStructData(StructureNdx);
+#else
+     (GuiLib_StructPtr)ReadWord(GuiStruct_StructPtrList[StructureNdx]);
+#endif
+
+  if (StructureToCall != 0)
+  {
+    LanguageIndex = CheckLanguageIndex(LanguageIndex);
+
+    sgl.ItemDataPtr = (GuiConst_INT8U PrefixLocate *)StructureToCall;
+    ItemCnt = GetItemByte(&sgl.ItemDataPtr);
+
+    I = 0;
+    for (ItemNdx = 0; ItemNdx < ItemCnt; ItemNdx++)
+    {
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+      GuiLib_RemoteDataReadBlock(
+         sgl.RemoteStructOffset,
+         2,
+         (GuiConst_INT8U*)&ItemSizeBuf);
+      ItemSize = (256 * (GuiConst_INT16U)ItemSizeBuf[1]) + ItemSizeBuf[0];
+      sgl.RemoteStructOffset += 2;
+      GuiLib_RemoteDataReadBlock(
+         sgl.RemoteStructOffset,
+         ItemSize,
+         sgl.GuiLib_RemoteItemBuffer);
+      sgl.RemoteStructOffset += ItemSize;
+      sgl.ItemDataPtr = &sgl.GuiLib_RemoteItemBuffer[0];
+#endif
+
+      ReadItem(LanguageIndex);
+
+      if ((sgl.CurItem.ItemType == GuiLib_ITEM_TEXT) ||
+          (sgl.CurItem.ItemType == GuiLib_ITEM_TEXTBLOCK))
+      {
+        if (I == TextNo)
+        {
+#ifdef GuiConst_CHARMODE_ANSI
+          return (GuiConst_TEXT PrefixLocate *) sgl.CurItem.TextPtr[0];
+#else
+          #ifdef GuiConst_ICC_COMPILER
+          ExtractUnicodeString((GuiConst_INT8U *)sgl.CurItem.TextPtr[0],
+                               sgl.CurItem.TextLength[0]);
+          #else
+          #ifdef GuiConst_CODEVISION_COMPILER
+          ExtractUnicodeString((GuiConst_INT8U *)sgl.CurItem.TextPtr[0],
+                               sgl.CurItem.TextLength[0]);
+          #else
+          ExtractUnicodeString((GuiConst_INT8U PrefixRom *)sgl.CurItem.TextPtr[0],
+                               sgl.CurItem.TextLength[0]);
+          #endif
+          #endif
+
+          return (sgl.UnicodeTextBuf);
+#endif
+        }
+        I++;
+      }
+    }
+  }
+
+  return (0);
+}
+
+//------------------------------------------------------------------------------
+GuiConst_TEXT PrefixLocate *GuiLib_GetTextPtr(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16U TextNo)
+{
+  return (GuiLib_GetTextLanguagePtr(StructureNdx, TextNo, GuiLib_LanguageIndex));
+}
+
+//------------------------------------------------------------------------------
+GuiConst_INT16U GuiLib_GetTextWidth(
+   GuiConst_TEXT PrefixLocate *String,
+   GuiLib_FontRecConstPtr Font,
+   GuiConst_INT8U PsWriting)
+{
+  GuiLib_ItemRec TextData;
+  GuiConst_INT16U CharCnt;
+
+  if ((String[0] != 0) && (Font != 0))
+  {
+    TextData.TextPar[0].Ps = PsWriting;
+    sgl.CurItem.TextPar[0].Ps = TextData.TextPar[0].Ps;
+#ifdef GuiConst_CHARMODE_ANSI
+    CharCnt = strlen(String);
+#else
+    CharCnt = GuiLib_UnicodeStrLen(String);
+#endif
+    sgl.CurFont = (GuiLib_FontRecPtr)Font;
+#ifdef GuiConst_DISP_VAR_NOW
+    displayVarNow = 1;
+#endif
+
+#ifdef GuiConst_CODEVISION_COMPILER
+    PrepareText((GuiConst_TEXT *)String, CharCnt, 0);
+#else
+#ifdef GuiConst_RENESAS_COMPILER_FAR
+    PrepareText((GuiConst_TEXT PrefixGeneric *)String, CharCnt, 0);
+#else
+    PrepareText(String, CharCnt, 0);
+#endif
+#endif
+#ifdef GuiConst_DISP_VAR_NOW
+    displayVarNow = 0;
+#endif
+
+    return (TextPixelLength(TextData.TextPar[0].Ps, CharCnt, 0));
+  }
+
+  return (0);
+}
+
+//---------------------------------------------------------------
+static GuiConst_TEXT GetCharCode(
+   GuiConst_TEXT PrefixRom * CharPtr,
+   GuiConst_INT16U CharCnt,
+   GuiConst_INT16U CharNo,
+   GuiConst_INT16U OmitCtrlCode)
+{
+  GuiConst_INT16U P;
+  GuiConst_TEXT CharCode, PreviousCharCode;
+
+  if (CharCnt > GuiConst_MAX_TEXT_LEN)
+    CharCnt = GuiConst_MAX_TEXT_LEN;
+
+  if (CharNo > CharCnt)
+    return 0;
+
+  if (CharCnt > GuiConst_MAX_TEXT_LEN)
+    CharCnt = GuiConst_MAX_TEXT_LEN;
+
+  if (OmitCtrlCode)
+  {
+    for (P = 0; P < CharNo + 1; P++)
+    {
+#ifdef GuiConst_CHARMODE_ANSI
+  #ifdef GuiConst_AVRGCC_COMPILER
+      CharCode = (unsigned GuiConst_CHAR) ReadBytePtr(CharPtr);
+  #else
+  #ifdef GuiConst_ICC_COMPILER
+      CharCode = *((GuiConst_INT8U PrefixRom *)CharPtr);
+  #else
+  #ifdef GuiConst_CODEVISION_COMPILER
+      CharCode = *((GuiConst_INT8U PrefixRom *)CharPtr);
+  #else
+      CharCode = (unsigned GuiConst_TEXT) *CharPtr;
+  #endif
+  #endif
+  #endif
+#else
+      CharCode = *((GuiConst_INT16U PrefixLocate *)CharPtr);
+#endif
+
+      if (P)
+      {
+        if ((CharCode == GuiLib_LINEFEED) ||
+           ((CharCode == ' ') && (PreviousCharCode == ' ')) ||
+           ((CharCode == ' ') && (PreviousCharCode == '-')))
+          CharNo++;
+      }
+      PreviousCharCode = CharCode;
+
+      CharPtr++;
+    }
+  }
+  else
+  {
+    CharPtr += CharNo;
+
+#ifdef GuiConst_CHARMODE_ANSI
+  #ifdef GuiConst_AVRGCC_COMPILER
+    CharCode = (unsigned GuiConst_CHAR) ReadBytePtr(CharPtr);
+  #else
+  #ifdef GuiConst_ICC_COMPILER
+    CharCode = *((GuiConst_INT8U PrefixRom *)CharPtr);
+  #else
+  #ifdef GuiConst_CODEVISION_COMPILER
+    CharCode = *((GuiConst_INT8U PrefixRom *)CharPtr);
+  #else
+    CharCode = (unsigned GuiConst_TEXT) *CharPtr;
+  #endif
+  #endif
+  #endif
+#else
+    CharCode = *((GuiConst_INT16U PrefixLocate *)CharPtr);
+#endif
+  }
+
+  return (GuiConst_TEXT)CharCode;
+}
+
+//------------------------------------------------------------------------------
+GuiConst_TEXT GuiLib_GetCharCode(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16U TextNo,
+   GuiConst_INT16U CharNo,
+   GuiConst_INT16U OmitCtrlCode)
+{
+  GuiConst_TEXT PrefixRom * CharPtr;
+
+  CharPtr = GuiLib_GetTextPtr(StructureNdx, TextNo);
+
+  if (CharPtr == 0) return 0;
+
+#ifdef GuiConst_CHARMODE_ANSI
+  return GetCharCode(CharPtr,
+                     strlen(CharPtr),
+                     CharNo,
+                     OmitCtrlCode);
+#else
+  return GetCharCode(CharPtr,
+                     GuiLib_UnicodeStrLen(CharPtr),
+                     CharNo,
+                     OmitCtrlCode);
+#endif
+}
+
+//------------------------------------------------------------------------------
+#ifdef GuiConst_BLINK_SUPPORT_ON
+GuiConst_TEXT GuiLib_GetBlinkingCharCode(
+   GuiConst_INT16U BlinkFieldNo,
+   GuiConst_INT16U CharNo,
+   GuiConst_INT16U OmitCtrlCode)
+{
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  GuiConst_INT16U StrLen;
+
+  if (BlinkFieldNo >= GuiConst_BLINK_FIELDS_MAX)
+    return 0;
+
+  if (sgl.BlinkTextItems[BlinkFieldNo].InUse)
+  {
+    #ifdef GuiConst_CHARMODE_ANSI
+    StrLen = strlen((GuiConst_TEXT*)sgl.BlinkTextItems[BlinkFieldNo].TextPtr);
+    #else
+    #ifdef GuiConst_CODEVISION_COMPILER
+    StrLen = GuiLib_UnicodeStrLen(
+       (GuiConst_TEXT*)sgl.BlinkTextItems[BlinkFieldNo].TextPtr);
+    #else
+    StrLen = GuiLib_UnicodeStrLen((GuiConst_TEXT*)sgl.BlinkTextItems[BlinkFieldNo].TextPtr);
+    #endif
+    #endif
+
+    return GetCharCode((GuiConst_TEXT PrefixRom *)sgl.BlinkTextItems[BlinkFieldNo].TextPtr,
+                       StrLen,
+                       CharNo,
+                       OmitCtrlCode);
+  }
+  else
+#endif
+    return 0;
+}
+#endif
+
+//------------------------------------------------------------------------------
+void GuiLib_SetLanguage(
+   GuiConst_INT16S NewLanguage)
+{
+  GuiLib_LanguageIndex = CheckLanguageIndex(NewLanguage);
+}
+
+//------------------------------------------------------------------------------
+static void InvertBox(void)
+{
+  if (sgl.DisplayWriting)
+    GuiLib_InvertBox(sgl.InvertBoxX1, sgl.InvertBoxY1, sgl.InvertBoxX2, sgl.InvertBoxY2);
+  sgl.InvertBoxOn = !sgl.InvertBoxOn;
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_InvertBoxStart(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2)
+{
+  GuiLib_InvertBoxStop();
+  sgl.InvertBoxX1 = X1;
+  sgl.InvertBoxY1 = Y1;
+  sgl.InvertBoxX2 = X2;
+  sgl.InvertBoxY2 = Y2;
+  InvertBox();
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_InvertBoxStop(void)
+{
+  if (sgl.InvertBoxOn)
+    InvertBox();
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_Refresh(void)
+{
+#ifdef WANT_DOUBLE_BUFFERING // Otherwise we are writing direct to the display - no need for this code
+  GuiConst_INT16S N, L;
+  GuiConst_INT8U RedrawBottomLevel;
+  ItemMemory     RemMemory;
+  GuiConst_INT8U ColorInvert;
+
+  GuiDisplay_Lock();
+
+  sgl.RefreshClock++;
+
+  RedrawBottomLevel = 0;
+
+  N = AutoRedraw_Reset();
+
+  memcpy(&RemMemory, &sgl.Memory, sizeof(ItemMemory));
+
+  while (N != -1)
+  {
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+    if (!AutoRedraw_IsOnlyCursor(N))
+#endif
+    {
+      if (AutoRedraw_VarChanged(N) != 0)
+      {
+        memcpy(&sgl.CurItem, AutoRedraw_GetItem(N), sizeof(GuiLib_ItemRec));
+        memcpy(&sgl.Memory, AutoRedraw_GetItemMemory(N), sizeof(ItemMemory));
+
+        AutoRedraw_UpdateVar(N);
+
+        ColorInvert = GuiLib_COL_INVERT_IF_CURSOR;
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+        if (AutoRedraw_CheckCursorInheritance(N) == 0)
+          ColorInvert = GuiLib_COL_INVERT_ON;
+#endif
+
+        L = AutoRedraw_GetLevel(N);
+
+        if (AutoRedraw_ItemIsStruct(N))
+        {
+          N = AutoRedraw_DeleteStruct(N);
+          sgl.AutoRedrawUpdate = GuiLib_TRUE;
+          if (sgl.AutoRedrawInsertPoint >= 0)
+            N = AutoRedraw_GetNext(N);
+        }
+        else
+        {
+          sgl.AutoRedrawUpdate = GuiLib_FALSE;
+          N = AutoRedraw_GetNext(N);
+        }
+
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+        UpdateBackgroundBitmap();
+#endif
+
+        sgl.DisplayLevel = 0;
+        sgl.SwapColors = 0;
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+        if ((sgl.CurItem.TextPar[0].BitFlags & GuiLib_BITFLAG_BLINKTEXTFIELD) &&
+            (sgl.CurItem.BlinkFieldNo < GuiConst_BLINK_FIELDS_MAX) &&
+             sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].InUse &&
+             sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].Active &&
+             sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].BlinkBoxInverted)
+           GuiLib_InvertBox(sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].BlinkBoxX1,
+                            sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].BlinkBoxY1,
+                            sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].BlinkBoxX2,
+                            sgl.BlinkTextItems[sgl.CurItem.BlinkFieldNo].BlinkBoxY2);
+#endif
+#endif
+
+        DrawItem(ColorInvert);
+
+        if (L == 0)
+          RedrawBottomLevel = 1;
+
+        sgl.AutoRedrawUpdate = GuiLib_FALSE;
+      }
+      else
+        N = AutoRedraw_GetNext(N);
+    }
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+    else
+      N = AutoRedraw_GetNext(N);
+#endif
+  }
+
+  memcpy(&sgl.Memory, &RemMemory, sizeof(ItemMemory));
+
+
+  if ((sgl.DrawingLevel > 0) && RedrawBottomLevel && (sgl.TopLevelStructure != 0))
+  {
+    sgl.DisplayLevel = 0;
+    sgl.SwapColors = 0;
+    DrawStructure(sgl.TopLevelStructure, GuiLib_COL_INVERT_IF_CURSOR);
+    ResetLayerBufPtr();
+  }
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+  for (N = 0; N < GuiConst_BLINK_FIELDS_MAX; N++)
+    if (sgl.BlinkTextItems[N].InUse &&
+        sgl.BlinkTextItems[N].Active)
+    {
+      if (sgl.BlinkTextItems[N].BlinkBoxInverted !=
+          sgl.BlinkTextItems[N].BlinkBoxLast)
+      {
+         GuiLib_InvertBox(sgl.BlinkTextItems[N].BlinkBoxX1,
+                          sgl.BlinkTextItems[N].BlinkBoxY1,
+                          sgl.BlinkTextItems[N].BlinkBoxX2,
+                          sgl.BlinkTextItems[N].BlinkBoxY2);
+         sgl.BlinkTextItems[N].BlinkBoxInverted =
+            sgl.BlinkTextItems[N].BlinkBoxLast;
+      }
+      if (sgl.BlinkTextItems[N].BlinkBoxState < 255)
+      {
+        sgl.BlinkTextItems[N].BlinkBoxState--;
+        if (sgl.BlinkTextItems[N].BlinkBoxState == 0)
+        {
+          sgl.BlinkTextItems[N].BlinkBoxState = sgl.BlinkTextItems[N].BlinkBoxRate;
+          if (sgl.DisplayWriting)
+          {
+            GuiLib_InvertBox(sgl.BlinkTextItems[N].BlinkBoxX1,
+                             sgl.BlinkTextItems[N].BlinkBoxY1,
+                             sgl.BlinkTextItems[N].BlinkBoxX2,
+                             sgl.BlinkTextItems[N].BlinkBoxY2);
+            sgl.BlinkTextItems[N].BlinkBoxInverted =
+               !sgl.BlinkTextItems[N].BlinkBoxInverted;
+            sgl.BlinkTextItems[N].BlinkBoxLast =
+               sgl.BlinkTextItems[N].BlinkBoxInverted;
+          }
+        }
+      }
+    }
+  if (sgl.BlinkBoxRate)
+  {
+    if (sgl.BlinkBoxState < 255)
+      sgl.BlinkBoxState--;
+    if (sgl.BlinkBoxState == 0)
+    {
+      sgl.BlinkBoxState = sgl.BlinkBoxRate;
+      BlinkBox();
+    }
+  }
+#endif
+#endif
+
+  GuiDisplay_Unlock();
+
+  GuiDisplay_Refresh();
+#endif // WANT_DOUBLE_BUFFERING 
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_DrawChar(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U FontNo,
+   GuiConst_TEXT Character,
+   GuiConst_INTCOLOR Color)
+{
+  GuiLib_FontRecPtr Font;
+#ifndef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT8U PrefixRom *CharPtr;
+#endif
+  GuiConst_INT16S X1,Y1,X2,Y2;
+#ifdef GuiConst_REMOTE_FONT_DATA
+  GuiConst_INT32U CharNdx;
+#else
+#ifdef GuiConst_CHARMODE_UNICODE
+  GuiConst_INT32U CharNdx;
+#endif
+#endif
+
+  Font = (GuiLib_FontRecPtr) ReadWord(GuiFont_FontList[FontNo]);
+
+  Y -= ReadByte(Font->BaseLine);
+
+#ifdef GuiConst_CHARMODE_ANSI
+  #ifdef GuiConst_REMOTE_FONT_DATA
+  if ((Character < Font->FirstChar) || (Character > Font->LastChar))
+    CharNdx =
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[Font->IllegalCharNdx];
+  else
+    CharNdx =
+       (GuiConst_INT32U PrefixRom)GuiFont_ChPtrList[Font->FirstCharNdx +
+       (GuiConst_INT16U)Character - (GuiConst_INT16U)Font->FirstChar];
+  DrawChar(X, Y, Font, CharNdx, Color, 0);
+  #else
+  if ((Character < ReadByte(Font->FirstChar)) ||
+     (Character > ReadByte(Font->LastChar)))
+    CharPtr = (GuiConst_INT8U PrefixRom *)ReadWord(
+       GuiFont_ChPtrList[ReadWord(Font->IllegalCharNdx)]);
+  else
+    CharPtr = (GuiConst_INT8U PrefixRom *)ReadWord(
+       GuiFont_ChPtrList[ReadWord(Font->FirstCharNdx) +
+       (GuiConst_INT16U)Character -
+       (GuiConst_INT16U)ReadByte(Font->FirstChar)]);
+  DrawChar(X, Y, Font, CharPtr, Color, 0);
+  #endif
+#else
+  CharNdx = GetCharNdx(Font, Character);
+  #ifdef GuiConst_REMOTE_FONT_DATA
+  DrawChar(X, Y, Font, CharNdx, Color, 0);
+  #else
+  CharPtr = (GuiConst_INT8U PrefixRom *)ReadWord(GuiFont_ChPtrList[CharNdx]);
+  DrawChar(X, Y, Font, CharPtr, Color, 0);
+  #endif
+#endif
+
+#ifdef GuiConst_REMOTE_FONT_DATA
+  X1 = X + sgl.GuiLib_RemoteFontBuffer[GuiLib_CHR_XLEFT_OFS];
+  X2 = X1 + sgl.GuiLib_RemoteFontBuffer[GuiLib_CHR_XWIDTH_OFS] - 1;
+  Y1 = Y + sgl.GuiLib_RemoteFontBuffer[GuiLib_CHR_YTOP_OFS];
+  Y2 = Y1 + sgl.GuiLib_RemoteFontBuffer[GuiLib_CHR_YHEIGHT_OFS] - 1;
+#else
+  X1 = X + ReadBytePtr(CharPtr + GuiLib_CHR_XLEFT_OFS);
+  X2 = X1 + ReadBytePtr(CharPtr + GuiLib_CHR_XWIDTH_OFS) - 1;
+  Y1 = Y + ReadBytePtr(CharPtr + GuiLib_CHR_YTOP_OFS);
+  Y2 = Y1 + ReadBytePtr(CharPtr + GuiLib_CHR_YHEIGHT_OFS) - 1;
+#endif
+
+  GuiLib_MarkDisplayBoxRepaint(X1,Y1,X2,Y2);
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_DrawStr(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U FontNo,
+   GuiConst_TEXT *String,
+   GuiConst_INT8U Alignment,
+   GuiConst_INT8U PsWriting,
+   GuiConst_INT8U Transparent,
+   GuiConst_INT8U Underlining,
+   GuiConst_INT16S BackBoxSizeX,
+   GuiConst_INT16S BackBoxSizeY1,
+   GuiConst_INT16S BackBoxSizeY2,
+   GuiConst_INT8U BackBorderPixels,
+   GuiConst_INTCOLOR ForeColor,
+   GuiConst_INTCOLOR BackColor)
+{
+  if (FontNo >= GuiFont_FontCnt)
+    return;
+  if (*String == 0)
+    return;
+
+  SetCurFont(FontNo);
+
+#ifdef GuiConst_AVRGCC_COMPILER
+  #ifdef GuiConst_CHARMODE_ANSI
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT8U *)String;
+  #else
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT16U *)String;
+  #endif
+#else
+#ifdef GuiConst_ICC_COMPILER
+  #ifdef GuiConst_CHARMODE_ANSI
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT8U *)String;
+  #else
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT16U *)String;
+  #endif
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+  #ifdef GuiConst_CHARMODE_ANSI
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT8U *)String;
+  #else
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT16U *)String;
+  #endif
+#else
+#ifdef GuiConst_RENESAS_COMPILER_FAR
+  #ifdef GuiConst_CHARMODE_ANSI
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT8U PrefixLocate *)String;
+  #else
+  sgl.CurItem.TextPtr[0] = (GuiConst_INT16U PrefixLocate *)String;
+  #endif
+#else
+  sgl.CurItem.TextPtr[0] = String;
+#endif
+#endif
+#endif
+#endif
+
+  sgl.CurItem.TextLength[0] = 0;
+  while (*String != 0)
+  {
+    sgl.CurItem.TextLength[0]++;
+    String++;
+  }
+  sgl.CurItem.X1 = X;
+  sgl.CurItem.Y1 = Y;
+  sgl.CurItem.TextPar[0].FontIndex = FontNo;
+  sgl.CurItem.TextPar[0].Alignment = Alignment;
+  sgl.CurItem.TextPar[0].Ps = PsWriting;
+  sgl.CurItem.TextPar[0].BitFlags = 0;
+  if (Underlining)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_UNDERLINE;
+  sgl.CurItem.TextPar[0].BackBoxSizeX = BackBoxSizeX;
+  sgl.CurItem.TextPar[0].BackBoxSizeY1 = BackBoxSizeY1;
+  sgl.CurItem.TextPar[0].BackBoxSizeY2 = BackBoxSizeY2;
+  sgl.CurItem.TextPar[0].BackBorderPixels = BackBorderPixels;
+  if (sgl.CurItem.TextPar[0].BackBoxSizeX > 0)
+    DrawBackBox(BackColor, Transparent, 0);
+
+#ifdef GuiConst_DISP_VAR_NOW
+  displayVarNow = 1;
+#endif
+
+  DrawText(sgl.CurItem.TextPtr[0],
+           sgl.CurItem.TextLength[0],
+           0,
+           ForeColor,
+           BackColor,
+           Transparent);
+
+#ifdef GuiConst_DISP_VAR_NOW
+  displayVarNow = 0;
+#endif
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_DrawVar(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U FontNo,
+   void PrefixLocate *VarPtr,
+   GuiConst_INT8U VarType,
+   GuiConst_INT8U FormatterFormat,
+   GuiConst_INT8U FormatterFieldWidth,
+   GuiConst_INT8U FormatterAlignment,
+   GuiConst_INT8U FormatterDecimals,
+   GuiConst_INT8U FormatterShowSign,
+   GuiConst_INT8U FormatterZeroPadding,
+   GuiConst_INT8U FormatterTrailingZeros,
+   GuiConst_INT8U FormatterThousandsSeparator,
+   GuiConst_INT8U Alignment,
+   GuiConst_INT8U PsWriting,
+   GuiConst_INT8U Transparent,
+   GuiConst_INT8U Underlining,
+   GuiConst_INT16S BackBoxSizeX,
+   GuiConst_INT16S BackBoxSizeY1,
+   GuiConst_INT16S BackBoxSizeY2,
+   GuiConst_INT8U BackBorderPixels,
+   GuiConst_INTCOLOR ForeColor,
+   GuiConst_INTCOLOR BackColor)
+{
+  GuiConst_INT32S VarValue;
+  GuiConst_INT16U StrLen;
+#ifndef GuiConst_CHARMODE_ANSI
+  GuiConst_INT16U P;
+#endif
+  GuiConst_TEXT PrefixGeneric *CharPtr;
+
+  if (FontNo >= GuiFont_FontCnt)
+    return;
+
+  SetCurFont(FontNo);
+
+  sgl.CurItem.VarPtr = VarPtr;
+  sgl.CurItem.VarType = VarType;
+  sgl.CurItem.FormatFormat = FormatterFormat;
+  sgl.CurItem.FormatFieldWidth = FormatterFieldWidth;
+  sgl.CurItem.FormatAlignment = FormatterAlignment;
+  sgl.CurItem.FormatDecimals = FormatterDecimals;
+  sgl.CurItem.TextPar[0].BitFlags = 0;
+  if (FormatterShowSign)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATSHOWSIGN;
+  if (FormatterZeroPadding)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATZEROPADDING;
+  if (FormatterTrailingZeros)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATTRAILINGZEROS;
+  if (FormatterThousandsSeparator)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_FORMATTHOUSANDSSEP;
+  sgl.CurItem.X1 = X;
+  sgl.CurItem.Y1 = Y;
+  sgl.CurItem.TextPar[0].FontIndex = FontNo;
+  sgl.CurItem.TextPar[0].Alignment = Alignment;
+  sgl.CurItem.TextPar[0].Ps = PsWriting;
+  if (Underlining)
+    sgl.CurItem.TextPar[0].BitFlags |= GuiLib_BITFLAG_UNDERLINE;
+  sgl.CurItem.TextPar[0].BackBoxSizeX = BackBoxSizeX;
+  sgl.CurItem.TextPar[0].BackBoxSizeY1 = BackBoxSizeY1;
+  sgl.CurItem.TextPar[0].BackBoxSizeY2 = BackBoxSizeY2;
+  sgl.CurItem.TextPar[0].BackBorderPixels = BackBorderPixels;
+  if (sgl.CurItem.TextPar[0].BackBoxSizeX > 0)
+    DrawBackBox(BackColor, Transparent, 0);
+
+#ifdef GuiConst_DISP_VAR_NOW
+  displayVarNow = 1;
+#endif
+
+  if (sgl.CurItem.VarType == GuiLib_VAR_STRING)
+  {
+    CharPtr = (GuiConst_TEXT PrefixLocate *)sgl.CurItem.VarPtr;
+#ifdef GuiConst_CHARMODE_ANSI
+    StrLen = strlen(CharPtr);
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+    StrLen = GuiLib_UnicodeStrLen((GuiConst_TEXT*)CharPtr);
+#else
+    StrLen = GuiLib_UnicodeStrLen(CharPtr);
+#endif
+#endif
+  }
+  else
+  {
+    VarValue = ReadVar(sgl.CurItem.VarPtr, sgl.CurItem.VarType);
+    StrLen = DataNumStr(VarValue, sgl.CurItem.VarType, 0);
+#ifdef GuiConst_CHARMODE_ANSI
+    CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumTextStr;
+#else
+    for (P = 0; P <= StrLen; P++)
+      sgl.VarNumUnicodeTextStr[P] = sgl.VarNumTextStr[P];
+    CharPtr = (GuiConst_TEXT PrefixGeneric *) sgl.VarNumUnicodeTextStr;
+#endif
+  }
+
+  DrawText(CharPtr,
+           StrLen,
+           0,
+           ForeColor,
+           BackColor,
+           Transparent);
+
+#ifdef GuiConst_DISP_VAR_NOW
+  displayVarNow = 0;
+#endif
+}
+
+//------------------------------------------------------------------------------
+void GuiLib_TestPattern(void)
+{
+  GuiLib_HLine(0, 31, 0, GuiConst_PIXEL_ON);
+  GuiLib_VLine(0, 1, 31, GuiConst_PIXEL_ON);
+  GuiLib_HLine(2, 8, 2, GuiConst_PIXEL_ON);
+  GuiLib_HLine(11, 16, 2, GuiConst_PIXEL_ON);
+  GuiLib_VLine(4, 4, 10, GuiConst_PIXEL_ON);
+  GuiLib_VLine(4, 13, 18, GuiConst_PIXEL_ON);
+}
+
+#include "GuiComponents.h"
+
+#ifdef GuiConst_REMOTE_DATA
+//------------------------------------------------------------------------------
+GuiConst_INT8U GuiLib_RemoteCheck(void)
+{
+  union
+  {
+    GuiConst_INT8U Bytes[4];
+    GuiConst_INT32U IdInFile;
+  } RemoteIdUnion;
+  GuiConst_INT8U ok;
+
+  GuiLib_RemoteDataReadBlock(0, 4, RemoteIdUnion.Bytes);
+  ok = (RemoteIdUnion.IdInFile == GuiConst_REMOTE_ID);
+
+#ifdef GuiConst_REMOTE_TEXT_DATA
+  GuiLib_RemoteTextReadBlock(0, 4, RemoteIdUnion.Bytes);
+  ok = ok && (RemoteIdUnion.IdInFile == GuiConst_REMOTE_ID);
+#endif
+
+  return (ok);
+}
+#endif
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiLib.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,3742 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2015 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                               v6.0.9.005                                 */
+/*                                                                          */
+/* ************************************************************************ */
+
+
+// =============================================================================
+#ifndef __GUILIB_H
+#define __GUILIB_H
+#include "GuiConst.h"
+#include "GuiVar.h"
+#include "GuiDisplay.h"
+
+
+#ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
+extern "C" {
+#endif
+
+// =============================================================================
+#ifdef GuiConst_CODEVISION_COMPILER
+// Remove warnings about unused functions
+#pragma used+
+#endif
+
+
+// =============================================================================
+#ifdef GuiConst_COLOR_DEPTH_5
+  #define GuiLib_COLOR_UNIT_8
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+#ifdef GuiConst_COLOR_DEPTH_8
+  #define GuiLib_COLOR_UNIT_8
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+#ifdef GuiConst_COLOR_DEPTH_12
+  #define GuiLib_COLOR_UNIT_16
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+#ifdef GuiConst_COLOR_DEPTH_15
+  #define GuiLib_COLOR_UNIT_16
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+#ifdef GuiConst_COLOR_DEPTH_16
+  #define GuiLib_COLOR_UNIT_16
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+#ifdef GuiConst_COLOR_DEPTH_18
+  #define GuiLib_COLOR_UNIT_24
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+#ifdef GuiConst_COLOR_DEPTH_24
+  #define GuiLib_COLOR_UNIT_24
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+#ifdef GuiConst_COLOR_DEPTH_32
+  #define GuiLib_COLOR_UNIT_32
+  #define GuiLib_LAYERS_SUPPORTED
+#endif
+
+
+// =============================================================================
+#ifdef GuiConst_AVR_COMPILER_FLASH_RAM
+  #define PrefixRom __flash
+  #define PrefixGeneric __generic
+  #define PrefixReentrant
+  #define PrefixLocate
+#else
+#ifdef GuiConst_PICC_COMPILER_ROM
+  #define PrefixRom rom
+  #define PrefixGeneric
+  #define PrefixReentrant
+  #define PrefixLocate
+#else
+#ifdef GuiConst_KEIL_COMPILER_REENTRANT
+  #define PrefixRom
+  #define PrefixGeneric
+  #define PrefixReentrant reentrant
+  #define PrefixLocate
+#else
+#ifdef GuiConst_ICC_COMPILER
+  #define PrefixRom const
+  #define PrefixGeneric
+  #define PrefixReentrant
+  #define PrefixLocate
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+  #define PrefixRom flash
+  #define PrefixGeneric
+  #define PrefixReentrant
+  #define PrefixLocate
+#else
+#ifdef GuiConst_RENESAS_COMPILER_FAR
+  #define PrefixRom _far
+  #define PrefixGeneric _far
+  #define PrefixReentrant
+  #define PrefixLocate _far
+#else
+  #define PrefixRom
+  #define PrefixGeneric
+  #define PrefixReentrant
+  #define PrefixLocate
+#endif
+#endif
+#endif
+#endif
+#endif
+#endif
+
+
+// =============================================================================
+#ifdef GuiConst_COLOR_DEPTH_1
+  #define GuiLib_COLOR_BYTESIZE_1
+#endif
+#ifdef GuiConst_COLOR_DEPTH_2
+  #define GuiLib_COLOR_BYTESIZE_1
+#endif
+#ifdef GuiConst_COLOR_DEPTH_4
+  #define GuiLib_COLOR_BYTESIZE_1
+#endif
+#ifdef GuiConst_COLOR_DEPTH_5
+  #define GuiLib_COLOR_BYTESIZE_1
+#endif
+#ifdef GuiConst_COLOR_DEPTH_8
+  #define GuiLib_COLOR_BYTESIZE_1
+#endif
+#ifdef GuiConst_COLOR_DEPTH_12
+  #define GuiLib_COLOR_BYTESIZE_2
+#endif
+#ifdef GuiConst_COLOR_DEPTH_15
+  #define GuiLib_COLOR_BYTESIZE_2
+#endif
+#ifdef GuiConst_COLOR_DEPTH_16
+  #define GuiLib_COLOR_BYTESIZE_2
+#endif
+#ifdef GuiConst_COLOR_DEPTH_18
+  #define GuiLib_COLOR_BYTESIZE_3
+#endif
+#ifdef GuiConst_COLOR_DEPTH_24
+  #define GuiLib_COLOR_BYTESIZE_3
+#endif
+#ifdef GuiConst_COLOR_DEPTH_32
+  #define GuiLib_COLOR_BYTESIZE_3
+#endif
+
+#define GuiLib_NO_CURSOR                    -1
+
+#define GuiLib_NO_RESET_AUTO_REDRAW         0
+#define GuiLib_RESET_AUTO_REDRAW            1
+
+#define GuiLib_ALIGN_NOCHANGE               0
+#define GuiLib_ALIGN_LEFT                   1
+#define GuiLib_ALIGN_CENTER                 2
+#define GuiLib_ALIGN_RIGHT                  3
+
+#define GuiLib_PS_NOCHANGE                  0
+#define GuiLib_PS_OFF                       1
+#define GuiLib_PS_ON                        2
+#define GuiLib_PS_NUM                       3
+
+#define GuiLib_TRANSPARENT_OFF              0
+#define GuiLib_TRANSPARENT_ON               1
+
+#define GuiLib_UNDERLINE_OFF                0
+#define GuiLib_UNDERLINE_ON                 1
+
+#define GuiLib_BBP_NONE                     0
+#define GuiLib_BBP_LEFT                     1
+#define GuiLib_BBP_RIGHT                    2
+#define GuiLib_BBP_TOP                      4
+#define GuiLib_BBP_BOTTOM                   8
+
+#define GuiLib_VAR_BOOL                     0
+#define GuiLib_VAR_UNSIGNED_CHAR            1
+#define GuiLib_VAR_SIGNED_CHAR              2
+#define GuiLib_VAR_UNSIGNED_INT             3
+#define GuiLib_VAR_SIGNED_INT               4
+#define GuiLib_VAR_UNSIGNED_LONG            5
+#define GuiLib_VAR_SIGNED_LONG              6
+#define GuiLib_VAR_FLOAT                    7
+#define GuiLib_VAR_DOUBLE                   8
+#define GuiLib_VAR_STRING                   9
+#define GuiLib_VAR_COLOR                    10
+#define GuiLib_VAR_NONE                     255
+
+#define GuiLib_FORMAT_DEC                   0
+#define GuiLib_FORMAT_EXP                   1
+#define GuiLib_FORMAT_HEX_POSTFIX_H         2
+#define GuiLib_FORMAT_TIME_MMSS             3
+#define GuiLib_FORMAT_TIME_HHMM_24          4
+#define GuiLib_FORMAT_TIME_HHMMSS_24        5
+#define GuiLib_FORMAT_TIME_HHMM_12_ampm     6
+#define GuiLib_FORMAT_TIME_HHMMSS_12_ampm   7
+#define GuiLib_FORMAT_TIME_HHMM_12_AMPM     8
+#define GuiLib_FORMAT_TIME_HHMMSS_12_AMPM   9
+#define GuiLib_FORMAT_HEX_PREFIX_0X         10
+#define GuiLib_FORMAT_HEX_CLEAN             11
+
+#define GuiLib_FORMAT_ALIGNMENT_LEFT        0
+#define GuiLib_FORMAT_ALIGNMENT_CENTER      1
+#define GuiLib_FORMAT_ALIGNMENT_RIGHT       2
+
+#define GuiLib_DECIMAL_PERIOD               0
+#define GuiLib_DECIMAL_COMMA                1
+
+#define GuiLib_LANGUAGE_TEXTDIR_LEFTTORIGHT 0
+#define GuiLib_LANGUAGE_TEXTDIR_RIGHTTOLEFT 1
+
+#define GuiLib_TEXTBOX_SCROLL_ILLEGAL_NDX   0
+#define GuiLib_TEXTBOX_SCROLL_INSIDE_BLOCK  1
+#define GuiLib_TEXTBOX_SCROLL_AT_HOME       2
+#define GuiLib_TEXTBOX_SCROLL_AT_END        3
+#define GuiLib_TEXTBOX_SCROLL_ABOVE_HOME    4
+#define GuiLib_TEXTBOX_SCROLL_BELOW_END     5
+
+#define GuiLib_BUTTON_STATE_UP              0
+#define GuiLib_BUTTON_STATE_DOWN            1
+#define GuiLib_BUTTON_STATE_DISABLED        2
+
+#define GuiLib_CHECKBOX_OFF                 0
+#define GuiLib_CHECKBOX_ON                  1
+
+#define GuiLib_RADIOBUTTON_OFF             -1
+
+
+#define GuiLib_NO_COLOR                     0x10000000
+
+
+// =============================================================================
+typedef struct
+{
+  GuiConst_INT16S ByteBegin;
+  GuiConst_INT16S ByteEnd;
+}
+GuiLib_DisplayLineRec;
+
+#ifdef GuiConst_CODEVISION_COMPILER
+typedef flash struct
+#else
+typedef struct
+#endif
+{
+#ifdef GuiConst_CHARMODE_ANSI
+  GuiConst_INT8U FirstChar;
+  GuiConst_INT8U LastChar;
+  GuiConst_INT16U FirstCharNdx;
+  GuiConst_INT16U IllegalCharNdx;
+#else
+  GuiConst_INT16U CharCount;
+  GuiConst_INT32U FirstCharNdx;
+#endif
+  GuiConst_INT8U XSize, YSize;
+#ifdef GuiConst_ADV_FONTS_ON
+  GuiConst_INT8U ColorDepth;
+#endif
+  GuiConst_INT8U TopLine, MidLine, BaseLine;
+  GuiConst_INT8U Cursor1, Cursor2;
+  GuiConst_INT8U Underline1, Underline2;
+  GuiConst_INT8U BoxWidth;
+  GuiConst_INT8U PsNumWidth;
+  GuiConst_INT8U PsSpace;
+  GuiConst_INT8U LineSize;
+}
+GuiLib_FontRec;
+
+#ifdef GuiConst_ICC_COMPILER
+typedef GuiLib_FontRec PrefixRom *GuiLib_FontRecPtr;
+typedef const GuiLib_FontRec * GuiLib_FontRecConstPtr;
+#else
+#ifdef GuiConst_CODEVISION_COMPILER
+typedef flash GuiLib_FontRec *GuiLib_FontRecPtr;
+typedef flash GuiLib_FontRec *GuiLib_FontRecConstPtr;
+#else
+typedef GuiLib_FontRec PrefixRom *GuiLib_FontRecPtr;
+typedef const GuiLib_FontRec PrefixRom *GuiLib_FontRecConstPtr;
+#endif
+#endif
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+typedef struct
+{
+  GuiConst_INT32S X;
+  GuiConst_INT32S Y;
+} GuiLib_GraphDataPoint;
+#endif
+
+// =============================================================================
+#ifdef GuiConst_DISPLAY_BUFFER_EASYGUI
+#ifdef GuiConst_COLOR_DEPTH_1
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#ifdef GuiConst_COLOR_DEPTH_2
+#ifdef GuiConst_COLOR_PLANES_2
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[2][GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#else
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#endif
+#ifdef GuiConst_COLOR_DEPTH_4
+#ifdef GuiConst_COLOR_PLANES_4
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[4][GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#else
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#endif
+#ifdef GuiConst_COLOR_DEPTH_5
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#ifdef GuiConst_COLOR_DEPTH_8
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#ifdef GuiConst_COLOR_DEPTH_12
+typedef union
+{
+  GuiConst_INT8U  Bytes[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+  GuiConst_INT16U Words[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE / 2];
+} DisplayBufUnion;
+extern DisplayBufUnion GuiLib_DisplayBuf;
+#endif
+#ifdef GuiConst_COLOR_DEPTH_15
+typedef union
+{
+  GuiConst_INT8U  Bytes[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+  GuiConst_INT16U Words[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE / 2];
+} DisplayBufUnion;
+extern DisplayBufUnion GuiLib_DisplayBuf;
+#endif
+#ifdef GuiConst_COLOR_DEPTH_16
+typedef union
+{
+  GuiConst_INT8U  Bytes[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+  GuiConst_INT16U Words[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE / 2];
+} DisplayBufUnion;
+extern DisplayBufUnion GuiLib_DisplayBuf;
+#endif
+#ifdef GuiConst_COLOR_DEPTH_18
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#ifdef GuiConst_COLOR_DEPTH_24
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#ifdef GuiConst_COLOR_DEPTH_32
+extern GuiConst_INT8U
+  GuiLib_DisplayBuf[GuiConst_BYTE_LINES][GuiConst_BYTES_PR_LINE];
+#endif
+#endif
+
+extern GuiLib_DisplayLineRec GuiLib_DisplayRepaint[GuiConst_BYTE_LINES];
+#ifdef GuiConst_VNC_REMOTE_SUPPORT_ON
+extern GuiLib_DisplayLineRec GuiLib_VncRepaint[GuiConst_BYTE_LINES];
+#endif // GuiConst_VNC_REMOTE_SUPPORT_ON
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+extern GuiConst_INT16S GuiLib_ActiveCursorFieldNo;
+#endif
+extern GuiConst_INT16S GuiLib_LanguageIndex;
+extern GuiConst_INT16S GuiLib_CurStructureNdx;
+#ifdef GuiConst_ALLOW_UPSIDEDOWN_AT_RUNTIME
+extern GuiConst_INT8U GuiLib_DisplayUpsideDown;
+#endif
+
+#ifdef GuiConst_REMOTE_DATA
+extern void (*GuiLib_RemoteDataReadBlock) (
+   GuiConst_INT32U SourceOffset,
+   GuiConst_INT32U SourceSize,
+   GuiConst_INT8U * TargetAddr);
+#ifdef GuiConst_REMOTE_TEXT_DATA
+extern void (*GuiLib_RemoteTextReadBlock) (
+   GuiConst_INT32U SourceOffset,
+   GuiConst_INT32U SourceSize,
+   void * TargetAddr);
+#endif
+#endif
+
+
+// =============================================================================
+#include "GuiFont.h"
+#include "GuiStruct.h"
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_DegToRad
+// ===============
+//
+// Converts angle from degrees to radians.
+//
+// Input:
+// ------
+// Angle in degrees * 10 (1° = 10)
+//
+// Output:
+// -------
+// Angle in radians * 4096 (1 rad = 4096)
+//
+extern GuiConst_INT32S GuiLib_DegToRad(
+   GuiConst_INT32S Angle);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_RadToDeg
+// ===============
+//
+// Converts angle from radians to degrees.
+//
+// Input:
+// ------
+// Angle in radians * 4096 (1 rad = 4096)
+//
+// Output:
+// -------
+// Angle in degrees * 10 (1° = 10)
+//
+extern GuiConst_INT32S GuiLib_RadToDeg(
+   GuiConst_INT32S Angle);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_SinRad
+// =============
+//
+// Calculates Sin(angle), where angle is in radians (factored).
+//
+// Input:
+// ------
+// Angle in radians * 4096 (1 rad = 4096)
+//
+// Output:
+// -------
+// Sine of angle in 1/4096 units
+//
+extern GuiConst_INT32S GuiLib_SinRad(
+   GuiConst_INT32S Angle);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_SinDeg
+// =============
+//
+// Calculates Sin(angle), where angle is in degrees (factored).
+//
+// Input:
+// ------
+// Angle in degrees * 10 (1° = 10)
+//
+// Output:
+// -------
+// Sine of angle in 1/4096 units
+//
+extern GuiConst_INT32S GuiLib_SinDeg(
+   GuiConst_INT32S Angle);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_CosRad
+// =============
+//
+// Calculates Cos(angle), where angle is in radians (factored).
+//
+// Input:
+// ------
+// Angle in radians * 4096 (1 rad = 4096)
+//
+// Output:
+// -------
+// Cosine of angle in 1/4096 units
+//
+extern GuiConst_INT32S GuiLib_CosRad(
+   GuiConst_INT32S Angle);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_CosDeg
+// =============
+//
+// Calculates Cos(angle), where angle is in degrees (factored).
+//
+// Input:
+// ------
+// Angle in degrees * 10 (1° = 10)
+//
+// Output:
+// -------
+// Cosine of angle in 1/4096 units
+//
+extern GuiConst_INT32S GuiLib_CosDeg(
+   GuiConst_INT32S Angle);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Sqrt
+// ===========
+//
+// Returns Square root of argument.
+//
+// Input:
+// ------
+// Argument
+//
+// Output:
+// -------
+// Square root of argument
+//
+extern GuiConst_INT32U GuiLib_Sqrt(
+   GuiConst_INT32U X);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetRedRgbColor
+// =====================
+//
+// Extracts red component from RGB color.
+//
+// Input:
+// ------
+// 24 bit RGB color
+//
+// Output:
+// -------
+// 8 bit red color component
+//
+extern GuiConst_INT8U GuiLib_GetRedRgbColor(
+   GuiConst_INT32U RgbColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_SetRedRgbColor
+// =====================
+//
+// Sets red component from RGB color.
+//
+// Input:
+// ------
+// 24 bit RGB color
+// 8 bit red color component
+//
+// Output:
+// -------
+// 24 bit RGB color
+//
+extern GuiConst_INT32U GuiLib_SetRedRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT8U RedColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetGreenRgbColor
+// =======================
+//
+// Extracts green component from RGB color.
+//
+// Input:
+// ------
+// 24 bit RGB color
+//
+// Output:
+// -------
+// 8 bit green color component
+//
+extern GuiConst_INT8U GuiLib_GetGreenRgbColor(
+   GuiConst_INT32U RgbColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_SetGreenRgbColor
+// =======================
+//
+// Sets green component from RGB color.
+//
+// Input:
+// ------
+// 24 bit RGB color
+// 8 bit green color component
+//
+// Output:
+// -------
+// 24 bit RGB color
+//
+extern GuiConst_INT32U GuiLib_SetGreenRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT8U GreenColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetBlueRgbColor
+// ======================
+//
+// Extracts blue component from RGB color.
+//
+// Input:
+// ------
+// 24 bit RGB color
+//
+// Output:
+// -------
+// 8 bit blue color component
+//
+extern GuiConst_INT8U GuiLib_GetBlueRgbColor(
+   GuiConst_INT32U RgbColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_SetBlueRgbColor
+// ======================
+//
+// Sets blue component from RGB color.
+//
+// Input:
+// ------
+// 24 bit RGB color
+// 8 bit blue color component
+//
+// Output:
+// -------
+// 24 bit RGB color
+//
+extern GuiConst_INT32U GuiLib_SetBlueRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT8U BlueColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_RgbToPixelColor
+// ======================
+//
+// Translates from RGB color to proper pixel value for display controller
+// color setup.
+//
+// Input:
+// ------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+extern GuiConst_INTCOLOR GuiLib_RgbToPixelColor(
+   GuiConst_INT32U RgbColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Rgb888ToPixelColor
+// =========================
+//
+// Translates from RGB color components to proper pixel value for display
+// controller color setup.
+//
+// Input:
+// ------
+// Red color value
+// Green color value
+// Blue color value
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+GuiConst_INTCOLOR GuiLib_Rgb888ToPixelColor(
+   GuiConst_INT8U Red, GuiConst_INT8U Green, GuiConst_INT8U Blue);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_PixelToRgbColor
+// ======================
+//
+// Translates from pixel value for display controller color setup to RGB color.
+//
+// Input:
+// ------
+// Encoded pixel color value
+//
+// Output:
+// -------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+extern GuiConst_INT32U GuiLib_PixelToRgbColor(
+   GuiConst_INTCOLOR PixelColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_RgbColorToGrayScale
+// ==========================
+//
+// Translates from RGB color to 0~255 gray scale value.
+//
+// Input:
+// ------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+// Output:
+// -------
+// Gray scale value, 0~255
+//
+extern GuiConst_INT8U GuiLib_RgbColorToGrayScale(
+   GuiConst_INT32U RgbColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Rgb888ColorToGrayScale
+// =============================
+//
+// Translates from RGB color components to a 0~255 grayscale value.
+//
+// Input:
+// ------
+// Red color value
+// Green color value
+// Blue color value
+//
+// Output:
+// -------
+// Gray scale value, 0~255
+//
+GuiConst_INT8U GuiLib_Rgb888ColorToGrayScale(
+   GuiConst_INT8U Red, GuiConst_INT8U Green, GuiConst_INT8U Blue);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GrayScaleToRgbColor
+// ==========================
+//
+// Translates from 0~255 gray scale value to RGB color.
+//
+// Input:
+// ------
+// Gray scale value, 0~255
+//
+// Output:
+// -------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+extern GuiConst_INT32U GuiLib_GrayScaleToRgbColor(
+   GuiConst_INT8U GrayValue);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_PixelColorToGrayScale
+// ============================
+//
+// Translates from pixel value for display controller color setup to 0~255 gray
+// scale value.
+//
+// Input:
+// ------
+// Encoded pixel color value
+//
+// Output:
+// -------
+// Gray scale value, 0~255
+//
+extern GuiConst_INT8U GuiLib_PixelColorToGrayScale(
+   GuiConst_INTCOLOR PixelColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GrayScaleToPixelColor
+// ============================
+//
+// Translates from gray scale value to display controller color setup.
+//
+// Input:
+// ------
+// Gray scale value, 0~255
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+extern GuiConst_INTCOLOR GuiLib_GrayScaleToPixelColor(
+   GuiConst_INT8U GrayValue);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_BrightenRgbColor
+// =======================
+//
+// Brightens RGB color 0~1000‰, 1000‰ results in pure white.
+//
+// Input:
+// ------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+// Brighten value, 0 ~ 1000‰
+//
+// Output:
+// -------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+extern GuiConst_INT32U GuiLib_BrightenRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_BrightenPixelColor
+// =========================
+//
+// Brightens color in display controller color setup 0~1000‰, 1000‰ results in
+// pure white.
+//
+// Input:
+// ------
+// Encoded pixel color value
+// Brighten value, 0 ~ 1000‰
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+extern GuiConst_INTCOLOR GuiLib_BrightenPixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_DarkenRgbColor
+// =====================
+//
+// Darkens RGB color 0~1000‰, 1000‰ results in pure black.
+//
+// Input:
+// ------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+// Darken value, 0 ~ 1000‰
+//
+// Output:
+// -------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+extern GuiConst_INT32U GuiLib_DarkenRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_DarkenPixelColor
+// =======================
+//
+// Darkens color in display controller color setup 0~1000‰, 1000‰ results in
+// pure black.
+//
+// Input:
+// ------
+// Encoded pixel color value
+// Darken value, 0 ~ 1000‰
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+extern GuiConst_INTCOLOR GuiLib_DarkenPixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_MiddleRgbColor
+// =====================
+//
+// Gives middle color, between color 1 and color 2.
+// Ratio in 0~1000‰, 0‰ gives color 1, 1000‰ gives color 2.
+//
+// Input:
+// ------
+// RGB color 1 value
+// RGB color 2 value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+// Color ratio, 0 ~ 1000‰
+//
+// Output:
+// -------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+extern GuiConst_INT32U GuiLib_MiddleRgbColor(
+   GuiConst_INT32U RgbColor1,
+   GuiConst_INT32U RgbColor2,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_MiddlePixelColor
+// =======================
+//
+// Gives middle color in display controller color setup,
+// between color 1 and color 2.
+// Ratio in 0~1000‰, 0‰ gives color 1, 1000‰ gives color 2.
+//
+// Input:
+// ------
+// Encoded pixel color 1 value
+// Encoded pixel color 2 value
+// Color ratio, 0 ~ 1000‰
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+extern GuiConst_INTCOLOR GuiLib_MiddlePixelColor(
+   GuiConst_INTCOLOR PixelColor1,
+   GuiConst_INTCOLOR PixelColor2,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_DesaturateRgbColor
+// =========================
+//
+// Removes saturation from color, turning it towards gray color.
+// Ratio in 0~1000‰, 0‰ gives color 1, 1000‰ gives gray.
+//
+// Input:
+// ------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+// Desaturation ratio, 0 ~ 1000‰
+//
+// Output:
+// -------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+extern GuiConst_INT32U GuiLib_DesaturateRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_DesaturatePixelColor
+// ===========================
+//
+// Removes saturation from color, turning it towards gray color.
+// Ratio in 0~1000‰, 0‰ gives color 1, 1000‰ gives gray.
+//
+// Input:
+// ------
+// Encoded pixel color value
+// Color ratio, 0 ~ 1000‰
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+extern GuiConst_INTCOLOR GuiLib_DesaturatePixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_AccentuateRgbColor
+// =========================
+//
+// Accentuates RGB color. Colors with less than 50% mean gray are made darker,
+// otherwise brighter. Amount in ‰, 0‰ gives no change, 1000‰ gives pure black
+// or white.
+//
+// Input:
+// ------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+// Accentuate value, 0 ~ 1000‰
+//
+// Output:
+// -------
+// RGB color value
+// (32 bit, 24 bits used, low byte = Red, middle byte = Green, high byte = Blue)
+//
+extern GuiConst_INT32U GuiLib_AccentuateRgbColor(
+   GuiConst_INT32U RgbColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_AccentuatePixelColor
+// ===========================
+//
+// Accentuates color in display controller color setup. Colors with less than
+// 50% mean gray are made darker, otherwise brighter. Amount in ‰, 0‰ gives no
+// change, 1000‰ gives pure black or white.
+//
+// Input:
+// ------
+// Encoded pixel color value
+// Accentuate value, 0 ~ 1000‰
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+extern GuiConst_INTCOLOR GuiLib_AccentuatePixelColor(
+   GuiConst_INTCOLOR PixelColor,
+   GuiConst_INT16U Amount);
+// -----------------------------------------------------------------------------
+
+// =============================================================================
+// GuiLib_SetButtonDisabledColor
+// =============================
+//
+// Override automatic generation of button disabled color with the specified
+// pixel color value.
+//
+// Input:
+// ------
+// Encoded pixel color value
+//
+// Output:
+// -------
+// Encoded pixel color value
+//
+GuiConst_INTCOLOR GuiLib_SetButtonDisabledColor(GuiConst_INTCOLOR PixelColor);
+// -----------------------------------------------------------------------------
+
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+
+// =============================================================================
+// GuiLib_ResetClipping
+// ====================
+//
+// Resets clipping.
+// Drawing can be limited to a rectangular portion of the screen,
+// this routine resets the clipping limits to the entire screen.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ResetClipping(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_SetClipping
+// ==================
+//
+// Sets clipping.
+// Drawing can be limited to a rectangular portion of the screen,
+// this routine sets the clipping limits expressed as two opposite
+// corner coordinates.
+//
+// Input:
+// ------
+// Rectangle coordinates
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_SetClipping(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+// =============================================================================
+// GuiLib_ResetDisplayRepaint
+// ==========================
+//
+// Resets all repainting scan line markers.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ResetDisplayRepaint(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_MarkDisplayBoxRepaint
+// ============================
+//
+// Sets the repainting scan line markers, indicating that all pixels inside the
+// specified rectangle must be repainted.
+//
+// Input:
+// ------
+// Rectangle coordinates
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_MarkDisplayBoxRepaint(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ClearDisplay
+// ===================
+//
+// Clears the screen.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ClearDisplay(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Dot
+// ==========
+//
+// Draws a single pixel.
+//
+// Input:
+// ------
+// Coordinates
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Dot(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetDot
+// =============
+//
+// Returns the color of a single pixel.
+//
+// Input:
+// ------
+// Coordinates
+//
+// Output:
+// -------
+// Color
+//
+extern GuiConst_INTCOLOR GuiLib_GetDot(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Line
+// ===========
+//
+// Draws a line.
+//
+// Input:
+// ------
+// Coordinates
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Line(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_LinePattern
+// ==================
+//
+// Draws a patterned line.
+//
+// Input:
+// ------
+// Coordinates
+// Line pattern (8 pixel pattern)
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_LinePattern(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INT8U LinePattern,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_HLine
+// ============
+//
+// Draws a horizontal line.
+//
+// Input:
+// ------
+// Coordinates
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_HLine(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_VLine
+// ============
+//
+// Draws a vertical line.
+//
+// Input:
+// ------
+// Coordinates
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_VLine(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Box
+// ==========
+//
+// Draws a single pixel wide rectangle.
+//
+// Input:
+// ------
+// Coordinates
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Box(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_FillBox
+// ==============
+//
+// Draws a filled rectangle.
+//
+// Input:
+// ------
+// Coordinates
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_FillBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_BorderBox
+// ================
+//
+// Draws a filled rectangle with single pixel border.
+//
+// Input:
+// ------
+// Coordinates
+// Border and fill colors
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_BorderBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INTCOLOR BorderColor,
+   GuiConst_INTCOLOR FillColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_InvertBox
+// ================
+//
+// Inverts a block.
+//
+// Input:
+// ------
+// Coordinates
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_InvertBox(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Circle
+// =============
+//
+// Draws a filled or framed circle with single pixel width border.
+//
+// Input:
+// ------
+// Center coordinate
+// Radius
+// Border color, GuiLib_NO_COLOR means same color as fill color
+// Fill color, GuiLib_NO_COLOR means no filling
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Circle(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U Radius,
+   GuiConst_INT32S BorderColor,
+   GuiConst_INT32S FillColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Ellipse
+// ==============
+//
+// Draws a filled or framed ellipse with single pixel width border.
+//
+// Input:
+// ------
+// Center coordinate
+// Horizontal and vertical radii
+// Border color, GuiLib_NO_COLOR means same color as fill color
+// Fill color, GuiLib_NO_COLOR means no filling
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Ellipse(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U Radius1,
+   GuiConst_INT16U Radius2,
+   GuiConst_INT32S BorderColor,
+   GuiConst_INT32S FillColor);
+// -----------------------------------------------------------------------------
+
+
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+
+// =============================================================================
+// GuiLib_ShowBitmap
+// =================
+//
+// Displays a stored bitmap.
+//
+// Input:
+// ------
+// Bitmap index in GuiStruct_BitmapPtrList
+// Coordinates for upper left corner
+// Transparent background color, -1 means no transparency
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ShowBitmap(
+   GuiConst_INT16U BitmapIndex,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT32S TranspColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ShowBitmapAt
+// ===================
+//
+// Displays a bitmap at a specific address.
+// The data in the memory area must conform to the format explained in the
+// easyGUI user manual.
+//
+// Input:
+// ------
+// Pointer to memory area
+// Coordinates for upper left corner
+// Transparent background color, -1 means no transparency
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ShowBitmapAt(
+   GuiConst_INT8U * BitmapPtr,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT32S TranspColor);
+// -----------------------------------------------------------------------------
+
+
+// ============================================================================
+// GuiLib_ShowBitmapArea
+// =====================
+//
+// Displays part of a stored bitmap.
+//
+// Input:
+// ------
+// Bitmap index in GuiStruct_BitmapPtrList
+// Starting coordinates for upper left corner of bitmap
+// Absolute coordinates for upper left and lower right corner of displayed area
+// Transparent background color, -1 means no transparency
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ShowBitmapArea(
+   GuiConst_INT16U BitmapIndex,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S AX1,
+   GuiConst_INT16S AY1,
+   GuiConst_INT16S AX2,
+   GuiConst_INT16S AY2,
+   GuiConst_INT32S TranspColor);
+// -----------------------------------------------------------------------------
+
+
+// ============================================================================
+// GuiLib_ShowBitmapAreaAt
+// =======================
+//
+// Displays part of a bitmap at a specific address.
+// The data in the memory area must conform to the format explained in the
+// easyGUI user manual.
+//
+// Input:
+// ------
+// Pointer to memory area
+// Starting coordinates for upper left corner of bitmap
+// Absolute coordinates for upper left and lower right corner of displayed area
+// Transparent background color, -1 means no transparency
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ShowBitmapAreaAt(
+   GuiConst_INT8U * BitmapPtr,
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S AX1,
+   GuiConst_INT16S AY1,
+   GuiConst_INT16S AX2,
+   GuiConst_INT16S AY2,
+   GuiConst_INT32S TranspColor);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+// =============================================================================
+// GuiLib_DrawChar
+// ===============
+//
+// Draws a single character on the display.
+//
+// Input:
+// ------
+// Coordinates
+// Font index
+// Character
+// Color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_DrawChar(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U FontNo,
+   GuiConst_TEXT Character,
+   GuiConst_INTCOLOR Color);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_DrawStr
+// ==============
+//
+// Draws a text string on the display.
+//
+// Input:
+// ------
+// Coordinates
+// Font index
+// Text string
+// Alignment
+// Ps mode
+// Transparent
+// Underlining
+// Back box size X (0 = none)
+// Back box size Y1 (height above base line, 0 = default font box)
+// Back box size Y2 (height below base line, 0 = default font box)
+// Extra back box pixels
+// Text color
+// Background box color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_DrawStr(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U FontNo,
+   GuiConst_TEXT PrefixLocate *String,
+   GuiConst_INT8U Alignment,
+   GuiConst_INT8U PsWriting,
+   GuiConst_INT8U Transparent,
+   GuiConst_INT8U Underlining,
+   GuiConst_INT16S BackBoxSizeX,
+   GuiConst_INT16S BackBoxSizeY1,
+   GuiConst_INT16S BackBoxSizeY2,
+   GuiConst_INT8U BackBorderPixels,
+   GuiConst_INTCOLOR ForeColor,
+   GuiConst_INTCOLOR BackColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_DrawVar
+// ==============
+//
+// Draws a variable on the display.
+//
+// Input:
+// ------
+// Coordinates
+// Font index
+// Variable pointer reference
+// Variable type - can be:
+//                   GuiLib_VAR_BOOL
+//                   GuiLib_VAR_UNSIGNED_CHAR
+//                   GuiLib_VAR_SIGNED_CHAR
+//                   GuiLib_VAR_UNSIGNED_INT
+//                   GuiLib_VAR_SIGNED_INT
+//                   GuiLib_VAR_UNSIGNED_LONG
+//                   GuiLib_VAR_SIGNED_LONG
+//                   GuiLib_VAR_FLOAT
+//                   GuiLib_VAR_DOUBLE
+//                   GuiLib_VAR_STRING
+// Variable format - can be:
+//                   GuiLib_FORMAT_DEC
+//                   GuiLib_FORMAT_EXP
+//                   GuiLib_FORMAT_HEX
+//                   GuiLib_FORMAT_TIME_MMSS
+//                   GuiLib_FORMAT_TIME_HHMM_24
+//                   GuiLib_FORMAT_TIME_HHMMSS_24
+//                   GuiLib_FORMAT_TIME_HHMM_12_ampm
+//                   GuiLib_FORMAT_TIME_HHMMSS_12_ampm
+//                   GuiLib_FORMAT_TIME_HHMM_12_AMPM
+//                   GuiLib_FORMAT_TIME_HHMMSS_12_AMPM
+// Variable format field width
+// Variable format alignment - can be:
+//                   GuiLib_FORMAT_ALIGNMENT_LEFT
+//                   GuiLib_FORMAT_ALIGNMENT_CENTER
+//                   GuiLib_FORMAT_ALIGNMENT_RIGHT
+// Variable format decimals
+// Variable format show sign (true or false)
+// Variable format zero padding (true or false)
+// Variable format trailing zeros (true or false)
+// Variable format thousands separator (true or false)
+// Alignment
+// Ps mode
+// Transparent
+// Underlining
+// Back box size X (0 = none)
+// Back box size Y1 (height above base line, 0 = default font box)
+// Back box size Y2 (height below base line, 0 = default font box)
+// Extra back box pixels
+// Text color
+// Background box color
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_DrawVar(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16U FontNo,
+   void PrefixLocate *VarPtr,
+   GuiConst_INT8U VarType,
+   GuiConst_INT8U FormatterFormat,
+   GuiConst_INT8U FormatterFieldWidth,
+   GuiConst_INT8U FormatterAlignment,
+   GuiConst_INT8U FormatterDecimals,
+   GuiConst_INT8U FormatterShowSign,
+   GuiConst_INT8U FormatterZeroPadding,
+   GuiConst_INT8U FormatterTrailingZeros,
+   GuiConst_INT8U FormatterThousandsSeparator,
+   GuiConst_INT8U Alignment,
+   GuiConst_INT8U PsWriting,
+   GuiConst_INT8U Transparent,
+   GuiConst_INT8U Underlining,
+   GuiConst_INT16S BackBoxSizeX,
+   GuiConst_INT16S BackBoxSizeY1,
+   GuiConst_INT16S BackBoxSizeY2,
+   GuiConst_INT8U BackBorderPixels,
+   GuiConst_INTCOLOR ForeColor,
+   GuiConst_INTCOLOR BackColor);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Init
+// ===========
+//
+// Initialises the easyGUI library module.
+// MUST be called at application startup, before using the easyGUI library.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Init(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Clear
+// ============
+//
+// Clears the screen, and resets the easyGUI system.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Clear(void);
+// -----------------------------------------------------------------------------
+
+
+#ifdef GuiConst_CHARMODE_UNICODE
+
+// =============================================================================
+// GuiLib_UnicodeStrLen
+// ====================
+//
+// Calculates length of Unicode string.
+// This function is equivalent to the ANSI character mode strlen function.
+//
+// Input:
+// ------
+// Unicode string reference
+//
+// Output:
+// -------
+// Length in characters, excluding zero termination
+//
+extern GuiConst_INT16U GuiLib_UnicodeStrLen(
+   GuiConst_TEXT PrefixLocate *S);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_StrAnsiToUnicode
+// =======================
+//
+// Converts ANSI string to Unicode string.
+//
+// Input:
+// ------
+// ANSI and Unicode string references
+// Unicode string must have sufficient space
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_StrAnsiToUnicode(
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_CHAR PrefixLocate *S1);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_UnicodeStrCmp
+// ====================
+//
+// Compares two Unicode strings.
+// This function is equivalent to the ANSI character mode strcmp function.
+//
+// Input:
+// ------
+// Unicode string references
+//
+// Output:
+// -------
+// <0: S1 is less than S2
+// =0: S1 and S2 are equal
+// >0: S1 is greater than S2
+//
+GuiConst_INT16S GuiLib_UnicodeStrCmp(
+   GuiConst_TEXT PrefixLocate *S1,
+   GuiConst_TEXT PrefixLocate *S2);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_UnicodeStrNCmp
+// =====================
+//
+// Compares two Unicode strings, until the N'th character.
+// This function is equivalent to the ANSI character mode strncmp function.
+//
+// Input:
+// ------
+// Unicode string references
+// Character count to compare
+//
+// Output:
+// -------
+// <0: S1 is less than S2 inside the N characters
+// =0: S1 and S2 are equal inside the N characters
+// >0: S1 is greater than S2 inside the N characters
+//
+GuiConst_INT16S GuiLib_UnicodeStrNCmp(
+   GuiConst_TEXT PrefixLocate *S1,
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_INT16U StrLen);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_UnicodeStrCpy
+// ====================
+//
+// Copy from one Unicode string to another.
+// This function is equivalent to the ANSI character mode strcpy function
+//
+// Input:
+// ------
+// S1: Unicode source string reference
+// S2: Unicode destination string reference
+// Unicode destination string must have sufficient space
+//
+// Output:
+// -------
+// None
+//
+void GuiLib_UnicodeStrCpy(
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_TEXT PrefixLocate *S1);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_UnicodeStrNCpy
+// =====================
+//
+// Copy from one Unicode string to another. No more than source StrLen bytes are
+// copied.
+// Bytes following a source null byte are not copied.
+// If needed target is padded with null bytes until reaching StrLen.
+// This function is equivalent to the ANSI character mode strncpy function.
+//
+// Input:
+// ------
+// S1: Unicode source string reference
+// S2: Unicode destination string reference
+// StrLen: Number of characters to copy
+// Unicode destination string must have sufficient space
+//
+// Output:
+// -------
+// None
+//
+void GuiLib_UnicodeStrNCpy(
+   GuiConst_TEXT PrefixLocate *S2,
+   GuiConst_TEXT PrefixLocate *S1,
+   GuiConst_INT16U StrLen);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+// =============================================================================
+// GuiLib_ShowScreen
+// =================
+//
+// Instructs structure drawing task to draw a complete structure.
+//
+// Input:
+// ------
+// Structure ID
+// Active cursor field No. -
+//    use GuiLib_NO_CURSOR if there is no cursor to show
+// Maintain or erase old AutoReadraw fields -
+//    use GuiLib_NO_RESET_AUTO_REDRAW or GuiLib_RESET_AUTO_REDRAW
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ShowScreen(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16S CursorFieldToShow,
+   GuiConst_INT8U ResetAutoRedraw);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetTextLanguagePtr
+// =========================
+//
+// Returns pointer to text in structure
+// Language of selected text can be freely selected, no matter what language
+// is active
+//
+// Input:
+// ------
+// Structure ID
+// Text No. - index 0 is first text in structure, Item types other than Texts
+// and Paragraph are ignored
+//
+// Output:
+// -------
+// Pointer to text based on structure, text No. and current language
+// Returns Nil if no text was found
+//
+extern GuiConst_TEXT PrefixLocate *GuiLib_GetTextLanguagePtr(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16U TextNo,
+   GuiConst_INT16S LanguageIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetTextPtr
+// =================
+//
+// Returns pointer to text in structure
+//
+// Input:
+// ------
+// Structure ID
+// Text No. - index 0 is first text in the structure, item types other than
+// Text and Paragraph are ignored
+//
+// Output:
+// -------
+// Pointer to text based on structure, text No. and current language
+// Returns Nil if no text was found
+//
+extern GuiConst_TEXT PrefixLocate *GuiLib_GetTextPtr(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16U TextNo);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetTextWidth
+// ===================
+//
+// Returns width of text in pixels
+//
+// Input:
+// ------
+// Pointer to text string
+// Pointer to font
+// PS writing mode - can be:
+//   GuiLib_PS_OFF   No proportional writing
+//   GuiLib_PS_ON    Normal proportional writing
+//   GuiLib_PS_NUM   Numerical proportional writing
+//
+// Output:
+// -------
+// Width of text in pixels, returns zero if an error is encountered
+//
+extern GuiConst_INT16U GuiLib_GetTextWidth(
+   GuiConst_TEXT PrefixLocate *String,
+   GuiLib_FontRecConstPtr Font,
+   GuiConst_INT8U PsWriting);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GetCharCode
+// ==================
+//
+// Returns ANSI or Unicode code of specific character in string
+//
+// Input:
+// ------
+// Structure ID
+// Text No. - index 0 is first text in the structure, item types other than
+// Text and Paragraph are ignored
+// Character position
+// Omit control codes, Control codes are soft and hard line breaks
+//   0 - count all charactes
+//   1 - omit control codes during counting
+//
+// Output:
+// -------
+// ANSI or Unicode code of character, returns zero if an error is encountered
+//
+extern GuiConst_TEXT GuiLib_GetCharCode(
+   const GuiConst_INT16U StructureNdx,
+   GuiConst_INT16U TextNo,
+   GuiConst_INT16U CharNo,
+   GuiConst_INT16U OmitCtrlCode);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_GuiLib_ClearPositionCallbacks
+// ====================================
+//
+// Resets all position callback function references - no callbacks will then
+// happen, until GuiLib_SetPositionCallbackFunc has been called
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_ClearPositionCallbacks(void);
+
+
+// =============================================================================
+// GuiLib_SetPositionCallbackFunc
+// ==============================
+//
+// Defines a callback function for a specific position callback item
+// The callback function will be called each time a structure containing a
+// position callback item with the same index number. The callback will contain
+// the index number and the current X,Y display coordinates.
+//
+// Input:
+// ------
+// Position callback index No.
+// Position callback function - function style is F(IndexNo, X, Y)
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_SetPositionCallbackFunc(
+   GuiConst_INT16U IndexNo,
+   void (*PosCallbackFunc) (GuiConst_INT16U IndexNo,
+                            GuiConst_INT16S X,
+                            GuiConst_INT16S Y));
+
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+
+// =============================================================================
+// GuiLib_GetBlinkingCharCode
+// ==========================
+//
+// Returns ANSI or Unicode code of character in string marked as blinking field
+//
+// Input:
+// ------
+// Blinking item No.
+// Character position
+// Omit control codes, Control codes are soft and hard line breaks
+//   0 - count all charactes
+//   1 - omit control codes during counting
+//
+// Output:
+// -------
+// ANSI or Unicode code of character, returns zero if an error is encountered
+//
+extern GuiConst_TEXT GuiLib_GetBlinkingCharCode(
+   GuiConst_INT16U BlinkFieldNo,
+   GuiConst_INT16U CharNo,
+   GuiConst_INT16U OmitCtrlCode);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+// =============================================================================
+// GuiLib_SetLanguage
+// ==================
+//
+// Selects current language. Index zero is the reference language.
+//
+// Input:
+// ------
+// Language index
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_SetLanguage(
+   GuiConst_INT16S NewLanguage);
+// -----------------------------------------------------------------------------
+
+
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+
+// =============================================================================
+// GuiLib_Cursor_Hide
+// ==================
+//
+// Hides cursor field.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Cursor_Hide(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_IsCursorFieldInUse
+// =========================
+//
+// Reports if a cursor field is active.
+//
+// Input:
+// ------
+// Query cursor field No.
+//
+// Output:
+// -------
+// 0 = Cursor field not active
+// 1 = Cursor field active
+//
+extern GuiConst_INT8U GuiLib_IsCursorFieldInUse(
+   GuiConst_INT16S AskCursorFieldNo);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Cursor_Select
+// ====================
+//
+// Makes requested cursor field active, redrawing both current and new cursor
+// field.
+//
+// Input:
+// ------
+// New cursor field No.
+// -1 hides cursor.
+//
+// Output:
+// -------
+// 0 = No change, requested cursor field is invalid
+// 1 = Cursor moved // extern GuiConst_INT8U GuiLib_Cursor_Select(
+//  GuiConst_INT16S NewCursorFieldNo);
+//
+extern GuiConst_INT8U GuiLib_Cursor_Select(
+   GuiConst_INT16S NewCursorFieldNo);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Cursor_Down
+// ==================
+//
+// Makes next cursor field active, redrawing both current and new cursor field.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// 0 = Cursor at end of range
+// 1 = Cursor moved
+//
+extern GuiConst_INT8U GuiLib_Cursor_Down(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Cursor_Up
+// ================
+//
+// Makes previous cursor field active, redrawing both current and new cursor
+// field.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// 0 = Cursor at end of range
+// 1 = Cursor moved
+//
+extern GuiConst_INT8U GuiLib_Cursor_Up(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Cursor_Home
+// ==================
+//
+// Makes first cursor field active, redrawing both current and new cursor
+// field.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// 0 = No change, first cursor field already active
+// 1 = Cursor moved
+//
+extern GuiConst_INT8U GuiLib_Cursor_Home(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Cursor_End
+// =================
+//
+// Makes last cursor field active, redrawing both current and new cursor
+// field.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// 0 = No change, last cursor field already active
+// 1 = Cursor moved
+//
+extern GuiConst_INT8U GuiLib_Cursor_End(void);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+#ifdef GuiConst_BLINK_SUPPORT_ON
+
+// =============================================================================
+// GuiLib_BlinkBoxStart
+// ====================
+//
+// Sets parameters for blinking box function
+//
+// Input:
+// ------
+// X1, Y1, X2, Y2: Blinking rectangle
+// Rate: Blinking rate, in multiples of refresh rate, valid range 0-255
+//       Rate = 255 disables blinking, but makes an initial inverting of the
+//       rectangle
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_BlinkBoxStart(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2,
+   GuiConst_INT16S Rate);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_BlinkBoxStop
+// ===================
+//
+// Stops blinking box function
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_BlinkBoxStop(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_BlinkBoxMarkedItem
+// =========================
+//
+// Sets parameters for blinking box function based on marked blink text field
+//
+// Input:
+// ------
+// BlinkFieldNo: Index No. to marked blink text field in structure
+// CharNo: Character number in text, first character is No. 1
+//         CharNo = 0 means entire text
+// Rate: Blinking rate, in multiples of refresh rate, valid range 0-255
+//       Rate = 255 disables blinking, but makes an initial marking of the
+//       character/text
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_BlinkBoxMarkedItem(
+   GuiConst_INT16U BlinkFieldNo,
+   GuiConst_INT16U CharNo,
+   GuiConst_INT16S Rate);
+// -----------------------------------------------------------------------------
+
+// =============================================================================
+// GuiLib_BlinkBoxMarkedItemStop
+// =============================
+//
+// Stops blinking box function based on marked blink text field
+//
+// Input:
+// ------
+// BlinkFieldNo: Index No. to marked blink text field in structure
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_BlinkBoxMarkedItemStop(
+   GuiConst_INT16U BlinkFieldNo);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_BlinkBoxMarkedItemUpdate
+// ===============================
+//
+// Update parameters for blinking box function based on marked blink text field
+//
+// Input:
+// ------
+// BlinkFieldNo: Index No. to marked blink text field in structure
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_BlinkBoxMarkedItemUpdate(
+   GuiConst_INT16U BlinkFieldNo);
+
+//------------------------------------------------------------------------------
+
+#endif
+
+
+// =============================================================================
+// GuiLib_InvertBoxStart
+// =====================
+//
+// Sets parameters for inverted box function
+//
+// Input:
+// ------
+// X1, Y1, X2, Y2: Inverted box rectangle
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_InvertBoxStart(
+   GuiConst_INT16S X1,
+   GuiConst_INT16S Y1,
+   GuiConst_INT16S X2,
+   GuiConst_INT16S Y2);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_InvertBoxStop
+// ====================
+//
+// Stops inverted box function
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_InvertBoxStop(void);
+// -----------------------------------------------------------------------------
+
+
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+
+// =============================================================================
+// GuiLib_TouchCheck
+// =================
+//
+// Returns touch area No. corresponding to the supplied coordinates.
+// If no touch area is found at coordinates -1 is returned.
+// Touch coordinates are converted to display coordinates, if conversion
+// parameters have been set with the GuiLib_TouchAdjustSet function.
+//
+// Input:
+// ------
+// X, Y: Touch position in touch interface coordinates
+//
+// Output:
+// -------
+// -1  = No touch area found
+// >=0 = Touch area No.
+//
+//
+extern GuiConst_INT32S GuiLib_TouchCheck(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TouchGet
+// ===============
+//
+// Performs the same action as GuiLib_TouchCheck, and additionally returns
+// touch coordinates in display coordinates:
+// Returns touch area No. corresponding to the supplied coordinates.
+// If no touch area is found at coordinates -1 is returned.
+// Touch coordinates are converted to display coordinates, if conversion
+// parameters have been set with the GuiLib_TouchAdjustSet function.
+// OBS: If no conversion parameters have been set with the GuiLib_TouchAdjustSet
+// function the calculated touch coordinates in display coordinates will be
+// TouchX = X, and TouchY = Y.
+//
+// Input:
+// ------
+// X, Y: Touch position in touch interface coordinates
+// TouchX, TouchY: Addresses of the variables where touch coordinates
+//                 converted to display coordinates will be stored
+//
+// Output:
+// -------
+// -1  = No touch area found
+// >=0 = Touch area No.
+//
+//
+extern GuiConst_INT32S GuiLib_TouchGet(
+   GuiConst_INT16S X,
+   GuiConst_INT16S Y,
+   GuiConst_INT16S* TouchX,
+   GuiConst_INT16S* TouchY);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TouchAdjustReset
+// =======================
+//
+// Resets touch coordinate conversion.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_TouchAdjustReset(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TouchAdjustSet
+// =====================
+//
+// Sets one coordinate pair for touch coordinate conversion.
+// Must be called two times, once for each of two diagonally opposed corners,
+// or four times, once for each of the corners.
+// The corner positions should be as close as possible to the physical display
+// corners, as precision is lowered when going towards the display center.
+//
+// Input:
+// ------
+// XTrue, YTrue        : Position represented in display coordinates
+// XMeasured, YMeasured: Position represented in touch interface coordinates
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_TouchAdjustSet(
+   GuiConst_INT16S XTrue,
+   GuiConst_INT16S YTrue,
+   GuiConst_INT16S XMeasured,
+   GuiConst_INT16S YMeasured);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+// =============================================================================
+// GuiLib_Refresh
+// ==============
+//
+// Refreshes variables and updates display.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_Refresh(void);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TestPattern
+// ==================
+//
+// Makes test pattern for display control error diagnosis. See user manual for
+// further info.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// None
+//
+extern void GuiLib_TestPattern(void);
+// -----------------------------------------------------------------------------
+
+
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+
+// =============================================================================
+// GuiLib_ScrollBox_Init
+// =====================
+//
+// Initializes a scroll box (new item type style).
+//
+// Input:
+// ------
+// Scroll box index
+// DataFuncPtr: Address of scroll line call-back function of type
+//    "void F(GuiConst_INT16S LineIndex)"
+// NoOfLines: Total No. of lines in scroll box
+// ActiveLine: Active scroll line, -1 means no active scroll line
+//
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_Init(
+   GuiConst_INT8U ScrollBoxIndex,
+   void (*DataFuncPtr) (GuiConst_INT16S LineIndex),
+   GuiConst_INT16S NoOfLines,
+   GuiConst_INT16S ActiveLine);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_Redraw
+// =======================
+//
+// Redraws dynamic parts of scroll box (new item type style).
+// For complete redraw use GuiLib_ScrollBox_Init.
+//
+// Input:
+// ------
+// Scroll box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_Redraw(
+   GuiConst_INT8U ScrollBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_RedrawLine
+// ===========================
+//
+// Redraws single line of scroll box (new item type style).
+// If line is not visible no action is performed.
+//
+// Input:
+// ------
+// Scroll box index
+// Scroll line to redraw, index zero is first line in scroll box list
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_RedrawLine(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLine);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_Close
+// ======================
+//
+// Closes a scroll box (new item type style).
+//
+// Input:
+// ------
+// Scroll box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_Close(
+   GuiConst_INT8U ScrollBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_Down
+// =====================
+//
+// Makes next scroll line active, and scrolls list if needed (new item type
+// style).
+//
+// Input:
+// ------
+// Scroll box index
+//
+// Output:
+// -------
+// 0 = No change, list already at bottom
+// 1 = Active scroll line changed
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_Down(
+   GuiConst_INT8U ScrollBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_Up
+// ===================
+//
+// Makes previous scroll line active, and scrolls list if needed (new item type
+// style).
+//
+// Input:
+// ------
+// Scroll box index
+//
+// Output:
+// -------
+// 0 = No change, list already at top
+// 1 = Active scroll line changed
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_Up(
+   GuiConst_INT8U ScrollBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_Home
+// =====================
+//
+// Makes first scroll line active, and scrolls list if needed (new item type
+// style).
+//
+// Input:
+// ------
+// Scroll box index
+//
+// Output:
+// -------
+// 0 = No change, list already at top
+// 1 = Active scroll line changed
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_Home(
+   GuiConst_INT8U ScrollBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_End
+// ====================
+//
+// Makes last scroll line active, and scrolls list if needed (new item type
+// style).
+//
+// Input:
+// ------
+// Scroll box index
+//
+// Output:
+// -------
+// 0 = No change, list already at bottom
+// 1 = Active scroll line changed
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_End(
+   GuiConst_INT8U ScrollBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_To_Line
+// ========================
+//
+// Makes specified scroll line active, and scrolls list if needed (new item type
+// style).
+//
+// Input:
+// ------
+// Scroll box index
+// New scroll line, -1 means no active scroll line
+//
+// Output:
+// -------
+// 0 = No change, list already at specified line
+// 1 = Active scroll line changed
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_To_Line(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16S NewLine);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_SetLineMarker
+// ==============================
+//
+// Sets scroll marker position and line count.
+// Scroll marker index 0 (active scroll line) can only cover 1 scroll line.
+// Display only changes after subsequent GuiLib_ScrollBox_Redraw call.
+//
+// Input:
+// ------
+// Scroll box index
+// Scroll marker index
+// Marker start line, -1 means no marker
+// Marker line count (clipped to a maximum of 1 for marker index 0)
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_SetLineMarker(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLineMarkerIndex,
+   GuiConst_INT16S StartLine,
+   GuiConst_INT16U Size);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_GetActiveLine
+// ==============================
+//
+// Returns topmost scroll marker line of selected scroll box / marker.
+//
+// Input:
+// ------
+// Scroll box index
+// Scroll marker index (0 = active scroll line, >0 = secondary line markers)
+//
+// Output:
+// -------
+// Index of topmost scroll marker line
+// -1 = Error in parameters
+//
+extern GuiConst_INT16S GuiLib_ScrollBox_GetActiveLine(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLineMarkerIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_GetActiveLineCount
+// ===================================
+//
+// Returns number of marked lines in selected scroll box / marker.
+//
+// Input:
+// ------
+// Scroll box index
+// Scroll marker index (0 = active scroll line, >0 = secondary line markers)
+//
+// Output:
+// -------
+// Count of marked scroll lines
+// -1 = Error in parameters
+// Active scroll line (scroll marker index = 0) will always return 1
+//
+extern GuiConst_INT16S GuiLib_ScrollBox_GetActiveLineCount(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16U ScrollLineMarkerIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_SetIndicator
+// =============================
+//
+// Sets scroll indicator position.
+// Display only changes after subsequent GuiLib_ScrollBox_Redraw call.
+//
+// Input:
+// ------
+// Scroll box index
+// Indicator line, -1 means no indicator
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_SetIndicator(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16S StartLine);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_SetTopLine
+// ===========================
+//
+// Sets topmost visible scroll line of selected scroll box.
+// Display only changes after subsequent GuiLib_ScrollBox_Redraw call.
+// If simultaneously setting line marker position make sure top line setting is
+// last action before GuiLib_ScrollBox_Redraw call.
+//
+// Input:
+// ------
+// Scroll box index
+// Index of topmost visible scroll line
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_ScrollBox_SetTopLine(
+   GuiConst_INT8U ScrollBoxIndex,
+   GuiConst_INT16S TopLine);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_ScrollBox_GetTopLine
+// ===========================
+//
+// Returns topmost visible scroll line of selected scroll box.
+//
+// Input:
+// ------
+// Scroll box index
+//
+// Output:
+// -------
+// Index of topmost visible scroll line
+// -1  = Error in parameters
+//
+extern GuiConst_INT16S GuiLib_ScrollBox_GetTopLine(
+   GuiConst_INT8U ScrollBoxIndex);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+
+// =============================================================================
+// GuiLib_Graph_Close
+// ==================
+//
+// Closes a graph, so that no futher actions can be accomplished with it.
+// Memory assigned to datasets must be freed independently.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+GuiConst_INT8U GuiLib_Graph_Close(
+   GuiConst_INT8U GraphIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_AddDataSet
+// =======================
+//
+// Adds a data set to a graph. The data set must be created in the structure,
+// but is not shown before this function is called.
+// Memory must be assigned independently for the data set.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// DataSetIndex: Index of data set in the graph (index is zero based).
+// XAxisIndex: Index of X-axis to use.
+// YAxisIndex: Index of Y-axis to use.
+// DataPtr: Pointer to an array of data points, where each data point is a 32
+//    bit signed X,Y entity of type GuiLib_GraphDataPoint.
+// DataSize: Maximum number of data points possible in the data set.
+// DataCount: Number of active data points in the data set.
+// DataFirst: Index of first active data point (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_AddDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex,
+   GuiConst_INT8U XAxisIndex,
+   GuiConst_INT8U YAxisIndex,
+   GuiLib_GraphDataPoint *DataPtr,
+   GuiConst_INT16U DataSize,
+   GuiConst_INT16U DataCount,
+   GuiConst_INT16U DataFirst);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_RemoveDataSet
+// ==========================
+//
+// Removes a data set from a graph.
+// Memory must be released independently for the data set.
+// Nothing is drawn in this function.
+//
+//------------------------------------------------------------------------------
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// DataSetIndex: Index of data set in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_RemoveDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_AddDataPoint
+// =========================
+//
+// Adds a data point to a data set. The data set must have sufficient space for
+// the new data point.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// DataSetIndex: Index of data set in the graph (index is zero based).
+// DataPointX, DataPointY: The data point.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_AddDataPoint(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex,
+   GuiConst_INT32S DataPointX,
+   GuiConst_INT32S DataPointY);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_ShowDataSet
+// ========================
+//
+// Marks a data set as visible.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// DataSetIndex: Index of data set in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_ShowDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_HideDataSet
+// ========================
+//
+// Marks a data set as invisible.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// DataSetIndex: Index of data set in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_HideDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_ShowXAxis
+// ======================
+//
+// Marks an X-axis as visible.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of X axis in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_ShowXAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_HideXAxis
+// ======================
+//
+// Marks an X-axis as invisible.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of X axis in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_HideXAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_ShowYAxis
+// ======================
+//
+// Marks an Y-axis as visible.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of Y axis in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_ShowYAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_HideYAxis
+// ======================
+//
+// Marks an Y-axis as invisible.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of Y axis in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_HideYAxis(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_SetXAxisRange
+// ==========================
+//
+// Changes an X-axis range.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of X axis in the graph (index is zero based).
+// MinValue, MaxValue: Limits of the X axis range.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_SetXAxisRange(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex,
+   GuiConst_INT32S MinValue,
+   GuiConst_INT32S MaxValue);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_SetYAxisRange
+// ==========================
+//
+// Changes an Y-axis range.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of Y axis in the graph (index is zero based).
+// MinValue, MaxValue: Limits of the Y axis range.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_SetYAxisRange(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U AxisIndex,
+   GuiConst_INT32S MinValue,
+   GuiConst_INT32S MaxValue);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_ResetXAxisOrigin
+// =============================
+//
+// Resets the X-axis origin to the original origin.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of X axis in the graph (index is zero based). Index -1 will
+//            reset all defined X axes.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_ResetXAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_OffsetXAxisOrigin
+// ==============================
+//
+// Adjusts the X-axis origin. Useful for dynamic graphs with moving X-axis.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of X axis in the graph (index is zero based). Index -1 will
+//            offset all defined X axes. This only makes sense if all X axes
+//            have identical scaling.
+// Offset: Amount of movement of the X axis origin.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_OffsetXAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex,
+   GuiConst_INT32S Offset);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_ResetYAxisOrigin
+// =============================
+//
+// Resets the Y-axis origin to the original origin.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of Y axis in the graph (index is zero based). Index -1 will
+//            reset all defined Y axes.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_ResetYAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_OffsetYAxisOrigin
+// ==============================
+//
+// Adjusts the Y-axis origin. Useful for dynamic graphs with moving Y-axis.
+// Nothing is drawn in this function.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// AxisIndex: Index of Y axis in the graph (index is zero based). Index -1 will
+//            offset all defined Y axes. This only makes sense if all Y axes
+//            have identical scaling.
+// Offset: Amount of movement of the Y axis origin.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_OffsetYAxisOrigin(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8S AxisIndex,
+   GuiConst_INT32S Offset);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_Redraw
+// ===================
+//
+// Redraws the complete graph, including background, axes, and data sets.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_Redraw(
+   GuiConst_INT8U GraphIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_DrawAxes
+// =====================
+//
+// Redraws the graph, including background and axes, but excluding data sets.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_DrawAxes(
+   GuiConst_INT8U GraphIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_DrawDataSet
+// ========================
+//
+// Redraws a data set.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// DataSetIndex: Index of data set in the graph (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_DrawDataSet(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex);
+//------------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_Graph_DrawDataPoint
+// ==========================
+//
+// Draws a single data point in a data set.
+//
+// Input:
+// ------
+// GraphIndex: Index of graph (index is zero based).
+// DataSetIndex: Index of data set in the graph (index is zero based).
+// DataIndex: Index of point in the data set (index is zero based).
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_Graph_DrawDataPoint(
+   GuiConst_INT8U GraphIndex,
+   GuiConst_INT8U DataSetIndex,
+   GuiConst_INT16U DataIndex);
+// -----------------------------------------------------------------------------
+
+#endif
+
+
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+
+// =============================================================================
+// GuiLib_GraphicsFilter_Init
+// ==========================
+//
+// Initializes a graphics filter call-back function.
+//
+// Input:
+// ------
+// GraphicsFilterIndex: Index of graphics filter (index is zero based).
+// FilterFuncPtr: Pointer to user-defined call-back filter function.
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+//------------------------------------------------------------------------------
+extern GuiConst_INT8U GuiLib_GraphicsFilter_Init(
+   GuiConst_INT8U GraphicsFilterIndex,
+   void (*FilterFuncPtr)
+     (GuiConst_INT8U *DestAddress,
+      GuiConst_INT16U DestLineSize,
+      GuiConst_INT8U *SourceAddress,
+      GuiConst_INT16U SourceLineSize,
+      GuiConst_INT16U Width,
+      GuiConst_INT16U Height,
+      GuiConst_INT32S FilterPars[10]));
+#endif
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Up
+// ========================
+//
+// Scrolls text box contents one text line up.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Up(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Down
+// ==========================
+//
+// Scrolls text box contents one text line down.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Down(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Home
+// ==========================
+//
+// Scrolls text box contents to the top.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Home(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_End
+// =========================
+//
+// Scrolls text box contents to the bottom.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_End(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_To_Line
+// =============================
+//
+// Scrolls text box contents to a specific text line.
+//
+// Input:
+// ------
+// Text box index
+// Text line
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_To_Line(
+   GuiConst_INT8U TextBoxIndex,
+   GuiConst_INT16S NewLine);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Up_Pixel
+// ==============================
+//
+// Scrolls text box contents one pixel position up.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Up_Pixel(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Down_Pixel
+// ================================
+//
+// Scrolls text box contents one pixel position down.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Down_Pixel(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Home_Pixel
+// ================================
+//
+// Scrolls text box contents to the top.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Home_Pixel(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_End_Pixel
+// ===============================
+//
+// Scrolls text box contents to the bottom.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_End_Pixel(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_To_PixelLine
+// ==================================
+//
+// Scrolls text box contents to a specific pixel position.
+//
+// Input:
+// ------
+// Text box index
+// Pixel line
+//
+// Output:
+// -------
+// 0 = Error in parameters
+// 1 = Ok
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_To_PixelLine(
+   GuiConst_INT8U TextBoxIndex,
+   GuiConst_INT16S NewPixelLine);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Get_Pos
+// =============================
+//
+// Returns status of topmost visible text line of text box.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// GuiLib_TEXTBOX_SCROLL_ILLEGAL_NDX   Illegal text box index
+// GuiLib_TEXTBOX_SCROLL_INSIDE_BLOCK  Text box scrolled mid way
+// GuiLib_TEXTBOX_SCROLL_AT_HOME       Text box scrolled to the top
+// GuiLib_TEXTBOX_SCROLL_AT_END        Text box scrolled to the bottom
+// GuiLib_TEXTBOX_SCROLL_ABOVE_HOME    Text box scrolled above the top
+// GuiLib_TEXTBOX_SCROLL_BELOW_END     Text box scrolled below the bottom
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Get_Pos(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_Get_Pos_Pixel
+// ===================================
+//
+// Returns status of topmost visible pixel position of text box.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// GuiLib_TEXTBOX_SCROLL_ILLEGAL_NDX   Illegal text box index
+// GuiLib_TEXTBOX_SCROLL_INSIDE_BLOCK  Text box scrolled mid way
+// GuiLib_TEXTBOX_SCROLL_AT_HOME       Text box scrolled to the top
+// GuiLib_TEXTBOX_SCROLL_AT_END        Text box scrolled to the bottom
+// GuiLib_TEXTBOX_SCROLL_ABOVE_HOME    Text box scrolled above the top
+// GuiLib_TEXTBOX_SCROLL_BELOW_END     Text box scrolled below the bottom
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_Get_Pos_Pixel(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+// =============================================================================
+// GuiLib_TextBox_Scroll_FitsInside
+// ================================
+//
+// Determines if a text fits completely inside a text box without scrolling.
+//
+// Input:
+// ------
+// Text box index
+//
+// Output:
+// -------
+// 0 = No
+// 1 = Yes
+//
+extern GuiConst_INT8U GuiLib_TextBox_Scroll_FitsInside(
+   GuiConst_INT8U TextBoxIndex);
+// -----------------------------------------------------------------------------
+
+
+#ifdef GuiConst_REMOTE_DATA
+// =============================================================================
+// GuiLib_RemoteCheck
+// ==================
+//
+// Checks if binary remote data file has correct ID.
+//
+// Input:
+// ------
+// None
+//
+// Output:
+// -------
+// 0 = Illegal ID
+// 1 = ID accepted
+//
+extern GuiConst_INT8U GuiLib_RemoteCheck(void);
+// -----------------------------------------------------------------------------
+#endif
+
+
+
+#ifdef GuiConst_CODEVISION_COMPILER
+#pragma used-
+#endif
+// -----------------------------------------------------------------------------
+
+
+#ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
+}
+
+#endif
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIFixed/GuiLibStruct.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,1139 @@
+/* ************************************************************************ */
+/*                                                                          */
+/*                     (C)2004-2015 IBIS Solutions ApS                      */
+/*                            sales@easyGUI.com                             */
+/*                             www.easyGUI.com                              */
+/*                                                                          */
+/*                               v6.0.9.005                                 */
+/*                                                                          */
+/* ************************************************************************ */
+
+#ifndef __GUILIBSTRUCT_H_
+#define __GUILIBSTRUCT_H_
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+
+
+#ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
+extern "C" {
+#endif
+
+#define GuiLib_ITEM_TEXT                   0
+#define GuiLib_ITEM_DOT                    1
+#define GuiLib_ITEM_LINE                   2
+#define GuiLib_ITEM_FRAME                  3
+#define GuiLib_ITEM_BLOCK                  4
+#define GuiLib_ITEM_STRUCTURE              5
+#define GuiLib_ITEM_STRUCTARRAY            6
+#define GuiLib_ITEM_CLIPRECT               7
+#define GuiLib_ITEM_VAR                    8
+#define GuiLib_ITEM_FORMATTER              9
+#define GuiLib_ITEM_BITMAP                 10
+#define GuiLib_ITEM_TEXTBLOCK              11
+#define GuiLib_ITEM_TOUCHAREA              12
+#define GuiLib_ITEM_VARBLOCK               13
+#define GuiLib_ITEM_ACTIVEAREA             14
+#define GuiLib_ITEM_SCROLLBOX              15
+#define GuiLib_ITEM_CIRCLE                 16
+#define GuiLib_ITEM_ELLIPSE                17
+#define GuiLib_ITEM_BACKGROUND             18
+#define GuiLib_ITEM_CLEARAREA              19
+#define GuiLib_ITEM_ADVGRAPH_COORDSYST     20
+#define GuiLib_ITEM_ADVGRAPH_PIXEL         21
+#define GuiLib_ITEM_ADVGRAPH_LINE          22
+#define GuiLib_ITEM_ADVGRAPH_ARC           23
+#define GuiLib_ITEM_ADVGRAPH_RECT          24
+#define GuiLib_ITEM_ADVGRAPH_ELLIPSE       25
+#define GuiLib_ITEM_ADVGRAPH_SEGMENT       26
+#define GuiLib_ITEM_ADVGRAPH_TRIANGLE      27
+#define GuiLib_ITEM_ADVGRAPH_POLYGON       28
+#define GuiLib_ITEM_GRAPH                  29
+#define GuiLib_ITEM_GRAPHICSLAYER          30
+#define GuiLib_ITEM_GRAPHICSFILTER         31
+#define GuiLib_ITEM_ROUNDEDFRAME           32
+#define GuiLib_ITEM_ROUNDEDBLOCK           33
+#define GuiLib_ITEM_QUARTERCIRCLE          34
+#define GuiLib_ITEM_QUARTERELLIPSE         35
+#define GuiLib_ITEM_CHECKBOX               36
+#define GuiLib_ITEM_RADIOBUTTON            37
+#define GuiLib_ITEM_BUTTON                 38
+#define GuiLib_ITEM_EDITBOX                39
+#define GuiLib_ITEM_PANEL                  40
+#define GuiLib_ITEM_MEMO                   41
+#define GuiLib_ITEM_LISTBOX                42
+#define GuiLib_ITEM_COMBOBOX               43
+#define GuiLib_ITEM_SCROLLAREA             44
+#define GuiLib_ITEM_PROGRESSBAR            45
+#define GuiLib_ITEM_STRUCTCOND             46
+#define GuiLib_ITEM_POSCALLBACK            47
+
+#define GuiLib_ITEMBIT_TEXT                0x00000001
+#define GuiLib_ITEMBIT_DOT                 0x00000002
+#define GuiLib_ITEMBIT_LINE                0x00000004
+#define GuiLib_ITEMBIT_FRAME               0x00000008
+#define GuiLib_ITEMBIT_BLOCK               0x00000010
+#define GuiLib_ITEMBIT_STRUCTURE           0x00000020
+#define GuiLib_ITEMBIT_STRUCTARRAY         0x00000040
+#define GuiLib_ITEMBIT_CLIPRECT            0x00000080
+#define GuiLib_ITEMBIT_VAR                 0x00000100
+#define GuiLib_ITEMBIT_FORMATTER           0x00000200
+#define GuiLib_ITEMBIT_BITMAP              0x00000400
+#define GuiLib_ITEMBIT_TEXTBLOCK           0x00000800
+#define GuiLib_ITEMBIT_TOUCHAREA           0x00001000
+#define GuiLib_ITEMBIT_VARBLOCK            0x00002000
+#define GuiLib_ITEMBIT_ACTIVEAREA          0x00004000
+#define GuiLib_ITEMBIT_SCROLLBOX           0x00008000
+#define GuiLib_ITEMBIT_CIRCLE              0x00010000
+#define GuiLib_ITEMBIT_ELLIPSE             0x00020000
+#define GuiLib_ITEMBIT_BACKGROUND          0x00040000
+#define GuiLib_ITEMBIT_CLEARAREA           0x00080000
+#define GuiLib_ITEMBIT_ADVGRAPH_COORDSYST  0x00100000
+#define GuiLib_ITEMBIT_ADVGRAPH_PIXEL      0x00200000
+#define GuiLib_ITEMBIT_ADVGRAPH_LINE       0x00400000
+#define GuiLib_ITEMBIT_ADVGRAPH_ARC        0x00800000
+#define GuiLib_ITEMBIT_ADVGRAPH_RECT       0x01000000
+#define GuiLib_ITEMBIT_ADVGRAPH_ELLIPSE    0x02000000
+#define GuiLib_ITEMBIT_ADVGRAPH_SEGMENT    0x04000000
+#define GuiLib_ITEMBIT_ADVGRAPH_TRIANGLE   0x08000000
+#define GuiLib_ITEMBIT_ADVGRAPH_POLYGON    0x10000000
+#define GuiLib_ITEMBIT_GRAPH               0x20000000
+#define GuiLib_ITEMBIT_GRAPHICSLAYER       0x40000000
+#define GuiLib_ITEMBIT_GRAPHICSFILTER      0x80000000
+#define GuiLib_ITEMBIT_ROUNDEDFRAME        0x00000001
+#define GuiLib_ITEMBIT_ROUNDEDBLOCK        0x00000002
+#define GuiLib_ITEMBIT_QUARTERCIRCLE       0x00000004
+#define GuiLib_ITEMBIT_QUARTERELLIPSE      0x00000008
+#define GuiLib_ITEMBIT_CHECKBOX            0x00000010
+#define GuiLib_ITEMBIT_RADIOBUTTON         0x00000020
+#define GuiLib_ITEMBIT_BUTTON              0x00000040
+#define GuiLib_ITEMBIT_EDITBOX             0x00000080
+#define GuiLib_ITEMBIT_PANEL               0x00000100
+#define GuiLib_ITEMBIT_MEMO                0x00000200
+#define GuiLib_ITEMBIT_LISTBOX             0x00000400
+#define GuiLib_ITEMBIT_COMBOBOX            0x00000800
+#define GuiLib_ITEMBIT_SCROLLAREA          0x00001000
+#define GuiLib_ITEMBIT_PROGRESSBAR         0x00002000
+#define GuiLib_ITEMBIT_STRUCTCOND          0x00004000
+#define GuiLib_ITEMBIT_POSCALLBACK         0x00008000
+
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+  #define GuiLib_GETITEMLONG
+#else
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  #define GuiLib_GETITEMLONG
+#endif
+#endif
+
+#define GuiLib_TRUE                        1
+#define GuiLib_FALSE                       0
+
+#define GuiLib_UPDATE_ALWAYS               0
+#define GuiLib_UPDATE_ON_CHANGE            1
+
+#ifdef GuiConst_AUTOREDRAW_ON_CHANGE
+#define GuiLib_AUTOREDRAW_MODE GuiLib_UPDATE_ON_CHANGE
+#else
+#define GuiLib_AUTOREDRAW_MODE GuiLib_UPDATE_ALWAYS
+#endif
+
+#define GuiLib_COOR_ABS                    0
+#define GuiLib_COOR_REL                    1
+#define GuiLib_COOR_REL_1                  2
+#define GuiLib_COOR_REL_2                  3
+
+#define GuiLib_COLOR_NOCHANGE              0
+#define GuiLib_COLOR_FORE                  1
+#define GuiLib_COLOR_BACK                  2
+#define GuiLib_COLOR_OTHER                 3
+#define GuiLib_COLOR_INVERT                4
+#define GuiLib_COLOR_TRANSP                5
+#define GuiLib_COLOR_TABLE                 6
+#define GuiLib_COLOR_VAR                   7
+
+#define GuiLib_MARKER_NONE                 0
+#define GuiLib_MARKER_ICON                 1
+#define GuiLib_MARKER_BITMAP               2
+#define GuiLib_MARKER_FIXED_BLOCK          3
+#define GuiLib_MARKER_VARIABLE_BLOCK       4
+
+#define GuiLib_MEMORY_MIN                  1
+#define GuiLib_MEMORY_MAX                  3
+#define GuiLib_MEMORY_CNT                  GuiLib_MEMORY_MAX - GuiLib_MEMORY_MIN + 1
+
+#define GuiLib_COL_INVERT_OFF              0
+#define GuiLib_COL_INVERT_ON               1
+#define GuiLib_COL_INVERT_IF_CURSOR        2
+
+#define GuiLib_BITFLAG_INUSE               0x00000001
+#define GuiLib_BITFLAG_TRANSPARENT         0x00000002
+#define GuiLib_BITFLAG_UNDERLINE           0x00000004
+#define GuiLib_BITFLAG_PATTERNEDLINE       0x00000004
+#define GuiLib_BITFLAG_CIRCLE_IF           0x00000004
+#define GuiLib_BITFLAG_FORMATSHOWSIGN      0x00000008
+#define GuiLib_BITFLAG_FORMATZEROPADDING   0x00000010
+#define GuiLib_BITFLAG_AUTOREDRAWFIELD     0x00000020
+#define GuiLib_BITFLAG_NOTINUSE            0x00000040
+#define GuiLib_BITFLAG_TRANSLATION         0x00000080
+#define GuiLib_BITFLAG_BLINKTEXTFIELD      0x00000100
+#define GuiLib_BITFLAG_CLIPPING            0x00000200
+#define GuiLib_BITFLAG_ACTIVEAREARELCOORD  0x00000400
+#define GuiLib_BITFLAG_REVERSEWRITING      0x00000800
+#define GuiLib_BITFLAG_FORMATTRAILINGZEROS 0x00001000
+#define GuiLib_BITFLAG_FORMATTHOUSANDSSEP  0x00002000
+#define GuiLib_BITFLAG_FIELDSCROLLBOX      0x00004000
+#define GuiLib_BITFLAG_BARTRANSPARENT      0x00008000
+
+#define GuiLib_SCROLL_STRUCTURE_UNDEF      0
+#define GuiLib_SCROLL_STRUCTURE_READ       1
+#define GuiLib_SCROLL_STRUCTURE_USED       2
+
+#define GuiLib_GRAPH_STRUCTURE_UNDEF       0
+#define GuiLib_GRAPH_STRUCTURE_USED        1
+
+#define GuiLib_GRAPH_DATATYPE_DOT          0
+#define GuiLib_GRAPH_DATATYPE_LINE         1
+#define GuiLib_GRAPH_DATATYPE_BAR          2
+#define GuiLib_GRAPH_DATATYPE_CROSS        3
+#define GuiLib_GRAPH_DATATYPE_X            4
+
+#define GuiLib_GRAPHAXIS_X                 0
+#define GuiLib_GRAPHAXIS_Y                 1
+
+#define GuiLib_GRAPHICS_LAYER_UNDEF        0
+#define GuiLib_GRAPHICS_LAYER_USED         1
+
+#define GuiLib_GRAPHICS_LAYER_SIZE_COORD   0
+#define GuiLib_GRAPHICS_LAYER_SIZE_SCREEN  1
+#define GuiLib_GRAPHICS_LAYER_SIZE_CLIP    2
+
+#define GuiLib_GRAPHICS_LAYER_INIT_NONE    0
+#define GuiLib_GRAPHICS_LAYER_INIT_COL     1
+#define GuiLib_GRAPHICS_LAYER_INIT_COPY    2
+
+#define GuiLib_GRAPHICS_LAYER_CURRENT      -3
+#define GuiLib_GRAPHICS_LAYER_PREVIOUS     -2
+#define GuiLib_GRAPHICS_LAYER_BASE         -1
+
+#define GuiLib_GRAPHICS_FILTER_UNDEF       0
+#define GuiLib_GRAPHICS_FILTER_USED        1
+
+#define GuiLib_MARKER_NONE                 0
+#define GuiLib_INDICATOR_NONE              0
+#define GuiLib_MARKER_SIZE                 8
+
+#define GuiLib_FULL_BITMAP                 0
+#define GuiLib_AREA_BITMAP                 1
+
+#define GuiLib_LANGUAGE_INACTIVE           9999
+
+#define GuiLib_LINEFEED                    0x0A
+
+#define GuiLib_CHECKBOX_FLAT               0
+#define GuiLib_CHECKBOX_3D                 1
+#define GuiLib_CHECKBOX_ICON               2
+#define GuiLib_CHECKBOX_BITMAP             3
+#define GuiLib_CHECKBOX_NONE               4
+#define GuiLib_CHECKBOX_MARK_CHECKED       0
+#define GuiLib_CHECKBOX_MARK_CROSSED       1
+#define GuiLib_CHECKBOX_MARK_FILLED        2
+#define GuiLib_CHECKBOX_MARK_ICON          3
+#define GuiLib_CHECKBOX_MARK_BITMAP        4
+
+#define GuiLib_RADIOBUTTON_FLAT            0
+#define GuiLib_RADIOBUTTON_3D              1
+#define GuiLib_RADIOBUTTON_ICON            2
+#define GuiLib_RADIOBUTTON_BITMAP          3
+#define GuiLib_RADIOBUTTON_MARK_STANDARD   0
+#define GuiLib_RADIOBUTTON_MARK_ICON       1
+#define GuiLib_RADIOBUTTON_MARK_BITMAP     2
+
+#define GuiLib_BUTTON_LAYOUT_TEXT          0
+#define GuiLib_BUTTON_LAYOUT_GLYPH         1
+#define GuiLib_BUTTON_LAYOUT_GLYPHLEFT     2
+#define GuiLib_BUTTON_LAYOUT_GLYPHRIGHT    3
+#define GuiLib_BUTTON_LAYOUT_GLYPHBOTTOM   4
+#define GuiLib_BUTTON_LAYOUT_GLYPHTOP      5
+
+#define GuiLib_BUTTON_BODY_FLAT            0
+#define GuiLib_BUTTON_BODY_3D              1
+#define GuiLib_BUTTON_BODY_ICON            2
+#define GuiLib_BUTTON_BODY_BITMAP          3
+
+#define GuiLib_BUTTON_GLYPH_ICON           0
+#define GuiLib_BUTTON_GLYPH_BITMAP         1
+
+#define GuiLib_PANEL_FLAT                  0
+#define GuiLib_PANEL_3D_RAISED             1
+#define GuiLib_PANEL_3D_LOWERED            2
+#define GuiLib_PANEL_EMBOSSED_RAISED       3
+#define GuiLib_PANEL_EMBOSSED_LOWERED      4
+
+#define GuiLib_AUTOREDRAW_MAX_VAR_SIZE GuiConst_AUTOREDRAW_MAX_VAR_SIZE
+
+//----------------------X-----------------------
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  typedef GuiConst_PTR *GuiLib_StructPtr;
+#else
+  #ifdef GuiConst_DISP_VAR_NOW
+    unsigned char displayVarNow;
+  #endif
+  #ifdef GuiConst_AVRGCC_COMPILER
+    typedef GuiConst_PTR *GuiLib_StructPtr;
+    #define ReadBytePtr(X) pgm_read_byte(X)
+    #define ReadByte(X)    pgm_read_byte(&X)
+    #define ReadWordPtr(X) pgm_read_word(X)
+    #define ReadWord(X)    pgm_read_word(&X)
+  #else
+    #if defined GuiConst_ICC_COMPILER
+      typedef void PrefixRom *GuiLib_StructPtr;
+    #elif defined GuiConst_CODEVISION_COMPILER
+      typedef void PrefixRom *GuiLib_StructPtr;
+    #elif defined GuiConst_RENESAS_COMPILER_FAR
+      typedef void PrefixRom *GuiLib_StructPtr; 
+    #else
+      typedef GuiConst_PTR *GuiLib_StructPtr;
+    #endif
+  #endif
+#endif
+//----------------------X-----------------------
+#ifndef ReadBytePtr
+#define ReadBytePtr(X) *(X)
+#endif
+#ifndef ReadByte
+#define ReadByte(X)    X
+#endif
+#ifndef ReadWordPtr
+#define ReadWordPtr(X) *(X)
+#endif
+#ifndef ReadWord
+#define ReadWord(X)    X
+#endif
+
+//----------------------X-----------------------
+
+
+//----------------------X-----------------------
+typedef struct
+{
+  GuiConst_INT32U BitFlags;
+  GuiConst_INT16S BackBoxSizeX;
+  GuiConst_INT8U BackBoxSizeY1, BackBoxSizeY2;
+  GuiConst_INT8U FontIndex;
+  GuiConst_INT8U Alignment;
+  GuiConst_INT8U Ps;
+  GuiConst_INT8U BackBorderPixels;
+} TextParRec;
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_STRUCTCOND_INUSE
+typedef struct
+{
+  GuiConst_INT16U IndexCount;
+  GuiConst_INT16S IndexFirst[GuiConst_STRUCTCOND_MAX];
+  GuiConst_INT16S IndexLast[GuiConst_STRUCTCOND_MAX];
+  GuiConst_INT16U CallIndex[GuiConst_STRUCTCOND_MAX];
+} CompStructCallRec;
+#else
+typedef struct
+{
+  GuiConst_INT16U IndexCount;
+} CompStructCallRec;
+#endif // GuiConst_ITEM_STRUCTCOND_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+typedef struct
+{
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  GuiConst_INT16S ScrollPos;
+  GuiConst_INT16U Lines;
+  GuiConst_INT8U ScrollIndex;
+#endif // GuiConst_TEXTBOX_FIELDS_ON
+  GuiConst_INT8U HorzAlignment;
+  GuiConst_INT8U VertAlignment;
+  GuiConst_INT8S LineDist;
+  GuiConst_INT8U LineDistRelToFont;
+} CompTextBoxRec;
+#endif // GuiConst_ITEM_TEXTBLOCK_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+typedef struct
+{
+  GuiConst_INT16U AreaNo;
+} CompTouchRec;
+#endif
+//----------------------X-----------------------
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+typedef struct
+{
+  GuiConst_INTCOLOR TranspColor;
+} CompBitmapRec;
+#endif
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+typedef struct
+{
+  GuiConst_INT16U MarkOffsetX;
+  GuiConst_INT16U MarkOffsetY;
+  GuiConst_INT16U MarkBitmapIndex;
+  GuiConst_INT16U IconOffsetX;
+  GuiConst_INT16U IconOffsetY;
+  GuiConst_INT16U BitmapIndex;
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR BitmapTranspColor;
+  GuiConst_INTCOLOR MarkBitmapTranspColor;
+#endif // GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR MarkColor;
+  GuiConst_INT16U MarkColorIndex;
+  GuiConst_TEXT PrefixLocate *IconPtr;
+  GuiConst_TEXT PrefixLocate *MarkIconPtr;
+  GuiConst_INT8U Style;
+  GuiConst_INT8U Size;
+  GuiConst_INT8U IconFont;
+  GuiConst_INT8U BitmapIsTransparent;
+  GuiConst_INT8U MarkStyle;
+  GuiConst_INT8U MarkIconFont;
+  GuiConst_INT8U MarkBitmapIsTransparent;
+} CompCheckBoxRec;
+#endif // GuiConst_ITEM_CHECKBOX_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+typedef struct
+{
+  GuiConst_INT16U InterDistance;
+  GuiConst_INT16U MarkOffsetX;
+  GuiConst_INT16U MarkOffsetY;
+  GuiConst_INT16U MarkBitmapIndex;
+  GuiConst_INT16U IconOffsetX;
+  GuiConst_INT16U IconOffsetY;
+  GuiConst_INT16U BitmapIndex;
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR BitmapTranspColor;
+  GuiConst_INTCOLOR MarkBitmapTranspColor;
+#endif // GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR MarkColor;
+  GuiConst_INT16U MarkColorIndex;
+  GuiConst_TEXT PrefixLocate *IconPtr;
+  GuiConst_TEXT PrefixLocate *MarkIconPtr;
+  GuiConst_INT8U Style;
+  GuiConst_INT8U Size;
+  GuiConst_INT8U Count;
+  GuiConst_INT8U IconFont;
+  GuiConst_INT8U BitmapIsTransparent;
+  GuiConst_INT8U MarkStyle;
+  GuiConst_INT8U MarkIconFont;
+  GuiConst_INT8U MarkBitmapIsTransparent;
+} CompRadioButtonRec;
+#endif // GuiConst_ITEM_RADIOBUTTON_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+typedef struct
+{
+  GuiConst_INT8U Layout;
+  GuiConst_INT8U BodyStyle;
+  GuiConst_INT8U BodyLikeUp;
+  GuiConst_TEXT PrefixLocate *BodyIconPtr[3];
+  GuiConst_INT8U BodyIconFont[3];
+  GuiConst_INT16U BodyIconOffsetX[3];
+  GuiConst_INT16U BodyIconOffsetY[3];
+  GuiConst_INT16U BodyBitmapIndex[3];
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR BodyBitmapTranspColor[3];
+#endif // GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INT8U BodyBitmapIsTransparent[3];
+  GuiConst_INT8U TextLikeUp;
+  GuiConst_INTCOLOR TextColor[3];
+  GuiConst_INT16U TextColorIndex[3];
+  GuiConst_INT8U GlyphStyle;
+  GuiConst_INT8U GlyphLikeUp;
+  GuiConst_INTCOLOR GlyphIconColor[3];
+  GuiConst_INT16U GlyphIconColorIndex[3];
+  GuiConst_TEXT PrefixLocate *GlyphIconPtr[3];
+  GuiConst_INT8U GlyphIconFont[3];
+  GuiConst_INT16U GlyphIconOffsetX[3];
+  GuiConst_INT16U GlyphIconOffsetY[3];
+  GuiConst_INT16U GlyphBitmapIndex[3];
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR GlyphBitmapTranspColor[3];
+#endif // GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INT8U GlyphBitmapIsTransparent[3];
+  GuiConst_INT16U GlyphBitmapOffsetX[3];
+  GuiConst_INT16U GlyphBitmapOffsetY[3];
+} CompButtonRec;
+#endif // GuiConst_ITEM_BUTTON_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_PANEL_INUSE
+typedef struct
+{
+  GuiConst_INT8U Style;
+} CompPanelRec;
+#endif
+//----------------------X-----------------------
+typedef union
+{
+  CompStructCallRec StructCall;
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+  CompTextBoxRec     CompTextBox;
+#endif
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+  CompTouchRec       CompTouch;
+#endif
+#ifdef GuiConst_ITEM_CHECKBOX_INUSE
+  CompCheckBoxRec    CompCheckBox;
+#endif
+#ifdef GuiConst_ITEM_RADIOBUTTON_INUSE
+  CompRadioButtonRec CompRadioButton;
+#endif
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+  CompButtonRec CompButton;
+#endif
+#ifdef GuiConst_ITEM_PANEL_INUSE
+  CompPanelRec       CompPanel;
+#endif
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  CompBitmapRec      CompBitmap;
+#endif
+} CompUnion;
+//----------------------X-----------------------
+typedef struct
+{
+  TextParRec TextPar[3];
+  void PrefixLocate *VarPtr;
+  GuiConst_INT16U StructToCallIndex;
+  GuiConst_INT16S X1, Y1, X2, Y2;
+  GuiConst_INT16S R1, R2;
+  GuiConst_INT16S RX, RY;
+  GuiConst_INT16S RX1, RY1, RX2, RY2;
+  GuiConst_INT16S DrawnX1, DrawnY1, DrawnX2, DrawnY2;
+  GuiConst_INT16U TextLength[3];
+  GuiConst_INT16S ForeColorEnhance;
+  GuiConst_INT16S BackColorEnhance;
+  GuiConst_INT16S BarForeColorEnhance;
+  GuiConst_INT16S BarBackColorEnhance;
+#ifdef GuiConst_REL_COORD_ORIGO_INUSE
+  GuiConst_INT16S CoordOrigoX, CoordOrigoY;
+#endif
+#ifdef GuiConst_CLIPPING_SUPPORT_ON
+  GuiConst_INT16S ClipRectX1, ClipRectY1, ClipRectX2, ClipRectY2;
+#endif
+  GuiConst_INT16U PosCallbackNo;
+  GuiConst_INTCOLOR ForeColor, BackColor;
+  GuiConst_INTCOLOR BarForeColor, BarBackColor;
+  GuiConst_INT16U ForeColorIndex;
+  GuiConst_INT16U BackColorIndex;
+  GuiConst_INT16U BarForeColorIndex;
+  GuiConst_INT16U BarBackColorIndex;
+  GuiConst_TEXT PrefixGeneric *TextPtr[3];
+#ifdef GuiConst_REMOTE_TEXT_DATA
+  GuiConst_INT32U TextIndex[3];
+#endif
+#ifdef GuiConst_REMOTE_STRUCT_DATA
+  GuiConst_INT32U TextOffset[3];
+#endif
+  GuiConst_INT8U TextCnt;
+  GuiConst_INT8U Drawn;
+  GuiConst_INT8U ItemType;
+  GuiConst_INT8U FrameThickness;
+  GuiConst_INT8U FormatFieldWidth;
+  GuiConst_INT8U FormatDecimals;
+  GuiConst_INT8U FormatAlignment;
+  GuiConst_INT8U FormatFormat;
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  GuiConst_INT8S CursorFieldNo;
+  GuiConst_INT8U CursorFieldLevel;
+#endif
+#ifdef GuiConst_BLINK_SUPPORT_ON
+  GuiConst_INT8S BlinkFieldNo;
+#endif
+  GuiConst_INT8U UpdateType;
+  GuiConst_INT8U VarType;
+  GuiConst_INT8U LinePattern;
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+  GuiConst_INT8U CursorScrollBoxIndex;
+#endif
+  CompUnion CompPars;
+} GuiLib_ItemRec;
+typedef GuiLib_ItemRec PrefixLocate * GuiLib_ItemRecPtr;
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+typedef struct
+{
+  GuiConst_INT16S X1, Y1, X2, Y2;
+  GuiConst_INT16U IndexNo;
+} GuiLib_TouchAreaRec;
+#endif
+//----------------------X-----------------------
+typedef struct
+{
+  void (*PosCallbackFunc) (GuiConst_INT16U IndexNo,
+                           GuiConst_INT16S X,
+                           GuiConst_INT16S Y);
+  GuiConst_INT16U IndexNo;
+  GuiConst_INT8U InUse;
+} GuiLib_PosCallbackRec;
+
+//----------------------X-----------------------
+#ifdef GuiConst_BLINK_SUPPORT_ON
+#ifndef GuiConst_BLINK_FIELDS_OFF
+typedef struct
+{
+  TextParRec TextPar;
+  GuiConst_INT16U CharNo;
+  GuiConst_INT16U CharCnt;
+  GuiConst_INT16S X1, X2;
+  GuiConst_INT16S Y1, Y2;
+  GuiConst_INT16S BlinkBoxX1, BlinkBoxX2;
+  GuiConst_INT16S BlinkBoxY1, BlinkBoxY2;
+  GuiConst_INT16S LineCnt;
+  GuiConst_INT16S BlindLinesAtTop;
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+  GuiConst_INT16S TextBoxScrollPos;
+#endif
+  GuiConst_TEXT PrefixGeneric *TextPtr;
+  GuiConst_INT8U InUse;
+  GuiConst_INT8U Active;
+  GuiConst_INT8U XSize;
+  GuiConst_INT8U ItemType;
+  GuiConst_INT8U VarType;
+  GuiConst_INT8U FormatFieldWidth;
+  GuiConst_INT8U FormatDecimals;
+  GuiConst_INT8U FormatAlignment;
+  GuiConst_INT8U FormatFormat;
+  GuiConst_INT8U PsNumWidth;
+  GuiConst_INT8U PsSpace;
+  GuiConst_INT8U BlinkBoxRate;
+  GuiConst_INT8U BlinkBoxState;
+  GuiConst_INT8U BlinkBoxInverted;
+  GuiConst_INT8U BlinkBoxLast;
+#ifdef GuiConst_ITEM_TEXTBLOCK_INUSE
+  GuiConst_INT8U YSize;
+  GuiConst_INT8S TextBoxLineDist;
+  GuiConst_INT8U TextBoxHorzAlignment;
+  GuiConst_INT8U TextBoxVertAlignment;
+#endif
+} GuiLib_BlinkTextItemRec;
+#endif // GuiConst_BLINK_FIELDS_OFF
+#endif // GuiConst_BLINK_SUPPORT_ON
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+typedef struct
+{
+  void (*ScrollLineDataFunc) (GuiConst_INT16S LineIndex);
+  GuiLib_ItemRec ScrollBoxItem;
+  GuiConst_INT16S X1;
+  GuiConst_INT16S Y1;
+  GuiConst_INT16S ScrollTopLine;
+  GuiConst_INT16U LastScrollTopLine;
+  GuiConst_INT16S LastMarkerLine;
+  GuiConst_INT16U ScrollActiveLine;
+  GuiConst_INT16U NumberOfLines;
+  GuiConst_INT16U MakeUpStructIndex;
+  GuiConst_INT16U ScrollVisibleLines;
+  GuiConst_INT16S LineVerticalOffset;
+  GuiConst_INT16S LineOffsetX;
+  GuiConst_INT16S LineOffsetY;
+  GuiConst_INT16S LineSizeX;
+  GuiConst_INT16S LineSizeY;
+  GuiConst_INT16S LineSizeY2;
+  GuiConst_INT16U LineStructIndex;
+  GuiConst_INT16S LineStructOffsetX;
+  GuiConst_INT16S LineStructOffsetY;
+  GuiConst_INT16U MarkerStructIndex[GuiConst_SCROLLITEM_MARKERS_MAX];
+  GuiConst_INT16S MarkerStartLine[GuiConst_SCROLLITEM_MARKERS_MAX];
+  GuiConst_INT16S MarkerSize[GuiConst_SCROLLITEM_MARKERS_MAX];
+  GuiConst_INTCOLOR LineColor;
+  GuiConst_INT16U LineColorIndex;
+  GuiConst_INTCOLOR BackColor;
+  GuiConst_INT16U BackColorIndex;
+  GuiConst_INTCOLOR MarkerColor[GuiConst_SCROLLITEM_MARKERS_MAX];
+  GuiConst_INT16U MarkerColorIndex[GuiConst_SCROLLITEM_MARKERS_MAX];
+  GuiConst_INT8U InUse;
+  GuiConst_INT8U ScrollBoxType;
+  GuiConst_INT8U LineColorTransparent;
+  GuiConst_INT8U WrapMode;
+  GuiConst_INT8U ScrollStartOfs;
+  GuiConst_INT8U ScrollMode;
+  GuiConst_INT8U LineMarkerCount;
+  GuiConst_INT8U MarkerColorTransparent[GuiConst_SCROLLITEM_MARKERS_MAX];
+  GuiConst_INT8U MarkerDrawingOrder[GuiConst_SCROLLITEM_MARKERS_MAX];
+  GuiConst_INT8U BarType;
+  GuiConst_INT8U IndicatorType;
+#ifndef GuiConst_SCROLLITEM_BAR_NONE
+  GuiConst_INT16S BarPositionX;
+  GuiConst_INT16S BarPositionY;
+  GuiConst_INT16S BarSizeX;
+  GuiConst_INT16S BarSizeY;
+  GuiConst_INT16U BarStructIndex;
+  GuiConst_INT16S BarMarkerLeftOffset;
+  GuiConst_INT16S BarMarkerRightOffset;
+  GuiConst_INT16S BarMarkerTopOffset;
+  GuiConst_INT16S BarMarkerBottomOffset;
+  GuiConst_INT16U BarMarkerIconOffsetX;
+  GuiConst_INT16U BarMarkerIconOffsetY;
+  GuiConst_INT16U BarMarkerBitmapIndex;
+  GuiConst_INT16U BarMarkerBitmapHeight;
+  GuiConst_INTCOLOR BarForeColor;
+  GuiConst_INT16U BarForeColorIndex;
+  GuiConst_INTCOLOR BarBackColor;
+  GuiConst_INT16U BarBackColorIndex;
+  GuiConst_INTCOLOR BarMarkerForeColor;
+  GuiConst_INT16U BarMarkerForeColorIndex;
+  GuiConst_INTCOLOR BarMarkerBackColor;
+  GuiConst_INT16U BarMarkerBackColorIndex;
+  GuiConst_INT8U BarMarkerBitmapIsTransparent;
+  GuiConst_INT8U BarMode;
+  GuiConst_INT8U BarTransparent;
+  GuiConst_INT8U BarThickness;
+  GuiConst_INT8U BarMarkerIconFont;
+  GuiConst_INT8U BarMarkerTransparent;
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR BarMarkerBitmapTranspColor;
+#endif // GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_TEXT PrefixLocate *BarIconPtr;
+#endif // GuiConst_SCROLLITEM_BAR_NONE
+#ifndef GuiConst_SCROLLITEM_INDICATOR_NONE
+  GuiConst_INT16S IndicatorPositionX;
+  GuiConst_INT16S IndicatorPositionY;
+  GuiConst_INT16S IndicatorSizeX;
+  GuiConst_INT16S IndicatorSizeY;
+  GuiConst_INT16U IndicatorStructIndex;
+  GuiConst_INT16S IndicatorMarkerLeftOffset;
+  GuiConst_INT16S IndicatorMarkerRightOffset;
+  GuiConst_INT16S IndicatorMarkerTopOffset;
+  GuiConst_INT16S IndicatorMarkerBottomOffset;
+  GuiConst_INT16U IndicatorMarkerIconFont;
+  GuiConst_INT16U IndicatorMarkerIconOffsetX;
+  GuiConst_INT16U IndicatorMarkerIconOffsetY;
+  GuiConst_INT16U IndicatorMarkerBitmapIndex;
+  GuiConst_INT16S IndicatorLine;
+  GuiConst_INTCOLOR IndicatorForeColor;
+  GuiConst_INT16U IndicatorForeColorIndex;
+  GuiConst_INTCOLOR IndicatorBackColor;
+  GuiConst_INT16U IndicatorBackColorIndex;
+  GuiConst_INTCOLOR IndicatorMarkerForeColor;
+  GuiConst_INT16U IndicatorMarkerForeColorIndex;
+  GuiConst_INTCOLOR IndicatorMarkerBackColor;
+  GuiConst_INT16U IndicatorMarkerBackColorIndex;
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_INTCOLOR IndicatorMarkerBitmapTranspColor;
+#endif // GuiConst_BITMAP_SUPPORT_ON
+  GuiConst_TEXT PrefixLocate *IndicatorIconPtr;
+  GuiConst_INT8U IndicatorMode;
+  GuiConst_INT8U IndicatorTransparent;
+  GuiConst_INT8U IndicatorThickness;
+  GuiConst_INT8U IndicatorMarkerTransparent;
+  GuiConst_INT8U IndicatorMarkerBitmapIsTransparent;
+#endif // GuiConst_SCROLLITEM_INDICATOR_NONE
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+  GuiConst_INT8U ContainsCursorFields;
+#endif // GuiConst_CURSOR_SUPPORT_ON
+} ScrollBoxRec;
+#endif // GuiConst_ITEM_SCROLLBOX_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+typedef struct
+{
+  GuiConst_INT32S NumbersMinValue;
+  GuiConst_INT32S NumbersMaxValue;
+  GuiConst_INT32S NumbersMinValueOrg;
+  GuiConst_INT32S NumbersMaxValueOrg;
+  GuiConst_INT32S NumbersStepMajor;
+  GuiConst_INT32S NumbersStepMinor;
+  GuiConst_INT32S Scale;
+  GuiConst_INT32U BitFlags;
+  GuiConst_INT16S Offset;
+  GuiConst_INT16S ArrowLength;
+  GuiConst_INT16S ArrowWidth;
+  GuiConst_INT16S TicksMajorLength;
+  GuiConst_INT16S TicksMajorWidth;
+  GuiConst_INT16S TicksMinorLength;
+  GuiConst_INT16S TicksMinorWidth;
+  GuiConst_INT16S NumbersAtEnd;
+  GuiConst_INT16S NumbersOffset;
+  GuiConst_INT8U Visible;
+  GuiConst_INT8U Line;
+  GuiConst_INT8U LineBetweenAxes;
+  GuiConst_INT8U LineNegative;
+  GuiConst_INT8U Arrow;
+  GuiConst_INT8U TicksMajor;
+  GuiConst_INT8U TicksMinor;
+  GuiConst_INT8U Numbers;
+  GuiConst_INT8U NumbersAtOrigo;
+  GuiConst_INT8U FormatFieldWidth;
+  GuiConst_INT8U FormatDecimals;
+  GuiConst_INT8U FormatAlignment;
+  GuiConst_INT8U FormatFormat;
+} GraphAxisRec;
+//----------------------X-----------------------
+typedef struct
+{
+  GuiLib_GraphDataPoint *DataPtr;
+  GuiConst_INT16U DataSize;
+  GuiConst_INT16U DataFirst;
+  GuiConst_INT16U DataCount;
+  GuiConst_INT16S Width;
+  GuiConst_INT16S Height;
+  GuiConst_INT16S Thickness;
+  GuiConst_INTCOLOR ForeColor, BackColor;
+  GuiConst_INT16U ForeColorIndex;
+  GuiConst_INT16U BackColorIndex;
+  GuiConst_INT8U Visible;
+  GuiConst_INT8U Representation;
+  GuiConst_INT8U BackColorTransparent;
+  GuiConst_INT8U AxisIndexX, AxisIndexY;
+} GraphDataSetRec;
+//----------------------X-----------------------
+typedef struct
+{
+  GuiLib_ItemRec GraphItem;
+  GraphAxisRec GraphAxes[GuiConst_GRAPH_AXES_MAX][2];
+  GraphDataSetRec GraphDataSets[GuiConst_GRAPH_DATASETS_MAX];
+  GuiConst_INT16S OrigoX, OrigoY;
+  GuiConst_INT16S OriginOffsetX, OriginOffsetY;
+  GuiConst_INTCOLOR ForeColor, BackColor;
+  GuiConst_INT16U ForeColorIndex;
+  GuiConst_INT16U BackColorIndex;
+  GuiConst_INT8U InUse;
+  GuiConst_INT8U GraphAxesCnt[2];
+  GuiConst_INT8U GraphDataSetCnt;
+} GraphItemRec;
+#endif //GuiConst_ITEM_GRAPH_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+typedef struct
+{
+  GuiConst_INT8U *BaseAddress;
+  GuiConst_INT16U X, Y;
+  GuiConst_INT16U LineSize;
+  GuiConst_INT16U Width, Height;
+  GuiConst_INT8U InUse;
+  GuiConst_INT8U SizeMode;
+  GuiConst_INT8U InitMode;
+} GraphicsLayerRec;
+typedef struct
+{
+  void (*GraphicsFilterFunc)
+     (GuiConst_INT8U *DestAddress,
+      GuiConst_INT16U DestLineSize,
+      GuiConst_INT8U *SourceAddress,
+      GuiConst_INT16U SourceLineSize,
+      GuiConst_INT16U Width,
+      GuiConst_INT16U Height,
+      GuiConst_INT32S FilterPars[10]);
+  void PrefixLocate *ParVarPtr[10];
+  GuiConst_INT32S ParValueNum[10];
+  GuiConst_INT16S SourceLayerIndexNo;
+  GuiConst_INT16S DestLayerIndexNo;
+  GuiConst_INT16S ContAtLayerIndexNo;
+  GuiConst_INT8U InUse;
+  GuiConst_INT8U ParVarType[10];
+} GraphicsFilterRec;
+#endif // GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+typedef struct
+{
+  GuiConst_INT16S Index;
+  GuiConst_INT16S X;
+  GuiConst_INT16S Y;
+  GuiConst_INT8U InUse;
+} BackgrBitmapRec;
+#endif // GuiConst_BITMAP_SUPPORT_ON
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+typedef struct
+{
+  GuiConst_INT16S index;
+  GuiConst_INT16S pos;
+} TextBoxRec;
+#endif
+//----------------------X-----------------------
+typedef struct
+{
+  GuiConst_INT16S X[2 * GuiLib_MEMORY_CNT];
+  GuiConst_INT16S Y[2 * GuiLib_MEMORY_CNT];
+  GuiConst_INTCOLOR C[GuiLib_MEMORY_CNT];
+} ItemMemory;
+//----------------------X-----------------------
+#define ITEM_NONE         0
+#define ITEM_AUTOREDRAW   1
+#define ITEM_CURSOR       2
+#define ITEM_TEXTBOX      4
+typedef struct
+{
+  PrefixLocate GuiLib_ItemRec  Item;
+  ItemMemory      Memory;
+  GuiConst_INT16S Prev;
+  GuiConst_INT16S Next;
+  GuiConst_INT16S Parent;
+  GuiConst_INT16S Padding;
+  GuiConst_INT8U  Valid;
+  GuiConst_INT8U  Level;
+  GuiConst_INT16U ValueSize;
+  GuiConst_INT8U  Value[GuiLib_AUTOREDRAW_MAX_VAR_SIZE];
+} AutoRedrawItems;
+//----------------------X-----------------------
+static GuiConst_INT8U GetItemByte(GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr);
+static GuiConst_INT16S GetItemWord(GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr);
+#ifdef GuiLib_COLOR_BYTESIZE_3
+static GuiConst_INT32S GetItemTriple(GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr);
+#endif
+#ifdef GuiLib_GETITEMLONG
+static GuiConst_INT32S GetItemLong(GuiConst_INT8U *PrefixLocate*PrefixLocate ItemDataPtrPtr);
+#endif
+#ifdef GuiConst_BLINK_SUPPORT_ON
+static void BlinkBox(void);
+#endif
+//----------------------X-----------------------
+void AutoRedraw_Init(void);
+void AutoRedraw_UpdateDrawn(GuiConst_INT16S I, PrefixLocate GuiLib_ItemRec * PrefixLocate Item);
+void AutoRedraw_Delete(GuiConst_INT16S I);
+void AutoRedraw_Destroy(void);
+GuiConst_INT8S AutoRedraw_GetLevel(GuiConst_INT16S I);
+GuiConst_INT8S AutoRedraw_ItemIsStruct(GuiConst_INT16S I);
+GuiConst_INT16S AutoRedraw_DeleteStruct(GuiConst_INT16S Struct_id);
+GuiConst_INT16S AutoRedraw_Reset(void);
+GuiConst_INT16S AutoRedraw_GetNext(GuiConst_INT16S I);
+GuiConst_INT16S AutoRedraw_Add(PrefixLocate GuiLib_ItemRec * PrefixLocate Item, GuiConst_INT16S Struct, GuiConst_INT8U Level);
+GuiConst_INT16S AutoRedraw_Insert(PrefixLocate GuiLib_ItemRec * PrefixLocate Item, GuiConst_INT16S Struct, GuiConst_INT8U Level);
+PrefixLocate GuiLib_ItemRec *AutoRedraw_GetItem(GuiConst_INT16S I);
+PrefixLocate ItemMemory     *AutoRedraw_GetItemMemory(GuiConst_INT16S I);
+GuiConst_INT8S RefreshColorVariable(GuiConst_INTCOLOR *comp, GuiConst_INT16U idx);
+void AutoRedraw_UpdateOnChange(GuiConst_INT16S I);
+void AutoRedraw_UpdateVar(GuiConst_INT16S I);
+GuiConst_INT8S AutoRedraw_VarChanged(GuiConst_INT16S I);
+#ifdef GuiConst_TEXTBOX_FIELDS_ON
+GuiConst_INT16S *TextBox_Scroll_GetPosRec(GuiConst_INT8U TextBoxIndex);
+GuiConst_INT16S AutoRedraw_InsertTextBox(PrefixLocate GuiLib_ItemRec * PrefixLocate Item,
+                  GuiConst_INT16S Struct,
+                  GuiConst_INT8U Level);
+void AutoRedraw_SetAsTextBox(GuiConst_INT16S I);
+GuiConst_INT16S AutoRedraw_GetTextBox(GuiConst_INT8S T, GuiConst_INT16S I);
+#endif
+#ifdef GuiConst_CURSOR_SUPPORT_ON
+void AutoRedraw_ResetCursor(void);
+GuiConst_INT16S AutoRedraw_InsertCursor(PrefixLocate GuiLib_ItemRec * PrefixLocate Item,
+                  GuiConst_INT16S Struct,
+                  GuiConst_INT8U Level);
+void AutoRedraw_SetAsCursor(GuiConst_INT16S I);
+GuiConst_INT16S AutoRedraw_IsOnlyCursor(GuiConst_INT16S I);
+GuiConst_INT16S AutoRedraw_GetCursor(GuiConst_INT8S C, GuiConst_INT16S I);
+GuiConst_INT8S AutoRedraw_GetCursorNumber(GuiConst_INT16S I);
+GuiConst_INT16S AutoRedraw_GetFirstCursor(void);
+GuiConst_INT16S AutoRedraw_GetLastCursor(void);
+GuiConst_INT16S AutoRedraw_GetNextCursor(GuiConst_INT8S C);
+GuiConst_INT16S AutoRedraw_GetPrevCursor(GuiConst_INT8S C);
+GuiConst_INT16S AutoRedraw_CheckCursorInheritance(GuiConst_INT16S N);
+#endif
+//----------------------X-----------------------
+typedef struct
+{
+  GuiConst_INT16S DrawnX1, DrawnY1, DrawnX2, DrawnY2;
+  GuiConst_INT16U Dummy1_16U;
+  GuiConst_INT16U Dummy2_16U;
+  GuiConst_INT16S Dummy1_16S;
+#ifdef GuiConst_ARAB_CHARS_INUSE
+  GuiConst_INT16S ArabicCharJoiningModeIndex[GuiConst_MAX_TEXT_LEN + 2];
+  GuiConst_INT8U ArabicCharJoiningMode[GuiConst_MAX_TEXT_LEN + 2];
+  GuiConst_INT8U ArabicCharJoiningModeBefore;
+  GuiConst_INT8U ArabicCharJoiningModeAfter;
+#endif
+  GuiConst_INT8U Drawn;
+  GuiConst_INT8U Dummy1_8U;
+  GuiConst_INT8U Dummy2_8U;
+  GuiConst_INT8U Dummy3_8U;
+} GuiLib_GLOBAL;
+typedef struct
+{
+  PrefixLocate GuiLib_ItemRec CurItem;
+  GuiLib_FontRecPtr CurFont;
+  GuiLib_StructPtr TopLevelStructure;
+  ItemMemory      Memory;
+  PrefixLocate AutoRedrawItems AutoRedraw[GuiConst_MAX_DYNAMIC_ITEMS];
+  GuiConst_INT8U PrefixLocate *ItemDataPtr;
+  GuiConst_INT8U *CurLayerBufPtr;
+  GuiConst_INT32U RefreshClock;
+  GuiConst_INT32U CurLayerBytes;
+  GuiConst_INT32U ItemTypeBit1, ItemTypeBit2;
+  GuiConst_INT16S AutoRedrawFirst;
+  GuiConst_INT16S AutoRedrawLast;
+  GuiConst_INT16S AutoRedrawLatest;
+  GuiConst_INT16S AutoRedrawNext;
+  GuiConst_INT16S AutoRedrawCount;
+  GuiConst_INT16S AutoRedrawParent;
+  GuiConst_INT16S AutoRedrawUpdate;
+  GuiConst_INT16S AutoRedrawInsertPoint;
+  GuiConst_INT32U CurLayerLineSize;
+  GuiConst_INT32U CurLayerWidth;
+  GuiConst_INT32U CurLayerHeight;
+  GuiConst_INT16S DisplayOrigoX, DisplayOrigoY;
+  GuiConst_INT16S LayerOrigoX, LayerOrigoY;
+  GuiConst_INT16S CoordOrigoX, CoordOrigoY;
+  GuiConst_INT16S InvertBoxX1, InvertBoxY1, InvertBoxX2, InvertBoxY2;
+  GuiConst_INT16S ItemX1, ItemY1;
+  GuiConst_INT16S ItemX2, ItemY2;
+  GuiConst_INT16S ItemR1, ItemR2;
+  GuiConst_INT16U X1VarIdx, Y1VarIdx, X2VarIdx, Y2VarIdx;
+  GuiConst_INT16U R1VarIdx, R2VarIdx;
+  GuiConst_INT16S BbX1, BbX2;
+  GuiConst_INT16S BbY1, BbY2;
+  GuiConst_INT16S DisplayLevel;
+  GuiConst_INT16S AutoRedrawSaveIndex;
+  GuiConst_INT16S ThicknessMemory;
+  GuiConst_INT16S FontWriteX1, FontWriteY1, FontWriteX2, FontWriteY2;
+  GuiConst_INT16U ColMemoryIndex[GuiLib_MEMORY_CNT];
+  GuiConst_INT8U TextPsMode[GuiConst_MAX_TEXT_LEN + 1];
+  GuiConst_CHAR  VarNumTextStr[GuiConst_MAX_VARNUM_TEXT_LEN + 1];
+  GuiConst_INT8U InvertBoxOn;
+  GuiConst_INT8U CommonByte0;
+  GuiConst_INT8U CommonByte1;
+  GuiConst_INT8U CommonByte2;
+  GuiConst_INT8U CommonByte3;
+  GuiConst_INT8U CommonByte4;
+  GuiConst_INT8U CommonByte5;
+  GuiConst_INT8U CommonByte6;
+  GuiConst_INT8U CommonByte7;
+  GuiConst_INT8U X1Mode, Y1Mode;
+  GuiConst_INT8U X2Mode, Y2Mode;
+  GuiConst_INT8U R1Mode, R2Mode;
+  GuiConst_INT8U X1MemoryRead, Y1MemoryRead;
+  GuiConst_INT8U X1MemoryWrite, Y1MemoryWrite;
+  GuiConst_INT8U X2MemoryRead, Y2MemoryRead;
+  GuiConst_INT8U X2MemoryWrite, Y2MemoryWrite;
+  GuiConst_INT8U R1MemoryRead, R2MemoryRead;
+  GuiConst_INT8U R1MemoryWrite, R2MemoryWrite;
+  GuiConst_INT8U X1VarType, Y1VarType, X2VarType, Y2VarType;
+  GuiConst_INT8U R1VarType, R2VarType;
+  GuiConst_INT8U DisplayWriting;
+  GuiConst_INT8U InitialDrawing;
+  GuiConst_INT8U DrawingLevel;
+  GuiConst_INT8U SwapColors;
+  GuiConst_INT8U BaseLayerDrawing;
+  GuiLib_PosCallbackRec PosCallbacks[GuiConst_POSCALLBACK_CNT];
+//----------------------X-----------------------
+  #ifdef GuiConst_TEXTBOX_FIELDS_ON
+    TextBoxRec TextBoxScrollPositions[GuiConst_TEXTBOX_FIELDS_MAX];
+  #endif
+//----------------------X-----------------------
+  #ifdef GuiConst_ITEM_TOUCHAREA_INUSE
+    GuiLib_TouchAreaRec TouchAreas[GuiConst_TOUCHAREA_CNT];
+    GuiConst_INT32S TouchAreaCnt;
+    GuiConst_INT32S TouchAdjustXMeasured[4];
+    GuiConst_INT32S TouchAdjustYMeasured[4];
+    GuiConst_INT32S TouchAdjustXTL, TouchAdjustYTL;
+    GuiConst_INT32S TouchAdjustXTR, TouchAdjustYTR;
+    GuiConst_INT32S TouchAdjustXBL, TouchAdjustYBL;
+    GuiConst_INT32S TouchAdjustXBR, TouchAdjustYBR;
+    GuiConst_INT16S TouchAdjustXTrue[4];
+    GuiConst_INT16S TouchAdjustYTrue[4];
+    GuiConst_INT8U TouchAdjustInUse[4];
+    GuiConst_INT8U TouchAdjustActive;
+    GuiConst_INT16S TouchConvertX, TouchConvertY;
+  #endif // GuiConst_ITEM_TOUCHAREA_INUSE
+//----------------------X-----------------------
+  #ifdef GuiConst_FLOAT_SUPPORT_ON
+    GuiConst_INT16S VarExponent;
+  #endif
+//----------------------X-----------------------
+  #ifdef GuiConst_CHARMODE_UNICODE
+    GuiConst_TEXT VarNumUnicodeTextStr[GuiConst_MAX_VARNUM_TEXT_LEN + 1];
+    GuiConst_TEXT UnicodeTextBuf[GuiConst_MAX_TEXT_LEN + 1];
+  #else
+    GuiConst_TEXT AnsiTextBuf[GuiConst_MAX_TEXT_LEN + 1];
+  #endif // GuiConst_CHARMODE_UNICODE
+//----------------------X-----------------------
+  #ifdef GuiConst_CURSOR_SUPPORT_ON
+    GuiConst_INT16S CursorFieldFound;
+    GuiConst_INT8U CursorInUse;
+    GuiConst_INT8U CursorActiveFieldFound;
+  #endif // GuiConst_CURSOR_SUPPORT_ON
+//----------------------X-----------------------
+  #ifdef GuiConst_BLINK_SUPPORT_ON
+    #ifndef GuiConst_BLINK_FIELDS_OFF
+      GuiLib_BlinkTextItemRec BlinkTextItems[GuiConst_BLINK_FIELDS_MAX];
+    #endif // GuiConst_BLINK_FIELDS_OFF
+    GuiConst_INT16S BlinkBoxX1, BlinkBoxY1, BlinkBoxX2, BlinkBoxY2;
+    GuiConst_INT16S BlinkBoxRate;
+    GuiConst_INT16S BlinkBoxState;
+    GuiConst_INT8U BlinkBoxInverted;
+  #endif // GuiConst_BLINK_SUPPORT_ON
+//----------------------X-----------------------
+  #ifdef GuiConst_CLIPPING_SUPPORT_ON
+    GuiConst_INT16S DisplayActiveAreaX1, DisplayActiveAreaY1;
+    GuiConst_INT16S DisplayActiveAreaX2, DisplayActiveAreaY2;
+    GuiConst_INT16S ClippingX1, ClippingY1, ClippingX2, ClippingY2;
+    GuiConst_INT16S ActiveAreaX1, ActiveAreaY1, ActiveAreaX2, ActiveAreaY2;
+    GuiConst_INT8U ClippingTotal;
+  #endif // GuiConst_CLIPPING_SUPPORT_ON
+//----------------------X-----------------------
+  #ifdef GuiConst_REMOTE_DATA
+    #ifdef GuiConst_REMOTE_FONT_DATA
+      GuiConst_INT32S CurRemoteFont;
+      GuiConst_INT8U GuiLib_RemoteFontBuffer[GuiConst_REMOTE_FONT_BUF_SIZE];
+    #endif // GuiConst_REMOTE_FONT_DATA
+    #ifdef GuiConst_REMOTE_STRUCT_DATA
+      GuiConst_INT32U RemoteStructOffset;
+      GuiConst_TEXT GuiLib_RemoteStructText[GuiConst_MAX_TEXT_LEN + 1];
+      GuiConst_INT8U GuiLib_RemoteStructBuffer[1];
+      GuiConst_INT8U GuiLib_RemoteItemBuffer[GuiConst_REMOTE_STRUCT_BUF_SIZE];
+    #endif // GuiConst_REMOTE_STRUCT_DATA
+    #ifdef GuiConst_REMOTE_BITMAP_DATA
+      GuiConst_INT32S CurRemoteBitmap;
+      GuiConst_INT8U GuiLib_RemoteBitmapBuffer[GuiConst_REMOTE_BITMAP_BUF_SIZE];
+    #endif // GuiConst_REMOTE_BITMAP_DATA
+    #ifdef GuiConst_REMOTE_TEXT_DATA
+      GuiConst_INT32S CurRemoteText;
+      GuiConst_INT32S RemoteTextTableOfs;
+      GuiConst_INT16U RemoteTextLen;
+      GuiConst_TEXT GuiLib_RemoteTextBuffer[GuiConst_REMOTE_TEXT_BUF_SIZE];
+    #endif // GuiConst_REMOTE_TEXT_DATA
+  #endif // GuiConst_REMOTE_DATA
+  #ifdef GuiConst_REMOTE_FONT_DATA
+    GuiConst_INT32U TextCharNdx[GuiConst_MAX_TEXT_LEN + 1];
+  #else
+    GuiConst_INT8U PrefixRom *TextCharPtrAry[GuiConst_MAX_TEXT_LEN + 1];
+  #endif // GuiConst_REMOTE_FONT_DATA
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_SCROLLBOX_INUSE
+  ScrollBoxRec ScrollBoxesAry[GuiConst_SCROLLITEM_BOXES_MAX];
+  GuiConst_INT8U NextScrollLineReading;
+  GuiConst_INT8U GlobalScrollBoxIndex;
+#endif // GuiConst_ITEM_SCROLLBOX_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_GRAPH_INUSE
+  GraphItemRec GraphAry[GuiConst_GRAPH_MAX];
+  GuiConst_INT16U GlobalGraphIndex;
+#endif
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+  GraphicsLayerRec GraphicsLayerList[GuiConst_GRAPHICS_LAYER_MAX];
+  GraphicsFilterRec GraphicsFilterList[GuiConst_GRAPHICS_FILTER_MAX];
+  GuiConst_INT16U GlobalGraphicsLayerIndex;
+  GuiConst_INT16U GlobalGraphicsFilterIndex;
+  GuiConst_INT16S GraphicsLayerLifo[GuiConst_GRAPHICS_LAYER_MAX];
+  GuiConst_INT8U LayerBuf[GuiConst_GRAPHICS_LAYER_BUF_BYTES];
+  GuiConst_INT8U GraphicsLayerLifoCnt;
+#endif // GuiConst_ITEM_GRAPHICS_LAYER_FILTER_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_ITEM_BUTTON_INUSE
+  GuiConst_INTCOLOR DisabledButtonColor;
+  GuiConst_INT16S   ButtonColorOverride;
+#endif // GuiConst_ITEM_BUTTON_INUSE
+//----------------------X-----------------------
+#ifdef GuiConst_BITMAP_SUPPORT_ON
+  BackgrBitmapRec BackgrBitmapAry[GuiConst_MAX_BACKGROUND_BITMAPS];
+  GuiConst_INT16U GlobalBackgrBitmapIndex;
+  GuiConst_INT16S BitmapWriteX2, BitmapWriteY2;
+  GuiConst_INT16S BitmapSizeX, BitmapSizeY;
+#endif // GuiConst_BITMAP_SUPPORT_ON
+} GuiLib_STATIC;
+
+#ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
+}
+#endif
+
+//----------------------X-----------------------
+//----------------------X-----------------------
+
+
+#endif
+
+/* End of File */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/GuiConst.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,134 @@
+// My own header is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+//
+//                            *** ATTENTION ***
+//
+//   This file is maintained by the easyGUI Graphical User Interface
+//   program. Modifications should therefore not be made directly in
+//   this file, as the changes will be lost next time easyGUI creates
+//   the file.
+//
+//                            *** ATTENTION ***
+//
+// -----------------------------------------------------------------------
+
+//
+// Generated by easyGUI version 6.0.9.005
+// Generated for project SinglePhoto_QSPI
+// in project file C:\Single Photo QSPI EasyGUI application\SinglePhoto_QSPI.gui
+//
+
+// Ensure that this header file is only included once
+#ifndef __GUICONST_H
+#define __GUICONST_H
+
+// --------------------------  INCLUDE SECTION  --------------------------
+
+
+// ---------------------  GLOBAL DECLARATION SECTION  --------------------
+
+#define GuiConst_PC_V6_0_9
+
+#define GuiConst_MICRO_LITTLE_ENDIAN
+#define GuiConst_CHAR    char
+#define GuiConst_INT8S   signed char
+#define GuiConst_INT8U   unsigned char
+#define GuiConst_INT16S  signed short
+#define GuiConst_INT16U  unsigned short
+#define GuiConst_INT32S  signed int
+#define GuiConst_INT32U  unsigned int
+
+#define GuiConst_PTR void *
+#define GuiConst_TEXT GuiConst_CHAR
+
+#define GuiConst_BITMAP_COMPRESSED
+
+#define GuiConst_DISPLAY_BUFFER_INTERMEDIATE
+#define GuiConst_DISPLAY_BUFFER_EASYGUI
+#define GuiConst_DISPLAY_LITTLE_ENDIAN
+#define GuiConst_DISPLAY_WIDTH            800
+#define GuiConst_DISPLAY_HEIGHT           480
+#define GuiConst_DISPLAY_WIDTH_HW         800
+#define GuiConst_DISPLAY_HEIGHT_HW        480
+#define GuiConst_CONTROLLER_COUNT_HORZ    1
+#define GuiConst_CONTROLLER_COUNT_VERT    1
+#define GuiConst_BYTES_PR_LINE            1600
+#define GuiConst_BYTE_LINES               480
+#define GuiConst_BYTES_PR_SECTION         1600
+#define GuiConst_LINES_PR_SECTION         480
+#define GuiConst_DISPLAY_BYTES            768000
+#define GuiConst_PIXELS_PER_BYTE          1
+
+#define GuiConst_BYTE_HORIZONTAL
+#define GuiConst_ROTATED_OFF
+
+#define GuiConst_COLOR_MODE_RGB
+#define GuiConst_COLOR_DEPTH_16
+#define GuiConst_COLOR_PLANES_1
+#define GuiConst_INTCOLOR                 GuiConst_INT16U
+#define GuiConst_COLOR_SIZE               16
+#define GuiConst_COLOR_MAX                65535
+#define GuiConst_COLOR_BYTE_SIZE          2
+#define GuiConst_PIXEL_BYTE_SIZE          2
+#define GuiConst_COLORCODING_MASK         0xFFFF
+#define GuiConst_COLORCODING_R_START      0
+#define GuiConst_COLORCODING_R_SIZE       5
+#define GuiConst_COLORCODING_R_MAX        31
+#define GuiConst_COLORCODING_R_MASK       0x001F
+#define GuiConst_COLORCODING_G_START      5
+#define GuiConst_COLORCODING_G_SIZE       6
+#define GuiConst_COLORCODING_G_MAX        63
+#define GuiConst_COLORCODING_G_MASK       0x07E0
+#define GuiConst_COLORCODING_B_START      11
+#define GuiConst_COLORCODING_B_SIZE       5
+#define GuiConst_COLORCODING_B_MAX        31
+#define GuiConst_COLORCODING_B_MASK       0xF800
+#define GuiConst_PIXEL_OFF                65535
+#define GuiConst_PIXEL_ON                 0
+
+
+#define GuiConst_CURSOR_SUPPORT_ON
+#define GuiConst_BLINK_SUPPORT_ON
+#define GuiConst_BITMAP_SUPPORT_ON
+#define GuiConst_CLIPPING_SUPPORT_ON
+#define GuiConst_FLOAT_SUPPORT_ON
+#define GuiConst_ADV_FONTS_ON
+
+#define GuiConst_CHARMODE_ANSI
+#define GuiConst_CURSOR_FIELDS_OFF
+#define GuiConst_BLINK_FIELDS_MAX         0
+#define GuiConst_BLINK_FIELDS_OFF
+#define GuiConst_BLINK_LF_COUNTS
+#define GuiConst_MAX_TEXT_LEN             80
+#define GuiConst_MAX_VARNUM_TEXT_LEN      12
+#define GuiConst_MAX_PARAGRAPH_LINE_CNT   50
+#define GuiConst_MAX_DYNAMIC_ITEMS        10
+#define GuiConst_MAX_BACKGROUND_BITMAPS   10
+#define GuiConst_TOUCHAREA_CNT            0
+#define GuiConst_POSCALLBACK_CNT          5
+#define GuiConst_CURSOR_MODE_STOP_TOP
+#define GuiConst_SCROLL_MODE_STOP_TOP
+
+#define GuiConst_DECIMAL_PERIOD
+
+#define GuiConst_AUTOREDRAW_MAX_VAR_SIZE  1
+
+#define GuiConst_LANGUAGE_CNT             1
+#define GuiConst_LANGUAGE_ACTIVE_CNT      1
+#define GuiConst_LANGUAGE_FIRST           0
+#define GuiConst_LANGUAGE_ALL_ACTIVE
+#define GuiConst_LANGUAGE_ENGLISH         0
+
+
+// --------------------------  CUSTOM SECTION  ---------------------------
+
+// My own code is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+
+#endif
+
+// -----------------------------------------------------------------------
+
+// My own footer is inserted here - edit it in the C code generation window
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/GuiFont.c	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,5304 @@
+// My own header is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+//
+//                            *** ATTENTION ***
+//
+//   This file is maintained by the easyGUI Graphical User Interface
+//   program. Modifications should therefore not be made directly in
+//   this file, as the changes will be lost next time easyGUI creates
+//   the file.
+//
+//                            *** ATTENTION ***
+//
+// -----------------------------------------------------------------------
+
+//
+// Generated by easyGUI version 6.0.9.005
+// Generated for project SinglePhoto_QSPI
+// in project file C:\Single Photo QSPI EasyGUI application\SinglePhoto_QSPI.gui
+//
+
+// --------------------------  INCLUDE SECTION  --------------------------
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+
+// ---------------------  GLOBAL DECLARATION SECTION  --------------------
+
+const GuiConst_INT8U Ch000000[16] =
+{
+  0,0,0,0,0,  1,1,1,1,1,
+  0,2,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000001[18] =
+{
+  1,0,0,1,2,  3,4,4,3,2,
+  0,5,
+  3,5,
+  0x12,
+  0x20,0xF8,0x20
+};
+const GuiConst_INT8U Ch000002[17] =
+{
+  2,2,2,1,1,  2,2,2,2,1,
+  1,2,
+  7,3,
+  0x02,
+  0x40,0x80
+};
+const GuiConst_INT8U Ch000003[16] =
+{
+  2,0,0,2,2,  2,4,4,2,2,
+  0,5,
+  5,1,
+  0x00,
+  0xF8
+};
+const GuiConst_INT8U Ch000004[16] =
+{
+  2,2,2,2,2,  2,2,2,2,2,
+  2,1,
+  8,1,
+  0x00,
+  0x80
+};
+const GuiConst_INT8U Ch000005[20] =
+{
+  1,0,0,1,2,  3,4,4,3,2,
+  0,5,
+  2,7,
+  0x18,
+  0x20,0x50,0x88,0x50,0x20
+};
+const GuiConst_INT8U Ch000006[18] =
+{
+  1,1,2,2,1,  2,2,2,2,2,
+  1,2,
+  2,7,
+  0x78,
+  0x40,0xC0,0x40
+};
+const GuiConst_INT8U Ch000007[22] =
+{
+  0,0,0,0,2,  4,4,3,4,2,
+  0,5,
+  2,7,
+  0x00,
+  0x70,0x88,0x08,0x30,0x40,0x80,0xF8
+};
+const GuiConst_INT8U Ch000008[22] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  2,7,
+  0x00,
+  0x70,0x88,0x08,0x30,0x08,0x88,0x70
+};
+const GuiConst_INT8U Ch000009[21] =
+{
+  1,0,0,1,2,  3,4,4,3,2,
+  0,5,
+  2,7,
+  0x40,
+  0x10,0x30,0x50,0x90,0xF8,0x10
+};
+const GuiConst_INT8U Ch000010[21] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  2,7,
+  0x10,
+  0xF8,0x80,0xF0,0x08,0x88,0x70
+};
+const GuiConst_INT8U Ch000011[21] =
+{
+  1,0,0,0,2,  3,4,4,4,2,
+  0,5,
+  2,7,
+  0x20,
+  0x30,0x40,0x80,0xF0,0x88,0x70
+};
+const GuiConst_INT8U Ch000012[21] =
+{
+  0,1,0,0,2,  4,4,3,1,2,
+  0,5,
+  2,7,
+  0x04,
+  0xF8,0x08,0x10,0x20,0x40,0x80
+};
+const GuiConst_INT8U Ch000013[20] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  2,7,
+  0x24,
+  0x70,0x88,0x70,0x88,0x70
+};
+const GuiConst_INT8U Ch000014[21] =
+{
+  0,0,0,1,2,  4,4,4,3,2,
+  0,5,
+  2,7,
+  0x04,
+  0x70,0x88,0x78,0x08,0x10,0x60
+};
+const GuiConst_INT8U Ch000015[18] =
+{
+  2,2,2,2,2,  2,2,2,2,2,
+  2,1,
+  4,5,
+  0x0C,
+  0x80,0x00,0x80
+};
+const GuiConst_INT8U Ch000016[20] =
+{
+  1,0,0,0,2,  3,4,4,4,2,
+  0,5,
+  2,7,
+  0x44,
+  0x20,0x50,0x88,0xF8,0x88
+};
+const GuiConst_INT8U Ch000017[20] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  2,7,
+  0x24,
+  0xF0,0x88,0xF0,0x88,0xF0
+};
+const GuiConst_INT8U Ch000018[20] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  2,7,
+  0x18,
+  0x70,0x88,0x80,0x88,0x70
+};
+const GuiConst_INT8U Ch000019[18] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  2,7,
+  0x3C,
+  0xF0,0x88,0xF0
+};
+const GuiConst_INT8U Ch000020[20] =
+{
+  0,0,0,0,2,  4,3,3,4,2,
+  0,5,
+  2,7,
+  0x24,
+  0xF8,0x80,0xF0,0x80,0xF8
+};
+const GuiConst_INT8U Ch000021[19] =
+{
+  0,0,0,0,2,  4,3,3,2,2,
+  0,5,
+  2,7,
+  0x64,
+  0xF8,0x80,0xF0,0x80
+};
+const GuiConst_INT8U Ch000022[18] =
+{
+  0,0,0,0,1,  0,3,3,3,2,
+  0,4,
+  2,7,
+  0x72,
+  0x80,0xE0,0x90
+};
+const GuiConst_INT8U Ch000023[17] =
+{
+  0,0,0,0,0,  5,5,5,5,5,
+  0,6,
+  0,11,
+  0xFE,0x07,
+  0xFC
+};
+const GuiConst_INT8U Ch000024[16] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000025[18] =
+{
+  2,0,0,2,2,  3,5,5,3,3,
+  0,6,
+  3,5,
+  0x12,
+  0x30,0xFC,0x30
+};
+const GuiConst_INT8U Ch000026[17] =
+{
+  2,2,2,1,1,  2,2,3,3,2,
+  1,3,
+  7,3,
+  0x02,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000027[16] =
+{
+  2,0,0,2,2,  3,5,5,3,3,
+  0,6,
+  5,1,
+  0x00,
+  0xFC
+};
+const GuiConst_INT8U Ch000028[16] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  7,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000029[20] =
+{
+  1,0,0,1,2,  4,5,5,4,3,
+  0,6,
+  2,7,
+  0x18,
+  0x30,0x78,0xCC,0x78,0x30
+};
+const GuiConst_INT8U Ch000030[19] =
+{
+  2,1,3,3,2,  4,4,4,4,3,
+  1,4,
+  2,7,
+  0x70,
+  0x30,0x70,0xF0,0x30
+};
+const GuiConst_INT8U Ch000031[22] =
+{
+  0,0,0,0,2,  5,5,4,5,3,
+  0,6,
+  2,7,
+  0x00,
+  0x78,0xCC,0x0C,0x38,0x60,0xC0,0xFC
+};
+const GuiConst_INT8U Ch000032[22] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  2,7,
+  0x00,
+  0x78,0xCC,0x0C,0x38,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000033[20] =
+{
+  1,0,0,3,2,  4,4,5,4,3,
+  0,6,
+  2,7,
+  0x48,
+  0x38,0x78,0xD8,0xFC,0x18
+};
+const GuiConst_INT8U Ch000034[21] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  2,7,
+  0x10,
+  0xFC,0xC0,0xF8,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000035[21] =
+{
+  1,0,0,0,2,  4,4,5,5,3,
+  0,6,
+  2,7,
+  0x20,
+  0x38,0x60,0xC0,0xF8,0xCC,0x78
+};
+const GuiConst_INT8U Ch000036[20] =
+{
+  0,1,2,1,2,  5,5,4,3,3,
+  0,6,
+  2,7,
+  0x28,
+  0xFC,0x0C,0x18,0x30,0x60
+};
+const GuiConst_INT8U Ch000037[20] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  2,7,
+  0x24,
+  0x78,0xCC,0x78,0xCC,0x78
+};
+const GuiConst_INT8U Ch000038[21] =
+{
+  0,0,1,1,2,  5,5,5,4,3,
+  0,6,
+  2,7,
+  0x04,
+  0x78,0xCC,0x7C,0x0C,0x18,0x70
+};
+const GuiConst_INT8U Ch000039[18] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  3,6,
+  0x2A,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000040[20] =
+{
+  1,0,0,0,2,  4,5,5,5,3,
+  0,6,
+  2,7,
+  0x48,
+  0x30,0x78,0xCC,0xFC,0xCC
+};
+const GuiConst_INT8U Ch000041[20] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  2,7,
+  0x24,
+  0xF8,0xCC,0xF8,0xCC,0xF8
+};
+const GuiConst_INT8U Ch000042[20] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  2,7,
+  0x18,
+  0x78,0xCC,0xC0,0xCC,0x78
+};
+const GuiConst_INT8U Ch000043[20] =
+{
+  0,0,0,0,2,  4,5,5,4,3,
+  0,6,
+  2,7,
+  0x18,
+  0xF0,0xD8,0xCC,0xD8,0xF0
+};
+const GuiConst_INT8U Ch000044[20] =
+{
+  0,0,0,0,2,  5,4,4,5,3,
+  0,6,
+  2,7,
+  0x24,
+  0xFC,0xC0,0xF8,0xC0,0xFC
+};
+const GuiConst_INT8U Ch000045[19] =
+{
+  0,0,0,0,2,  5,4,4,2,3,
+  0,6,
+  2,7,
+  0x64,
+  0xFC,0xC0,0xF8,0xC0
+};
+const GuiConst_INT8U Ch000046[18] =
+{
+  0,0,0,0,2,  1,4,4,4,2,
+  0,5,
+  2,7,
+  0x72,
+  0xC0,0xF0,0xD8
+};
+const GuiConst_INT8U Ch000047[17] =
+{
+  0,0,0,0,0,  6,6,6,6,6,
+  0,7,
+  0,11,
+  0xFE,0x07,
+  0xFE
+};
+const GuiConst_INT8U Ch000048[16] =
+{
+  0,0,0,0,0,  0,0,0,0,0,
+  0,1,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000049[18] =
+{
+  1,0,0,1,1,  1,2,2,1,1,
+  0,3,
+  4,3,
+  0x00,
+  0x40,0xE0,0x40
+};
+const GuiConst_INT8U Ch000050[17] =
+{
+  1,1,1,0,0,  1,1,1,1,0,
+  0,2,
+  7,3,
+  0x02,
+  0x40,0x80
+};
+const GuiConst_INT8U Ch000051[16] =
+{
+  1,0,0,1,1,  1,2,2,1,1,
+  0,3,
+  5,1,
+  0x00,
+  0xE0
+};
+const GuiConst_INT8U Ch000052[16] =
+{
+  1,1,1,1,1,  1,1,1,1,1,
+  1,1,
+  8,1,
+  0x00,
+  0x80
+};
+const GuiConst_INT8U Ch000053[18] =
+{
+  1,0,0,1,1,  1,2,2,1,1,
+  0,3,
+  2,7,
+  0x3C,
+  0x40,0xA0,0x40
+};
+const GuiConst_INT8U Ch000054[18] =
+{
+  1,0,1,1,0,  1,1,1,1,1,
+  0,2,
+  2,7,
+  0x78,
+  0x40,0xC0,0x40
+};
+const GuiConst_INT8U Ch000055[21] =
+{
+  1,0,0,0,1,  1,2,1,2,1,
+  0,3,
+  2,7,
+  0x20,
+  0x40,0xA0,0x20,0x40,0x80,0xE0
+};
+const GuiConst_INT8U Ch000056[22] =
+{
+  1,0,0,1,1,  1,2,2,1,1,
+  0,3,
+  2,7,
+  0x00,
+  0x40,0xA0,0x20,0x40,0x20,0xA0,0x40
+};
+const GuiConst_INT8U Ch000057[20] =
+{
+  1,0,0,1,1,  2,2,3,2,2,
+  0,4,
+  2,7,
+  0x48,
+  0x20,0x60,0xA0,0xF0,0x20
+};
+const GuiConst_INT8U Ch000058[21] =
+{
+  0,0,0,1,1,  2,2,2,1,1,
+  0,3,
+  2,7,
+  0x10,
+  0xE0,0x80,0xC0,0x20,0xA0,0x40
+};
+const GuiConst_INT8U Ch000059[20] =
+{
+  1,0,0,1,1,  2,2,2,1,1,
+  0,3,
+  2,7,
+  0x30,
+  0x60,0x80,0xC0,0xA0,0x40
+};
+const GuiConst_INT8U Ch000060[18] =
+{
+  0,1,1,1,1,  2,2,1,1,1,
+  0,3,
+  2,7,
+  0x74,
+  0xE0,0x20,0x40
+};
+const GuiConst_INT8U Ch000061[20] =
+{
+  1,0,0,1,1,  1,2,2,1,1,
+  0,3,
+  2,7,
+  0x24,
+  0x40,0xA0,0x40,0xA0,0x40
+};
+const GuiConst_INT8U Ch000062[20] =
+{
+  1,0,0,0,1,  1,2,2,1,1,
+  0,3,
+  2,7,
+  0x0C,
+  0x40,0xA0,0x60,0x20,0xC0
+};
+const GuiConst_INT8U Ch000063[18] =
+{
+  1,1,1,1,1,  1,1,1,1,1,
+  1,1,
+  4,5,
+  0x0C,
+  0x80,0x00,0x80
+};
+const GuiConst_INT8U Ch000064[19] =
+{
+  1,0,0,0,1,  1,2,2,2,1,
+  0,3,
+  2,7,
+  0x4C,
+  0x40,0xA0,0xE0,0xA0
+};
+const GuiConst_INT8U Ch000065[20] =
+{
+  0,0,0,0,0,  1,2,2,1,0,
+  0,3,
+  2,7,
+  0x24,
+  0xC0,0xA0,0xC0,0xA0,0xC0
+};
+const GuiConst_INT8U Ch000066[20] =
+{
+  0,0,0,0,0,  1,2,2,1,0,
+  0,3,
+  2,7,
+  0x18,
+  0x40,0xA0,0x80,0xA0,0x40
+};
+const GuiConst_INT8U Ch000067[18] =
+{
+  0,0,0,0,0,  1,2,2,1,0,
+  0,3,
+  2,7,
+  0x3C,
+  0xC0,0xA0,0xC0
+};
+const GuiConst_INT8U Ch000068[20] =
+{
+  0,0,0,0,0,  2,1,1,2,0,
+  0,3,
+  2,7,
+  0x24,
+  0xE0,0x80,0xC0,0x80,0xE0
+};
+const GuiConst_INT8U Ch000069[19] =
+{
+  0,0,0,0,0,  2,1,1,0,1,
+  0,3,
+  2,7,
+  0x64,
+  0xE0,0x80,0xC0,0x80
+};
+const GuiConst_INT8U Ch000070[18] =
+{
+  0,0,0,0,1,  0,1,2,2,1,
+  0,3,
+  2,7,
+  0x72,
+  0x80,0xC0,0xA0
+};
+const GuiConst_INT8U Ch000071[17] =
+{
+  0,0,0,0,0,  4,4,4,4,4,
+  0,5,
+  0,11,
+  0xFE,0x07,
+  0xF8
+};
+const GuiConst_INT8U Ch000072[16] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000073[18] =
+{
+  2,1,0,2,2,  3,4,5,3,3,
+  0,6,
+  5,5,
+  0x12,
+  0x30,0xFC,0x30
+};
+const GuiConst_INT8U Ch000074[17] =
+{
+  2,2,2,1,2,  2,2,2,3,2,
+  1,3,
+  10,3,
+  0x02,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000075[16] =
+{
+  2,1,0,2,2,  2,3,4,2,2,
+  0,5,
+  7,2,
+  0x02,
+  0xF8
+};
+const GuiConst_INT8U Ch000076[16] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  10,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000077[19] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  3,9,
+  0xFC,0x00,
+  0x78,0xCC,0x78
+};
+const GuiConst_INT8U Ch000078[20] =
+{
+  2,1,3,3,2,  4,4,4,4,3,
+  1,4,
+  3,9,
+  0xF0,0x01,
+  0x30,0x70,0xF0,0x30
+};
+const GuiConst_INT8U Ch000079[24] =
+{
+  0,0,0,0,2,  5,5,3,5,3,
+  0,6,
+  3,9,
+  0x80,0x00,
+  0x78,0xCC,0x0C,0x18,0x30,0x60,0xC0,0xFC
+};
+const GuiConst_INT8U Ch000080[24] =
+{
+  0,0,1,0,2,  5,5,5,5,3,
+  0,6,
+  3,9,
+  0x40,0x00,
+  0x78,0xCC,0x04,0x0C,0x18,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000081[23] =
+{
+  2,1,0,1,3,  5,5,6,5,3,
+  0,7,
+  3,9,
+  0x20,0x01,
+  0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C
+};
+const GuiConst_INT8U Ch000082[22] =
+{
+  0,0,1,0,2,  5,4,5,5,3,
+  0,6,
+  3,9,
+  0x64,0x00,
+  0xFC,0xC0,0xF8,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000083[22] =
+{
+  1,0,0,0,2,  4,4,5,5,3,
+  0,6,
+  3,9,
+  0xE0,0x00,
+  0x38,0x60,0xC0,0xF8,0xCC,0x78
+};
+const GuiConst_INT8U Ch000084[20] =
+{
+  0,1,2,2,2,  5,5,4,3,3,
+  0,6,
+  3,9,
+  0xB4,0x01,
+  0xFC,0x0C,0x18,0x30
+};
+const GuiConst_INT8U Ch000085[21] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  3,9,
+  0xCC,0x00,
+  0x78,0xCC,0x78,0xCC,0x78
+};
+const GuiConst_INT8U Ch000086[22] =
+{
+  0,0,0,1,2,  5,5,5,4,3,
+  0,6,
+  3,9,
+  0x1C,0x00,
+  0x78,0xCC,0x7C,0x0C,0x18,0x70
+};
+const GuiConst_INT8U Ch000087[18] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  5,7,
+  0x5A,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000088[21] =
+{
+  2,1,0,0,2,  3,4,5,5,3,
+  0,6,
+  3,9,
+  0x2A,0x01,
+  0x30,0x78,0xCC,0xFC,0xCC
+};
+const GuiConst_INT8U Ch000089[21] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  3,9,
+  0xCC,0x00,
+  0xF8,0xCC,0xF8,0xCC,0xF8
+};
+const GuiConst_INT8U Ch000090[21] =
+{
+  0,0,0,0,2,  5,5,4,5,3,
+  0,6,
+  3,9,
+  0x78,0x00,
+  0x78,0xCC,0xC0,0xCC,0x78
+};
+const GuiConst_INT8U Ch000091[21] =
+{
+  0,0,0,0,2,  4,5,5,4,3,
+  0,6,
+  3,9,
+  0x78,0x00,
+  0xF0,0xD8,0xCC,0xD8,0xF0
+};
+const GuiConst_INT8U Ch000092[21] =
+{
+  0,0,0,0,2,  4,3,3,4,2,
+  0,5,
+  3,9,
+  0xCC,0x00,
+  0xF8,0xC0,0xF0,0xC0,0xF8
+};
+const GuiConst_INT8U Ch000093[20] =
+{
+  0,0,0,0,2,  4,3,3,1,2,
+  0,5,
+  3,9,
+  0xCC,0x01,
+  0xF8,0xC0,0xF0,0xC0
+};
+const GuiConst_INT8U Ch000094[19] =
+{
+  0,0,0,0,2,  3,5,5,5,3,
+  0,6,
+  3,9,
+  0xF2,0x01,
+  0xC0,0xF8,0xCC
+};
+const GuiConst_INT8U Ch000095[18] =
+{
+  0,0,0,0,0,  8,8,8,8,8,
+  0,9,
+  0,14,
+  0xFE,0x3F,
+  0xFF,0x80
+};
+const GuiConst_INT8U Ch000096[16] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000097[18] =
+{
+  3,1,0,3,3,  4,6,7,4,4,
+  0,8,
+  5,7,
+  0x66,
+  0x18,0xFF,0x18
+};
+const GuiConst_INT8U Ch000098[17] =
+{
+  3,3,3,3,2,  3,3,3,4,4,
+  2,3,
+  12,4,
+  0x06,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000099[16] =
+{
+  3,1,0,3,3,  4,6,7,4,4,
+  0,8,
+  8,1,
+  0x00,
+  0xFF
+};
+const GuiConst_INT8U Ch000100[16] =
+{
+  3,3,3,3,3,  4,4,4,4,4,
+  3,2,
+  12,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000101[21] =
+{
+  1,0,0,1,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0xF4,0x02,
+  0x3C,0x66,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000102[20] =
+{
+  2,1,3,3,2,  4,4,4,4,3,
+  1,4,
+  3,11,
+  0xF0,0x07,
+  0x30,0x70,0xF0,0x30
+};
+const GuiConst_INT8U Ch000103[25] =
+{
+  1,0,1,0,3,  6,7,6,7,4,
+  0,8,
+  3,11,
+  0x08,0x02,
+  0x3C,0x66,0xC3,0x03,0x0E,0x38,0x60,0xC0,0xFF
+};
+const GuiConst_INT8U Ch000104[27] =
+{
+  1,0,4,1,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0x00,0x00,
+  0x3C,0x66,0xC3,0x03,0x06,0x0C,0x06,0x03,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000105[22] =
+{
+  2,1,0,4,3,  5,5,7,5,4,
+  0,8,
+  3,11,
+  0x54,0x06,
+  0x1C,0x3C,0x6C,0xCC,0xFF,0x0C
+};
+const GuiConst_INT8U Ch000106[24] =
+{
+  0,0,1,1,3,  7,6,7,6,4,
+  0,8,
+  3,11,
+  0xC4,0x00,
+  0xFF,0xC0,0xFC,0xE6,0x03,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000107[25] =
+{
+  2,0,0,1,3,  6,5,7,6,4,
+  0,8,
+  3,11,
+  0x80,0x01,
+  0x1E,0x30,0x60,0xC0,0xFC,0xE6,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000108[22] =
+{
+  0,3,3,2,3,  7,7,5,4,4,
+  0,8,
+  3,11,
+  0x54,0x05,
+  0xFF,0x03,0x06,0x0C,0x18,0x30
+};
+const GuiConst_INT8U Ch000109[25] =
+{
+  1,0,0,1,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0x08,0x01,
+  0x3C,0x66,0xC3,0x66,0x3C,0x66,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000110[25] =
+{
+  1,0,1,1,3,  6,7,7,5,4,
+  0,8,
+  3,11,
+  0x18,0x00,
+  0x3C,0x66,0xC3,0x67,0x3F,0x03,0x06,0x0C,0x78
+};
+const GuiConst_INT8U Ch000111[18] =
+{
+  3,3,3,3,3,  4,4,4,4,4,
+  3,2,
+  6,8,
+  0xBA,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000112[21] =
+{
+  2,2,1,0,3,  5,5,6,7,4,
+  0,8,
+  3,11,
+  0xDA,0x04,
+  0x18,0x3C,0x66,0xFF,0xC3
+};
+const GuiConst_INT8U Ch000113[25] =
+{
+  0,0,0,0,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0x08,0x01,
+  0xFC,0xC6,0xC3,0xC6,0xFC,0xC6,0xC3,0xC6,0xFC
+};
+const GuiConst_INT8U Ch000114[21] =
+{
+  1,0,0,1,3,  7,6,6,7,4,
+  0,8,
+  3,11,
+  0xF8,0x01,
+  0x3E,0x63,0xC0,0x63,0x3E
+};
+const GuiConst_INT8U Ch000115[21] =
+{
+  0,0,0,0,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0xF8,0x01,
+  0xFC,0xC6,0xC3,0xC6,0xFC
+};
+const GuiConst_INT8U Ch000116[21] =
+{
+  0,0,0,0,3,  7,5,5,7,4,
+  0,8,
+  3,11,
+  0x9C,0x03,
+  0xFF,0xC0,0xFC,0xC0,0xFF
+};
+const GuiConst_INT8U Ch000117[20] =
+{
+  0,0,0,0,3,  7,5,5,1,4,
+  0,8,
+  3,11,
+  0x9C,0x07,
+  0xFF,0xC0,0xFC,0xC0
+};
+const GuiConst_INT8U Ch000118[20] =
+{
+  0,0,0,0,3,  1,5,6,6,3,
+  0,7,
+  3,11,
+  0xC6,0x07,
+  0xC0,0xF8,0xEC,0xC6
+};
+const GuiConst_INT8U Ch000119[19] =
+{
+  0,0,0,0,0,  8,8,8,8,8,
+  0,9,
+  0,17,
+  0xFE,0xFF,0x01,
+  0xFF,0x80
+};
+const GuiConst_INT8U Ch000120[16] =
+{
+  0,0,0,0,0,  1,1,1,1,1,
+  0,2,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000121[18] =
+{
+  2,0,0,2,2,  3,5,5,3,3,
+  0,6,
+  5,7,
+  0x66,
+  0x30,0xFC,0x30
+};
+const GuiConst_INT8U Ch000122[17] =
+{
+  3,3,3,3,2,  3,3,3,4,4,
+  2,3,
+  12,4,
+  0x06,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000123[16] =
+{
+  3,1,0,3,3,  4,6,6,4,4,
+  0,7,
+  8,1,
+  0x00,
+  0xFE
+};
+const GuiConst_INT8U Ch000124[16] =
+{
+  3,3,3,3,3,  4,4,4,4,4,
+  3,2,
+  12,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000125[21] =
+{
+  1,0,0,1,3,  5,6,6,5,3,
+  0,7,
+  3,11,
+  0xF4,0x02,
+  0x38,0x6C,0xC6,0x6C,0x38
+};
+const GuiConst_INT8U Ch000126[20] =
+{
+  2,1,3,3,2,  4,4,4,4,3,
+  1,4,
+  3,11,
+  0xF0,0x07,
+  0x30,0x70,0xF0,0x30
+};
+const GuiConst_INT8U Ch000127[25] =
+{
+  1,0,1,0,2,  5,6,5,6,3,
+  0,7,
+  3,11,
+  0x08,0x02,
+  0x38,0x6C,0xC6,0x0C,0x18,0x30,0x60,0xC0,0xFE
+};
+const GuiConst_INT8U Ch000128[27] =
+{
+  1,0,3,1,2,  5,6,6,5,3,
+  0,7,
+  3,11,
+  0x00,0x00,
+  0x38,0x6C,0xC6,0x06,0x0C,0x18,0x0C,0x06,0xC6,0x6C,0x38
+};
+const GuiConst_INT8U Ch000129[22] =
+{
+  3,1,0,4,3,  5,5,6,5,3,
+  0,7,
+  3,11,
+  0xAA,0x04,
+  0x1C,0x3C,0x6C,0xCC,0xFE,0x0C
+};
+const GuiConst_INT8U Ch000130[24] =
+{
+  0,0,1,1,3,  6,5,6,5,3,
+  0,7,
+  3,11,
+  0xC4,0x00,
+  0xFE,0xC0,0xF8,0xCC,0x06,0xC6,0x6C,0x38
+};
+const GuiConst_INT8U Ch000131[25] =
+{
+  2,0,0,1,3,  5,4,6,5,3,
+  0,7,
+  3,11,
+  0x80,0x01,
+  0x1C,0x30,0x60,0xC0,0xF8,0xEC,0xC6,0x6C,0x38
+};
+const GuiConst_INT8U Ch000132[22] =
+{
+  0,2,2,1,2,  6,6,4,3,3,
+  0,7,
+  3,11,
+  0x54,0x05,
+  0xFE,0x06,0x0C,0x18,0x30,0x60
+};
+const GuiConst_INT8U Ch000133[25] =
+{
+  1,0,0,1,3,  5,6,6,5,3,
+  0,7,
+  3,11,
+  0x08,0x01,
+  0x38,0x6C,0xC6,0x6C,0x38,0x6C,0xC6,0x6C,0x38
+};
+const GuiConst_INT8U Ch000134[25] =
+{
+  1,0,1,1,2,  5,6,6,4,3,
+  0,7,
+  3,11,
+  0x18,0x00,
+  0x38,0x6C,0xC6,0x6E,0x3E,0x06,0x0C,0x18,0x70
+};
+const GuiConst_INT8U Ch000135[18] =
+{
+  3,3,3,3,3,  4,4,4,4,4,
+  3,2,
+  6,8,
+  0xBA,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000136[22] =
+{
+  2,1,0,0,3,  4,5,6,6,3,
+  0,7,
+  3,11,
+  0xD2,0x04,
+  0x38,0x7C,0x6C,0xC6,0xFE,0xC6
+};
+const GuiConst_INT8U Ch000137[25] =
+{
+  0,0,0,0,2,  5,6,6,5,3,
+  0,7,
+  3,11,
+  0x08,0x01,
+  0xF8,0xCC,0xC6,0xCC,0xF8,0xCC,0xC6,0xCC,0xF8
+};
+const GuiConst_INT8U Ch000138[21] =
+{
+  1,0,0,1,3,  6,5,5,6,3,
+  0,7,
+  3,11,
+  0xF8,0x01,
+  0x3C,0x66,0xC0,0x66,0x3C
+};
+const GuiConst_INT8U Ch000139[21] =
+{
+  0,0,0,0,2,  5,6,6,5,3,
+  0,7,
+  3,11,
+  0xF8,0x01,
+  0xF8,0xCC,0xC6,0xCC,0xF8
+};
+const GuiConst_INT8U Ch000140[21] =
+{
+  0,0,0,0,3,  6,4,4,6,3,
+  0,7,
+  3,11,
+  0x9C,0x03,
+  0xFE,0xC0,0xF8,0xC0,0xFE
+};
+const GuiConst_INT8U Ch000141[20] =
+{
+  0,0,0,0,3,  6,4,4,1,3,
+  0,7,
+  3,11,
+  0x9C,0x07,
+  0xFE,0xC0,0xF8,0xC0
+};
+const GuiConst_INT8U Ch000142[19] =
+{
+  0,0,0,0,2,  1,5,5,5,3,
+  0,6,
+  3,11,
+  0xE6,0x07,
+  0xC0,0xF8,0xCC
+};
+const GuiConst_INT8U Ch000143[18] =
+{
+  0,0,0,0,0,  7,7,7,7,7,
+  0,8,
+  0,17,
+  0xFE,0xFF,0x01,
+  0xFF
+};
+const GuiConst_INT8U Ch000144[16] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000145[18] =
+{
+  2,0,0,2,2,  2,4,4,2,2,
+  0,5,
+  5,7,
+  0x66,
+  0x20,0xF8,0x20
+};
+const GuiConst_INT8U Ch000146[17] =
+{
+  1,1,1,1,1,  2,2,2,2,1,
+  0,3,
+  12,3,
+  0x02,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000147[16] =
+{
+  2,0,0,2,2,  2,4,4,2,2,
+  0,5,
+  8,1,
+  0x00,
+  0xF8
+};
+const GuiConst_INT8U Ch000148[16] =
+{
+  1,1,1,1,1,  2,2,2,2,2,
+  1,2,
+  12,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000149[21] =
+{
+  1,0,0,1,2,  3,4,4,3,2,
+  0,5,
+  3,11,
+  0xF8,0x01,
+  0x20,0x50,0x88,0x50,0x20
+};
+const GuiConst_INT8U Ch000150[19] =
+{
+  1,2,2,2,1,  2,2,2,2,2,
+  1,2,
+  3,11,
+  0xF8,0x07,
+  0x40,0xC0,0x40
+};
+const GuiConst_INT8U Ch000151[24] =
+{
+  0,1,0,0,2,  4,4,2,4,2,
+  0,5,
+  3,11,
+  0x84,0x02,
+  0x70,0x88,0x08,0x10,0x20,0x40,0x80,0xF8
+};
+const GuiConst_INT8U Ch000152[23] =
+{
+  0,1,0,0,2,  4,4,4,4,2,
+  0,5,
+  3,11,
+  0x94,0x02,
+  0x70,0x88,0x08,0x30,0x08,0x88,0x70
+};
+const GuiConst_INT8U Ch000153[22] =
+{
+  2,1,0,3,2,  3,3,4,3,2,
+  0,5,
+  3,11,
+  0xB4,0x04,
+  0x10,0x30,0x50,0x90,0xF8,0x10
+};
+const GuiConst_INT8U Ch000154[22] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  3,11,
+  0xCC,0x02,
+  0xF8,0x80,0xF0,0x08,0x88,0x70
+};
+const GuiConst_INT8U Ch000155[22] =
+{
+  1,0,0,0,2,  3,3,4,4,2,
+  0,5,
+  3,11,
+  0x94,0x03,
+  0x30,0x40,0x80,0xF0,0x88,0x70
+};
+const GuiConst_INT8U Ch000156[22] =
+{
+  0,2,1,0,2,  4,3,2,2,2,
+  0,5,
+  3,11,
+  0x54,0x05,
+  0xF8,0x08,0x10,0x20,0x40,0x80
+};
+const GuiConst_INT8U Ch000157[21] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  3,11,
+  0x9C,0x03,
+  0x70,0x88,0x70,0x88,0x70
+};
+const GuiConst_INT8U Ch000158[22] =
+{
+  0,0,1,1,2,  4,4,4,3,2,
+  0,5,
+  3,11,
+  0x9C,0x02,
+  0x70,0x88,0x78,0x08,0x10,0x60
+};
+const GuiConst_INT8U Ch000159[18] =
+{
+  1,1,1,1,1,  2,2,2,2,2,
+  1,2,
+  7,7,
+  0x5A,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000160[21] =
+{
+  2,0,0,0,2,  2,4,4,4,2,
+  0,5,
+  3,11,
+  0x5A,0x06,
+  0x20,0x50,0x88,0xF8,0x88
+};
+const GuiConst_INT8U Ch000161[21] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  3,11,
+  0x9C,0x03,
+  0xF0,0x88,0xF0,0x88,0xF0
+};
+const GuiConst_INT8U Ch000162[21] =
+{
+  0,0,0,0,2,  4,3,4,4,2,
+  0,5,
+  3,11,
+  0xF4,0x02,
+  0x70,0x88,0x80,0x88,0x70
+};
+const GuiConst_INT8U Ch000163[19] =
+{
+  0,0,0,0,2,  4,4,4,4,2,
+  0,5,
+  3,11,
+  0xFC,0x03,
+  0xF0,0x88,0xF0
+};
+const GuiConst_INT8U Ch000164[21] =
+{
+  0,0,0,0,2,  4,3,3,4,2,
+  0,5,
+  3,11,
+  0x9C,0x03,
+  0xF8,0x80,0xF0,0x80,0xF8
+};
+const GuiConst_INT8U Ch000165[20] =
+{
+  0,0,0,0,2,  4,3,3,2,2,
+  0,5,
+  3,11,
+  0x9C,0x07,
+  0xF8,0x80,0xF0,0x80
+};
+const GuiConst_INT8U Ch000166[19] =
+{
+  0,0,0,0,1,  0,3,3,3,2,
+  0,4,
+  3,11,
+  0xCE,0x07,
+  0x80,0xE0,0x90
+};
+const GuiConst_INT8U Ch000167[18] =
+{
+  0,0,0,0,0,  5,5,5,5,5,
+  0,6,
+  0,17,
+  0xFE,0xFF,0x01,
+  0xFC
+};
+const GuiConst_INT8U Ch000168[17] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00,0x00
+};
+const GuiConst_INT8U Ch000169[27] =
+{
+  3,3,1,3,3,  3,3,6,3,3,
+  0,7,
+  9,5,
+  0x12,
+  0x00,0xB0,0x01,0x00,0xF3,0xFF,0xFF,0x05,0x00,0xB0,0x01,0x00
+};
+const GuiConst_INT8U Ch000170[18] =
+{
+  0,0,0,1,1,  1,1,1,1,1,
+  0,2,
+  15,3,
+  0x00,
+  0xA0,0x60,0x83
+};
+const GuiConst_INT8U Ch000171[17] =
+{
+  3,3,2,3,3,  4,4,5,4,4,
+  2,4,
+  12,1,
+  0x00,
+  0xF8,0x8F
+};
+const GuiConst_INT8U Ch000172[16] =
+{
+  1,1,1,1,1,  1,1,1,1,1,
+  1,1,
+  15,1,
+  0x00,
+  0x0A
+};
+const GuiConst_INT8U Ch000173[60] =
+{
+  1,0,0,1,3,  5,5,6,5,3,
+  0,7,
+  5,11,
+  0x00,0x00,
+  0x00,0xFC,0x0C,0x00,0xA0,0x05,0x85,0x00,0xB1,0x00,0xB0,0x01,
+  0xA3,0x00,0xA0,0x03,0x85,0x00,0x80,0x03,0x85,0x00,0x80,0x05,
+  0x85,0x00,0x80,0x03,0xA3,0x00,0xA0,0x03,0xB1,0x00,0xB0,0x01,
+  0xA0,0x05,0x85,0x00,0x00,0xFC,0x0C,0x00
+};
+const GuiConst_INT8U Ch000174[26] =
+{
+  3,1,4,4,2,  4,4,4,4,3,
+  1,4,
+  5,11,
+  0xE0,0x07,
+  0x00,0x71,0x00,0x8A,0x80,0x86,0x17,0x83,0x00,0x83
+};
+const GuiConst_INT8U Ch000175[60] =
+{
+  1,1,2,0,3,  5,6,5,6,3,
+  0,7,
+  5,11,
+  0x00,0x00,
+  0x00,0xFC,0x3F,0x00,0xA0,0x03,0xB1,0x00,0x81,0x00,0x80,0x03,
+  0x00,0x00,0x80,0x05,0x00,0x00,0xC1,0x01,0x00,0x00,0x8A,0x00,
+  0x00,0x80,0x0C,0x00,0x00,0xC5,0x00,0x00,0x50,0x1D,0x00,0x00,
+  0xD1,0x03,0x00,0x00,0xF5,0xFF,0xFF,0x05
+};
+const GuiConst_INT8U Ch000176[60] =
+{
+  1,1,2,1,3,  5,5,6,5,3,
+  0,7,
+  5,11,
+  0x00,0x00,
+  0x00,0xFC,0x0A,0x00,0xA0,0x03,0x85,0x00,0xB1,0x00,0xB1,0x00,
+  0x00,0x00,0x81,0x00,0x00,0x00,0x38,0x00,0x00,0xD1,0x8F,0x00,
+  0x00,0x00,0xD1,0x03,0x00,0x00,0x80,0x05,0xA3,0x00,0xA0,0x03,
+  0xC0,0x03,0xC3,0x00,0x10,0xFD,0x0C,0x00
+};
+const GuiConst_INT8U Ch000177[52] =
+{
+  4,3,1,5,4,  5,5,6,5,4,
+  1,7,
+  5,11,
+  0x00,0x06,
+  0x00,0x00,0x1B,0x00,0x00,0x50,0x1D,0x00,0x00,0xA1,0x1C,0x00,
+  0x00,0x37,0x1B,0x00,0x30,0x08,0x1B,0x00,0x80,0x01,0x1B,0x00,
+  0x55,0x00,0x1B,0x00,0xFA,0xFF,0xFF,0x03,0x00,0x00,0x1B,0x00
+};
+const GuiConst_INT8U Ch000178[60] =
+{
+  1,1,1,1,3,  5,4,6,5,3,
+  0,7,
+  5,11,
+  0x00,0x00,
+  0x50,0xFF,0xCF,0x00,0x80,0x03,0x00,0x00,0x80,0x01,0x00,0x00,
+  0xA0,0x00,0x00,0x00,0xC0,0xFF,0x1D,0x00,0xD1,0x03,0xC3,0x00,
+  0x00,0x00,0xA0,0x03,0x00,0x00,0x80,0x05,0xA3,0x00,0xA0,0x03,
+  0xC0,0x03,0xA5,0x00,0x10,0xFD,0x0C,0x00
+};
+const GuiConst_INT8U Ch000179[60] =
+{
+  1,0,0,1,3,  5,5,6,5,3,
+  0,7,
+  5,11,
+  0x00,0x00,
+  0x00,0xFA,0x1D,0x00,0x80,0x05,0xA5,0x00,0x81,0x00,0xB0,0x01,
+  0x83,0x00,0x00,0x00,0x65,0xFA,0x1D,0x00,0xF5,0x03,0xC3,0x00,
+  0xA5,0x00,0xA0,0x03,0x83,0x00,0x80,0x05,0x81,0x00,0xA0,0x03,
+  0xA0,0x05,0xC3,0x00,0x00,0xFA,0x1D,0x00
+};
+const GuiConst_INT8U Ch000180[60] =
+{
+  0,3,2,2,3,  6,5,3,2,3,
+  0,7,
+  5,11,
+  0x00,0x00,
+  0xF5,0xFF,0xFF,0x05,0x00,0x00,0xD3,0x01,0x00,0x00,0x5A,0x00,
+  0x00,0x30,0x0C,0x00,0x00,0xA0,0x05,0x00,0x00,0xB1,0x00,0x00,
+  0x00,0x85,0x00,0x00,0x00,0x5A,0x00,0x00,0x00,0x1B,0x00,0x00,
+  0x10,0x0B,0x00,0x00,0x10,0x08,0x00,0x00
+};
+const GuiConst_INT8U Ch000181[52] =
+{
+  1,1,0,1,3,  5,5,5,5,3,
+  0,7,
+  5,11,
+  0x08,0x01,
+  0x00,0xFC,0x0C,0x00,0xA0,0x05,0x85,0x00,0xA0,0x00,0xB1,0x00,
+  0xA0,0x05,0xA5,0x00,0x00,0xFA,0x0A,0x00,0xC1,0x01,0xC3,0x00,
+  0x85,0x00,0x80,0x03,0xD1,0x03,0xD3,0x01,0x10,0xFD,0x1D,0x00
+};
+const GuiConst_INT8U Ch000182[60] =
+{
+  1,0,1,1,3,  5,6,6,5,3,
+  0,7,
+  5,11,
+  0x00,0x00,
+  0x10,0xFD,0x0A,0x00,0xC0,0x05,0x83,0x00,0xA3,0x00,0x80,0x01,
+  0x85,0x00,0x80,0x03,0xA3,0x00,0xA0,0x05,0xC0,0x03,0xF3,0x05,
+  0x10,0xFD,0x88,0x03,0x00,0x00,0x80,0x03,0xB1,0x00,0xA0,0x00,
+  0xC0,0x03,0x85,0x00,0x10,0xFD,0x0A,0x00
+};
+const GuiConst_INT8U Ch000183[18] =
+{
+  1,1,1,1,1,  1,1,1,1,1,
+  1,1,
+  8,8,
+  0x7C,
+  0x0A,0x00,0x0A
+};
+const GuiConst_INT8U Ch000184[60] =
+{
+  4,3,2,1,3,  5,5,6,7,4,
+  0,8,
+  5,11,
+  0x00,0x00,
+  0x00,0x00,0x3A,0x00,0x00,0x10,0x8D,0x00,0x00,0x50,0x74,0x00,
+  0x00,0x80,0x82,0x01,0x00,0x81,0x80,0x03,0x00,0x35,0x30,0x08,
+  0x00,0x07,0x10,0x0B,0x10,0xFD,0xFF,0x1D,0x50,0x05,0x00,0x58,
+  0x80,0x01,0x00,0x85,0x81,0x00,0x00,0xC3
+};
+const GuiConst_INT8U Ch000185[52] =
+{
+  1,1,1,1,3,  6,6,6,6,4,
+  0,8,
+  5,11,
+  0x08,0x01,
+  0xD1,0xFF,0xCF,0x00,0xB1,0x00,0x50,0x0A,0xB1,0x00,0x00,0x0A,
+  0xB1,0x00,0x50,0x08,0xD1,0xFF,0xAF,0x00,0xB1,0x00,0x30,0x0C,
+  0xB1,0x00,0x00,0x3A,0xB1,0x00,0x10,0x0B,0xD1,0xFF,0xFF,0x03
+};
+const GuiConst_INT8U Ch000186[66] =
+{
+  2,1,1,2,4,  7,7,7,7,4,
+  0,9,
+  5,11,
+  0x20,0x00,
+  0x00,0xC0,0xFF,0x08,0x00,0x10,0x1C,0x00,0x88,0x00,0xA0,0x03,
+  0x00,0xB0,0x01,0xB1,0x00,0x00,0x00,0x00,0xA3,0x00,0x00,0x00,
+  0x00,0x81,0x00,0x00,0x00,0x00,0xA0,0x00,0x00,0x80,0x03,0x80,
+  0x03,0x00,0xA0,0x00,0x10,0x1C,0x00,0x5A,0x00,0x00,0xD1,0xFF,
+  0x05,0x00
+};
+const GuiConst_INT8U Ch000187[52] =
+{
+  1,1,1,1,4,  6,7,7,6,5,
+  1,8,
+  5,11,
+  0x60,0x00,
+  0xFC,0xFF,0x3F,0x00,0x0A,0x00,0xC0,0x03,0x0A,0x00,0x30,0x0A,
+  0x0A,0x00,0x00,0x1B,0x0A,0x00,0x00,0x3A,0x0A,0x00,0x00,0x1B,
+  0x0A,0x00,0x30,0x0A,0x0A,0x00,0xC0,0x03,0xFC,0xFF,0x3F,0x00
+};
+const GuiConst_INT8U Ch000188[36] =
+{
+  1,1,1,1,3,  6,5,6,7,4,
+  0,8,
+  5,11,
+  0x9C,0x03,
+  0xD1,0xFF,0xFF,0x3F,0xB1,0x00,0x00,0x00,0xD1,0xFF,0xFF,0x0C,
+  0xB1,0x00,0x00,0x00,0xD1,0xFF,0xFF,0x5F
+};
+const GuiConst_INT8U Ch000189[28] =
+{
+  1,1,1,1,3,  6,4,5,1,4,
+  1,6,
+  5,11,
+  0x9C,0x07,
+  0xFC,0xFF,0xCF,0x1B,0x00,0x00,0xFC,0xFF,0x3F,0x1B,0x00,0x00
+};
+const GuiConst_INT8U Ch000190[31] =
+{
+  1,1,1,1,2,  1,5,5,5,3,
+  0,6,
+  5,11,
+  0x86,0x07,
+  0xB1,0x00,0x00,0xB1,0xF4,0x3F,0xD1,0x3F,0xA3,0xD1,0x03,0xA0,
+  0xB1,0x00,0xA0
+};
+const GuiConst_INT8U Ch000191[26] =
+{
+  0,0,0,0,0,  17,17,17,17,17,
+  0,18,
+  0,20,
+  0xFE,0xFF,0x0F,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
+};
+const GuiConst_INT8U Ch000192[16] =
+{
+  0,0,0,0,0,  3,3,3,3,3,
+  0,4,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000193[18] =
+{
+  4,2,1,4,4,  5,7,8,5,5,
+  1,8,
+  7,8,
+  0xD6,
+  0x18,0xFF,0x18
+};
+const GuiConst_INT8U Ch000194[19] =
+{
+  3,3,2,2,3,  4,4,5,4,4,
+  2,4,
+  13,5,
+  0x04,
+  0x60,0xF0,0x60,0xC0
+};
+const GuiConst_INT8U Ch000195[16] =
+{
+  4,1,1,4,4,  5,8,8,5,5,
+  1,8,
+  10,2,
+  0x02,
+  0xFF
+};
+const GuiConst_INT8U Ch000196[18] =
+{
+  3,3,3,2,3,  4,4,4,5,4,
+  2,4,
+  13,4,
+  0x04,
+  0x60,0xF0,0x60
+};
+const GuiConst_INT8U Ch000197[34] =
+{
+  2,0,0,2,4,  6,8,8,6,4,
+  0,9,
+  4,13,
+  0xE0,0x01,
+  0x3E,0x00,0x7F,0x00,0x63,0x00,0xE3,0x80,0xC1,0x80,0xE3,0x80,
+  0x63,0x00,0x7F,0x00,0x3E,0x00
+};
+const GuiConst_INT8U Ch000198[22] =
+{
+  3,1,4,4,3,  5,5,5,5,3,
+  1,5,
+  4,13,
+  0xC0,0x1F,
+  0x18,0x38,0x78,0xF8,0xD8,0x18
+};
+const GuiConst_INT8U Ch000199[38] =
+{
+  1,0,1,0,4,  7,8,7,8,4,
+  0,9,
+  4,13,
+  0x10,0x10,
+  0x3E,0x00,0x7F,0x00,0xE3,0x80,0x01,0x80,0x03,0x80,0x0F,0x00,
+  0x3E,0x00,0x78,0x00,0xE0,0x00,0xC0,0x00,0xFF,0x80
+};
+const GuiConst_INT8U Ch000200[40] =
+{
+  1,0,1,1,4,  7,8,8,7,4,
+  0,9,
+  4,13,
+  0x40,0x00,
+  0x3E,0x00,0x7F,0x00,0xE3,0x80,0xC1,0x80,0x03,0x80,0x0F,0x00,
+  0x03,0x80,0x01,0x80,0xC1,0x80,0xE3,0x80,0x7F,0x00,0x3E,0x00
+};
+const GuiConst_INT8U Ch000201[36] =
+{
+  3,1,0,5,4,  6,6,8,6,4,
+  0,9,
+  4,13,
+  0x00,0x1A,
+  0x0E,0x00,0x1E,0x00,0x3E,0x00,0x36,0x00,0x76,0x00,0x66,0x00,
+  0xE6,0x00,0xC6,0x00,0xFF,0x80,0x06,0x00
+};
+const GuiConst_INT8U Ch000202[36] =
+{
+  0,0,0,1,4,  8,6,8,7,4,
+  0,9,
+  4,13,
+  0x0A,0x01,
+  0xFF,0x80,0xC0,0x00,0xDE,0x00,0xFF,0x00,0xE3,0x80,0x01,0x80,
+  0xC1,0x80,0xE3,0x80,0x7F,0x00,0x3E,0x00
+};
+const GuiConst_INT8U Ch000203[38] =
+{
+  2,0,0,1,4,  7,6,8,7,4,
+  0,9,
+  4,13,
+  0x00,0x03,
+  0x1F,0x00,0x3F,0x00,0x70,0x00,0xE0,0x00,0xDE,0x00,0xFF,0x00,
+  0xE3,0x80,0xC1,0x80,0xE3,0x80,0x7F,0x00,0x3E,0x00
+};
+const GuiConst_INT8U Ch000204[40] =
+{
+  0,4,4,2,4,  8,8,6,5,4,
+  0,9,
+  4,13,
+  0x02,0x00,
+  0xFF,0x80,0x01,0x80,0x03,0x80,0x03,0x00,0x07,0x00,0x06,0x00,
+  0x0E,0x00,0x0C,0x00,0x1C,0x00,0x18,0x00,0x38,0x00,0x30,0x00
+};
+const GuiConst_INT8U Ch000205[42] =
+{
+  1,0,0,1,4,  7,8,8,7,4,
+  0,9,
+  4,13,
+  0x00,0x00,
+  0x3E,0x00,0x7F,0x00,0xE3,0x80,0xC1,0x80,0xE3,0x80,0x7F,0x00,
+  0x3E,0x00,0x7F,0x00,0xE3,0x80,0xC1,0x80,0xE3,0x80,0x7F,0x00,
+  0x3E,0x00
+};
+const GuiConst_INT8U Ch000206[38] =
+{
+  1,0,0,1,4,  7,8,8,6,4,
+  0,9,
+  4,13,
+  0x30,0x00,
+  0x3E,0x00,0x7F,0x00,0xE3,0x80,0xC1,0x80,0xE3,0x80,0x7F,0x80,
+  0x3D,0x80,0x03,0x80,0x07,0x00,0x7E,0x00,0x7C,0x00
+};
+const GuiConst_INT8U Ch000207[23] =
+{
+  3,2,3,2,3,  4,5,4,5,4,
+  2,4,
+  6,11,
+  0x64,0x02,
+  0x60,0xF0,0x60,0x00,0x60,0xF0,0x60
+};
+const GuiConst_INT8U Ch000208[32] =
+{
+  2,2,1,0,4,  6,6,7,8,4,
+  0,9,
+  4,13,
+  0x26,0x18,
+  0x1C,0x00,0x3E,0x00,0x36,0x00,0x77,0x00,0x63,0x00,0x7F,0x00,
+  0xFF,0x80,0xC1,0x80
+};
+const GuiConst_INT8U Ch000209[38] =
+{
+  0,0,0,0,4,  7,8,8,7,4,
+  0,9,
+  4,13,
+  0x40,0x02,
+  0xFE,0x00,0xFF,0x00,0xC3,0x80,0xC1,0x80,0xC3,0x80,0xFF,0x00,
+  0xC3,0x80,0xC1,0x80,0xC3,0x80,0xFF,0x00,0xFE,0x00
+};
+const GuiConst_INT8U Ch000210[34] =
+{
+  1,0,0,1,4,  7,8,8,7,4,
+  0,9,
+  4,13,
+  0xE0,0x01,
+  0x3E,0x00,0x7F,0x00,0xE3,0x80,0xC1,0x80,0xC0,0x00,0xC1,0x80,
+  0xE3,0x80,0x7F,0x00,0x3E,0x00
+};
+const GuiConst_INT8U Ch000211[30] =
+{
+  0,0,0,0,4,  7,8,8,7,4,
+  0,9,
+  4,13,
+  0xF0,0x03,
+  0xFE,0x00,0xFF,0x00,0xC3,0x80,0xC1,0x80,0xC3,0x80,0xFF,0x00,
+  0xFE,0x00
+};
+const GuiConst_INT8U Ch000212[26] =
+{
+  0,0,0,0,4,  8,6,6,8,4,
+  0,9,
+  4,13,
+  0x5A,0x17,
+  0xFF,0x80,0xC0,0x00,0xFE,0x00,0xC0,0x00,0xFF,0x80
+};
+const GuiConst_INT8U Ch000213[24] =
+{
+  0,0,0,0,4,  8,6,6,1,4,
+  0,9,
+  4,13,
+  0x5A,0x1F,
+  0xFF,0x80,0xC0,0x00,0xFE,0x00,0xC0,0x00
+};
+const GuiConst_INT8U Ch000214[21] =
+{
+  0,0,0,0,3,  1,6,7,7,4,
+  0,8,
+  4,13,
+  0x86,0x1F,
+  0xC0,0xDC,0xFE,0xE7,0xC3
+};
+const GuiConst_INT8U Ch000215[19] =
+{
+  0,0,0,0,0,  10,10,10,10,10,
+  0,11,
+  0,21,
+  0xFE,0xFF,0x1F,
+  0xFF,0xE0
+};
+const GuiConst_INT8U Ch000216[17] =
+{
+  0,0,0,0,0,  3,3,3,3,3,
+  0,4,
+  0,0,
+  0x00,
+  0x00,0x00
+};
+const GuiConst_INT8U Ch000217[34] =
+{
+  5,2,0,5,5,  6,9,11,6,6,
+  0,12,
+  10,10,
+  0xAE,0x03,
+  0x00,0x00,0xF0,0x0F,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+  0x00,0x00,0xF0,0x0F,0x00,0x00
+};
+const GuiConst_INT8U Ch000218[23] =
+{
+  1,1,1,1,1,  1,1,1,2,1,
+  0,3,
+  21,5,
+  0x02,
+  0xF0,0x0F,0x00,0x0F,0x50,0x09,0x93,0x00
+};
+const GuiConst_INT8U Ch000219[18] =
+{
+  4,4,2,4,4,  4,4,6,4,4,
+  2,5,
+  16,2,
+  0x02,
+  0xFF,0xFF,0x0F
+};
+const GuiConst_INT8U Ch000220[16] =
+{
+  0,0,0,0,0,  1,1,1,1,1,
+  0,2,
+  21,2,
+  0x02,
+  0xFF
+};
+const GuiConst_INT8U Ch000221[82] =
+{
+  1,0,0,1,4,  7,8,8,7,4,
+  0,9,
+  6,17,
+  0x80,0x07,0x00,
+  0x00,0xB5,0xBF,0x05,0x00,0x50,0xFF,0xFF,0x5F,0x00,0xD0,0x5F,
+  0x50,0xDF,0x00,0xF5,0x07,0x00,0xF7,0x05,0xF8,0x04,0x00,0xF4,
+  0x08,0xF9,0x03,0x00,0xF3,0x09,0xFF,0x00,0x00,0xF0,0x0F,0xFA,
+  0x03,0x00,0xF3,0x09,0xF8,0x04,0x00,0xF4,0x08,0xF5,0x07,0x00,
+  0xF7,0x05,0xF3,0x5F,0x50,0xDF,0x00,0x50,0xFF,0xFF,0x5F,0x00,
+  0x00,0xB4,0xBF,0x05,0x00
+};
+const GuiConst_INT8U Ch000222[38] =
+{
+  5,2,5,5,4,  6,6,6,6,4,
+  2,5,
+  6,17,
+  0x80,0xFF,0x01,
+  0x00,0x60,0x0F,0x00,0xF3,0x0F,0x30,0xFD,0x0F,0xD4,0xFF,0x0F,
+  0xFF,0xF5,0x0F,0x39,0xF0,0x0F,0x00,0xF0,0x0F
+};
+const GuiConst_INT8U Ch000223[102] =
+{
+  1,0,3,0,4,  7,8,6,8,4,
+  0,9,
+  6,17,
+  0x00,0x00,0x00,
+  0x00,0xB6,0xDF,0x07,0x00,0xA0,0xFF,0xFF,0xAF,0x00,0xF5,0x3A,
+  0x30,0xFD,0x06,0xF9,0x04,0x00,0xF4,0x0B,0xFF,0x00,0x00,0xF0,
+  0x0F,0x00,0x00,0x00,0xF0,0x0F,0x00,0x00,0x00,0xF5,0x08,0x00,
+  0x00,0x00,0xFB,0x05,0x00,0x00,0x70,0x9F,0x00,0x00,0x00,0xF5,
+  0x0A,0x00,0x00,0x50,0xDF,0x03,0x00,0x00,0xF4,0x3D,0x00,0x00,
+  0x30,0xDD,0x03,0x00,0x00,0xA0,0x3D,0x00,0x00,0x00,0xF5,0x04,
+  0x00,0x00,0x00,0xFA,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,
+  0x0F
+};
+const GuiConst_INT8U Ch000224[102] =
+{
+  1,1,1,1,4,  7,8,8,7,4,
+  0,9,
+  6,17,
+  0x00,0x00,0x00,
+  0x00,0xB6,0xDF,0x07,0x00,0xA0,0xFF,0xFF,0xAF,0x00,0xF6,0x3A,
+  0x30,0xFA,0x07,0xFB,0x03,0x00,0xF3,0x0D,0x00,0x00,0x00,0xF0,
+  0x0F,0x00,0x00,0x00,0xF3,0x0A,0x00,0x00,0x50,0xFD,0x04,0x00,
+  0xF0,0xFF,0x4F,0x00,0x00,0xF0,0xFF,0xDF,0x00,0x00,0x30,0x40,
+  0xFD,0x07,0x00,0x00,0x00,0xF4,0x0B,0x00,0x00,0x00,0xF0,0x0F,
+  0xFF,0x00,0x00,0xF0,0x0F,0xF9,0x05,0x00,0xF5,0x09,0xF5,0x3D,
+  0x30,0xFD,0x05,0x80,0xFF,0xFF,0x7F,0x00,0x00,0xD6,0xBF,0x06,
+  0x00
+};
+const GuiConst_INT8U Ch000225[82] =
+{
+  5,2,0,6,4,  7,7,9,7,5,
+  0,10,
+  6,17,
+  0x00,0xD0,0x01,
+  0x00,0x00,0x60,0xFF,0x00,0x00,0x00,0xD3,0xFF,0x00,0x00,0x00,
+  0xF7,0xFF,0x00,0x00,0x30,0xBF,0xFF,0x00,0x00,0x70,0x5F,0xFF,
+  0x00,0x00,0xF3,0x0B,0xFF,0x00,0x00,0xF7,0x05,0xFF,0x00,0x30,
+  0xBF,0x00,0xFF,0x00,0x90,0x4F,0x00,0xFF,0x00,0xF3,0x09,0x00,
+  0xFF,0x00,0xF9,0x03,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,
+  0x00,0x00,0x00,0xFF,0x00
+};
+const GuiConst_INT8U Ch000226[92] =
+{
+  1,0,1,1,4,  7,7,8,7,4,
+  0,9,
+  6,17,
+  0x10,0x08,0x00,
+  0xF0,0xFF,0xFF,0xFF,0x00,0xF3,0xFF,0xFF,0xFF,0x00,0xF3,0x09,
+  0x00,0x00,0x00,0xF6,0x06,0x00,0x00,0x00,0xF8,0x87,0xDF,0x06,
+  0x00,0xF9,0xFF,0xFF,0x8F,0x00,0xFD,0x3A,0x50,0xFD,0x05,0x64,
+  0x00,0x00,0xF6,0x08,0x00,0x00,0x00,0xF3,0x0D,0x00,0x00,0x00,
+  0xF0,0x0F,0xFF,0x00,0x00,0xF3,0x0A,0xF9,0x05,0x00,0xF6,0x06,
+  0xF5,0x3D,0x50,0xFF,0x03,0x90,0xFF,0xFF,0x6F,0x00,0x00,0xD6,
+  0xBF,0x05,0x00
+};
+const GuiConst_INT8U Ch000227[102] =
+{
+  2,0,0,1,4,  7,7,8,7,4,
+  0,9,
+  6,17,
+  0x00,0x00,0x00,
+  0x00,0x83,0xFF,0x38,0x00,0x30,0xFD,0xFF,0xDF,0x03,0xB0,0x5F,
+  0x30,0xFA,0x07,0xF4,0x07,0x00,0xF3,0x0D,0xF6,0x03,0x00,0x00,
+  0x00,0xF9,0x00,0x00,0x00,0x00,0x9D,0x60,0xFD,0x07,0x00,0x9F,
+  0xF9,0xFF,0xAF,0x00,0xFF,0x3D,0x30,0xFD,0x05,0xFF,0x05,0x00,
+  0xF5,0x09,0xFF,0x00,0x00,0xF0,0x0F,0xFA,0x00,0x00,0xF0,0x0F,
+  0xF8,0x03,0x00,0xF0,0x0D,0xF5,0x06,0x00,0xF5,0x08,0xD0,0x5F,
+  0x30,0xFD,0x05,0x50,0xFF,0xFF,0x9F,0x00,0x00,0xA4,0xDF,0x06,
+  0x00
+};
+const GuiConst_INT8U Ch000228[102] =
+{
+  0,4,3,2,4,  8,6,5,3,4,
+  0,9,
+  6,17,
+  0x00,0x00,0x00,
+  0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,0x0D,0x00,0x00,
+  0x00,0xF4,0x05,0x00,0x00,0x00,0xBD,0x00,0x00,0x00,0x60,0x4F,
+  0x00,0x00,0x00,0xD0,0x0B,0x00,0x00,0x00,0xF6,0x05,0x00,0x00,
+  0x00,0xFB,0x00,0x00,0x00,0x40,0x8F,0x00,0x00,0x00,0x70,0x5F,
+  0x00,0x00,0x00,0xD0,0x0F,0x00,0x00,0x00,0xF3,0x0A,0x00,0x00,
+  0x00,0xF5,0x06,0x00,0x00,0x00,0xF7,0x05,0x00,0x00,0x00,0xF9,
+  0x03,0x00,0x00,0x00,0xFD,0x03,0x00,0x00,0x00,0xFF,0x00,0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000229[97] =
+{
+  1,0,0,1,4,  7,8,8,7,4,
+  0,9,
+  6,17,
+  0x00,0x10,0x00,
+  0x00,0xD7,0xDF,0x07,0x00,0xA0,0xFF,0xFF,0xAF,0x00,0xF7,0x3A,
+  0x30,0xFA,0x07,0xFD,0x03,0x00,0xF3,0x0D,0xFF,0x00,0x00,0xF0,
+  0x0F,0xFB,0x03,0x00,0xF3,0x0B,0xF6,0x3A,0x30,0xFA,0x06,0x60,
+  0xFD,0xFF,0x6D,0x00,0x60,0xFF,0xFF,0x6F,0x00,0xF6,0x3D,0x30,
+  0xFD,0x05,0xFA,0x04,0x00,0xF4,0x0A,0xFF,0x00,0x00,0xF0,0x0F,
+  0xFA,0x04,0x00,0xF4,0x0B,0xF6,0x3D,0x30,0xFD,0x06,0xA0,0xFF,
+  0xFF,0xAF,0x00,0x00,0xB6,0xBF,0x06,0x00
+};
+const GuiConst_INT8U Ch000230[102] =
+{
+  1,0,1,1,4,  7,8,8,6,4,
+  0,9,
+  6,17,
+  0x00,0x00,0x00,
+  0x00,0xD6,0xAF,0x04,0x00,0x90,0xFF,0xFF,0x5F,0x00,0xF5,0x5F,
+  0x30,0xDD,0x00,0xF9,0x06,0x00,0xF5,0x05,0xFF,0x03,0x00,0xF0,
+  0x09,0xFF,0x00,0x00,0xF0,0x0B,0xFF,0x00,0x00,0xF0,0x0F,0xF9,
+  0x05,0x00,0xF5,0x0F,0xF5,0x3D,0x30,0xDD,0x0F,0xA0,0xFF,0xFF,
+  0x97,0x0F,0x00,0xF7,0x6D,0xB0,0x0D,0x00,0x00,0x00,0xF0,0x09,
+  0x00,0x00,0x00,0xF4,0x06,0xFD,0x03,0x00,0xF9,0x04,0xF7,0x09,
+  0x50,0xBF,0x00,0xD3,0xFF,0xFF,0x3D,0x00,0x30,0xF8,0x8F,0x03,
+  0x00
+};
+const GuiConst_INT8U Ch000231[19] =
+{
+  0,0,0,0,0,  1,1,1,1,1,
+  0,2,
+  11,12,
+  0xFA,0x0B,
+  0xFF,0x00,0xFF
+};
+const GuiConst_INT8U Ch000232[136] =
+{
+  4,3,1,0,6,  8,9,11,12,6,
+  0,13,
+  6,17,
+  0x00,0x00,0x00,
+  0x00,0x00,0xF3,0xFF,0x03,0x00,0x00,0x00,0x00,0xF5,0xFF,0x05,
+  0x00,0x00,0x00,0x00,0xF8,0xF8,0x08,0x00,0x00,0x00,0x00,0xFF,
+  0xF3,0x0F,0x00,0x00,0x00,0x40,0xBF,0x90,0x4F,0x00,0x00,0x00,
+  0x70,0x6F,0x50,0x7F,0x00,0x00,0x00,0xB0,0x3F,0x30,0xBF,0x00,
+  0x00,0x00,0xF3,0x0B,0x00,0xFB,0x03,0x00,0x00,0xF6,0x06,0x00,
+  0xF6,0x06,0x00,0x00,0xFA,0x03,0x00,0xF3,0x0A,0x00,0x00,0xFF,
+  0xFF,0xFF,0xFF,0x0F,0x00,0x50,0xFF,0xFF,0xFF,0xFF,0x5F,0x00,
+  0x80,0x4F,0x00,0x00,0x40,0x8F,0x00,0xD0,0x0F,0x00,0x00,0x00,
+  0xDF,0x00,0xF3,0x09,0x00,0x00,0x00,0xF9,0x03,0xF6,0x05,0x00,
+  0x00,0x00,0xF5,0x06,0xFB,0x03,0x00,0x00,0x00,0xF3,0x0B
+};
+const GuiConst_INT8U Ch000233[113] =
+{
+  0,0,0,0,5,  8,9,10,9,5,
+  0,11,
+  6,17,
+  0x00,0x10,0x00,
+  0xFF,0xFF,0xFF,0x8D,0x03,0x00,0xFF,0xFF,0xFF,0xFF,0x3D,0x00,
+  0xFF,0x00,0x00,0xA3,0x8F,0x00,0xFF,0x00,0x00,0x30,0xFF,0x00,
+  0xFF,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x30,0x8F,0x00,
+  0xFF,0x00,0x00,0xA3,0x3D,0x00,0xFF,0xFF,0xFF,0xFF,0x05,0x00,
+  0xFF,0xFF,0xFF,0xFF,0x7F,0x00,0xFF,0x00,0x00,0x40,0xFD,0x05,
+  0xFF,0x00,0x00,0x00,0xF4,0x0A,0xFF,0x00,0x00,0x00,0xF0,0x0F,
+  0xFF,0x00,0x00,0x00,0xF4,0x0A,0xFF,0x00,0x00,0x40,0xFD,0x05,
+  0xFF,0xFF,0xFF,0xFF,0x9F,0x00,0xFF,0xFF,0xFF,0xAF,0x06,0x00
+};
+const GuiConst_INT8U Ch000234[107] =
+{
+  2,0,0,2,5,  9,11,10,9,6,
+  0,12,
+  6,17,
+  0x00,0x03,0x00,
+  0x00,0x30,0xD7,0xDF,0x37,0x00,0x00,0xF5,0xFF,0xFF,0xDF,0x03,
+  0x50,0xDF,0x06,0x30,0xFA,0x0D,0xD0,0x4F,0x00,0x00,0xD0,0x6F,
+  0xF5,0x09,0x00,0x00,0x50,0xBF,0xF8,0x04,0x00,0x00,0x30,0x39,
+  0xFB,0x03,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,
+  0xFB,0x03,0x00,0x00,0x00,0x00,0xF8,0x05,0x00,0x00,0x30,0x39,
+  0xF5,0x08,0x00,0x00,0x50,0xBF,0xD0,0x3F,0x00,0x00,0xB0,0x6F,
+  0x50,0xDF,0x05,0x30,0xFA,0x0D,0x00,0xF7,0xFF,0xFF,0xDF,0x03,
+  0x00,0x50,0xF9,0xBF,0x37,0x00
+};
+const GuiConst_INT8U Ch000235[107] =
+{
+  0,0,0,0,5,  9,11,11,9,6,
+  0,12,
+  6,17,
+  0x00,0x03,0x00,
+  0xFF,0xFF,0xFF,0x9F,0x05,0x00,0xFF,0xFF,0xFF,0xFF,0x9F,0x00,
+  0xFF,0x00,0x00,0x50,0xFD,0x06,0xFF,0x00,0x00,0x00,0xF3,0x3F,
+  0xFF,0x00,0x00,0x00,0x70,0x5F,0xFF,0x00,0x00,0x00,0x40,0x9F,
+  0xFF,0x00,0x00,0x00,0x30,0xDF,0xFF,0x00,0x00,0x00,0x00,0xFF,
+  0xFF,0x00,0x00,0x00,0x30,0xBF,0xFF,0x00,0x00,0x00,0x50,0x8F,
+  0xFF,0x00,0x00,0x00,0x70,0x5F,0xFF,0x00,0x00,0x00,0xF3,0x0D,
+  0xFF,0x00,0x00,0x53,0xFD,0x06,0xFF,0xFF,0xFF,0xFF,0x7F,0x00,
+  0xFF,0xFF,0xFF,0x8D,0x05,0x00
+};
+const GuiConst_INT8U Ch000236[42] =
+{
+  0,0,0,0,4,  9,7,7,9,5,
+  0,10,
+  6,17,
+  0x7A,0x7D,0x01,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xFF,0xFF,
+  0xFF,0xFF,0x0F,0xFF,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
+  0xFF
+};
+const GuiConst_INT8U Ch000237[37] =
+{
+  0,0,0,0,4,  9,7,7,1,5,
+  0,10,
+  6,17,
+  0x7A,0xFD,0x01,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0xFF,0xFF,
+  0xFF,0xFF,0x0F,0xFF,0x00,0x00,0x00,0x00
+};
+const GuiConst_INT8U Ch000238[47] =
+{
+  0,0,0,0,4,  1,8,8,8,4,
+  0,9,
+  6,17,
+  0x1E,0xFC,0x01,
+  0xFF,0x00,0x00,0x00,0x00,0xFF,0x60,0xFD,0x5B,0x00,0xFF,0xF7,
+  0xFF,0xFF,0x05,0xFF,0x5D,0x30,0xF9,0x09,0xFF,0x05,0x00,0xF3,
+  0x0F,0xFF,0x00,0x00,0xF0,0x0F
+};
+const GuiConst_INT8U Ch000239[30] =
+{
+  0,0,0,0,0,  23,23,23,23,23,
+  0,24,
+  0,29,
+  0xFE,0xFF,0xFF,0x1F,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
+};
+const GuiConst_INT8U Ch000240[16] =
+{
+  0,0,0,0,0,  5,5,5,5,5,
+  0,6,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000241[22] =
+{
+  7,1,1,7,7,  7,13,13,7,7,
+  1,13,
+  8,13,
+  0xDE,0x1E,
+  0x07,0x00,0xFF,0xF8,0x07,0x00
+};
+const GuiConst_INT8U Ch000242[21] =
+{
+  6,6,6,4,6,  6,6,6,8,6,
+  4,5,
+  20,7,
+  0x04,
+  0x70,0xF8,0x78,0x38,0x70,0x60
+};
+const GuiConst_INT8U Ch000243[17] =
+{
+  6,1,1,6,6,  6,13,13,6,6,
+  1,13,
+  13,3,
+  0x06,
+  0xFF,0xF8
+};
+const GuiConst_INT8U Ch000244[18] =
+{
+  6,6,6,4,6,  6,6,6,8,6,
+  4,5,
+  20,4,
+  0x04,
+  0x70,0xF8,0x70
+};
+const GuiConst_INT8U Ch000245[39] =
+{
+  3,0,0,3,6,  10,13,13,10,7,
+  0,14,
+  5,19,
+  0xA0,0x5F,0x00,
+  0x0F,0xC0,0x1F,0xE0,0x3F,0xF0,0x78,0x78,0x70,0x38,0xE0,0x1C,
+  0x70,0x38,0x78,0x78,0x3F,0xF0,0x1F,0xE0,0x0F,0xC0
+};
+const GuiConst_INT8U Ch000246[24] =
+{
+  5,2,6,6,5,  8,8,8,8,5,
+  2,7,
+  5,19,
+  0x80,0xFF,0x07,
+  0x0E,0x1E,0x3E,0x7E,0xFE,0xEE,0x0E
+};
+const GuiConst_INT8U Ch000247[49] =
+{
+  2,0,1,0,6,  11,13,10,13,7,
+  0,14,
+  5,19,
+  0x00,0x80,0x06,
+  0x0F,0xC0,0x3F,0xF0,0x7F,0xF8,0x78,0x78,0xF0,0x3C,0xE0,0x1C,
+  0x00,0x3C,0x00,0x7C,0x01,0xF8,0x07,0xE0,0x1F,0x80,0x3E,0x00,
+  0x78,0x00,0xF0,0x00,0xE0,0x00,0xFF,0xFC
+};
+const GuiConst_INT8U Ch000248[51] =
+{
+  2,0,0,2,6,  11,13,13,11,7,
+  0,14,
+  5,19,
+  0x20,0x40,0x00,
+  0x0F,0xC0,0x3F,0xF0,0x7F,0xF8,0x70,0x38,0xE0,0x1C,0x00,0x1C,
+  0x00,0x3C,0x01,0xF8,0x01,0xF0,0x01,0xF8,0x00,0x3C,0x00,0x1C,
+  0xE0,0x1C,0x70,0x38,0x7F,0xF8,0x3F,0xF0,0x0F,0xC0
+};
+const GuiConst_INT8U Ch000249[41] =
+{
+  6,3,0,8,6,  10,10,13,10,7,
+  0,14,
+  5,19,
+  0x0A,0x60,0x07,
+  0x03,0xE0,0x07,0xE0,0x0F,0xE0,0x0E,0xE0,0x1E,0xE0,0x1C,0xE0,
+  0x3C,0xE0,0x38,0xE0,0x78,0xE0,0x70,0xE0,0xFF,0xFC,0x00,0xE0
+};
+const GuiConst_INT8U Ch000250[43] =
+{
+  0,0,0,2,6,  12,11,13,11,7,
+  0,14,
+  5,19,
+  0x16,0x58,0x00,
+  0xFF,0xF8,0xE0,0x00,0xE7,0xC0,0xFF,0xF0,0xFF,0xF8,0xF8,0x38,
+  0xE0,0x1C,0x00,0x1C,0xE0,0x1C,0x70,0x38,0x7F,0xF8,0x3F,0xF0,
+  0x0F,0xC0
+};
+const GuiConst_INT8U Ch000251[49] =
+{
+  4,0,0,2,6,  11,9,13,11,7,
+  0,14,
+  5,19,
+  0x00,0x70,0x00,
+  0x03,0xF0,0x0F,0xF0,0x1F,0xF0,0x3C,0x00,0x78,0x00,0x70,0x00,
+  0xE0,0x00,0xEF,0xC0,0xFF,0xF0,0xFF,0xF8,0xF0,0x38,0xE0,0x1C,
+  0x70,0x38,0x7F,0xF8,0x3F,0xF0,0x0F,0xC0
+};
+const GuiConst_INT8U Ch000252[51] =
+{
+  0,9,6,3,6,  13,12,9,6,7,
+  0,14,
+  5,19,
+  0x06,0x00,0x00,
+  0xFF,0xFC,0x00,0x3C,0x00,0x38,0x00,0x78,0x00,0x70,0x00,0xF0,
+  0x00,0xE0,0x01,0xE0,0x01,0xC0,0x03,0xC0,0x03,0x80,0x07,0x80,
+  0x07,0x00,0x0F,0x00,0x0E,0x00,0x1E,0x00,0x1C,0x00
+};
+const GuiConst_INT8U Ch000253[47] =
+{
+  2,0,0,2,6,  11,13,13,11,7,
+  0,14,
+  5,19,
+  0x60,0x60,0x00,
+  0x0F,0xC0,0x3F,0xF0,0x7F,0xF8,0x70,0x38,0xE0,0x1C,0x70,0x38,
+  0x7F,0xF0,0x3F,0xF0,0x7F,0xF8,0x70,0x3C,0xE0,0x1C,0x70,0x38,
+  0x7F,0xF8,0x3F,0xF0,0x0F,0xC0
+};
+const GuiConst_INT8U Ch000254[49] =
+{
+  2,0,2,2,6,  11,13,13,9,7,
+  0,14,
+  5,19,
+  0xE0,0x00,0x00,
+  0x0F,0xC0,0x3F,0xF0,0x7F,0xF8,0x70,0x38,0xE0,0x1C,0x70,0x3C,
+  0x7F,0xFC,0x3F,0xFC,0x0F,0xDC,0x00,0x1C,0x00,0x38,0x00,0x78,
+  0x00,0xF0,0x3F,0xE0,0x3F,0xC0,0x3F,0x00
+};
+const GuiConst_INT8U Ch000255[23] =
+{
+  6,4,6,4,6,  6,8,6,8,6,
+  4,5,
+  10,14,
+  0xE4,0x13,
+  0x70,0xF8,0x70,0x00,0x70,0xF8,0x70
+};
+const GuiConst_INT8U Ch000256[37] =
+{
+  4,4,2,0,6,  9,9,11,13,7,
+  0,14,
+  5,19,
+  0x6C,0xD2,0x04,
+  0x03,0x00,0x07,0x80,0x0F,0xC0,0x1F,0xE0,0x1C,0xE0,0x3C,0xF0,
+  0x38,0x70,0x7F,0xF8,0xF0,0x3C,0xE0,0x1C
+};
+const GuiConst_INT8U Ch000257[53] =
+{
+  0,0,0,0,6,  11,13,13,11,7,
+  0,14,
+  5,19,
+  0x00,0x02,0x00,
+  0xFF,0xC0,0xFF,0xF0,0xFF,0xF8,0xE0,0x78,0xE0,0x3C,0xE0,0x1C,
+  0xE0,0x3C,0xE0,0x78,0xFF,0xF0,0xFF,0xF8,0xE0,0x78,0xE0,0x3C,
+  0xE0,0x1C,0xE0,0x3C,0xE0,0x78,0xFF,0xF8,0xFF,0xF0,0xFF,0xC0
+};
+const GuiConst_INT8U Ch000258[43] =
+{
+  2,0,0,2,6,  11,13,13,11,7,
+  0,14,
+  5,19,
+  0x80,0x1F,0x00,
+  0x0F,0xC0,0x3F,0xF0,0x7F,0xF8,0x78,0x78,0xF0,0x3C,0xE0,0x1C,
+  0xE0,0x00,0xE0,0x1C,0xF0,0x3C,0x78,0x78,0x7F,0xF8,0x3F,0xF0,
+  0x0F,0xC0
+};
+const GuiConst_INT8U Ch000259[39] =
+{
+  0,0,0,0,6,  11,13,13,11,7,
+  0,14,
+  5,19,
+  0xC0,0x3F,0x00,
+  0xFF,0xC0,0xFF,0xF0,0xFF,0xF8,0xE0,0x78,0xE0,0x3C,0xE0,0x1C,
+  0xE0,0x3C,0xE0,0x78,0xFF,0xF8,0xFF,0xF0,0xFF,0xC0
+};
+const GuiConst_INT8U Ch000260[27] =
+{
+  0,0,0,0,6,  13,9,9,13,7,
+  0,14,
+  5,19,
+  0xF6,0xF6,0x06,
+  0xFF,0xFC,0xE0,0x00,0xFF,0xC0,0xE0,0x00,0xFF,0xFC
+};
+const GuiConst_INT8U Ch000261[25] =
+{
+  0,0,0,0,6,  13,9,9,2,7,
+  0,14,
+  5,19,
+  0xF6,0xF6,0x07,
+  0xFF,0xFC,0xE0,0x00,0xFF,0xC0,0xE0,0x00
+};
+const GuiConst_INT8U Ch000262[31] =
+{
+  0,0,0,0,6,  2,10,12,12,6,
+  0,13,
+  5,19,
+  0x1E,0xF8,0x07,
+  0xE0,0x00,0xEF,0x80,0xFF,0xE0,0xFF,0xF0,0xF0,0xF0,0xE0,0x78,
+  0xE0,0x38
+};
+const GuiConst_INT8U Ch000263[21] =
+{
+  0,0,0,0,0,  16,16,16,16,16,
+  0,17,
+  0,31,
+  0xFE,0xFF,0xFF,0x7F,
+  0xFF,0xFF,0x80
+};
+const GuiConst_INT8U Ch000264[18] =
+{
+  0,0,0,0,0,  4,4,4,4,4,
+  0,5,
+  0,0,
+  0x00,
+  0x00,0x00,0x00
+};
+const GuiConst_INT8U Ch000265[37] =
+{
+  6,6,0,6,6,  7,7,13,7,7,
+  0,14,
+  14,12,
+  0x5E,0x0F,
+  0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,
+  0xFF,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0x00
+};
+const GuiConst_INT8U Ch000266[25] =
+{
+  1,1,1,1,1,  1,1,1,2,2,
+  0,3,
+  28,7,
+  0x0A,
+  0xF0,0x0F,0x00,0x0F,0x60,0x0D,0xF3,0x06,0x82,0x00
+};
+const GuiConst_INT8U Ch000267[19] =
+{
+  5,5,2,5,5,  5,5,8,5,5,
+  2,7,
+  21,2,
+  0x02,
+  0xFF,0xFF,0xFF,0x0F
+};
+const GuiConst_INT8U Ch000268[16] =
+{
+  0,0,0,0,0,  1,1,1,1,1,
+  0,2,
+  28,2,
+  0x02,
+  0xFF
+};
+const GuiConst_INT8U Ch000269[150] =
+{
+  3,0,0,3,6,  9,12,12,9,6,
+  0,13,
+  7,23,
+  0x00,0x3C,0x00,
+  0x00,0x10,0xE8,0xEF,0x18,0x00,0x00,0x00,0xE4,0xFF,0xFF,0xFF,
+  0x04,0x00,0x00,0xFE,0x08,0x00,0xF9,0x0E,0x00,0x80,0x8F,0x00,
+  0x00,0x80,0x8F,0x00,0xF0,0x0E,0x00,0x00,0x00,0xFE,0x00,0xF4,
+  0x08,0x00,0x00,0x00,0xF8,0x04,0xF7,0x04,0x00,0x00,0x00,0xF4,
+  0x07,0xFA,0x02,0x00,0x00,0x00,0xF2,0x0A,0xFD,0x00,0x00,0x00,
+  0x00,0xF0,0x0D,0xFF,0x00,0x00,0x00,0x00,0xF0,0x0F,0xFD,0x00,
+  0x00,0x00,0x00,0xF0,0x0D,0xFA,0x02,0x00,0x00,0x00,0xF2,0x0A,
+  0xF8,0x04,0x00,0x00,0x00,0xF4,0x07,0xF5,0x08,0x00,0x00,0x00,
+  0xF8,0x04,0xF0,0x0E,0x00,0x00,0x00,0xFE,0x00,0xA0,0x8F,0x00,
+  0x00,0x80,0x8F,0x00,0x10,0xFE,0x09,0x00,0xF9,0x0E,0x00,0x00,
+  0xE4,0xFF,0xFF,0xFF,0x04,0x00,0x00,0x00,0xE8,0xEF,0x18,0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000270[53] =
+{
+  7,2,7,7,5,  8,8,8,8,5,
+  2,7,
+  7,23,
+  0x00,0xFE,0x7F,
+  0x00,0x00,0x60,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0xFC,0x0F,
+  0x00,0x90,0xFF,0x0F,0x00,0xFC,0xFF,0x0F,0xE3,0xFF,0xF4,0x0F,
+  0xFF,0x1A,0xF0,0x0F,0x4C,0x00,0xF0,0x0F,0x00,0x00,0xF0,0x0F
+};
+const GuiConst_INT8U Ch000271[178] =
+{
+  2,0,5,0,3,  10,12,9,12,9,
+  0,13,
+  7,23,
+  0x00,0x00,0x00,
+  0x00,0x20,0xE9,0xFF,0x5C,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFF,
+  0x0C,0x00,0x70,0xEF,0x06,0x00,0xD4,0xAF,0x00,0xF0,0x1E,0x00,
+  0x00,0x00,0xFD,0x04,0xF7,0x06,0x00,0x00,0x00,0xF3,0x09,0xFA,
+  0x00,0x00,0x00,0x00,0xF0,0x0F,0xFF,0x00,0x00,0x00,0x00,0xF0,
+  0x0F,0x00,0x00,0x00,0x00,0x00,0xF1,0x0E,0x00,0x00,0x00,0x00,
+  0x00,0xF6,0x09,0x00,0x00,0x00,0x00,0x00,0xFE,0x04,0x00,0x00,
+  0x00,0x00,0x90,0xDF,0x00,0x00,0x00,0x00,0x00,0xF5,0x2F,0x00,
+  0x00,0x00,0x00,0x40,0xFF,0x06,0x00,0x00,0x00,0x00,0xF4,0x8F,
+  0x00,0x00,0x00,0x00,0x40,0xFF,0x0A,0x00,0x00,0x00,0x00,0xF4,
+  0xCF,0x00,0x00,0x00,0x00,0x40,0xFF,0x0C,0x00,0x00,0x00,0x00,
+  0xF4,0xCF,0x00,0x00,0x00,0x00,0x20,0xFF,0x0C,0x00,0x00,0x00,
+  0x00,0xD0,0xDF,0x00,0x00,0x00,0x00,0x00,0xF4,0x2F,0x00,0x00,
+  0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,
+  0xFF,0xFF,0xFF,0xFF,0x0F
+};
+const GuiConst_INT8U Ch000272[171] =
+{
+  2,0,2,2,6,  9,11,12,10,6,
+  0,13,
+  7,23,
+  0x00,0x00,0x01,
+  0x00,0x40,0xFC,0xDF,0x06,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xEF,
+  0x01,0x00,0xA0,0xDF,0x04,0x10,0xFA,0x0E,0x00,0xF2,0x0D,0x00,
+  0x00,0xA0,0x7F,0x00,0xF8,0x04,0x00,0x00,0x10,0xDF,0x00,0xFE,
+  0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
+  0x00,0x00,0x00,0x00,0x00,0x30,0xCF,0x00,0x00,0x00,0x00,0x00,
+  0xC0,0x4F,0x00,0x00,0x00,0x00,0x40,0xFD,0x0C,0x00,0x00,0x00,
+  0xF0,0xFF,0xEF,0x03,0x00,0x00,0x00,0xF0,0xFF,0xFF,0x7F,0x00,
+  0x00,0x00,0x10,0x00,0xD3,0xFF,0x02,0x00,0x00,0x00,0x00,0x00,
+  0xFD,0x08,0x00,0x00,0x00,0x00,0x00,0xF4,0x0D,0x00,0x00,0x00,
+  0x00,0x00,0xF0,0x0F,0xFF,0x00,0x00,0x00,0x00,0xF0,0x0D,0xF9,
+  0x06,0x00,0x00,0x00,0xF6,0x08,0xF4,0x1E,0x00,0x00,0x10,0xFE,
+  0x00,0xA0,0xEF,0x04,0x00,0xF6,0x6F,0x00,0x00,0xFA,0xFF,0xFF,
+  0xFF,0x06,0x00,0x00,0x40,0xFA,0xEF,0x28,0x00,0x00
+};
+const GuiConst_INT8U Ch000273[136] =
+{
+  7,4,0,8,6,  9,9,12,9,6,
+  0,13,
+  7,23,
+  0x00,0x00,0x7D,
+  0x00,0x00,0x00,0x00,0xFD,0x00,0x00,0x00,0x00,0x00,0x60,0xFF,
+  0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,
+  0xF7,0xFF,0x00,0x00,0x00,0x00,0x00,0xEF,0xFF,0x00,0x00,0x00,
+  0x00,0xA0,0x6F,0xFF,0x00,0x00,0x00,0x00,0xF2,0x0D,0xFF,0x00,
+  0x00,0x00,0x00,0xFC,0x04,0xFF,0x00,0x00,0x00,0x40,0xAF,0x00,
+  0xFF,0x00,0x00,0x00,0xD0,0x2F,0x00,0xFF,0x00,0x00,0x00,0xF6,
+  0x09,0x00,0xFF,0x00,0x00,0x00,0xFE,0x00,0x00,0xFF,0x00,0x00,
+  0x80,0x7F,0x00,0x00,0xFF,0x00,0x00,0xF0,0x0E,0x00,0x00,0xFF,
+  0x00,0x00,0xFA,0x06,0x00,0x00,0xFF,0x00,0x00,0xFF,0xFF,0xFF,
+  0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0xFF,0x00,0x00
+};
+const GuiConst_INT8U Ch000274[164] =
+{
+  2,1,2,2,6,  11,9,12,9,6,
+  0,13,
+  7,23,
+  0x00,0xC0,0x00,
+  0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x20,0xFF,0xFF,0xFF,0xFF,
+  0xFF,0x00,0x50,0x7F,0x00,0x00,0x00,0x00,0x00,0x80,0x5F,0x00,
+  0x00,0x00,0x00,0x00,0xA0,0x2F,0x00,0x00,0x00,0x00,0x00,0xF0,
+  0x0F,0x00,0x00,0x00,0x00,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,
+  0x00,0xF2,0x4A,0xE9,0xEF,0x29,0x00,0x00,0xF6,0xFF,0xFF,0xFF,
+  0xFF,0x06,0x00,0xF8,0xDF,0x04,0x10,0xF8,0x5F,0x00,0xFC,0x0D,
+  0x00,0x00,0x40,0xFF,0x00,0xD9,0x02,0x00,0x00,0x00,0xFA,0x07,
+  0x00,0x00,0x00,0x00,0x00,0xF3,0x0A,0x00,0x00,0x00,0x00,0x00,
+  0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0xF1,0x0C,0xFF,0x00,0x00,
+  0x00,0x00,0xF4,0x08,0xF9,0x04,0x00,0x00,0x00,0xFD,0x03,0xF4,
+  0x0E,0x00,0x00,0x80,0xDF,0x00,0xC0,0xEF,0x04,0x10,0xF9,0x1F,
+  0x00,0x00,0xFC,0xFF,0xFF,0xEF,0x04,0x00,0x00,0x40,0xFA,0xDF,
+  0x08,0x00,0x00
+};
+const GuiConst_INT8U Ch000275[178] =
+{
+  3,0,0,3,6,  10,12,12,10,6,
+  0,13,
+  7,23,
+  0x00,0x00,0x00,
+  0x00,0x00,0xA4,0xFF,0x7D,0x00,0x00,0x00,0xA0,0xFF,0xFF,0xFF,
+  0x1E,0x00,0x00,0xFA,0x3C,0x00,0xD3,0xCF,0x00,0x50,0xAF,0x00,
+  0x00,0x00,0xFE,0x04,0xD0,0x0E,0x00,0x00,0x00,0xF5,0x09,0xF2,
+  0x07,0x00,0x00,0x00,0xF0,0x0E,0xF6,0x01,0x00,0x00,0x00,0x00,
+  0x00,0xF9,0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0x00,0xD8,0xFF,
+  0x39,0x00,0x00,0xAF,0xE4,0xFF,0xFF,0xFF,0x08,0x00,0xDF,0xFF,
+  0x06,0x00,0xF6,0x7F,0x00,0xFF,0x4F,0x00,0x00,0x10,0xFF,0x01,
+  0xFF,0x08,0x00,0x00,0x00,0xF8,0x08,0xFF,0x01,0x00,0x00,0x00,
+  0xF2,0x0C,0xFE,0x00,0x00,0x00,0x00,0xF0,0x0F,0xFA,0x00,0x00,
+  0x00,0x00,0xF0,0x0F,0xF8,0x00,0x00,0x00,0x00,0xF0,0x0F,0xF5,
+  0x04,0x00,0x00,0x00,0xF3,0x0A,0xF0,0x0A,0x00,0x00,0x00,0xF8,
+  0x05,0x80,0x8F,0x00,0x00,0x40,0xFF,0x00,0x00,0xFE,0x19,0x00,
+  0xF6,0x6F,0x00,0x00,0xE1,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,
+  0xD6,0xFF,0x4A,0x00,0x00
+};
+const GuiConst_INT8U Ch000276[164] =
+{
+  0,7,4,3,6,  12,10,6,4,6,
+  0,13,
+  7,23,
+  0x02,0x00,0x40,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,
+  0xF4,0x0A,0x00,0x00,0x00,0x00,0x10,0xEF,0x00,0x00,0x00,0x00,
+  0x00,0xC0,0x2F,0x00,0x00,0x00,0x00,0x00,0xF6,0x09,0x00,0x00,
+  0x00,0x00,0x00,0xEE,0x00,0x00,0x00,0x00,0x00,0x80,0x6F,0x00,
+  0x00,0x00,0x00,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0xF8,
+  0x06,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
+  0x50,0x9F,0x00,0x00,0x00,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,
+  0x00,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0xF5,0x08,0x00,
+  0x00,0x00,0x00,0x00,0xFA,0x03,0x00,0x00,0x00,0x00,0x00,0xFF,
+  0x00,0x00,0x00,0x00,0x00,0x20,0xCF,0x00,0x00,0x00,0x00,0x00,
+  0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x90,0x5F,0x00,0x00,0x00,
+  0x00,0x00,0xA0,0x2F,0x00,0x00,0x00,0x00,0x00,0xF0,0x0F,0x00,
+  0x00,0x00,0x00
+};
+const GuiConst_INT8U Ch000277[164] =
+{
+  3,1,0,2,6,  9,11,12,10,6,
+  0,13,
+  7,23,
+  0x40,0x00,0x01,
+  0x00,0x00,0xE8,0xEF,0x08,0x00,0x00,0x00,0xE1,0xFF,0xFF,0xEF,
+  0x01,0x00,0x00,0xFE,0x09,0x00,0xF9,0x0E,0x00,0x70,0x9F,0x00,
+  0x00,0xA0,0x6F,0x00,0xC0,0x1F,0x00,0x00,0x30,0xCF,0x00,0xF0,
+  0x0F,0x00,0x00,0x00,0xFF,0x00,0xD0,0x2F,0x00,0x00,0x10,0xEF,
+  0x00,0x80,0x9F,0x00,0x00,0x90,0x8F,0x00,0x00,0xFE,0x09,0x00,
+  0xF9,0x0E,0x00,0x00,0xD1,0xFF,0xFF,0xEF,0x02,0x00,0x00,0xF8,
+  0xFF,0xFF,0xFF,0x07,0x00,0xC0,0xEF,0x04,0x00,0xE6,0xAF,0x00,
+  0xF5,0x1E,0x00,0x00,0x10,0xFE,0x04,0xFA,0x04,0x00,0x00,0x00,
+  0xF5,0x0A,0xFF,0x00,0x00,0x00,0x00,0xF0,0x0F,0xFE,0x00,0x00,
+  0x00,0x00,0xF0,0x0F,0xF9,0x04,0x00,0x00,0x00,0xF4,0x09,0xF4,
+  0x1E,0x00,0x00,0x10,0xFE,0x04,0xA0,0xEF,0x06,0x00,0xE4,0xAF,
+  0x00,0x00,0xFA,0xFF,0xFF,0xFF,0x0A,0x00,0x00,0x40,0xF9,0xFF,
+  0x49,0x00,0x00
+};
+const GuiConst_INT8U Ch000278[178] =
+{
+  2,0,2,2,6,  9,12,12,9,6,
+  0,13,
+  7,23,
+  0x00,0x00,0x00,
+  0x00,0x30,0xF9,0xDF,0x06,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xEF,
+  0x01,0x00,0x70,0xFF,0x19,0x00,0xF6,0x0E,0x00,0xF0,0x6F,0x00,
+  0x00,0x40,0x8F,0x00,0xF7,0x0A,0x00,0x00,0x00,0xF8,0x00,0xFC,
+  0x03,0x00,0x00,0x00,0xF2,0x05,0xFF,0x00,0x00,0x00,0x00,0xF0,
+  0x09,0xFF,0x00,0x00,0x00,0x00,0xF0,0x0A,0xFF,0x00,0x00,0x00,
+  0x00,0xF0,0x0F,0xFC,0x01,0x00,0x00,0x00,0xF2,0x0F,0xF8,0x08,
+  0x00,0x00,0x00,0xF8,0x0F,0xF1,0x3F,0x00,0x00,0x10,0xFF,0x0F,
+  0x70,0xFF,0x06,0x00,0xE6,0xDE,0x0F,0x00,0xF8,0xFF,0xFF,0xEF,
+  0xA3,0x0F,0x00,0x30,0xF9,0xDF,0x07,0xD0,0x0A,0x00,0x00,0x00,
+  0x00,0x00,0xF0,0x09,0x00,0x00,0x00,0x00,0x00,0xF3,0x06,0xFF,
+  0x00,0x00,0x00,0x00,0xF8,0x01,0xFA,0x04,0x00,0x00,0x00,0xDF,
+  0x00,0xF4,0x0D,0x00,0x00,0xC0,0x4F,0x00,0xD0,0xCF,0x02,0x30,
+  0xFC,0x0A,0x00,0x10,0xFE,0xFF,0xFF,0xAF,0x00,0x00,0x00,0x70,
+  0xFD,0xAF,0x04,0x00,0x00
+};
+const GuiConst_INT8U Ch000279[20] =
+{
+  0,0,0,0,0,  1,1,1,1,1,
+  0,2,
+  13,17,
+  0xFA,0x7F,0x01,
+  0xFF,0x00,0xFF
+};
+const GuiConst_INT8U Ch000280[224] =
+{
+  7,5,2,0,3,  9,11,14,16,13,
+  0,17,
+  7,23,
+  0x00,0x00,0x00,
+  0x00,0x00,0x00,0xE0,0xEF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0xF3,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0xFF,0x07,
+  0x00,0x00,0x00,0x00,0x00,0x00,0xFD,0xF7,0x0D,0x00,0x00,0x00,
+  0x00,0x00,0x10,0xFF,0xE0,0x1F,0x00,0x00,0x00,0x00,0x00,0x70,
+  0xCF,0x80,0x6F,0x00,0x00,0x00,0x00,0x00,0xC0,0x5F,0x30,0xCF,
+  0x00,0x00,0x00,0x00,0x00,0xF0,0x0F,0x00,0xFF,0x00,0x00,0x00,
+  0x00,0x00,0xF5,0x0C,0x00,0xF9,0x05,0x00,0x00,0x00,0x00,0xFC,
+  0x05,0x00,0xF4,0x0A,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0xF0,
+  0x0F,0x00,0x00,0x00,0x40,0xCF,0x00,0x00,0x90,0x4F,0x00,0x00,
+  0x00,0x90,0x4F,0x00,0x00,0x40,0x9F,0x00,0x00,0x00,0xF0,0x0F,
+  0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xF4,0xFF,0xFF,0xFF,0xFF,
+  0xFF,0x03,0x00,0x00,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0x08,0x00,
+  0x00,0xFE,0x00,0x00,0x00,0x00,0xF0,0x0E,0x00,0x30,0xCF,0x00,
+  0x00,0x00,0x00,0xC0,0x3F,0x00,0x80,0x5F,0x00,0x00,0x00,0x00,
+  0x50,0x7F,0x00,0xD0,0x1F,0x00,0x00,0x00,0x00,0x00,0xDF,0x00,
+  0xF1,0x0D,0x00,0x00,0x00,0x00,0x00,0xFD,0x01,0xF7,0x07,0x00,
+  0x00,0x00,0x00,0x00,0xF7,0x07,0xFD,0x01,0x00,0x00,0x00,0x00,
+  0x00,0xF1,0x0D
+};
+const GuiConst_INT8U Ch000281[164] =
+{
+  0,0,0,0,3,  10,12,13,11,7,
+  0,14,
+  7,23,
+  0x40,0x00,0x01,
+  0xFF,0xFF,0xFF,0xFF,0x8D,0x01,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,
+  0x4F,0x00,0xFF,0x00,0x00,0x00,0x71,0xEF,0x00,0xFF,0x00,0x00,
+  0x00,0x00,0xF9,0x08,0xFF,0x00,0x00,0x00,0x00,0xF1,0x0D,0xFF,
+  0x00,0x00,0x00,0x00,0xF0,0x0F,0xFF,0x00,0x00,0x00,0x00,0xF1,
+  0x0A,0xFF,0x00,0x00,0x00,0x00,0xF7,0x04,0xFF,0x00,0x00,0x00,
+  0x71,0xCF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x00,0xFF,0xFF,
+  0xFF,0xFF,0xFF,0xFF,0x04,0xFF,0x00,0x00,0x00,0x40,0xFD,0x0E,
+  0xFF,0x00,0x00,0x00,0x00,0xD0,0x7F,0xFF,0x00,0x00,0x00,0x00,
+  0x40,0xCF,0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,
+  0x00,0x00,0x00,0xEF,0xFF,0x00,0x00,0x00,0x00,0x30,0x9F,0xFF,
+  0x00,0x00,0x00,0x00,0xC0,0x4F,0xFF,0x00,0x00,0x00,0x30,0xFC,
+  0x0C,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF,0x00,0xFF,0xFF,0xFF,0xFF,
+  0xAF,0x05,0x00
+};
+const GuiConst_INT8U Ch000282[177] =
+{
+  4,0,0,4,7,  12,15,14,12,8,
+  0,16,
+  7,23,
+  0x00,0x1C,0x00,
+  0x00,0x00,0x40,0xE9,0xFF,0x6C,0x00,0x00,0x00,0x10,0xFC,0xFF,
+  0xFF,0xFF,0x3E,0x00,0x00,0xE1,0xCF,0x04,0x00,0xC3,0xFF,0x03,
+  0x00,0xFD,0x08,0x00,0x00,0x00,0xFA,0x0E,0x60,0xAF,0x00,0x00,
+  0x00,0x00,0xE0,0x6F,0xE0,0x0F,0x00,0x00,0x00,0x00,0x60,0xDF,
+  0xF4,0x09,0x00,0x00,0x00,0x00,0x00,0x2A,0xF8,0x05,0x00,0x00,
+  0x00,0x00,0x00,0x00,0xFA,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
+  0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0xFA,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
+  0xF7,0x05,0x00,0x00,0x00,0x00,0x00,0x2A,0xF3,0x09,0x00,0x00,
+  0x00,0x00,0x40,0xDF,0xE0,0x0F,0x00,0x00,0x00,0x00,0xA0,0x7F,
+  0x60,0x9F,0x00,0x00,0x00,0x00,0xF2,0x1F,0x00,0xFE,0x07,0x00,
+  0x00,0x10,0xFE,0x09,0x00,0xF3,0xAF,0x03,0x00,0xE6,0xCF,0x00,
+  0x00,0x40,0xFE,0xFF,0xFF,0xFF,0x0C,0x00,0x00,0x00,0x60,0xFC,
+  0xEF,0x49,0x00,0x00
+};
+const GuiConst_INT8U Ch000283[177] =
+{
+  0,0,0,0,3,  11,14,14,11,6,
+  0,15,
+  7,23,
+  0x00,0x1C,0x00,
+  0xFF,0xFF,0xFF,0xFF,0x9D,0x02,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
+  0xFF,0x8F,0x00,0x00,0xFF,0x00,0x00,0x00,0x62,0xFF,0x07,0x00,
+  0xFF,0x00,0x00,0x00,0x00,0xF1,0x2F,0x00,0xFF,0x00,0x00,0x00,
+  0x00,0x60,0xAF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,
+  0xFF,0x00,0x00,0x00,0x00,0x00,0xF7,0x05,0xFF,0x00,0x00,0x00,
+  0x00,0x00,0xF3,0x09,0xFF,0x00,0x00,0x00,0x00,0x00,0xF1,0x0C,
+  0xFF,0x00,0x00,0x00,0x00,0x00,0xF0,0x0F,0xFF,0x00,0x00,0x00,
+  0x00,0x00,0xF0,0x0E,0xFF,0x00,0x00,0x00,0x00,0x00,0xF2,0x0A,
+  0xFF,0x00,0x00,0x00,0x00,0x00,0xF4,0x08,0xFF,0x00,0x00,0x00,
+  0x00,0x00,0xF8,0x04,0xFF,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,
+  0xFF,0x00,0x00,0x00,0x00,0x60,0x9F,0x00,0xFF,0x00,0x00,0x00,
+  0x00,0xE1,0x1F,0x00,0xFF,0x00,0x00,0x00,0x72,0xFF,0x06,0x00,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
+  0x8C,0x01,0x00,0x00
+};
+const GuiConst_INT8U Ch000284[52] =
+{
+  0,0,0,0,3,  13,9,10,13,10,
+  0,14,
+  7,23,
+  0xFA,0xEB,0x5F,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
+  0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0x00,0x00,
+  0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
+};
+const GuiConst_INT8U Ch000285[45] =
+{
+  0,0,0,0,6,  12,1,10,1,6,
+  0,13,
+  7,23,
+  0xFA,0xD7,0x7F,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0x00,0x00,0x00,0x00,
+  0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0x00,0x00,
+  0x00,0x00,0x00,0x00
+};
+const GuiConst_INT8U Ch000286[65] =
+{
+  0,0,0,0,3,  1,9,10,10,7,
+  0,11,
+  7,23,
+  0x3E,0xE0,0x7F,
+  0xFF,0x00,0x00,0x00,0x00,0x00,0xFF,0x40,0xFA,0xDF,0x06,0x00,
+  0xFF,0xF8,0xFF,0xFF,0xCF,0x00,0xFF,0xCF,0x03,0x50,0xFF,0x04,
+  0xFF,0x0D,0x00,0x00,0xF6,0x09,0xFF,0x05,0x00,0x00,0xF0,0x0D,
+  0xFF,0x01,0x00,0x00,0xF0,0x0F,0xFF,0x00,0x00,0x00,0xF0,0x0F
+};
+const GuiConst_INT8U Ch000287[33] =
+{
+  0,0,0,0,0,  27,27,27,27,27,
+  0,28,
+  0,37,
+  0xFE,0xFF,0xFF,0xFF,0x1F,
+  0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
+  0xFF,0xFF
+};
+const GuiConst_INT8U Ch000288[17] =
+{
+  0,0,0,0,0,  9,9,9,9,9,
+  0,10,
+  0,0,
+  0x00,
+  0x00,0x00
+};
+const GuiConst_INT8U Ch000289[23] =
+{
+  7,6,0,7,7,  8,9,15,8,8,
+  0,16,
+  12,17,
+  0x7E,0xFB,0x01,
+  0x03,0xC0,0xFF,0xFF,0x03,0xC0
+};
+const GuiConst_INT8U Ch000290[22] =
+{
+  7,7,7,5,7,  7,7,7,9,7,
+  5,5,
+  27,8,
+  0x04,
+  0x70,0xF8,0x78,0x38,0x70,0xE0,0xC0
+};
+const GuiConst_INT8U Ch000291[17] =
+{
+  7,7,0,7,7,  8,8,15,8,8,
+  0,16,
+  19,3,
+  0x06,
+  0xFF,0xFF
+};
+const GuiConst_INT8U Ch000292[18] =
+{
+  7,7,7,5,7,  7,7,7,9,7,
+  5,5,
+  27,4,
+  0x04,
+  0x70,0xF8,0x70
+};
+const GuiConst_INT8U Ch000293[43] =
+{
+  4,0,0,4,7,  11,15,15,11,8,
+  0,16,
+  7,24,
+  0x40,0xFF,0x05,
+  0x03,0xC0,0x0F,0xF0,0x1F,0xF8,0x3E,0x7C,0x3C,0x3C,0x78,0x1E,
+  0xF0,0x0F,0x78,0x1E,0x3C,0x3C,0x3E,0x7C,0x1F,0xF8,0x0F,0xF0,
+  0x03,0xC0
+};
+const GuiConst_INT8U Ch000294[35] =
+{
+  6,3,7,7,6,  10,10,10,10,6,
+  2,9,
+  7,24,
+  0x00,0xFE,0xFF,
+  0x07,0x80,0x0F,0x80,0x1F,0x80,0x3F,0x80,0x7F,0x80,0xFF,0x80,
+  0x77,0x80,0x27,0x80,0x07,0x80
+};
+const GuiConst_INT8U Ch000295[55] =
+{
+  3,2,1,0,7,  12,15,10,15,8,
+  0,16,
+  7,24,
+  0x00,0x01,0xD8,
+  0x07,0xE0,0x1F,0xF8,0x3F,0xFC,0x7C,0x3E,0xF8,0x1F,0x70,0x0F,
+  0x20,0x0F,0x00,0x0F,0x00,0x1F,0x00,0x3E,0x00,0x7C,0x01,0xF8,
+  0x07,0xF0,0x1F,0xC0,0x3F,0x00,0x7C,0x00,0x78,0x00,0xF0,0x00,
+  0xFF,0xFF
+};
+const GuiConst_INT8U Ch000296[63] =
+{
+  3,2,3,3,7,  12,15,15,12,8,
+  0,16,
+  7,24,
+  0x00,0x10,0x00,
+  0x07,0xE0,0x1F,0xF8,0x3F,0xFC,0x7C,0x3E,0xF8,0x1F,0x70,0x0F,
+  0x20,0x0F,0x00,0x0F,0x00,0x1F,0x00,0x3E,0x00,0xFC,0x03,0xF8,
+  0x00,0xFC,0x00,0x3E,0x00,0x1F,0x00,0x0F,0x20,0x0F,0x70,0x0F,
+  0xF8,0x1F,0x7C,0x3E,0x3F,0xFC,0x1F,0xF8,0x07,0xE0
+};
+const GuiConst_INT8U Ch000297[39] =
+{
+  8,4,0,3,7,  12,12,14,12,8,
+  0,16,
+  7,24,
+  0xAA,0xAA,0xEC,
+  0x00,0xF8,0x01,0xF8,0x03,0xF8,0x07,0xF8,0x0F,0x78,0x1E,0x78,
+  0x3C,0x78,0x78,0x78,0xF0,0x78,0xFF,0xFF,0x00,0x78
+};
+const GuiConst_INT8U Ch000298[47] =
+{
+  1,1,3,3,7,  15,11,15,12,8,
+  0,16,
+  7,24,
+  0xF6,0x81,0x01,
+  0x7F,0xFF,0x78,0x00,0x7F,0xF0,0x7F,0xFC,0x7F,0xFE,0x00,0x7E,
+  0x00,0x1F,0x00,0x0F,0x20,0x0F,0x70,0x0F,0xF8,0x1F,0x7C,0x3E,
+  0x3F,0xFC,0x1F,0xF8,0x07,0xE0
+};
+const GuiConst_INT8U Ch000299[55] =
+{
+  6,1,0,3,7,  11,10,15,12,8,
+  0,16,
+  7,24,
+  0x00,0x81,0x07,
+  0x00,0x60,0x01,0xF0,0x03,0xF0,0x0F,0xE0,0x1F,0x80,0x3F,0x00,
+  0x3C,0x00,0x78,0x00,0xF7,0xE0,0xFF,0xF8,0xFF,0xFC,0xFC,0x3E,
+  0xF8,0x1F,0xF0,0x0F,0xF8,0x1F,0x7C,0x3E,0x3F,0xFC,0x1F,0xF8,
+  0x07,0xE0
+};
+const GuiConst_INT8U Ch000300[61] =
+{
+  0,9,5,2,7,  15,14,10,6,8,
+  0,16,
+  7,24,
+  0x06,0x00,0x00,
+  0xFF,0xFF,0x00,0x0F,0x00,0x1F,0x00,0x1E,0x00,0x3E,0x00,0x3C,
+  0x00,0x7C,0x00,0x78,0x00,0xF8,0x00,0xF0,0x01,0xF0,0x01,0xE0,
+  0x03,0xE0,0x03,0xC0,0x07,0xC0,0x07,0x80,0x0F,0x80,0x0F,0x00,
+  0x1F,0x00,0x1E,0x00,0x3E,0x00,0x3C,0x00
+};
+const GuiConst_INT8U Ch000301[55] =
+{
+  3,0,0,3,7,  12,15,15,12,8,
+  0,16,
+  7,24,
+  0xC0,0x10,0x06,
+  0x07,0xE0,0x1F,0xF8,0x3F,0xFC,0x7C,0x3E,0xF8,0x1F,0xF0,0x0F,
+  0xF8,0x1F,0x7C,0x3E,0x3F,0xFC,0x1F,0xF8,0x3F,0xFC,0x7C,0x3E,
+  0xF8,0x1F,0xF0,0x0F,0xF8,0x1F,0x7C,0x3E,0x3F,0xFC,0x1F,0xF8,
+  0x07,0xE0
+};
+const GuiConst_INT8U Ch000302[55] =
+{
+  3,0,4,4,7,  12,15,15,9,8,
+  0,16,
+  7,24,
+  0xC0,0x03,0x01,
+  0x07,0xE0,0x1F,0xF8,0x3F,0xFC,0x7C,0x3E,0xF8,0x1F,0xF0,0x0F,
+  0xF8,0x1F,0x7C,0x3F,0x3F,0xFF,0x1F,0xFF,0x07,0xEF,0x00,0x1E,
+  0x00,0x3C,0x00,0xFC,0x01,0xF8,0x07,0xF0,0x0F,0xC0,0x0F,0x80,
+  0x06,0x00
+};
+const GuiConst_INT8U Ch000303[24] =
+{
+  7,5,7,5,7,  7,9,7,9,7,
+  5,5,
+  14,17,
+  0xE4,0x9F,0x00,
+  0x70,0xF8,0x70,0x00,0x70,0xF8,0x70
+};
+const GuiConst_INT8U Ch000304[35] =
+{
+  6,4,2,0,7,  9,11,13,15,8,
+  0,16,
+  7,24,
+  0xDA,0xDD,0xD4,
+  0x03,0xC0,0x07,0xE0,0x0F,0xF0,0x1E,0x78,0x3C,0x3C,0x3F,0xFC,
+  0x7F,0xFE,0x78,0x1E,0xF0,0x0F
+};
+const GuiConst_INT8U Ch000305[57] =
+{
+  0,0,0,0,7,  12,15,15,12,8,
+  0,16,
+  7,24,
+  0xC0,0x00,0x06,
+  0xFF,0xC0,0xFF,0xF0,0xFF,0xFC,0xF0,0x7E,0xF0,0x1E,0xF0,0x0F,
+  0xF0,0x1E,0xF0,0x7E,0xFF,0xF8,0xFF,0xF0,0xFF,0xF8,0xF0,0x7E,
+  0xF0,0x1E,0xF0,0x1F,0xF0,0x0F,0xF0,0x1E,0xF0,0x7E,0xFF,0xFC,
+  0xFF,0xF0,0xFF,0xC0
+};
+const GuiConst_INT8U Ch000306[47] =
+{
+  3,0,0,3,7,  12,15,14,12,8,
+  0,16,
+  7,24,
+  0x00,0xFF,0x01,
+  0x03,0xC0,0x0F,0xF0,0x3F,0xFC,0x7E,0x7E,0x78,0x1E,0xF8,0x1F,
+  0xF0,0x0F,0xF0,0x00,0xF0,0x0F,0xF8,0x1F,0x78,0x1E,0x7E,0x7E,
+  0x3F,0xFC,0x0F,0xF0,0x03,0xC0
+};
+const GuiConst_INT8U Ch000307[39] =
+{
+  0,0,0,0,7,  12,15,15,12,8,
+  0,16,
+  7,24,
+  0xC0,0xFF,0x07,
+  0xFF,0xC0,0xFF,0xF0,0xFF,0xFC,0xF0,0x7E,0xF0,0x1E,0xF0,0x0F,
+  0xF0,0x1E,0xF0,0x7E,0xFF,0xFC,0xFF,0xF0,0xFF,0xC0
+};
+const GuiConst_INT8U Ch000308[27] =
+{
+  0,0,0,0,7,  15,11,11,15,8,
+  0,16,
+  7,24,
+  0xF6,0xDB,0xDF,
+  0xFF,0xFF,0xF0,0x00,0xFF,0xF0,0xF0,0x00,0xFF,0xFF
+};
+const GuiConst_INT8U Ch000309[25] =
+{
+  0,0,0,0,7,  15,11,9,3,8,
+  0,16,
+  7,24,
+  0xF6,0xDB,0xFF,
+  0xFF,0xFF,0xF0,0x00,0xFF,0xF0,0xF0,0x00
+};
+const GuiConst_INT8U Ch000310[31] =
+{
+  0,0,0,0,7,  3,12,15,15,8,
+  0,16,
+  7,24,
+  0x7E,0xD0,0xFF,
+  0xF0,0x00,0xF3,0xC0,0xFF,0xF0,0xFF,0xFC,0xFC,0x3C,0xF0,0x1E,
+  0xF0,0x0F
+};
+const GuiConst_INT8U Ch000311[22] =
+{
+  0,0,0,0,0,  18,18,18,18,18,
+  0,19,
+  0,39,
+  0xFE,0xFF,0xFF,0xFF,0x7F,
+  0xFF,0xFF,0xE0
+};
+const GuiConst_INT8U Ch000312[16] =
+{
+  0,0,0,0,0,  7,7,7,7,7,
+  0,8,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000313[26] =
+{
+  8,0,0,8,8,  9,17,17,9,9,
+  0,18,
+  14,18,
+  0x7E,0xF7,0x03,
+  0x01,0xE0,0x00,0xFF,0xFF,0xC0,0x01,0xE0,0x00
+};
+const GuiConst_INT8U Ch000314[23] =
+{
+  6,6,6,4,6,  7,7,7,9,7,
+  4,6,
+  32,10,
+  0x1C,0x00,
+  0x78,0xFC,0x7C,0x3C,0x38,0x78,0x70
+};
+const GuiConst_INT8U Ch000315[18] =
+{
+  8,0,0,8,8,  9,17,17,9,9,
+  0,18,
+  21,4,
+  0x0E,
+  0xFF,0xFF,0xC0
+};
+const GuiConst_INT8U Ch000316[18] =
+{
+  6,6,6,4,6,  7,7,7,9,7,
+  4,6,
+  32,6,
+  0x1C,
+  0x78,0xFC,0x78
+};
+const GuiConst_INT8U Ch000317[69] =
+{
+  3,0,0,3,8,  14,17,17,14,9,
+  0,18,
+  8,30,
+  0x80,0xFC,0x9F,0x00,
+  0x03,0xF0,0x00,0x0F,0xFC,0x00,0x1F,0xFE,0x00,0x3F,0xFF,0x00,
+  0x3E,0x1F,0x00,0x7C,0x0F,0x80,0x78,0x07,0x80,0xF8,0x07,0xC0,
+  0xF0,0x03,0xC0,0xF8,0x07,0xC0,0x78,0x07,0x80,0x7C,0x0F,0x80,
+  0x3E,0x1F,0x00,0x3F,0xFF,0x00,0x1F,0xFE,0x00,0x0F,0xFC,0x00,
+  0x03,0xF0,0x00
+};
+const GuiConst_INT8U Ch000318[38] =
+{
+  6,3,8,8,6,  11,11,11,11,7,
+  2,10,
+  8,30,
+  0x00,0xFC,0xFF,0x3F,
+  0x03,0xC0,0x07,0xC0,0x0F,0xC0,0x1F,0xC0,0x3F,0xC0,0x7F,0xC0,
+  0xFF,0xC0,0x7B,0xC0,0x33,0xC0,0x03,0xC0
+};
+const GuiConst_INT8U Ch000319[87] =
+{
+  2,2,0,0,8,  15,17,12,16,9,
+  0,18,
+  8,30,
+  0x08,0x00,0x80,0x3B,
+  0x03,0xF0,0x00,0x0F,0xFC,0x00,0x3F,0xFF,0x00,0x7E,0x1F,0x80,
+  0x78,0x07,0x80,0xF8,0x07,0xC0,0x70,0x03,0xC0,0x30,0x03,0xC0,
+  0x00,0x03,0xC0,0x00,0x07,0xC0,0x00,0x07,0x80,0x00,0x1F,0x80,
+  0x00,0x7F,0x00,0x01,0xFE,0x00,0x07,0xFC,0x00,0x0F,0xF0,0x00,
+  0x1F,0xC0,0x00,0x3F,0x00,0x00,0x7E,0x00,0x00,0x7C,0x00,0x00,
+  0xF8,0x00,0x00,0xF0,0x00,0x00,0xFF,0xFF,0x80
+};
+const GuiConst_INT8U Ch000320[99] =
+{
+  2,1,1,2,8,  15,17,17,15,9,
+  0,18,
+  8,30,
+  0x08,0x80,0x00,0x08,
+  0x03,0xF0,0x00,0x0F,0xFC,0x00,0x3F,0xFF,0x00,0x7E,0x1F,0x80,
+  0x78,0x07,0x80,0xF8,0x07,0xC0,0x70,0x03,0xC0,0x30,0x03,0xC0,
+  0x00,0x03,0xC0,0x00,0x07,0xC0,0x00,0x07,0x80,0x00,0x1F,0x80,
+  0x00,0xFF,0x00,0x00,0xFE,0x00,0x00,0xFF,0x00,0x00,0x1F,0x80,
+  0x00,0x07,0x80,0x00,0x07,0xC0,0x00,0x03,0xC0,0x30,0x03,0xC0,
+  0x70,0x03,0xC0,0xF8,0x07,0xC0,0x78,0x07,0x80,0x7E,0x1F,0x80,
+  0x3F,0xFF,0x00,0x0F,0xFC,0x00,0x03,0xF0,0x00
+};
+const GuiConst_INT8U Ch000321[72] =
+{
+  9,4,0,10,8,  13,13,17,13,9,
+  0,18,
+  8,30,
+  0xAA,0x02,0xC0,0x3D,
+  0x00,0x3C,0x00,0x00,0x7C,0x00,0x00,0xFC,0x00,0x01,0xFC,0x00,
+  0x03,0xFC,0x00,0x07,0xFC,0x00,0x07,0xBC,0x00,0x0F,0xBC,0x00,
+  0x0F,0x3C,0x00,0x1F,0x3C,0x00,0x1E,0x3C,0x00,0x3E,0x3C,0x00,
+  0x3C,0x3C,0x00,0x7C,0x3C,0x00,0x78,0x3C,0x00,0xF8,0x3C,0x00,
+  0xFF,0xFF,0xC0,0x00,0x3C,0x00
+};
+const GuiConst_INT8U Ch000322[69] =
+{
+  1,1,1,2,8,  16,15,17,15,9,
+  0,18,
+  8,30,
+  0xEE,0x11,0x1E,0x08,
+  0x7F,0xFF,0x80,0x78,0x00,0x00,0x7B,0xF0,0x00,0x7F,0xFC,0x00,
+  0x7F,0xFF,0x00,0x7C,0x1F,0x80,0x70,0x07,0x80,0x00,0x07,0xC0,
+  0x00,0x03,0xC0,0x30,0x03,0xC0,0x70,0x03,0xC0,0xF8,0x07,0xC0,
+  0x78,0x07,0x80,0x7E,0x1F,0x80,0x3F,0xFF,0x00,0x0F,0xFC,0x00,
+  0x03,0xF0,0x00
+};
+const GuiConst_INT8U Ch000323[87] =
+{
+  6,0,0,2,8,  14,15,17,15,9,
+  0,18,
+  8,30,
+  0x00,0x20,0x7C,0x08,
+  0x00,0x38,0x00,0x00,0xF8,0x00,0x03,0xFC,0x00,0x07,0xF8,0x00,
+  0x0F,0xE0,0x00,0x1F,0x80,0x00,0x3F,0x00,0x00,0x3E,0x00,0x00,
+  0x7C,0x00,0x00,0x78,0x00,0x00,0x7B,0xF0,0x00,0xFF,0xFC,0x00,
+  0xFF,0xFF,0x00,0xFE,0x1F,0x80,0xF8,0x07,0x80,0xF8,0x07,0xC0,
+  0xF0,0x03,0xC0,0xF8,0x07,0xC0,0x78,0x07,0x80,0x7E,0x1F,0x80,
+  0x3F,0xFF,0x00,0x0F,0xFC,0x00,0x03,0xF0,0x00
+};
+const GuiConst_INT8U Ch000324[60] =
+{
+  0,7,5,1,8,  17,15,11,9,9,
+  0,18,
+  8,30,
+  0xAE,0xAA,0xAA,0x2A,
+  0xFF,0xFF,0xC0,0x00,0x07,0xC0,0x00,0x0F,0x80,0x00,0x1F,0x00,
+  0x00,0x3E,0x00,0x00,0x7C,0x00,0x00,0xF8,0x00,0x01,0xF0,0x00,
+  0x03,0xE0,0x00,0x07,0xC0,0x00,0x0F,0x80,0x00,0x1F,0x00,0x00,
+  0x3E,0x00,0x00,0x7C,0x00,0x00
+};
+const GuiConst_INT8U Ch000325[93] =
+{
+  2,0,0,2,8,  15,17,17,15,9,
+  0,18,
+  8,30,
+  0x08,0x01,0x60,0x08,
+  0x03,0xF0,0x00,0x0F,0xFC,0x00,0x3F,0xFF,0x00,0x7E,0x1F,0x80,
+  0x78,0x07,0x80,0xF8,0x07,0xC0,0xF0,0x03,0xC0,0xF8,0x07,0xC0,
+  0x78,0x07,0x80,0x7E,0x1F,0x80,0x3F,0xFF,0x00,0x1F,0xFE,0x00,
+  0x0F,0xFC,0x00,0x1F,0xFE,0x00,0x3F,0xFF,0x00,0x7E,0x1F,0x80,
+  0x78,0x07,0x80,0xF8,0x07,0xC0,0xF0,0x03,0xC0,0xF8,0x07,0xC0,
+  0x78,0x07,0x80,0x7E,0x1F,0x80,0x3F,0xFF,0x00,0x0F,0xFC,0x00,
+  0x03,0xF0,0x00
+};
+const GuiConst_INT8U Ch000326[87] =
+{
+  2,0,2,3,8,  15,17,17,11,9,
+  0,18,
+  8,30,
+  0x08,0x1F,0x02,0x00,
+  0x03,0xF0,0x00,0x0F,0xFC,0x00,0x3F,0xFF,0x00,0x7E,0x1F,0x80,
+  0x78,0x07,0x80,0xF8,0x07,0xC0,0xF0,0x03,0xC0,0xF8,0x07,0xC0,
+  0x78,0x07,0xC0,0x7E,0x1F,0xC0,0x3F,0xFF,0xC0,0x0F,0xFF,0xC0,
+  0x03,0xF7,0x80,0x00,0x07,0x80,0x00,0x0F,0x80,0x00,0x1F,0x00,
+  0x00,0x3F,0x00,0x00,0x7E,0x00,0x01,0xFC,0x00,0x07,0xF8,0x00,
+  0x0F,0xF0,0x00,0x07,0xC0,0x00,0x07,0x00,0x00
+};
+const GuiConst_INT8U Ch000327[24] =
+{
+  6,4,6,4,6,  7,9,7,9,7,
+  4,6,
+  15,23,
+  0x9C,0xFF,0x39,
+  0x78,0xFC,0x78,0x00,0x78,0xFC,0x78
+};
+const GuiConst_INT8U Ch000328[54] =
+{
+  6,4,1,0,8,  11,13,16,17,9,
+  0,18,
+  8,30,
+  0xDA,0x99,0xD9,0x39,
+  0x01,0xE0,0x00,0x03,0xF0,0x00,0x07,0xF8,0x00,0x0F,0xFC,0x00,
+  0x0F,0x3C,0x00,0x1F,0x3E,0x00,0x1E,0x1E,0x00,0x3E,0x1F,0x00,
+  0x3C,0x0F,0x00,0x7F,0xFF,0x80,0xF8,0x07,0xC0,0xF0,0x03,0xC0
+};
+const GuiConst_INT8U Ch000329[87] =
+{
+  0,0,0,0,8,  15,17,17,15,9,
+  0,18,
+  8,30,
+  0x08,0x83,0x60,0x08,
+  0xFF,0xF0,0x00,0xFF,0xFC,0x00,0xFF,0xFF,0x00,0xF0,0x1F,0x80,
+  0xF0,0x07,0x80,0xF0,0x07,0xC0,0xF0,0x03,0xC0,0xF0,0x07,0xC0,
+  0xF0,0x07,0x80,0xF0,0x1F,0x80,0xFF,0xFF,0x00,0xFF,0xFE,0x00,
+  0xFF,0xFF,0x00,0xF0,0x1F,0x80,0xF0,0x07,0x80,0xF0,0x07,0xC0,
+  0xF0,0x03,0xC0,0xF0,0x07,0xC0,0xF0,0x07,0x80,0xF0,0x1F,0x80,
+  0xFF,0xFF,0x00,0xFF,0xFC,0x00,0xFF,0xF0,0x00
+};
+const GuiConst_INT8U Ch000330[69] =
+{
+  2,0,0,2,8,  15,16,16,15,9,
+  0,18,
+  8,30,
+  0x08,0xFC,0x1F,0x08,
+  0x03,0xF0,0x00,0x0F,0xFC,0x00,0x3F,0xFF,0x00,0x7E,0x1F,0x80,
+  0x78,0x07,0x80,0xF8,0x07,0xC0,0xF0,0x03,0x80,0xF0,0x03,0x00,
+  0xF0,0x00,0x00,0xF0,0x03,0x00,0xF0,0x03,0x80,0xF8,0x07,0xC0,
+  0x78,0x07,0x80,0x7E,0x1F,0x80,0x3F,0xFF,0x00,0x0F,0xFC,0x00,
+  0x03,0xF0,0x00
+};
+const GuiConst_INT8U Ch000331[57] =
+{
+  0,0,0,0,8,  15,17,17,15,9,
+  0,18,
+  8,30,
+  0x08,0xFF,0x7F,0x08,
+  0xFF,0xF0,0x00,0xFF,0xFC,0x00,0xFF,0xFF,0x00,0xF0,0x1F,0x80,
+  0xF0,0x07,0x80,0xF0,0x07,0xC0,0xF0,0x03,0xC0,0xF0,0x07,0xC0,
+  0xF0,0x07,0x80,0xF0,0x1F,0x80,0xFF,0xFF,0x00,0xFF,0xFC,0x00,
+  0xFF,0xF0,0x00
+};
+const GuiConst_INT8U Ch000332[33] =
+{
+  0,0,0,0,8,  17,11,11,17,9,
+  0,18,
+  8,30,
+  0xEE,0xDF,0xFD,0x3B,
+  0xFF,0xFF,0xC0,0xF0,0x00,0x00,0xFF,0xF0,0x00,0xF0,0x00,0x00,
+  0xFF,0xFF,0xC0
+};
+const GuiConst_INT8U Ch000333[30] =
+{
+  0,0,0,0,8,  17,11,11,3,9,
+  0,18,
+  8,30,
+  0xEE,0xDF,0xFD,0x3F,
+  0xFF,0xFF,0xC0,0xF0,0x00,0x00,0xFF,0xF0,0x00,0xF0,0x00,0x00
+};
+const GuiConst_INT8U Ch000334[42] =
+{
+  0,0,0,0,8,  3,14,16,16,8,
+  0,17,
+  8,30,
+  0xFE,0x23,0xFC,0x3F,
+  0xF0,0x00,0x00,0xF3,0xE0,0x00,0xFF,0xF8,0x00,0xFF,0xFE,0x00,
+  0xFC,0x1F,0x00,0xF0,0x0F,0x00,0xF0,0x0F,0x80,0xF0,0x07,0x80
+};
+const GuiConst_INT8U Ch000335[23] =
+{
+  0,0,0,0,0,  20,20,20,20,20,
+  0,21,
+  0,47,
+  0xFE,0xFF,0xFF,0xFF,0xFF,0x7F,
+  0xFF,0xFF,0xF8
+};
+const GuiConst_INT8U Ch000336[16] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000337[18] =
+{
+  2,0,0,2,2,  3,5,5,3,3,
+  0,6,
+  6,5,
+  0x12,
+  0x30,0xFC,0x30
+};
+const GuiConst_INT8U Ch000338[17] =
+{
+  2,2,2,1,1,  2,2,3,3,2,
+  1,3,
+  10,3,
+  0x02,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000339[16] =
+{
+  2,0,0,2,2,  3,5,5,3,3,
+  0,6,
+  8,1,
+  0x00,
+  0xFC
+};
+const GuiConst_INT8U Ch000340[16] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  10,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000341[20] =
+{
+  1,0,0,1,2,  4,5,5,4,3,
+  0,6,
+  5,7,
+  0x18,
+  0x30,0x78,0xCC,0x78,0x30
+};
+const GuiConst_INT8U Ch000342[19] =
+{
+  2,1,3,3,2,  4,4,4,4,3,
+  1,4,
+  5,7,
+  0x70,
+  0x30,0x70,0xF0,0x30
+};
+const GuiConst_INT8U Ch000343[22] =
+{
+  0,0,0,0,2,  5,5,4,5,3,
+  0,6,
+  5,7,
+  0x00,
+  0x78,0xCC,0x0C,0x38,0x60,0xC0,0xFC
+};
+const GuiConst_INT8U Ch000344[22] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  5,7,
+  0x00,
+  0x78,0xCC,0x0C,0x38,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000345[20] =
+{
+  1,0,0,3,2,  4,4,5,4,3,
+  0,6,
+  5,7,
+  0x48,
+  0x38,0x78,0xD8,0xFC,0x18
+};
+const GuiConst_INT8U Ch000346[21] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  5,7,
+  0x10,
+  0xFC,0xC0,0xF8,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000347[21] =
+{
+  1,0,0,0,2,  4,4,5,5,3,
+  0,6,
+  5,7,
+  0x20,
+  0x38,0x60,0xC0,0xF8,0xCC,0x78
+};
+const GuiConst_INT8U Ch000348[20] =
+{
+  0,1,2,1,2,  5,5,4,3,3,
+  0,6,
+  5,7,
+  0x28,
+  0xFC,0x0C,0x18,0x30,0x60
+};
+const GuiConst_INT8U Ch000349[20] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  5,7,
+  0x24,
+  0x78,0xCC,0x78,0xCC,0x78
+};
+const GuiConst_INT8U Ch000350[21] =
+{
+  0,0,1,1,2,  5,5,5,4,3,
+  0,6,
+  5,7,
+  0x04,
+  0x78,0xCC,0x7C,0x0C,0x18,0x70
+};
+const GuiConst_INT8U Ch000351[18] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  6,6,
+  0x2A,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000352[20] =
+{
+  1,0,0,0,2,  4,5,5,5,3,
+  0,6,
+  5,7,
+  0x48,
+  0x30,0x78,0xCC,0xFC,0xCC
+};
+const GuiConst_INT8U Ch000353[20] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  5,7,
+  0x24,
+  0xF8,0xCC,0xF8,0xCC,0xF8
+};
+const GuiConst_INT8U Ch000354[20] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  5,7,
+  0x18,
+  0x78,0xCC,0xC0,0xCC,0x78
+};
+const GuiConst_INT8U Ch000355[20] =
+{
+  0,0,0,0,2,  4,5,5,4,3,
+  0,6,
+  5,7,
+  0x18,
+  0xF0,0xD8,0xCC,0xD8,0xF0
+};
+const GuiConst_INT8U Ch000356[20] =
+{
+  0,0,0,0,2,  5,4,4,5,3,
+  0,6,
+  5,7,
+  0x24,
+  0xFC,0xC0,0xF8,0xC0,0xFC
+};
+const GuiConst_INT8U Ch000357[19] =
+{
+  0,0,0,0,2,  5,4,4,2,3,
+  0,6,
+  5,7,
+  0x64,
+  0xFC,0xC0,0xF8,0xC0
+};
+const GuiConst_INT8U Ch000358[18] =
+{
+  0,0,0,0,2,  1,4,4,4,2,
+  0,5,
+  5,7,
+  0x72,
+  0xC0,0xF0,0xD8
+};
+const GuiConst_INT8U Ch000359[18] =
+{
+  0,0,0,0,0,  14,14,14,14,14,
+  0,15,
+  0,16,
+  0xFE,0xFF,
+  0xFF,0xFE
+};
+const GuiConst_INT8U Ch000360[16] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000361[18] =
+{
+  2,1,0,2,2,  3,4,5,3,3,
+  0,6,
+  6,5,
+  0x12,
+  0x30,0xFC,0x30
+};
+const GuiConst_INT8U Ch000362[17] =
+{
+  2,2,2,1,2,  2,2,2,3,2,
+  1,3,
+  11,3,
+  0x02,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000363[16] =
+{
+  2,1,0,2,2,  2,3,4,2,2,
+  0,5,
+  8,2,
+  0x02,
+  0xF8
+};
+const GuiConst_INT8U Ch000364[16] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  11,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000365[19] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  4,9,
+  0xFC,0x00,
+  0x78,0xCC,0x78
+};
+const GuiConst_INT8U Ch000366[20] =
+{
+  2,1,3,3,2,  4,4,4,4,3,
+  1,4,
+  4,9,
+  0xF0,0x01,
+  0x30,0x70,0xF0,0x30
+};
+const GuiConst_INT8U Ch000367[24] =
+{
+  0,0,0,0,2,  5,5,3,5,3,
+  0,6,
+  4,9,
+  0x80,0x00,
+  0x78,0xCC,0x0C,0x18,0x30,0x60,0xC0,0xFC
+};
+const GuiConst_INT8U Ch000368[24] =
+{
+  0,0,1,0,2,  5,5,5,5,3,
+  0,6,
+  4,9,
+  0x40,0x00,
+  0x78,0xCC,0x04,0x0C,0x18,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000369[23] =
+{
+  2,1,0,1,3,  5,5,6,5,3,
+  0,7,
+  4,9,
+  0x20,0x01,
+  0x0C,0x1C,0x3C,0x6C,0xCC,0xFE,0x0C
+};
+const GuiConst_INT8U Ch000370[22] =
+{
+  0,0,1,0,2,  5,4,5,5,3,
+  0,6,
+  4,9,
+  0x64,0x00,
+  0xFC,0xC0,0xF8,0x0C,0xCC,0x78
+};
+const GuiConst_INT8U Ch000371[22] =
+{
+  1,0,0,0,2,  4,4,5,5,3,
+  0,6,
+  4,9,
+  0xE0,0x00,
+  0x38,0x60,0xC0,0xF8,0xCC,0x78
+};
+const GuiConst_INT8U Ch000372[20] =
+{
+  0,1,2,2,2,  5,5,4,3,3,
+  0,6,
+  4,9,
+  0xB4,0x01,
+  0xFC,0x0C,0x18,0x30
+};
+const GuiConst_INT8U Ch000373[21] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  4,9,
+  0xCC,0x00,
+  0x78,0xCC,0x78,0xCC,0x78
+};
+const GuiConst_INT8U Ch000374[22] =
+{
+  0,0,0,1,2,  5,5,5,4,3,
+  0,6,
+  4,9,
+  0x1C,0x00,
+  0x78,0xCC,0x7C,0x0C,0x18,0x70
+};
+const GuiConst_INT8U Ch000375[18] =
+{
+  2,2,2,2,2,  3,3,3,3,3,
+  2,2,
+  6,7,
+  0x5A,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000376[21] =
+{
+  2,1,0,0,2,  3,4,5,5,3,
+  0,6,
+  4,9,
+  0x2A,0x01,
+  0x30,0x78,0xCC,0xFC,0xCC
+};
+const GuiConst_INT8U Ch000377[21] =
+{
+  0,0,0,0,2,  5,5,5,5,3,
+  0,6,
+  4,9,
+  0xCC,0x00,
+  0xF8,0xCC,0xF8,0xCC,0xF8
+};
+const GuiConst_INT8U Ch000378[21] =
+{
+  0,0,0,0,2,  5,5,4,5,3,
+  0,6,
+  4,9,
+  0x78,0x00,
+  0x78,0xCC,0xC0,0xCC,0x78
+};
+const GuiConst_INT8U Ch000379[21] =
+{
+  0,0,0,0,2,  4,5,5,4,3,
+  0,6,
+  4,9,
+  0x78,0x00,
+  0xF0,0xD8,0xCC,0xD8,0xF0
+};
+const GuiConst_INT8U Ch000380[21] =
+{
+  0,0,0,0,2,  4,3,3,4,2,
+  0,5,
+  4,9,
+  0xCC,0x00,
+  0xF8,0xC0,0xF0,0xC0,0xF8
+};
+const GuiConst_INT8U Ch000381[20] =
+{
+  0,0,0,0,2,  4,3,3,1,2,
+  0,5,
+  4,9,
+  0xCC,0x01,
+  0xF8,0xC0,0xF0,0xC0
+};
+const GuiConst_INT8U Ch000382[19] =
+{
+  0,0,0,0,2,  3,5,5,5,3,
+  0,6,
+  4,9,
+  0xF2,0x01,
+  0xC0,0xF8,0xCC
+};
+const GuiConst_INT8U Ch000383[19] =
+{
+  0,0,0,0,0,  15,15,15,15,15,
+  0,16,
+  0,17,
+  0xFE,0xFF,0x01,
+  0xFF,0xFF
+};
+const GuiConst_INT8U Ch000384[16] =
+{
+  0,0,0,0,0,  2,2,2,2,2,
+  0,3,
+  0,0,
+  0x00,
+  0x00
+};
+const GuiConst_INT8U Ch000385[18] =
+{
+  3,1,0,3,3,  4,6,7,4,4,
+  0,8,
+  5,7,
+  0x66,
+  0x18,0xFF,0x18
+};
+const GuiConst_INT8U Ch000386[17] =
+{
+  3,3,3,3,2,  3,3,3,4,4,
+  2,3,
+  12,4,
+  0x06,
+  0x60,0xC0
+};
+const GuiConst_INT8U Ch000387[16] =
+{
+  3,1,0,3,3,  4,6,7,4,4,
+  0,8,
+  8,1,
+  0x00,
+  0xFF
+};
+const GuiConst_INT8U Ch000388[16] =
+{
+  3,3,3,3,3,  4,4,4,4,4,
+  3,2,
+  12,2,
+  0x02,
+  0xC0
+};
+const GuiConst_INT8U Ch000389[21] =
+{
+  1,0,0,1,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0xF4,0x02,
+  0x3C,0x66,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000390[20] =
+{
+  2,1,3,3,2,  4,4,4,4,3,
+  1,4,
+  3,11,
+  0xF0,0x07,
+  0x30,0x70,0xF0,0x30
+};
+const GuiConst_INT8U Ch000391[25] =
+{
+  1,0,1,0,3,  6,7,6,7,4,
+  0,8,
+  3,11,
+  0x08,0x02,
+  0x3C,0x66,0xC3,0x03,0x0E,0x38,0x60,0xC0,0xFF
+};
+const GuiConst_INT8U Ch000392[27] =
+{
+  1,0,4,1,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0x00,0x00,
+  0x3C,0x66,0xC3,0x03,0x06,0x0C,0x06,0x03,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000393[22] =
+{
+  2,1,0,4,3,  5,5,7,5,4,
+  0,8,
+  3,11,
+  0x54,0x06,
+  0x1C,0x3C,0x6C,0xCC,0xFF,0x0C
+};
+const GuiConst_INT8U Ch000394[24] =
+{
+  0,0,1,1,3,  7,6,7,6,4,
+  0,8,
+  3,11,
+  0xC4,0x00,
+  0xFF,0xC0,0xFC,0xE6,0x03,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000395[25] =
+{
+  2,0,0,1,3,  6,5,7,6,4,
+  0,8,
+  3,11,
+  0x80,0x01,
+  0x1E,0x30,0x60,0xC0,0xFC,0xE6,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000396[22] =
+{
+  0,3,3,2,3,  7,7,5,4,4,
+  0,8,
+  3,11,
+  0x54,0x05,
+  0xFF,0x03,0x06,0x0C,0x18,0x30
+};
+const GuiConst_INT8U Ch000397[25] =
+{
+  1,0,0,1,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0x08,0x01,
+  0x3C,0x66,0xC3,0x66,0x3C,0x66,0xC3,0x66,0x3C
+};
+const GuiConst_INT8U Ch000398[25] =
+{
+  1,0,1,1,3,  6,7,7,5,4,
+  0,8,
+  3,11,
+  0x18,0x00,
+  0x3C,0x66,0xC3,0x67,0x3F,0x03,0x06,0x0C,0x78
+};
+const GuiConst_INT8U Ch000399[18] =
+{
+  3,3,3,3,3,  4,4,4,4,4,
+  3,2,
+  6,8,
+  0xBA,
+  0xC0,0x00,0xC0
+};
+const GuiConst_INT8U Ch000400[21] =
+{
+  2,2,1,0,3,  5,5,6,7,4,
+  0,8,
+  3,11,
+  0xDA,0x04,
+  0x18,0x3C,0x66,0xFF,0xC3
+};
+const GuiConst_INT8U Ch000401[25] =
+{
+  0,0,0,0,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0x08,0x01,
+  0xFC,0xC6,0xC3,0xC6,0xFC,0xC6,0xC3,0xC6,0xFC
+};
+const GuiConst_INT8U Ch000402[21] =
+{
+  1,0,0,1,3,  7,6,6,7,4,
+  0,8,
+  3,11,
+  0xF8,0x01,
+  0x3E,0x63,0xC0,0x63,0x3E
+};
+const GuiConst_INT8U Ch000403[21] =
+{
+  0,0,0,0,3,  6,7,7,6,4,
+  0,8,
+  3,11,
+  0xF8,0x01,
+  0xFC,0xC6,0xC3,0xC6,0xFC
+};
+const GuiConst_INT8U Ch000404[21] =
+{
+  0,0,0,0,3,  7,5,5,7,4,
+  0,8,
+  3,11,
+  0x9C,0x03,
+  0xFF,0xC0,0xFC,0xC0,0xFF
+};
+const GuiConst_INT8U Ch000405[20] =
+{
+  0,0,0,0,3,  7,5,5,1,4,
+  0,8,
+  3,11,
+  0x9C,0x07,
+  0xFF,0xC0,0xFC,0xC0
+};
+const GuiConst_INT8U Ch000406[20] =
+{
+  0,0,0,0,3,  1,5,6,6,3,
+  0,7,
+  3,11,
+  0xC6,0x07,
+  0xC0,0xF8,0xEC,0xC6
+};
+const GuiConst_INT8U Ch000407[20] =
+{
+  0,0,0,0,0,  16,16,16,16,16,
+  0,17,
+  0,18,
+  0xFE,0xFF,0x03,
+  0xFF,0xFF,0x80
+};
+const GuiConst_PTR const GuiFont_ChPtrList[GuiFont_CharCnt] =
+{
+  (GuiConst_PTR)Ch000000,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000001,
+  (GuiConst_PTR)Ch000002,
+  (GuiConst_PTR)Ch000003,
+  (GuiConst_PTR)Ch000004,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000005,
+  (GuiConst_PTR)Ch000006,
+  (GuiConst_PTR)Ch000007,
+  (GuiConst_PTR)Ch000008,
+  (GuiConst_PTR)Ch000009,
+  (GuiConst_PTR)Ch000010,
+  (GuiConst_PTR)Ch000011,
+  (GuiConst_PTR)Ch000012,
+  (GuiConst_PTR)Ch000013,
+  (GuiConst_PTR)Ch000014,
+  (GuiConst_PTR)Ch000015,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000016,
+  (GuiConst_PTR)Ch000017,
+  (GuiConst_PTR)Ch000018,
+  (GuiConst_PTR)Ch000019,
+  (GuiConst_PTR)Ch000020,
+  (GuiConst_PTR)Ch000021,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000022,
+  (GuiConst_PTR)Ch000023,
+  (GuiConst_PTR)Ch000024,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000025,
+  (GuiConst_PTR)Ch000026,
+  (GuiConst_PTR)Ch000027,
+  (GuiConst_PTR)Ch000028,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000029,
+  (GuiConst_PTR)Ch000030,
+  (GuiConst_PTR)Ch000031,
+  (GuiConst_PTR)Ch000032,
+  (GuiConst_PTR)Ch000033,
+  (GuiConst_PTR)Ch000034,
+  (GuiConst_PTR)Ch000035,
+  (GuiConst_PTR)Ch000036,
+  (GuiConst_PTR)Ch000037,
+  (GuiConst_PTR)Ch000038,
+  (GuiConst_PTR)Ch000039,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000040,
+  (GuiConst_PTR)Ch000041,
+  (GuiConst_PTR)Ch000042,
+  (GuiConst_PTR)Ch000043,
+  (GuiConst_PTR)Ch000044,
+  (GuiConst_PTR)Ch000045,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000046,
+  (GuiConst_PTR)Ch000047,
+  (GuiConst_PTR)Ch000048,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000049,
+  (GuiConst_PTR)Ch000050,
+  (GuiConst_PTR)Ch000051,
+  (GuiConst_PTR)Ch000052,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000053,
+  (GuiConst_PTR)Ch000054,
+  (GuiConst_PTR)Ch000055,
+  (GuiConst_PTR)Ch000056,
+  (GuiConst_PTR)Ch000057,
+  (GuiConst_PTR)Ch000058,
+  (GuiConst_PTR)Ch000059,
+  (GuiConst_PTR)Ch000060,
+  (GuiConst_PTR)Ch000061,
+  (GuiConst_PTR)Ch000062,
+  (GuiConst_PTR)Ch000063,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000064,
+  (GuiConst_PTR)Ch000065,
+  (GuiConst_PTR)Ch000066,
+  (GuiConst_PTR)Ch000067,
+  (GuiConst_PTR)Ch000068,
+  (GuiConst_PTR)Ch000069,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000070,
+  (GuiConst_PTR)Ch000071,
+  (GuiConst_PTR)Ch000072,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000073,
+  (GuiConst_PTR)Ch000074,
+  (GuiConst_PTR)Ch000075,
+  (GuiConst_PTR)Ch000076,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000077,
+  (GuiConst_PTR)Ch000078,
+  (GuiConst_PTR)Ch000079,
+  (GuiConst_PTR)Ch000080,
+  (GuiConst_PTR)Ch000081,
+  (GuiConst_PTR)Ch000082,
+  (GuiConst_PTR)Ch000083,
+  (GuiConst_PTR)Ch000084,
+  (GuiConst_PTR)Ch000085,
+  (GuiConst_PTR)Ch000086,
+  (GuiConst_PTR)Ch000087,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000088,
+  (GuiConst_PTR)Ch000089,
+  (GuiConst_PTR)Ch000090,
+  (GuiConst_PTR)Ch000091,
+  (GuiConst_PTR)Ch000092,
+  (GuiConst_PTR)Ch000093,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000094,
+  (GuiConst_PTR)Ch000095,
+  (GuiConst_PTR)Ch000096,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000097,
+  (GuiConst_PTR)Ch000098,
+  (GuiConst_PTR)Ch000099,
+  (GuiConst_PTR)Ch000100,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000101,
+  (GuiConst_PTR)Ch000102,
+  (GuiConst_PTR)Ch000103,
+  (GuiConst_PTR)Ch000104,
+  (GuiConst_PTR)Ch000105,
+  (GuiConst_PTR)Ch000106,
+  (GuiConst_PTR)Ch000107,
+  (GuiConst_PTR)Ch000108,
+  (GuiConst_PTR)Ch000109,
+  (GuiConst_PTR)Ch000110,
+  (GuiConst_PTR)Ch000111,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000112,
+  (GuiConst_PTR)Ch000113,
+  (GuiConst_PTR)Ch000114,
+  (GuiConst_PTR)Ch000115,
+  (GuiConst_PTR)Ch000116,
+  (GuiConst_PTR)Ch000117,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000118,
+  (GuiConst_PTR)Ch000119,
+  (GuiConst_PTR)Ch000120,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000121,
+  (GuiConst_PTR)Ch000122,
+  (GuiConst_PTR)Ch000123,
+  (GuiConst_PTR)Ch000124,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000125,
+  (GuiConst_PTR)Ch000126,
+  (GuiConst_PTR)Ch000127,
+  (GuiConst_PTR)Ch000128,
+  (GuiConst_PTR)Ch000129,
+  (GuiConst_PTR)Ch000130,
+  (GuiConst_PTR)Ch000131,
+  (GuiConst_PTR)Ch000132,
+  (GuiConst_PTR)Ch000133,
+  (GuiConst_PTR)Ch000134,
+  (GuiConst_PTR)Ch000135,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000136,
+  (GuiConst_PTR)Ch000137,
+  (GuiConst_PTR)Ch000138,
+  (GuiConst_PTR)Ch000139,
+  (GuiConst_PTR)Ch000140,
+  (GuiConst_PTR)Ch000141,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000142,
+  (GuiConst_PTR)Ch000143,
+  (GuiConst_PTR)Ch000144,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000145,
+  (GuiConst_PTR)Ch000146,
+  (GuiConst_PTR)Ch000147,
+  (GuiConst_PTR)Ch000148,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000149,
+  (GuiConst_PTR)Ch000150,
+  (GuiConst_PTR)Ch000151,
+  (GuiConst_PTR)Ch000152,
+  (GuiConst_PTR)Ch000153,
+  (GuiConst_PTR)Ch000154,
+  (GuiConst_PTR)Ch000155,
+  (GuiConst_PTR)Ch000156,
+  (GuiConst_PTR)Ch000157,
+  (GuiConst_PTR)Ch000158,
+  (GuiConst_PTR)Ch000159,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000160,
+  (GuiConst_PTR)Ch000161,
+  (GuiConst_PTR)Ch000162,
+  (GuiConst_PTR)Ch000163,
+  (GuiConst_PTR)Ch000164,
+  (GuiConst_PTR)Ch000165,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000166,
+  (GuiConst_PTR)Ch000167,
+  (GuiConst_PTR)Ch000168,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000169,
+  (GuiConst_PTR)Ch000170,
+  (GuiConst_PTR)Ch000171,
+  (GuiConst_PTR)Ch000172,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000173,
+  (GuiConst_PTR)Ch000174,
+  (GuiConst_PTR)Ch000175,
+  (GuiConst_PTR)Ch000176,
+  (GuiConst_PTR)Ch000177,
+  (GuiConst_PTR)Ch000178,
+  (GuiConst_PTR)Ch000179,
+  (GuiConst_PTR)Ch000180,
+  (GuiConst_PTR)Ch000181,
+  (GuiConst_PTR)Ch000182,
+  (GuiConst_PTR)Ch000183,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000184,
+  (GuiConst_PTR)Ch000185,
+  (GuiConst_PTR)Ch000186,
+  (GuiConst_PTR)Ch000187,
+  (GuiConst_PTR)Ch000188,
+  (GuiConst_PTR)Ch000189,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000190,
+  (GuiConst_PTR)Ch000191,
+  (GuiConst_PTR)Ch000192,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000193,
+  (GuiConst_PTR)Ch000194,
+  (GuiConst_PTR)Ch000195,
+  (GuiConst_PTR)Ch000196,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000197,
+  (GuiConst_PTR)Ch000198,
+  (GuiConst_PTR)Ch000199,
+  (GuiConst_PTR)Ch000200,
+  (GuiConst_PTR)Ch000201,
+  (GuiConst_PTR)Ch000202,
+  (GuiConst_PTR)Ch000203,
+  (GuiConst_PTR)Ch000204,
+  (GuiConst_PTR)Ch000205,
+  (GuiConst_PTR)Ch000206,
+  (GuiConst_PTR)Ch000207,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000208,
+  (GuiConst_PTR)Ch000209,
+  (GuiConst_PTR)Ch000210,
+  (GuiConst_PTR)Ch000211,
+  (GuiConst_PTR)Ch000212,
+  (GuiConst_PTR)Ch000213,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000214,
+  (GuiConst_PTR)Ch000215,
+  (GuiConst_PTR)Ch000216,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000217,
+  (GuiConst_PTR)Ch000218,
+  (GuiConst_PTR)Ch000219,
+  (GuiConst_PTR)Ch000220,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000221,
+  (GuiConst_PTR)Ch000222,
+  (GuiConst_PTR)Ch000223,
+  (GuiConst_PTR)Ch000224,
+  (GuiConst_PTR)Ch000225,
+  (GuiConst_PTR)Ch000226,
+  (GuiConst_PTR)Ch000227,
+  (GuiConst_PTR)Ch000228,
+  (GuiConst_PTR)Ch000229,
+  (GuiConst_PTR)Ch000230,
+  (GuiConst_PTR)Ch000231,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000232,
+  (GuiConst_PTR)Ch000233,
+  (GuiConst_PTR)Ch000234,
+  (GuiConst_PTR)Ch000235,
+  (GuiConst_PTR)Ch000236,
+  (GuiConst_PTR)Ch000237,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000238,
+  (GuiConst_PTR)Ch000239,
+  (GuiConst_PTR)Ch000240,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000241,
+  (GuiConst_PTR)Ch000242,
+  (GuiConst_PTR)Ch000243,
+  (GuiConst_PTR)Ch000244,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000245,
+  (GuiConst_PTR)Ch000246,
+  (GuiConst_PTR)Ch000247,
+  (GuiConst_PTR)Ch000248,
+  (GuiConst_PTR)Ch000249,
+  (GuiConst_PTR)Ch000250,
+  (GuiConst_PTR)Ch000251,
+  (GuiConst_PTR)Ch000252,
+  (GuiConst_PTR)Ch000253,
+  (GuiConst_PTR)Ch000254,
+  (GuiConst_PTR)Ch000255,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000256,
+  (GuiConst_PTR)Ch000257,
+  (GuiConst_PTR)Ch000258,
+  (GuiConst_PTR)Ch000259,
+  (GuiConst_PTR)Ch000260,
+  (GuiConst_PTR)Ch000261,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000262,
+  (GuiConst_PTR)Ch000263,
+  (GuiConst_PTR)Ch000264,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000265,
+  (GuiConst_PTR)Ch000266,
+  (GuiConst_PTR)Ch000267,
+  (GuiConst_PTR)Ch000268,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000269,
+  (GuiConst_PTR)Ch000270,
+  (GuiConst_PTR)Ch000271,
+  (GuiConst_PTR)Ch000272,
+  (GuiConst_PTR)Ch000273,
+  (GuiConst_PTR)Ch000274,
+  (GuiConst_PTR)Ch000275,
+  (GuiConst_PTR)Ch000276,
+  (GuiConst_PTR)Ch000277,
+  (GuiConst_PTR)Ch000278,
+  (GuiConst_PTR)Ch000279,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000280,
+  (GuiConst_PTR)Ch000281,
+  (GuiConst_PTR)Ch000282,
+  (GuiConst_PTR)Ch000283,
+  (GuiConst_PTR)Ch000284,
+  (GuiConst_PTR)Ch000285,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000286,
+  (GuiConst_PTR)Ch000287,
+  (GuiConst_PTR)Ch000288,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000289,
+  (GuiConst_PTR)Ch000290,
+  (GuiConst_PTR)Ch000291,
+  (GuiConst_PTR)Ch000292,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000293,
+  (GuiConst_PTR)Ch000294,
+  (GuiConst_PTR)Ch000295,
+  (GuiConst_PTR)Ch000296,
+  (GuiConst_PTR)Ch000297,
+  (GuiConst_PTR)Ch000298,
+  (GuiConst_PTR)Ch000299,
+  (GuiConst_PTR)Ch000300,
+  (GuiConst_PTR)Ch000301,
+  (GuiConst_PTR)Ch000302,
+  (GuiConst_PTR)Ch000303,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000304,
+  (GuiConst_PTR)Ch000305,
+  (GuiConst_PTR)Ch000306,
+  (GuiConst_PTR)Ch000307,
+  (GuiConst_PTR)Ch000308,
+  (GuiConst_PTR)Ch000309,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000310,
+  (GuiConst_PTR)Ch000311,
+  (GuiConst_PTR)Ch000312,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000313,
+  (GuiConst_PTR)Ch000314,
+  (GuiConst_PTR)Ch000315,
+  (GuiConst_PTR)Ch000316,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000317,
+  (GuiConst_PTR)Ch000318,
+  (GuiConst_PTR)Ch000319,
+  (GuiConst_PTR)Ch000320,
+  (GuiConst_PTR)Ch000321,
+  (GuiConst_PTR)Ch000322,
+  (GuiConst_PTR)Ch000323,
+  (GuiConst_PTR)Ch000324,
+  (GuiConst_PTR)Ch000325,
+  (GuiConst_PTR)Ch000326,
+  (GuiConst_PTR)Ch000327,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000328,
+  (GuiConst_PTR)Ch000329,
+  (GuiConst_PTR)Ch000330,
+  (GuiConst_PTR)Ch000331,
+  (GuiConst_PTR)Ch000332,
+  (GuiConst_PTR)Ch000333,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000334,
+  (GuiConst_PTR)Ch000335,
+  (GuiConst_PTR)Ch000336,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000337,
+  (GuiConst_PTR)Ch000338,
+  (GuiConst_PTR)Ch000339,
+  (GuiConst_PTR)Ch000340,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000341,
+  (GuiConst_PTR)Ch000342,
+  (GuiConst_PTR)Ch000343,
+  (GuiConst_PTR)Ch000344,
+  (GuiConst_PTR)Ch000345,
+  (GuiConst_PTR)Ch000346,
+  (GuiConst_PTR)Ch000347,
+  (GuiConst_PTR)Ch000348,
+  (GuiConst_PTR)Ch000349,
+  (GuiConst_PTR)Ch000350,
+  (GuiConst_PTR)Ch000351,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000352,
+  (GuiConst_PTR)Ch000353,
+  (GuiConst_PTR)Ch000354,
+  (GuiConst_PTR)Ch000355,
+  (GuiConst_PTR)Ch000356,
+  (GuiConst_PTR)Ch000357,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000358,
+  (GuiConst_PTR)Ch000359,
+  (GuiConst_PTR)Ch000360,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000361,
+  (GuiConst_PTR)Ch000362,
+  (GuiConst_PTR)Ch000363,
+  (GuiConst_PTR)Ch000364,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000365,
+  (GuiConst_PTR)Ch000366,
+  (GuiConst_PTR)Ch000367,
+  (GuiConst_PTR)Ch000368,
+  (GuiConst_PTR)Ch000369,
+  (GuiConst_PTR)Ch000370,
+  (GuiConst_PTR)Ch000371,
+  (GuiConst_PTR)Ch000372,
+  (GuiConst_PTR)Ch000373,
+  (GuiConst_PTR)Ch000374,
+  (GuiConst_PTR)Ch000375,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000376,
+  (GuiConst_PTR)Ch000377,
+  (GuiConst_PTR)Ch000378,
+  (GuiConst_PTR)Ch000379,
+  (GuiConst_PTR)Ch000380,
+  (GuiConst_PTR)Ch000381,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000382,
+  (GuiConst_PTR)Ch000383,
+  (GuiConst_PTR)Ch000384,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000385,
+  (GuiConst_PTR)Ch000386,
+  (GuiConst_PTR)Ch000387,
+  (GuiConst_PTR)Ch000388,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000389,
+  (GuiConst_PTR)Ch000390,
+  (GuiConst_PTR)Ch000391,
+  (GuiConst_PTR)Ch000392,
+  (GuiConst_PTR)Ch000393,
+  (GuiConst_PTR)Ch000394,
+  (GuiConst_PTR)Ch000395,
+  (GuiConst_PTR)Ch000396,
+  (GuiConst_PTR)Ch000397,
+  (GuiConst_PTR)Ch000398,
+  (GuiConst_PTR)Ch000399,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000400,
+  (GuiConst_PTR)Ch000401,
+  (GuiConst_PTR)Ch000402,
+  (GuiConst_PTR)Ch000403,
+  (GuiConst_PTR)Ch000404,
+  (GuiConst_PTR)Ch000405,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000407,
+  (GuiConst_PTR)Ch000406,
+  (GuiConst_PTR)Ch000407
+};
+const GuiLib_FontRec Font_ANSI7 =
+{
+  32,
+  104,
+  0,
+  73,
+  6,11,
+  1,
+  2,4,8,
+  9,10,
+  10,10,
+  5,
+  5,
+  1,
+  1
+};
+const GuiLib_FontRec Font_ANSI7Bold =
+{
+  32,
+  104,
+  74,
+  147,
+  7,11,
+  1,
+  2,4,8,
+  10,10,
+  9,9,
+  6,
+  6,
+  1,
+  1
+};
+const GuiLib_FontRec Font_ANSI7Condensed =
+{
+  32,
+  104,
+  148,
+  221,
+  5,11,
+  1,
+  2,4,8,
+  9,10,
+  10,10,
+  4,
+  4,
+  1,
+  1
+};
+const GuiLib_FontRec Font_ANSI9 =
+{
+  32,
+  104,
+  222,
+  295,
+  9,14,
+  1,
+  3,5,11,
+  14,14,
+  14,14,
+  6,
+  7,
+  2,
+  2
+};
+const GuiLib_FontRec Font_ANSI11 =
+{
+  32,
+  104,
+  296,
+  369,
+  9,17,
+  1,
+  3,6,13,
+  15,16,
+  15,15,
+  8,
+  7,
+  2,
+  2
+};
+const GuiLib_FontRec Font_ANSI11Condensed =
+{
+  32,
+  104,
+  370,
+  443,
+  8,17,
+  1,
+  3,6,13,
+  15,16,
+  15,15,
+  7,
+  7,
+  1,
+  1
+};
+const GuiLib_FontRec Font_ANSI11Light =
+{
+  32,
+  104,
+  444,
+  517,
+  6,17,
+  1,
+  3,7,13,
+  15,16,
+  15,15,
+  5,
+  5,
+  1,
+  1
+};
+const GuiLib_FontRec Font_ANSI11AA =
+{
+  32,
+  104,
+  518,
+  591,
+  18,20,
+  4,
+  5,8,15,
+  19,19,
+  17,17,
+  8,
+  5,
+  2,
+  9
+};
+const GuiLib_FontRec Font_ANSI13 =
+{
+  32,
+  104,
+  592,
+  665,
+  11,21,
+  1,
+  4,7,16,
+  18,20,
+  18,19,
+  9,
+  9,
+  2,
+  2
+};
+const GuiLib_FontRec Font_ANSI17AA =
+{
+  32,
+  104,
+  666,
+  739,
+  24,29,
+  4,
+  6,11,22,
+  28,28,
+  25,26,
+  10,
+  7,
+  3,
+  12
+};
+const GuiLib_FontRec Font_ANSI19 =
+{
+  32,
+  104,
+  740,
+  813,
+  17,31,
+  1,
+  5,10,23,
+  25,28,
+  25,26,
+  14,
+  14,
+  3,
+  3
+};
+const GuiLib_FontRec Font_ANSI23AA =
+{
+  32,
+  104,
+  814,
+  887,
+  28,37,
+  4,
+  7,13,29,
+  36,36,
+  32,33,
+  14,
+  11,
+  4,
+  14
+};
+const GuiLib_FontRec Font_ANSI24 =
+{
+  32,
+  104,
+  888,
+  961,
+  19,39,
+  1,
+  7,14,30,
+  32,36,
+  32,33,
+  16,
+  15,
+  3,
+  3
+};
+const GuiLib_FontRec Font_ANSI30 =
+{
+  32,
+  104,
+  962,
+  1035,
+  21,47,
+  1,
+  8,18,37,
+  40,44,
+  39,41,
+  18,
+  17,
+  4,
+  3
+};
+const GuiLib_FontRec Font_Unicode7_14Bold =
+{
+  32,
+  104,
+  1036,
+  1109,
+  15,16,
+  1,
+  5,7,11,
+  14,15,
+  14,15,
+  14,
+  6,
+  2,
+  2
+};
+const GuiLib_FontRec Font_Unicode9_15 =
+{
+  32,
+  104,
+  1110,
+  1183,
+  16,17,
+  1,
+  4,6,12,
+  15,16,
+  15,16,
+  15,
+  7,
+  2,
+  2
+};
+const GuiLib_FontRec Font_Unicode11_16 =
+{
+  32,
+  104,
+  1184,
+  1257,
+  17,18,
+  1,
+  3,6,13,
+  16,17,
+  15,16,
+  16,
+  7,
+  2,
+  3
+};
+const GuiLib_FontRecPtr GuiFont_FontList[GuiFont_FontCnt] = 
+{
+  (GuiLib_FontRecPtr)&Font_ANSI7,
+  (GuiLib_FontRecPtr)&Font_ANSI7,
+  (GuiLib_FontRecPtr)&Font_ANSI7Bold,
+  (GuiLib_FontRecPtr)&Font_ANSI7Condensed,
+  (GuiLib_FontRecPtr)&Font_ANSI9,
+  (GuiLib_FontRecPtr)&Font_ANSI11,
+  (GuiLib_FontRecPtr)&Font_ANSI11Condensed,
+  (GuiLib_FontRecPtr)&Font_ANSI11Light,
+  (GuiLib_FontRecPtr)&Font_ANSI11AA,
+  (GuiLib_FontRecPtr)&Font_ANSI13,
+  (GuiLib_FontRecPtr)&Font_ANSI17AA,
+  (GuiLib_FontRecPtr)&Font_ANSI19,
+  (GuiLib_FontRecPtr)&Font_ANSI23AA,
+  (GuiLib_FontRecPtr)&Font_ANSI24,
+  (GuiLib_FontRecPtr)&Font_ANSI30,
+  (GuiLib_FontRecPtr)&Font_Unicode7_14Bold,
+  (GuiLib_FontRecPtr)&Font_Unicode9_15,
+  (GuiLib_FontRecPtr)&Font_Unicode11_16
+};
+const GuiConst_INT8U GuiFont_LanguageActive[GuiConst_LANGUAGE_CNT] =
+{
+  1
+};
+const GuiConst_INT16U GuiFont_LanguageIndex[GuiConst_LANGUAGE_CNT] =
+{
+  0
+};
+const GuiConst_INT8U GuiFont_LanguageTextDir[GuiConst_LANGUAGE_CNT] =
+{
+  GuiLib_LANGUAGE_TEXTDIR_LEFTTORIGHT
+};
+const GuiConst_INT8U GuiFont_DecimalChar[GuiConst_LANGUAGE_CNT] =
+{
+  GuiLib_DECIMAL_PERIOD
+};
+
+
+// --------------------------  CUSTOM SECTION  ---------------------------
+
+// My own code is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+
+// My own footer is inserted here - edit it in the C code generation window
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/GuiFont.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,81 @@
+// My own header is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+//
+//                            *** ATTENTION ***
+//
+//   This file is maintained by the easyGUI Graphical User Interface
+//   program. Modifications should therefore not be made directly in
+//   this file, as the changes will be lost next time easyGUI creates
+//   the file.
+//
+//                            *** ATTENTION ***
+//
+// -----------------------------------------------------------------------
+
+//
+// Generated by easyGUI version 6.0.9.005
+// Generated for project SinglePhoto_QSPI
+// in project file C:\Single Photo QSPI EasyGUI application\SinglePhoto_QSPI.gui
+//
+
+// Ensure that this header file is only included once
+#ifndef __GUIFONT_H
+#define __GUIFONT_H
+
+// --------------------------  INCLUDE SECTION  --------------------------
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+
+// ---------------------  GLOBAL DECLARATION SECTION  --------------------
+
+#define GuiFont_CharCnt  1258
+extern const GuiConst_PTR const GuiFont_ChPtrList[GuiFont_CharCnt];
+
+// Fonts
+// =====
+
+#define GuiFont_DEFAULT_TEXT_FONT      0
+
+#define GuiFont_ANSI7                  1
+#define GuiFont_ANSI7Bold              2
+#define GuiFont_ANSI7Condensed         3
+#define GuiFont_ANSI9                  4
+#define GuiFont_ANSI11                 5
+#define GuiFont_ANSI11Condensed        6
+#define GuiFont_ANSI11Light            7
+#define GuiFont_ANSI11AA               8
+#define GuiFont_ANSI13                 9
+#define GuiFont_ANSI17AA               10
+#define GuiFont_ANSI19                 11
+#define GuiFont_ANSI23AA               12
+#define GuiFont_ANSI24                 13
+#define GuiFont_ANSI30                 14
+#define GuiFont_Unicode7_14Bold        15
+#define GuiFont_Unicode9_15            16
+#define GuiFont_Unicode11_16           17
+
+#define GuiFont_FontCnt  18
+extern const GuiLib_FontRecPtr GuiFont_FontList[GuiFont_FontCnt];
+
+extern const GuiConst_INT8U GuiFont_LanguageActive[GuiConst_LANGUAGE_CNT];
+
+extern const GuiConst_INT16U GuiFont_LanguageIndex[GuiConst_LANGUAGE_CNT];
+
+extern const GuiConst_INT8U GuiFont_LanguageTextDir[GuiConst_LANGUAGE_CNT];
+
+extern const GuiConst_INT8U GuiFont_DecimalChar[GuiConst_LANGUAGE_CNT];
+
+
+// --------------------------  CUSTOM SECTION  ---------------------------
+
+// My own code is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+
+#endif
+
+// -----------------------------------------------------------------------
+
+// My own footer is inserted here - edit it in the C code generation window
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/GuiStruct.c	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,68 @@
+// My own header is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+//
+//                            *** ATTENTION ***
+//
+//   This file is maintained by the easyGUI Graphical User Interface
+//   program. Modifications should therefore not be made directly in
+//   this file, as the changes will be lost next time easyGUI creates
+//   the file.
+//
+//                            *** ATTENTION ***
+//
+// -----------------------------------------------------------------------
+
+//
+// Generated by easyGUI version 6.0.9.005
+// Generated for project SinglePhoto_QSPI
+// in project file C:\Single Photo QSPI EasyGUI application\SinglePhoto_QSPI.gui
+//
+
+// --------------------------  INCLUDE SECTION  --------------------------
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+
+// ---------------------  GLOBAL DECLARATION SECTION  --------------------
+
+const GuiConst_INT8U GuiStruct_00000[1] =
+{
+  0
+};
+const GuiConst_PTR const GuiStruct_StructPtrList[GuiStruct_StructCnt] =
+{
+  (GuiConst_PTR)GuiStruct_00000
+};
+const GuiConst_INT16U GuiStruct_StructNdxList[GuiStruct_StructCnt] =
+{
+  0
+};
+const GuiConst_PTR const GuiStruct_VarPtrList[GuiStruct_VarPtrCnt] =
+{
+  0
+};
+
+const GuiConst_INT8U GuiStruct_VarTypeList[GuiStruct_VarPtrCnt] =
+{
+  0
+};
+
+const GuiConst_PTR const GuiStruct_BitmapPtrList[GuiStruct_BitmapCnt] =
+{
+  0
+};
+
+const GuiConst_INTCOLOR GuiStruct_ColorTable[GuiStruct_ColorTableCnt] =
+{
+  27437
+};
+
+
+// --------------------------  CUSTOM SECTION  ---------------------------
+
+// My own code is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+
+// My own footer is inserted here - edit it in the C code generation window
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/GuiStruct.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,122 @@
+// My own header is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+//
+//                            *** ATTENTION ***
+//
+//   This file is maintained by the easyGUI Graphical User Interface
+//   program. Modifications should therefore not be made directly in
+//   this file, as the changes will be lost next time easyGUI creates
+//   the file.
+//
+//                            *** ATTENTION ***
+//
+// -----------------------------------------------------------------------
+
+//
+// Generated by easyGUI version 6.0.9.005
+// Generated for project SinglePhoto_QSPI
+// in project file C:\Single Photo QSPI EasyGUI application\SinglePhoto_QSPI.gui
+//
+
+// Ensure that this header file is only included once
+#ifndef __GUISTRUCT_H
+#define __GUISTRUCT_H
+
+// --------------------------  INCLUDE SECTION  --------------------------
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+
+// ---------------------  GLOBAL DECLARATION SECTION  --------------------
+
+// CLASS Base
+// ==========
+
+#define GuiStruct_Demo_0                         0
+// Internal sub-assemblies
+// =======================
+
+#define GuiStructCOMP_CBFLAT                     1
+#define GuiStructCOMP_CBFLATTRANSP               2
+#define GuiStructCOMP_CB3D                       3
+#define GuiStructCOMP_CB3DINNER                  4
+#define GuiStructCOMP_CBMCHSMALL                 5
+#define GuiStructCOMP_CBMCHBIG                   6
+#define GuiStructCOMP_CBMCRFLSMALL               7
+#define GuiStructCOMP_CBMCR3DSMALL               8
+#define GuiStructCOMP_CBMCRBIG                   9
+#define GuiStructCOMP_CBMFIFLAT                  10
+#define GuiStructCOMP_CBMFI3D                    11
+#define GuiStructCOMP_RBFLAT                     12
+#define GuiStructCOMP_RBFLATTRANSP               13
+#define GuiStructCOMP_RB3D                       14
+#define GuiStructCOMP_RB3DINNER                  15
+#define GuiStructCOMP_RBMFLAT                    16
+#define GuiStructCOMP_RBM3D                      17
+#define GuiStructCOMP_RBMSQUA                    18
+#define GuiStructCOMP_BUFLAT0                    19
+#define GuiStructCOMP_BUFLAT1                    20
+#define GuiStructCOMP_BUFLAT2                    21
+#define GuiStructCOMP_BUFLATR0                   22
+#define GuiStructCOMP_BUFLATR1                   23
+#define GuiStructCOMP_BUFLATR2                   24
+#define GuiStructCOMP_BU3D0                      25
+#define GuiStructCOMP_BU3D1                      26
+#define GuiStructCOMP_BU3D2                      27
+#define GuiStructCOMP_BU3DR0                     28
+#define GuiStructCOMP_BU3DR1                     29
+#define GuiStructCOMP_BU3DR2                     30
+#define GuiStructCOMP_EBFLAT                     31
+#define GuiStructCOMP_EB3D                       32
+#define GuiStructCOMP_PAFLAT                     33
+#define GuiStructCOMP_PAFLATR                    34
+#define GuiStructCOMP_PAFLATTRANSP               35
+#define GuiStructCOMP_PAFLATTRANSPR              36
+#define GuiStructCOMP_PA3DRAIS                   37
+#define GuiStructCOMP_PA3DRAISR                  38
+#define GuiStructCOMP_PA3DLOW                    39
+#define GuiStructCOMP_PA3DLOWR                   40
+#define GuiStructCOMP_PA3DINNER                  41
+#define GuiStructCOMP_PA3DINNERR                 42
+#define GuiStructCOMP_PAEMBRAIS                  43
+#define GuiStructCOMP_PAEMBLOW                   44
+#define GuiStructCOMP_MMFLAT                     45
+#define GuiStructCOMP_MM3D                       46
+#define GuiStructCOMP_LBFLAT                     47
+#define GuiStructCOMP_LB3D                       48
+#define GuiStructCOMP_COFLAT                     49
+#define GuiStructCOMP_CO3D                       50
+#define GuiStructCOMP_SAFLAT                     51
+#define GuiStructCOMP_SA3D                       52
+#define GuiStructCOMP_PBFLAT                     53
+#define GuiStructCOMP_PB3D                       54
+
+#define GuiStruct_StructCnt  1
+extern const GuiConst_PTR const GuiStruct_StructPtrList[GuiStruct_StructCnt];
+extern const GuiConst_INT16U GuiStruct_StructNdxList[GuiStruct_StructCnt];
+
+#define GuiStruct_VarPtrCnt  1
+extern const GuiConst_PTR const GuiStruct_VarPtrList[GuiStruct_VarPtrCnt];
+
+extern const GuiConst_INT8U GuiStruct_VarTypeList[GuiStruct_VarPtrCnt];
+
+
+#define GuiStruct_BitmapCnt  1
+extern const GuiConst_PTR const GuiStruct_BitmapPtrList[GuiStruct_BitmapCnt];
+
+#define GuiStruct_ColorTableCnt  1
+extern const GuiConst_INTCOLOR GuiStruct_ColorTable[GuiStruct_ColorTableCnt];
+
+
+// --------------------------  CUSTOM SECTION  ---------------------------
+
+// My own code is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+
+#endif
+
+// -----------------------------------------------------------------------
+
+// My own footer is inserted here - edit it in the C code generation window
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/GuiVar.c	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,43 @@
+// My own header is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+//
+//                            *** ATTENTION ***
+//
+//   This file is maintained by the easyGUI Graphical User Interface
+//   program. Modifications should therefore not be made directly in
+//   this file, as the changes will be lost next time easyGUI creates
+//   the file.
+//
+//                            *** ATTENTION ***
+//
+// -----------------------------------------------------------------------
+
+//
+// Generated by easyGUI version 6.0.9.005
+// Generated for project SinglePhoto_QSPI
+// in project file C:\Single Photo QSPI EasyGUI application\SinglePhoto_QSPI.gui
+//
+
+// --------------------------  INCLUDE SECTION  --------------------------
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+
+// ---------------------  GLOBAL DECLARATION SECTION  --------------------
+
+
+GuiConst_INT16S    GuiVarCompInt1;
+GuiConst_INT16S    GuiVarCompInt2;
+GuiConst_INT16S    GuiVarCompInt3;
+GuiConst_INT16S    GuiVarCompInt4;
+GuiConst_INT16S    GuiVarCompInt5;
+
+
+// --------------------------  CUSTOM SECTION  ---------------------------
+
+// My own code is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+
+// My own footer is inserted here - edit it in the C code generation window
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/GuiVar.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,58 @@
+// My own header is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+//
+//                            *** ATTENTION ***
+//
+//   This file is maintained by the easyGUI Graphical User Interface
+//   program. Modifications should therefore not be made directly in
+//   this file, as the changes will be lost next time easyGUI creates
+//   the file.
+//
+//                            *** ATTENTION ***
+//
+// -----------------------------------------------------------------------
+
+//
+// Generated by easyGUI version 6.0.9.005
+// Generated for project SinglePhoto_QSPI
+// in project file C:\Single Photo QSPI EasyGUI application\SinglePhoto_QSPI.gui
+//
+
+// Ensure that this header file is only included once
+#ifndef __GUIVAR_H
+#define __GUIVAR_H
+
+// --------------------------  INCLUDE SECTION  --------------------------
+
+#include "GuiConst.h"
+#include "GuiLib.h"
+
+// ---------------------  GLOBAL DECLARATION SECTION  --------------------
+
+// Positions
+// =========
+
+
+// Variables
+// =========
+
+
+extern GuiConst_INT16S    GuiVarCompInt1;
+extern GuiConst_INT16S    GuiVarCompInt2;
+extern GuiConst_INT16S    GuiVarCompInt3;
+extern GuiConst_INT16S    GuiVarCompInt4;
+extern GuiConst_INT16S    GuiVarCompInt5;
+
+
+// --------------------------  CUSTOM SECTION  ---------------------------
+
+// My own code is inserted here - edit it in the C code generation window
+
+// -----------------------------------------------------------------------
+
+#endif
+
+// -----------------------------------------------------------------------
+
+// My own footer is inserted here - edit it in the C code generation window
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/easyGUIUpdated/VarInit.h	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,3 @@
+// Variable initialization values for project:
+// C:\Single Photo EasyGUI Application\SinglePhoto.gui
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 28 14:40:43 2017 +0000
@@ -0,0 +1,154 @@
+#include "mbed.h"
+#include "DMBoard.h"
+#include "lpc_swim.h"
+#include "lpc_swim_font.h"
+
+#include "GuiLib.h"
+#include "GuiDisplay.h"
+
+#include "QSPIBitmap.h"
+
+// Use QSPI - uncomment '#define DM_BOARD_USE_QSPI' in dm_board_config.h, and:
+#include "QSPIFileSystem.h"
+QSPIFileSystem qspifs("qspi");
+// Can now use QSPI memory as file device '/qspi/'
+//
+
+/*
+    Bodge so GuiDisplay.c ('easyGUIFixed' file) can call Thread::wait 
+    (giving it an accurate millisecond timer)
+*/
+extern "C" {
+    void EasyGUIWaitMs(GuiConst_INT32U msec)
+    {
+        Thread::wait(msec);
+    }
+}
+
+// Defined in GuiDisplay.c - set the display frame address at runtime
+extern "C" {
+    void GuiDisplay_SetFrameAddress(void *newFrameAddress);
+}
+
+/*
+    Displays the specified easyGUI 'structure' (or page, to use a more easily understood term).
+    
+    Args are: the index of the structure to be displayed,
+              
+    No return code.
+*/
+void DisplayEasyGuiStructure(int structureIndex, QSPIBitmap* bitmapToDisplay, GuiConst_INT16S bitmapX, GuiConst_INT16S bitmapY)
+{
+    GuiLib_Clear(); // Don't need this if we have drawn the background bitmap - it covers the entire screen
+
+    GuiLib_ShowScreen(structureIndex, GuiLib_NO_CURSOR, GuiLib_RESET_AUTO_REDRAW);
+                   
+    if(bitmapToDisplay != NULL) {     
+        bitmapToDisplay->DisplayAt(bitmapX, bitmapY, -1); // No transparent colour
+    }
+
+    GuiLib_Refresh();
+
+} // End of "DisplayEasyGUIStructure"
+
+/*
+    Sets up the easyGUI user interface in an acceptable initial state.
+
+    No return code.
+*/
+void InitEasyGUIDisplay(int initialEasyGUIPage, QSPIBitmap* bitmapToDisplay, GuiConst_INT16S bitmapX, GuiConst_INT16S bitmapY)
+{
+    // easyGUI stuff - note function calls require 'extern "C"' in relevant header
+    
+    GuiDisplay_Lock();
+    
+    GuiLib_Init();
+  
+    DisplayEasyGuiStructure(initialEasyGUIPage, bitmapToDisplay, bitmapX, bitmapY);
+    
+    GuiDisplay_Unlock();
+}
+
+
+void InitialiseLPC4088(DMBoard* board, void **frameBufferAddress1, void **frameBufferAddress2)
+{
+    RtosLog* log = board->logger();
+    Display* disp = board->display();
+  
+    DMBoard::BoardError err;
+
+    do {
+        err = board->init();
+        if (err != DMBoard::Ok) {
+            log->printf("Failed to initialize the board, got error %d\r\n", err);
+            break;
+        }
+       
+
+#define COLOR_FLICKERING_FIX_1
+#ifdef COLOR_FLICKERING_FIX_1
+        // Possible fix for display flickering on LPC4088
+        uint32_t* reg = ((uint32_t*)0x400fc188);
+        *reg |= (3<<10);
+#undef COLOR_FLICKERING_FIX_1
+#endif
+        log->printf("\n\nHello World!\n\n");
+    
+        void* fb = disp->allocateFramebuffer();
+        if (fb == NULL) {
+            log->printf("Failed to allocate memory for a frame buffer\r\n");
+            err = DMBoard::MemoryError;
+            break;
+        }
+    
+        *frameBufferAddress1 = fb;
+
+        // Allocate a second frame buffer - what will its address be?
+        void* fb2 = disp->allocateFramebuffer();
+        *frameBufferAddress2 = fb2;
+                
+        Display::DisplayError disperr;
+//      disperr = disp->powerUp(fb, Display::Resolution_24bit_rgb888);
+        // Start display in default mode (16-bit) (24-bit uses too much memory)
+#define COLOR_FLICKERING_FIX_2
+#ifdef COLOR_FLICKERING_FIX_2
+        // Second possible fix for colour flickering problem,
+        // suggested by Embedded Artists - specify low frame rate
+        disp->powerDown();
+        disperr = disp->powerUp(fb, Display::Resolution_16bit_rgb565, FrameRate_Low);
+#undef COLOR_FLICKERING_FIX_2
+#else
+        disperr = disp->powerUp(fb);
+#endif
+        if (disperr != Display::DisplayError_Ok) {
+            log->printf("Failed to initialize the display, got error %d\r\n", disperr);
+            break;
+        }
+        
+    } while(false);
+
+    if (err != DMBoard::Ok) {
+        log->printf("\nTERMINATING\n");
+        wait_ms(2000); // allow RtosLog to flush messages
+        mbed_die();
+    }  
+}
+
+int main()
+{
+    DMBoard* board = &DMBoard::instance();
+    RtosLog* log = board->logger();
+    Display* disp = board->display();
+    
+    QSPIBitmap* singlePhotoBitmap = new QSPIBitmap("GuiStruct_Bitmap_DSC_1836Reduced");
+
+    void *frameBuffer1;
+    void *frameBuffer2;
+    InitialiseLPC4088(board, &frameBuffer1, &frameBuffer2);
+    GuiDisplay_SetFrameAddress(frameBuffer1);
+  
+    InitEasyGUIDisplay(GuiStruct_Demo_0, singlePhotoBitmap, 40, 0);
+    
+    while(true) {
+    }   
+}