NAME

IUP::Scintilla - [GUI element] multiline source code text editor (based on Scintilla library)

DESCRIPTION

Creates a multiline source code text editor that uses the Scintilla library.

Scintilla is a free library that provides text-editing functions, with an emphasis on advanced features for source code editing. It is available on http://www.scintilla.org.

IUP::Scintilla includes the Scintilla 3.4.4 source code, so no external references are needed.

Supported in Windows and in the systems the GTK driver is supported.

USAGE

CREATION - new() method

$fill = IUP::Scintilla->new( EXPAND=>'YES' );

Returns: the identifier of the created element, or undef if an error occurs.

NOTE: You can pass to new() other ATTRIBUTE=>'value' or CALLBACKNAME=>\&func pairs relevant to this element - see IUP::Manual::02_Elements.

ATTRIBUTES

For more info about concept of attributes (setting/getting values etc.) see IUP::Manual::03_Attributes. Attributes specific to this element:

General

  • BORDER (creation only)

    Shows a border around the text. Default: "YES".

  • CANFOCUS (creation only) (non inheritable)

    enables the focus traversal of the control. In Windows the control will still get the focus when clicked. Default: YES.

  • CLIPBOARD (non inheritable)

    clear, cut, copy or paste the selection to or from the clipboard. Values: "CLEAR", "CUT", "COPY", "PASTE". Returns Yes or No, if data can be pasted from the clipboard.

  • CURSOR (non inheritable)

    defines the cursor type. Can be: "NORMAL" or "WAIT" (displays a wait cursor when the mouse is over or owned by the control).

  • DROPFILESTARGET [Windows and GTK Only] (non inheritable)

    Enable or disable the drop of files. Default: NO, but if DROPFILES_CB is defined when the element is mapped then it will be automatically enabled.

  • KEYSUNICODE [Windows Only] (non inheritable)

    allow processing of Unicode typed characters. Default: NO. (since 3.9)

  • OVERWRITE (non inheritable)

    turns the overwrite mode ON or OFF. When enabled, each typed character replaces the character to the right of the text caret. When disabled, characters are inserted at the caret.

  • READONLY (non inheritable)

    Allows the user only to read the contents, without changing it. Restricts the insertion using keyboard input and attributes. Navigation keys are still available. Possible values: "YES" and "NO". Default: NO.

  • SAVEDSTATE (non inheritable)

    sets the current state of the document to saved (given value is ignored), returns Yes or No if the document has been modified. After setting the SAVEDSTATE, when editing is done the SAVEPOINT_CB callback is called with status=0. When undo is performed back to the point were the saved state was set the callback is called again with status=1.

  • SIZE (non inheritable)

    Since the contents can be changed by the user, the Natural Size is not affected by the text contents. In IUP 2.x the Natural Size was defined by the number of lines in the text and the with of the largest line. For IUP 3, use VISIBLECOLUMNS and VISIBLELINES to control the Natural Size.

  • USEPOPUP (non inheritable)

    allows to disable the default editing menu shown when the user clicks with the right button. Default: Yes.

  • VISIBLECOLUMNS

    Defines the number of visible columns for the Natural Size, this means that will act also as minimum number of visible columns. It uses a wider character size then the one used for the SIZE attribute so strings will fit better without the need of extra columns. As for SIZE you can set to NULL after map to use it as an initial value.

    Default: 50.

  • VISIBLELINES

    Defines the number of visible lines for the Natural Size, this means that will act also as minimum number of visible lines. As for SIZE you can set to NULL after map to use it as an initial value.

    Default: 10.

  • VISIBLELINESCOUNT (non inheritable, read-only)

    returns the number of actual visible lines.

  • WORDWRAP (non inheritable)

    If enabled will force a word wrap of lines that are greater than the with of the control, and the horizontal scrollbar will be removed. Default: NO.

  • WORDWRAPVISUALFLAGS (non inheritable)

    enable the drawing of visual flags to indicate a line is wrapped. Can be: MARGIN (at the line number margin), START (start of wrapped line), END (end of wrapped line) or NONE. Default: NONE.

