コード例 #1
0
ファイル: kzxmlpgo.c プロジェクト: arksoftgit/10c
//:   VIEW            SourceView
zOPER_EXPORT zSHORT OPERATION
oKZXMLPGO_AddWebControlSubobject( zVIEW     vKZXMLPGO,
                                  zPCHAR    ControlName,
                                  zPCHAR    ControlType,
                                  zPCHAR    ControlContext,
                                  zPCHAR    SourceViewName,
                                  zPCHAR    SourceEntity,
                                  zPCHAR    SourceAttribute,
                                  zPCHAR    AutoComboBoxExternalValue )
{
   zVIEW     SourceView = 0; 
   //:VIEW            SourceView2
   zVIEW     SourceView2 = 0; 
   //:SHORT           nRC
   zSHORT    nRC = 0; 
   //:INTEGER         CursorPos
   zLONG     CursorPos = 0; 
   //:STRING ( 2000 ) ExternalValue
   zCHAR     ExternalValue[ 2001 ] = { 0 }; 
   //:STRING ( 200 )  CurrentValue
   zCHAR     CurrentValue[ 201 ] = { 0 }; 
   zSHORT    RESULT; 
   zCHAR     szTempString_0[ 255 ]; 
   zCHAR     szTempString_1[ 32001 ]; 


   //:// Create a Control entity for the data passed.
   //:// If the Control is a ListBox or ComboBox, also create the SubControl entries for each list value.

   //:CREATE ENTITY vKZXMLPGO.Control
   RESULT = CreateEntity( vKZXMLPGO, "Control", zPOS_AFTER );
   //:vKZXMLPGO.Control.Name = ControlName
   SetAttributeFromString( vKZXMLPGO, "Control", "Name", ControlName );
   //:vKZXMLPGO.Control.Type = ControlType
   SetAttributeFromString( vKZXMLPGO, "Control", "Type", ControlType );

   //:// If the Named View does not exist or the EntityName doesn't exist, simply return.
   //:GET VIEW SourceView NAMED SourceViewName
   RESULT = GetViewByName( &SourceView, SourceViewName, vKZXMLPGO, zLEVEL_TASK );
   //:IF RESULT < 0
   if ( RESULT < 0 )
   { 
      //:// There is no mapping, so return having just created the entity, with Name and Type,
      //:// unless the Control is Text, in which case we'll add the Text value, which is passed as
      //:// AutoComboBoxExternalValue.
      //:IF vKZXMLPGO.Control.Type = "Text" OR
      //:   vKZXMLPGO.Control.Type = "PushBtn"
      if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "Text" ) == 0 || CompareAttributeToString( vKZXMLPGO, "Control", "Type", "PushBtn" ) == 0 )
      { 

         //:vKZXMLPGO.Control.CurrentValue = AutoComboBoxExternalValue
         SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", AutoComboBoxExternalValue );
      } 

      //:END
      //:RETURN
      return( 0 );
   } 

   //:END
   //:IF SourceEntity != ""
   if ( ZeidonStringCompare( SourceEntity, 1, 0, "", 1, 0, 33 ) != 0 )
   { 
      //:nRC = CheckExistenceOfEntity( SourceView, SourceEntity )
      nRC = CheckExistenceOfEntity( SourceView, SourceEntity );
      //:IF nRC < 0
      if ( nRC < 0 )
      { 
         //:RETURN
         return( 0 );
      } 

      //:END
   } 

   //:END

   //:// If there is mapping, process according to Control Type
   //:IF vKZXMLPGO.Control.Type = "EditBox" OR
   //:   vKZXMLPGO.Control.Type = "Text" OR
   //:   vKZXMLPGO.Control.Type = "CheckBox"
   if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "EditBox" ) == 0 || CompareAttributeToString( vKZXMLPGO, "Control", "Type", "Text" ) == 0 || CompareAttributeToString( vKZXMLPGO, "Control", "Type", "CheckBox" ) == 0 )
   { 

      //:GetStringFromAttributeByContext( ExternalValue,
      //:                                 SourceView, SourceEntity, SourceAttribute, ControlContext, 2000 )
      GetStringFromAttributeByContext( ExternalValue, SourceView, SourceEntity, SourceAttribute, ControlContext, 2000 );
      //:vKZXMLPGO.Control.CurrentValue = ExternalValue
      SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", ExternalValue );
      //:ELSE
   } 
   else
   { 

      //:IF vKZXMLPGO.Control.Type = "MLEdit"
      if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "MLEdit" ) == 0 )
      { 
         //:SetAttributeFromAttribute( vKZXMLPGO, "Control", "CurrentValue",
         //:                        SourceView, SourceEntity, SourceAttribute )
         SetAttributeFromAttribute( vKZXMLPGO, "Control", "CurrentValue", SourceView, SourceEntity, SourceAttribute );
         //:ELSE
      } 
      else
      { 

         //:IF vKZXMLPGO.Control.Type = "ComboBox"
         if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "ComboBox" ) == 0 )
         { 
            //:// Build the list of selection values from the Domain table entries.
            //:GetStringFromAttributeByContext( CurrentValue,
            //:                           SourceView, SourceEntity, SourceAttribute, ControlContext, 200 )
            GetStringFromAttributeByContext( CurrentValue, SourceView, SourceEntity, SourceAttribute, ControlContext, 200 );
            //:vKZXMLPGO.Control.CurrentValue = CurrentValue
            SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", CurrentValue );
            //:nRC = GetFirstTableEntryForAttribute( ExternalValue,
            //:                                SourceView, SourceEntity, SourceAttribute,
            //:                                ControlContext, CursorPos )
            nRC = GetFirstTableEntryForAttribute( ExternalValue, SourceView, SourceEntity, SourceAttribute, ControlContext, &CursorPos );
            //:LOOP WHILE nRC >= 0
            while ( nRC >= 0 )
            { 
               //:CREATE ENTITY vKZXMLPGO.ComboValue
               RESULT = CreateEntity( vKZXMLPGO, "ComboValue", zPOS_AFTER );
               //:vKZXMLPGO.ComboValue.ExternalValue = ExternalValue
               SetAttributeFromString( vKZXMLPGO, "ComboValue", "ExternalValue", ExternalValue );
               //:IF ExternalValue = CurrentValue
               if ( ZeidonStringCompare( ExternalValue, 1, 0, CurrentValue, 1, 0, 2001 ) == 0 )
               { 
                  //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 )
                  SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 );
                  //:ELSE
               } 
               else
               { 
                  //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 )
                  SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 );
               } 

               //:END
               //:nRC = GetNextTableEntryForAttribute( ExternalValue,
               //:                               SourceView, SourceEntity, SourceAttribute,
               //:                               ControlContext, CursorPos )
               nRC = GetNextTableEntryForAttribute( ExternalValue, SourceView, SourceEntity, SourceAttribute, ControlContext, &CursorPos );
            } 

            //:END
            //:ELSE
         } 
         else
         { 

            //:IF vKZXMLPGO.Control.Type = "ComboBoxAuto"
            if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "ComboBoxAuto" ) == 0 )
            { 
               //:// Build the list of selection values from the list of entities.
               //:// Note that the entry selected is defined by the AutoComboBoxExternalValue passed, which
               //:// was set from the value of the Edit Mapping.
               //:vKZXMLPGO.Control.CurrentValue = AutoComboBoxExternalValue
               SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", AutoComboBoxExternalValue );
               //:nRC = SetCursorFirstEntity( SourceView, SourceEntity, "" )
               nRC = SetCursorFirstEntity( SourceView, SourceEntity, "" );
               //:LOOP WHILE nRC >= 0
               while ( nRC >= 0 )
               { 
                  //:CREATE ENTITY vKZXMLPGO.ComboValue
                  RESULT = CreateEntity( vKZXMLPGO, "ComboValue", zPOS_AFTER );
                  //:GetStringFromAttributeByContext( ExternalValue,
                  //:                        SourceView, SourceEntity, SourceAttribute, "", 2000 )
                  GetStringFromAttributeByContext( ExternalValue, SourceView, SourceEntity, SourceAttribute, "", 2000 );
                  //:vKZXMLPGO.ComboValue.ExternalValue = ExternalValue
                  SetAttributeFromString( vKZXMLPGO, "ComboValue", "ExternalValue", ExternalValue );
                  //:IF ExternalValue = AutoComboBoxExternalValue
                  if ( ZeidonStringCompare( ExternalValue, 1, 0, AutoComboBoxExternalValue, 1, 0, 2001 ) == 0 )
                  { 
                     //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 )
                     SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 );
                     //:ELSE
                  } 
                  else
                  { 
                     //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 )
                     SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 );
                  } 

                  //:END
                  //:nRC = SetCursorNextEntity( SourceView, SourceEntity, "" )
                  nRC = SetCursorNextEntity( SourceView, SourceEntity, "" );
               } 

               //:END
               //:ELSE
            } 
            else
            { 

               //:IF vKZXMLPGO.Control.Type = "ComboBoxList"
               if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "ComboBoxList" ) == 0 )
               { 
                  //:// Build the list of selection values from the list of entities.
                  //:// Note that the entry selected is defined by the cursor position.
                  //:CreateViewFromViewForTask( SourceView2, SourceView, vKZXMLPGO )
                  CreateViewFromViewForTask( &SourceView2, SourceView, vKZXMLPGO );
                  //:GetStringFromAttributeByContext( CurrentValue,
                  //:                     SourceView, SourceEntity, SourceAttribute, "", 2000 )
                  GetStringFromAttributeByContext( CurrentValue, SourceView, SourceEntity, SourceAttribute, "", 2000 );
                  //:vKZXMLPGO.Control.CurrentValue = CurrentValue
                  SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", CurrentValue );
                  //:nRC = SetCursorFirstEntity( SourceView2, SourceEntity, "" )
                  nRC = SetCursorFirstEntity( SourceView2, SourceEntity, "" );
                  //:LOOP WHILE nRC >= 0
                  while ( nRC >= 0 )
                  { 
                     //:CREATE ENTITY vKZXMLPGO.ComboValue
                     RESULT = CreateEntity( vKZXMLPGO, "ComboValue", zPOS_AFTER );
                     //:GetStringFromAttributeByContext( ExternalValue,
                     //:                     SourceView2, SourceEntity, SourceAttribute, "", 2000 )
                     GetStringFromAttributeByContext( ExternalValue, SourceView2, SourceEntity, SourceAttribute, "", 2000 );
                     //:vKZXMLPGO.ComboValue.ExternalValue = ExternalValue
                     SetAttributeFromString( vKZXMLPGO, "ComboValue", "ExternalValue", ExternalValue );
                     //:IF ExternalValue = CurrentValue
                     if ( ZeidonStringCompare( ExternalValue, 1, 0, CurrentValue, 1, 0, 2001 ) == 0 )
                     { 
                        //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 )
                        SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 );
                        //:ELSE
                     } 
                     else
                     { 
                        //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 )
                        SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 );
                     } 

                     //:END
                     //:nRC = SetCursorNextEntity( SourceView2, SourceEntity, "" )
                     nRC = SetCursorNextEntity( SourceView2, SourceEntity, "" );
                  } 

                  //:END
                  //:DropView( SourceView2 )
                  DropView( SourceView2 );
               } 


               //:END
            } 

            //:END
         } 

         //:END
      } 

      //:END
   } 

   //:END

   //:TraceLineS( "AddWebControlSubobject Type: ", vKZXMLPGO.Control.Type )
   GetStringFromAttribute( szTempString_0, vKZXMLPGO, "Control", "Type" );
   TraceLineS( "AddWebControlSubobject Type: ", szTempString_0 );
   //:TraceLineS( "      =============== Value: ", vKZXMLPGO.Control.CurrentValue )
   GetStringFromAttribute( szTempString_1, vKZXMLPGO, "Control", "CurrentValue" );
   TraceLineS( "      =============== Value: ", szTempString_1 );
   return( 0 );
