home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / felixcad / fcaddata.z / FCDIALOG.H < prev    next >
C/C++ Source or Header  |  1997-05-29  |  10KB  |  197 lines

  1. /****************************************************************************
  2.                (C) 1995-96 FELIX Computer Aided Technologies GmbH
  3.  
  4. File:          fcdialog.h
  5. Contents:      Definitions for FCAD dialog box functions
  6. Bearbeiter:    D. Hubert
  7. Created:       Dec. 15, 1994
  8. Changed:      
  9. ****************************************************************************/
  10.  
  11. #ifndef _INC_FCDIALOG
  12. #define _INC_FCDIALOG
  13.  
  14. #include  "fdt.h"
  15.  
  16. #ifdef __cplusplus
  17. extern "C"{
  18. #endif
  19.  
  20. #ifndef EXPORT
  21. #define EXPORT __far __pascal __export
  22. #endif
  23.  
  24. /*===========================================================================
  25.                            Definitions
  26. ===========================================================================*/
  27.  
  28. typedef void* dlg_hdlg;
  29. typedef void* dlg_htile;
  30.  
  31. /* control-name (max. char number ) */
  32. #define KEY_STR_MAX   32
  33.  
  34. typedef struct {
  35.     dlg_hdlg  dialog;                 /* Handle for dialog window          */
  36.     dlg_htile tile;                   /* Handle for control element (tile) */
  37.     char      key[KEY_STR_MAX+1];     /* Key (ID) of control element       */
  38.     LPSTR     value;                  /* Current value of control element  */
  39.     void*     client_data;            /* Currrent client data              */
  40.     int       reason;                 /* Code of return reason             */
  41.     long      x,y;                    /* Coordinates of image control      */
  42.   } dlg_callback_packet;
  43.  
  44. /* For use in tile callback packets */
  45.  
  46. #define CTRL_SELECT       1
  47. #define CTRL_LOST_FOCUS   2
  48. #define CTRL_DRAG         3
  49. #define CTRL_DOUBLE_CLICK 4
  50. #if _WIN32 
  51. #define CTRL_UPDATE       5
  52. #endif                      //#if _WIN32 
  53.  
  54. /* DIALOG user's function, passed to FELIX to be called later */
  55.  
  56. typedef void( EXPORT *CLIENTFUNC) ( dlg_callback_packet *cpkt);
  57. #define NO_CLIENTFUNC ((CLIENTFUNC)0)
  58. #define BAD_DIALOG NULL
  59. typedef void( EXPORT *DLGINITFUNC) ( dlg_hdlg  hdlg);
  60. #define NO_DLGINITFUNC ((DLGINITFUNC)0)
  61.  
  62. /* Return by reference integers for DLG_DialogStart() */
  63.  
  64. #define DLG_CANCEL           0    /* User pressed Cancel or equivalent   */
  65. #define DLG_OK               1    /* User pressed Ok                     */
  66. #define DLG_ALLDONE         -1    /* All dialogs terminated with
  67.                                      Dlg_DialogTerm()                    */
  68. #define DLG_STATUS           2    /* Start of user return codes          */
  69. #define DLG_ERR_EXIST       -2    /* Dialog allready started             */
  70. #define DLG_ERR_TOOMANY     -3    /* To many started dialogs             */
  71. #define DLG_ERR_WRONGHANDLE -4    /* Invalid dialog handle               */
  72.  
  73. /* List argument type for DLG_ListStart(); */
  74. #define DLG_L_CHANGE    ((short) 1)   /* Change selected listbox contents    */
  75. #define DLG_L_APPEND    ((short) 2)   /* Append new listbox entry            */
  76. #define DLG_L_NEW       ((short) 3)   /* Delete old list and create new list */
  77. #define DLG_L_INSERT    ((short)10)   /* Insert listbox entry                */
  78. #define DLG_L_DELETE    ((short)11)   /* Delete listbox entry                */
  79. #define DLG_L_GETSEL    ((short)12)   /* Get selected listbox entries        */
  80. #define DLG_L_GETTEXT   ((short)13)   /* Get listbox entries                 */
  81. #define DLG_L_SETSEL    ((short)14)   /* Select listbox entry                */ 
  82. #define DLG_L_RESETSEL  ((short)15)   /* Deselect listbox entry              */ 
  83. #define DLG_L_SETCARET  ((short)16)   /* Set focus rectangle                 */ 
  84.  
  85. /* Mode argument type for DLG_TileMode(); */
  86. #define DLG_M_ENABLE   ((short) 0)    /* Enable tile                         */
  87. #define DLG_M_DISABLE  ((short) 1)    /* Disable tile                        */
  88. #define DLG_M_SETFOCUS ((short) 2)    /* Set focus to tile                   */
  89. #define DLG_M_SETSEL   ((short) 3)    /* Set editbox selection--allows  
  90.                                           auto-clearing of old string        */
  91. #define DLG_M_FLIP     ((short) 4)    /* Invert current state                */
  92. #define DLG_M_VISIBLE  ((short) 5)    /* Visible tile                        */
  93. #define DLG_M_HIDE     ((short) 6)    /* Hide tile                           */
  94.  
  95. /* For buffers that receive values for tiles.  The number is arbitrary
  96.    --it's just here to allow changing them all from one place. */
  97. #define TILE_STR_MAX   40
  98. #define TILE_STR_LIMIT 255            /* real limit of dialog strings        */
  99.  
  100. /* Radiobutton/Checkbox argument type for Dlg_Tile[Set,Get]() */
  101. #define DLG_B_UNCHECKED     "0"       /* Checkbox/Radiobutton                */
  102. #define DLG_B_CHECKED       "1"       /* Checkbox/Radiobutton                */
  103. #define DLG_B_INDETERMINATE "2"       /* Only Checkbox with attribute 3STATE 
  104.                                          or AUTO3STATE                       */
  105.  
  106. /* Color argument type for Dlg_Image[Fill,Vector]() */
  107. #define CAD_BG_COLOR   ((short) -2)  /* Background color CAD window           */
  108. #define DLG_BG_COLOR   ((short)-15)  /* Background color current dialog window*/
  109. #define DLG_TXT_COLOR  ((short)-16)  /* Text color of current dialog window   */
  110. #define DLG_CUR_COLOR  ((short)-18)  /* Current color of current dialog window*/
  111.  
  112. /* Font argument type for Dlg_TileSetFont() */
  113. #define DLG_SYS_VAR_FONT   ((short) 0)   /* System font                       */
  114. #define DLG_SYS_FIX_FONT   ((short) 1)   /* System fixed font                 */
  115. #define DLG_ANSI_VAR_FONT  ((short) 2)   /* ANSI ystem font                   */
  116. #define DLG_ANSI_FIX_FONT  ((short) 3)   /* ANSI system fixed font            */
  117.  
  118. /*===========================================================================
  119.                           Dialog Functions
  120. ===========================================================================*/
  121.  
  122. /* Dialog function */
  123. FDT_DLLEXPORT int EXPORT Dlg_DialogLoad( LPCSTR dlg_file, int* dlg_id);
  124. FDT_DLLEXPORT int EXPORT Dlg_DialogUnload( int dlg_id);
  125. FDT_DLLEXPORT int EXPORT Dlg_DialogNew( LPCSTR dlg_name, const int dlg_id, 
  126.                           const CLIENTFUNC def_callback, dlg_hdlg* hdlg);
  127. FDT_DLLEXPORT int EXPORT Dlg_DialogNewPositioned( LPCSTR dlg_name, const int dlg_id,
  128.                                     const CLIENTFUNC def_callback,
  129.                                     const int x, const int y,
  130.                                     dlg_hdlg* hdlg);
  131. FDT_DLLEXPORT int EXPORT Dlg_DialogStart( const dlg_hdlg hdlg, int* status,
  132.                             const DLGINITFUNC init_dialog_callback);
  133. FDT_DLLEXPORT int EXPORT Dlg_DialogDone( const dlg_hdlg hdlg, const int status);
  134. FDT_DLLEXPORT int EXPORT Dlg_DialogDonePositioned( const dlg_hdlg hdlg, const int status,
  135.                                      int* x_result, int* y_result);
  136. FDT_DLLEXPORT int EXPORT Dlg_DialogTerm( void);
  137.  
  138. /* Control functions */
  139. FDT_DLLEXPORT int EXPORT Dlg_TileAction( const dlg_hdlg hdlg, LPCSTR key,
  140.                            const CLIENTFUNC tilefunc);
  141. FDT_DLLEXPORT int EXPORT Dlg_TileSet( const dlg_hdlg hdlg, LPCSTR key, LPCSTR value);
  142. FDT_DLLEXPORT int EXPORT Dlg_TileGet( const dlg_hdlg hdlg, LPCSTR key, LPSTR value,
  143.                         const int maxlen);
  144. FDT_DLLEXPORT int EXPORT Dlg_TileClientData( const dlg_hdlg hdlg, LPCSTR key, void* clientdata);
  145. FDT_DLLEXPORT int EXPORT Dlg_TileMode( const dlg_hdlg hdlg, LPCSTR key, 
  146.                          const short mode);
  147. FDT_DLLEXPORT int EXPORT Dlg_TileDimensions( const dlg_hdlg hdlg, LPCSTR key, 
  148.                                short* cx, short* cy);
  149. FDT_DLLEXPORT int EXPORT Dlg_TileSetFont( const dlg_hdlg hdlg, LPCSTR key, 
  150.                             const short font);
  151.  
  152. /* List functions */
  153. FDT_DLLEXPORT int EXPORT Dlg_ListStart( const dlg_hdlg hdlg, LPCSTR key,
  154.                           const short operation, const short index);
  155. FDT_DLLEXPORT int EXPORT Dlg_ListAdd( LPCSTR item);
  156. FDT_DLLEXPORT int EXPORT Dlg_ListGet( int* nPos, LPSTR szBuffer, const int maxlen);
  157. FDT_DLLEXPORT int EXPORT Dlg_ListEnd( void);
  158. FDT_DLLEXPORT int EXPORT Dlg_ListSetTabStops( const dlg_hdlg hdlg, LPCSTR key, LPCSTR tabstops);
  159. FDT_DLLEXPORT int EXPORT Dlg_ListSetColumnWidth( const dlg_hdlg hdlg, LPCSTR key,
  160.                                    LPCSTR columnwidth); 
  161.  
  162. /* Slider functions */
  163. FDT_DLLEXPORT int EXPORT Dlg_SliderGet( const dlg_hdlg hdlg, LPCSTR key,
  164.                           int* nCurPos,   int* nMinPos, int* nMaxPos,
  165.                           int* nSmallInc, int* nBigInc );
  166. FDT_DLLEXPORT int EXPORT Dlg_SliderSet( const dlg_hdlg hdlg, LPCSTR key, const int nCurPos,
  167.                           const int nMinPos, const int nMaxPos, 
  168.                           const int nSmallInc, const int nBigInc );
  169.  
  170. /* Image functions */
  171. FDT_DLLEXPORT int EXPORT Dlg_ImageStart( const dlg_hdlg hdlg, LPCSTR key);
  172. FDT_DLLEXPORT int EXPORT Dlg_ImageEnd( void);
  173. FDT_DLLEXPORT int EXPORT Dlg_ImageVector( const short x1, const short y1, 
  174.                             const short x2, const short y2, const short color);
  175.  
  176. FDT_DLLEXPORT int EXPORT Dlg_ImageFill(const short x1, const short y1, 
  177.                                        const short x2, const short y2, const short color);
  178.  
  179. FDT_DLLEXPORT int EXPORT Dlg_ImageBmp(const short x1, const short y1, 
  180.                                       const short x2, const short y2, LPCSTR szBmpPath);
  181.  
  182. FDT_DLLEXPORT int EXPORT Dlg_ImagePreviewBmp(const short x1, const short y1, 
  183.                                              const short x2, const short y2, 
  184.                                              LPCSTR szDrawingPath);
  185.  
  186. FDT_DLLEXPORT int EXPORT Dlg_ImageWmf( const short x1, const short y1, 
  187.                          const short x2, const short y2, LPCSTR szWmfPath);
  188.  
  189. FDT_DLLEXPORT int EXPORT Dlg_ImageLibrary(const short x1, const short y1, 
  190.                                           const short x2, const short y2, 
  191.                                           LPCSTR szImageName, LPCSTR szLibPath);
  192. #ifdef __cplusplus
  193. }
  194. #endif 
  195.  
  196. #endif   // _INC_FCDIALOG
  197.