Text Retrieval and Modification

  • APPEND (non inheritable, write-only)

    Inserts a text at the end of the current text. If APPENDNEWLINE=YES, a "\n" character will be automatically inserted before the appended text if the current text is not empty (APPENDNEWLINE default is YES).

  • CHAR(id) (non inheritable, read-only)

    returns the character at a given position, considering the "id" as the position.

  • CLEARALL (non inheritable, write-only)

    deletes all the text (unless the document is read-only).

  • COUNT (non inheritable, read-only)

    returns the number of characters in the text.

  • DELETERANGE (non inheritable, write-only)

    Deletes a range of text in the document. It uses a string format "pos,len" in order to indicate the start position and text length to delete.

  • INSERT(id) (non inheritable, write-only)

    Inserts a text string at position "id" or at the current position if pos is -1 or omitted. If the current position is after the insertion point then it is moved along with its surrounding text but no scrolling is performed.

  • LINE(id) (non inheritable, read-only)

    returns the text of the line, considering the "id" as the line number. It does not include the "\n" character. Number lines starts at 0.

  • LINECOUNT (non inheritable, read-only)

    returns the number of lines in the text.

  • LINEVALUE (non inheritable, read-only)

    returns the text of the line where the caret is. It does not include the "\n" character.

  • PREPEND (non inheritable, write-only)

    Inserts a text at the =item * begin of the current text. If APPENDNEWLINE=YES, a "\n" character will be automatically inserted after the prepended text if the current text is not empty (APPENDNEWLINE default is YES).

  • VALUE (non inheritable)

    Text entered by the user. The "\n" character indicates a new line. After the element is mapped and if there is no text will return the empty string "". This replaces all the text in the document with the zero terminated text string you pass in.

Annotation

  • ANNOTATIONTEXT(id) (non inheritable)

    defines and returns an annotation displayed underneath a specific line, considering the "id" as the line number. An annotation may consist of multiple lines separated by '\n'.

  • ANNOTATIONSTYLE(id) (non inheritable)

    sets and gets a particular style to the annotation, considering the "id" as the line number.

  • ANNOTATIONSTYLEOFFSET (non inheritable)

    sets and gets a style offset, in order to separate standard text styles from annotation styles.

  • ANNOTATIONVISIBLE (non inheritable)

    enable or disable annotations. Can be "HIDDEN" (not displayed), "STANDARD" (displayed) or "BOXED" (displayed and surrounded by a box). Default HIDDEN.

  • ANNOTATIONCLEARALL (non inheritable, write-only)

    deletes all annotations.

Auto-Completion (since 3.10)

  • AUTOCSHOW(id) (non inheritable, write only)

    causes a list of words to be displayed. The words are separated by a space. "id" defines the number of characters of the word already entered by user.

  • AUTOCCANCEL (non inheritable, write only)

    cancels any displayed auto-completion list. When in auto-completion mode, the list should disappear when the user types a character that can not be part of the auto-completion.

  • AUTOCACTIVE (non inheritable, read only)

    returns YES if there is an active auto-completion list and NO if there is not.

  • AUTOCPOSSTART (non inheritable, read only)

    returns the current position when the list of words started to be shown.

  • AUTOCCOMPLETE (non inheritable, write only)

    triggers auto-completion. This has the same effect as the tab key.

  • AUTOCSELECT (non inheritable, write only)

    selects an item in the auto-completion list. It searches in the list of words for the first that matches of value (comparisons are case sensitive). If the item is not found, no item is selected.

  • AUTOCSELECTEDINDEX (non inheritable, read only)

    retrieves the current selection index, set by AUTOCSELECT attribute.

  • AUTOCDROPRESTOFWORD (non inheritable)

    when an item is selected, any word characters following the caret are first erased if this attribute is set YES. The default is NO.

  • AUTOCMAXHEIGHT (non inheritable)

    sets and gets the maximum number of rows that will be visible in an auto-completion list. If there are more rows in the list, then a vertical scrollbar is shown. The default is 5.

  • AUTOCMAXWIDTH (non inheritable)

    the maximum width of an auto-completion list expressed as the number of characters in the longest item that will be totally visible. The default is 0 (in this case, the list width is calculated to fit the item with the most characters).

Brace Highlighting

  • BRACEHIGHLIGHT (non inheritable, write only)

    highlights the brace, defined by its initial and final positions (format: "pos1:pos2"). Up to two characters can be highlighted in a 'brace highlighting style', which is defined as style number (See Style Definition, id = 34).

  • BRACEBADLIGHT (non inheritable, write only)

    highlights the non matching brace, based on a position. If there is no matching brace then the brace badlighting style (See Style Definition, id = 35) can be used to show the brace that is unmatched. Set -1 as position removes the highlight.

  • BRACEMATCH(id) (non inheritable, read only)

    finds a corresponding matching brace given id, the position of one brace. The brace characters handled are '(', ')', '[', ']', '{', '}', '<', and '>'. If the character at position is not a brace character, or a matching brace cannot be found, the return value is -1.

