52 #ifndef __PCL_CodeEditor_h
53 #define __PCL_CodeEditor_h
61 #ifndef __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
206 return EncodedText(
"UTF-8" );
218 return EncodedText(
"ISO-8859-1" );
241 SetEncodedText( text,
"UTF-8" );
253 SetEncodedText( text,
"ISO-8859-1" );
310 return Save( filePath,
"UTF-8" );
323 return Save( filePath,
"ISO-8859-1" );
350 return Load( filePath,
"UTF-8" );
363 return Load( filePath,
"ISO-8859-1" );
394 return CursorPosition().y;
402 return CursorPosition().x;
419 SetCursorPosition( pos.
y, pos.
x );
449 SetInsertMode( !replace );
482 SetBlockSelectionMode( !lineMode );
552 SetSelection( r.
y0, r.
x0, r.
y1, r.
x1 );
874 EventHandlers() =
default;
875 EventHandlers(
const EventHandlers& ) =
default;
876 EventHandlers& operator =(
const EventHandlers& ) =
default;
882 friend class CodeEditorEventDispatcher;
Client-side interface to a PixInsight CodeEditor control.
void SetReadOnly(bool readOnly=true)
void SetTextUTF8(const IsoString &text)
void SetTextISO88591(const IsoString &text)
void SetDynamicWordWrapMode(bool wrapMode=true)
bool Load(const String &filePath, const IsoString &encoding="UTF-8")
int NumberOfLines() const
void InsertText(const String &text)
bool IsDynamicWordWrapMode() const
bool LoadUTF8(const String &filePath)
void SetSelection(const Rect &r)
IsoString EncodedText(const IsoString &encoding="UTF-8") const
void SetLineSelectionMode(bool lineMode=true)
void SetInsertMode(bool insert=true)
bool LoadISO88591(const String &filePath)
bool SaveUTF8(const String &filePath)
int HighlightAllMatches(const String &toFind, FindModes mode)
int ReplaceAll(const String &toFind, const String &replaceWith, FindModes mode)
bool HasSelection() const
bool Find(const String &toFind, FindModes mode)
Point CursorPosition() const
Control & LineNumbersControl()
bool IsInsertMode() const
void SetFilePath(const String &path)
void SetCursorPosition(int line, int column)
bool Save(const String &filePath, const IsoString &encoding="UTF-8")
void SetSelection(int fromLine, int fromCol, int toLine, int toCol)
void SetBlockSelectionMode(bool blockMode=true)
void SetEncodedText(const IsoString &text, const IsoString &encoding="UTF-8")
int NumberOfCharacters() const
IsoString TextUTF8() const
bool ReplaceSelection(const String &replaceWith)
bool IsBlockSelectionMode() const
String SelectedText() const
IsoString TextISO88591() const
bool GotoMatchedParenthesis()
void SetCursorPosition(const Point &pos)
void SetText(const String &text)
void SetReplaceMode(bool replace=true)
CodeEditor(Control &parent=Control::Null())
bool SaveISO88591(const String &filePath)
Client-side interface to a PixInsight Control object.
A type-safe collection of enumerated flags.
A generic point in the two-dimensional space.
component x
Abscissa (horizontal, or X-axis coordinate).
component y
Ordinate (vertical, or Y-axis coordinate).
A generic rectangle in the two-dimensional space.
component x1
Horizontal coordinate of the lower right corner.
component y1
Vertical coordinate of the lower right corner.
component y0
Vertical coordinate of the upper left corner.
component x0
Horizontal coordinate of the upper left corner.
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
void(Control::*)(CodeEditor &sender, int fromLine, int fromCol, int toLine, int toCol) selection_event_handler
void OnDynamicWordWrapModeUpdated(state_event_handler handler, Control &receiver)
void OnSelectionModeUpdated(state_event_handler handler, Control &receiver)
void(Control::*)(CodeEditor &sender, int line, int col) cursor_event_handler
void OnCursorPositionUpdated(cursor_event_handler handler, Control &receiver)
void(Control::*)(CodeEditor &sender, bool state) state_event_handler
void OnOverwriteModeUpdated(state_event_handler handler, Control &receiver)
void(Control::*)(CodeEditor &sender) editor_event_handler
void OnTextUpdated(editor_event_handler handler, Control &receiver)
void OnSelectionUpdated(selection_event_handler handler, Control &receiver)