home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskLib / h_doc / Save2 < prev    next >
Encoding:
Text File  |  1997-01-20  |  1.7 KB  |  79 lines

  1. #ifndef __Desk_Save2_h
  2. #define __Desk_Save2_h
  3.  
  4.  
  5. #ifdef __cplusplus
  6.     extern "C" {
  7. #endif
  8.  
  9.  
  10. #include <stddef.h>
  11.  
  12. #ifndef __Desk_Dialog2_h
  13.     #include "Desk.Dialog2.h"
  14. #endif
  15.  
  16. #ifndef __Desk_Export_h
  17.     #include "Desk.Export.h"
  18. #endif
  19.  
  20. #ifndef __Desk_Wimp_h
  21.     #include "Desk.Wimp.h"
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27. typedef struct    {
  28.     Desk_dialog2_block*        dialog2;
  29.     Desk_icon_handle        dragsprite;
  30.     Desk_icon_handle        filenameicon;
  31.     Desk_export_filesaver        filesaver;
  32.     Desk_export_ramsaver        ramsaver;
  33.     Desk_export_resulthandler    resulthandler;
  34.     size_t                estimatedsize;
  35.     int                filetype;
  36.     void*                reference;
  37.     int                dragbutton;
  38.     }
  39.     Desk_save2_block;
  40.  
  41.  
  42. Desk_save2_block*    Desk_Save2_Create(
  43.                 Desk_dialog2_block*        dialog2,
  44.                 Desk_icon_handle        dragsprite,
  45.                 Desk_icon_handle        filenameicon,
  46.                 Desk_export_filesaver        filesaver,
  47.                 Desk_export_ramsaver        ramsaver,
  48.                 Desk_export_resulthandler    resulthandler,
  49.                 size_t                estimatedsize,
  50.                 int                filetype,
  51.                 void*                reference
  52.                 );
  53. /*
  54. This sets up the specified Desk_dialog2_block to be used to implement a
  55. save box. Save2 installs its own functions into the dialog2 window (so
  56. you can't use your own open handler for example).
  57.  
  58. Whenever the specified dialog2 is opened (eg by you calling
  59. Desk_Dialog2_OpenDialogMenuLeaf, Desk_Dialog2_OpenDialogMenu or
  60. Desk_Dialog2_OpenDialogStatic), Save2 looks after all drags of the
  61. dragsprite etc, and calls 'filesaver' or 'ramsaver' whenever a save is
  62. attempted.
  63.  
  64. Thus to implement a save box, all you need to do is create a dialog2
  65. window using Desk_Dialog2_CreateDialogBlock, write functions to
  66. save/ramtransfer data, and call Desk_Save2_Create with these functions.
  67. Lastly, simple open the dialog2 window when appropriate, and the rest
  68. happens automatically.
  69.  */
  70.  
  71.  
  72.  
  73. #ifdef __cplusplus
  74.     }
  75. #endif
  76.  
  77.  
  78. #endif
  79.