Code: Select all
/*
switches circularly between lower case-UPPER CASE-Name Case (like in MS Word)
*/
var s = Document.SelText;
if (s != "") {
var ss = Document.SelStart;
var sl = Document.SelLength;
if (s == Lowercase(s)) {
Document.InsertText(Uppercase(s));
} else if (s == Uppercase(s)) {
Document.InsertText(Namecase(s));
} else {
Document.InsertText(Lowercase(s));
}
if (Document.IsColumnModeActive() != true) {
Document.SelStart = ss;
Document.SelLength = sl;
}
} else {
ShowMessage("Select some text first!");
}
Rickard,
would it be possible that SelLength work on Column Mode, too? I mean that it would bring back selection as it was before deselecting. Otherwise I think one would have to use SetSelection(), but how to get all four coordinates? Perhaps you could add a new function GetSelection(), that would return, umm, an array with the four coordinates?