home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WFONTDLG.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
6KB
|
179 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WFontDialog -- Wrapper for the Windows 95 Font dialog control.
*
* Events:
*
*************************************************************************/
#ifndef _WFONTDIALOG_HPP_INCLUDED
#define _WFONTDIALOG_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCOMDLG_HPP_INCLUDED
# include "wcomdlg.hpp"
#endif
#ifndef _WCANVAS_HPP_INCLUDED
# include "wcanvas.hpp"
#endif
#ifndef _WFONT_HPP_INCLUDED
# include "wfont.hpp"
#endif
typedef WStyle WFontDStyle;
//
// WFontDialog styles
//
#define WFontDSScreenFonts ((WStyle)0x00000001L)
#define WFontDSPrinterFonts ((WStyle)0x00000002L)
#define WFontDSBoth ((WStyle)0x00000003L)
#define WFontDSShowHelp ((WStyle)0x00000004L)
#define WFontDSEnableHook ((WStyle)0x00000008L)
#define WFontDSEnableTemplate ((WStyle)0x00000010L)
#define WFontDSEnableTemplateHandle ((WStyle)0x00000020L)
#define WFontDSInitToLogFontStruct ((WStyle)0x00000040L)
#define WFontDSUseStyle ((WStyle)0x00000080L)
#define WFontDSEffects ((WStyle)0x00000100L)
#define WFontDSApply ((WStyle)0x00000200L)
#define WFontDSScriptsOnly ((WStyle)0x00000400L)
#define WFontDSNoVectorFonts ((WStyle)0x00000800L)
#define WFontDSNoSimulations ((WStyle)0x00001000L)
#define WFontDSLimitSize ((WStyle)0x00002000L)
#define WFontDSFixedPitchOnly ((WStyle)0x00004000L)
#define WFontDSWYSIWYG ((WStyle)0x00008000L)
#define WFontDSForceFontExist ((WStyle)0x00010000L)
#define WFontDSScalableOnly ((WStyle)0x00020000L)
#define WFontDSTTOnly ((WStyle)0x00040000L)
#define WFontDSNoFaceSel ((WStyle)0x00080000L)
#define WFontDSNoStyleSel ((WStyle)0x00100000L)
#define WFontDSNoSizeSel ((WStyle)0x00200000L)
#define WFontDSSelectScript ((WStyle)0x00400000L)
#define WFontDSNoScriptSel ((WStyle)0x00800000L)
#define WFontDSNoVertFonts ((WStyle)0x01000000L)
class WCMCLASS WFontDialog : public WCommonDialog {
WDeclareSubclass( WFontDialog, WCommonDialog );
public:
/*******************************************************
* Constructors and Destructors
*******************************************************/
WFontDialog();
~WFontDialog();
/*******************************************************
* Properties
*******************************************************/
// Color
//
// Set/get the color chosen by the user.
// For use, WFontDSEffects must be specified.
WBool SetColor( const WColor & color );
WColor GetColor() const;
// Font
//
// Set/get the font chosen by the user.
WBool SetFont( const WFont & font );
WFont GetFont() const;
// MaximumPointSize
//
// Set/get the maximum point size of the font.
// For use, WFontDSLimitSize must be specified.
WBool SetMaximumPointSize( WInt pointSize );
WInt GetMaximumPointSize() const;
// MinimumPointSize
//
// Set/get the minimum point size of the font.
// For use, WFontDSLimitSize must be specified.
WBool SetMinimumPointSize( WInt pointSize );
WInt GetMinimumPointSize() const;
// Style
//
// Set the styles used by the file dialog. Note that
// the WFontDSEnableHook style will ALWAYS be enabled.
WFontDStyle GetStyle() const;
WBool SetStyle( WFontDStyle style );
/*******************************************************
* Methods
*******************************************************/
// ChangeStyle
//
// Use to turn a specific style on or off.
WBool ChangeStyle( WFontDStyle 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( const WInfoCanvas *canvas=NULL );
WBool Prompt( WWindow * owner, const WChar * title,
const WFont & initialFont,
const WInfoCanvas *canvas=NULL );
/********************************************************
* Notifications
********************************************************/
void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
/********************************************************
* Others
********************************************************/
private:
void *PackCF( WDeviceHandle dc );
WBool UnpackCF( WBool ok );
/********************************************************
* Data members
********************************************************/
private:
void *_cf;
WSystemLogicalFont *_logFont;
WFont _font;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WFONTDIALOG_HPP_INCLUDED