28 #include "ui/controls/control.h"
39 const int EDITSTUDIOMAX = 20000;
41 const int EDITLINEMAX = 1000;
43 const int EDITHISTORYMAX = 50;
46 const int EDITUNDOMAX = 20;
124 bool EventProcess(
const Event &event)
override;
125 void Draw()
override;
127 void SetText(
const char *text,
bool bNew=
true);
128 void GetText(
char *buffer,
int max);
132 bool ReadText(std::string filename,
int addSize=0);
133 bool WriteText(std::string filename);
135 void SetMaxChar(
int max);
138 void SetEditCap(
bool bMode);
141 void SetHighlightCap(
bool bEnable);
142 bool GetHighlightCap();
144 void SetInsideScroll(
bool bInside);
145 bool GetInsideScroll();
147 void SetSoluceMode(
bool bSoluce);
148 bool GetSoluceMode();
150 void SetGenericMode(
bool bGeneric);
151 bool GetGenericMode();
153 void SetAutoIndent(
bool bMode);
154 bool GetAutoIndent();
156 void SetCursor(
int cursor1,
int cursor2);
157 void GetCursor(
int &cursor1,
int &cursor2);
159 void SetFirstLine(
int rank);
163 void SetDisplaySpec(
bool bDisplay);
164 bool GetDisplaySpec();
166 void SetMultiFont(
bool bMulti);
170 bool Copy(
bool memorize_cursor =
false);
175 void HyperHome(std::string filename);
179 void SetFontSize(
float size)
override;
182 bool SetFormat(
int cursor1,
int cursor2,
int format);
185 void SendModifEvent();
194 void HyperJump(std::string name, std::string marker);
195 bool HyperAdd(std::string filename,
int firstLine);
197 void DrawImage(
Math::Point pos, std::string name,
float width,
float offset,
float height,
int nbLine);
204 void LoadImage(std::string name);
205 void Scroll(
int pos,
bool bAdjustCursor);
207 void MoveChar(
int move,
bool bWord,
bool bSelect);
208 void MoveLine(
int move,
bool bWord,
bool bSelect);
209 void MoveHome(
bool bWord,
bool bSelect);
210 void MoveEnd(
bool bWord,
bool bSelect);
212 void Insert(
char character);
213 void InsertOne(
char character);
214 void Delete(
int dir);
215 void DeleteOne(
int dir);
217 int IndentTabCount();
218 void IndentTabAdjust(
int number);
219 bool Shift(
bool bLeft);
220 bool MinMaj(
bool bMaj);
222 int GetCursorLine(
int cursor);
225 void UndoMemorize(OperUndo oper);
231 std::unique_ptr<CScroll> m_scroll;
234 std::vector<char> m_text;
235 std::vector<Gfx::FontMetaChar> m_format;
243 bool m_bInsideScroll;
255 int m_lineOffset[EDITLINEMAX];
256 char m_lineIndent[EDITLINEMAX];
257 std::vector<ImageLine> m_image;
258 std::vector<HyperLink> m_link;
259 std::vector<HyperMarker> m_marker;
261 int m_historyCurrent;
265 float m_timeLastClick;
266 float m_timeLastScroll;
int firstLine
rank of the first displayed line
Definition: edit.h:106
float width
width
Definition: edit.h:82
Definition: robotmain.h:107
std::string name
name of the image (without icons/)
Definition: edit.h:76
int pos
position in the text
Definition: edit.h:98
std::string name
text file name (without help/)
Definition: edit.h:88
std::string name
name of the marker
Definition: edit.h:96
std::string marker
name of the marker
Definition: edit.h:90
int cursor2
offset cursor
Definition: edit.h:57
CEdit()
Object's constructor.
Definition: edit.cpp:99
2D point
Definition: point.h:50
float height
height of the part (dv texture)
Definition: edit.h:80
int lineFirst
the first line displayed.
Definition: edit.h:59
std::vector< char > text
original text
Definition: edit.h:51
float offset
vertical offset (v texture)
Definition: edit.h:78
RGBA color.
Definition: color.h:39
EventType
Type of event message.
Definition: event.h:41
Event sent by system, interface or game.
Definition: event.h:709
int cursor1
offset cursor
Definition: edit.h:55
int len
length of the text
Definition: edit.h:53
std::string filename
full file name text
Definition: edit.h:104