コード例 #1
0
ファイル: ZDrOpt.cpp プロジェクト: arksoftgit/10c
// Function to delete the option data.
void
fnDeleteOptionObject( ZOption *pZOption,
                      WPARAM wParam,
                      LPARAM lParam )
{
   mDeleteInit( pZOption );
}
コード例 #2
0
ファイル: ZDrOpt.cpp プロジェクト: arksoftgit/10c
void
ZSubtask::AddBarTip( HWND hWnd, zLONG lFirstId, zLONG lLastId )
{
   ZBarTip *pBarTip;
   zSHORT nPos = m_nBarTipCnt;

   while ( nPos )
   {
      nPos--;
      pBarTip = m_BarTipList[ nPos ];
      if ( pBarTip->m_hWnd == hWnd )
      {
         pBarTip->m_lFirstId = lFirstId;
         pBarTip->m_lLastId = lLastId;
         return;
      }
      else
      if ( mIs_hWnd( pBarTip->m_hWnd ) == FALSE )
      {
         m_BarTipList.RemoveAt( nPos );
         m_nBarTipCnt--;
         nPos = m_nBarTipCnt;
         mDeleteInit( pBarTip );
      }
   }

   pBarTip = new ZBarTip( hWnd, lFirstId, lLastId );
   m_BarTipList.SetAtGrow( m_nBarTipCnt++, pBarTip );
}
コード例 #3
0
ファイル: ZDrOLE.cpp プロジェクト: DeegC/ZeidonTools
ZDrOleClient::~ZDrOleClient( )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZDrOleClient::~ZDrOleClient dtor", "" );
#endif

   // TODO: add cleanup code here
   mDeleteInit( m_pDispatchInstance );
}
コード例 #4
0
ファイル: ZDrOpt.cpp プロジェクト: arksoftgit/10c
void
ZSubtask::CleanupBarTips( )
{
   ZBarTip *pBarTip;
   while ( m_nBarTipCnt > 0 )
   {
      m_nBarTipCnt--;
      pBarTip = m_BarTipList[ m_nBarTipCnt ];
      mDeleteInit( pBarTip );
   }
}
コード例 #5
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
// ZCheckBox - dtor
ZCheckBox::~ZCheckBox( )
{
// TraceLineS( "ZCheckBox::~ZCheckBox", "" );
   if ( mIs_hWnd( m_hWnd ) )
      DestroyWindow( );

   mDeleteInit( m_pzsValueOn );
   mDeleteInit( m_pzsValueOff );
   m_clr = CLR_INVALID;
   for ( int k = 0; k < 6; k++ )
   {
      if ( m_bitmaps[ k ] )
      {
         DeleteObject( m_bitmaps[ k ] );  // it was subscript 0???
         m_bitmaps[ k ] = 0;
      }
   }

// DeleteObject( m_pFont );
}
コード例 #6
0
ファイル: ZdCtlHDN.cpp プロジェクト: DeegC/10d
void
ZHD_Node::EraseNode( )
{
   CRect    rect;
   CBrush   *pBrush;
   CPen     *pPen;
   zBOOL    bRelease;

   // Erase the rectangle containing the entity
   rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
   rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
   rect.right  = rect.left + (tzHDNODEX * tzHDCELLSIZE) - 1;
   rect.bottom = rect.top  + (tzHDNODEY * tzHDCELLSIZE) - 1;

   if ( m_pHD_Diagram->m_hDC == 0 )
   {
      m_pHD_Diagram->GetDeviceContext( );
      bRelease = TRUE;
   }
   else
      bRelease = FALSE;

   // Unpaint the nodes line
   DrawNodeLine( 1 );

   // Now un-paint the rectangle where the entity was
   pBrush = new CBrush( tzHDCOLORBACKGROUND );
   pPen   = new CPen( PS_SOLID, 1, tzHDCOLORBACKGROUND );
   CPen *pPenOld = m_pHD_Diagram->m_hDC->SelectObject( pPen );
   CBrush *pBrushOld = m_pHD_Diagram->m_hDC->SelectObject( pBrush );

   m_pHD_Diagram->m_hDC->Rectangle( rect );

   m_pHD_Diagram->m_hDC->SelectObject( pPenOld );
   m_pHD_Diagram->m_hDC->SelectObject( pBrushOld );
   mDeleteInit( pBrush );
   mDeleteInit( pPen );

   if ( bRelease )
      m_pHD_Diagram->ReleaseDeviceContext( );
}
コード例 #7
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
int
ZCheckBox::OnCreate( LPCREATESTRUCT lpCreateStruct )
{
// TraceLineS( "ZCheckBox::OnCreate", "" );

   int nRC = (int) Default( );
   if ( nRC == -1 )
      return( -1 );

   LOGFONT lf;

   mDeleteInit( m_pFont );
   m_pFont = new CFont;
   ::GetObject( (HFONT) GetStockObject( DEFAULT_GUI_FONT ),
                                        sizeof( lf ), &lf );
   m_pFont->CreateFontIndirect( &lf );
   SetFontOverride( );
   return( nRC );
}
コード例 #8
0
ファイル: Z2MP.cpp プロジェクト: arksoftgit/10c
ZMapPointApp::~ZMapPointApp( )
{
   // TODO: add construction code here,
   // Place all significant initialization in InitInstance
   mDeleteInit( m_pMapPointApp );
}
コード例 #9
0
ファイル: ZdCtlMLE.cpp プロジェクト: DeegC/ZeidonTools
// ZMLE - ctor
ZMLE::ZMLE( ZSubtask *pZSubtask,
            CWnd     *pWndParent,
            ZMapAct  *pzmaComposite,
            zVIEW    vDialog,
            zSHORT   nOffsetX,
            zSHORT   nOffsetY,
            zKZWDLGXO_Ctrl_DEF *pCtrlDef ) :
      CEdit( ),
      ZMapAct( pZSubtask,        // base class ctor
               pzmaComposite,
               pWndParent,
               this,
               vDialog,
               nOffsetX,
               nOffsetY,
               pCtrlDef,
               "MLE" )
{
#ifdef DEBUG_ALL
   TraceLineI( "In ctor for ZMLE", (zLONG) this );
   if ( m_pzsVName )
   {
      TraceLineS( "ZMLE ViewName", *m_pzsVName );
      TraceLineS( "ZMLE Entity", *m_pzsEName );
      TraceLineS( "ZMLE Attribute", *m_pzsAName );
   }
#endif

   m_ulLth = 0;
   if ( m_ulMapActFlags & zMAPACT_USE_SUBTASK_BRUSH )
   {
      mDeleteInit( m_pBrush );
      m_clrBk = 0;
   }

   if ( pCtrlDef->Subtype & zCONTROL_SIZEABLEBORDER )
      Attr.Style |= WS_THICKFRAME;
   else
   if ( (pCtrlDef->Subtype & zCONTROL_BORDEROFF) )
      Attr.Style &= ~WS_BORDER;
   else
      Attr.Style |= WS_BORDER;

   if ( pCtrlDef->Subtype & zCONTROL_NOTABSTOP )
      Attr.Style &= ~WS_TABSTOP;
   else
      Attr.Style |= WS_TABSTOP;

   Attr.Style &= ~(WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL);
   Attr.Style |= ES_AUTOVSCROLL | WS_VSCROLL;
   Attr.Style |= ES_MULTILINE | ES_WANTRETURN;

   if ( pCtrlDef->Subtype & zEDITBOX_LOWERCASE )
      Attr.Style |= ES_LOWERCASE;

   if ( pCtrlDef->Subtype & zEDITBOX_UPPERCASE )
      Attr.Style |= ES_UPPERCASE;

#ifndef zREMOTE_SERVER
   if ( pzmaComposite == 0 ||
        (pzmaComposite->m_ulMapActFlag2 & zMAPACT_CREATE_CHILDREN) )
#endif
   {
      CreateZ( );
   }
}
コード例 #10
0
ファイル: ZDrVCtrl.cpp プロジェクト: DeegC/ZeidonTools
zOPER_EXPORT void OPERATION
DeleteMemoryHandle( zLONG hMemory )
{
   ZDrMemory *pMemory = (ZDrMemory *) hMemory;
   mDeleteInit( pMemory );
}
コード例 #11
0
ファイル: ZDrCtl.cpp プロジェクト: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
//   bSubcontrol - TRUE  - add controls to existing pZSubtask->m_pZMIXCtrl
//                 FALSE - delete existing pZSubtask->m_pZMIXCtrl and start
//                         a new list
//
/////////////////////////////////////////////////////////////////////////////
void OPERATION
CreateZeidonCtrls( zVIEW    vSubobject,
                   ZSubtask *pZSubtask,
                   CWnd     *pWndParent,
                   ZMapAct  *pzmaComposite,
                   zSHORT   nOffsetX,
                   zSHORT   nOffsetY,
                   zBOOL    bSubcontrol )
{
   zKZWDLGXO_Ctrl_DEF CtrlDef;
   zFARPROC_CONTROL lpfnCtrlProc;
   LPLIBRARY hCCtlLibrary;
   zPCHAR    pchDLL_Name;
   zPCHAR    pchCOP;
   zSHORT    nRC;

#ifdef DEBUG_ALL
   TraceLineX( "CreateZeidonCtrls parent - ", (zLONG) pZSubtask );
#endif

   nRC = CheckExistenceOfEntity( vSubobject, szlCtrl );
   if ( bSubcontrol == FALSE )
   {
      mDeleteInit( pZSubtask->m_pZMIXCtrl );
      if ( nRC > zCURSOR_UNCHANGED )
      {
         zLONG  lTempCtrlCnt;       // just to get the long temporarily

         GetIntegerFromAttribute( &lTempCtrlCnt, pZSubtask->m_vDialog,
                                  szlWnd, "CtrlCnt" );
//       TraceLineI( "CreateZeidonCtrls count ", lTempCtrlCnt );
         pZSubtask->m_pZMIXCtrl =
                     new ZMultiIdxSet( (fnCOMPARE) fnCompareCtrlNodes,
                                       (fnCOMPARE) fnSeekCtrlNode,
                                       lTempCtrlCnt );
         // Instead of having ZMultiIdxSet delete the nodes itself, we call
         // a recursive routine (fnDeleteCtrls) to guarantee the child
         // controls are deleted before their parents.
      }
      else
         pZSubtask->m_pZMIXCtrl = 0;

      CreateViewFromViewForTask( &(pZSubtask->m_vPE),
                                 pZSubtask->m_pZTask->m_vPE,
                                 pZSubtask->m_vDialog );
   }

#ifdef DEBUG_LODSTRUCT
   zmemset( CtrlDef.Tag, 0xFE, sizeof( CtrlDef ) );
// CtrlDef.CheckByte = 0xFE;
#endif
   while ( nRC > zCURSOR_UNCHANGED )
   {
      // Get the structure of attributes for this control.
      zPCHAR pch = 0;   // for derived Text attribute

      GetStructFromEntityAttrs( (zPCHAR) CtrlDef.Tag, vSubobject, szlCtrl );
#ifdef DEBUG_LODSTRUCT
      if ( CtrlDef.CheckByte != 0xFE )
         MessageBox( 0, "CtrlDef Structure Length Error",
                     "GetStructFromEntityAttrs", MB_OK );
   // zPCHAR pchCheckByte = (zPCHAR) &(CtrlDef.CheckByte);
   // pchCheckByte--;
   // if ( *pchCheckByte == (char) 0xFE )
   //    TraceLineS( "zdrctl CtrlDef CheckByte error??", "" );
#endif
      GetAddrForAttribute( (zPCHAR *) &pch, vSubobject, szlCtrl, szlD_Text );
      if ( *pch )
         zstrcpy( CtrlDef.Text, pch );

#ifdef DEBUG_ALL
      TraceLineS( "Tag ", CtrlDef.Tag );
      TraceLineI( "Type ", CtrlDef.Type );
      TraceLineI( "IdNbr ", CtrlDef.IdNbr );
      TraceLineI( "PSDLG_X ", CtrlDef.PSDLG_X );
      TraceLineI( "PSDLG_Y ", CtrlDef.PSDLG_Y );
      TraceLineI( "SZDLG_X ", CtrlDef.SZDLG_X );
      TraceLineI( "SZDLG_Y ", CtrlDef.SZDLG_Y );
#endif

      // The token is validated by the painter and/or conversion to
      // the executable object, but we check here anyway.
      nRC = SetCursorFirstEntityByInteger( pZSubtask->m_pZTask->m_vPE,
                                           szlCtrl, szlKey,
                                           CtrlDef.Type, 0 );
      if ( nRC != zCURSOR_SET )
      {
         TraceLine( "(drvr) ID (%d) not found (%d) in PPE for Ctrl: %s.%s.%s",
                    CtrlDef.Type, nRC,
                    pZSubtask->m_pzsDlgTag ? *(pZSubtask->m_pzsDlgTag) : "?",
                    pZSubtask->m_pzsWndTag ? *(pZSubtask->m_pzsWndTag) : "?",
                    CtrlDef.Tag );
         DisplayEntityInstance( pZSubtask->m_pZTask->m_vPE, szlCtrl );
         DisplayObjectInstance( pZSubtask->m_pZTask->m_vPE, 0, 0 );

         // Skip this one and try the next.
         nRC = SetCursorNextEntity( vSubobject, szlCtrl, 0 );
         continue;
      }

      GetAddrForAttribute( (zPCHAR *) &pchDLL_Name,
                           pZSubtask->m_pZTask->m_vPE, szlCtrl, szlDLL );
      GetAddrForAttribute( (zPCHAR *) &pchCOP,
                           pZSubtask->m_pZTask->m_vPE, szlCtrl, szlCOP );

      // If the DLL name is added to the list, this is the first time it
      // has been encountered ... so call its initialization routine.
      pZSubtask->m_pZTask->AddApplicationDLL( pZSubtask, pchDLL_Name );

      hCCtlLibrary = 0;  // set to zero for GetOperationDynamicCallAddress

      lpfnCtrlProc = (zFARPROC_CONTROL)
           GetOperationDynamicCallAddress( pZSubtask->m_vDialog,
                                           (LPLPLIBRARY) &hCCtlLibrary,
                                           pchDLL_Name, pchCOP,
                                           "(drvr) Ctrl" );

      try
      {
         if ( lpfnCtrlProc ) // && (k % 2) == 0 )
         {
//          TraceLineS( "Create Control: ", pchCOP );
            (*lpfnCtrlProc)( pZSubtask, pWndParent, pzmaComposite,
                             vSubobject, nOffsetX, nOffsetY, &CtrlDef );
         }
      }
#if 0
      catch( CResourceException *e )
      {
         zCHAR szMsg[ 256 ];
         e->GetErrorMessage( szMsg, sizeof( szMsg ) );
         zstrcat( szMsg,
      }
#endif
      catch( CException *e )
      {
         zCHAR szMsg[ 256 ];

         e->GetErrorMessage( szMsg, sizeof( szMsg ) );
         MessageSend( pZSubtask->m_vDialog, 0, "Zeidon Control", szMsg,
                      zMSGQ_MODAL_ERROR, FALSE );
         break;
      }

      nRC = SetCursorNextEntity( vSubobject, szlCtrl, 0 );

   }  // end of: while ( nRC == zCURSOR_UNCHANGED )  looping thru controls

   if ( bSubcontrol == FALSE )
   {
      DropView( pZSubtask->m_vPE );
      pZSubtask->m_vPE = 0;  // using this to determine Ctrls have been created

      // Ctrl creation is complete ... notify each ctrl.
      if ( pZSubtask->m_pZMIXCtrl )
      {
         pZSubtask->m_pZMIXCtrl->VisitInorder( (fnVISIT_INORDER) fnPostCreateCtrls,
                                               0, 0, 0 );
      }
   }
}
コード例 #12
0
ファイル: ZdCtlHDN.cpp プロジェクト: DeegC/10d
zSHORT
ZHD_Node::DrawNodeLine( zBOOL bErase )
{
   CPen   *pPen;
   CRect  rect;
   zBOOL  bRelease;
   CPoint point1;

   // Now that the node has been drawn, draw the line to the parent node if the node exists
   if ( m_pParentNode )
   {
      if ( m_pHD_Diagram->m_hDC == 0 )
      {
         m_pHD_Diagram->GetDeviceContext( );
         bRelease = TRUE;
      }
      else
         bRelease = FALSE;

      if ( m_pHD_Diagram->m_bPrintDC )
         pPen = new CPen( PS_SOLID, 1, tzHDCOLORBLACK );
      else
      if ( bErase )
         pPen = new CPen( PS_SOLID, 1, tzHDCOLORBACKGROUND );
      else
         pPen = new CPen( PS_SOLID, 1, tzHDCOLORLINES );

      rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
      rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
      rect.right  = rect.left + (tzHDNODEX * tzHDCELLSIZE) - 1;
      rect.bottom = rect.top  + (tzHDNODEY * tzHDCELLSIZE) - 1;
      if ( m_pHD_Diagram->m_bOrientation == 0 )
      {
         if ( m_bHidden )
            point1.x = rect.left + (tzHDCELLSIZE / 2);
         else
            point1.x = (rect.left + rect.right) / 2;

         point1.y = rect.top;
      }
      else
      {
         point1.x = rect.left;
         if ( m_bHidden )
            point1.y = rect.top + (tzHDCELLSIZE / 2);
         else
            point1.y = (rect.top + rect.bottom) / 2;
      }

      m_pHD_Diagram->m_hDC->MoveTo( point1.x, point1.y );
      rect.left = (m_pParentNode->PosX( ) - m_pParentNode->PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
      rect.top  = (m_pParentNode->PosY( ) - m_pParentNode->PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
      rect.right  = rect.left + (tzHDNODEX * tzHDCELLSIZE) - 1;
      rect.bottom = rect.top  + (tzHDNODEY * tzHDCELLSIZE) - 1;
      if ( m_pHD_Diagram->m_bOrientation == 0 )
      {
         point1.x = ( rect.left + rect.right ) / 2;
         point1.y = rect.bottom;
      }
      else
      {
         point1.x = rect.right;
         point1.y = ( rect.bottom + rect.top ) / 2;
      }

      m_pHD_Diagram->m_hDC->LineTo( point1.x, point1.y );
      mDeleteInit( pPen );
      if ( bRelease )
         m_pHD_Diagram->ReleaseDeviceContext( );
   }

   // return that entity was drawn
   return( 1 );
}
コード例 #13
0
ファイル: ZdCtlHDN.cpp プロジェクト: DeegC/10d
zSHORT
ZHD_Node::DrawNode( )
{
   CBrush   *pBrush = 0;    // but because we are a little neurotic
   CFont    *pFont = 0;     // we will do it regardless
   CPen     *pPen = 0;      // not sure we have to zero these out ...
   CRect    rect;
   CSize    Size;
   zBOOL    bRelease;
   zCHAR    szText[ 256 ];
   COLORREF colorOldText;
   zBOOL    bSpecialSelect = FALSE;

   // Now paint a rounded rectangle to represent the entity
   if ( !m_pHD_Diagram->PositionVisible( m_lPosIdx, m_lPosIdx + (tzHDNODEX - 1) + ((tzHDNODEY - 1) * tzHDDIAGRAMX) ) )
   {
      return( 0 );
   }

   if ( m_pHD_Diagram->m_hDC == 0 )
   {
      m_pHD_Diagram->GetDeviceContext( );
      bRelease = TRUE;
   }
   else
      bRelease = FALSE;

   if ( m_pHD_Diagram->m_bPrintDC )
   {
      if ( m_bSelected && m_pHD_Diagram->m_bShadeEnts )
         pBrush = new CBrush( COLORREF( tzHDCOLORSHADE ) );
      else
         pBrush = new CBrush( tzHDCOLORWHITE );

      pPen = new CPen( PS_SOLID, 1, tzHDCOLORBLACK );
      colorOldText = m_pHD_Diagram->m_hDC->SetTextColor( tzHDCOLORBLACK );
   }
   else
   {
      pPen = new CPen( PS_SOLID, 1, tzHDCOLORBOX );
      colorOldText = m_pHD_Diagram->m_hDC->SetTextColor( tzHDCOLORTEXT );
      if ( m_lColor >= 0 && m_lColor < 16 )
      {
         if ( m_bSelected )
            pBrush = new CBrush( tzHDCOLORSELECTED );
         else
            pBrush = new CBrush( tzHDCOLORNORMAL[ m_lColor ] );
      }
      else
      {
         pBrush = new CBrush( m_lColor );
         if ( m_bSelected )
            bSpecialSelect = TRUE;
      }
   }

   CPen   *pPenOld = m_pHD_Diagram->m_hDC->SelectObject( pPen );
   CBrush *pBrushOld = m_pHD_Diagram->m_hDC->SelectObject( pBrush );
   CFont  *pFontOld = 0;

   pFont = new CFont( );
   if ( pFont->CreateFont( (tzHDFONTHEIGHT * 5) / 4, 0, 0, 0, 0, 0, 0, 0, ANSI_CHARSET,
                           OUT_TT_ONLY_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, tzHDFONTFF, tzHDFONTNAME ) )
   {
      pFontOld = m_pHD_Diagram->m_hDC->SelectObject( pFont );
   }

   rect.left = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
   rect.top  = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
   if ( m_bHidden )
   {
      rect.right  = rect.left + tzHDCELLSIZE;
      rect.bottom = rect.top  + tzHDCELLSIZE;
      m_pHD_Diagram->m_hDC->Ellipse( rect.left, rect.top, rect.right, rect.bottom );
      if ( bSpecialSelect )
         m_pHD_Diagram->m_hDC->Ellipse( rect.left + 2, rect.top + 2, rect.right + 2, rect.bottom - 2 );

   }
   else
   {
      rect.right  = rect.left + ((tzHDNODEX * tzHDCELLSIZE) - 1);
      rect.bottom = rect.top  + ((tzHDNODEY * tzHDCELLSIZE) - 1);
      m_pHD_Diagram->m_hDC->RoundRect( rect.left, rect.top, rect.right, rect.bottom, tzHDARCSIZE, tzHDARCSIZE );
      if ( bSpecialSelect )
         m_pHD_Diagram->m_hDC->RoundRect( rect.left + 2, rect.top + 2, rect.right - 2, rect.bottom - 2, tzHDARCSIZE, tzHDARCSIZE );
      // Now that the rectangle is drawn, see if we need to draw the attributive or associative lines in the entity
      if ( m_chType == 'A' )
      {
         if ( m_pHD_Diagram->m_bPrintDC == FALSE )
         {
            CPen *pPen2 = pPen;
            pPen = new CPen( PS_SOLID, 1, tzHDCOLORGRAY );
            m_pHD_Diagram->m_hDC->SelectObject( pPen );
            mDeleteInit( pPen2 );
         }

         CPoint pt1;
         CPoint pt2;

         pt1.x = ((rect.left + rect.right) / 2);
         pt1.y = rect.top;
         m_pHD_Diagram->m_hDC->MoveTo( pt1.x, pt1.y );
         pt2.x = rect.left;
         pt2.y = rect.bottom - tzHDCELLSIZE;
         m_pHD_Diagram->m_hDC->LineTo( pt2.x, pt2.y );
         m_pHD_Diagram->m_hDC->MoveTo( pt1.x, pt1.y );
         pt2.x = rect.right;
         m_pHD_Diagram->m_hDC->LineTo( pt2.x, pt2.y );
      }
      else
      if ( m_chType == 'S' )
      {
         if ( m_pHD_Diagram->m_bPrintDC == FALSE )
         {
            CPen *pPen2 = pPen;
            pPen = new CPen( PS_SOLID, 1, tzHDCOLORGRAY );
            m_pHD_Diagram->m_hDC->SelectObject( pPen );
            mDeleteInit( pPen2 );
         }

         CPoint pt1;
         CPoint pt2;

         pt1.x = ((rect.left + rect.right) / 2);
         pt1.y = rect.top;
         m_pHD_Diagram->m_hDC->MoveTo( pt1.x, pt1.y );
         pt2.x = rect.left;
         pt2.y = (rect.top + rect.bottom) / 2;
         m_pHD_Diagram->m_hDC->LineTo( pt2.x, pt2.y );
         pt2.x = pt1.x;
         pt2.y = rect.bottom;
         m_pHD_Diagram->m_hDC->LineTo( pt2.x, pt2.y );
         pt2.x = rect.right;
         pt2.y = (rect.top + rect.bottom) / 2;
         m_pHD_Diagram->m_hDC->LineTo( pt2.x, pt2.y );
         m_pHD_Diagram->m_hDC->LineTo( pt1.x, pt1.y );
      }

      int nOldBkMode = m_pHD_Diagram->m_hDC->SetBkMode( TRANSPARENT );
      Size = m_pHD_Diagram->m_hDC->GetTextExtent( m_csText );
      rect.left   += 4;
      rect.right  -= 4;
      if ( Size.cx > (rect.right - rect.left) )
      {
         rect.top    += ((tzHDCELLSIZE * 3) / 4);
         rect.bottom -= ((tzHDCELLSIZE * 3) / 4);
//       rect.top    += tzHDCELLSIZE;
//       rect.bottom -= tzHDCELLSIZE;

         zSHORT nIdx = 0;
         zSHORT nLth = m_csText.GetLength( ) - 1;
         while ( nIdx < nLth && m_csText.GetAt( nIdx ) != ' ' )
            nIdx++;

         Size = m_pHD_Diagram->m_hDC->GetTextExtent( m_csText, nIdx );
         if ( Size.cx > (rect.right - rect.left) )
         {
            while ( nIdx && Size.cx > (rect.right - rect.left) )
            {
               nIdx--;
               Size = m_pHD_Diagram->m_hDC->GetTextExtent( m_csText, nIdx );
            }

            nIdx--;
            if ( nIdx > 0 )
            {
               HyphenateHD_Text( m_csText, szText, zsizeof( szText ), nIdx );
            }

            m_pHD_Diagram->m_hDC->DrawText( szText, -1, rect, DT_LEFT | DT_WORDBREAK );
   //                                                         DT_SINGLELINE | DT_LEFT | DT_VCENTER );
         }
         else
         {
   //       rect.top += ((tzHDCELLSIZE * 3) / 4);
            m_pHD_Diagram->m_hDC->DrawText( m_csText, -1, rect, DT_CENTER | DT_WORDBREAK );
         }
      }
      else
      {
         rect.left   -= 4;
         rect.right  += 4;
         m_pHD_Diagram->m_hDC->DrawText( m_csText, -1, rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER );
      }

      if ( m_pHD_Diagram->m_bCollapsable ||
           m_csTitle.IsEmpty( ) == FALSE  ||
           m_csDIL.IsEmpty( ) == FALSE    ||
           m_csOutsideText1.IsEmpty( ) == FALSE ||
           m_csOutsideText2.IsEmpty( ) == FALSE ||
           m_csOutsideText3.IsEmpty( ) == FALSE ||
           m_csOutsideText4.IsEmpty( ) == FALSE ||
           m_csOutsideText5.IsEmpty( ) == FALSE )
      {
         if ( pFontOld )
         {
            m_pHD_Diagram->m_hDC->SelectObject( pFontOld );
            pFontOld = 0;
         }

         mDeleteInit( pFont );
         pFont = new CFont( );
         if ( pFont->CreateFont( tzHDCELLSIZE - 1, 0, 0, 0, 0, 0, 0, 0, ANSI_CHARSET,
                                 OUT_TT_ONLY_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, tzHDFONTFF, tzHDFONTNAME ) )
         {
            pFontOld = m_pHD_Diagram->m_hDC->SelectObject( pFont );
         }

         if ( m_csTitle.IsEmpty( ) == FALSE )
         {
            rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.right  = rect.left + (tzHDNODEX * tzHDCELLSIZE) - 1;
            rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.bottom = rect.top  + tzHDCELLSIZE;
            m_pHD_Diagram->m_hDC->DrawText( m_csTitle, -1, rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER );
         }

         if ( m_csDIL.IsEmpty( ) == FALSE )
         {
            rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.right  = rect.left + (tzHDNODEX * tzHDCELLSIZE) - 1;
            rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.top    += ((tzHDNODEY - 1) * tzHDCELLSIZE);
            rect.bottom = rect.top + tzHDCELLSIZE;
            m_pHD_Diagram->m_hDC->DrawText( m_csDIL, -1, rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER );
         }

         if ( m_csOutsideText1.IsEmpty( ) == FALSE )
         {
            rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.left   = rect.left + (tzHDNODEX * tzHDCELLSIZE) + 1;
            rect.right  = rect.left + (tzHDNODEX * ((tzHDCELLSIZE + 1) / 2));
            rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.bottom = rect.top  + tzHDCELLSIZE;
            m_pHD_Diagram->m_hDC->DrawText( m_csOutsideText1, -1, rect,  DT_SINGLELINE | DT_VCENTER );
         }

         if ( m_csOutsideText2.IsEmpty( ) == FALSE )
         {
            rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.left   = rect.left + (tzHDNODEX * tzHDCELLSIZE) + 1;
            rect.right  = rect.left + (tzHDNODEX * ((tzHDCELLSIZE + 1) / 2));
            rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.top    += tzHDCELLSIZE;
            rect.bottom = rect.top  + tzHDCELLSIZE;
            m_pHD_Diagram->m_hDC->DrawText( m_csOutsideText2, -1, rect, DT_SINGLELINE | DT_VCENTER );
         }

         if ( m_csOutsideText3.IsEmpty( ) == FALSE )
         {
            rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.left   = rect.left + (tzHDNODEX * tzHDCELLSIZE) + 1;
            rect.right  = rect.left + (tzHDNODEX * ((tzHDCELLSIZE + 1) / 2));
            rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.top    += (2 * tzHDCELLSIZE);
            rect.bottom = rect.top  + tzHDCELLSIZE;
            m_pHD_Diagram->m_hDC->DrawText( m_csOutsideText3, -1, rect,  DT_SINGLELINE | DT_VCENTER );
         }

         if ( m_csOutsideText4.IsEmpty( ) == FALSE )
         {
            rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.left   = rect.left + (tzHDNODEX * tzHDCELLSIZE) + 1;
            rect.right  = rect.left + (tzHDNODEX * ((tzHDCELLSIZE + 1) / 2));
            rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.top    += (3 * tzHDCELLSIZE);
            rect.bottom = rect.top  + tzHDCELLSIZE;
            m_pHD_Diagram->m_hDC->DrawText( m_csOutsideText4, -1, rect, DT_SINGLELINE | DT_VCENTER );
         }

         if ( m_csOutsideText5.IsEmpty( ) == FALSE )
         {
            rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.left   = rect.left + (tzHDNODEX * tzHDCELLSIZE) + 1;
            rect.right  = rect.left + (tzHDNODEX * ((tzHDCELLSIZE + 1) / 2));
            rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
            rect.top    += (4 * tzHDCELLSIZE);
            rect.bottom = rect.top  + tzHDCELLSIZE;
            m_pHD_Diagram->m_hDC->DrawText( m_csOutsideText5, -1, rect, DT_SINGLELINE | DT_VCENTER );
         }
      }

      if ( m_pHD_Diagram->m_bCollapsable )
      {
         rect.left   = (PosX( ) - PosX( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
         rect.top    = (PosY( ) - PosY( tzHDDISPLAYPOS )) * tzHDCELLSIZE;
         rect.right  = rect.left + tzHDCELLSIZE;
         rect.bottom = rect.top  + tzHDCELLSIZE;
         if ( m_bCollapsed )
         {
            if ( m_pHD_Diagram->m_bPrintDC == FALSE )
            {
               mDeleteInit( pBrush );
               if ( m_lColor >= 0 && m_lColor < 16 )
               {
                  if ( m_bSelected )
                     pBrush = new CBrush( tzHDCOLORNORMAL[ m_lColor ] );
                  else
                     pBrush = new CBrush( tzHDCOLORSELECTED );
               }
               else
               {
                  pBrush = new CBrush( m_lColor );
                  if ( m_bSelected )
                     bSpecialSelect = TRUE;
               }

               m_pHD_Diagram->m_hDC->SelectObject( pBrush );
               m_pHD_Diagram->m_hDC->SetBkMode( OPAQUE );
               m_pHD_Diagram->m_hDC->Ellipse( rect.left, rect.top, rect.right, rect.bottom );
               m_pHD_Diagram->m_hDC->SetBkMode( TRANSPARENT );
            }

            m_pHD_Diagram->m_hDC->DrawText( "+", -1, rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER );
         }
//       else
//       {
//          m_pHD_Diagram->m_hDC->DrawText( "-", -1, rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER );
//       }
      }

      m_pHD_Diagram->m_hDC->SetBkMode( nOldBkMode );
   }

   m_pHD_Diagram->m_hDC->SetTextColor( colorOldText );
   m_pHD_Diagram->m_hDC->SelectObject( pPenOld );
   if ( pFontOld )
      m_pHD_Diagram->m_hDC->SelectObject( pFontOld );

   m_pHD_Diagram->m_hDC->SelectObject( pBrushOld );
   mDeleteInit( pPen );
   mDeleteInit( pFont );
   mDeleteInit( pBrush );

   // Now that the node has been drawn, draw the line to the parent node if the node exists
   DrawNodeLine( );

   if ( bRelease )
      m_pHD_Diagram->ReleaseDeviceContext( );

   // return that entity was drawn
   return( 1 );
}