gtk: offset should be added only if fixed widget also have no window (fixes something in lazreport)

git-svn-id: trunk@13366 -
This commit is contained in:
paul 2007-12-18 06:06:57 +00:00
parent b9556171fe
commit 5f4c1f9e2c
3 changed files with 21 additions and 16 deletions

View File

@ -50,7 +50,7 @@ end;
------------------------------------------------------------------------------}
function TGtkDeviceContext.GetOffset: TPoint;
var
Fixed : Pointer;
Fixed: Pointer;
Adjustment: PGtkAdjustment;
begin
if Self = nil
@ -61,20 +61,26 @@ begin
end;
Result := FOrigin;
{$ifdef GTK2}
if (FWidget <> nil)
and GTK_WIDGET_NO_WINDOW(FWidget)
and not GtkWidgetIsA(FWidget, GTKAPIWidget_GetType)
then begin
Inc(Result.X, FWidget^.Allocation.x);
Inc(Result.y, FWidget^.Allocation.y);
{$ifndef gtk1}
if (FWidget <> nil) then
begin
Fixed := GetFixedWidget(FWidget);
if GTK_WIDGET_NO_WINDOW(FWidget) and
GTK_WIDGET_NO_WINDOW(Fixed) and
not GtkWidgetIsA(FWidget, GTKAPIWidget_GetType) then
begin
Inc(Result.X, FWidget^.Allocation.x);
Inc(Result.y, FWidget^.Allocation.y);
end;
end;
{$endIf}
{$endif}
if not FSpecialOrigin then Exit;
if FWidget = nil then Exit;
{$ifdef gtk1}
Fixed := GetFixedWidget(FWidget);
{$endif}
if not GtkWidgetIsA(Fixed, GTK_LAYOUT_GET_TYPE) then Exit;
Adjustment := gtk_layout_get_hadjustment(Fixed);

View File

@ -3957,9 +3957,10 @@ end;
Get the gdkwindow of a widget.
------------------------------------------------------------------------------}
Function GetControlWindow(Widget: Pointer) : PGDKWindow;
function GetControlWindow(Widget: Pointer) : PGDKWindow;
begin
If Widget <> nil then begin
if Widget <> nil then
begin
If not GTKWidgetIsA(PGTKWidget(Widget), GTK_Layout_Get_Type) then
Result := PGTKWidget(Widget)^.Window
else
@ -3973,8 +3974,6 @@ begin
end;
{------------------------------------------------------------------------------
function CreateWidgetInfo(const AWidget: Pointer): PWidgetInfo;
@ -7006,7 +7005,7 @@ begin
{$IFDEF Gtk2}
if (Widget^.parent<>nil)
and GtkWidgetIsA(Widget^.parent,GTK_TYPE_FIXED)
and not gtk_fixed_get_has_window(PGtkFixed(Widget^.parent))
and GTK_WIDGET_NO_WINDOW(Widget^.parent)
then begin
inc(LCLLeft, Widget^.parent^.allocation.x);
inc(LCLTop, Widget^.parent^.allocation.y);
@ -7117,7 +7116,7 @@ begin
else
if (aWidget^.parent<>nil)
and GtkWidgetIsA(aWidget^.parent,GTK_TYPE_FIXED)
and not gtk_fixed_get_has_window(PGtkFixed(aWidget^.parent))
and GTK_WIDGET_NO_WINDOW(aWidget^.parent)
then begin
// widget on a fixed, but fixed w/o window
Dec(Left, PGtkWidget(aWidget^.parent)^.allocation.x);

View File

@ -3195,7 +3195,7 @@ begin
if ALCLObject is TCustomListBox then
gMouse:=gMain;
{$ELSE}
if GTK_IS_FIXED(gMouse) and not gtk_fixed_get_has_window(PGtkFixed(gMouse)) then
if GTK_IS_FIXED(gMouse) and GTK_WIDGET_NO_WINDOW(gMouse) then
begin
gTemp := PGtkObject(gtk_widget_get_parent(PGtkWidget(gMouse)));
//DebugLn(gtk_type_name(g_object_type(gMouse)) + ' => ' + gtk_type_name(g_object_type(gTemp)));