mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-28 12:02:15 -05:00
donno what I changed, but it's probably important!
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@413 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
e9579234d8
commit
ad14b80b30
@ -43,7 +43,7 @@ uses
|
|||||||
ocr, updateform, simbasettings, reportbug;
|
ocr, updateform, simbasettings, reportbug;
|
||||||
|
|
||||||
const
|
const
|
||||||
SimbaVersion = 408;
|
SimbaVersion = 413;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -322,6 +322,7 @@ type
|
|||||||
procedure PauseScript;
|
procedure PauseScript;
|
||||||
procedure StopScript;
|
procedure StopScript;
|
||||||
procedure AddTab;
|
procedure AddTab;
|
||||||
|
procedure StopCodeCompletion;
|
||||||
function DeleteTab( TabIndex : integer; CloseLast : boolean; Silent : boolean = false) : boolean;
|
function DeleteTab( TabIndex : integer; CloseLast : boolean; Silent : boolean = false) : boolean;
|
||||||
procedure ClearTab( TabIndex : integer);
|
procedure ClearTab( TabIndex : integer);
|
||||||
procedure CloseTabs(Exclude: integer = -1; Silent : boolean = false); //-1 for no exclusion
|
procedure CloseTabs(Exclude: integer = -1; Silent : boolean = false); //-1 for no exclusion
|
||||||
@ -855,8 +856,8 @@ begin
|
|||||||
Self.Caption := Format(WindowTitle,[Script.ScriptName + '*'])
|
Self.Caption := Format(WindowTitle,[Script.ScriptName + '*'])
|
||||||
end else
|
end else
|
||||||
begin;
|
begin;
|
||||||
Self.Caption := Format(WindowTitle,[Script.ScriptName]);
|
|
||||||
Tab.TabSheet.Caption:= Script.ScriptName;
|
Tab.TabSheet.Caption:= Script.ScriptName;
|
||||||
|
Self.Caption := Format(WindowTitle,[Script.ScriptName]);
|
||||||
end;
|
end;
|
||||||
StatusBar.Panels[Panel_ScriptName].Text:= Script.ScriptName;
|
StatusBar.Panels[Panel_ScriptName].Text:= Script.ScriptName;
|
||||||
StatusBar.Panels[Panel_ScriptPath].text:= Script.ScriptFile;
|
StatusBar.Panels[Panel_ScriptPath].text:= Script.ScriptFile;
|
||||||
@ -864,7 +865,7 @@ begin
|
|||||||
if Self.Showing then
|
if Self.Showing then
|
||||||
if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then
|
if Tab.TabSheet.TabIndex = Self.PageControl1.TabIndex then
|
||||||
CurrScript.SynEdit.SetFocus;
|
CurrScript.SynEdit.SetFocus;
|
||||||
editSearchListExit(self);//To set the highlighting back to normal;
|
StopCodeCompletion;//To set the highlighting back to normal;
|
||||||
frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text);
|
frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text);
|
||||||
with CurrScript.SynEdit do
|
with CurrScript.SynEdit do
|
||||||
begin
|
begin
|
||||||
@ -1089,25 +1090,31 @@ begin
|
|||||||
if CurrScript.SynEdit.CanFocus then
|
if CurrScript.SynEdit.CanFocus then
|
||||||
CurrScript.SynEdit.SetFocus;
|
CurrScript.SynEdit.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
procedure TForm1.StopCodeCompletion;
|
||||||
|
begin
|
||||||
|
if frmFunctionList.InCodeCompletion then
|
||||||
|
with CurrScript,frmFunctionList do
|
||||||
|
begin;
|
||||||
|
editSearchList.Color:= clWhite;
|
||||||
|
if FilterTree.Focused then
|
||||||
|
begin;
|
||||||
|
Writeln('This is currently not supported');
|
||||||
|
SynEdit.Lines[CompletionCaret.y - 1] := CompletionStart;
|
||||||
|
SynEdit.LogicalCaretXY:= point(CompletionCaret.x,CompletionCaret.y);
|
||||||
|
SynEdit.SelEnd:= SynEdit.SelStart;
|
||||||
|
end;
|
||||||
|
InCodeCompletion:= false;
|
||||||
|
SynEdit.SelectedColor.Style:= [];
|
||||||
|
SynEdit.SelectedColor.Foreground:= clHighlightText;
|
||||||
|
SynEdit.SelectedColor.Background:= clHighlight;
|
||||||
|
Synedit.MarkupByClass[TSynEditMarkupHighlightAllCaret].TempEnable;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.editSearchListExit(Sender: TObject);
|
procedure TForm1.editSearchListExit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
frmFunctionList.editSearchList.Color := clWhite;
|
frmFunctionList.editSearchList.Color := clWhite;
|
||||||
if frmFunctionList.InCodeCompletion then
|
StopCodeCompletion;
|
||||||
begin;
|
|
||||||
if frmFunctionList.FilterTree.Focused then
|
|
||||||
begin;
|
|
||||||
Writeln('This is currently not supported');
|
|
||||||
CurrScript.SynEdit.Lines[frmFunctionList.CompletionCaret.y - 1] := frmFunctionList.CompletionStart;
|
|
||||||
CurrScript.SynEdit.LogicalCaretXY:= point(frmFunctionList.CompletionCaret.x,frmFunctionList.CompletionCaret.y);
|
|
||||||
CurrScript.SynEdit.SelEnd:= CurrScript.SynEdit.SelStart;
|
|
||||||
end;
|
|
||||||
frmFunctionList.InCodeCompletion:= false;
|
|
||||||
CurrScript.SynEdit.SelectedColor.Style:= [];
|
|
||||||
CurrScript.SynEdit.SelectedColor.Foreground:= clHighlightText;
|
|
||||||
CurrScript.SynEdit.SelectedColor.Background:= clHighlight;
|
|
||||||
CurrScript.Synedit.MarkupByClass[TSynEditMarkupHighlightAllCaret].TempEnable;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.editSearchListKeyDown(Sender: TObject; var Key: Word;
|
procedure TForm1.editSearchListKeyDown(Sender: TObject; var Key: Word;
|
||||||
@ -1133,27 +1140,22 @@ begin
|
|||||||
begin;
|
begin;
|
||||||
key := #0;
|
key := #0;
|
||||||
frmFunctionList.Find(True);
|
frmFunctionList.Find(True);
|
||||||
//See OnKeyUp
|
|
||||||
{ end else if key = Chr(VK_UP) then //Up, go one up!
|
|
||||||
begin;
|
|
||||||
Writeln('hai');
|
|
||||||
frmFunctionList.Find(false,true);}
|
|
||||||
end else
|
end else
|
||||||
if frmFunctionList.InCodeCompletion then
|
if frmFunctionList.InCodeCompletion then
|
||||||
begin;
|
begin;
|
||||||
if key = #27 then//esc -> C'est error!
|
if key = #27 then//esc -> C'est error!
|
||||||
begin
|
begin
|
||||||
key := #0;
|
key := #0;
|
||||||
|
StopCodeCompletion;
|
||||||
CurrScript.SynEdit.Lines[frmFunctionList.CompletionCaret.y - 1] := frmFunctionList.CompletionStart;
|
CurrScript.SynEdit.Lines[frmFunctionList.CompletionCaret.y - 1] := frmFunctionList.CompletionStart;
|
||||||
frmFunctionList.editSearchList.OnExit(sender);
|
|
||||||
CurrScript.SynEdit.LogicalCaretXY:= point(frmFunctionList.CompletionCaret.x,frmFunctionList.CompletionCaret.y);
|
CurrScript.SynEdit.LogicalCaretXY:= point(frmFunctionList.CompletionCaret.x,frmFunctionList.CompletionCaret.y);
|
||||||
CurrScript.SynEdit.SelEnd:= CurrScript.SynEdit.SelStart;
|
CurrScript.SynEdit.SelEnd:= CurrScript.SynEdit.SelStart;
|
||||||
CurrScript.SynEdit.SetFocus;
|
CurrScript.SynEdit.SetFocus;
|
||||||
end else
|
end else
|
||||||
if key in [' ',',','.','(',')'] then //on on these chars we will insert the function!
|
if key in [' ',',','.','(',')'] then //on on these chars we will insert the function!
|
||||||
begin;
|
begin;
|
||||||
|
StopCodeCompletion;
|
||||||
linetext := CurrScript.SynEdit.Lines[frmFunctionList.CompletionCaret.y - 1];
|
linetext := CurrScript.SynEdit.Lines[frmFunctionList.CompletionCaret.y - 1];
|
||||||
frmFunctionList.editSearchList.OnExit(sender);
|
|
||||||
while (frmFunctionList.CompletionCaret.x <= length(linetext)) and (linetext[frmFunctionList.CompletionCaret.x] in ['a'..'z','A'..'Z','0'..'9','_']) do
|
while (frmFunctionList.CompletionCaret.x <= length(linetext)) and (linetext[frmFunctionList.CompletionCaret.x] in ['a'..'z','A'..'Z','0'..'9','_']) do
|
||||||
inc(frmFunctionList.CompletionCaret.x);
|
inc(frmFunctionList.CompletionCaret.x);
|
||||||
CurrScript.SynEdit.LogicalCaretXY:= frmFunctionList.CompletionCaret;
|
CurrScript.SynEdit.LogicalCaretXY:= frmFunctionList.CompletionCaret;
|
||||||
@ -1182,7 +1184,7 @@ end;
|
|||||||
|
|
||||||
procedure TForm1.FunctionListExit(Sender: TObject);
|
procedure TForm1.FunctionListExit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
StatusBar.Panels[2].Text:= '';
|
// StatusBar.Panels[2].Text:= '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.MenuItemColourHistoryClick(Sender: TObject);
|
procedure TForm1.MenuItemColourHistoryClick(Sender: TObject);
|
||||||
@ -1308,8 +1310,6 @@ procedure TForm1.FormShortCuts(var Msg: TLMKey; var Handled: Boolean);
|
|||||||
begin
|
begin
|
||||||
SetEditActions;
|
SetEditActions;
|
||||||
Handled := ActionList.IsShortCut(Msg);
|
Handled := ActionList.IsShortCut(Msg);
|
||||||
{ ShiftState := MsgKeyDataToShiftState(Message.KeyData);
|
|
||||||
ShortCut := KeyToShortCut(Message.CharCode, ShiftState);}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1785,6 +1785,7 @@ begin
|
|||||||
ScriptFile := FileName;
|
ScriptFile := FileName;
|
||||||
SynEdit.Lines.SaveToFile(ScriptFile);
|
SynEdit.Lines.SaveToFile(ScriptFile);
|
||||||
ScriptName:= ExtractFileNameOnly(ScriptFile);
|
ScriptName:= ExtractFileNameOnly(ScriptFile);
|
||||||
|
Writeln('Saving to: ' + FileName);
|
||||||
WriteLn('Script name will be: ' + ScriptName);
|
WriteLn('Script name will be: ' + ScriptName);
|
||||||
RefreshTab();
|
RefreshTab();
|
||||||
Result := True;
|
Result := True;
|
||||||
|
@ -282,8 +282,7 @@ procedure TMColorPicker.ColorPickUp(Sender: TObject; Button: TMouseButton;
|
|||||||
begin;
|
begin;
|
||||||
{ Set the coordinates and color that the user cliked on }
|
{ Set the coordinates and color that the user cliked on }
|
||||||
Color:= WidgetSet.DCGetPixel(ImageMain.Canvas.Handle,x,y);
|
Color:= WidgetSet.DCGetPixel(ImageMain.Canvas.Handle,x,y);
|
||||||
Self.Colorx := x;
|
Input.GetMousePos(ColorX, ColorY);
|
||||||
Self.Colory := y;
|
|
||||||
|
|
||||||
if OnPick <> nil then
|
if OnPick <> nil then
|
||||||
Onpick(Sender,Color,Colorx,Colory);
|
Onpick(Sender,Color,Colorx,Colory);
|
||||||
|
Loading…
Reference in New Issue
Block a user