home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / hpp.z / WCOMDLG.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-04  |  5.1 KB  |  190 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WCommonDialog -- Base CommonDialog class
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *       Change --
  19.  *
  20.  *       Close --
  21.  *
  22.  *       Create --
  23.  *
  24.  *       Destroy --
  25.  *
  26.  *       FolderChange --
  27.  *
  28.  *       Help --
  29.  *
  30.  *       InitializationDone --
  31.  *
  32.  *       MessageHook --
  33.  *
  34.  *       NewFileType --
  35.  *
  36.  *       SharingViolation --
  37.  *
  38.  *************************************************************************/
  39.  
  40. #ifndef _WCOMDLG_HPP_INCLUDED
  41. #define _WCOMDLG_HPP_INCLUDED
  42.  
  43. #ifndef _WNO_PRAGMA_PUSH
  44. #pragma pack(push,4);
  45. #pragma enum int;
  46. #endif
  47.  
  48. #ifndef _WEVENTD_HPP_INCLUDED
  49. #include "weventd.hpp"
  50. #endif
  51.  
  52. #ifndef _WFILPATH_HPP_INCLUDED
  53. #include "wfilpath.hpp"
  54. #endif
  55.  
  56. #ifndef _WRESID_HPP_INCLUDED
  57. #include "wresid.hpp"
  58. #endif
  59.  
  60. #ifndef _WMODULE_HPP_INCLUDED
  61. #include "wmodule.hpp"
  62. #endif
  63.  
  64. class WWindow;
  65. class WModelessDialog;
  66. class WDialog;
  67. class WModule;
  68.  
  69. struct WSharingViolationEventData : public WEventData {
  70.     WChar *             fileName;
  71. };
  72.  
  73. //
  74. // WCommonDialog
  75. //
  76.  
  77. class WCMCLASS WCommonDialog : public WEventGenerator {
  78.     WDeclareSubclass( WCommonDialog, WEventGenerator );
  79.  
  80.     public:
  81.         WCommonDialog();
  82.  
  83.         ~WCommonDialog();
  84.  
  85.         /********************************************************
  86.          * Properties
  87.          ********************************************************/
  88.  
  89.         // Dialog
  90.         //
  91.         //    Returns a pointer to a WDialog that can be used to
  92.         //    manipulate the common dialog.  For modal dialogs
  93.         //    this property only returns non-NULL when the
  94.         //    dialog is being displayed and thus is typically only
  95.         //    used within events.
  96.  
  97.         WDialog *GetDialog();
  98.  
  99.         // ModelessDialog
  100.         //
  101.  
  102.         WModelessDialog *GetModelessDialog();
  103.  
  104.         // Owner
  105.         //
  106.         //    Sets/gets the form that owns the dialog.
  107.  
  108.         WWindow *GetOwner() const;
  109.         WBool    SetOwner( WWindow *owner );
  110.  
  111.         // TemplateID
  112.         //
  113.         //    Sets/gets the resource ID that defines the template
  114.         //    to use for the dialog.  0 means no template is used.
  115.  
  116.         WResourceID GetTemplateID() const;
  117.         WBool       SetTemplateID( WResourceID id );
  118.  
  119.         // TemplateModule
  120.         //
  121.         //    Sets/gets the module for the template.  A value of
  122.         //    NULL means use the application module.
  123.  
  124.         WModule GetTemplateModule() const;
  125.         WBool   SetTemplateModule( const WModule & module );
  126.  
  127.         // Title
  128.         //
  129.         //    The title used when displaying the dialog.  The
  130.         //    title may be a null string, in which case a default
  131.         //    value is used.
  132.  
  133.         WString GetTitle() const;
  134.         WBool   SetTitle( const WChar *title );
  135.  
  136.         /********************************************************
  137.          * Methods
  138.          ********************************************************/
  139.  
  140.         // Abort
  141.         //
  142.         //    Causes the dialog to be closed as if the user had
  143.         //    cancelled it.
  144.  
  145.         WBool Abort() const;
  146.  
  147.         /********************************************************
  148.          * Notifications
  149.          ********************************************************/
  150.  
  151.         void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus,
  152.                                  WBool modal=TRUE );
  153.         void OnDialogDestroy();
  154.  
  155.         /********************************************************
  156.          * Event handlers
  157.          ********************************************************/
  158.  
  159.         WBool MessageHookEventHandler( WCommonDialog * dialog,
  160.                                        WMessageHookEventData * event );
  161.  
  162.         /********************************************************
  163.          * Data members
  164.          ********************************************************/
  165.  
  166.     protected:
  167.         WWindowHandle    _hWnd;
  168.         WBool            _isModal;
  169.         WDialog         *_dialog;
  170.         WModelessDialog *_modelessDialog;
  171.         WWindow         *_owner;
  172.         WModule          _templateModule;
  173.         WResourceID      _templateID;
  174.         WBool            _hasUserHook;
  175.         WString          _title;
  176.  
  177.     // Internal use only
  178.  
  179.     public:
  180.         WBool HasUserHook() const { return _hasUserHook; }
  181. };
  182.  
  183.  
  184. #ifndef _WNO_PRAGMA_PUSH
  185. #pragma enum pop;
  186. #pragma pack(pop);
  187. #endif
  188.  
  189. #endif // _WCOMDLG_HPP_INCLUDED
  190.