IUP

 view release on metacpan or  search on metacpan

lib/IUP/Scintilla.pod  view on Meta::CPAN

=for comment based on iup-3.11 - http://www.tecgraf.puc-rio.br/iup/en/ctrl/iup_scintilla.html

=head1 NAME

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

=head1 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 L<http://www.scintilla.org|http://www.scintilla.org>.

L<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.

=head1 USAGE

=head2 CREATION - new() method

 $fill = IUP::Scintilla->new( EXPAND=>'YES' );
 
B<Returns:> the identifier of the created element, or C<undef> if an error occurs.

NOTE: You can pass to C<new()> other C<ATTRIBUTE=E<gt>'value'> or C<CALLBACKNAME=E<gt>\&func> pairs relevant
to this element - see L<IUP::Manual::02_Elements|IUP::Manual::02_Elements/"new()">.

=head2 ATTRIBUTES

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

=head3 General

=over

=item * B<BORDER> (creation only)

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

=item * B<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.

=item * B<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.

=item * B<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).

=item * B<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.

=item * B<KEYSUNICODE> [Windows Only] (non inheritable)

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

=item * B<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.

=item * B<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.

=item * B<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 L<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.

=item * L<SIZE|IUP::Manual::03_Attributes/SIZE> (non inheritable)

Since the contents
can be changed by the user, the B<Natural> B<Size> is not affected by
the text contents. In IUP 2.x the B<Natural> B<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 B<Natural Size>.

=item * B<USEPOPUP> (non inheritable)

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

=item * B<VISIBLECOLUMNS>

Defines the number of visible columns for the
B<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.

lib/IUP/Scintilla.pod  view on Meta::CPAN


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.

=back

=head3 Zooming

=over

=item * B<ZOOMIN> (non inheritable, write only)

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

=item * B<ZOOMOUT> (non inheritable, write only)

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

=item * B<ZOOM> (non inheritable)

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

=back

The following L<common attributes|IUP::Manual::03_Attributes/Common Attributes> are also accepted:

=over

=item * L<ACTIVE|IUP::Manual::03_Attributes/ACTIVE>,
L<EXPAND|IUP::Manual::03_Attributes/EXPAND>,
L<SCREENPOSITION|IUP::Manual::03_Attributes/SCREENPOSITION>,
L<POSITION|IUP::Manual::03_Attributes/POSITION>,
L<MINSIZE|IUP::Manual::03_Attributes/MINSIZE>,
L<MAXSIZE|IUP::Manual::03_Attributes/MAXSIZE>, L<WID|IUP::Manual::03_Attributes/WID>,
L<TIP|IUP::Manual::03_Attributes/TIP>,
L<RASTERSIZE|IUP::Manual::03_Attributes/RASTERSIZE>,
L<ZORDER|IUP::Manual::03_Attributes/ZORDER>,
L<VISIBLE|IUP::Manual::03_Attributes/VISIBLE>

=item * Drag E<amp> Drop attributes are supported.

=back

=head2 CALLBACKS

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

=over

=item * L<ACTION|IUP::Manual::04_Callbacks/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]

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

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

B<$pos> - 0 based character position when change started.

B<$length> - size of the change.

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

=item * B<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 B<
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]

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

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

B<$text> - the text of the selection.

=item * B<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]

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

=item * B<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]

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

=item * L<BUTTON_CB|../call/iup_button_cb.html>

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

=item * L<IUP::ConvertXYToPos|IUP::ConvertXYToPos> to convert (x,y)
coordinates in character positioning.

=item * B<CARET_CB>

Action generated when the caret/cursor position is
changed.



( run in 0.764 second using v1.01-cache-2.11-cpan-2398b32b56e )