예제 #1
0
zOPER_EXPORT zSHORT OPERATION
zwTZVSDBAD_StepOnce( zVIEW    vSubtask )
{
   zVIEW    XPG;
   zVIEW    lpZeidonVML;
   zVIEW    vStatementView;
   zLONG    lStepCode;
   zSHORT   nZRetCode;
   zSHORT   RESULT;
   zLONG    lTempInteger_0;

   lStepCode = Exec_StepOnce( vSubtask );
   if ( lStepCode == zXC_OPERATION_EXECUTED )
   {
      nZRetCode = zwTZVSDBAD_Resume( vSubtask );
      nZRetCode = SetWindowActionBehavior( vSubtask, zWAB_ReturnToParentWithRefresh, "", "" );
      return( -1 );
   }

   nZRetCode = GetViewByName( &lpZeidonVML, "ZeidonVML", vSubtask, zLEVEL_TASK );
   nZRetCode = GetViewByName( &XPG, "XPG", lpZeidonVML, zLEVEL_SUBTASK );
   nZRetCode = SetNameForView( XPG, "XPG", vSubtask, zLEVEL_SUBTASK );
   nZRetCode = GetViewByName( &vStatementView, "StatementView", lpZeidonVML, zLEVEL_SUBTASK );
   nZRetCode = GetIntegerFromAttribute( &lTempInteger_0, vStatementView, "Statement", "RelativeLineNumber" );
   RESULT = SetCursorFirstEntityByInteger( XPG, "OperationText", "RelativeLineNumber", lTempInteger_0, "" );
   return( 0 );
}
예제 #2
0
파일: tzerrord.c 프로젝트: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
//    OPERATION: zwTZERRORD_SetTitle
//
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT /*LOCAAL */  OPERATION
zwTZERRORD_SetTitle( zVIEW vSubtask )
{
   zVIEW  vTZERROR;
   zCHAR  szTitle[ 100 ];
   zCHAR  szColumnName[50];
   zLONG  lType;

   if ( GetViewByName( &vTZERROR, "TZERROR", vSubtask, zLEVEL_TASK ) < 0 )
      return( -1 );

   GetIntegerFromAttribute( &lType, vTZERROR, "ErrorList", "MetaType" );

   if ( lType == zSOURCE_ERD_META )
   {
      zstrcpy( szTitle, "Data Model Error List" );
      zstrcpy( szColumnName, "Entity" );
   }
   else
   if ( lType == zSOURCE_REPLACE_BMP )
   {
      zstrcpy( szTitle, "Bitmap Error List" );
      zstrcpy( szColumnName, "Dialog" );
   }
   else
   {
      zstrcpy( szTitle, "" );
      zstrcpy( szColumnName, "" );
   }

   SetCtrlRowColText( vSubtask, "lbErrorList", 0, 1, szColumnName );
   SetWindowCaptionTitle( vSubtask, szTitle, "" );
   return( 0 );

} // zwTZERRORD_SetTitle
예제 #3
0
파일: tzadw4aw.c 프로젝트: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
ofnTZWDLGSO_AssignTag( zVIEW  vSubtask,
                       zVIEW  vDialog,
                       zVIEW  vControl,
                       zPCHAR szType )
{
   zVIEW vTmpDlg;
   zLONG lIdx;
   zSHORT nLth;
   zCHAR szTag[ 25 ];

   zstrcpy( szTag, szType );
   nLth = zstrlen( szTag );

   // Use a temp view for Dialog to make sure we are positioned on the
   // Window itself for getting ControlTagCounter and not on a subcontrol.
   CreateViewFromViewForTask( &vTmpDlg, vControl, 0 );
   ResetView( vTmpDlg );

   // Select next integer to make control tag unique.
   GetIntegerFromAttribute( &lIdx, vTmpDlg, "Window", "ControlTagCounter" );
   lIdx++;
   SetAttributeFromInteger( vTmpDlg, "Window", "ControlTagCounter", lIdx );
   zltoa( lIdx, &szTag[ nLth ] );
   DropView( vTmpDlg );

   SetAttributeFromString( vControl, "Control", "Tag", szTag );
   return( 0 );
}
예제 #4
0
파일: tzersast.c 프로젝트: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
oTZERSASO_RefreshOneSA_Entity( zVIEW    vSubjectArea,
                               zVIEW    vEntpModel )
{
   zVIEW    vEntpModel_Wrk;
   zLONG    lEntityZKey;
   zSHORT   nRC;

   CreateViewFromViewForTask( &vEntpModel_Wrk, vEntpModel, 0 );
   GetIntegerFromAttribute( &lEntityZKey, vSubjectArea,
                            "ER_Entity", "ZKey" );
   nRC = SetCursorFirstEntityByInteger( vEntpModel_Wrk, "ER_Entity",
                                        "ZKey", lEntityZKey, "" );
   if ( nRC > zCURSOR_UNCHANGED )
   {
      ExcludeEntity( vSubjectArea, "ER_Entity" );
//    SetCursorPrevEntity( vSubjectArea, "SA_Entity", "" );
      IncludeSubobjectFromSubobject( vSubjectArea, "ER_Entity",
                                     vEntpModel_Wrk, "ER_Entity", zPOS_AFTER );
      nRC = 0;
   }
   else
   {
      DeleteEntity( vSubjectArea, "SA_Entity" );
      nRC = 1;
   }

   DropView( vEntpModel_Wrk );
   return( nRC );
}
예제 #5
0
/////////////////////////////////////////////////////////////////////////////
//
// ENTRY:
//
// PURPOSE:    Save the VKey Ctrl/Alt/Shift based on the check box settings
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
SaveVKey( zVIEW vSubtask )
{
   zVIEW  vHotkey;
   zACCEL_DEF ac;
   zLONG  lVKey;

   zmemset( &ac, 0, sizeof( zACCEL_DEF ) );
   GetViewByName( &vHotkey, "KZHKEYSO", vSubtask, zLEVEL_ANY );
   GetIntegerFromAttribute( &lVKey, vHotkey, "Hotkey", "VKey" );
   ac.uVK = (zUSHORT) lVKey;

   ac.fCtrl = (zUSHORT) GetCtrlState( vSubtask, "Ctrl",
                                      zCONTROL_STATUS_CHECKED );
   ac.fAlt = (zUSHORT) GetCtrlState( vSubtask, "Alt",
                                     zCONTROL_STATUS_CHECKED );
   ac.fShift = (zUSHORT) GetCtrlState( vSubtask, "Shift",
                                       zCONTROL_STATUS_CHECKED );

   SetAttributeFromBlob( vHotkey, "Hotkey", "KeyCombo",
                         &ac, sizeof( zACCEL_DEF ) );
// if ( CheckExistenceOfEntity( vHotkey, "Operation" ) > zCURSOR_UNCHANGED )
// {
//    zCHAR szText[ 64 ];
//
//    GetCtrlText( vSubtask, "DLL_Name", szText, sizeof( szText ) );
//    SetAttributeFromString( vHotkey, "Operation", "DLL_Name", 0 );
// }

   return( 0 );
}
예제 #6
0
zOPER_EXPORT zSHORT OPERATION
zwTZVSDBAD_Update( zVIEW    vSubtask )
{
   zVIEW    StackObject;
   zVIEW    XPG;
   zVIEW    lpZeidonVML;
   zSHORT   nZRetCode;
   zSHORT   RESULT;
   zLONG    lTempInteger_0;

   nZRetCode = GetViewByName( &lpZeidonVML, "ZeidonVML", vSubtask, zLEVEL_TASK );
   nZRetCode = GetViewByName( &XPG, "XPG", lpZeidonVML, zLEVEL_SUBTASK );
   nZRetCode = GetViewByName( &StackObject, "StackObject", vSubtask, zLEVEL_SUBTASK );
   nZRetCode = GetIntegerFromAttribute( &lTempInteger_0, StackObject, "Variable", "ID" );
   RESULT = SetCursorFirstEntityByInteger( XPG, "Variable", "ID", lTempInteger_0, "" );
   if ( CompareAttributeToInteger ( XPG, "Variable", "DataType", 1045 ) != 0 )
   {
      nZRetCode = SetWindowActionBehavior( vSubtask, zWAB_StartModalSubwindow, "TZVSDBAD", "UPDATEVAR" );
   }
   else
   {
      zwTZVSDBAD_SpawnObjectBrowser( vSubtask );
   }

   return( 0 );
}
예제 #7
0
파일: tzcmrptd.c 프로젝트: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
zwTZCMRPTD_LoadAudittrail( zVIEW vSubtask )
{
   zVIEW    vTZCMRPTO;
   zVIEW    vTZBRAUDO;
   zVIEW    vKZDBHQUA;
   zULONG   ulZKey;
   zCHAR    szZKey[18];
   zSHORT   nRC;

   if ( GetViewByName( &vTZCMRPTO, "TZCMRPTO", vSubtask, zLEVEL_TASK ) > 0 )
   {
      if ( CheckExistenceOfEntity( vTZCMRPTO, "Z_MetaDef" ) == 0 )
      {
         if ( ActivateEmptyObjectInstance ( &vKZDBHQUA, "KZDBHQUA", vSubtask,
                                            zSINGLE ) >= 0 )
         {
            SetNameForView( vKZDBHQUA, "KZDBHQUA", vSubtask, zLEVEL_TASK );
            CreateEntity( vKZDBHQUA, "EntitySpec", zPOS_AFTER );
            CreateEntity( vKZDBHQUA, "QualAttrib", zPOS_AFTER );
         }
         else
            return( -1 );

         GetIntegerFromAttribute(( zPLONG )&ulZKey, vTZCMRPTO, "Z_MetaDef", "ZKey" );
         SetAttributeFromString( vKZDBHQUA, "EntitySpec", "EntityName", "Z_MetaDef" );
         SetAttributeFromString( vKZDBHQUA, "QualAttrib", "EntityName", "Z_MetaDef" );
         SetAttributeFromString( vKZDBHQUA, "QualAttrib", "AttributeName", "ZKey" );
         SetAttributeFromString( vKZDBHQUA, "QualAttrib", "Oper", "=" );
         zltoa( ulZKey, szZKey );
         SetAttributeFromString( vKZDBHQUA, "QualAttrib", "Value", szZKey );

         nRC = ActivateObjectInstance( &vTZBRAUDO, "TZBRAUDO", vSubtask,
                                       vKZDBHQUA, zSINGLE | zLEVEL_APPLICATION );
         DropObjectInstance( vKZDBHQUA );

         if ( CheckExistenceOfEntity( vTZBRAUDO, "AuditTrail" ) == 0 )
            SetNameForView( vTZBRAUDO, "TZBRAUDO", vSubtask, zLEVEL_TASK );
         else
         {
            MessageSend( vSubtask, "CM00299", "Audit Trail:",
                         "There are no AuditTrail-Information for the component in this CPLR.",
                         zMSGQ_OBJECT_CONSTRAINT_INFORMATION, zBEEP );
            SetWindowActionBehavior( vSubtask, zWAB_StayOnWindow, 0, 0 );
            return( -1 );

         }
      }
   }
   else
      return( -1 );

   return( 0 );
}
예제 #8
0
파일: tzcmrptd.c 프로젝트: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
//    OPERATION: zwTZCMRPTD_LoadNewAudittrail
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT /*DIALOG */  OPERATION
zwTZCMRPTD_LoadNewAudittrail( zVIEW vSubtask )
{
   zVIEW   vTZCMCPL;
   zVIEW   vTZBRAU2O;
   zVIEW   vParentWindow;
   zULONG  ulZKey;
   zULONG  ulZKeyCPLR;
   zCHAR   szName[ 33 ];
   zCHAR   szControlText[40];

   GetViewByName( &vTZCMCPL, "TZCMCPL", vSubtask, zLEVEL_TASK );

   GetIntegerFromAttribute( (zPLONG) &ulZKey, vTZCMCPL, "CPLR", "ZKey" );
   GetStringFromAttribute( szName, vTZCMCPL, "CPLR", "Name" );

   if ( GetViewByName( &vTZBRAU2O, "TZBRAU2O", vSubtask, zLEVEL_TASK ) > 0 )
   {
      GetIntegerFromAttribute( (zPLONG) &ulZKeyCPLR, vTZBRAU2O, "CPLR", "ZKey" );
      if ( ulZKey == ulZKeyCPLR )
         return( 0 );
      else
         DropObjectInstance( vTZBRAU2O );
   }

   if ( zwfnTZCMRPTD_LoadNewAudittrail( vSubtask, &vTZBRAU2O ) < 0 )
   {
      return( -1 );
   }

   GetStringFromAttribute( szName, vTZCMCPL, "CPL", "Name" );
   zstrcpy( szControlText, " CPL: " );
   zstrcat( szControlText, szName );
   SetCtrlText( vSubtask, "txtCPL", szControlText );

   GetParentWindow( &vParentWindow, vSubtask );
   RefreshCtrl( vParentWindow, "lbCPLRList" );

   return( 0 );
} // zwTZCMRPTD_LoadNewAudittrail
예제 #9
0
파일: tzadw3aw.c 프로젝트: DeegC/10d
/////////////////////////////////////////////////////////////////////////////
//
// ENTRY: CalculateWindowSize
//
// PURPOSE: This function finds the coordinates of field or group
//          that is farthest down on the current window and the
//          field or group that is farthest to the right of the current
//          window.
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
ofnTZWDLGSO_CalculateWindowSize( zVIEW vNewDialog,
   zPLONG    nLine,
   zPLONG    nMaxLength )
{
   zLONG    lFieldEnd;
   zLONG    i;
   zLONG    j;
   zSHORT   RESULT;

// TraceLineS("IN", "CalculateWindowSize W3" );
   /* Now go through the painted window and calculate the minimum
      size of the window in lines and columns. */
   *nLine = 0;
   *nMaxLength = 0;
   lFieldEnd = 0;
   RESULT = SetCursorFirstEntity( vNewDialog, "Control", "" );
   while ( RESULT > zCURSOR_UNCHANGED )
   {
      GetIntegerFromAttribute( &i, vNewDialog, "Control", "PSDLG_X" );
      GetIntegerFromAttribute( &j, vNewDialog, "Control", "SZDLG_X" );
      i = i + j;
      if ( i > *nMaxLength )
      {
         *nMaxLength = i;
      }
      GetIntegerFromAttribute( &i, vNewDialog, "Control", "PSDLG_Y" );
      GetIntegerFromAttribute( &j, vNewDialog, "Control", "SZDLG_Y" );
      lFieldEnd = i + j;
      if ( lFieldEnd > *nLine )
      {
         *nLine = lFieldEnd;
      }
      RESULT = SetCursorNextEntity( vNewDialog, "Control", "" );
   }
// TraceLineS("END", "CalculateWindowSize W3" );
   return( 0 );
}
예제 #10
0
파일: tzcmrptd.c 프로젝트: arksoftgit/10c
static zSHORT
zwfnTZCMRPTD_LoadNewAudittrail( zVIEW vSubtask, zPVIEW vTZBRAU2O )
{
   zVIEW    vTZCMCPL;
   zVIEW    vKZDBHQUA;
   zULONG   ulZKey;
   zCHAR    szZKey[18];
   zSHORT   nRC;

   if ( GetViewByName( &vTZCMCPL, "TZCMCPL", vSubtask, zLEVEL_TASK ) < 0 )
      return( -1 );

   if ( CheckExistenceOfEntity( vTZCMCPL, "CPLR" ) == zCURSOR_SET )
   {

      if ( ActivateEmptyObjectInstance( &vKZDBHQUA, "KZDBHQUA", vSubtask,
                                        zSINGLE ) >= 0 )
      {
         SetNameForView( vKZDBHQUA, "KZDBHQUA", vSubtask, zLEVEL_TASK );
         CreateEntity( vKZDBHQUA, "EntitySpec", zPOS_AFTER );
         CreateEntity( vKZDBHQUA, "QualAttrib", zPOS_AFTER );
      }
      else
         return( -1 );

      GetIntegerFromAttribute( (zPLONG)&ulZKey, vTZCMCPL, "CPLR", "ZKey" );
      SetAttributeFromString( vKZDBHQUA, "EntitySpec", "EntityName", "CPLR" );
      SetAttributeFromString( vKZDBHQUA, "QualAttrib", "EntityName", "CPLR" );
      SetAttributeFromString( vKZDBHQUA, "QualAttrib", "AttributeName", "ZKey" );
      SetAttributeFromString( vKZDBHQUA, "QualAttrib", "Oper", "=" );
      zltoa( ulZKey, szZKey );
      SetAttributeFromString( vKZDBHQUA, "QualAttrib", "Value", szZKey );


      nRC = ActivateObjectInstance( vTZBRAU2O, "TZBRAU2O", vSubtask,
                                    vKZDBHQUA, zSINGLE | zLEVEL_APPLICATION );
      DropObjectInstance( vKZDBHQUA );
      SetNameForView( *vTZBRAU2O, "TZBRAU2O", vSubtask, zLEVEL_TASK );
   }
   else
   {
      MessageSend( vSubtask, "CM00299", "Audit Trail:",
                   "There are no Audit Trail Information for a non-repository LPLR.",
                   zMSGQ_OBJECT_CONSTRAINT_WARNING, zBEEP );
      SetWindowActionBehavior( vSubtask, zWAB_StayOnWindow, 0, 0 );
      return( -1 );
   }

   return( 0 );
} // zwfnTZCMRPTD_LoadNewAudittrail
예제 #11
0
zOPER_EXPORT zSHORT OPERATION
zwTZVSDBAD_PostInitDebugger( zVIEW    vSubtask )
{
   zVIEW    XPG;
   zVIEW    vStatementView;
   zSHORT   nZRetCode;
   zSHORT   RESULT;
   zLONG    lTempInteger_0;

   nZRetCode = GetViewByName( &XPG, "XPG", vSubtask, zLEVEL_SUBTASK );
   nZRetCode = GetViewByName( &vStatementView, "StatementView", vSubtask, zLEVEL_SUBTASK );
   nZRetCode = GetIntegerFromAttribute( &lTempInteger_0, vStatementView, "Statement", "RelativeLineNumber" );
   RESULT = SetCursorFirstEntityByInteger( XPG, "OperationText", "RelativeLineNumber", lTempInteger_0, "" );
   return( 0 );
}
예제 #12
0
파일: tzcmrptd.c 프로젝트: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
zwTZCMRPTD_LoadDesc_AUDO( zVIEW vSubtask )
{
   zLONG  CPLR_ZKey;
   zCHAR  szTimeStamp[ 20 ];
   zVIEW  vTZBRAUDO;

   if ( GetViewByName( &vTZBRAUDO, "TZBRAUDO", vSubtask, zLEVEL_TASK ) > 0 )
   {
     GetIntegerFromAttribute( &CPLR_ZKey, vTZBRAUDO, "CPLR", "ZKey");
     GetStringFromAttribute( szTimeStamp,  vTZBRAUDO, "AuditTrail", "TimeStamp");
     zwTZCMRPTD_LoadDesc_AUX( vSubtask, CPLR_ZKey, szTimeStamp );
   }

   return( 0 );
}
예제 #13
0
파일: tzvmpmoo.c 프로젝트: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: oTZVSPOOO_C_GenOperationName
//
// PURPOSE:   For Object and Local operations, concatenate the LOD
//            name in front of the VML operation name.
//            For others, just use the regular operation name.
//            The Type for a Local Oper is L.
//            The Types for Object operations are either O, T, C, E or A.
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
oTZVSPOOO_C_GenOperationName( zVIEW  PIView,
                              LPVIEWENTITY EntityStructure,
                              LPVIEWATTRIB AttributeStructure,
                              zSHORT nGetOrSetFlag )
{
   zCHAR  szTempName1[ 64 ];
   zCHAR  szTempName2[ 32 ];
   zCHAR  szType[ 2 ];
   zLONG  lZKey;
   zVIEW  vTempView;

   // Set up a temporary view so that PIView remains unchanged
   CreateViewFromViewForTask( &vTempView, PIView, 0 );

   // Position on the corresponding OperationSource for Operation entity
   GetIntegerFromAttribute( &lZKey, vTempView, "Operation", "ZKey" );
   SetCursorFirstEntityByInteger( vTempView, "OperationSource", "ZKey",
                                  lZKey, "VML_XSource" );

   GetStringFromAttribute( szType, vTempView, "Operation", "Type" );
   if ( szType[ 0 ] == 'L' ||
        szType[ 0 ] == 'O' ||
        szType[ 0 ] == 'T' ||
        szType[ 0 ] == 'C' ||
        szType[ 0 ] == 'E' ||
        szType[ 0 ] == 'A' )
   {
      szTempName1[ 0 ] = 'o';
      GetStringFromAttribute( szTempName1 + 1, vTempView,
                              "VML_XSource", "MetaName" );
      zstrcat( szTempName1, "_" );
      GetStringFromAttribute( szTempName2, vTempView, "Operation", "Name" );
      zstrcat( szTempName1, szTempName2 );
   }
   else
      GetStringFromAttribute( szTempName1, vTempView, "Operation", "Name" );


   StoreValueInRecord( vTempView, EntityStructure, AttributeStructure,
                       szTempName1, 0 );

   // Get rid of temporary view
   DropView( vTempView );

   return( 0 );
}
예제 #14
0
파일: tzpnupgd.c 프로젝트: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
UpgradeControl( zVIEW    vSubtask,
                zVIEW    OrigW,
                zVIEW    OrigWC,
                zVIEW    vType,
                zVIEW    vPE )
{
#if 0
   zLONG    lType;
   zCHAR    szTag[ 35 ];
   zSHORT   RESULT;
   zSHORT   nZRetCode;

   RESULT = SetCursorFirstEntity( OrigWC, "CtrlCtrl", "" );
   while ( RESULT >= 0 )
   {
      nZRetCode = SetViewToSubobject( OrigWC, "CtrlCtrl" );
      nZRetCode = UpgradeControl( vSubtask, OrigW, OrigWC, vType, vPE );
      nZRetCode = ResetViewFromSubobject( OrigWC );
      RESULT = SetCursorNextEntity( OrigWC, "CtrlCtrl", "" );
   }
   RESULT = SetCursorFirstEntity( OrigWC, "CtrlMap", "" );
   while ( RESULT >= 0 )
   {
      nZRetCode = UpgradeCtrlMap( vSubtask, OrigW, OrigWC );
      RESULT = SetCursorNextEntity( OrigWC, "CtrlMap", "" );
   }
   // Upgrade Control to relate to ControlDef
   if ( CheckExistenceOfEntity ( OrigWC, "ControlDef" ) < 0 )
   {
      GetIntegerFromAttribute( &lType, OrigWC, "Control", "Type" );
      SetCursorFirstEntityByInteger( vType, "Control", "Type", lType, "" );
      GetStringFromAttribute( szTag, vType, "Control", "Tag" );
      SetCursorFirstEntityByString( vPE, "ControlDef", "Tag", szTag, "" );
      IncludeSubobjectFromSubobject( OrigWC, "ControlDef", vPE, "ControlDef", zPOS_AFTER );
      SetAttributeFromString ( OrigWC, "Control", "Type", "");
   }
#endif
   return( 0 );
}
예제 #15
0
zOPER_EXPORT zSHORT OPERATION
zwTZVSDBAD_SetBreakPoint( zVIEW    vSubtask )
{
   zVIEW    XPG;
   zVIEW    XPG2;
   zVIEW    lpZeidonVML;
   zLONG    FoundFlag;
   zSHORT   nZRetCode;
   zSHORT   RESULT;
   zLONG    lTempInteger_0;

   nZRetCode = GetViewByName( &lpZeidonVML, "ZeidonVML", vSubtask, zLEVEL_TASK );
   nZRetCode = GetViewByName( &XPG, "XPG", lpZeidonVML, zLEVEL_SUBTASK );
   nZRetCode = CreateViewFromViewForTask( &XPG2, XPG, 0 );
   nZRetCode = GetIntegerFromAttribute( &lTempInteger_0, XPG2, "OperationSource", "ZKey" );
   RESULT = SetCursorFirstEntityByInteger( XPG2, "Operation", "ZKey", lTempInteger_0, "" );
   FoundFlag = zwTZVSDBAD_FindStatement( XPG2, XPG );
   if ( FoundFlag == 1 )
   {
      nZRetCode = SetWindowActionBehavior( vSubtask, zWAB_StayOnWindowWithRefresh, "", "" );
   }
   return( 0 );
}
예제 #16
0
파일: tzvminaa.c 프로젝트: DeegC/10d
//
// OPERATION: LoadXPG
//
// DESCRIPTION: LoadXPG Gets the executable directory from the TaskLPLR.
//    It then creates a file name from which to load the pared instance file.
//    If the load is successful then the view is names in the interp
//    subtask as XPG.
//
zOPER_EXPORT zSHORT OPERATION
LoadXPG( zVIEW  lpInterpSubtask,                      // interpretor subtask
         zVIEW  vSubtask,                             // application subtask
         zPCHAR szSrcDLLName,                         // source dllname
         zCPCHAR cpcGenLang )
{

   zVIEW  vViewObject;                                       // task view
   zCHAR  szExecDir[ zMAX_FILESPEC_LTH + 1 ];                // dir string
   zCHAR  szMessage[ zMAX_MESSAGE_LTH + 1 ];
   zLONG  lParserVersion = 0;
   zSHORT nLth;                                              // string length
   zSHORT nRC;

   // First check to see if it already exists.
   GetViewByName( &g_vXPGView, "XPG", lpInterpSubtask, zLEVEL_SUBTASK );
   if ( g_vXPGView != 0 )
      return( 0 );

   // get a view to the Task LPLR
   if ( GetViewByName( &vViewObject, "TaskLPLR", vSubtask, zLEVEL_TASK ) != zLEVEL_TASK )
   {
      return( -1 );
   }

   // get the exec directory
   GetStringFromAttribute( szExecDir, zsizeof( szExecDir ), vViewObject, "LPLR", "ExecDir" );

   // be sure it was terminated with a '\'
   nLth = (zSHORT) zstrlen( szExecDir );
   if ( szExecDir[ nLth ] != '\\' )
   {
      szExecDir[ nLth ] = '\\';
      szExecDir[ nLth + 1 ] = 0;
   }

   // concat the name. and the .XPG extention
   strcat_s( szExecDir, zsizeof( szExecDir ), szSrcDLLName );
   if ( cpcGenLang[ 0 ] == 'J' )
      strcat_s( szExecDir, zsizeof( szExecDir ), ".XPJ" );
   else
      strcat_s( szExecDir, zsizeof( szExecDir ), ".XPG" );

   // activate the file
   nRC = ActivateOI_FromFile( &g_vXPGView,
                                   "TZVSPOOO",
                                   lpInterpSubtask,
                                   szExecDir,
                                   zSINGLE | zNOI_OKAY |
                                   zIGNORE_ATTRIB_ERRORS );

   if ( nRC != 0 ) //  failed
   {
      strcpy_s( szMessage, zsizeof( szMessage ), "Source VML :" );
      strcat_s( szMessage, zsizeof( szMessage ), szSrcDLLName );
      strcat_s( szMessage, zsizeof( szMessage ), " must be parsed prior to execution" );
      MessageSend( lpInterpSubtask, "VM03002", "VML Interpretor",
                   szMessage,
                   zMSGQ_OBJECT_CONSTRAINT_ERROR, zBEEP );
      TraceLineS( "Could Not Load ", szExecDir );
      return( -1 );
   }
   // do the Parser Version Compatibility Check
#define PARSER_VERSION_REQUIRED 1
   nRC = GetIntegerFromAttribute( &lParserVersion, g_vXPGView,
                                       "VML_XSource",  "ParserVersion" );
   if ( nRC != 0 || lParserVersion < PARSER_VERSION_REQUIRED )
   {
      // the XPG is too old, and not compatible with the current
      //  interpreter.
      strcpy_s( szMessage, zsizeof( szMessage ), "Source VML :" );
      strcat_s( szMessage, zsizeof( szMessage ), szSrcDLLName );
      strcat_s( szMessage, zsizeof( szMessage ),
         " is outdated and must be re-parsed prior to execution" );
      MessageSend( lpInterpSubtask, "VM03002", "VML Interpretor",
                   szMessage,
                   zMSGQ_OBJECT_CONSTRAINT_ERROR, zBEEP );
      TraceLineS( "Program File Outdated : ", szExecDir );
      return( -1 );
   }

   // name the view to the interpretor subtask
   SetNameForView( g_vXPGView, "XPG", lpInterpSubtask, zLEVEL_SUBTASK );

   return( 0 );
}
예제 #17
0
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION:    zwTZZMAIND_ToolAboutPostBuild
//
//   PURPOSE:    For ToolAbout window, Set Icon visible, Set caption
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
zwTZZMAIND_ToolAboutPostBuild( zVIEW vSubtask )
{
   zVIEW  vAbout;
   zLONG  lTool;
   zPCHAR szToolTitle;

   SetCtrlState( vSubtask, "IconSYSADM", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconWKSADM", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconDOMAIN", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconERD", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconDTE", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconLOD", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconDIALOG", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconPENV", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconGO", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconHDR", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconDBG", zCONTROL_STATUS_VISIBLE, 0 );
   SetCtrlState( vSubtask, "IconREPORT", zCONTROL_STATUS_VISIBLE, 0 );

   GetViewByName( &vAbout, "ToolAbout", vSubtask, zLEVEL_TASK);

// Make proper tool icon visible

   GetIntegerFromAttribute( &lTool, vAbout, "TZ", "AboutToolTitleID" );

// LoadString( g_hInstanceDLL, lTool, szTool, 100 );

   if ( lTool ==  zTOOL_SYSADM )
      SetCtrlState( vSubtask, "IconSYSADM", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_WKSADM )
      SetCtrlState( vSubtask, "IconWKSADM", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_DOMAIN )
      SetCtrlState( vSubtask, "IconDOMAIN", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_ERD )
      SetCtrlState( vSubtask, "IconERD", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_DTE )
      SetCtrlState( vSubtask, "IconDTE", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_LOD )
      SetCtrlState( vSubtask, "IconLOD", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_DIALOG )
      SetCtrlState( vSubtask, "IconDIALOG", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_PENV )
      SetCtrlState( vSubtask, "IconPENV", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_GO )
      SetCtrlState( vSubtask, "IconGO", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_HDR )
      SetCtrlState( vSubtask, "IconHDR", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_DEBUG )
      SetCtrlState( vSubtask, "IconDBG", zCONTROL_STATUS_VISIBLE, 1 );
   else
   if ( lTool ==  zTOOL_REPORT )
      SetCtrlState( vSubtask, "IconREPORT", zCONTROL_STATUS_VISIBLE, 1 );

// Set window caption as tool name


   GetAddrForAttribute( &szToolTitle, vAbout, "TZ", "AboutToolTitle" );
   SetWindowCaptionTitle( vSubtask, 0, szToolTitle );


   return( 0 );
}
예제 #18
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 );
      }
   }
}
예제 #19
0
파일: tzadw4aw.c 프로젝트: arksoftgit/10c
///////////////////////////////////////////////////////////////////////
//
// PURPOSE:  This function paints the list attributes from the user spec
//           into the existing partition.
//
////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zLONG OPERATION
ofnTZWDLGSO_AutoPntFldPartWLits( zVIEW  vSubtask,
                                 zVIEW  vUserSpec,
                                 zVIEW  vNewDialog,
                                 zPCHAR szListType )
{
   zVIEW  vAutoDesWk;
   zVIEW  vSubobject;
   zVIEW  vTempStyle;
   zVIEW  vCtrlDef;
   zLONG  k, j;
   zLONG  lCC, lCL;
   zLONG  lMaxLines;
   zLONG  lLine, lFirstPaintLine, lFieldsPainted, lColumn;
   zLONG  lMaxFieldDLG_X, lMaxText, lPush;
   zLONG  lGroupDLG_X, lGroupDLG_Y;
   zSHORT RESULT;
   zLONG  lLastPaintLine, lLastWindowLine, lMaxLength;
// zCHAR  cUsage[ 1 ];
   zCHAR  szMapEntity[ 33 ];
   zCHAR  szMapAttribute[ 33 ];
   zCHAR  szType[ 33 ];
   zCHAR  szWorkString[ 256 ];
   zCHAR  X_LOD_Attribute[ 16 ];
   zCHAR  X_ER_Attribute[ 15 ];

// TraceLineS( "IN", " AutoPaintPartitionWithFields" );

   // Set up variables to either I_LOD listbox or L_LOD listbox.
   if ( szListType[ 0 ] == 'I' )
   {
      zstrcpy( X_LOD_Attribute, "I_LOD_Attribute" );
      zstrcpy( X_ER_Attribute, "I_ER_Attribute" );
   }
   else
   {
      zstrcpy( X_LOD_Attribute, "L_LOD_Attribute" );
      zstrcpy( X_ER_Attribute, "L_ER_Attribute" );
   }

// TraceLineS( "IN", " AutoPaintPartitionWithFields" );

   GetViewByName( &vCtrlDef, "TZADCTLD", vNewDialog, zLEVEL_TASK );
   GetViewByName( &vAutoDesWk, "TZADWWKO", vNewDialog, zLEVEL_TASK );
   CreateViewFromViewForTask( &vSubobject, vNewDialog, 0 );

   lCL = 12;
   lCC = 5;

   /* Create a new view that will point to the UIS_ViewObjRef entity
      in the user spec object.  Sometimes vUserSpec is pointing to a
      recursive subobject and UI_ViewObjRef cannot be accessed. */
   CreateViewFromViewForTask( &vTempStyle, vUserSpec, 0 );
   ResetView( vTempStyle );

   SetViewToSubobject( vSubobject, "CtrlCtrl" );
   /* Delete any existing fields in the listbox */
   RESULT = SetCursorFirstEntity( vSubobject, "Control", "" );
   while ( RESULT > zCURSOR_UNCHANGED )
   {
      RESULT = DeleteEntity( vSubobject, "Control", zREPOS_NEXT );
   }

   GetIntegerFromAttribute( &lMaxLines, vNewDialog, "Control", "SZDLG_Y" );
   szMapEntity[ 0 ] = 0;

   lFirstPaintLine = 0;
   lLastPaintLine = 1;
   lLine          = 1;
   lMaxFieldDLG_X = 0;
   lMaxLength     = 0;
   lMaxText       = 0;
   lPush          = 0;
   lFieldsPainted = 0;

// cUsage[ 0 ] = 'U';

   /* If there is a paint object, loop through its attributes */
   RESULT = SetCursorFirstEntity( vUserSpec, X_LOD_Attribute, "" );
   while ( RESULT > zCURSOR_UNCHANGED )
   {
      /* The last line painted was at this posititon */
      lLastPaintLine = lLine;
      lColumn = 1;

      /* Create the Text Field for the Attribute */
      CreateMetaEntity( vSubtask, vSubobject, "Control", zPOS_AFTER );
      SetAttributeFromInteger( vSubobject, "Control",
                               "PSDLG_Y", lLine );
      if ( lFirstPaintLine == 0 )
         lFirstPaintLine = lLine;

      SetAttributeFromInteger( vSubobject, "Control",
                               "PSDLG_X", lColumn );
      /* Creating text field. */
      SetCursorFirstEntityByString( vCtrlDef, "ControlDef",
                                    "Tag", "Text", "" );
      IncludeSubobjectFromSubobject( vSubobject, "ControlDef",
                                     vCtrlDef, "ControlDef", zPOS_AFTER );
      // Remove the text border.
      SetAttributeFromInteger( vSubobject, "Control", "Subtype",
                               zCONTROL_BORDEROFF | zCONTROL_NOTABSTOP );
      GetStringFromAttribute( szWorkString, vUserSpec,
                              X_ER_Attribute, "ListPaintLit" );
      GetStringFromAttribute( szMapAttribute, vUserSpec,
                              X_ER_Attribute, "Name" );

      // If there is no paint literal for this attribute then
      // use the attribute name as the paint literal.
      if ( szWorkString[ 0 ] == 0 )
         zstrcpy( szWorkString, szMapAttribute );

      SetAttributeFromString( vSubobject, "Control", "Text", szWorkString );

      j = zstrlen( szWorkString );
      j = j * lCC;

      // Determine the size of the longest paint literal.
      if ( j > lMaxText )
         lMaxText = j;

      SetAttributeFromInteger( vSubobject, "Control", "SZDLG_X", j );
      SetAttributeFromInteger( vSubobject, "Control", "SZDLG_Y", lCL );

      /* Add the length of the longest paint literal
         to the column so the attribute field will be
         painted there */
      lColumn += j;
      lColumn = lColumn + lCC;

      // If there is no paint length for the field, then
      // use the field's length.
      j = ofnTZWDLGSO_GetSizeForListAttr( vSubtask, vUserSpec, szListType );

      j = j * lCC;

      // If there is no paint length for the field, then
      // use the field's length.
      if ( j > 100 )
         j = 100;
      else
      if ( j < 25 )
         j = 25;

      // Create the appropriate Data Field for the Attribute.
      CreateMetaEntity( vSubtask, vSubobject, "Control", zPOS_AFTER );

      SetAttributeFromInteger( vSubobject, "Control",
                               "PSDLG_Y",  lLine );
      SetAttributeFromInteger( vSubobject, "Control",
                               "PSDLG_X", lColumn );
      SetAttributeFromInteger( vSubobject, "Control",
                               "SZDLG_X", j );
      SetAttributeFromInteger( vSubobject, "Control",
                               "SZDLG_Y", lCL );
      // Determine the maximum column length.
      if ( lMaxFieldDLG_X < lColumn )
         lMaxFieldDLG_X = lColumn;

      lColumn += j;
      lColumn = lColumn - 1 * lCC;

      // Determine the maximum length of colum and literal.
      if ( lMaxLength < lColumn )
         lMaxLength = lColumn;

      SetCursorFirstEntityByString( vCtrlDef, "ControlDef",
                                    "Tag", "EditBox", "" );
      IncludeSubobjectFromSubobject( vSubobject, "ControlDef",
                                     vCtrlDef, "ControlDef", zPOS_AFTER );
   // SetAttributeFromInteger( vSubobject, "Control", "Type", 1010 );
      /*
      if ( cUsage[ 0 ] == 'U' )
      {
         GetStringFromAttribute( cWork, vUserSpec,
                                 X_LOD_Attribute, "DERIVEDF" );
         if ( cWork[ 0 ] != 0 )
            SetAttributeFromCharacter( vSubobject,
                                        "Control", "Type", 1000 );
      }
      */
      /* setting the group and field's ENAME and ANAME */
      CreateMetaEntity( vSubtask, vSubobject, "CtrlMap", zPOS_AFTER );

      /* set the partitions OI name */
      IncludeSubobjectFromSubobject( vSubobject, "CtrlMapView",
                                     vTempStyle, "UIS_ViewObjRef", zPOS_AFTER );
      IncludeSubobjectFromSubobject( vSubobject, "CtrlMapLOD_Attribute",
                                     vUserSpec, X_LOD_Attribute, zPOS_AFTER );
      lFieldsPainted++;
      lLine = lLine + lCL;

      RESULT = SetCursorNextEntity( vUserSpec, X_LOD_Attribute, "" );
   }

   lLastPaintLine = lLine;

   /* Get the dimensions of the partition. */
   GetIntegerFromAttribute( &lGroupDLG_X, vNewDialog, "Control", "SZDLG_X" );

   GetIntegerFromAttribute( &lGroupDLG_Y, vNewDialog, "Control", "SZDLG_Y" );

   RESULT = SetCursorFirstEntity( vSubobject, "Control", "" );
   while ( RESULT > zCURSOR_UNCHANGED )
   {
      GetIntegerFromAttribute( &lLine, vSubobject, "Control", "PSDLG_Y" );
      if ( lLine >= lFirstPaintLine && lLine <= lLastPaintLine )
      {
         GetStringFromAttribute( szType, vSubobject, "ControlDef", "Tag" );
         /* If the control is not a text control. */
         if ( zstrcmp( szType, "Text" ) != 0 )
         {
            GetIntegerFromAttribute( &j, vSubobject, "Control", "PSDLG_X" );
            GetIntegerFromAttribute( &k, vSubobject, "Control", "SZDLG_X" );

            if ( j < lMaxFieldDLG_X )
            {
               j = lMaxFieldDLG_X - j;
               if ( ( lMaxFieldDLG_X + k ) >
                    ( lMaxLength + lCC ) )
               {
                  if ( ( lMaxFieldDLG_X + k ) <= lGroupDLG_X )
                  {
                     lMaxLength = lMaxFieldDLG_X +( k - lCC );
                  }
                  else
                  {
                     j -=( ( lMaxFieldDLG_X + k ) -
                                          lGroupDLG_X );
                     if ( j > 0 )
                     {
                        AddToAttributeFromInteger( vSubobject, "Control",
                                                   "PSDLG_X", j );
                        lMaxLength = lGroupDLG_X - lCC;
                        j = -1;
                     }
                  }
               }

               if ( j > 0 )
               {
                  SetAttributeFromInteger( vSubobject, "Control",
                                           "PSDLG_X", lMaxFieldDLG_X );
               }
            }
         }

         GetIntegerFromAttribute( &j, vSubobject, "Control", "PSDLG_X" );
         GetIntegerFromAttribute( &k, vSubobject, "Control", "SZDLG_X" );
         if ( ( j + k ) >= lGroupDLG_X )
         {
            RESULT = SetCursorFirstEntity( vSubobject, "Control", "" );
            while ( RESULT > zCURSOR_UNCHANGED )
            {
               RESULT = DeleteEntity( vSubobject, "Control", zREPOS_NEXT );
            }

            MessageSend( vNewDialog, "AD10304", "Autodesigner",
                         "Partition too small( width )",
                         zMSGQ_OBJECT_CONSTRAINT_ERROR, zBEEP );

            /* the partition is not wide enough */
            return( -1 );
         }

         ///////////////////////////////////////////////////////////
         // Code to truncate fields which extend over the partition to
         // the right COMMENTED out. This is a 'too small' error as
         // noted above.
         // else
         // if ( (j + k) >= lGroupDLG_X )
         // {
         //    k =( lGroupDLG_X - 1 ) - j;
         //    SetAttributeFromInteger( vSubobject, "Control",
         //                             "SZDLG_X", k );
         // }
         ////////////////////////////////////////////////////////////
      }

      RESULT = SetCursorNextEntity( vSubobject, "Control", "" );
   }

   lLastWindowLine = lLine;

   /* If the window painted has too many lines for the
      terminal being used for painting. Attempt to
      compress the window into a more manageable size by combining
      painted fields which are located on separate lines            */

   /*
   for ( i = 1; i < 8; i++ )
   {
      if ( lLastWindowLine + 12 <= lMaxLines )
      {
         break;
      }
      fnCompressPartition( vNewDialog, i, lFirstPaintLine, lMaxText,
                           lMaxLines,
                           &lLastPaintLine, &lLastWindowLine,
                           &lMaxLength );
   }
   */

   if ( ( lLastWindowLine + lCL ) > lMaxLines )
   {
      RESULT = SetCursorFirstEntity( vSubobject, "Control", "" );
      while ( RESULT > zCURSOR_UNCHANGED )
      {
         RESULT = DeleteEntity( vSubobject, "Control", zREPOS_NEXT );
      }

      MessageSend( vNewDialog, "AD10305", "Autodesigner",
                   "Partition too small( height )",
                   zMSGQ_OBJECT_CONSTRAINT_ERROR, zBEEP );
      return( -1 );
   }

// TraceLineS( "END", " AutoPaintPartitionWithFields" );

   /* Return the last paint line for AutoDesign */
   return( lLastPaintLine );
}
예제 #20
0
파일: tzadw4aw.c 프로젝트: arksoftgit/10c
/////////////////////////////////////////////////////////////////////
//
// PURPOSE:  This routine paints selected fields in a list box
// or partition (all the fields are on one line) and paints the
// field literals above the listbox or partition.
//
/////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
ofnTZWDLGSO_AutoPaintListBox( zVIEW  vSubtask,
                              zVIEW  vUserSpec,
                              zVIEW  vNewDialog,
                              zPCHAR szListType )
{
   zLONG    lCC;
   zLONG    lCL;
   zSHORT   nRC;
   zLONG    lFieldRow;
   zLONG    lFieldCol;
   zLONG    lPartitionStartDLG_Y;
   zLONG    lPartitionStartDLG_X;
   zLONG    lPartitionSizeDLG_X;
   zLONG    lSubtype;
   zCHAR    szParentName[ 33 ];
   zLONG    lTempInteger_0;
   zSHORT   RESULT;
//BL   zLONG    lTempInteger_1;
   zCHAR    X_LOD_Attribute[ 16 ];

// TraceLineS("IN", "AutoPaintListBox W4" );

   // Set up variables to either I_LOD listbox or L_LOD listbox.
   if ( szListType[ 0 ] == 'I' )
      zstrcpy( X_LOD_Attribute, "I_LOD_Attribute" );
   else
      zstrcpy( X_LOD_Attribute, "L_LOD_Attribute" );

   lCL = 12;
   lCC = 5;
   zstrcpy( szParentName, "Window" );
   lTempInteger_0  = zstrcmp( szParentName, "SECTION" );
   /* If we are Autodesigning a ROD, set the lCL to 8 so line skips do
      not tak place. */
   if ( lTempInteger_0 == 0 )
   {
      lCL = 8;
   }
   else
   {
      lCL = 12;
   }

   // Set the Tag
   ofnTZWDLGSO_AssignTag( vSubtask, vNewDialog, vNewDialog, "ListBox" );
// SetAttributeFromAttribute( vNewDialog, "Control", "Tag",
//                            vUserSpec, "LOD_Entity", "Name" );

   /* Get the group's dimensions. */
   GetIntegerFromAttribute( &lPartitionStartDLG_Y, vNewDialog,
                            "Control", "PSDLG_Y" );
   GetIntegerFromAttribute( &lPartitionStartDLG_X, vNewDialog,
                            "Control", "PSDLG_X" );
   GetIntegerFromAttribute( &lPartitionSizeDLG_X, vNewDialog,
                            "Control", "SZDLG_X" );

   /* If the control is a group box not a listbox, then the output
      fields should be placed lower down then the listbox's output fields. */
   if ( CompareAttributeToString( vNewDialog, "ControlDef", "Tag",
                                  "ListBox" ) == 0 )
      lFieldRow = 2;
   else
      lFieldRow = 5;
   lFieldCol = 1;

   RESULT = SetCursorFirstEntity( vUserSpec, X_LOD_Attribute, "" );

   /* Paint the output fields into the listbox or partition. */
   nRC = ofnTZWDLGSO_AutoPaintListPart( vSubtask, vUserSpec, vNewDialog,
                                        lFieldRow, lFieldCol,
                                        lPartitionSizeDLG_X, szListType );

#if 0
   //* Eliminated 1999/04/23 for support of new listbox style.
   /* If the fields fit and there was no other problem, paint the lits. */
   if ( nRC > -1 )
   {
      /* The literals are going to be placed above the listbox
         or partition. */
      lFieldRow = lPartitionStartDLG_Y - nCL;
      lFieldCol = lPartitionStartDLG_X + nCC;

      RESULT = SetCursorFirstEntity( vUserSpec, X_LOD_Attribute, "" );

      /* Paint the literals above the listbox or partition. */
      lTempInteger_1 = zstrcmp( szParentName, "Window" );
      if ( lTempInteger_1 == 0 )
      {
         nRC = ofnTZWDLGSO_AutoPaintLstLitPart( vUserSpec, vNewDialog,
                                                lFieldRow, lFieldCol,
                                                lPartitionSizeDLG_X,
                                                szListType );
         if ( nRC == -1 )
            return( -1 );
      }
   }
   else
   {
      return( -1 );
   }
#endif

   // Set listbox to sort and disable first subcontrol.
   GetIntegerFromAttribute( &lSubtype, vNewDialog, "Control", "Subtype" );
   lSubtype |= zLISTBOX_SORTEDHEADERS;
   SetAttributeFromInteger( vNewDialog, "Control", "Subtype", lSubtype );
   SetCursorFirstEntity( vNewDialog, "CtrlCtrl", 0 );
   GetIntegerFromAttribute( &lSubtype, vNewDialog, "CtrlCtrl", "Subtype" );
   lSubtype |= zCONTROL_DISABLED;
   SetAttributeFromInteger( vNewDialog, "CtrlCtrl", "Subtype", lSubtype );

// TraceLineS("END", "AutoPaintListBox W4" );
   return( nRC );
}
예제 #21
0
파일: tzwdlg3o.c 프로젝트: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
// OPERATION: oTZWDLGSO_DIL_Inherited_Ctrl
// PURPOSE:   This derived attribute determines the DIL message by the following
//            algorithm.
//            1. If the control is a Radio or Push button, the Control Text
//               attribute is used.
//            2. If there is no mapping, the Control Text attribute is used.
//            3. If there is mapping, we will use the Domain's Context to
//               determine the DIL Text.  If there is a Context specified for
//               the Control, that Context will be used.  Otherwise the default
//               Context will be used.
//            NOTE: The operation is designed for Control only.
//                  It will not handle CtrlCtrl, Option, or OptOpt.
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
oTZWDLGSO_DIL_Inherited_Ctrl( zVIEW         vIn,
                              LPVIEWENTITY  lpViewEntity,
                              LPVIEWATTRIB  lpViewAttrib,
                              zSHORT        nMsg )
{
   zPCHAR       szAttr;
   zVIEW        vDomain;
   zLONG        lZKey;

   // If this is a derived retrieval call, then assign the attribute
   // using the derivation formula defined above
   if ( nMsg == zDERIVED_GET )
   {
      GetAddrForAttribute( &szAttr, vIn, "ControlDef", "Tag" );
      if ( lstrcmp( szAttr, "Radio" ) == 0 ||
           lstrcmp( szAttr, "Push" ) == 0 )
      {
         GetAddrForAttribute( &szAttr, vIn, "Control", "Text" );
      }
      else
      {
         if ( CheckExistenceOfEntity( vIn, "CtrlMapER_Domain" )
                                                            < zCURSOR_SET )
         {
            // no mapping so use text of control
            GetAddrForAttribute( &szAttr, vIn, "Control", "Text" );
         }
         else
         {
            // OK, This is where we use the mapping
            // Context/Domain info to determine what the DIL needs to be.

            // First get a view to the Domain.
            GetIntegerFromAttribute( &lZKey, vIn, "CtrlMapER_Domain", "ZKey" );
            ActivateMetaOI_ByZKey( vIn, &vDomain, 0,
                                   zREFER_DOMAIN_META, zSINGLE,
                                   lZKey, zCURRENT_OI );
            if ( CheckExistenceOfEntity( vIn, "CtrlMapContext" )
                                                            >= zCURSOR_SET )
            {
               // If there is a Context override, position on that Context.
               GetIntegerFromAttribute( &lZKey, vIn, "CtrlMapContext", "ZKey" );
               SetCursorFirstEntityByInteger( vDomain, "Context", "ZKey", lZKey, 0 );
            }
            else
               // If there is no Context override, position on the default
               // Context.
               SetCursorFirstEntityByString( vDomain, "Context", "IsDefault", "Y", 0 );

            // Now retrieve the DIL Message from the Context.
            GetAddrForAttribute( &szAttr, vDomain, "Context", "DIL_NLS_Text" );
            if ( szAttr[ 0 ] == 0 )
            {
               GetAddrForAttribute( &szAttr, vDomain, "Context",
                                    "DIL_Inherited" );
            }

            DropView( vDomain );
         }
      }

      // Update the value of the DIL message text in the object
      StoreValueInRecord( vIn, lpViewEntity, lpViewAttrib, szAttr, 0 );
   }

   return( 0 );
}
예제 #22
0
//:DIALOG OPERATION
//:RemoveAll ( VIEW vSubtask )
//:   VIEW TZTENVRO      REGISTERED AS TZTENVRO
zOPER_EXPORT zSHORT OPERATION
RemoveAll( zVIEW     vSubtask )
{
   zVIEW     TZTENVRO = 0; 
   zSHORT    RESULT; 
   //:VIEW TZZOLODO      REGISTERED AS TZZOLODO
   zVIEW     TZZOLODO = 0; 
   //:VIEW TZZOLODO_Hier BASED ON LOD  TZZOLODO
   zVIEW     TZZOLODO_Hier = 0; 
   //:STRING ( 100 ) szEntityName
   zCHAR     szEntityName[ 101 ] = { 0 }; 
   //:SHORT          sReturnLevel
   zSHORT    sReturnLevel = 0; 
   //:SHORT          nRC
   zSHORT    nRC = 0; 
   //:INTEGER        lAbsPos
   zLONG     lAbsPos = 0; 
   //:INTEGER        lDataSourceZKey
   zLONG     lDataSourceZKey = 0; 

   RESULT = GetViewByName( &TZTENVRO, "TZTENVRO", vSubtask, zLEVEL_TASK );
   RESULT = GetViewByName( &TZZOLODO, "TZZOLODO", vSubtask, zLEVEL_TASK );

   //:CreateViewFromViewForTask( TZZOLODO, TZZOLODO, vSubtask )
   CreateViewFromViewForTask( &TZZOLODO, TZZOLODO, vSubtask );
   //:ResetView( TZZOLODO )
   ResetView( TZZOLODO );

   //:CreateViewFromViewForTask( TZZOLODO_Hier, TZZOLODO, vSubtask )
   CreateViewFromViewForTask( &TZZOLODO_Hier, TZZOLODO, vSubtask );

   //:szEntityName    = "LOD_EntityParent"
   ZeidonStringCopy( szEntityName, 1, 0, "LOD_EntityParent", 1, 0, 101 );
   //:lDataSourceZKey = TZTENVRO.TE_DBMS_Source.ZKey
   GetIntegerFromAttribute( &lDataSourceZKey, TZTENVRO, "TE_DBMS_Source", "ZKey" );

   //:nRC = DefineHierarchicalCursor( TZZOLODO_Hier, "LOD_EntityParent" )
   nRC = DefineHierarchicalCursor( TZZOLODO_Hier, "LOD_EntityParent" );
   //:LOOP WHILE nRC >= zCURSOR_SET
   while ( nRC >= zCURSOR_SET )
   { 

      //: IF nRC = zCURSOR_SET_RECURSIVECHILD
      if ( nRC == zCURSOR_SET_RECURSIVECHILD )
      { 
         //: SetViewToSubobject( TZZOLODO_Hier, "LOD_EntityChild" )
         SetViewToSubobject( TZZOLODO_Hier, "LOD_EntityChild" );
      } 

      //: END

      //: // Set up our temp view from the hier view.
      //: GetAbsolutePositionForEntity( lAbsPos, TZZOLODO_Hier, "LOD_EntityParent" )
      GetAbsolutePositionForEntity( &lAbsPos, TZZOLODO_Hier, "LOD_EntityParent" );
      //: SetCursorAbsolutePosition( szEntityName, TZZOLODO, lAbsPos )
      SetCursorAbsolutePosition( szEntityName, TZZOLODO, lAbsPos );

      //: IF szEntityName = "LOD_EntityParent"
      if ( ZeidonStringCompare( szEntityName, 1, 0, "LOD_EntityParent", 1, 0, 101 ) == 0 )
      { 

         //:  SET CURSOR FIRST TZZOLODO.POD_Entity
         //:             WHERE TZZOLODO.TE_DBMS_SourceForEntity.ZKey = lDataSourceZKey
         RESULT = SetCursorFirstEntity( TZZOLODO, "POD_Entity", "" );
         if ( RESULT > zCURSOR_UNCHANGED )
         { 
            while ( RESULT > zCURSOR_UNCHANGED && ( CompareAttributeToInteger( TZZOLODO, "TE_DBMS_SourceForEntity", "ZKey", lDataSourceZKey ) != 0 ) )
            { 
               RESULT = SetCursorNextEntity( TZZOLODO, "POD_Entity", "" );
            } 

         } 


         //:  IF RESULT >= zCURSOR_SET
         if ( RESULT >= zCURSOR_SET )
         { 
            //:  TZZOLODO.POD_Entity.SQL_JoinWithParent = "N"
            SetAttributeFromString( TZZOLODO, "POD_Entity", "SQL_JoinWithParent", "N" );
         } 

         //:  END
      } 

      //: END

      //: nRC = SetCursorNextEntityHierarchical( sReturnLevel, szEntityName, TZZOLODO_Hier )
      nRC = SetCursorNextEntityHierarchical( (zPUSHORT) &sReturnLevel, szEntityName, TZZOLODO_Hier );
   } 

   //:END

   //:DropView( TZZOLODO_Hier )
   DropView( TZZOLODO_Hier );
   //:DropView( TZZOLODO )
   DropView( TZZOLODO );

   //:RefreshCtrl( vSubtask, "JoinCheck" )
   RefreshCtrl( vSubtask, "JoinCheck" );
   return( 0 );
// END
} 
예제 #23
0
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: oTZEREMDO_DeleteEntity
//
// PURPOSE:   Delete Relationship from ER Model
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
oTZEREMDO_DeleteEntity( zVIEW  vTZEREMDO,
                        zSHORT nReposition )
{
   zVIEW    vTZEREMD1;
   zVIEW    vTZERSASO;
   zVIEW    vSubtask;   // to refresh ER Diagram
   zSHORT   nRC;
   zLONG    lEntityZKey;
   LPLIBRARY hLibrary = 0;  // used for dynamic call to ER control func's
   zFARPROC_RemoveFunc lpfn = 0;

//  Position and determine if there are any relationships involving
//  this Entity prior to deleting the Entity.
   nRC = CreateViewFromViewForTask( &vTZEREMD1, vTZEREMDO, 0 );
   nRC = GetIntegerFromAttribute( &lEntityZKey, vTZEREMD1, "ER_Entity", "ZKey" );
   nRC = SetCursorFirstEntityByInteger( vTZEREMD1, "ER_Entity_2",
                                        "ZKey", lEntityZKey,
                                        "EntpER_Model" );

//  Delete the entity if it is involved in any relationships.
   if ( nRC >= zCURSOR_SET )
   {
      //  Loop and Delete all ER RelLinks
      for ( nRC = SetCursorFirstEntity( vTZEREMDO, "ER_RelLink", "" );
            nRC >= zCURSOR_SET;
            nRC = SetCursorNextEntity( vTZEREMDO, "ER_RelLink", "" ) )
      {
         oTZEREMDO_DeleteRelationship( vTZEREMDO, zREPOS_NONE, 1 );
      }
      //  Check to if all relationships were deleted.
      if ( SetCursorFirstEntityByInteger( vTZEREMD1, "ER_Entity_2",
                                          "ZKey", lEntityZKey,
                                          "EntpER_Model" ) >= zCURSOR_SET )
      {
         DropView( vTZEREMD1 );
         return( -1 );
      }
   }

// Delete ER Entity
   if ( GetViewByName( &vSubtask, "TZEREMDD", vTZEREMDO, zLEVEL_TASK ) > 0 )
   {
      lpfn = (zFARPROC_RemoveFunc)
             GetOperationDynamicCallAddress( vSubtask,
                                             (LPLPLIBRARY) &hLibrary,
                                             "TZCTL", "RemoveEntity",
                                             "(tzlooprs)" );
      if ( lpfn )
        (*lpfn)( vSubtask, "ERD", 0, 0 );
   }

   nRC = DeleteEntity( vTZEREMDO, "ER_Entity", nReposition );

   // It is possible that the ER_Entity we just deleted is part of an
   // opened Subject Area.  If so, we must be sure that Subject Area doesn't
   // have hanging SA_Entity entities.
   if ( GetViewByName( &vTZERSASO, "TZERSASO", vTZEREMDO, zLEVEL_TASK ) > 0 )
   {
      nRC = SetCursorFirstEntity( vTZERSASO, "SA_Entity", 0 );
      while ( nRC >= zCURSOR_SET )
      {
         if ( CheckExistenceOfEntity( vTZERSASO, "ER_Entity" ) < zCURSOR_SET )
         {
            if ( GetViewByName( &vSubtask, "SAVIEW", vTZEREMDO, zLEVEL_TASK ) > 0 )
            {
               if ( lpfn == 0 )   // only get func addr once
               {
                  lpfn = (zFARPROC_RemoveFunc)
                     GetOperationDynamicCallAddress( vSubtask,
                                                     (LPLPLIBRARY) &hLibrary,
                                                     "TZCTL", "RemoveEntity",
                                                     "(tzlooprs)" );
               }
               if ( lpfn )
               (*lpfn)( vSubtask, "ERD", 0, 0 );
            }

            DeleteEntity( vTZERSASO, "SA_Entity", zREPOS_NONE );
         }

         nRC = SetCursorNextEntity( vTZERSASO, "SA_Entity", 0 );
      }
   }

   DropView( vTZEREMD1 );
   return( 0 );
}
예제 #24
0
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: oTZEREMDO_DeleteRelationship
//
// PURPOSE:   Delete Relationship from ER Model
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
oTZEREMDO_DeleteRelationship( zVIEW  vTZEREMDO,
                              zSHORT nReposition,
                              zSHORT nQuietMode )
{
   zVIEW          vTZERSASO;
   zVIEW          vSubtask;
   zVIEW          vERD;
   zSHORT         nRC;
   unsigned long  ulZKey;
   LPLIBRARY      hLibrary = 0;  // used for dynamic call to ER control func's
   zFARPROC_RemoveFunc lpfn = 0;

   //  Positon on ER_RelType on Right Side( side representing relationships
   //  only ) thus allowing a single Delete to cascade and Delete all
   //  representations of the Relationship on both sides of the Object.
   nRC = SetCursorFirstEntityByEntityCsr( vTZEREMDO, "ER_RelType",
                                          vTZEREMDO, "ER_RelType_1",
                                          "EntpER_Model" );

   if ( GetViewByName( &vSubtask, "TZEREMDD", vTZEREMDO, zLEVEL_TASK ) > 0 )
   {
      if ( lpfn == 0 )   // only get func addr once
      {
         lpfn =(zFARPROC_RemoveFunc)
                  GetOperationDynamicCallAddress( vSubtask,(LPLPLIBRARY) &hLibrary,
                     "TZCTL", "RemoveRelationship", "(tzlooprs)" );
      }

      if ( lpfn )
        (*lpfn)( vSubtask, "ERD", 0, 0 );
   }

   // if delete Relationship and this Relationship is a part of the
   // Identifier, then delete the Relationship from the Identifier
   CreateViewFromViewForTask( &vERD, vTZEREMDO, 0 );

   for ( nRC = SetCursorFirstEntity( vERD, "ER_RelLink_2", "" );
         nRC >= zCURSOR_SET;
         nRC = SetCursorNextEntity( vERD, "ER_RelLink_2", "" ) )
   {
      GetIntegerFromAttribute( &ulZKey, vERD, "ER_RelLink_2", "ZKey" );
      for ( nRC = SetCursorFirstEntityByInteger( vERD, "ER_RelLinkIdentifier",
                  "ZKey", ulZKey, "EntpER_Model" );
            nRC >= zCURSOR_SET;
            nRC = SetCursorNextEntityByInteger( vERD, "ER_RelLinkIdentifier",
                  "ZKey", ulZKey, "EntpER_Model" ))
      {
         if ( CheckExistenceOfEntity( vERD, "ER_AttributeIdentifier" ) == zCURSOR_NULL )
         {

            DeleteEntity( vERD, "ER_FactType", zREPOS_NONE );
         }

      }
   }

   DropView( vERD );

   nRC = DeleteEntity( vTZEREMDO, "ER_RelType", nReposition );
   if ( nReposition != zREPOS_NONE )
   {
      if ( nReposition == zREPOS_NEXT )
         SetCursorNextEntity( vTZEREMDO, "ER_RelLink", "" );
      else
         SetCursorPrevEntity( vTZEREMDO, "ER_RelLink", "" );
   }

   // It is possible that the ER_RelType we just deleted is part of an
   // opened Subject Area.  If so, we must be sure that Subject Area doesn't
   // have hanging SA_RelType entities that result from the deleted
   // relationships.
   if ( GetViewByName( &vTZERSASO, "TZERSASO", vTZEREMDO, zLEVEL_TASK ) > 0 )
   {
      nRC = SetCursorFirstEntity( vTZERSASO, "SA_RelType", 0 );
      while ( nRC >= zCURSOR_SET )
      {
         if ( CheckExistenceOfEntity( vTZERSASO, "ER_RelType" ) < zCURSOR_SET )
         {
            if ( GetViewByName( &vSubtask, "SAVIEW", vTZEREMDO, zLEVEL_TASK ) > 0 )
            {
               if ( lpfn == 0 )   // only get func addr once
               {
                  lpfn = (zFARPROC_RemoveFunc)
                     GetOperationDynamicCallAddress( vSubtask,
                                                     (LPLPLIBRARY) &hLibrary,
                                                     "TZCTL",
                                                     "RemoveRelationship",
                                                     "(tzlooprs)" );
               }
               if ( lpfn )
               (*lpfn)( vSubtask, "ERD", 0, 0 );
            }

            DeleteEntity( vTZERSASO, "SA_RelType", zREPOS_NONE );
         }

         nRC = SetCursorNextEntity( vTZERSASO, "SA_RelType", 0 );
      }
   }

   return( 0 );
}
예제 #25
0
파일: tzsixsko.c 프로젝트: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: zofnTZSIXSKO_BldXSK
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
zofnTZSIXSKO_BldXSK ( zVIEW vKZSIXSKO_Root,
                      zVIEW vKZSIXSKO, zVIEW vTZZOXODO,
                      zVIEW vTZTENVRO_REF )
{
   zVIEW  vTZZOXOD1;
   zVIEW  vTZZOXOD_TestWorkAttrib;
   zVIEW  vTZTENVR1;
   zPCHAR szDBMS;
   zSHORT nEntImpls;
   zSHORT nRC;
   zLONG  lEntityZKey;
   zSHORT nAttrCount = 0;
   zSHORT nEntitySet = 0;

   nRC = CreateViewFromViewForTask( &vTZTENVR1, vTZTENVRO_REF, 0 );
   nRC = CreateViewFromViewForTask( &vTZZOXOD1, vTZZOXODO, 0 );

   nRC = SetCursorFirstEntity( vTZZOXOD1, "ENTITY", "" );

   /*=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?
   ?? Was ist hier mit Work Entities ?
   ?? Wie koennen diese umgangen werden
   ?? natuerlich auch fuer Kinder beruecksichtigen
   **=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?*/

   /* Check physik, if no, then do not process this entity */
   if ( (nRC = CheckExistenceOfEntity( vTZZOXOD1,
                                       "DATARECORD" )) >= zCURSOR_SET )
   {
     // Suche SironKatalog in TE
     nRC = GetIntegerFromAttribute( &lEntityZKey, vTZZOXOD1, "ENTITY",
                                    "ERENT_TOK" );
     nRC = SetCursorFirstEntityByInteger( vTZTENVR1, "ER_Entity",
                                          "ZKey", lEntityZKey,
                                          "TE_DBMS_Source" );
     if ( nRC < zCURSOR_SET )
     {
         GetAddrForAttribute( &szDBMS,
                              vTZTENVR1, "TE_DBMS_Source", "DBMS" );
           nEntImpls = 0;
           for ( nRC = SetCursorFirstEntityByInteger( vTZTENVR1, "ER_Entity",
                                                      "ZKey", lEntityZKey,
                                                      "TE_DB_Environ" );
               nRC > zCURSOR_UNCHANGED;
               nRC = SetCursorNextEntityByInteger( vTZTENVR1, "ER_Entity",
                                             "ZKey", lEntityZKey,
                                             "TE_DB_Environ" ) )
           {
              if ( CompareAttributeToString( vTZTENVR1, "TE_DBMS_Source",
                                             "DBMS", szDBMS ) == 0 )
              {
                 nEntImpls++;
              }
           }

           if ( nEntImpls == 1 )
           {
              nRC = zCURSOR_SET;
           }
           else
           if ( nEntImpls > 1 )
           {
              for ( nRC = SetCursorFirstEntityByInteger( vTZTENVR1, "ER_Entity",
                                                         "ZKey", lEntityZKey,
                                                         "TE_DB_Environ" );
                    nRC > zCURSOR_UNCHANGED;
                    nRC = SetCursorNextEntityByInteger( vTZTENVR1, "ER_Entity",
                                                        "ZKey", lEntityZKey,
                                                        "TE_DB_Environ" ) )
              {
                 if ( CompareAttributeToString( vTZTENVR1, "TE_DBMS_Source",
                                                "DBMS", szDBMS ) == 0 )
                 {
                    zstrcpy( szMsg, "Do you want to use Data Source '" );
                    GetAddrForAttribute( &szMsgName,
                                    vTZTENVR1, "TE_DBMS_Source", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "' to implement ER Entity '" );
                    GetAddrForAttribute( &szMsgName,
                                         vTZTENVR1, "ER_Entity", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "'?" );
                    nRC = MessagePrompt ( vTZTENVR1, "XOD_06", "TE Choice",
                                         szMsg, 0, zBUTTONS_YESNO, 0, 0 );
                    if ( nRC == zRESPONSE_YES )
                       break;   // found Entity implemented in same DBMS
                 }
              }
           }

           if ( nRC < zCURSOR_SET )
           {
              zstrcpy( szMsg,
                       "Unable to Find Entity in TE Data Source with same "
                         "DBMS.\n\nEntity Name = " );
              GetAddrForAttribute( &szMsgName, vTZZOXOD1, "ENTITY", "NAME" );
              zstrcat( szMsg, szMsgName );
              nRC = MessagePrompt( vTZZOXOD1, "XOD_03",
                                   "Internal LOD Error", szMsg,
                                   0, zBUTTONS_OK, 0, 0 );
              return( 0 );
           }
     }

     // Now: First Entity found
     //      if SironKatalog Exits
     //         create KATALOG and KATCOM entities
     //         create first ENTITY and ENTITYCOM entities
     //         create dependent ATTRIB and ATTRICOM entities
     nRC = CheckExistenceOfEntity ( vTZTENVR1, "SironKatalog" );
     if (  nRC >= zCURSOR_SET )
     {
        // Create KATALOG entity
        nRC = CreateEntity ( vKZSIXSKO_Root, "KATALOG", zPOS_AFTER );
        SetMatchingAttributesByName(vKZSIXSKO_Root, "KATALOG",
                               vTZTENVR1, "SironKatalog", zSET_ALL );

        for ( nRC = SetCursorFirstEntity( vTZTENVR1,
                                   "KatalogComment", "SironKatalog");
              nRC > zCURSOR_UNCHANGED;
              nRC = SetCursorNextEntity( vTZTENVR1,
                                  "KatalogComment", "SironKatalog") )
        {
          CreateEntity ( vKZSIXSKO_Root, "KATCOM", zPOS_AFTER );
          SetMatchingAttributesByName( vKZSIXSKO_Root, "KATCOM",
                             vTZTENVR1, "KatalogComment", zSET_ALL );
        }

        // Create first ENTITY entity
        nRC = CreateEntity ( vKZSIXSKO_Root, "ENTITY", zPOS_AFTER );
        nEntitySet = 1;
        SetMatchingAttributesByName(vKZSIXSKO_Root, "ENTITY",
                                    vTZTENVR1, "OrigSironField", zSET_ALL );
        SetAttributeFromAttribute( vKZSIXSKO_Root, "ENTITY", "ERENT_TOK",
                                   vTZZOXOD1,      "ENTITY", "ERENT_TOK" );

        for ( nRC = SetCursorFirstEntity( vTZTENVR1,
                                          "FieldComment", "OrigSironField");
              nRC > zCURSOR_UNCHANGED;
              nRC = SetCursorNextEntity( vTZTENVR1,
                                        "FieldComment", "OrigSironField") )
        {
          CreateEntity ( vKZSIXSKO_Root, "ENTITYCOM", zPOS_AFTER );
          SetMatchingAttributesByName( vKZSIXSKO_Root, "ENTITYCOM",
                                       vTZTENVR1, "FieldComment",
                                       zSET_ALL );
        }

        // Create all dependent ATTRIB entities
        //                             according to XOD ATTRIB entities
        for ( nRC = SetCursorFirstEntity( vTZZOXOD1, "ATTRIB", "ENTITY");
              nRC > zCURSOR_UNCHANGED;
              nRC = SetCursorNextEntity( vTZZOXOD1, "ATTRIB", "ENTITY") )
        {
          // If the Attribute is a Workattribute there is no Datafield.
          // Do not save the Workattributes in the XSK-file.
          nRC = CreateViewFromViewForTask( &vTZZOXOD_TestWorkAttrib, vTZZOXOD1, 0 );
          nRC = SetCursorFirstEntityByAttr (vTZZOXOD_TestWorkAttrib, "DATAFIELD",
                                            "FLDNAME",
                                            vTZZOXOD1, "ATTRIB", "NAME", "");

          if (nRC == zCURSOR_SET)
          {
             nRC = SetCursorFirstEntityByAttr
                        ( vTZTENVR1, "TE_FieldDataRel", "Name",
                          vTZZOXOD1, "ATTRIB", "NAME", "TE_TablRec");


             CreateEntity ( vKZSIXSKO_Root, "ATTRIB", zPOS_AFTER );
             SetMatchingAttributesByName( vKZSIXSKO_Root, "ATTRIB",
                                       vTZTENVR1, "SironField", zSET_ALL );
             SetAttributeFromAttribute( vKZSIXSKO_Root, "ATTRIB", "XVAATT_TOK",
                                     vTZZOXOD1,      "ATTRIB", "XVAATT_TOK" );
             // Create all dependent ATTRIBCOM entities
             for ( nRC = SetCursorFirstEntity( vTZTENVR1,"SironFieldComment","SironField");
                nRC > zCURSOR_UNCHANGED;
                nRC = SetCursorNextEntity( vTZTENVR1,"SironFieldComment","SironField") )
             {
                CreateEntity ( vKZSIXSKO_Root, "ATTRIBCOM", zPOS_AFTER );
                SetMatchingAttributesByName( vKZSIXSKO_Root, "ATTRIBCOM",
                                         vTZTENVR1, "SironFieldComment", zSET_ALL );
             }
          }

          DropView( vTZZOXOD_TestWorkAttrib );
        }
     }
   }

   nRC = CheckExistenceOfEntity( vTZZOXOD1, "CHILDENTITY" );
   if ( nRC >= zCURSOR_SET )
        zofnTZSIXSKO_BldXSKChildEnt( vKZSIXSKO_Root, vKZSIXSKO, vTZZOXOD1,
                                     vTZTENVRO_REF, nEntitySet );

   nRC = DropView( vTZZOXOD1 );
   nRC = DropView( vTZTENVR1 );
   return( 0 );
}
예제 #26
0
/*

   This operation builds the operation list for the OperationList window.
   Depending on what the value is for vProfileXFER.ED.OpIns_CurrentType
   we build different operations lists.

*/
zOPER_EXPORT zSHORT OPERATION
OpIns_BuildOperList( zVIEW vSubtask )
{
#define DISP_SELECT_SET    1
#define SEL_SELECT_SET     2

   zCHAR  szCurrentType[ 5 ];
   zVIEW  vProfileXFER;
   zVIEW  vEdWrk;
   zSHORT nRC;
   zCHAR  szKeyword[ 255 ];
   zLONG  lSelectCount = 0;

   GetWorkView( &vEdWrk );
   GetProfileView( &vProfileXFER );
   GetStringFromAttribute( szCurrentType, vProfileXFER, "ED",
                           "OpIns_CurrentType" );

   // Default of CurrentType is 'Z'...
   if ( *szCurrentType == 0 )
   {
      zstrcpy( szCurrentType, "Z" );
      SetAttributeFromString( vProfileXFER, "ED", "OpIns_CurrentType",
                              szCurrentType );
   }

   // Check to see if the operations for the current type are already
   // loaded. If they are, then we obviously don't need to load them again.
   if ( SetCursorFirstEntityByString( vEdWrk, "OperListType", "Type",
                                      szCurrentType, 0 ) != zCURSOR_SET )
   {
      // Operations haven't been loaded yet, so load 'em up.

      CreateEntity( vEdWrk, "OperListType", zPOS_LAST );
      SetAttributeFromString( vEdWrk, "OperListType", "Type", szCurrentType );

      switch ( *szCurrentType )
      {
         case 'Z':
         {
            zVIEW vTZOPSIGK;

            // Get list of Zeidon operations.

            // Check to see if we've already activated the Zeidon opers list.
            // If not, activate it and save the view.
            GetViewByName( &vTZOPSIGK, "TZOPSIGK", vSubtask, zLEVEL_TASK );
            if ( !vTZOPSIGK )
            {
               oTZOPGRPO_GetViewForXGO( vSubtask, &vTZOPSIGK, zSYS_CURRENT_OI );
               SetNameForView( vTZOPSIGK, "TZOPSIGK", vSubtask, zLEVEL_TASK );
            }

            // Now copy each of the operations to the editor work object.
            for ( nRC = SetCursorFirstEntity( vTZOPSIGK, "Operation", 0 );
                  nRC == zCURSOR_SET;
                  nRC = SetCursorNextEntity( vTZOPSIGK, "Operation", 0 ) )
            {
               CreateEntity( vEdWrk, "Oper", zPOS_LAST );
               SetMatchingAttributesByName( vEdWrk, "Oper",
                                            vTZOPSIGK, "Operation", zSET_ALL );
            }

            break;
         } // Case 'Z'...

         case 'G':
         {
            zVIEW vOp;

            // Get list of Global operations.

            RetrieveViewForMetaList( vSubtask, &vOp, zREFER_GO_META );

            // Now copy each of the operations to the editor work object.
            for ( nRC = SetCursorFirstEntity( vOp, "W_MetaDef", 0 );
                  nRC == zCURSOR_SET;
                  nRC = SetCursorNextEntity( vOp, "W_MetaDef", 0 ) )
            {
               CreateEntity( vEdWrk, "Oper", zPOS_LAST );
               SetMatchingAttributesByName( vEdWrk, "Oper",
                                            vOp, "W_MetaDef", zSET_ALL );
            }

            DropView( vOp );

            break;
         } // Case 'G'...

         case 'L':
         {
            zVIEW vMeta;
            zLONG lMetaType;

            // Get list of "Local" operations.  "Local" operations in this
            // case mean all operations that are for the current meta.
            // For example, if the current meta is a Dialog, then the "Local"
            // operations include local and Dialog operations.

            // Get the source view and the meta type.
            GetIntegerFromAttribute( (zPLONG) &vMeta, vEdWrk, "Buffer",
                                     "SourceViewID" );
            GetIntegerFromAttribute( &lMetaType, vEdWrk, "Buffer",
                                     "MetaType" );

            // Create a new, temp view of the meta so that we can muck around
            // with the cursors.
            CreateViewFromViewForTask( &vMeta, vMeta, 0 );

            //
            // Now copy the "Local" meta operations to vEdWrk.
            //

            if ( lMetaType == zREFER_DIALOG_META ||
                 lMetaType == zREFER_LOD_META )
            {
               // Make sure we are reading the "Local" operations for
               // the current source file.
               SetCursorFirstEntityByAttr( vMeta, "SourceFile", "Name",
                                           vEdWrk, "Buffer",
                                           "SourceFileName", 0 );
            }

            // Copy all the operations to vEdWrk
            for ( nRC = SetCursorFirstEntity( vMeta, "Operation", 0 );
                  nRC == zCURSOR_SET;
                  nRC = SetCursorNextEntity( vMeta, "Operation", 0 ) )
            {
               CreateEntity( vEdWrk, "Oper", zPOS_LAST );
               SetMatchingAttributesByName( vEdWrk, "Oper",
                                            vMeta, "Operation",
                                            zSET_ALL );
            }

            DropView( vMeta );

            break;

         } // Case 'L'...

         case 'O':
         {
            // Since we load the object operations by object, we don't have
            // to do anything here.
            break;

         } // Case 'O'...

         default:
            SysMessageBox( "Zeidon Internal",
                           "This operation type not yet supported", 0 );
            break;

      } // switch ( *szCurrentType )...

      // Now that we've loaded the operations, sort them.
      OrderEntityForView( vEdWrk, "Oper", "Name A" );

   } // if ( SetCursor...)...

   // Disable the "Objects" button unless we are showing object operations.
   if ( *szCurrentType == 'O' )
      SetCtrlState( vSubtask, "ListObjects", zCONTROL_STATUS_ENABLED, TRUE );
   else
      SetCtrlState( vSubtask, "ListObjects", zCONTROL_STATUS_ENABLED, FALSE );

   // Now set the select states depending on the keyword values.
   GetStringFromAttribute( szKeyword, vProfileXFER, "ED", "OpIns_Keyword" );
   if ( *szKeyword &&
        CompareAttributeToString( vProfileXFER,
                                  "ED", "OpIns_UseKeyword", "Y" ) == 0 )
   {
      zCHAR  szIgnoreCase[ 5 ];
      zPCHAR pszKeyword;
      zBOOL  bStartColOne;
      zSHORT nKeywordLth;

      // De-select all operations.
      SetAllSelectStatesForEntity( vEdWrk, "Oper", FALSE, 0 );

      GetStringFromAttribute( szIgnoreCase, vProfileXFER, "ED",
                              "OpIns_KeywordIgnoreCase" );
      if ( *szIgnoreCase == 'Y' )
      {
         for ( pszKeyword = szKeyWord; *pszKeyword; pszKeyword++ )
            *pszKeyword = ztoupper( *pszKeyword );
      }

      // If the keyword starts with a "/", then the keyword search starts
      // with the first zCHAR (e.g. column) ONLY.
      pszKeyword = szKeyword;
      if ( *pszKeyword == '/' )
      {
         pszKeyword++;
         bStartColOne = TRUE;
         nKeywordLth = zstrlen( pszKeyword );
      }
      else
         bStartColOne = FALSE;

      for ( nRC = SetCursorFirstEntity( vEdWrk, "Oper", 0 );
            nRC == zCURSOR_SET;
            nRC = SetCursorNextEntity( vEdWrk, "Oper", 0 ) )
      {
         zCHAR  szOperName[ 255 ];

         GetStringFromAttribute( szOperName, vEdWrk, "Oper", "Name" );
         if ( *szIgnoreCase == 'Y' )
            strupr( szOperName );

         if ( bStartColOne )
         {
            if ( zstrncmp( szOperName, pszKeyword, nKeywordLth ) == 0 )
            {
               SetSelectStateOfEntity( vEdWrk, "Oper", TRUE );
               lSelectCount++;
            }
         }
         else
         {
            if ( strstr( szOperName, pszKeyword ) )
            {
               SetSelectStateOfEntity( vEdWrk, "Oper", TRUE );
               lSelectCount++;
            }
         }
      } // for...
   }
   else
   {
      // Select all operations.
      SetAllSelectStatesForEntity( vEdWrk, "Oper", TRUE, 0 );
      lSelectCount = CountEntitiesForView( vEdWrk, "Oper" );
   }

   //SetSelectSetForView( vEdWrk, nOldSelectSet );
   SetCursorFirstSelectedEntity( vEdWrk, "Oper", 0 );
   LB_SetDisplaySelectSet( vSubtask, "OperationList", DISP_SELECT_SET );
   LB_SetSelectSelectSet( vSubtask, "OperationList", SEL_SELECT_SET );

   // Re-use szKeyword to set the message...
   sprintf( szKeyword, "%d Operations listed", lSelectCount );
   MB_SetMessage( vSubtask, 0, szKeyword );

   RefreshWindow( vSubtask );

   return( 0 );

} // OpIns_BuildOperList
예제 #27
0
파일: tzsixsko.c 프로젝트: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: zofnTZSIXSKO_BldXSKChildEnt
//
// PURPOSE:
//
// TRIGGLODED BY:
//    WINDOW: TZZOLODD
//    ACTION: OPTION
//    NAME: File_Save
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
zofnTZSIXSKO_BldXSKChildEnt ( zVIEW vKZSIXSKO_Root,
                              zVIEW vKZSIXSKO, zVIEW vTZZOXOD1,
                              zVIEW vTZTENVRO_REF,
                              zSHORT nEntityFlag )
{
   zVIEW  vTZTENVRO_Parent;
   zSHORT nRC;
   zSHORT nRC2;
   zPCHAR szDBMS;
   zSHORT nEntImpls;
   zLONG  lEntityZKey;
   zSHORT nEntitySet    = nEntityFlag;
   zSHORT nSetViewToSubXsk = 0;

   nRC = CreateViewFromViewForTask( &vTZTENVRO_Parent, vTZTENVRO_REF, 0 );

   nRC = zCURSOR_SET;
   while ( nRC >= zCURSOR_SET )
   {
      nRC = SetViewToSubobject( vTZZOXOD1, "CHILDENTITY" );

      /* Check physik, if no, then do not process this entity */
      if ( (nRC = CheckExistenceOfEntity ( vTZZOXOD1, "DATARECORD" )) >= zCURSOR_SET )
      {

         nRC = GetIntegerFromAttribute( &lEntityZKey, vTZZOXOD1,
                                        "ENTITY", "ERENT_TOK" );
         nRC = SetCursorFirstEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                              "ZKey", lEntityZKey,
                                              "TE_DBMS_Source" );
         if ( nRC < zCURSOR_SET )
         {
            GetAddrForAttribute( &szDBMS,
                                 vTZTENVRO_Parent, "TE_DBMS_Source", "DBMS" );
            nEntImpls = 0;
            for ( nRC = SetCursorFirstEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                "ZKey", lEntityZKey,
                                                "TE_DB_Environ" );
                  nRC > zCURSOR_UNCHANGED;
                  nRC = SetCursorNextEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                "ZKey", lEntityZKey,
                                                "TE_DB_Environ" ) )
            {
               if ( CompareAttributeToString( vTZTENVRO_Parent, "TE_DBMS_Source", "DBMS",
                               szDBMS ) == 0 )
               {
                  nEntImpls++;
               }
            }
            if ( nEntImpls == 1 )
            {
               nRC = zCURSOR_SET;
            }
            else
            if ( nEntImpls > 1 )
            {
              for ( nRC = SetCursorFirstEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                  "ZKey", lEntityZKey,
                                                  "TE_DB_Environ" );
                    nRC > zCURSOR_UNCHANGED;
                    nRC = SetCursorNextEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                  "ZKey", lEntityZKey,
                                                  "TE_DB_Environ" ) )
              {
                 if ( CompareAttributeToString( vTZTENVRO_Parent, "TE_DBMS_Source", "DBMS",
                                szDBMS ) == 0 )
                 {
                    zstrcpy( szMsg, "Do you want to use Data Source '" );
                    GetAddrForAttribute( &szMsgName,
                                         vTZTENVRO_Parent, "TE_DBMS_Source", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "' to implement ER Entity '" );
                    GetAddrForAttribute( &szMsgName,
                                         vTZTENVRO_Parent, "ER_Entity", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "'?" );
                    nRC = MessagePrompt ( vTZTENVRO_Parent, "XOD_06", "TE Choice",
                                          szMsg, 0, zBUTTONS_YESNO, 0, 0 );
                    if ( nRC == zRESPONSE_YES )
                        break;   // found Entity implemented in same DBMS
                 }
              }
            }

            if ( nRC < zCURSOR_SET )
            {
               zstrcpy( szMsg, "Unable to Find Entity in TE Data Source with same DBMS.\n\nEntity Name = " );
               GetAddrForAttribute( &szMsgName, vTZZOXOD1, "ER_EntityRec", "Name" );
               zstrcat( szMsg, szMsgName );
               nRC = MessagePrompt( vTZZOXOD1, "XOD_06", "Internal LOD Error", szMsg, 0,
                                    zBUTTONS_OK, 0, 0 );
               nRC = DropView( vTZTENVRO_Parent );
               return( 0 );
            }
         }

         //  new Entity found
         //  if SironGroup exists
         //     if SironKatalog exists
         //        create new Katalog
         //     create next ENTITY and ENTITYCOM entities
         //     create dependent ATTRIB and ATTRICOM entities
         nRC = CheckExistenceOfEntity ( vTZTENVRO_Parent, "SironGroup" );
         if ( nRC >= zCURSOR_SET )
         {
          nRC = CheckExistenceOfEntity ( vTZTENVRO_Parent, "SironKatalog" );
          if ( nRC >= zCURSOR_SET )
          {
            // Go back to KATALOG entity
            if ( nEntitySet )
            {
              while ( ResetViewFromSubobject( vKZSIXSKO_Root ) == 0 );
            }

            // Create new  KATALOG entity
            nRC = SetCursorLastEntity ( vKZSIXSKO_Root, "KATALOG", "" );
            nRC = CreateEntity ( vKZSIXSKO_Root, "KATALOG", zPOS_AFTER );
            SetMatchingAttributesByName(vKZSIXSKO_Root, "KATALOG",
                                        vTZTENVRO_Parent, "SironKatalog", zSET_ALL );

            for ( nRC = SetCursorFirstEntity( vTZTENVRO_Parent,
                                            "KatalogComment", "SironKatalog");
                  nRC > zCURSOR_UNCHANGED;
                  nRC = SetCursorNextEntity( vTZTENVRO_Parent,
                                             "KatalogComment", "SironKatalog") )
            {
              CreateEntity ( vKZSIXSKO_Root, "KATCOM", zPOS_AFTER );
              SetMatchingAttributesByName( vKZSIXSKO_Root, "KATCOM",
                                           vTZTENVRO_Parent, "KatalogComment", zSET_ALL );
            }
          }

          // ViewToSubobject only, if caller created an ENTITY entity
          if ( nEntitySet )
          {
            if ( CheckExistenceOfEntity( vKZSIXSKO_Root, "ENTITY" )
                                                             >= zCURSOR_SET )
            {
               SetViewToSubobject( vKZSIXSKO_Root, "ENTITYCHILD" );
               nSetViewToSubXsk = 1;
            }
          }

          // Create next ENTITY entity
          nRC = SetCursorLastEntity ( vKZSIXSKO_Root, "ENTITY", "" );
          nRC = CreateEntity ( vKZSIXSKO_Root, "ENTITY", zPOS_AFTER );
          nEntitySet = 1;
          SetMatchingAttributesByName(vKZSIXSKO_Root, "ENTITY",
                                      vTZTENVRO_Parent, "SironGroup", zSET_ALL );
          SetAttributeFromInteger( vKZSIXSKO_Root, "ENTITY", "ERENT_TOK",
                                   lEntityZKey );

          for ( nRC = SetCursorFirstEntity( vTZTENVRO_Parent, "GroupComment", "SironGroup");
                nRC > zCURSOR_UNCHANGED;
                nRC = SetCursorNextEntity( vTZTENVRO_Parent, "GroupComment", "SironGroup") )
          {
            CreateEntity ( vKZSIXSKO_Root, "ENTITYCOM", zPOS_AFTER );
            SetMatchingAttributesByName( vKZSIXSKO_Root, "ENTITYCOM",
                                         vTZTENVRO_Parent, "GroupComment", zSET_ALL );
          }

          // Create all dependent ATTRIB entities according to XOD ATTRIB
          // entities
          for ( nRC  = SetCursorFirstEntity( vTZZOXOD1, "ATTRIB", "ENTITY");
                nRC  > zCURSOR_UNCHANGED;
                nRC  = SetCursorNextEntity( vTZZOXOD1, "ATTRIB", "ENTITY") )
          {
             nRC = SetCursorFirstEntityByAttr( vTZTENVRO_Parent,
                                               "TE_FieldDataRel","Name",
                                               vTZZOXOD1, "ATTRIB", "NAME",
                                               "TE_TablRec");

             nRC = CheckExistenceOfEntity( vTZTENVRO_Parent, "SironField" );
             if ( nRC < zCURSOR_SET )
             {
               zstrcpy( szMsg,
       "Unable to Find SironField in TE Data Source .\n\nAttribute Name = " );
               GetAddrForAttribute( &szMsgName, vTZZOXOD1, "ATTRIB", "NAME" );
               zstrcat( szMsg, szMsgName );
               nRC = MessagePrompt ( vTZZOXOD1, "XOD_06",
                                     "Internal XOD Error", szMsg,
                                     0, zBUTTONS_OK, 0, 0 );
               nRC = DropView( vTZTENVRO_Parent );
               return( 0 );
             }

             CreateEntity( vKZSIXSKO_Root, "ATTRIB", zPOS_AFTER );
             SetMatchingAttributesByName( vKZSIXSKO_Root, "ATTRIB",
                                          vTZTENVRO_Parent, "SironField", zSET_ALL );
             SetAttributeFromAttribute( vKZSIXSKO_Root, "ATTRIB", "XVAATT_TOK",
                                        vTZZOXOD1,      "ATTRIB", "XVAATT_TOK" );

             // Create all dependent ATTRIBCOM entities
             for ( nRC = SetCursorFirstEntity( vTZTENVRO_Parent,
                                               "SironFieldComment","SironField");
                   nRC > zCURSOR_UNCHANGED;
                   nRC = SetCursorNextEntity( vTZTENVRO_Parent,
                                              "SironFieldComment","SironField"))
             {
               CreateEntity ( vKZSIXSKO_Root, "ATTRIBCOM", zPOS_AFTER );
               SetMatchingAttributesByName( vKZSIXSKO_Root, "ATTRIBCOM",
                                            vTZTENVRO_Parent, "SironFieldComment",
                                            zSET_ALL );
             }
          }
        }
      }

      // Abstieg des Pfades
      nRC = CheckExistenceOfEntity( vTZZOXOD1, "CHILDENTITY" );
      if ( nRC >= zCURSOR_SET )
              zofnTZSIXSKO_BldXSKChildEnt( vKZSIXSKO_Root, vKZSIXSKO,
                   vTZZOXOD1, vTZTENVRO_Parent, nEntitySet );

      nRC2 = ResetViewFromSubobject( vTZZOXOD1 );
      if ( nSetViewToSubXsk )
      {
        nRC2 = ResetViewFromSubobject( vKZSIXSKO_Root );
        nSetViewToSubXsk = 0;
      }

      nRC  = SetCursorNextEntity( vTZZOXOD1, "CHILDENTITY", "" );
   }

   if ( vTZTENVRO_Parent )
      nRC = DropView( vTZTENVRO_Parent );

   return( 0 );
}
예제 #28
0
파일: TzCtlTAB.cpp 프로젝트: DeegC/10d
/////////////////////////////////////////////////////////////////////////////
//
//  CONSTRUCTOR: Tab sub-control (to group controls at the tab level)
//
/////////////////////////////////////////////////////////////////////////////
// ctor
TZNotePage::TZNotePage( TZPainterWindow *pPainterWindow,
                        TZPainterCtrl   *pCtrlParent,
                        CWnd    *pWndParent,
                        CRect&  rect,
                        zVIEW   vCtrl,
                        zLONG   lType,
                        zBOOL   bPlaceHolder,
                        zLONG   lZKey,
                        zLONG   lTabStopNbr,
                        zLONG   lCtrlID,
                        zPCHAR  pchTag,
                        zPCHAR  pchText ) :
            CWnd( ),
            TZPainterCtrl( pPainterWindow, pCtrlParent, pWndParent,
                           rect, vCtrl, this, pchTag, pchText,
                           lType, bPlaceHolder, lZKey, lTabStopNbr, lCtrlID )
{
#ifdef DEBUG_ALL
   TraceLineS( "TZNotePage::ctor ", m_csTag );
#endif
   m_pNext = 0;
   m_uVisible = 0x0100;

   m_lSubtype = 0;

   m_pZNoteBook = DYNAMIC_DOWNCAST( TZNoteBook, pWndParent );
   if ( m_pZNoteBook == 0 )
      return;

   zPCHAR pch;
   zLONG  lTabNbr;
   zLONG  lLth;

   if ( vCtrl )
   {
      GetAddrForAttribute( &pch, vCtrl, szlControl, szlText );
      lLth = zstrlen( pch ) + 1;
      m_pchCaption = new char[ lLth ];
      strcpy_s( m_pchCaption, lLth, pch );
      GetIntegerFromAttribute( &lTabNbr, vCtrl, szlControl, szlType );
      if ( lTabNbr == 0 )
      {
         zVIEW vTemp;

         m_pZNoteBook->m_nTabNbrMax++;
         CreateViewFromViewForTask( &vTemp, vCtrl, pPainterWindow->m_vDialog );
         ResetViewFromSubobject( vTemp );
         while ( SetCursorFirstEntityByInteger( vTemp, szlCtrlCtrl, szlType,
                                                m_pZNoteBook->m_nTabNbrMax, 0 ) == zCURSOR_SET )
         {
            m_pZNoteBook->m_nTabNbrMax++;
         }

         SetAttributeFromInteger( vCtrl, szlControl, szlType, m_pZNoteBook->m_nTabNbrMax );
         m_lSubtype = m_pZNoteBook->m_nTabNbrMax;
         DropView( vTemp );
      }
      else
      {
         if ( lTabNbr > m_pZNoteBook->m_nTabNbrMax )
            m_pZNoteBook->m_nTabNbrMax = (zSHORT) lTabNbr;

         m_lSubtype = m_pZNoteBook->m_nTabNbrMax;
      }

      if ( MiGetUpdateForView( vCtrl ) > 0 )
      {
         SetAttributeFromAttribute( vCtrl, szlControl, szlSyncKey, vCtrl, szlControl, szlType );
      }
   }
   else
   {
      m_pZNoteBook->m_nTabNbrMax++;
      m_lSubtype = m_pZNoteBook->m_nTabNbrMax;
      lTabNbr = m_pZNoteBook->m_nTabNbrMax;
      lLth = zstrlen( pchText ) + 1;
      m_pchCaption = new char[ lLth ];
      strcpy_s( m_pchCaption, lLth, pchText );
   }

// TraceRect( "TabCtl rect ", rect );
// TraceLineI( "    Attr.X ", Attr.X );
// TraceLineI( "    Attr.Y ", Attr.Y );
// TraceLineI( "    Attr.W ", Attr.W );
// TraceLineI( "    Attr.H ", Attr.H );

   // Build sub-controls on demand (only when visible or selectable).
   m_bBuildOnDemand = TRUE;

   if ( m_pZNoteBook->m_pZNotePage )
   {
      m_nTabIdx = 1;
      TZNotePage *pCurrNotePage = m_pZNoteBook->m_pZNotePage;
      while ( pCurrNotePage->m_pNext )
      {
         m_nTabIdx++;
         pCurrNotePage = pCurrNotePage->m_pNext;
      }

      pCurrNotePage->m_pNext = this;
   }
   else
   {
      m_nTabIdx = 0;
      m_pZNoteBook->m_pZNotePage = this;
   }

// m_nTabNbr = (zSHORT) lTabNbr;
   m_nTabNbr = m_nTabIdx + 1;
   m_pZNoteBook->m_nPageCnt++;

   TC_ITEM TabCtrlItem;
   TabCtrlItem.mask = TCIF_TEXT;
   TabCtrlItem.pszText = m_pchCaption;
#ifdef DEBUG_ALL
   TraceLineS( "Adding TabCtrlItem: ", m_pchCaption );
#endif
   m_pZNoteBook->InsertItem( m_nTabIdx, &TabCtrlItem );

//?Attr.StyleEx = WS_EX_TRANSPARENT;
//?Attr.Style &= ~(WS_CLIPSIBLINGS | WS_CLIPCHILDREN);

   CreateZ( );
}