Caret and Selection

  • CARET (non inheritable)

    Position of the insertion point. The first position, lin or col, is "0". It uses a string format "lin,col" in order to indicate the caret position, where lin and col must be integer numbers.

    When lin is greater than the number of lines, the caret is placed at the last line. When col is greater than the number of characters in the given line, the caret is placed after the last character of the line.

    If the caret is not visible the text is scrolled to make it visible.

  • CARETPOS (non inheritable)

    Position of the insertion point using a zero based character unique index "pos". Useful for indexing the VALUE string. This removes any selection, sets the caret at pos and scrolls the view to make the caret visible, if necessary.

  • CARETTOVIEW (non inheritable, write only)

    Moves the caret to the nearest visible line. Any selection is lost.

  • SELECTEDTEXT (non inheritable)

    Selection text. Returns NULL if there is no selection. When changed replaces the current selection. Similar to INSERT, but does nothing if there is no selection.

  • SELECTION (non inheritable)

    Selection interval. Returns NULL if there is no selection. The first position, lin or col, is "0". The accepted format is represented by the string "lin1,col1:lin2,col2", where lin1, col1, lin2 and =item * col2 are integer numbers corresponding to the selection's interval. col2 correspond to the character after the last selected character. The values ALL and NONE are also accepted.

    SELECTIONPOS (non inheritable)

    Same as SELECTION but using a zero based character index "pos1:pos2". Useful for indexing the VALUE string. The values ALL and NONE are also accepted.

Folding

  • FOLDFLAGS (non inheritable, write-only)

    determines how folding lines are drawn. Can be: "LEVELNUMBERS", "LINEBEFORE_EXPANDED", "LINEBEFORE_CONTRACTED", "LINEAFTER_EXPANDED" or "LINEAFTER_CONTRACTED " (default).

  • FOLDLEVEL(id) (non inheritable)

    sets and gets the fold level of a "id" line. Can be: "WHITEFLAG", "HEADERFLAG", "NUMBERMASK" or "BASE" (default). If you use a Lexer, it is not recommend to set the fold level (this is far better handled by the Lexer). By contrast, get fold level is useful to decide how to handle user folding requests.

  • FOLDTOGGLE (non inheritable, write-only)

    Determines if the fold point (line number) may be either expanded, displaying all its child lines, or contracted, hiding all the child lines.

Lexer

  • KEYWORD(id) (non inheritable, write-only)

    keyword list used by the current Lexer. Until 9 lists of keywords can set up using id from 0 to 8. The value is a list of keywords separated by spaces, tabs, "\n" or "\r" or any combination of these.

  • KEYWORDSETS (non inheritable, read only)

    returns a description of all of the keyword sets separated by "\n".

  • LEXERLANGUAGE (non inheritable)

    associate the Lexer language name. It is case sensitive. Default: not defined. Set to NULL to clear the association. Can be: any name supported by Scintilla. For instance: asm, bash, freebasic, cmake, COBOL, cpp (C++), css, d, diff, eiffel, fortran, hypertext (HTML), xml, lisp, lua (Lua), makefile, matlab, mysql, nsis, pascal, perl, python, ruby, smalltalk, sql, tcl, tex, vb (Visual Basic), and many others.

  • LOADLEXERLIBRARY (non inheritable, write-only)

    Load a Lexer implemented in a dynamic library given the library file name. This is a .so file on GTK+/Linux or a .DLL file on Windows. (since 3.11)

  • PROPERTY (non inheritable)

    sets and gets Lexer properties using "name=value" string pairs, where name is case sensitive and value is the associated string. There is no limit to the number of keyword pairs you can set, other than available memory. To retrieve a property first set the PROPERTYNAME attribute, the PROPERTY attribute will return its value.

  • PROPERTYNAMES (non inheritable, read only)

    returns a list of property names separated by "\n". If the Lexer does not support this information then an empty string is returned.