//    /* vKZXMLPGO.Control.Type = "EditBox" OR
//       vKZXMLPGO.Control.Type = "ListBox" OR
//       vKZXMLPGO.Control.Type = "Text" OR
//       vKZXMLPGO.Control.Type = "CheckBox" OR
//       vKZXMLPGO.Control.Type = "ListBox" OR
//       vKZXMLPGO.Control.Type = "MLE" OR
//       vKZXMLPGO.Control.Type = "Outliner" OR
//       vKZXMLPGO.Control.Type = "RadioBtnGroup" */
// END
} 
コード例 #2
0
ファイル: tzedcwzd.c プロジェクト: DeegC/ZeidonTools
/*

   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
コード例 #3
0
ファイル: tzedcwzd.c プロジェクト: DeegC/ZeidonTools
zOPER_EXPORT zSHORT OPERATION
VML_DisplayList( zVIEW vSubtask )
{
   zVIEW  vProfileXFER;
   zCHAR  szShowStr[ 10 ];
   zSHORT nRC;

   GetProfileView( &vProfileXFER );
   *szShowStr = 0;

   // Build a string that contains each of the VML types that the user
   // wants shown.

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowDeclarations", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "D" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowControlStatements", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "C" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowViewStatements", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "V" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowEntityStatements", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "E" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowOperators", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "O" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowOther", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "?" );
   }

   // szShowStr lists all the types that the user wants shown. eg "CV?" means
   // that the user wants all control, view, and 'other' vml statements
   // shown.
   for ( nRC = SetCursorFirstEntity( vProfileXFER, "VML_Text", 0 );
         nRC == zCURSOR_SET;
         nRC = SetCursorNextEntity( vProfileXFER, "VML_Text", 0 ) )
   {
      zCHAR szType[ 5 ];

      GetStringFromAttribute( szType, vProfileXFER, "VML_Text", "Type" );
      if ( zstrchr( szShowStr, *szType ) )
         SetSelectStateOfEntity( vProfileXFER, "VML_Text", TRUE );
      else
         SetSelectStateOfEntity( vProfileXFER, "VML_Text", FALSE );
   }

   SetCursorFirstSelectedEntity( vProfileXFER, "VML_Text", 0 );
   LB_SetDisplaySelectSet( vSubtask, "TextList", DISP_SELECT_SET );
   LB_SetSelectSelectSet( vSubtask, "TextList", SEL_SELECT_SET );

   return( 0 );

} // VML_DisplayList
コード例 #4
0
ファイル: tzedcwzd.c プロジェクト: DeegC/ZeidonTools
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