#ifndef VGUI_EDITPANEL_H #define VGUI_EDITPANEL_H #include #include #include namespace vgui { class Font; class VGUIAPI EditPanel : public Panel { public: EditPanel(int x,int y,int wide,int tall); public: virtual void doCursorUp(); virtual void doCursorDown(); virtual void doCursorLeft(); virtual void doCursorRight(); virtual void doCursorToStartOfLine(); virtual void doCursorToEndOfLine(); virtual void doCursorInsertChar(char ch); virtual void doCursorBackspace(); virtual void doCursorNewLine(); virtual void doCursorDelete(); virtual void doCursorPrintf(char* format,...); virtual int getLineCount(); virtual int getVisibleLineCount(); virtual void setCursorBlink(bool state); virtual void setFont(Font* font); virtual void getText(int lineIndex, int offset,char* buf,int bufLen); public: //bullshit public void getCursorBlink(bool& blink,int& nextBlinkTime); protected: virtual void paintBackground(); virtual void paint(); virtual void addLine(); virtual Dar* getLine(int lineIndex); virtual void setChar(Dar* lineDar,int x,char ch,char fill); virtual void setChar(Dar* lineDar,int x,char ch); virtual void shiftLineLeft(Dar* lineDar,int x,int count); virtual void shiftLineRight(Dar* lineDar,int x,int count); private: virtual int spatialCharOffsetBetweenTwoLines(Dar* srcDar,Dar* dstDar,int x); protected: Dar*> _lineDarDar; int _cursor[2]; bool _cursorBlink; int _cursorNextBlinkTime; Font* _font; }; } #endif