partly fixed gtk2 mouse offsets;

added new includes to gtk2 lpk

git-svn-id: trunk@4702 -
This commit is contained in:
ajgenius 2003-10-06 16:13:53 +00:00
parent 230f4d80cb
commit d1b6f316f9
4 changed files with 54 additions and 4 deletions

View File

@ -854,6 +854,15 @@ procedure TGtkObject.SendCachedGtkMessages;
GtkLeft:=MainWidget^.Allocation.X; GtkLeft:=MainWidget^.Allocation.X;
GtkTop:=MainWidget^.Allocation.Y; GtkTop:=MainWidget^.Allocation.Y;
{$Ifdef GTK2}
if GTK_WIDGET_NO_WINDOW(MainWidget) and GTK_WIDGET_NO_WINDOW(MainWidget^.Parent)
// and (not GtkWidgetIsA(MainWidget,GTKAPIWidget_GetType))
then begin
Dec(GtkLeft, MainWidget^.parent^.Allocation.X);
Dec(GtkTop, MainWidget^.parent^.Allocation.Y);
end;
{$EndIf}
GtkWidth:=MainWidget^.Allocation.Width; GtkWidth:=MainWidget^.Allocation.Width;
if GtkWidth<0 then GtkWidth:=0; if GtkWidth<0 then GtkWidth:=0;
GtkHeight:=MainWidget^.Allocation.Height; GtkHeight:=MainWidget^.Allocation.Height;
@ -8445,6 +8454,10 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.432 2003/10/06 16:13:52 ajgenius
partly fixed gtk2 mouse offsets;
added new includes to gtk2 lpk
Revision 1.431 2003/10/06 10:50:10 mattias Revision 1.431 2003/10/06 10:50:10 mattias
added recursion to InvalidateClientRectCache added recursion to InvalidateClientRectCache

View File

@ -2153,6 +2153,13 @@ begin
if ClientWindow<>nil then begin if ClientWindow<>nil then begin
BeginGDKErrorTrap; BeginGDKErrorTrap;
gdk_window_get_origin(ClientWindow,@Result.X,@Result.Y); gdk_window_get_origin(ClientWindow,@Result.X,@Result.Y);
{$Ifdef GTK2}
if GTK_WIDGET_NO_WINDOW(ClientWidget)
then begin
Inc(Result.X, ClientWidget^.Allocation.X);
Inc(Result.Y, ClientWidget^.Allocation.Y);
end;
{$EndIf}
EndGDKErrorTrap; EndGDKErrorTrap;
exit; exit;
end; end;
@ -4899,6 +4906,10 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.215 2003/10/06 16:13:52 ajgenius
partly fixed gtk2 mouse offsets;
added new includes to gtk2 lpk
Revision 1.214 2003/10/03 01:25:01 ajgenius Revision 1.214 2003/10/03 01:25:01 ajgenius
add more gtk1i<->gtk2 key & event wrappers, add more gtk1i<->gtk2 key & event wrappers,
move more GTK2 workarounds from gtk to gtk2 interface, move more GTK2 workarounds from gtk to gtk2 interface,

View File

@ -3609,10 +3609,24 @@ begin
inc(MainOrigin.X,Widget^.Allocation.X); inc(MainOrigin.X,Widget^.Allocation.X);
inc(MainOrigin.Y,Widget^.Allocation.Y); inc(MainOrigin.Y,Widget^.Allocation.Y);
end; end;
if ClientWindow<>nil then if ClientWindow<>nil then begin
gdk_window_get_origin(ClientWindow,@ClientOrigin.X,@ClientOrigin.Y) {$Ifdef GTK2}
else begin if GTK_WIDGET_NO_WINDOW(ClientWidget)
then begin
ClientOrigin.X := ClientWidget^.Allocation.X;
ClientOrigin.Y := ClientWidget^.Allocation.Y;
end else
{$EndIf}
gdk_window_get_origin(ClientWindow,@ClientOrigin.X,@ClientOrigin.Y);
end else begin
// client widget not realized // client widget not realized
{$Ifdef GTK2}
if GTK_WIDGET_NO_WINDOW(ClientWidget)
then begin
ClientOrigin.X := ClientWidget^.Allocation.X;
ClientOrigin.Y := ClientWidget^.Allocation.Y;
end else
{$EndIf}
ClientOrigin:=MainOrigin; ClientOrigin:=MainOrigin;
end; end;
ARect.Left:=ClientOrigin.X-MainOrigin.X; ARect.Left:=ClientOrigin.X-MainOrigin.X;
@ -8951,6 +8965,10 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.290 2003/10/06 16:13:52 ajgenius
partly fixed gtk2 mouse offsets;
added new includes to gtk2 lpk
Revision 1.289 2003/10/02 18:18:32 ajgenius Revision 1.289 2003/10/02 18:18:32 ajgenius
buffer cs_opaque ExtTextOut blocks to help prevent extensive flickering buffer cs_opaque ExtTextOut blocks to help prevent extensive flickering

View File

@ -13,7 +13,7 @@
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
</Other> </Other>
</CompilerOptions> </CompilerOptions>
<Files Count="20"> <Files Count="22">
<Item1> <Item1>
<Filename Value="interfaces.pas"/> <Filename Value="interfaces.pas"/>
<UnitName Value="Interfaces"/> <UnitName Value="Interfaces"/>
@ -94,6 +94,14 @@
<Filename Value="../gtk/keymap.pp"/> <Filename Value="../gtk/keymap.pp"/>
<UnitName Value="KeyMap"/> <UnitName Value="KeyMap"/>
</Item20> </Item20>
<Item21>
<Filename Value="gtk2winapi.inc"/>
<Type Value="Include"/>
</Item21>
<Item22>
<Filename Value="gtk2object.inc"/>
<Type Value="Include"/>
</Item22>
</Files> </Files>
<Type Value="RunAndDesignTime"/> <Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="2"> <RequiredPkgs Count="2">