give TextEdit new abilities.

This commit is contained in:
Jim Saxton 2015-10-31 12:25:57 -07:00
parent a922aea5b7
commit 9ab5e3addd
4 changed files with 12 additions and 2 deletions

View File

@ -659,7 +659,8 @@ LineNumber = TEXTEDIT GET TextEdit$, Option$, Search$
LineNumber = Option$ = "Case-Sensitive-Find", Search$
LineNumber = TEXTEDIT GET TextEdit$, Option$
IsChanged = Option$ = "hasChanged"
LineNumber = Option$ = "countlines"
LineNumber = Option$ = "countlines" -- /n characters
LineNumber = Option$ = "countphysicallines" -- displayed lines
LineNumber = Option$ = "currentline"
YOffset = Option$ = "vertical-scrollbar"
XOffset = Option$ = "horizontal-scrollbar"
@ -673,6 +674,7 @@ TEXTEDIT SET TextEdit$, Option$, Value
Option$ = "wordwrap", true/false
Option$ = "editable", true/false
Option$ = "color-case-sensitive", true/false
Options = "Cursor", ofset
Option$ = "changed", true/false
Option$ = "gotoline", LineNumber
Option$ = "select", LineNumber

View File

@ -3796,7 +3796,11 @@ void YabInterface::TextSet(const char* title, const char* option, int value)
myText->SetCaseSensitive((bool)value);
else if(tmp.IFindFirst("tabwidth")!=B_ERROR)
myText->SetTabWidth(value);
else if(tmp.IFindFirst("curser")!=B_ERROR)
myText->Select(value, value);
else if(tmp.IFindFirst("textwidth")!=B_ERROR)
{
// BRect txtframe = myText->TextRect();
// txtframe.right = txtframe.left + value;
@ -4126,6 +4130,8 @@ int YabInterface::TextGet(const char* title, const char* option)
}
else if(tmp.IFindFirst("countlines")!=B_ERROR)
ret = myText->CountLines();
else if(tmp.IFindFirst("countphysicallines")!=B_ERROR)
ret=myText->CountPhysicalLines();
else if(tmp.IFindFirst("textlength")!=B_ERROR)
ret = myText->TextLength();
else if(tmp.IFindFirst("haschanged")!=B_ERROR)

Binary file not shown.

View File

@ -8361,7 +8361,8 @@ This is a hook function that is set once the user changes the text, reset it to
Then use this hook to see if the user has changed the text.
Option$ = "countlines" -- returns the number of lines
Option$ = "countlines" -- returns the number of lines ending in /n
Options = "countphysicallines" -- returns the number of displayed lines
Option$ = "currentline" -- returns the curent lLineNumber
Option$ = "vertical-scrollbar" -- returns the virtical ofset of the scrollbar
Option$ = "horizontal-scrollbar" -- returns the horizontal ofset of the scrollbar
@ -8440,6 +8441,7 @@ The textedit will notice when text was changed since the last time the option "c
Given three parameters, the following options are valid for the textedit named TextEdit$ when the third parameter Value is a number:
Option$ = "autocomplete-start" -- set the number of characters when auto-completion should kick in (default is 4)
Option$ = "Cursor" -- place the curser at the ofset of Value characters from the start.
Option$ = "gotoline" -- put the cursor to the line with number Value
Option$ = "select" -- select the line with number Value
Option$ = "tabwidth" -- set the tab width to Value (in pixel!), default is 28