fontdlg.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:5k
- /*
- * fontdlg.h
- *
- * Font selection dialog.
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: fontdlg.h,v $
- * Revision 1.10 1999/03/10 03:49:51 robertj
- * More documentation adjustments.
- *
- * Revision 1.9 1999/03/09 08:01:48 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.8 1999/02/16 08:08:45 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.7 1998/12/01 12:55:52 robertj
- * new directory structure.
- *
- * Revision 1.6 1998/09/23 06:23:37 robertj
- * Added open source copyright license.
- *
- * Revision 1.5 1998/09/22 15:04:36 robertj
- * Fixed confusion in Font Dialog, variable at different levels with same name.
- *
- * Revision 1.4 1995/06/17 11:12:36 robertj
- * Documentation update.
- *
- * Revision 1.3 1995/04/25 10:56:20 robertj
- * Changed function names to avoid conflicts with ancestor virtuals.
- *
- * Revision 1.2 1995/03/14 12:41:27 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.1 1995/01/22 04:49:25 robertj
- * Initial revision
- *
- */
- #define _PFONTDIALOG
- #ifdef __GNUC__
- #pragma interface
- #endif
- /**System specific standard dialogs for getting a font specification.
- Note that unlike most dialogs, most operations such as
- Ref{PInteractor::Show()}, Ref{PInteractorLayout::GetControl()} etc may
- {bf not} be executed before the Ref{PModalDialog::RunModal()} function
- has been executed. Furthermore, they are not available {bf after}
- Ref{PModalDialog::RunModal()} has returned. This is due to the
- implementation on some platforms which goes to great lengths to use the
- actual standard font dialog for the platform.
- */
- class PFontDialog : public PModalDialog
- {
- PCLASSINFO(PFontDialog, PModalDialog);
- public:
- /**Create the standard font dialog. The second form of constructor
- preinitialises the fields in the dialog to that specified in the
- font specification class. Otherwise a system default will be used.
- If the print canvas is specified then that canvas is used to enumerate
- the possible fonts. If #pCanvas# is NULL then the fonts for
- the screen are presented.
- */
- PFontDialog(
- PInteractor * parent, /// Owner interactor for the dialog.
- PPrintCanvas * pCanvas = NULL, /// Printer canvas to select fonts from.
- PRESOURCE_ID resID = PSTD_ID_DIALOG_FONT
- /// Resource identifier for the dialog description resource.
- );
- PFontDialog(
- PInteractor * parent, /// Owner interactor for the dialog.
- const PFont & font, /// Initial font specification.
- PPrintCanvas * pCanvas = NULL, /// Printer canvas to select fonts from.
- PRESOURCE_ID resID = PSTD_ID_DIALOG_FONT
- /// Resource identifier for the dialog description resource.
- );
- /** Destroy the standard font dialog. */
- ~PFontDialog();
- /**@name New functions for class */
- /**Set the initial font for the dialog. This function will only have an
- effect before the Ref{PModalDialog::RunModal()} function is called.
- After that it is ignored.
- */
- void SetDefaultFont(const PFont & font);
- /**Get the font specification set by this dialog. Before the
- {bf return} from the Ref{PModalDialog::RunModal()} function, this
- will get the inital font as set by the constructor or the
- Ref{SetFont()} function. After the Ref{PModalDialog::RunModal()}
- function has returned TRUE, it will get the selected font.
- @return
- reference to Ref{PFont} member variable in this class.
- */
- const PFont & GetSelectedFont() const;
- protected:
- // Member variables
- /** Font specification for the dialog. */
- PFont selectedFont;
- /** Printer canvas used for font enumeration in dialog. */
- PPrintCanvas * printerCanvas;
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////