Margins

  • MARGINMASKFOLDERS(id) (non inheritable)

    defines if a margin is folding or non-folding. Can be: Yes or No.

  • MARGINSENSITIVE(id) (non inheritable)

    determines if a margin is sensitive or not. Margins that are not sensitive act as selection margins which make it easy to select ranges of lines. By default, all margins are insensitive. Can be: YES or NO.

  • MARGINTYPE(id) (non inheritable)

    set and get the type of a margin. The margin argument should be 0, 1, 2, 3 or 4. Each margin can be set to display only symbols, line numbers, or text. You can use the predefined values "SYMBOL", "NUMBER", "TEXT", "RTEXT" (right justify text), "BACKGROUND" or "FOREGROUND" (the latter two used for symbol margins that set their background or foreground using the style default colors).

  • MARGINWIDTH(id) (non inheritable)

    width of a margin in pixels (Default value: 0). A margin with width=0 is invisible. The margins are numbered 0 to 4. By default, Scintilla margin 0 is set to display line numbers, margin 1 is set to display non-folding symbols, and margin 2 is set to display folding symbols. Margins 3 and 4 are free for user default. However, you can set the margins to be whatever you wish using MARGINTYPEid.

  • MARGINLEFT (non inheritable)

    size of the blank margin on the left side. Default: 1.

  • MARGINRIGHT (non inheritable)

    size of the blank margin on the right side. Default: 1.

  • MARGINTEXT(id) (non inheritable)

    controls the text of each line of a text margin. id is the line number.

  • MARGINTEXTSTYLE(id) (non inheritable)

    controls the style of the text of each line of a text margin. id is the line number.

  • MARGINTEXTCLEARALL (non inheritable, write-only)

    clear all text and styles of a text margin.

  • MARGINCURSOR(id) (non inheritable)

    set and get the arrow cursor normally shown over margins. Can be: "REVERSEARROW" (default) or "ARROW".

Markers

  • MARKERDEFINE (non inheritable, write-only)

    Defines a marker using its number and its symbol. Format: "number=symbol".

  • Marker numbers

    can be a number in the range 0 to 31, or the pre-defined names: "FOLDEREND", "FOLDEROPENMID", "FOLDERMIDTAIL", "FOLDERSUB", "FOLDER" and "FOLDEROPEN".

  • Marker symbols: (see MARKERSYMBOL).

  • MARKERSYMBOL(id) (non inheritable)

    Defines a marker symbol given its number. id can be from 0 to 31.

  • Marker symbols: "CIRCLE", "ROUNDRECT", "ARROW", "SMALLRECT", "SHORTARROW", "EMPTY", "ARROWDOWN", "MINUS", "PLUS", "VLINE", "LCORNER", "TCORNER", "BOXPLUS", "BOXPLUSCONNECTED", "BOXMINUS", "BOXMINUSCONNECTED", "LCORNERCURVE", "TCORNERCURVE", "CIRCLEPLUS", "CIRCLEPLUSCONNECTED", "CIRCLEMINUS", "CIRCLEMINUSCONNECTED", "BACKGROUND" (line background color), "DOTDOTDOT", "ARROWS", "FULLRECT" (margin background color), "LEFTRECT", "UNDERLINE" (underline across the line), "RGBAIMAGE" and "CHARACTER+c" (where c is an ASCii character code).

  • MARKERFGCOLOR(id) (non inheritable, write only)

    defines the foreground color of a marker number (id). Values in RGB format ("r g b").

  • MARKERBGCOLOR(id) (non inheritable, write only)

    defines the background color of a marker number (id). Values in RGB format ("r g b").

  • MARKERBGCOLORSEL(id) (non inheritable, write only)

    defines the highlight background colour of a marker number (id) when its folding block is selected. Values in RGB format ("r g b").

  • MARKERALPHA(id) (non inheritable, write only)

    defines the alpha value of a marker number (id). Markers may be drawn translucently when there are no margins.

  • MARKERRGBAIMAGE(id) (non inheritable, write only)

    defines the image name to be used on a marker number. Use =item * IUP::SetHandle or IUP::SetAttributeHandle to associate an image to a name. See also IUP::Image. It must be an image created with the IUP::ImageRGBA constructor, it can not be a image loaded from stock or resources.

    MARKERRGBAIMAGESCALE (non inheritable, write only)

    defines the image scale factor, in percent (1-100).

  • MARKERHIGHLIGHT (non inheritable)

    enable or disable the the highlight folding block when it is selected. (i.e. block that contains the caret). Can be Yes or No. Default: No.

  • MARKERADD(id) (non inheritable, write-only)

    adds marker number to a line (id). Internally, sets the marker handle number (LASTMARKERADDHANDLE attribute) that identifies the added marker (or -1 for invalid line and out of memory), which may be useful to find where a marker is after moving or combining lines removes markers of the given number from all lines. If marker number is -1, it deletes all markers from all lines.

  • MARKERDELETE(id) (non inheritable, write-only)

    deletes marker number given a line number (id). If marker number is -1, all markers are deleted from the line.

  • MARKERDELETEALL (non inheritable, write-only)

    removes markers of the given number from all lines. If marker number is -1, it deletes all markers from all lines.

  • MARKERGET(id) (non inheritable, read-only)

    returns a 32-bit integer that indicates which markers were present on the line (id). Bit 0 is set if marker 0 is present, bit 1 for marker 1 and so on.

  • MARKERNEXT(id) (non inheritable, write-only)

    searches a given marker number, starting at line number (id) and continuing forwards to the end of the file. Internally, sets the the line number of the first line that contains the marker (LASTMARKERFOUND attribute) or -1, if no marker is found.

  • MARKERPREVIOUS(id) (non inheritable, write-only)

    searches a given marker number, starting at line number (id) and continuing backwards to the start of the file. Internally, sets the the line number of the first line that contains the marker (LASTMARKERFOUND attribute) or -1, if no marker is found.

  • MARKERLINEFROMHANDLE(id) (non inheritable, read-only)

    searches the document for the marker given its handle returned in MARKERADDid (use the LASTMARKERADDHANDLE as attribute value) and returns the line number of the first line that contains the marker or -1, if no marker is found.

  • MARKERDELETEHANDLE (non inheritable, write-only)

    searches the document for the marker with this handle (use the LASTMARKERADDHANDLE as attribute value) and deletes the marker if it is found.

  • LASTMARKERADDHANDLE (non inheritable, read-only)

    returns the last marker handle set by the MARKERADDid attribute.

  • LASTMARKERFOUND (non inheritable, read-only)

    returns the last line number that contains a marker found by the MARKERNEXTid, MARKERPREVIOUSid or MARKERLINEFROMHANDLE attributes.

