28 #include "ui/controls/control.h"
38 const int EDITHISTORYMAX = 50;
40 const int EDITUNDOMAX = 20;
118 bool EventProcess(
const Event &event)
override;
119 void Draw()
override;
121 void SetText(
const std::string& text,
bool bNew=
true);
122 std::string GetText(
int max);
123 const std::string& GetText();
126 bool ReadText(std::string filename);
127 bool WriteText(std::string filename);
129 void SetMaxChar(
int max);
132 void SetEditCap(
bool bMode);
135 void SetHighlightCap(
bool bEnable);
136 bool GetHighlightCap();
138 void SetInsideScroll(
bool bInside);
139 bool GetInsideScroll();
141 void SetSoluceMode(
bool bSoluce);
142 bool GetSoluceMode();
144 void SetGenericMode(
bool bGeneric);
145 bool GetGenericMode();
147 void SetAutoIndent(
bool bMode);
148 bool GetAutoIndent();
150 void SetCursor(
int cursor1,
int cursor2);
151 void GetCursor(
int &cursor1,
int &cursor2);
153 void SetFirstLine(
int rank);
157 void SetDisplaySpec(
bool bDisplay);
158 bool GetDisplaySpec();
160 void SetMultiFont(
bool bMulti);
164 bool Copy(
bool memorize_cursor =
false);
169 void HyperHome(std::string filename);
173 void SetFontSize(
float size)
override;
176 bool SetFormat(
int cursor1,
int cursor2,
int format);
179 void SendModifEvent();
188 void HyperJump(std::string name, std::string marker);
189 bool HyperAdd(std::string filename,
int firstLine);
191 void DrawImage(
Math::Point pos, std::string name,
float width,
float offset,
float height,
int nbLine);
198 void Scroll(
int pos,
bool bAdjustCursor);
200 void MoveChar(
int move,
bool bWord,
bool bSelect);
201 void MoveLine(
int move,
bool bWord,
bool bSelect);
202 void MoveHome(
bool bWord,
bool bSelect);
203 void MoveEnd(
bool bWord,
bool bSelect);
205 void Insert(
char character);
206 void InsertOne(
char character);
207 void Delete(
int dir);
208 void DeleteOne(
int dir);
210 int IndentTabCount();
211 void IndentTabAdjust(
int number);
212 bool Shift(
bool bLeft);
213 bool MinMaj(
bool bMaj);
215 int GetCursorLine(
int cursor);
218 void UndoMemorize(OperUndo oper);
223 void SetFocus(
CControl* control)
override;
226 void GetIndentedText(std::ostream& stream,
unsigned int start,
unsigned int end);
229 std::unique_ptr<CScroll> m_scroll;
233 std::vector<Gfx::FontMetaChar> m_format;
241 bool m_bInsideScroll;
253 std::vector<int> m_lineOffset;
254 std::vector<char> m_lineIndent;
255 std::vector<ImageLine> m_image;
256 std::vector<HyperLink> m_link;
257 std::vector<HyperMarker> m_marker;
259 int m_historyCurrent;
260 std::array<HyperHistory, EDITHISTORYMAX> m_history;
263 float m_timeLastClick;
264 float m_timeLastScroll;
273 std::array<EditUndo, EDITUNDOMAX> m_undo;
int firstLine
rank of the first displayed line
Definition: edit.h:100
float width
width
Definition: edit.h:76
Definition: robotmain.h:108
std::string name
name of the image (without icons/)
Definition: edit.h:70
int pos
position in the text
Definition: edit.h:92
std::string name
text file name (without help/)
Definition: edit.h:82
std::string name
name of the marker
Definition: edit.h:90
std::string marker
name of the marker
Definition: edit.h:84
int cursor2
offset cursor
Definition: edit.h:51
CEdit()
Object's constructor.
Definition: edit.cpp:90
2D point
Definition: point.h:50
float height
height of the part (dv texture)
Definition: edit.h:74
int lineFirst
the first line displayed.
Definition: edit.h:53
float offset
vertical offset (v texture)
Definition: edit.h:72
std::string text
original text
Definition: edit.h:45
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:735
int cursor1
offset cursor
Definition: edit.h:49
int len
length of the text
Definition: edit.h:47
std::string filename
full file name text
Definition: edit.h:98