gtk2 intf: fixed TGtk2WSCustomTabControl.GetDefaultClientRect to check if gtknotebook has a page

git-svn-id: trunk@36905 -
This commit is contained in:
mattias 2012-04-19 09:58:51 +00:00
parent e99a152f77
commit 38c771eeb4
2 changed files with 6 additions and 3 deletions

View File

@ -311,8 +311,11 @@ var
begin
Result:=false;
//DebugLn(['TGtk2WSCustomTabControl.GetDefaultClientRect ',DbgSName(AWinControl),' ',aWidth,'x',aHeight]);
if AWinControl.HandleAllocated then begin
if AWinControl.HandleAllocated
and (gtk_notebook_get_nth_page({%H-}PGtkNotebook(AWinControl.Handle),0)<>nil) then
begin
// handle allocated and has one page
// => normal GetClientRect will retrieve the right ClientRect
end else begin
FrameBorders:=GetStyleNotebookFrameBorders;
aClientRect:=Rect(0,0,

View File

@ -4381,7 +4381,7 @@ var
ARect:=Rect(0,0,
Max(0,AWidth-FrameBorders.Left-FrameBorders.Right),
Max(0,aHeight-FrameBorders.Top-FrameBorders.Bottom));
//DebugLn(['GetNoteBookClientRect using defaults: ',GetWidgetDebugReport(Widget),' ARect=',dbgs(aRect)]);
//DebugLn(['GetNoteBookClientRect using defaults: ',GetWidgetDebugReport(Widget),' ARect=',dbgs(aRect),' Frame=',dbgs(FrameBorders)]);
end;
end;