AaronCameron.net
No ads. No Profit. No Master, But Truth.
Not a Member? - Login or Create an Account
Wednesday the 23rd of May 2012 @ 10:24am
Front Page Journal Projects Your Profile About
[]

LibN2L-4 Library Code Reference

Classes
Compounds
Files
Members
Method Index
Full Reference

cGuiTextDisplay.h

Go to the documentation of this file.
00001 /************************************************************************
00002 Nova-2 Library (libN2L, or simply n2l) Game development C++ Library
00003 Copyright (C) 2002  Aaron Cameron
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009 
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 Lesser General Public License for more details.
00014 
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00018 
00019 A copy of the GNU Lesser General Public License has been provided with
00020 this library in the file 'COPYING'.
00021 
00022 Contact information for the author of this library has been provided
00023 with this library in the file 'AUTHOR'.
00024 ************************************************************************/
00025 #ifndef _n2l4_cGuiTextDisplay_H
00026 #define _n2l4_cGuiTextDisplay_H
00027 
00028 #include "n2l/n2l.h"
00029 
00030 #include "gui/types.h"
00031 #include "gui/cGuiInteractive.h"
00032 #include "gui/cGuiTextStyle.h"
00033 
00034 /******************************************************************************/
00035 namespace n2l
00036 {
00037     class cVfsNodeInterface;
00038     class cGuiSlider;
00039     class cDynVar;
00040     class cEventInterface;
00041 
00045     class cGuiTextDisplay : public cGuiInteractive
00046     {
00047     public:
00048         cGuiTextDisplay();
00049         cGuiTextDisplay( const cVfsNodeInterface &iNode );
00050         cGuiTextDisplay( const cDynVar &iDefinition );
00051         virtual ~cGuiTextDisplay();
00052 
00053         virtual void load( const cVfsNodeInterface &iNode );
00054         virtual void load( const cDynVar &iDefinition );
00055 
00056         virtual void draw() const;
00057 
00058         virtual void text( const tString &iLabel );
00059         virtual const tString &text() const;
00060 
00061         virtual void lineInfo( const tUint &iLine,
00062             tUint &oSPos, tUint &oLen ) const;
00063 
00064         virtual const tUint numLines() const;
00065 
00070         virtual const tUint &lineOffset() const;
00071         virtual void lineOffset( const tUint &iOffset );
00072 
00073         virtual void textStyle( const cGuiTextStyle &iStyle );
00074         virtual const cGuiTextStyle &textStyle() const;
00075 
00076         virtual void slider( const cGuiSlider &iSliderTemplate );
00077 
00078         // Allow this widget to be cloned
00079         virtual const cAutoPtr<cGuiElement> clone() const;
00080 
00081         virtual void prop( const tString &iName, const cDynVar &iVal,
00082             const tString &iInnerKey = "" );
00083 
00084         virtual const cDynVar prop( const tString &iName,
00085             const tString &iInnerKey = "" ) const;
00086 
00087         // Get events to pass along to the slider if we have one.
00088         virtual void systemEvent(
00089             const cAutoPtr<const cEventInterface> &i_iEvent );
00090 
00091         virtual void systemEventOutside(
00092             const cAutoPtr<const cEventInterface> &i_iEvent );
00093 
00094     protected:
00095         virtual void cloneInto(
00096             const cAutoPtr<cGuiTextDisplay> &i_ioElement ) const;
00097 
00098         virtual void dimensionChanged();
00099         virtual void propertyChanged();
00100 
00101     private:
00102         typedef struct {
00103             tUint mSPos;
00104             tUint mSize;
00105         } tLineInfo;
00106 
00107         typedef std::vector<tLineInfo> tLineList;
00108 
00109         cGuiTextStyle mTextStyle;
00110         tString mText;
00111         cAutoPtr<cGuiSlider> mSlider;
00112 
00113         tLineList mLines;
00114 
00115         tUint mLineOffset;
00116 
00117 #       ifdef N2L_PASSIVE_GUI_REG
00118             static tBool smRegistered;
00119 #       endif
00120 
00121         virtual void reset();
00122 
00123      }; // class cGuiCanvas
00124 
00125 } // namespace n2l
00126 
00127 #endif
©2012 Aaron Cameron