Scrolling

  • SCROLLBAR (creation only)

    Associates an automatic horizontal and/or vertical scrollbar. Can be: "VERTICAL", "HORIZONTAL", "YES" (both) or "NO" (none). Default: "YES". For all systems, when SCROLLBAR is NO, the natural size will always include its size even if the native system hides the scrollbar.

  • SCROLLTO (non inheritable, write only)

    Scroll the text to make the given position visible. It uses the same format and reference of the =item * CARET attribute ("lin,col" or "col" starting at 0).

    SCROLLTOCARET (non inheritable, write only)

    Scroll the text to make the caret position visible.

  • SCROLLTOPOS (non inheritable, write only)

    Scroll the text to make the given position visible. It uses the same format and reference of the CARETPOS attribute ("pos" starting at 0).

  • SCROLLWIDTH (non inheritable)

    controls the document width in pixels. Default: 2000.

Search and Replace (since 3.10)

  • SEARCHINTARGET (non inheritable, write only)

    This searches for the first occurrence of a text string in the target defined by TARGETSTART and TARGETEND. If the search succeeds, the target is set to the found text.

  • SEARCHFLAGS (non inheritable)

    sets and gets the search flags used in SEARCHINTARGET attribute. Possible values: MATCHCASE, WHOLEWORD, WORDSTART, REGEXP and POSIX. The flag options are combined using "|" as separators. Use NULL to reset all flags.

  • TARGETSTART (non inheritable)

    sets and gets the start of target. When searching in non-regular expression mode, you can set TARGETSTART greater than TARGETEND to find the last matching text in the target rather than the first matching text. If set 0, target start will be 1 (first position of text).

  • TARGETEND (non inheritable)

    sets and gets the end of target. If set 0, target end will be the last position of text.

  • TARGETFROMSELECTION (non inheritable, write only)

    set the target start and end from current position of the selection.

  • REPLACETARGET (non inheritable, write only)

    replaces the target text. After replacement, the target range refers to the replacement text.

