Пример #1
0
zOPER_EXPORT zSHORT OPERATION
VML_StartHelp( zVIEW vSubtask )
{

   zCHAR  szBuffer[60];
   zPCHAR pszText;

   zSHORT nRC;
   zSHORT i;
   zSHORT j;

   zVIEW  vProfileXFER;


   // GET ADDRESS OF THE STRING FOR THE TEXT IN THE LIST BOX
   GetProfileView( &vProfileXFER );
   GetAddrForAttribute( &pszText,       /* Return Address */
                        vProfileXFER,  /* View Id */
                        "VML_Text",    /* Entity name */
                        "Text" /* Attribute Name */ );

   // EXTRACT FIRST ALL CAP WORD FROM pszText
   i = 0;
   j = 0;

   // look for first cap
   while ( !isupper( pszText[ i ] ) &&  /* not upper case */
           pszText[ i ] != 0 )          /* not null terminator */
   {
      i++;
   }

   // if no cap is found, no help is available. get out now.
   if ( pszText[ i ] == 0)
   {
      MB_SetMessage( vSubtask, 0, "Help for this operation is not currently available." );
      return( 0 );
   }

   // copy first all cap word into the buffer
   while ( isupper( pszText[ i ] )  &&      /* upper case */
           pszText[ i ] != 0 &&             /* not null terminator */
           j < 59 )                         /* room left in buffer */
   {
      szBuffer[ j++ ] = pszText[ i++ ];
   }
   szBuffer[j] = 0;

   // CALL HELP
   nRC = StartZeidonHelp( vSubtask, szBuffer );

   // IF HELP WAS NOT FOUND, NOTIFY THE USER.
   if ( nRC == zCALL_ERROR )
   {
      MB_SetMessage( vSubtask, 0, "Help for this item is not available." );
   }

   return( 0 );
}
Пример #2
0
/////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: fnPopMsgQ_State
//
// PURPOSE: This routine pops the state of the message queue object
//
/////////////////////////////////////////////////////////////////////////////
zLONG
fnPopMsgQ_State( zVIEW vMsgQ )
{
   zPCHAR  pStack;    // blob containing Status Stack
   zLONG   lPrevState = 0;
   zUSHORT uCnt;

#ifdef zREMOTE_SERVER
   // Protect this with a semaphore!!!
   SysMutexLock( vSubtask, "ZDm", 0, 0 );
// TraceLineS( "PopMsgQ_State Lock Mutex ZDm", "" );
#endif

   GetAddrForAttribute( (zPCHAR *) &pStack, vMsgQ, szlTask, szlStatus );
   if ( pStack )
   {
      uCnt = *((zPSHORT) (pStack + sizeof( zLONG )));

      if ( uCnt > 0 )
      {
         uCnt--;
         *((zPSHORT) (pStack + sizeof( zLONG ))) = uCnt;
      }
      else
      {
         OperatorSend( 0, szlDrvr, "Cannot pop message queue", TRUE );
      }

      if ( uCnt )
      {
         lPrevState = *((zPLONG) (pStack + // sizeof( zLONG ) + the extra long is in uCnt
                         2 * sizeof( zSHORT ) + uCnt * sizeof( zLONG )));
      }
      else
         lPrevState = 0;

      *((zPLONG) pStack) = lPrevState;
   }
   else
   {
      TraceLineS( "PopMsgQ_State Lock Mutex ZDm: ", "NULL Status?" );
      DisplayObjectInstance( vMsgQ, 0, 0 );
      ::MessageBox( 0, "PushMsgQ_State NULL Status?", "ZDr Error", MB_OK );
   }

#ifdef zREMOTE_SERVER
// TraceLineS( "PopMsgQ_State Unlock Mutex ZDm", "" );
   SysMutexUnlock( vSubtask, "ZDm", 0 );
#endif

   return( lPrevState );
}
Пример #3
0
// Get the data from the OI and use it to set the check for the check button
// appropriately.
zSHORT
ZCheckBox::MapFromOI( WPARAM wFlag )
{
// if ( zstrcmp( *m_pzsTag, "CheckAutoCreateActOnCatChg" ) == 0 )
//    TraceLineS( "ZCheckBox::MapFromOI ", *m_pzsTag );

   // If the control is not Visible, do not do mapping.
   if ( IsVisibleForMapFromOI( ) == FALSE )
      return( 0 );

   m_ulMapActFlag2 |= zMAPACT_MAPPED_FROM_OI1;
   if ( m_pzsVName && m_pzsEName && m_pzsAName )
   {
      zPCHAR pch;
      zBOOL  bCheck = FALSE;
      zULONG ulLth;
      zCHAR  szMap[ 256 ];
      zVIEW  vApp;

      zUSHORT uMapState = GetMappingAutoGray( &vApp, *m_pzsVName,
                                              *m_pzsEName,
                                              *m_pzsAName );
      if ( vApp && (uMapState & zMAPACT_ENTITY_EXISTS) )
      {
         GetAttributeLength( &ulLth, vApp, *m_pzsEName, *m_pzsAName );
         if ( ulLth >= sizeof( szMap ) )
         {
            GetAddrForAttribute( (zPCHAR *) &pch, vApp,
                                 *m_pzsEName, *m_pzsAName );
         }
         else
         {
            GetVariableFromAttribute( szMap, 0, zTYPE_STRING, 256,
                                      vApp, *m_pzsEName,
                                      *m_pzsAName, *m_pzsContext, 0 );
            pch = szMap;
         }

         // determine check or uncheck
         bCheck = (zstrcmp( pch, *m_pzsValueOn ) ? 0 : 1);
      }

      SetCheck( bCheck );
      return( 0 );
   }

   return( -1 );
}
Пример #4
0
/////////////////////////////////////////////////////////////////////////////
//
// ENTRY:
//
// PURPOSE:    Set the title of the window to contain the LPLR Name.
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
zwTZHKEYAD_SetTitle( zVIEW vSubtask )
{
   zVIEW vLPL;
   zPCHAR szLPL_Name;

   // Set LPL Name on Window Title.
   GetViewByName( &vLPL, "TaskLPLR", vSubtask, zLEVEL_TASK );
   if ( vLPL )
   {
      GetAddrForAttribute( &szLPL_Name, vLPL, "LPLR", "Name" );
      SetWindowCaptionTitle( vSubtask, 0, szLPL_Name );
   }

   return( 0 );
}
Пример #5
0
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: AddAttributeToMemory
//
// Returns: >= 0 - Resultant length of string in memory
//                 Attribute successfully retrieved
//           < 0 - Error retrieving attribute
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zLONG  OPERATION
AddAttributeToMemory( zLONG    hMemory,
                      zVIEW    vApp,
                      zCPCHAR  cpcEntityName,
                      zCPCHAR  cpcAttributeName,
                      zLONG    lFlag )
{
   ZDrMemory *pMemory = (ZDrMemory *) hMemory;
   zPCHAR pch;
   zLONG  nRC;

   nRC = GetAddrForAttribute( &pch, vApp, cpcEntityName, cpcAttributeName );
   if ( nRC == 0 )
      return( pMemory->AddStringToMemory( pch, lFlag ) );
   else
      return( zCALL_ERROR );
}
Пример #6
0
zSHORT  /* LOCAL */  OPERATION
zwTZCMRPTD_ExportTextAUX( zVIEW vSubtask,
                          zPCHAR pszFileName )
{
   zVIEW   vTZBRAU3O;
   zLONG   lfFile;
   zCHAR   szMsg[ 256 ];
   zCHAR   szText[ 1000 ];
   zPCHAR  szAttr;

   if ( GetViewByName( &vTZBRAU3O, "TZBRAU3O", vSubtask, zLEVEL_TASK ) > 0 )
   {
      lfFile = SysOpenFile( vSubtask, pszFileName, COREFILE_WRITE );

      if ( lfFile < 0 )
      {
         strcpy( szMsg, "Error writing the File '" );
         strcat( szMsg, pszFileName );
         strcat( szMsg, "'." );
         MessageSend( vSubtask, "CM00xxx", "Configuration Management",
                      szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, zBEEP );
      }

      strcpy( szText, "AuditTrail Print created with (c) Zeidon 1997" );
      SysWriteLine( vSubtask, lfFile, szText );

      strcpy( szText, "---------------------------------------------" );
      SysWriteLine( vSubtask, lfFile, szText );

      // save the CPLR-Name:
      strcpy( szText, "CPLR:\t\t" );
      GetStringFromAttribute( szMsg, vTZBRAU3O, "CPLR", "Name" );
      strcat( szText, szMsg );
      SysWriteLine( vSubtask, lfFile, szText );

      // save the DateTime:
      strcpy( szText, "Date:\t\t" );
      GetStringFromAttributeByContext( szMsg, vTZBRAU3O, "AuditTrail", "TimeStamp",
                                       "DD.MM.YYYY HH:MM:SS", 20);
      strcat( szText, szMsg );
      SysWriteLine( vSubtask, lfFile, szText );

      // save the User:
      strcpy( szText, "User:\t\t" );
      GetStringFromAttribute( szMsg, vTZBRAU3O, "AuditTrail", "UserName" );
      strcat( szText, szMsg );
      strcat( szText, " " );
      GetStringFromAttribute( szMsg, vTZBRAU3O, "AuditTrail", "UserDesc" );
      strcat( szText, szMsg );
      SysWriteLine( vSubtask, lfFile, szText );

      // save the ShortDesc:
      strcpy( szText, "ShortDesc:\t" );
      GetStringFromAttribute( szMsg, vTZBRAU3O, "AuditTrail", "ShortDesc" );
      strcat( szText, szMsg );
      SysWriteLine( vSubtask, lfFile, szText );

      strcpy( szText, "---------------------------------------------" );
      SysWriteLine( vSubtask, lfFile, szText );

      GetAddrForAttribute( &szAttr, vTZBRAU3O, "AuditTrail", "Desc" );
      SysWriteLine( vSubtask, lfFile, szAttr );

      // Close the template file.
      SysCloseFile( vSubtask, lfFile, 0 );
   }
   else
   {
      IssueError( vSubtask, 0, 0,
                  "Object TZCMAU3O does not exist (zwTZCMRPTD_ExportTextAUX)" );
   }

   return( 0 );
}
Пример #7
0
/////////////////////////////////////////////////////////////////////////////
// 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 );
}
Пример #8
0
/////////////////////////////////////////////////////////////////////////////
//
// 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 );
}
Пример #9
0
/////////////////////////////////////////////////////////////////////////////
//
// 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 );
}
Пример #10
0
/////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: fnPushMsgQ_State
//
// PURPOSE: This routine sets the state of the message queue object
//          and pushes the state on the stack.  The stack is organized
//          as follows:
//
//             zLONG  lCurrentState;
//             zSHORT nEntryCnt;
//             zSHORT nEntryMax;
//             zLONG  lState[ 1 ];
//             zLONG  lState[ 2 ];
//                 .
//                 .
//                 .
//
//             zLONG  lState[ n ];  // same as lCurrentState
//
/////////////////////////////////////////////////////////////////////////////
void
fnPushMsgQ_State( zVIEW vMsgQ,
                  zLONG lState )
{
   zPCHAR  pStack;    // blob containing Status Stack
   zUSHORT uCnt;
   zUSHORT uMax;

#ifdef zREMOTE_SERVER
   // Protect this with a semaphore!!!
   SysMutexLock( vSubtask, "ZDm", 0, 0 );
// TraceLineS( "PushMsgQ_State Lock Mutex ZDm", "" );
// DisplayObjectInstance( vMsgQ, 0, 0 );
// ::MessageBox( 0, "PushMsgQ", "ZDr", MB_OK );
#endif

   GetAddrForAttribute( (zPCHAR *) &pStack, vMsgQ, szlTask, szlStatus );
   if ( pStack )
   {
      uCnt = *((zPSHORT) (pStack + sizeof( zLONG )));
      uMax = *((zPSHORT) (pStack + sizeof( zLONG ) + sizeof( zSHORT )));

      // If there is no more room on the stack ... make more room.
      if ( uCnt >= uMax )
      {
         zULONG ulBlobLth;
         zULONG ulLth;

         uMax += 10;
         ulLth = sizeof( zLONG ) + 2 * sizeof( zSHORT ) + uMax * sizeof( zLONG );
         ulBlobLth = ulLth;
         zPCHAR pch = new char[ ulLth ];
         GetBlobFromAttribute( pch, &ulBlobLth, vMsgQ, szlTask, szlStatus );
         if ( ulLth != ulBlobLth + 10 * sizeof( zLONG ) )
            OperatorSend( 0, szlDrvr, "PushMsgQ_State", TRUE );
         else
            TraceLineI( "Message queue stack expanded to ", ulLth );

         SetAttributeFromBlob( vMsgQ, szlTask, szlStatus, pch, ulLth );
         GetAddrForAttribute( (zPCHAR *) &pStack, vMsgQ, szlTask, szlStatus );
         *((zPSHORT) (pStack + sizeof( zLONG ) + sizeof( zSHORT ))) = uMax;
         delete [] pch;
      }

      (*((zPSHORT) (pStack + sizeof( zLONG ))))++;    // increment EntryCnt
      *((zPLONG) pStack) = lState;                    // set CurrentState
      *((zPLONG) (pStack + sizeof( zLONG ) +          // set State[ n ]
                   2 * sizeof( zSHORT ) +
                   uCnt * sizeof( zLONG ))) = lState; // (not incrementing
                                                      //  uCnt since not
                                                      //  used hereafter)
   }
   else
   {
      TraceLineS( "PushMsgQ_State Lock Mutex ZDm: ", "NULL Status?" );
      DisplayObjectInstance( vMsgQ, 0, 0 );
      ::MessageBox( 0, "PushMsgQ_State NULL Status?", "ZDr Error", MB_OK );
   }

#ifdef zREMOTE_SERVER
// TraceLineS( "PushMsgQ_State Unlock Mutex ZDm", "" );
   SysMutexUnlock( vSubtask, "ZDm", 0 );
#endif
}
Пример #11
0
/////////////////////////////////////////////////////////////////////////////
//
//   bSubcontrol - TRUE  - add controls to existing pZSubtask->m_pZMIXCtrl
//                 FALSE - delete existing pZSubtask->m_pZMIXCtrl and start
//                         a new list
//
/////////////////////////////////////////////////////////////////////////////
void OPERATION
CreateZeidonCtrls( zVIEW    vSubobject,
                   ZSubtask *pZSubtask,
                   CWnd     *pWndParent,
                   ZMapAct  *pzmaComposite,
                   zSHORT   nOffsetX,
                   zSHORT   nOffsetY,
                   zBOOL    bSubcontrol )
{
   zKZWDLGXO_Ctrl_DEF CtrlDef;
   zFARPROC_CONTROL lpfnCtrlProc;
   LPLIBRARY hCCtlLibrary;
   zPCHAR    pchDLL_Name;
   zPCHAR    pchCOP;
   zSHORT    nRC;

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

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

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

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

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

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

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

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

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

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

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

      hCCtlLibrary = 0;  // set to zero for GetOperationDynamicCallAddress

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

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

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

      nRC = SetCursorNextEntity( vSubobject, szlCtrl, 0 );

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

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

      // Ctrl creation is complete ... notify each ctrl.
      if ( pZSubtask->m_pZMIXCtrl )
      {
         pZSubtask->m_pZMIXCtrl->VisitInorder( (fnVISIT_INORDER) fnPostCreateCtrls,
                                               0, 0, 0 );
      }
   }
}
Пример #12
0
/////////////////////////////////////////////////////////////////////////////
//
// 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 );
}
Пример #13
0
zOPER_EXPORT zSHORT OPERATION
AEQ_SelectView( zVIEW vSubtask )
{
   zSHORT nRC;
   zVIEW  vList;
   zVIEW  vLOD;
   zVIEW  vEdWrk;
   zPCHAR szLOD_Name;
   zPCHAR szName;

   GetWorkView( &vEdWrk );
   if ( vEdWrk == 0 )
   {
      zCHAR sz[ 200 ];

      zstrcpy( sz, "TZEDWRKO not Available at ObjSelAQ_ObjSelView." );
      OperatorPrompt( 0, "ED - Error", sz, 0, zBUTTONS_OK, 0, zICON_STOP );
      return( zCALL_ERROR );
   }

   // If Entity entity exists, then the LOD has already been loaded for
   // for this view.  Exit because nothing else needs to be done.
   if ( CheckExistenceOfEntity( vEdWrk, "Entity" ) == zCURSOR_SET )
   {
      AEQ_RefreshAEQ( vSubtask );
      return( 0 );
   }

   // Activate the LOD specified by vEdWrk.View.ObjectName
   GetAddrForAttribute( &szLOD_Name, vEdWrk, "View", "ObjectName" );
   nRC = RetrieveViewForMetaList( vSubtask, &vList, zREFER_LOD_META );
   nRC = SetCursorFirstEntity( vList, "W_MetaDef", "" );
   while ( nRC == zCURSOR_SET )
   {
      GetAddrForAttribute( &szName, vList, "W_MetaDef", "Name" );
      if ( zstrcmpi( szName, szLOD_Name ) == 0 )
         break;

      nRC = SetCursorNextEntity( vList, "W_MetaDef", "" );
   }

   if ( nRC != zCURSOR_SET )
   {
      zCHAR sz[ 200 ];

      DropView( vList );
      zstrcpy( sz, "LOD " );
      zstrcat( sz, szLOD_Name );
      zstrcat( sz, " not found.  Possibly wrong LPLR?" );
      OperatorPrompt( vSubtask, "ZeidonEditor", sz, 0, 0, 1, zICON_STOP );
      return( zCALL_ERROR );
   }

   nRC = ActivateMetaOI( vSubtask, &vLOD, vList, zREFER_LOD_META,
                         zSINGLE | zLEVEL_APPLICATION );
   DropView( vList );

   // Copy Entity and Attribute names from LOD to vEdWrk.
   nRC = SetCursorFirstEntity( vLOD, "LOD_Entity", "" );
   while ( nRC == zCURSOR_SET )
   {
      CreateEntity( vEdWrk, "Entity", zPOS_LAST );
      SetAttributeFromAttribute( vEdWrk, "Entity", "EntityName",
                                 vLOD, "LOD_Entity", "IndentName" );

      nRC = SetCursorFirstEntity( vLOD, "LOD_Attribute", "" );
      while ( nRC == zCURSOR_SET )
      {
         CreateEntity( vEdWrk, "Attribute", zPOS_LAST );
         SetAttributeFromAttribute( vEdWrk, "Attribute", "AttributeName",
                                    vLOD, "ER_Attribute", "Name" );

         nRC = SetCursorNextEntity( vLOD, "LOD_Attribute", "" );
      }

      nRC = SetCursorNextEntity( vLOD, "LOD_Entity", "" );
   }

   DropMetaOI( vSubtask, vLOD );
   nRC = SetCursorFirstEntity( vEdWrk, "Entity", "" );
   SetSelectStateOfEntity( vEdWrk, "Entity", 1 );

   if ( CheckExistenceOfEntity( vEdWrk, "Attribute" ) >= zCURSOR_SET )
      SetSelectStateOfEntity( vEdWrk, "Attribute", 1 );

   AEQ_RefreshAEQ( vSubtask );

   return( 0 );

} // AEQ_SelectView
Пример #14
0
/////////////////////////////////////////////////////////////////////////////
//
//  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( );
}