home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WCommonDialog -- Base CommonDialog class
- *
- *
- * Events:
- *
- * Change --
- *
- * Close --
- *
- * Create --
- *
- * Destroy --
- *
- * FolderChange --
- *
- * Help --
- *
- * InitializationDone --
- *
- * MessageHook --
- *
- * NewFileType --
- *
- * SharingViolation --
- *
- *************************************************************************/
-
- #ifndef _WCOMDLG_HPP_INCLUDED
- #define _WCOMDLG_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,4);
- #pragma enum int;
- #endif
-
- #ifndef _WEVENTD_HPP_INCLUDED
- #include "weventd.hpp"
- #endif
-
- #ifndef _WFILPATH_HPP_INCLUDED
- #include "wfilpath.hpp"
- #endif
-
- #ifndef _WRESID_HPP_INCLUDED
- #include "wresid.hpp"
- #endif
-
- #ifndef _WMODULE_HPP_INCLUDED
- #include "wmodule.hpp"
- #endif
-
- class WWindow;
- class WModelessDialog;
- class WDialog;
- class WModule;
-
- struct WSharingViolationEventData : public WEventData {
- WChar * fileName;
- };
-
- //
- // WCommonDialog
- //
-
- class WCMCLASS WCommonDialog : public WEventGenerator {
- WDeclareSubclass( WCommonDialog, WEventGenerator );
-
- public:
- WCommonDialog();
-
- ~WCommonDialog();
-
- /********************************************************
- * Properties
- ********************************************************/
-
- // Dialog
- //
- // Returns a pointer to a WDialog that can be used to
- // manipulate the common dialog. For modal dialogs
- // this property only returns non-NULL when the
- // dialog is being displayed and thus is typically only
- // used within events.
-
- WDialog *GetDialog();
-
- // ModelessDialog
- //
-
- WModelessDialog *GetModelessDialog();
-
- // Owner
- //
- // Sets/gets the form that owns the dialog.
-
- WWindow *GetOwner() const;
- WBool SetOwner( WWindow *owner );
-
- // TemplateID
- //
- // Sets/gets the resource ID that defines the template
- // to use for the dialog. 0 means no template is used.
-
- WResourceID GetTemplateID() const;
- WBool SetTemplateID( WResourceID id );
-
- // TemplateModule
- //
- // Sets/gets the module for the template. A value of
- // NULL means use the application module.
-
- WModule GetTemplateModule() const;
- WBool SetTemplateModule( const WModule & module );
-
- // Title
- //
- // The title used when displaying the dialog. The
- // title may be a null string, in which case a default
- // value is used.
-
- WString GetTitle() const;
- WBool SetTitle( const WChar *title );
-
- /********************************************************
- * Methods
- ********************************************************/
-
- // Abort
- //
- // Causes the dialog to be closed as if the user had
- // cancelled it.
-
- WBool Abort() const;
-
- /********************************************************
- * Notifications
- ********************************************************/
-
- void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus,
- WBool modal=TRUE );
- void OnDialogDestroy();
-
- /********************************************************
- * Event handlers
- ********************************************************/
-
- WBool MessageHookEventHandler( WCommonDialog * dialog,
- WMessageHookEventData * event );
-
- /********************************************************
- * Data members
- ********************************************************/
-
- protected:
- WWindowHandle _hWnd;
- WBool _isModal;
- WDialog *_dialog;
- WModelessDialog *_modelessDialog;
- WWindow *_owner;
- WModule _templateModule;
- WResourceID _templateID;
- WBool _hasUserHook;
- WString _title;
-
- // Internal use only
-
- public:
- WBool HasUserHook() const { return _hasUserHook; }
- };
-
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WCOMDLG_HPP_INCLUDED
-