home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / code / desklib / DeskLib / !DeskLib / h / Dialog2 < prev    next >
Encoding:
Text File  |  1995-07-17  |  2.3 KB  |  80 lines

  1.  
  2. #ifndef __dl_dialog2_h
  3. #define __dl_dialog2_h
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifndef __dl_wimp_h
  8. #include "Wimp.h"
  9. #endif
  10. #ifndef __dl_window_h
  11. #include "Window.h"
  12. #endif
  13. typedef enum {
  14. dialog2_type_CLOSED = 0,
  15. dialog2_type_MENULEAF,
  16. dialog2_type_MENU,
  17. dialog2_type_STATIC
  18. }
  19. dialog2_dialog2type;
  20. typedef struct dialog2_block *dialog2_blockptr;
  21. typedef void (*dialog2_openfn)( dialog2_blockptr);
  22. typedef void (*dialog2_okfn)( dialog2_blockptr);
  23. typedef struct dialog2_block {
  24. void *reference; 
  25. char *templatename; 
  26. window_handle window; 
  27. dialog2_openfn openfn; 
  28. dialog2_okfn okfn; 
  29. union {
  30. int value;
  31. struct {
  32. unsigned int type : 2; 
  33. unsigned int keepwindow : 1;
  34. unsigned int notifyclose : 1;
  35. int okbutton : 9;
  36. int cancelbutton : 9;
  37. int maxtitlesize : 10;
  38. }
  39. data;
  40. }
  41. flags;
  42. }
  43. dialog2_block;
  44. dialog2_block *Dialog2_CreateDialogBlock( 
  45. char *templatename, 
  46. icon_handle okbutton,
  47. icon_handle cancelbutton,
  48. dialog2_openfn openfn,
  49. dialog2_okfn okfn,
  50. void *reference
  51. );
  52. BOOL Dialog2_OpenDialogMenuLeaf( event_pollblock *event, dialog2_block *dialog2);
  53. BOOL Dialog2_OpenDialogMenu( dialog2_block *dialog2, window_openpos openpos);
  54. BOOL Dialog2_OpenDialogStatic( dialog2_block *dialog2, window_openpos openpos);
  55. BOOL Dialog2_CloseDialog( dialog2_block *dialog2);
  56. BOOL Dialog2_DeleteDialog( dialog2_block *dialog2);
  57. #ifdef _DeskLib_SDLS
  58. extern dialog2_block **Dialog2__Ref_menublock( void);
  59. #endif
  60. #if defined( _DeskLib_SDLS) && !defined( _DeskLib_Dialog2)
  61. #define dialog2_menublock (*Dialog2__Ref_menublock())
  62. #else
  63. extern dialog2_block *dialog2_menublock;
  64. #endif
  65. void Dialog2_Window_GetWindowOpenPos( 
  66. wimp_point *pos, window_openpos openpos, window_handle window
  67. );
  68. void Dialog2_EnsureWindowHandle( dialog2_block *dialog2);
  69. #define Dialog2_ChangeCloseNotification( dialog2, x) (dialog2)->flags.data.notifyclose = (x)
  70. #define Dialog2_NotifyClose( dialog2) Dialog2_ChangeCloseNotification( dialog2, 1)
  71. #define Dialog2_DontNotifyClose( dialog2) Dialog2_ChangeCloseNotification( dialog2, 0)
  72. #define Dialog2_ChangeKeepWindow( dialog2, x) (dialog2)->flags.data.keepwindow = (x)
  73. #define Dialog2_KeepWindow( dialog2) Dialog2_ChangeKeepWindow( dialog2, 1)
  74. #define Dialog2_DontKeepWindow( dialog2) Dialog2_ChangeKeepWindow( dialog2, 0)
  75. #define Dialog2_ChangeTitleSize( dialog2, x) (dialog2)->flags.data.maxtitlesize = (x)
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif
  80.