supertext(3)
NAME
Tk::Text::SuperText - An improved text widget for perl/tk
SYNOPSIS
$super_text = $paren->SuperText(?options?);
STANDARD OPTIONS
-background -highlightbackground -inserton time -selectborderwidth -borderwidth -highlight color -insertwidth -selectforeground -cur sor -highlightthickness -padx -setgrid -exportselec tion -insertbackground -pady -takefocus -font -insertborderwidth -relief -xscrollcommand -foreground -insertofftime -selectback ground -yscrollcommand -ansicolor
See Tk::options for details of the standard options.
-height -spacing1 -spacing2 -spacing3 -state -tabs -width -wrap
See Tk::Text for details of theis options.
WIDGET-SPECIFIC OPTIONS
- Name: indentMode
Class: IndentMode
Switch: -indentmode - Specifies how to indent when a new line is inserted in
the text. The possible modes are none for no indent
at all or auto for positioning the insertion cursor
right below the first non-white space character of the
previous line. - Name: undoDepth
Class: UndoDepth
Switch: -undodepth - Sets the maximum depth for the undo buffer:a number
specifies the numbers of insert or delete operations
that can be stored in the buffer before the oldest one
is poped out and forgotten;0 stops the undo fea
ture,undef sets unlimited depth. - Name: redoDepth
Class: RedoDepth
Switch: -redodepth - Sets the maximum depth for the redo buffer:a number
specifies the numbers of undo operations that can be
stored in the buffer before the oldest one is poped
out and forgotten;0 stops the redo feature,undef sets
unlimited depth. - Name: showMatching
Class: ShowMatching
Switch: -showmatching - With a value of 1 activates the matching parentheses
feature.0 deactivates it. - Name: matchHighlightTime
Class: MatchHighlightTime
Switch: -matchhighlighttime - Sets the number of milliseconds the match highlight
stays visible; with a value of 0 the highlight stays
on till next match. - Name: matchForeground
Class: MatchForeground
Switch: -matchforeground - Set the foreground color for the char hilighted by the
match-parentheses command. - Name: matchBackground
Class: MatchBackground
Switch: -matchbackground - Set the background color for the char hilighted by the
match-parentheses command. - Name: matchingCouples
Class: MatchingCouples
Switch: -matchingcouples - Sets the chars that are searched for a matching coun
terpart. The format is a simple string with matching
chars coupled in left-right order; here's an example:
{}[]()"" . For double couples ("") the match is done only on the forwarding chars. - Name: insertMode
Class: InsertMode
Switch: -insertmode - Sets the default insert mode: insert or overwrite .
- Name: ansiColor
Class: AnsiColor
Switch: -ansicolor - Enables or disables use of Tk-TextANSIColor module (by
Tim Jenness <t.jenness@jach.hawaii.edu>). This option
was implemented by Jim Turner <turnerjw2@netscape.net>
(THANKS for the support!)
DESCRIPTION
Tk::Text::SuperText implements many new features over the
standard Tk::Text widget while supporting all it's stan
dard features.Its used simply as the Tk::Text widget. New
Features:
- · Unlimited undo/redo.
- So you can undo and redo whatever you deleted/inserted
whenever you want. To reset the undo and redo buffers
call this method: $w->resetUndo; - · Rectangular selections.
- Rectangular text zones can be
selected,copied,deleted,shifted with the mouse or with
the keyboard. - · Selection right/left char and tab shift.
- Text selections can be shifted left/right of one or
more chars or a tabs. - · Normal and 'inline' selection paste.
- The 'normal' paste is the normal text paste you know :
- Paste Buffer:
line xline y
- Text Buffer:
line 1line2
- Normal paste at line 1:
line xline yline 1line 2
- The 'inline' paste work as this:
Inline paste at line 1:line x line 1line y line 2 - · Parentheses matching.
- To help you inspect nested parentheses,brackets and
other characters,SuperText has both an automatic parenthesis matching mode,and a find matching command.
Automatic parenthesis matching is activated when you
type or when you move the insertion cursor after a
parenthesis.It momentarily highlightsthe matching
character if that character is visible in the win
dow.To find a matching character anywhere in the
file,position the cursor after the it,and call the
find matching command. - · Autoindenting.
- When you press the Return or Enter key,spaces and tabs
are inserted to line up the insert point under the
start of the previous line. - · Control codes insertion.
- You can directly insert a non printable control char
acter in the text. - · Commands are managed via virtual events.
- Every SuperText command is binded to a virtual
event,so to call it or to bind it to a key sequence
use the Tk::event functions. I used this format for
key bind so there's no direct key-to-command bind,and
this give me more flexibility;however you can use nor
mal binds. - Example: $w->eventAdd('Tk::Text::SuperText','<<Selec_ tAll>>','<Control-a>');
- To set default events bindigs use this methos:
$w->bindDefault; - · Default key bindings are redefined (not really a feature
:). - Every virtual event has an associated public method
with the same name of the event but with the firts
char in lower case (eg: <<MouseSelect>> event has a corresponding $super_text->mouseSelect method). - Virtual Event/Command Default Key Binding
- MouseSetInsert <Button1> MouseSe
lect <B1-Motion> MouseSelect
Word <Double-1> MouseSelect
Line <Triple-1>
MouseSelectAdd <Shift-1> MouseSelectAd dWord <Double-Shift-1> MouseSelectAd dLine <Triple-Shift-1> MouseSelectAu toScan <B1-Leave> MouseSelectAu toScanStop <B1-Enter>,<ButtonRelease-1> MouseMoveIn sert <Alt-1> MouseRectSelection <Con trol-B1-Motion> MouseMovePageTo <2> Mouse MovePage <B2-Motion> MousePasteSelec tion <ButtonRelease-2> - MoveLeft <Left>
SelectLeft <Shift-Left> Selec tRectLeft <Shift-Alt-Left> MoveLeft Word <Control-Left> SelectLeft Word <Shift-Control-Left> MoveRight <Right> Selec tRight <Shift-Right> SelectRec tRight <Shift-Alt-Right> MoveRight Word <Control-Right> SelectRight Word <Shift-Control-Right> MoveUp <Up>
SelectUp <Shift-Up> Selec tRectUp <Shift-Alt-Up> MoveUpPara graph <Control-Up> SelectUpPara graph <Shift-Control-Up> Move Down <Down> Select Down <Shift-Down> SelectRect Down <Shift-Alt-Down> MoveDownPara graph <Control-Down> SelectDownPara graph <Shift-Control-Down> MoveLineS tart <Home> SelectToLineS tart <Shift-Home>
MoveTextStart <Control-Home> SelectTo TextStart <Shift-Control-Home> MoveLi neEnd <End> SelectToLi neEnd <Shift-End> MoveTex tEnd <Control-End> SelectToTex tEnd <Shift-Control-End> MovePageUp <Prior> Select ToPageUp <Shift-Prior> MovePageLeft <Control-Prior> MovePage Down <Next> SelectToPage Down <Shift-Next>
MovePageRight <Control-Next> SetSelection Mark <Control-space>,<Select> Select ToMark <Shift-Control-space>,<ShiftSelect> - SelectAll <Control-a> Selection ShiftLeft <Control-comma> SelectionShiftLeft Tab <Control-Alt-comma> Selection ShiftRight <Control-period> SelectionShiftRight Tab <Control-Alt-period>
- Ins <Insert>
Enter <Return> AutoIndentEn ter <Control-Return> NoAutoindentEn ter <Shift-Return>
Del <Delete>
BackSpace <BackSpace> DeleteToWord Start <Shift-BackSpace> DeleteToWor dEnd <Shift-Delete> DeleteToLineS tart <Alt-BackSpace> DeleteToLi neEnd <Alt-Delete> Delete Word <Control-BackSpace> Delete Line <Control-Delete> - InsertControlCode <Control-Escape>
- FocusNext <Control-Tab> Focus Prev <Shift-Control-Tab>
- FlashMatchingChar <Control-b> Remove Match <Control-B> FindMatch ingChar <Control-j> JumpToMatch ingChar <Control-J>
- Escape <Escape>
- Tab <Tab>
- LeftTab <Shift-Tab>
- Copy <Control-c>
- Cut <Control-x>
- Paste <Control-v>
- InlinePaste <Control-V>
- Undo <Control-z>
- Redo <Control-Z>
- Destroy <Destroy>
- MenuSelect <Alt-KeyPress>
- · Public methods.
- $widget->mouseSetInsert
- $widget->museSelect
- $widget->mouseSelectWord
- $widget->mouseSelectLine
- $widget->mouseSelectAdd
- $widget->mouseSelectAddWord
- $widget->mouseSelectAddLine
- $widget->mouseSelectAutoScan
- $widget->mouseSelectAutoScanStop
- $widget->mouseMoveInsert
- $widget->mouseRectSelection
- $widget->mouseMovePageTo
- $widget->mouseMovePage
- $widget->mousePasteSelection
- $widget->moveLeft
- $widget->selectLeft
- $widget->selectRectLeft
- $widget->moveLeftWord
- $widget->selectLeftWord
- $widget->moveRight
- $widget->selectRight
- $widget->selectRectRight
- $widget->moveRightWord
- $widget->selectRightWord
- $widget->moveUp
- $widget->selectUp
- $widget->selectRectUp
- $widget->moveUpParagraph
- $widget->selectUpParagraph
- $widget->moveDown
- $widget->selectDown
- $widget->selectRectDown
- $widget->moveDownParagraph
- $widget->selectDownParagraph
- $widget->moveLineStart
- $widget->selectToLineStart
- $widget->moveTextStart
- $widget->selectToTextStart
- $widget->moveLineEnd
- $widget->selectToLineEnd
- $widget->moveTextEnd
- $widget->selectToTextEnd
- $widget->movePageUp
- $widget->selectToPageUp
- $widget->movePageLeft
- $widget->movePageDown
- $widget->selectToPageDown
- $widget->movePageRight
- $widget->setSelectionMark
- $widget->selectToMark
- $widget->selectAll
- $widget->selectionShiftLeft
- $widget->selectionShiftLeftTab
- $widget->selectionShiftRight
- $widget->selectionShiftRightTab
- $widget->ins
- $widget->enter
- $widget->autoIndentEnter
- $widget-> noAutoindentEnter
- $widget->del
- $widget->backSpace
- $widget->deleteToWordStart
- $widget->deleteToWordEnd
- $widget->deleteToLineStart
- $widget->deleteToLineEnd
- $widget->deleteWord
- $widget->deleteLine
- $widget->insertControlCode
- $widget->focusNext
- $widget->focusPrev
- $widget->flashMatchingChar
- $widget->removeMatch
- $widget->findMatchingChar
- $widget->jumpToMatchingChar
- $widget->escape
- $widget->tab
- $widget->leftTab
- $widget->copy
- $widget->cut
- $widget->paste
- $widget->inlinePaste
- $widget->undo
- $widget->redo
- $widget->destroy
- $widget->menuSelect
AUTHOR
Alessandro Iob <alexiob@dlevel.com>.
SEE ALSO
Tk::Text Tk::ROText Tk::TextUndo
KEYWORDS
- text, widget