⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 project_va_move_dialog.c

📁 基于UG的自动装配技术
💻 C
📖 第 1 页 / 共 2 页
字号:


/*=============================================================================
   WARNING!!  This file is overwritten by the UIStyler each time the Styler 
   file is saved.
  
  
        Filename:  Project_VA_Move_dialog_template.c
  
        This file was generated by the NX User Interface Styler
        Created by: befree
        Version: NX 3
              Date: 12-08- 6
              Time: 11:36
  
   This template file is overwritten each time the UIStyler dialog is
   saved.  Any modifications to this file will be lost.
==============================================================================*/
 


/*==============================================================================
   Purpose:  This TEMPLATE file contains C source and static structures to      
   guide you in the construction of your NX Open application dialog.            
   The generation of your dialog file (.dlg extension) is the first step towards
   dialog construction within Unigraphics.  You must now create a UGOpen        
   application that utilizes this file (.dlg).                                  
                                                                                
   The information in this file provides you with the following:                
                                                                                
   1.  Help on the use of the functions, UF_MB_add_styler_actions and           
       UF_STYLER_create_dialog in your NX Open application.  These functions    
       will load and display your UIStyler dialog in Unigraphics.               
                                                                                
       An example of the function, UF_MB_add_styler_actions to associate your   
       dialog to the menubar is shown below (Search on Example 1).              
                                                                                
       An example of a invoking a dialog from a callback utilizing              
       UF_STYLER_create_dialog is also shown below (Search for Example 2).      
                                                                                
       An example of a user exit utilizing UF_STYLER_create_dialog is also      
       shown below (Search for Example 3).                                      
                                                                                
   2.  The callback structure: --- PROJECT_VA_MOVE_cbs ---               
       This structure is VERY important if you have callbacks associated with   
       your dialog.  It correlates the dialog items in your dialog with the     
       callback functions you must supply.  You should not modify this          
       structure since it MUST match up to the information stored in your       
       dialog file (.dlg).  Any attempt to do so will cause an error while      
       constructing your dialog.   If you wish to modify the association of     
       your callbacks to your dialog, please reload your dialog file (.dlg) into
       the UIStyler and regenerate your files.                                  
       You do not need to be concerned about this structure, simply pass it as  
       an argument to the function, UF_STYLER_create_dialog along with your     
       dialog file (.dlg).
       
       Example 1 displays the actual call you may make for this particular      
       dialog.                                                                  
                                                                                
   3.  The empty callback functions (stubs) associated with your dialog items   
       have also been placed in this file.  These empty functions have been     
       created simply to start you along with your coding requirements.         
       The function name, argument list and possible return values have already 
       been provided for you.                                                   
                                                                                
NOTE:  Each callback must be wrappered with the functions UF_initialize()       
       and UF_terminate().                                                      
                                                                                
==============================================================================*/



/* These include files are needed for the following template code.            */
#include <stdio.h> 
#include <uf.h>
#include <uf_defs.h>
#include <uf_exit.h>
#include <uf_ui.h>
#include <uf_styler.h>
#include <uf_mb.h> 
#include "Project_VA_Move_dialog.h"

/* The following definition defines the number of callback entries */
/* in the callback structure:                                      */
/* UF_STYLER_callback_info_t PROJECT_VA_MOVE_cbs */
#define PROJECT_VA_MOVE_CB_COUNT ( 7 + 1 ) /* Add 1 for the terminator */
 
/*--------------------------------------------------------------------------
The following structure defines the callback entries used by the       
styler file.  This structure MUST be passed into the user function,    
UF_STYLER_create_dialog along with PROJECT_VA_MOVE_CB_COUNT.                       
--------------------------------------------------------------------------*/
static UF_STYLER_callback_info_t PROJECT_VA_MOVE_cbs[PROJECT_VA_MOVE_CB_COUNT] = 
{
 {UF_STYLER_DIALOG_INDEX, UF_STYLER_CONSTRUCTOR_CB  , 0, PROJECT_VA_MOVE_construction},
 {UF_STYLER_DIALOG_INDEX, UF_STYLER_DESTRUCTOR_CB   , 0, PROJECT_VA_MOVE_destruction},
 {UF_STYLER_DIALOG_INDEX, UF_STYLER_OK_CB           , 0, PROJECT_VA_MOVE_ok_cb},
 {UF_STYLER_DIALOG_INDEX, UF_STYLER_CANCEL_CB       , 0, PROJECT_VA_MOVE_cancel_cb},
 {PROJECT_VA_MOVE_PLUS  , UF_STYLER_ACTIVATE_CB     , 0, PROJECT_VA_MOVE_plus},
 {PROJECT_VA_MOVE_MINUS , UF_STYLER_ACTIVATE_CB     , 0, PROJECT_VA_MOVE_minus},
 {PROJECT_VA_MOVE_STEPSIZE, UF_STYLER_ACTIVATE_CB     , 1, PROJECT_VA_MOVE_change_stepsize},
 {UF_STYLER_NULL_OBJECT, UF_STYLER_NO_CB, 0, 0 }
};



