home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WPROPSHT.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-30
|
11KB
|
372 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
#ifndef _WPROPSHT_HPP_INCLUDED
#define _WPROPSHT_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCONTROL_HPP_INCLUDED
# include "wcontrol.hpp"
#endif
#ifndef _WVECTOR_HPP_INCLUDED
# include "wvector.hpp"
#endif
/*************************************************************************
*
* WPropertySheetItem --
*
*************************************************************************/
class WIcon;
class WPropertySheet;
struct WPropertySheetEventData : public WEventData {
WInt index;
};
struct WPSDialogEventData : public WEventData {
WLong p1;
WLong p2;
};
//
// PropertySheet styles
//
#define WPSSDefault ((WStyle)0x50000000L) // WS_VISIBLE|WS_CHILD
class WCMCLASS WPropertySheetItem : public WModelessDialog {
WDeclareSubclass( WPropertySheetItem, WModelessDialog );
friend class WModelessPropertySheet;
friend class WPropertySheet;
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WPropertySheetItem( WWindow * prt=NULL,
WPropertySheet * propsht=NULL );
~WPropertySheetItem();
/**********************************************************
* Properties
*********************************************************/
WInt GetIndex() const;
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Overrides
*********************************************************/
virtual WBool ProcessMessage( const WMessage & msg,
WLong & returns );
virtual void * GetTargetWindowProc() const;
/**********************************************************
* Others
*********************************************************/
virtual int operator ==( const WPropertySheetItem & obj ) const;
/**********************************************************
* Data members
*********************************************************/
private:
WModelessPropertySheet * _parent;
char const * _id;
void * _data;
WInt _index;
};
class WCMCLASS WPropertySheetInfo {
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WPropertySheetInfo();
WPropertySheetInfo( const WPropertySheetInfo & info );
~WPropertySheetInfo();
/**********************************************************
* Methods
*********************************************************/
void Init();
/**********************************************************
* Others
*********************************************************/
WPropertySheetInfo& operator=( const WPropertySheetInfo & info );
public:
/**********************************************************
* Data members
*********************************************************/
WString text;
void * data;
WIcon * image;
WBool selfDeleteImage;
WPropertySheetItem * dialog;
WBool selfDeleteDialog;
WResourceID * dlgID;
WBool selfDeleteDialogID;
WModuleHandle * module;
WBool selfDeleteModule;
WBool hasHelp;
WWindowHandle handle; // ignored by Add(),
// will be set later
// automatically
};
enum WPropertySheetButton {
WPSBOK,
WPSBCancel,
WPSBApplyNow,
WPSBHelp
};
/*************************************************************************
*
* WModelessPropertySheet -- Wrapper for the Windows 95 Property Sheet
*
* Events:
*
* ApplyNowOrOK --
*
* Back --
*
* Cancel --
*
* Finish --
*
* Help --
*
* Next --
*
* PageSelect --
*
* PageUnselect --
*
* QueryCancel --
*
* QuerySibling --
*
*************************************************************************/
class WCMCLASS WModelessPropertySheet : public WControl {
WDeclareSubclass( WModelessPropertySheet, WControl );
friend class WPropertySheetItem;
public:
/**********************************************************
* Constructors and destructors
*********************************************************/
WModelessPropertySheet( WBool hasHelp=FALSE, WIcon * image=NULL,
const WChar * text=NULL,
WBool isPropertyTitle=FALSE,
WInt startItemIndex=0,
WPropertySheetInfo * infoArray=NULL,
WInt numItems=0 );
~WModelessPropertySheet();
/**********************************************************
* Properties
*********************************************************/
// Changed
WBool SetChanged( WBool changed );
// Count
WInt GetCount() const;
// Selected
WBool SetSelected( WInt index );
/**********************************************************
* Methods
*********************************************************/
// Add
WPropertySheetItem * Add( const WPropertySheetInfo & info );
// Center
WBool Center();
WBool Center( WWindow *window );
// ChangeCancelToClose
virtual WBool ChangeCancelToClose();
// Delete
WBool Delete( WInt index );
// DeleteAll
WBool DeleteAll();
// QuerySiblings
WInt QuerySiblings( WLong p1, WLong p2 );
// PressButton
WBool PressButton( WPropertySheetButton buttonToSimulate );
// RebootSystem
WBool RebootSystem();
// RestartWindows
WBool RestartWindows();
/**********************************************************
* Overrides
*********************************************************/
virtual WBool SetText( const WString & text );
virtual const WChar * InitializeClass();
virtual WStyle GetDefaultStyle() const;
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
protected:
virtual WBool ProcessNotify( WUInt id, WNotify code, WNotifyInfo info,
WLong & returns );
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
*********************************************************/
protected:
WBool _isWizard;
public:
static char * _WPropertySheetClassName;
protected:
WULong _return;
WBool _canRebootOrRestart;
WInt _currItemIndex;
WPropertySheetInfo * _infoArray;
private:
WInt _numItems;
WBool _hasHelp;
WBool _isPropertyTitle;
WString _text;
WIcon * _image;
WInt _startItemIndex;
};
/*************************************************************************
*
* WPropertySheet -- Wrapper for the Windows 95 Property Sheet
*
* Events:
*
*************************************************************************/
class WCMCLASS WPropertySheet : public WModelessPropertySheet {
WDeclareSubclass( WPropertySheet, WModelessPropertySheet );
friend class WPropertySheetItem;
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WPropertySheet( WBool hasHelp=FALSE, WIcon * image=NULL,
const WChar * text=NULL, WBool isPropertyTitle=FALSE,
WInt startItemIndex=0,
WPropertySheetInfo * infoArray=NULL,
WInt numItems=0 );
~WPropertySheet();
/**********************************************************
* Properties
*********************************************************/
// ReturnValue
WULong GetReturnValue() const;
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Other
*********************************************************/
protected:
virtual WBool ProcessNotify( WUInt id, WNotify code, WNotifyInfo info,
WLong & returns );
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WPROPSHT_HPP_INCLUDED