• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

MyGUI_EditText.h

Go to the documentation of this file.
00001 
00007 /*
00008     This file is part of MyGUI.
00009     
00010     MyGUI is free software: you can redistribute it and/or modify
00011     it under the terms of the GNU Lesser General Public License as published by
00012     the Free Software Foundation, either version 3 of the License, or
00013     (at your option) any later version.
00014     
00015     MyGUI is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU Lesser General Public License for more details.
00019     
00020     You should have received a copy of the GNU Lesser General Public License
00021     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00022 */
00023 #ifndef __MYGUI_EDIT_TEXT_H__
00024 #define __MYGUI_EDIT_TEXT_H__
00025 
00026 #include "MyGUI_Prerequest.h"
00027 #include "MyGUI_XmlDocument.h"
00028 #include "MyGUI_Types.h"
00029 #include "MyGUI_ISubWidgetText.h"
00030 #include "MyGUI_IFont.h"
00031 #include "MyGUI_ResourceSkin.h"
00032 #include "MyGUI_RenderFormat.h"
00033 #include "MyGUI_TextView.h"
00034 
00035 namespace MyGUI
00036 {
00037 
00038     class RenderItem;
00039 
00040     class MYGUI_EXPORT EditText : public ISubWidgetText
00041     {
00042         MYGUI_RTTI_DERIVED( EditText );
00043 
00044     public:
00045         EditText();
00046         virtual ~EditText();
00047 
00048         virtual void setVisible(bool _value);
00049 
00050         // обновляет все данные связанные с тектом
00051         virtual void updateRawData();
00052 
00053         // метод для отрисовки себя
00054         virtual void doRender();
00055 
00056         void setCaption(const UString& _value);
00057         const UString& getCaption();
00058 
00059         void setTextColour(const Colour& _value);
00060         const Colour& getTextColour();
00061 
00062         void setAlpha(float _value);
00063         float getAlpha();
00064 
00065         virtual void setFontName(const std::string& _value);
00066         virtual const std::string& getFontName();
00067 
00068         virtual void setFontHeight(int _value);
00069         virtual int getFontHeight();
00070 
00071         virtual void createDrawItem(const std::string& _texture, ILayerNode * _node);
00072         virtual void destroyDrawItem();
00073 
00074         virtual void setTextAlign(Align _value);
00075         virtual Align getTextAlign();
00076 
00077         virtual size_t getTextSelectionStart();
00078         virtual size_t getTextSelectionEnd();
00079         virtual void setTextSelection(size_t _start, size_t _end);
00080 
00081         virtual bool getSelectBackground();
00082         virtual void setSelectBackground(bool _normal);
00083 
00084         virtual bool isVisibleCursor();
00085         virtual void setVisibleCursor(bool _value);
00086 
00087         virtual bool getInvertSelected() { return mInvertSelect; }
00088         virtual void setInvertSelected(bool _value);
00089 
00090         virtual size_t getCursorPosition();
00091         virtual void setCursorPosition(size_t _index);
00092 
00093         virtual IntSize getTextSize();
00094 
00095         // устанавливает смещение текста в пикселях
00096         virtual void setViewOffset(const IntPoint& _point);
00097         virtual IntPoint getViewOffset();
00098 
00099         // возвращает положение курсора по произвольному положению
00100         virtual size_t getCursorPosition(const IntPoint& _point);
00101 
00102         // возвращает положение курсора в обсолютных координатах
00103         virtual IntCoord getCursorCoord(size_t _position);
00104 
00105         void setShiftText(bool _shift);
00106 
00107         void setWordWrap(bool _value);
00108 
00109         virtual void setStateData(IStateInfo * _data);
00110 
00111         void _updateView();
00112         void _correctView();
00113 
00114     /*internal:*/
00115         void _setAlign(const IntSize& _oldsize, bool _update);
00116         void _setAlign(const IntCoord& _oldcoord, bool _update);
00117 
00118     protected:
00119         bool mEmptyView;
00120         uint32 mCurrentColour;
00121         uint32 mInverseColour;
00122         uint32 mCurrentAlpha;
00123         IntCoord mCurrentCoord;
00124 
00125         UString mCaption;
00126         bool mTextOutDate;
00127         Align mTextAlign;
00128 
00129         Colour mColour;
00130         float mAlpha;
00131         VertexColourType mVertexFormat;
00132 
00133         IFont* mFont;
00134         ITexture* mTexture;
00135         int mFontHeight;
00136 
00137         bool mBackgroundNormal;
00138         size_t mStartSelect;
00139         size_t mEndSelect;
00140         size_t mCursorPosition;
00141         bool mVisibleCursor;
00142         bool mInvertSelect;
00143 
00144         IntPoint mViewOffset; // смещение текста
00145 
00146         ILayerNode* mNode;
00147         RenderItem* mRenderItem;
00148         size_t mCountVertex;
00149         bool mIsAddCursorWidth;
00150 
00151         bool mShiftText;
00152         bool mWordWrap;
00153         int mOldWidth;
00154 
00155         TextView mTextView;
00156     };
00157 
00158 } // namespace MyGUI
00159 
00160 #endif // __MYGUI_EDIT_TEXT_H__

Generated on Sun Jan 30 2011 for MyGUI by  doxygen 1.7.1