Style Definition (See Style Definition)

  • BGCOLOR

    Background color of the text. Default: the global attribute TXTBGCOLOR. If changed it will affect the default style.

  • FGCOLOR

    Text color. Default: the global attribute TXTFGCOLOR. If changed it will affect the default style.

  • FONT

    the text font. Default: the global attribute DEFAULTFONT. If changed it will affect the default style.

  • STYLEBGCOLOR(id) (non inheritable)

    background color for a style (See Style Definition). Values in RGB format ("r g b").

  • STYLEBOLD(id) (non inheritable)

    the boldness of a font (See Style Definition).

  • STYLECASE(id) (non inheritable)

    determines how text is displayed (See Style Definition). Values: LOWERCASE, UPPERCASE or MIXED (default).

  • STYLECHARSET(id) (non inheritable)

    sets and gets a style to use a different character set than the default (See Style Definition). Can be ANSI (default), EASTEUROPE, RUSSIAN, GB2312, HANGUL or SHIFTJIS.

  • STYLECLEARALL(id) (non inheritable)

    sets all styles to have the same attributes as default global style (id = 32) (See Style Definition).

  • STYLEEOLFILLED(id) (non inheritable)

    If the last character in the line has a style with this attribute set, the remainder of the line up to the right edge of the window is filled with the background color set for the last character (See Style Definition). Can be YES (italic) or NO.

  • STYLEFGCOLOR(id) (non inheritable)

    foreground color for a style (See Style Definition). Values in RGB format ("r g b").

  • STYLEFONT(id) (non inheritable)

    sets and gets the font name (See =item * Style Definition). Scintilla caches fonts by their names, but the cache is case sensitive.

  • STYLEFONTSIZE(id) (non inheritable)

    sets and gets the font size (See Style Definition), using a integer number of points.

  • STYLEFONTSIZEFRAC(id) (non inheritable)

    sets and gets the font size (See Style Definition), using a fractional point size in hundredths of a point. For example, a text size of 9.4 points is set with value = 940.

  • STYLEHOTSPOT(id) (non inheritable)

    used to mark ranges of text that can detect mouse clicks (See Style Definition). The cursor changes to a hand over hotspots, and the foreground, and background colors may change and an underline appear to indicate that these areas are sensitive to clicking. This may be used to allow hyperlinks to other documents.

  • STYLEITALIC(id) (non inheritable)

    the italic style of a font (See =item * Style Definition). Can be YES (italic) or NO.

  • STYLERESET(id) (non inheritable, write-only)

    Resets to the initial Scintilla style default (See Style Definition).

  • STYLEUNDERLINE(id) (non inheritable)

    determines if the underline is drawn, using a foreground color (See Style Definition). Can be YES (underline) or NO.

  • STYLEVISIBLE(id) (non inheritable)

    determines if the text is visible (YES) or hidden (NO) (See Style Definition).

  • STYLEWEIGHT(id) (non inheritable)

    the weight of a font (See =item * Style Definition). Predefined values

    NORMAL, SEMIBOLD and BOLD. The weight can also be a number between 1 and 999 with 1 being very light and 999 very heavy.

Styling

  • CLEARDOCUMENTSTYLE (non inheritable, write-only)

    clear all styling information and reset the folding state.

  • STARTSTYLING (non inheritable, write only)

    prepares for styling by setting the styling position.

  • STYLING(id) (non inheritable, write only)

    sets the style of given length characters starting at the styling position and then increases the styling position by length. id is the style.

Tabs and Indentation Guides

  • TABSIZE (non inheritable)

    Controls the number of characters for a tab stop. Default: 8.

  • INDENTATIONGUIDES (non inheritable)

    dotted vertical lines that appear within indentation white space every indent size columns. Can be: NONE, REAL, LOOKFORWARD, LOOKBOTH. Default: NONE.

  • HIGHLIGHTGUIDE (non inheritable)

    Highlights the indentation guide of a given column. When brace highlighting occurs, the indentation guide corresponding to the braces may be highlighted with the brace highlighting style (See Style Definition, id = 34). Set column to 0 to cancel this highlight.

  • USETABS (non inheritable)

    Use tabs also for indentation or only spaces. Can be Yes or No. Default: Yes.

Undo and Redo

  • REDO (non inheritable)

    redo the last operation if set to Yes, clears the undo information otherwise. Returns Yes or No if redo can be performed.

  • UNDO (non inheritable)

    undo the last operation if set to Yes, clears the undo information otherwise. Returns Yes or No if undo can be performed.

  • UNDOCOLLECT (non inheritable)

    enable or disable the undo collect of information. Can be Yes or No. Default: Yes.

White Space

  • EXTRAASCENT (non inheritable)

    sets and gets the space to be added to the maximum ascent, in order to allow for more space between lines. Default: 0.

  • EXTRADESCENT (non inheritable)

    sets and gets the space to be added to the maximum descent, in order to allow for more space between lines. Default: 0.

  • WHITESPACEVIEW (non inheritable)

    sets and gets the white space display mode. The white spaces can be: "INVISIBLE" (shown as an empty background color), "VISIBLEALWAYS" (drawn as dots and arrows) or "VISIBLEAFTERINDENT" (white space used for indentation is displayed normally but after the first visible character, it is shown as dots and arrows). Default: INVISIBLE.

  • WHITESPACESIZE (non inheritable)

    sets and gets the size of the dots used for mark space characters. Default: 1.

  • WHITESPACEFGCOLOR (non inheritable, write only)

    defines the foreground color of visible white space. Values in RGB format ("r g b"). By default the color will be defined by the Lexer, but defining this attribute will overriding the Lexer definition. Set to NULL to reset the definition and use the Lexer again.

  • WHITESPACEBGCOLOR (non inheritable, write only)

    defines the background color of visible white space. Values in RGB format ("r g b"). By default the color will be defined by the Lexer, but defining this attribute will overriding the Lexer definition. Set to NULL to reset the definition and use the Lexer again.

