home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
felixcad
/
fcaddata.z
/
FCDIALOG.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-29
|
10KB
|
197 lines
/****************************************************************************
(C) 1995-96 FELIX Computer Aided Technologies GmbH
File: fcdialog.h
Contents: Definitions for FCAD dialog box functions
Bearbeiter: D. Hubert
Created: Dec. 15, 1994
Changed:
****************************************************************************/
#ifndef _INC_FCDIALOG
#define _INC_FCDIALOG
#include "fdt.h"
#ifdef __cplusplus
extern "C"{
#endif
#ifndef EXPORT
#define EXPORT __far __pascal __export
#endif
/*===========================================================================
Definitions
===========================================================================*/
typedef void* dlg_hdlg;
typedef void* dlg_htile;
/* control-name (max. char number ) */
#define KEY_STR_MAX 32
typedef struct {
dlg_hdlg dialog; /* Handle for dialog window */
dlg_htile tile; /* Handle for control element (tile) */
char key[KEY_STR_MAX+1]; /* Key (ID) of control element */
LPSTR value; /* Current value of control element */
void* client_data; /* Currrent client data */
int reason; /* Code of return reason */
long x,y; /* Coordinates of image control */
} dlg_callback_packet;
/* For use in tile callback packets */
#define CTRL_SELECT 1
#define CTRL_LOST_FOCUS 2
#define CTRL_DRAG 3
#define CTRL_DOUBLE_CLICK 4
#if _WIN32
#define CTRL_UPDATE 5
#endif //#if _WIN32
/* DIALOG user's function, passed to FELIX to be called later */
typedef void( EXPORT *CLIENTFUNC) ( dlg_callback_packet *cpkt);
#define NO_CLIENTFUNC ((CLIENTFUNC)0)
#define BAD_DIALOG NULL
typedef void( EXPORT *DLGINITFUNC) ( dlg_hdlg hdlg);
#define NO_DLGINITFUNC ((DLGINITFUNC)0)
/* Return by reference integers for DLG_DialogStart() */
#define DLG_CANCEL 0 /* User pressed Cancel or equivalent */
#define DLG_OK 1 /* User pressed Ok */
#define DLG_ALLDONE -1 /* All dialogs terminated with
Dlg_DialogTerm() */
#define DLG_STATUS 2 /* Start of user return codes */
#define DLG_ERR_EXIST -2 /* Dialog allready started */
#define DLG_ERR_TOOMANY -3 /* To many started dialogs */
#define DLG_ERR_WRONGHANDLE -4 /* Invalid dialog handle */
/* List argument type for DLG_ListStart(); */
#define DLG_L_CHANGE ((short) 1) /* Change selected listbox contents */
#define DLG_L_APPEND ((short) 2) /* Append new listbox entry */
#define DLG_L_NEW ((short) 3) /* Delete old list and create new list */
#define DLG_L_INSERT ((short)10) /* Insert listbox entry */
#define DLG_L_DELETE ((short)11) /* Delete listbox entry */
#define DLG_L_GETSEL ((short)12) /* Get selected listbox entries */
#define DLG_L_GETTEXT ((short)13) /* Get listbox entries */
#define DLG_L_SETSEL ((short)14) /* Select listbox entry */
#define DLG_L_RESETSEL ((short)15) /* Deselect listbox entry */
#define DLG_L_SETCARET ((short)16) /* Set focus rectangle */
/* Mode argument type for DLG_TileMode(); */
#define DLG_M_ENABLE ((short) 0) /* Enable tile */
#define DLG_M_DISABLE ((short) 1) /* Disable tile */
#define DLG_M_SETFOCUS ((short) 2) /* Set focus to tile */
#define DLG_M_SETSEL ((short) 3) /* Set editbox selection--allows
auto-clearing of old string */
#define DLG_M_FLIP ((short) 4) /* Invert current state */
#define DLG_M_VISIBLE ((short) 5) /* Visible tile */
#define DLG_M_HIDE ((short) 6) /* Hide tile */
/* For buffers that receive values for tiles. The number is arbitrary
--it's just here to allow changing them all from one place. */
#define TILE_STR_MAX 40
#define TILE_STR_LIMIT 255 /* real limit of dialog strings */
/* Radiobutton/Checkbox argument type for Dlg_Tile[Set,Get]() */
#define DLG_B_UNCHECKED "0" /* Checkbox/Radiobutton */
#define DLG_B_CHECKED "1" /* Checkbox/Radiobutton */
#define DLG_B_INDETERMINATE "2" /* Only Checkbox with attribute 3STATE
or AUTO3STATE */
/* Color argument type for Dlg_Image[Fill,Vector]() */
#define CAD_BG_COLOR ((short) -2) /* Background color CAD window */
#define DLG_BG_COLOR ((short)-15) /* Background color current dialog window*/
#define DLG_TXT_COLOR ((short)-16) /* Text color of current dialog window */
#define DLG_CUR_COLOR ((short)-18) /* Current color of current dialog window*/
/* Font argument type for Dlg_TileSetFont() */
#define DLG_SYS_VAR_FONT ((short) 0) /* System font */
#define DLG_SYS_FIX_FONT ((short) 1) /* System fixed font */
#define DLG_ANSI_VAR_FONT ((short) 2) /* ANSI ystem font */
#define DLG_ANSI_FIX_FONT ((short) 3) /* ANSI system fixed font */
/*===========================================================================
Dialog Functions
===========================================================================*/
/* Dialog function */
FDT_DLLEXPORT int EXPORT Dlg_DialogLoad( LPCSTR dlg_file, int* dlg_id);
FDT_DLLEXPORT int EXPORT Dlg_DialogUnload( int dlg_id);
FDT_DLLEXPORT int EXPORT Dlg_DialogNew( LPCSTR dlg_name, const int dlg_id,
const CLIENTFUNC def_callback, dlg_hdlg* hdlg);
FDT_DLLEXPORT int EXPORT Dlg_DialogNewPositioned( LPCSTR dlg_name, const int dlg_id,
const CLIENTFUNC def_callback,
const int x, const int y,
dlg_hdlg* hdlg);
FDT_DLLEXPORT int EXPORT Dlg_DialogStart( const dlg_hdlg hdlg, int* status,
const DLGINITFUNC init_dialog_callback);
FDT_DLLEXPORT int EXPORT Dlg_DialogDone( const dlg_hdlg hdlg, const int status);
FDT_DLLEXPORT int EXPORT Dlg_DialogDonePositioned( const dlg_hdlg hdlg, const int status,
int* x_result, int* y_result);
FDT_DLLEXPORT int EXPORT Dlg_DialogTerm( void);
/* Control functions */
FDT_DLLEXPORT int EXPORT Dlg_TileAction( const dlg_hdlg hdlg, LPCSTR key,
const CLIENTFUNC tilefunc);
FDT_DLLEXPORT int EXPORT Dlg_TileSet( const dlg_hdlg hdlg, LPCSTR key, LPCSTR value);
FDT_DLLEXPORT int EXPORT Dlg_TileGet( const dlg_hdlg hdlg, LPCSTR key, LPSTR value,
const int maxlen);
FDT_DLLEXPORT int EXPORT Dlg_TileClientData( const dlg_hdlg hdlg, LPCSTR key, void* clientdata);
FDT_DLLEXPORT int EXPORT Dlg_TileMode( const dlg_hdlg hdlg, LPCSTR key,
const short mode);
FDT_DLLEXPORT int EXPORT Dlg_TileDimensions( const dlg_hdlg hdlg, LPCSTR key,
short* cx, short* cy);
FDT_DLLEXPORT int EXPORT Dlg_TileSetFont( const dlg_hdlg hdlg, LPCSTR key,
const short font);
/* List functions */
FDT_DLLEXPORT int EXPORT Dlg_ListStart( const dlg_hdlg hdlg, LPCSTR key,
const short operation, const short index);
FDT_DLLEXPORT int EXPORT Dlg_ListAdd( LPCSTR item);
FDT_DLLEXPORT int EXPORT Dlg_ListGet( int* nPos, LPSTR szBuffer, const int maxlen);
FDT_DLLEXPORT int EXPORT Dlg_ListEnd( void);
FDT_DLLEXPORT int EXPORT Dlg_ListSetTabStops( const dlg_hdlg hdlg, LPCSTR key, LPCSTR tabstops);
FDT_DLLEXPORT int EXPORT Dlg_ListSetColumnWidth( const dlg_hdlg hdlg, LPCSTR key,
LPCSTR columnwidth);
/* Slider functions */
FDT_DLLEXPORT int EXPORT Dlg_SliderGet( const dlg_hdlg hdlg, LPCSTR key,
int* nCurPos, int* nMinPos, int* nMaxPos,
int* nSmallInc, int* nBigInc );
FDT_DLLEXPORT int EXPORT Dlg_SliderSet( const dlg_hdlg hdlg, LPCSTR key, const int nCurPos,
const int nMinPos, const int nMaxPos,
const int nSmallInc, const int nBigInc );
/* Image functions */
FDT_DLLEXPORT int EXPORT Dlg_ImageStart( const dlg_hdlg hdlg, LPCSTR key);
FDT_DLLEXPORT int EXPORT Dlg_ImageEnd( void);
FDT_DLLEXPORT int EXPORT Dlg_ImageVector( const short x1, const short y1,
const short x2, const short y2, const short color);
FDT_DLLEXPORT int EXPORT Dlg_ImageFill(const short x1, const short y1,
const short x2, const short y2, const short color);
FDT_DLLEXPORT int EXPORT Dlg_ImageBmp(const short x1, const short y1,
const short x2, const short y2, LPCSTR szBmpPath);
FDT_DLLEXPORT int EXPORT Dlg_ImagePreviewBmp(const short x1, const short y1,
const short x2, const short y2,
LPCSTR szDrawingPath);
FDT_DLLEXPORT int EXPORT Dlg_ImageWmf( const short x1, const short y1,
const short x2, const short y2, LPCSTR szWmfPath);
FDT_DLLEXPORT int EXPORT Dlg_ImageLibrary(const short x1, const short y1,
const short x2, const short y2,
LPCSTR szImageName, LPCSTR szLibPath);
#ifdef __cplusplus
}
#endif
#endif // _INC_FCDIALOG