home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 4.1 KB | 140 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWStatic.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
-
- #ifndef FWSTATIC_H
- #define FWSTATIC_H
-
- //-----------------------------------------------------------------------------
- // Imported Classes
- //-----------------------------------------------------------------------------
-
- #ifndef FWVIEW_H
- #include "FWView.h"
- #endif
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- #ifndef FWTXTBOX_H
- #include "FWTxtBox.h"
- #endif
-
- //-----------------------------------------------------------------------------
- // FW_CStaticText
- //-----------------------------------------------------------------------------
-
- class FW_CStaticText: public FW_CView
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CStaticText)
-
- FW_CStaticText(Environment* ev,
- FW_CSuperView* container,
- const FW_CRect& bounds,
- const FW_CString& text,
- const FW_CFont& font = FW_kNormalFont,
- FW_TextBoxOptions options = FW_kTextBoxClipToBox,
- const FW_CInk& ink = FW_kNormalTextInk);
- FW_CStaticText(Environment* ev,
- FW_CSuperView* container,
- const FW_CTextBoxShape& textboxshape);
- FW_CStaticText(Environment* ev);
-
- ~FW_CStaticText();
-
- // ----- New API ------
- void GetText(Environment* ev, FW_CString& text) const;
- void SetText(Environment* ev, const FW_CString& text, FW_Boolean refresh = TRUE);
- FW_CTextBoxShape* GetTextBoxShape(Environment* ev);
-
- // ----- inherited from FW_CView
- virtual void Draw (Environment* ev, ODFacet* facet, ODShape* invalidShape);
-
- // ----- Archiving -----
- static void* Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
- static void Destroy(void* object, FW_ClassTypeConstant type);
- virtual void Flatten(Environment* ev, FW_CWritableStream& stream) const;
- virtual void InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
-
- private:
- void Initialize(Environment* ev,
- const FW_CRect& bounds,
- const FW_CString& text,
- const FW_CFont& font,
- FW_TextBoxOptions options,
- const FW_CInk& ink);
- private:
- FW_CTextBoxShape* fTextBoxShape;
- };
-
- //-----------------------------------------------------------------------------
- // FW_CStaticText In-lines
- //-----------------------------------------------------------------------------
- inline FW_CTextBoxShape* FW_CStaticText::GetTextBoxShape(Environment*)
- {
- return fTextBoxShape;
- }
-
- inline void FW_CStaticText::GetText(Environment*, FW_CString& text) const
- {
- fTextBoxShape->GetString(text);
- }
-
- //-----------------------------------------------------------------------------
- // FW_CGroupBox
- //-----------------------------------------------------------------------------
-
- class FW_CGroupBox: public FW_CStaticText
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CGroupBox)
-
- FW_CGroupBox (Environment* ev,
- FW_CSuperView* container,
- const FW_CRect& bounds,
- const FW_CString& text,
- const FW_CFont& font = FW_kNormalFont,
- FW_TextBoxOptions options = FW_kTextBoxClipToBox,
- const FW_CInk& textInk = FW_kNormalTextInk,
- const FW_CInk& frameInk = FW_kNormalInk);
- FW_CGroupBox (Environment* ev,
- FW_CSuperView* container,
- const FW_CTextBoxShape& textbox,
- const FW_CInk& frameInk = FW_kNormalInk);
- FW_CGroupBox(Environment* ev);
-
- ~FW_CGroupBox();
-
- // ----- New API ------
-
- // ----- FW_CView ------
- virtual void Draw (Environment* ev, ODFacet* facet, ODShape* invalidShape);
-
- // ----- Archiving -----
- static void* Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
- static void Destroy(void* object, FW_ClassTypeConstant type);
- virtual void Flatten(Environment* ev, FW_CWritableStream& stream) const;
- virtual void InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
-
- protected:
- void SetLabelRect(Environment* ev, FW_CGraphicContext& gc, FW_CRect& rect);
-
- private:
- FW_CInk fFrameInk;
- };
-
-
- #endif // FWSTATIC_H
-
-
-