/********************************************************************************
* *
* M u l t i - L i n e T e x t W i d g e t *
* *
*********************************************************************************
* Copyright (C) 1998,2024 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see *
********************************************************************************/
#ifndef FXTEXT_H
#define FXTEXT_H
#ifndef FXSCROLLAREA_H
#include "FXScrollArea.h"
#endif
namespace FX {
/// Text widget options
enum {
TEXT_READONLY = 0x00100000, /// Text is NOT editable
TEXT_WORDWRAP = 0x00200000, /// Wrap at word breaks
TEXT_OVERSTRIKE = 0x00400000, /// Overstrike mode
TEXT_FIXEDWRAP = 0x00800000, /// Fixed wrap columns
TEXT_NO_TABS = 0x01000000, /// Insert spaces for tabs
TEXT_AUTOINDENT = 0x02000000, /// Autoindent
TEXT_SHOWACTIVE = 0x04000000, /// Show active line
TEXT_SHOWMATCH = 0x08000000, /// Show matching brace
};
/// Highlight style entry
struct FXHiliteStyle {
FXColor normalForeColor; /// Normal text foreground color
FXColor normalBackColor; /// Normal text background color
FXColor selectForeColor; /// Selected text foreground color
FXColor selectBackColor; /// Selected text background color
FXColor hiliteForeColor; /// Highlight text foreground color
FXColor hiliteBackColor; /// Highlight text background color
FXColor activeBackColor; /// Active text background color
FXuint style; /// Highlight text style
};
/**
* Text mutation callback data passed with the SEL_INSERTED,
* SEL_REPLACED, and SEL_DELETED messages; both old and new
* text is available on behalf of the undo system as well as
* syntax highlighting.
*/
struct FXTextChange {
FXint pos; /// Position in buffer
FXint ndel; /// Number characters deleted at position
FXint nins; /// Number characters inserted at position
const FXchar *del; /// Text deleted at position
const FXchar *ins; /// Text inserted at position
};
/**
* Text selection data.
* A range-selection is in effect when startpos