mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-21 08:45:06 -05:00
Extensions: Removed mask on ScriptText and added function GetSelectedText.
This commit is contained in:
parent
d75f7d55cf
commit
5eff9e1c6f
@ -192,6 +192,7 @@ begin
|
||||
AddFunction(@ext_MessageDlg,'function MessageDlg(const aCaption, aMsg: string; DlgType: TMsgDlgType;Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;');
|
||||
AddFunction(@ext_InputQuery,'function InputQuery(const ACaption, APrompt : String; var Value : String) : Boolean;');
|
||||
AddFunction(@ext_ScriptText,'function ScriptText: string;');
|
||||
AddFunction(@ext_GetSelectedText, 'function GetSelectedText: string;');
|
||||
AddFunction(@ext_OpenScript,'procedure OpenScript(Name, Data: string; Run: boolean);');
|
||||
AddFunction(@ext_OpenScriptEx,'procedure OpenScriptEx(FileName: string; Run: boolean);');
|
||||
AddRegisteredPTRVariable('Settings','TMMLSettingsSandbox');
|
||||
|
@ -126,7 +126,23 @@ end;
|
||||
function ext_ScriptText: string;
|
||||
begin
|
||||
Result := SimbaForm.CurrScript.SynEdit.Lines.Text;
|
||||
Result := ReplaceRegExpr('([N|n][A|a][M|m][E|e]|[P|p][A|a][S|s]{2}|[P|p][I|i][N|n])\s*\:\=\s*\''.*?\'';', Result, '$1 := ''*********'';', True);
|
||||
end;
|
||||
|
||||
function ext_GetSelectedText: string;
|
||||
var
|
||||
I: integer;
|
||||
begin
|
||||
with SimbaForm.CurrScript.SynEdit do
|
||||
begin
|
||||
if (not (BlockBegin.Y = BlockEnd.Y)) then
|
||||
begin
|
||||
Result := Copy(Lines[BlockBegin.Y - 1], BlockBegin.X, Length(Lines[BlockBegin.Y - 1])) + MEOL;
|
||||
for I := BlockBegin.Y + 1 to BlockEnd.Y - 1 do
|
||||
Result := Result + Lines[I - 1] + MEOL;
|
||||
Result := Result + Copy(Lines[BlockEnd.Y - 1], 1, BlockEnd.X - 1);
|
||||
end else
|
||||
Result := Copy(Lines[BlockBegin.Y - 1], BlockBegin.X, BlockEnd.X - BlockBegin.X);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure ext_OpenScript(vName, Data: string; Run: boolean);
|
||||
|
Loading…
Reference in New Issue
Block a user