📄 dialog.h
字号:
/*---------------------------------------------------------------------- File : dialog.h Contents: simplified dialog definition for Athena widgets (action functions, alert/about dialog, property sheets) History : 14.05.1998 file created as psheet.h 03.06.1998 minor improvements 12.01.2000 action functions and alert/about dialog added 20.01.2000 text display dialog box added----------------------------------------------------------------------*/#ifndef __DIALOG__#define __DIALOG__#include <X11/Intrinsic.h>/*---------------------------------------------------------------------- Preprocessor Definitions----------------------------------------------------------------------*/#define TXT_STRING 0 /* get text to display from string */#define TXT_FILE 1 /* get text to display from file */#define PSH_LABEL 0 /* label */#define PSH_COMMAND 1 /* command button */#define PSH_TEXT 2 /* non-editable text field */#define PSH_EDIT 3 /* editable text field */#define PSH_TOGGLE 4 /* toggle button (checkbox) */#define PSH_RADIO 5 /* radio button */#define PSH_MENU 6 /* menu *//*---------------------------------------------------------------------- Type Definitions----------------------------------------------------------------------*/typedef struct { /* --- property sheet item --- */ Widget widget; /* item widget */ int type; /* item type (e.g. PS_COMMAND) */} PSHITEM; /* (property sheet item) */typedef struct { /* --- property sheet --- */ Widget parent; /* parent widget */ Widget shell; /* shell widget */ Widget form; /* form widget */ Widget ok, ca; /* ok and cancel button */ Widget currline; /* current line */ Widget prevline; /* previous line */ Widget previtem; /* previous item */ int itemvsz; /* size of items vector */ int itemcnt; /* number of items */ PSHITEM *items; /* property sheet items */} PSHEET; /* (property sheet) *//*---------------------------------------------------------------------- Dialog Box Action Functions----------------------------------------------------------------------*/extern void db_focus (Widget w, XEvent *e, String *s, Cardinal *c);extern void db_next (Widget w, XEvent *e, String *s, Cardinal *c);extern void db_close (Widget w, XEvent *e, String *s, Cardinal *c);/*---------------------------------------------------------------------- Alert/About/Text Display Box Functions----------------------------------------------------------------------*/extern int db_alert (Widget parent, XtCallbackProc callback, const char *msg);extern int db_text (Widget parent, XtCallbackProc callback, const char *title, int src, const char *text);extern int db_about (Widget parent, XtCallbackProc callback);/*---------------------------------------------------------------------- Property Sheet Functions----------------------------------------------------------------------*/extern PSHEET* psh_create (const char *name, Widget parent, int cabutton);extern void psh_delete (PSHEET *psh);extern int psh_addline (PSHEET *psh, const char *name);extern int psh_additem (PSHEET *psh, const char *name, int type, int width);extern int psh_addcb (PSHEET *psh, const char *name, XtCallbackProc callback, XtPointer data);extern int psh_menuadd (PSHEET *psh, const char *name, const char *text);extern int psh_setval (PSHEET *psh, const char *name, const char *text);extern const char* psh_getval (PSHEET *psh, const char *name);extern int psh_handle (PSHEET *psh, XtCallbackProc callback);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -