home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WDIALOG.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-29
|
9KB
|
266 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WModelessDialog -- Wrapper for the Windows 95 Dialog object.
*
*
* Events:
*
* Cancel --
*
* Close --
*
* OK --
*
*************************************************************************/
#ifndef _WDIALOG_HPP_INCLUDED
#define _WDIALOG_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WFORM_HPP_INCLUDED
# include "wform.hpp"
#endif
#ifndef _WRESID_HPP_INCLUDED
# include "wresid.hpp"
#endif
#ifndef _WVECTOR_HPP_INCLUDED
# include "wvector.hpp"
#endif
#ifndef _WSEMAPHR_HPP_INCLUDED
# include "wsemaphr.hpp"
#endif
struct WMessageFilterData;
class WCommandButton;
#define WIDOK 1
#define WIDCancel 2
#define WIDAbort 3
#define WIDRetry 4
#define WIDIgnore 5
#define WIDYes 6
#define WIDNo 7
#define WIDClose 8
#define WIDHelp 9
//
// Dialog styles
//
#define WDSAbsAlign ((WStyle)0x0001L) // DS_ABSALIGN
#define WDSSysModal ((WStyle)0x0002L) // DS_SYSMODAL
#define WDS3DLook ((WStyle)0x0004L) // DS_3DLOOK
#define WDSFixedSys ((WStyle)0x0008L) // DS_FIXEDSYS
#define WDSNoFailCreate ((WStyle)0x0010L) // DS_NOFAILCREATE
#define WDSLocalEdit ((WStyle)0x0020L) // DS_LOCALEDIT
#define WDSSetFont ((WStyle)0x0040L) // DS_SETFONT
#define WDSModalFrame ((WStyle)0x0080L) // DS_MODALFRAME
#define WDSNoIdleMsg ((WStyle)0x0100L) // DS_NOIDLEMSG
#define WDSSetForeGround ((WStyle)0x0200L) // DS_SETFOREGROUND
#define WDSControl ((WStyle)0x0400L) // DS_CONTROL
#define WDSCenter ((WStyle)0x0800L) // DS_CENTER
#define WDSCenterMouse ((WStyle)0x1000L) // DS_CENTERMOUSE
#define WDSContextHelp ((WStyle)0x2000L) // DS_CONTEXTHELP
class WCMCLASS WModelessDialog : public WForm {
WDeclareSubclass( WModelessDialog, WForm );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WModelessDialog();
WModelessDialog( WWindow *parent );
~WModelessDialog();
/**********************************************************
* Properties
*********************************************************/
// CancelButton
WCommandButton * SetCancelButton( WCommandButton * cancelButton );
// OKButton
WCommandButton * SetOKButton( WCommandButton * okButton );
/**********************************************************
* Methods
*********************************************************/
// Dismiss
virtual void Dismiss( WULong code );
/**********************************************************
* Event Handlers
*********************************************************/
WBool OKButtonCallback( WWindow *, WEventData * );
WBool CancelButtonCallback( WWindow *, WEventData * );
virtual WBool DialogCloseEventHandler( WModelessDialog * dialog,
WEventData * event );
/**********************************************************
* Overrides
*********************************************************/
virtual void AddControl( WControl * ctrl );
virtual WBool ProcessMessage( const WMessage & msg,
WLong & returns );
virtual WBool DefaultProcess( const WMessage & msg,
WLong & returns );
virtual WStyle GetDefaultStyle() const;
virtual WBool Destroy();
virtual void * GetTargetWindowProc() const;
virtual WInt GetTargetOffset() const;
virtual WBool LoadWindow( WWindow * parent,
const WResourceID & id,
WModuleHandle module=_ApplicationModule );
virtual WBool MakeWindow( WWindow * parent, WUInt id,
const WChar * className,
const WChar * title, const WRect & r,
WStyle wstyle, WStyle exStyle,
void * data=NULL );
/**********************************************************
* Other
*********************************************************/
WBool DialogFilter( WMessageFilterData * data );
WCallbackProc GetDialogProcedure() const;
WResourceID GetResourceID() const;
int operator ==( const WModelessDialog & obj ) const;
WBool PrepareChildHelpIDs();
virtual WBool CallNextWindowProcedure( const WMessage & msg,
WLong & returns );
private:
void EventInit();
/**********************************************************
* Data members
*********************************************************/
protected:
void * _internalData3;
void * _internalData2;
int _internalCount;
WModuleHandle _moduleHandle;
private:
WCallbackProc _procInst;
WResourceID _dialog_id;
WCommandButton * _okButton;
WCommandButton * _cancelButton;
};
/*************************************************************************
*
* WDialog -- Wrapper for the Windows 95 Dialog object.
*
*
* Events:
*
*************************************************************************/
class WCMCLASS WDialog : public WModelessDialog {
WDeclareSubclass( WDialog, WModelessDialog );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WDialog();
WDialog( WWindow *parent );
~WDialog();
/**********************************************************
* Properties
*********************************************************/
// ReturnValue
WULong GetReturnValue() const;
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Overrides
*********************************************************/
virtual WBool ProcessMessage( const WMessage & msg,
WLong & returns );
virtual void Dismiss( WULong code );
virtual WBool Destroy();
virtual WBool LoadWindow( WWindow * parent,
const WResourceID & id,
WModuleHandle module=_ApplicationModule );
virtual WBool MakeWindow( WWindow * parent, WUInt id,
const WChar * className,
const WChar * title, const WRect & r,
WStyle wstyle, WStyle exStyle,
void * data=NULL );
/**********************************************************
* Data Members
*********************************************************/
private:
WULong _return;
void * _internalData;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WDIALOG_HPP_INCLUDED