home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WCOLRDLG.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
5KB
|
146 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 _WCOLRDLG_HPP_INCLUDED
#define _WCOLRDLG_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCOLOR_HPP_INCLUDED
# include "wcolor.hpp"
#endif
#ifndef _WCOMDLG_HPP_INCLUDED
# include "wcomdlg.hpp"
#endif
#ifndef _WARRAY_HPP_INCLUDED
# include "warray.hpp"
#endif
typedef WArray< WColor > WColorArray;
//
// ColorDialog styles
//
typedef WULong WCDStyle;
#define WCDSRGBInit ((WCDStyle)0x00000001L) // CC_RGBINIT
#define WCDSFullOpen ((WCDStyle)0x00000002L) // CC_FULLOPEN
#define WCDSPreventFullOpen ((WCDStyle)0x00000004L) // CC_PREVENTFULLOPEN
#define WCDSShowHelp ((WCDStyle)0x00000008L) // CC_SHOWHELP
#define WCDSEnableHook ((WCDStyle)0x00000010L) // CC_ENABLEHOOK
#define WCDSEnableTemplate ((WCDStyle)0x00000020L) // CC_ENABLETEMPLATE
#define WCDSEnableTemplateHandle ((WCDStyle)0x00000040L) // CC_ENABLETEMPLATEHANDLE
#define WCDSSolidColor ((WCDStyle)0x00000080L) // CC_SOLIDCOLOR
#define WCDSAnyColor ((WCDStyle)0x00000100L) // CC_ANYCOLOR
// WColorDialog
//
// Used to display color dialog.
class WCMCLASS WColorDialog : public WCommonDialog {
WDeclareSubclass( WColorDialog, WCommonDialog );
public:
/*******************************************************
* Constructors and Destructors
*******************************************************/
WColorDialog();
~WColorDialog();
/*******************************************************
* Properties
*******************************************************/
// Color
WColor GetColor() const;
WBool SetColor( const WColor & color );
// CustomColorList
//
// Set the list of colors to use in the custom color
// section of the dialog. The list of colors is an
// array of 16 WColor objects. The colors will be
// modified as necessary and so must be read-write.
#define WCD_NUM_COLORS 16
WColorArray GetCustomColorList() const;
WBool SetCustomColorList( const WColorArray & list );
// Style
//
// Set the styles used by the file dialog. Note that
// the WCDSEnableHook style will ALWAYS be enabled.
WCDStyle GetStyle() const;
WBool SetStyle( WCDStyle style );
/*******************************************************
* Methods
*******************************************************/
// ChangeStyle
//
// Use to turn a specific style on or off.
WBool ChangeStyle( WCDStyle style, WBool on );
// Prompt
//
// Display the dialog and wait for it to be dismissed.
// The first form uses the current settings. The second
// is a convenience function.
WBool Prompt();
WBool Prompt( WWindow * owner, const WChar * title );
/************************************************************
* Notifications
************************************************************/
void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
/************************************************************
* Others
************************************************************/
private:
void * PackCC();
WBool UnpackCC( WBool ok );
/************************************************************
* Data members
************************************************************/
private:
void * _cc;
WULong _customColors[ 16 ];
WColorArray _colorList;
WColor _color;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WCOLRDLG_HPP_INCLUDED