Go to the documentation of this file.
52 #ifndef __PCL_CodeEditor_h
53 #define __PCL_CodeEditor_h
61 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
66 #endif // !__PCL_BUILDING_PIXINSIGHT_APPLICATION
92 Backward = 0x00000010,
93 CaseSensitive = 0x00000020,
94 WholeWords = 0x00000040,
95 SelectionOnly = 0x00000100,
96 Incremental = 0x00000200,
97 Default = CaseSensitive|WholeWords
108 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
176 void SetFilePath(
const String& path );
186 void SetText(
const String& text );
206 return EncodedText(
"UTF-8" );
218 return EncodedText(
"ISO-8859-1" );
241 SetEncodedText( text,
"UTF-8" );
253 SetEncodedText( text,
"ISO-8859-1" );
268 bool IsReadOnly()
const;
279 void SetReadOnly(
bool readOnly =
true );
298 bool Save(
const String& filePath,
const IsoString& encoding =
"UTF-8" );
310 return Save( filePath,
"UTF-8" );
323 return Save( filePath,
"ISO-8859-1" );
338 bool Load(
const String& filePath,
const IsoString& encoding =
"UTF-8" );
350 return Load( filePath,
"UTF-8" );
363 return Load( filePath,
"ISO-8859-1" );
370 int NumberOfLines()
const;
376 int NumberOfCharacters()
const;
387 Point CursorPosition()
const;
394 return CursorPosition().y;
402 return CursorPosition().x;
410 void SetCursorPosition(
int line,
int column );
419 SetCursorPosition( pos.
y, pos.
x );
431 bool IsInsertMode()
const;
439 void SetInsertMode(
bool insert =
true );
449 SetInsertMode( !replace );
462 bool IsBlockSelectionMode()
const;
471 void SetBlockSelectionMode(
bool blockMode =
true );
482 SetBlockSelectionMode( !lineMode );
497 bool IsDynamicWordWrapMode()
const;
504 void SetDynamicWordWrapMode(
bool wrapMode =
true );
509 int UndoSteps()
const;
514 int RedoSteps()
const;
519 bool HasSelection()
const;
531 Rect Selection()
const;
541 void SetSelection(
int fromLine,
int fromCol,
int toLine,
int toCol );
552 SetSelection( r.
y0, r.
x0, r.
y1, r.
x1 );
559 String SelectedText()
const;
567 void InsertText(
const String& text );
625 bool GotoMatchedParenthesis();
675 bool ReplaceSelection(
const String& replaceWith );
874 EventHandlers() =
default;
875 EventHandlers(
const EventHandlers& ) =
default;
876 EventHandlers& operator =(
const EventHandlers& ) =
default;
882 friend class CodeEditorEventDispatcher;
887 #endif // __PCL_BUILDING_PIXINSIGHT_APPLICATION
891 #endif // __PCL_CodeEditor_h
void(Control::*)(CodeEditor &sender) editor_event_handler
void(Control::*)(CodeEditor &sender, bool state) state_event_handler
bool SaveISO88591(const String &filePath)
bool LoadISO88591(const String &filePath)
component y1
Vertical coordinate of the lower right corner.
void SetCursorPosition(const Point &pos)
A generic point in the two-dimensional space.
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
void SetTextUTF8(const IsoString &text)
void(Control::*)(CodeEditor &sender, int fromLine, int fromCol, int toLine, int toCol) selection_event_handler
IsoString TextUTF8() const
void SetTextISO88591(const IsoString &text)
A type-safe collection of enumerated flags.
A generic rectangle in the two-dimensional space.
component x1
Horizontal coordinate of the lower right corner.
void SetLineSelectionMode(bool lineMode=true)
Client-side interface to a PixInsight CodeEditor control.
component x
Abscissa (horizontal, or X-axis coordinate).
bool LoadUTF8(const String &filePath)
IsoString TextISO88591() const
bool SaveUTF8(const String &filePath)
component x0
Horizontal coordinate of the upper left corner.
component y0
Vertical coordinate of the upper left corner.
Client-side interface to a PixInsight Control object.
void SetReplaceMode(bool replace=true)
component y
Ordinate (vertical, or Y-axis coordinate).
void SetSelection(const Rect &r)
void(Control::*)(CodeEditor &sender, int line, int col) cursor_event_handler