Zooming

  • ZOOMIN (non inheritable, write only)

    increases the zoom factor by one point if the current zoom factor is less than 20 points.

  • ZOOMOUT (non inheritable, write only)

    decreases the zoom factor by one point if the current zoom factor is greater than -10 points.

  • ZOOM (non inheritable)

    sets and gets the zoom factor directly. Limits: -10 points to zoom out and 20 points to zoom in.

The following common attributes are also accepted:

CALLBACKS

For more info about concept of callbacks (setting callback handlers etc.) see IUP::Manual::04_Callbacks. Callbacks specific to this element:

  • ACTION

    Action generated when the text is edited, but before its value is actually changed. Can be generated when using the keyboard, undo/redo system or from the clipboard.

    XXXXXX-TODO: int function(Ihandle *ih, int insert, int pos, int length, char* text ); [in C]elem:action(insert: boolean, pos, length: number, text: string) -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

    $insert - =1 when text is inserted, =0 when text is deleted.

    $pos - 0 based character position when change started.

    $length - size of the change.

    $text - the inserted text value. It is NULL when insert=0.

  • AUTOCSELECTION_CB

    Action generated when the user has selected an item in an auto-completion list. It is sent before the selection is inserted. Automatic insertion can be cancelled by setting the AUTOCCANCEL attribute before returning from the callback. (since 3.10.1)

    XXX-TODO: int function(Ihandle *ih, int pos, char* text ); [in C]elem:autocselection_cb(pos: number, text: string) -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

    $pos - 0 based character start position of the word being completed.

    $text - the text of the selection.

  • AUTOCCANCELLED_CB

    Called after the user has cancelled an auto-completion list. (since 3.10.1)

    XXX-TODO: int function(Ihandle *ih); [in C]elem:autoccancelled_cb() -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

  • AUTOCCHARDELETED_CB

    Called after the user deleted a character while auto-completion list was active. (since 3.10.1)

    XXX-TODO: int function(Ihandle *ih); [in C]elem:autocchardeleted_cb() -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

  • BUTTON_CB

    Action generated when any mouse button is pressed or released. Use =back

  • IUP::ConvertXYToPos to convert (x,y) coordinates in character positioning.

  • CARET_CB

    Action generated when the caret/cursor position is changed.

    XXX-TODO: int function(Ihandle *ih, int lin, int col, int pos); [in C]elem - caret_cb(lin, col, pos: number) -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

    $lin, col - line and column number (start at 0).

    $pos - 0 based character position.

  • DROPFILES_CB

    Action generated when one or more files are dropped in the element.

  • HOTSPOTCLICK_CB

    Action generated when the user clicks or double clicks on text that is in a style with the hotspot attribute set.

    XXX-TODO: int function(Ihandle *ih, int pos, int lin, int col, char* status); [in C]elem:hotspotclick_cb(pos, lin, col: number, status: string) -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

    $pos - the character position in the document that corresponds to the hotspot click.

    $lin - line in the document that corresponds to the hotspot click.

    $col - column in the document that corresponds to the hotspot click.

    $status - status of mouse buttons and certain keyboard keys at the moment the event was generated. The same macros used for

  • BUTTON_CB can be used for this status.

  • MARGINCLICK_CB

    Action generated when the mouse button is clicked inside a margin that is marked as sensitive.

    XXX-TODO: int function(Ihandle *ih, int margin, int lin, char* status); [in C]elem - marginclick_cb(margin, lin: number, status: string) -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

    $margin - the margin number that was clicked.

    $lin - line in the document that corresponds to the margin click.

    $status - status of mouse buttons and certain keyboard keys at the moment the event was generated. The same macros used for

  • BUTTON_CB

  • MOTION_CB

    Action generated when the mouse is moved. Use ConvertXYToPos to convert (x,y) coordinates in character positioning.

  • SAVEPOINT_CB

    Notifies the application that a save point was reached (1) or left (0). Can be used to controls whether to display a saved or modified document. To set the save point use the SAVEDSTATE attribute.

    XXX-TODO: int function(Ihandle *ih, int status); [in C]elem savepoint_cb(status - number) -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.ih> - identifier of the element that activated the event.

    $status - can be 1 (reached) or 0 (left).

  • VALUECHANGED_CB

    Called after the value was interactively changed by the user.

    XXX-TODO: int function(Ihandle *ih); [in C]elem:valuechanged_cb() -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.

  • ZOOM_CB

    Notifies the application when the user zooms the display using the keyboard or the ZOOM attribute. Can be used to recalculate positions, such as the width of the line number margin to maintain sizes in terms of characters rather than pixels.

    XXX-TODO: int function(Ihandle *ih, int zoomInPoints); [in C]elem:zoom_cb(zoomInPoints: number) -> (ret: number) [in Lua]

    $ih - identifier of the element that activated the event.ih> - identifier of the element that activated the event.

    $ih - identifier of the element that activated the event.zoomInPoints> - the current zoom factor.

  • MAP_CB, UNMAP_CB, GETFOCUS_CB, KILLFOCUS_CB, ENTERWINDOW_CB, LEAVEWINDOW_CB, K_ANY, HELP_CB

  • "Drag & Drop" callbacks are supported. See Notes bellow.

