stattext.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:5k
- /*
- * stattext.h
- *
- * Static text control.
- *
- * 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: stattext.h,v $
- * Revision 1.18 1999/03/10 03:49:53 robertj
- * More documentation adjustments.
- *
- * Revision 1.17 1999/03/09 08:01:50 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.16 1999/02/16 08:08:46 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.15 1998/09/23 06:29:22 robertj
- * Added open source copyright license.
- *
- * Revision 1.14 1995/06/17 11:13:28 robertj
- * Documentation update.
- *
- * Revision 1.13 1995/03/14 12:42:43 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.12 1995/01/27 11:16:57 robertj
- * Changed alignment mask from enum to int.
- *
- * Revision 1.11 1995/01/16 09:42:11 robertj
- * Documentation.
- *
- * Revision 1.10 1994/10/30 11:47:22 robertj
- * Changed mechanism for doing notification callback functions.
- *
- * Revision 1.9 1994/08/23 11:32:52 robertj
- * Oops
- *
- * Revision 1.8 1994/08/22 00:46:48 robertj
- * Added pragma fro GNU C++ compiler.
- *
- * Revision 1.7 1994/03/07 07:38:19 robertj
- * Major enhancementsacross the board.
- *
- * Revision 1.6 1994/01/03 04:42:23 robertj
- * Mass changes to common container classes and interactors etc etc etc.
- *
- * Revision 1.5 1993/09/27 16:35:25 robertj
- * Removed special constructor for dialog resource loading.
- *
- * Revision 1.4 1993/08/21 01:50:33 robertj
- * Made Clone() function optional, default will assert if called.
- *
- * Revision 1.3 1993/07/14 12:49:16 robertj
- * Fixed RCS keywords.
- *
- */
- #define _PSTATICTEXT
- #ifdef __GNUC__
- #pragma interface
- #endif
- class PStaticText : public PNamedControl
- {
- PCLASSINFO(PStaticText, PNamedControl)
- /* A simple control to display some text. This draws the text without any
- borders in the specified alignment and in the current foreground and
- background colours for the interactor.
-
- This control is display only and normally does not permit any further
- interaction.
- */
- public:
- /**Create a static text control containing the specified string and
- using the specified alignment options.
- */
- PStaticText(
- PInteractor * parent, /// Interactor into which the control is placed.
- int align = PCanvas::LeftAlign
- /**Alignment for the text in the control. This is an or combination of
- values from the Ref{PCanvas::DrawStringOptions enum}.
- */
- );
- PStaticText(
- PInteractor * parent, /// Interactor into which the control is placed.
- const PString & name, /// Text string contents of the static control.
- int align = PCanvas::LeftAlign
- /**Alignment for the text in the control. This is an or combination of
- value from the Ref{Pcanvas::DrawStringOptions enum}.
- */
- );
- /** Create control from interactor layout with the specified control ID. */
- PStaticText(
- PInteractorLayout * parent, /// Interactor into which the box is placed.
- PRESOURCE_ID ctlID, /// Identifier for the control in the layout.
- const PNotifier & notify, /// Function to call when changes state.
- void * valuePtr /// Unused value pointer for static control.
- );
- /** Destroy the static text control. */
- virtual ~PStaticText();
- /**@name Overrides from class PInteractor */
- /**This function is called by the system whenever the control requires
- redrawing.
-
- The bahaviour here is to draw the name of the control with the
- alignment specified. It uses the Ref{PCanvas::DrawString()} function.
- */
- virtual void OnRedraw(
- PCanvas & canvas /// Canvas used for to draw the static text.
- );
- /**@name New functions for class */
- /**Set the default (minimum) dimensions for the control. This is
- determined by the current font of the control and the text being
- displayed.
- */
- void DefaultDimensions();
- /**Set the current alignment for the static text control. This is an or
- combination of values from the Ref{PCanvas::DrawStringOptions enum}.
- */
- void SetAlignment(
- int newAlign /// New text alignment options.
- );
- /**Get the current alignment for the static text control.
-
- @return
- alignment of the text in the control.
- */
- int GetAlignment() const;
- protected:
- /** The current alignment used by the control. */
- int alignment;
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////