/*--------------------------------------------------------------------------
UF_MB_styler_actions_t contains 4 fields.  These are defined as follows:
 
Field 1 : the name of your dialog that you wish to display.
Field 2 : any client data you wish to pass to your callbacks.
Field 3 : your callback structure.
Field 4 : flag to inform menubar of your dialog location.  This flag MUST  
          match the resource set in your dialog!  Do NOT ASSUME that changing 
          this field will update the location of your dialog.  Please use the 
          UIStyler to indicate the position of your dialog.
--------------------------------------------------------------------------*/
static UF_MB_styler_actions_t actions[] = {
    { "Project_VA_Move_dialog.dlg",  NULL,   PROJECT_VA_MOVE_cbs,  UF_MB_STYLER_IS_NOT_TOP },
    { NULL,  NULL,  NULL,  0 } /* This is a NULL terminated list */
};









/*-------DIALOG CREATION FROM A CALLBACK HELP Example ----------
If you wish to have this dialog displayed from the callback of 
another UIStyler dialog, you should:                           

1) Make sure that the callback of your UIStyler dialog is 
   designated as a dialog building callback.              
2) Remove the conditional definitions:
   #ifdef DISPLAY_FROM_CALLBACK 
   #endif DISPLAY_FROM_CALLBACK
3) Your callback should issue a call to this function.
4) You should also add the funcitonal prototype to your header file 
   (Project_VA_Move_dialog.h) and ensure that the file is properly included.

All dialog files must be located in 
      $UGII_USER_DIR/application or 
      $UGII_SITE_DIR/application or 
      $UGII_VENDOR_DIR/application directory
--------------------------------------------------------------*/


extern int LaunchMovePlanningDialog( int *response ,int *action)
{
    int  error_code = 0;
 
    if ( ( error_code = UF_initialize() ) != 0 ) 
           return (0) ;

    if ( ( error_code = UF_STYLER_create_dialog ( "Project_VA_Move_dialog.dlg",
           PROJECT_VA_MOVE_cbs,      /* Callbacks from dialog */
           PROJECT_VA_MOVE_CB_COUNT, /* number of callbacks*/
           action,        /* This is your client data */
           response ) ) != 0 )
    {
          char fail_message[133];

          /* Get the user function fail message based on the fail code.*/
          UF_get_fail_message(error_code, fail_message);
          UF_UI_set_status (fail_message);
          printf ( "%s\n", fail_message ); 
    }


    UF_terminate();                             
    return (error_code);
}






/*-------------------------------------------------------------------------*/
/*---------------------- UIStyler Callback Functions ----------------------*/
/*-------------------------------------------------------------------------*/

/* -------------------------------------------------------------------------
 * Callback Name: PROJECT_VA_MOVE_construction
 * This is a callback function associated with an action taken from a
 * UIStyler object. 
 *
 * Input: dialog_id   -   The dialog id indicate which dialog this callback
 *                        is associated with.  The dialog id is a dynamic,
 *                        unique id and should not be stored.  It is
 *                        strictly for the use in the NX Open API:
 *                               UF_STYLER_ask_value(s) 
 *                               UF_STYLER_set_value   
 *        client_data -   Client data is user defined data associated
 *                        with your dialog.  Client data may be bound
 *                        to your dialog with UF_MB_add_styler_actions
 *                        or UF_STYLER_create_dialog.                 
 *        callback_data - This structure pointer contains information
 *                        specific to the UIStyler Object type that  
 *                        invoked this callback and the callback type.
 * -----------------------------------------------------------------------*/
int PROJECT_VA_MOVE_construction ( int dialog_id,
             void * client_data,
             UF_STYLER_item_value_type_p_t callback_data)
{
     /* Make sure User Function is available. */  
     if ( UF_initialize() != 0) 
          return ( UF_UI_CB_CONTINUE_DIALOG );

     /* ---- Enter your callback code here ----- */

     UF_terminate ();

    /* Callback acknowledged, do not terminate dialog */
    return (UF_UI_CB_CONTINUE_DIALOG); 
    /* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted    */
    /* for this callback type.  You must continue dialog construction.*/

}


/* -------------------------------------------------------------------------
 * Callback Name: PROJECT_VA_MOVE_destruction
 * This is a callback function associated with an action taken from a
 * UIStyler object. 
 *
 * Input: dialog_id   -   The dialog id indicate which dialog this callback
 *                        is associated with.  The dialog id is a dynamic,
 *                        unique id and should not be stored.  It is
 *                        strictly for the use in the NX Open API:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -