mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-24 18:22:25 -05:00
LoadDLL is now LoadLib (and it can also be used as a compiler directive {$loadlib libsmart}). Fixed a bug in PS-Script. Also fixed a segfault which would occur if you would do Ctrl + Space before it was done filling the corebuffer..
This commit is contained in:
parent
a4c7c30e77
commit
e3d359b088
@ -46,7 +46,7 @@ uses
|
||||
CastaliaSimplePasPar, v_AutoCompleteForm, PSDump;
|
||||
|
||||
const
|
||||
SimbaVersion = 670;
|
||||
SimbaVersion = 675;
|
||||
|
||||
type
|
||||
|
||||
@ -539,7 +539,12 @@ var
|
||||
b: TStringList;
|
||||
ms: TMemoryStream;
|
||||
begin
|
||||
Index := PluginsGlob.LoadPlugin(LibName);
|
||||
try
|
||||
Index := PluginsGlob.LoadPlugin(LibName);
|
||||
except
|
||||
Result := false;
|
||||
Index := -1;
|
||||
end;
|
||||
if (Index < 0) then
|
||||
Exit(False)
|
||||
else
|
||||
@ -2022,6 +2027,7 @@ var
|
||||
a: TPSScriptExtension;
|
||||
b: TStringList;
|
||||
ms: TMemoryStream;
|
||||
buf : TCodeInsight;
|
||||
begin
|
||||
if SimbaForm.UpdatingFonts then
|
||||
begin
|
||||
@ -2053,15 +2059,16 @@ begin
|
||||
|
||||
CoreDefines.AddStrings(a.Defines);
|
||||
|
||||
SetLength(CoreBuffer, 1);
|
||||
CoreBuffer[0] := TCodeInsight.Create;
|
||||
with CoreBuffer[0] do
|
||||
buf := TCodeInsight.Create;
|
||||
with buf do
|
||||
begin
|
||||
OnMessage := @SimbaForm.OnCCMessage;
|
||||
b.SaveToStream(ms);
|
||||
Run(ms, nil, -1, True);
|
||||
FileName := '"PSCORE"';
|
||||
end;
|
||||
SetLength(CoreBuffer, 1);
|
||||
CoreBuffer[0] := buf;
|
||||
finally
|
||||
b.Free;
|
||||
a.Free;
|
||||
@ -2517,7 +2524,7 @@ begin
|
||||
if (NewPos <> OldPos) and (NewPos <> -1) then
|
||||
begin;
|
||||
Tabs.Move(OldPos,NewPos);
|
||||
PageControl1.Pages[OldPos].TabIndex:= NewPos;
|
||||
PageControl1.Pages[OldPos].PageIndex := NewPos;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -424,7 +424,7 @@ var
|
||||
path : string;
|
||||
begin
|
||||
result := false;
|
||||
if CompareText(DirectiveName,'LOADDLL') = 0 then
|
||||
if CompareText(DirectiveName,'LOADLIB') = 0 then
|
||||
begin
|
||||
if DirectiveArgs <> '' then
|
||||
begin;
|
||||
@ -436,7 +436,7 @@ begin
|
||||
result:= True;
|
||||
end;
|
||||
end else
|
||||
psWriteln('Your LoadDLL directive has no params, thus cannot find the plugin');
|
||||
psWriteln('Your LoadLib directive has no params, thus cannot find the plugin');
|
||||
end else
|
||||
if CompareText(DirectiveName,'INCLUDE_ONCE') = 0 then
|
||||
begin
|
||||
@ -598,7 +598,7 @@ procedure TPSThread.PSScriptProcessUnknowDirective(Sender: TPSPreProcessor;
|
||||
Parser: TPSPascalPreProcessorParser; const Active: Boolean;
|
||||
const DirectiveName, DirectiveParam: string; var Continue: Boolean);
|
||||
begin
|
||||
Continue:= ProcessDirective(DirectiveName, DirectiveParam);
|
||||
Continue:=not ProcessDirective(DirectiveName, DirectiveParam);
|
||||
end;
|
||||
|
||||
function Muf_Conv_to_PS_Conv( conv : integer) : TDelphiCallingConvention;
|
||||
|
@ -133,7 +133,7 @@ implementation
|
||||
ii := i;
|
||||
end;
|
||||
if ii = -1 then
|
||||
raise Exception.CreateFMT('Plugins(%s) has not been found',[PluginName]);
|
||||
raise Exception.CreateFMT('Plugin(%s) has not been found',[PluginName]);
|
||||
for i := 0 to PluginLen - 1 do
|
||||
if Loaded[i].filename = (PluginDirs.Strings[ii] + PluginName + PlugExt) then
|
||||
Exit(i);
|
||||
|
@ -1546,7 +1546,7 @@ begin
|
||||
FDirectiveParamOrigin := FOrigin + FTokenPos;
|
||||
FTokenPos := Run;
|
||||
case KeyHash of
|
||||
60: if KeyComp('LOADDLL') then
|
||||
55: if KeyComp('LOADLIB') then
|
||||
fTokenID := tokIncludeDirect
|
||||
else
|
||||
fTokenID := tokBorComment;
|
||||
@ -2388,6 +2388,10 @@ begin
|
||||
if KeyComp('UNDEF') then
|
||||
Result := tokUndefDirect else
|
||||
Result := tokCompDirect;
|
||||
55:
|
||||
if KeyComp('LOADLIB') then
|
||||
result := tokIncludeDirect else
|
||||
result := tokCompDirect;
|
||||
56:
|
||||
if KeyComp('ELSEIF') then
|
||||
Result := tokElseIfDirect else
|
||||
|
@ -292,7 +292,7 @@ begin
|
||||
{$ENDIF}
|
||||
if (not Sender.IsJunk) and (Param <> '') then
|
||||
begin
|
||||
p := Pos('loaddll', LowerCase(Sender.Token));
|
||||
p := Pos('loadlib', LowerCase(Sender.Token));
|
||||
if (p > 0) and (p <= 3) then
|
||||
begin
|
||||
if LoadLibrary(Param) then
|
||||
@ -1322,6 +1322,8 @@ procedure TCodeInsight.FillSynCompletionProposal(ItemList, InsertList: TStrings;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if item = nil then
|
||||
exit;
|
||||
if (not Item.Proposal_Filled) then
|
||||
Item.FillProposal;
|
||||
|
||||
|
@ -447,7 +447,7 @@ procedure callObjectOnProcessDirective (
|
||||
const DirectiveName, DirectiveParam: tbtstring;
|
||||
Var Continue: Boolean);
|
||||
begin
|
||||
TPSScript (Sender.ID).DoOnProcessUnknowDirective(Sender, Parser, Active, DirectiveName, DirectiveParam, Continue);
|
||||
TPSScript (Sender.ID).DoOnProcessDirective(Sender, Parser, Active, DirectiveName, DirectiveParam, Continue);
|
||||
end;
|
||||
|
||||
procedure callObjectOnProcessUnknowDirective (
|
||||
@ -457,7 +457,7 @@ procedure callObjectOnProcessUnknowDirective (
|
||||
const DirectiveName, DirectiveParam: tbtstring;
|
||||
Var Continue: Boolean);
|
||||
begin
|
||||
TPSScript (Sender.ID).DoOnProcessDirective(Sender, Parser, Active, DirectiveName, DirectiveParam, Continue);
|
||||
TPSScript (Sender.ID).DoOnProcessUnknowDirective(Sender, Parser, Active, DirectiveName, DirectiveParam, Continue);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -166,7 +166,7 @@ begin
|
||||
with CL.AddClassN(CL.FindClass('TPage'),'TTabSheet') do
|
||||
begin
|
||||
RegisterProperty('PageControl', 'TPageControl', iptrw);
|
||||
RegisterProperty('TabIndex', 'Integer', iptrw);
|
||||
RegisterProperty('TabIndex', 'Integer', iptr);
|
||||
RegisterProperty('OnMouseDown','TMouseEvent',iptrw);
|
||||
RegisterProperty('OnMouseMove','TMouseMoveEvent',iptrw);
|
||||
RegisterProperty('OnMouseUp','TMouseEvent',iptrw);
|
||||
@ -434,8 +434,10 @@ procedure TPageControlActivePageIndex_R(Self: TPageControl; var T: Integer);
|
||||
begin T := Self.ActivePageIndex; end;
|
||||
|
||||
(*----------------------------------------------------------------------------*)
|
||||
{$IFNDEF FPC}
|
||||
procedure TTabSheetTabIndex_W(Self: TTabSheet; const T: Integer);
|
||||
begin Self.TabIndex := T; end;
|
||||
{$ENDIF}
|
||||
|
||||
(*----------------------------------------------------------------------------*)
|
||||
procedure TTabSheetTabIndex_R(Self: TTabSheet; var T: Integer);
|
||||
@ -671,7 +673,7 @@ begin
|
||||
with CL.Add(TTabSheet) do
|
||||
begin
|
||||
RegisterPropertyHelper(@TTabSheetPageControl_R,@TTabSheetPageControl_W,'PageControl');
|
||||
RegisterPropertyHelper(@TTabSheetTabIndex_R,@TTabSheetTabIndex_W,'TabIndex');
|
||||
RegisterPropertyHelper(@TTabSheetTabIndex_R,nil,'TabIndex');
|
||||
RegisterEventPropertyHelper(@TControlOnMouseDown_R,@TControlOnMouseDown_W,'OnMouseDown');
|
||||
RegisterEventPropertyHelper(@TControlOnMouseMove_R,@TControlOnMouseMove_W,'OnMouseMove');
|
||||
RegisterEventPropertyHelper(@TControlOnMouseUp_R,@TControlOnMouseUp_W,'OnMouseUp');
|
||||
|
Loading…
Reference in New Issue
Block a user