1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-08-13 16:53:59 -04:00

Several bugfixes.

For the record:
	- One in wait. Integer -> DWord.
	- ActivateClient did not call XFlush(), and wasn't exported either.
	- Bug in SendKeys where it did not release the VK_SHIFT key.
	- Overloaded + and - operators for TPoints



git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@253 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-11-30 19:57:26 +00:00
parent 8e3c093fbb
commit d0572ddc18
7 changed files with 33 additions and 3 deletions

View File

@ -28,7 +28,7 @@ begin
end;
{$else}
var
EndTime : integer;
EndTime : DWord;
begin
if t > 50 then
begin;
@ -36,7 +36,9 @@ begin
while (CurrThread.PSScript.Exec.Status = isRunning) and (GetTickCount < EndTime) do
Sleep(16);
end else
begin
sleep(t);
end;
end;
{$endif}

View File

@ -51,3 +51,8 @@ procedure SetTargetArray(P: Integer; Size: TPoint);
begin
CurrThread.Client.MWindow.SetTarget(PRGB32(P), Size);
end;
procedure activateclient;
begin
CurrThread.Client.MWindow.ActivateClient;
end;

View File

@ -72,6 +72,7 @@ Sender.AddFunction(@GetClientDimensions, 'procedure GetClientDimensions(out w, h
Sender.AddFunction(@SetTargetBitmap,'procedure SetTargetBitmap(Bitmap : integer);');
Sender.AddFunction(@SetDesktopAsClient,'procedure SetDesktopAsClient');
Sender.AddFunction(@SetTargetArray, 'procedure SetTargetArray(P: Integer; Size: TPoint);');
Sender.AddFunction(@ActivateClient, 'procedure activateclient;');
{files}
Sender.AddFunction(@ps_CreateFile, 'function CreateFile(Path: string): Integer;');

View File

@ -200,6 +200,7 @@ end;
{$I PSInc/Wrappers/other.inc}
{$I PSInc/Wrappers/bitmap.inc}
{$I PSInc/Wrappers/window.inc}
{$I PSInc/Wrappers/colour.inc}
{$I PSInc/Wrappers/math.inc}
{$I PSInc/Wrappers/mouse.inc}

View File

@ -182,7 +182,7 @@ begin
for i := 1 to length(text) do
begin
if((text[i] >= 'A') and (text[i] <= 'Z')) then
begin;
begin
Self.KeyDown(VK_SHIFT);
HoldShift:= True;
Text[i] := lowerCase(Text[i]);
@ -194,6 +194,8 @@ begin
end;
Self.PressKey( GetSimpleKeyCode(Text[i]));
end;
if HoldShift then
Self.KeyUp(VK_SHIFT);
end;
function TMInput.isKeyDown(key: Word): Boolean;

View File

@ -34,7 +34,16 @@ const
DS = DirectorySeparator;
MEOL = {$ifdef MSWINDOWS}#13+{$endif}#10;
{ Overloaded Operators}
{ TPoint add }
operator + (PT1,PT2 : TPoint) : TPoint;
{ TPoint sub }
operator - (PT1,PT2 : TPoint) : TPoint;
type
TRGB32 = packed record
B, G, R, A: Byte;
end;
@ -283,6 +292,15 @@ var
);
implementation
operator+(PT1, PT2: TPoint): TPoint;
begin
Result.x := PT1.x + PT2.x;
Result.y := Pt1.y + PT2.y;
end;
operator-(PT1, PT2: TPoint): TPoint;
begin
Result.x := PT1.x - PT2.x;
Result.y := Pt1.y - PT2.y;
end;
end.

View File

@ -531,6 +531,7 @@ begin
begin;
Old_Handler := XSetErrorHandler(@MufasaXErrorHandler);
XSetInputFocus(Self.XDisplay,Self.CurWindow,RevertToParent,CurrentTime);
XFlush(Self.XDisplay);
XSetErrorHandler(Old_Handler);
end;
{$ENDIF}