Auxiliary Functions

IUP::Text auxiliary functions TextConvertLinColToPos and TextConvertPosToLinCol can be used.

Style Definition

Scintilla can automatically format the text using the Lexer or the application can manually format the text. In both cases only 256 different styles are available. Styles are numbered from 0 to 255, invalid IDs are simply ignored. When the id is not specified for an attributes the style 0 is assumed.

Each Lexer will use the available styles with its own rules, but several Lexers share many ids. Notice that language keywords and styles definitions are not pre-defined internally, the application must define them.

ID      Global styles
======  ==================================================================
32      This style defines the attributes that all styles receive
        when the STYLECLEARALL attribute is used.
33      This style sets the attributes of the text used to display
        line numbers in a line number margin.
34      This style sets the attributes used when highlighting braces
        with the BRACEHIGHLIGHT and HIGHLIGHTGUIDE attributes.
35      This style sets the attributes used when marking an unmatched
        brace with the BRACEBADLIGHT attribute.
36      This style sets the font used when drawing control characters.
37      This style sets the foreground and background colors used when
        drawing the indentation guides. Used when INDENTATIONGUIDES!=NONE.

Here are some known styles for C++ and Lua:

ID  C++ styles                                  Lua styles
==  ==========================================  ==============================================
0   Default style                               Default style
1   C comment                                   Lua comment
2   C++ comment line                            Lua comment line
3   JavaDoc/ Doxygen style C comment            JavaDoc/ Doxygen style Lua comment
4   Number                                      Number
5   Keyword                                     Keyword
6   String                                      String
7   Character                                   Character
8   IDL UUID                                    Literal string
9   Preprocessor block                          Preprocessor block
10  Operator                                    Operator
11  Identifier                                  Identifier
12  End of a line where a string is not closed  End of a line where a string is not closed
13  C# verbatim string                          Keyword set number 2
14  Regular expression                          Keyword set number 3
15  JavaDoc/Doxygen style C++ comment line      Keyword set number 4
16  Keyword set number 2                        Keyword set number 5
17  JavaDoc/Doxygen keyword                     Keyword set number 6
18  JavaDoc/Doxygen keyword error               Keyword set number 7
19  Global class or typedef defined in keyword  Keyword set number 8
20  C++ raw string                              Label
21  F# triple-quoted verbatim strings           -
22  Hash-quoted strings                         -
23  Preprocessor block comment                  -

Here is a list of the common keys for all drivers. Other keys are available depending on the driver.

Keys                    Action
======================  ======================
Arrows                  move by individual characters/lines
Ctrl+Arrows             move by words/paragraphs
Home/End                move to begin/end line
Ctrl+Home/End           move to begin/end text
PgUp/PgDn               move vertically by pages
Ctrl+PgUp/PgDn          move horizontally by pages
Shift+Arrows            select characters
Ctrl+A                  select all
Del                     delete the character at right
Backspace               delete the character at left
Ctrl+C                  copy
Ctrl+X                  cut
Ctrl+V                  paste

EXAMPLES

The element IUP::Scintilla is used in the following sample scripts:

SEE ALSO

The original doc: iup_scintilla.html