From 67c3678880daa7998be8e39a3e757368bbe857bb Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 27 Aug 2003 20:55:51 +0000 Subject: [PATCH] fixed updating codetools on changing pkg output dir git-svn-id: trunk@4538 - --- lcl/controls.pp | 19 +++++- lcl/include/dockzone.inc | 88 +++++++++++++++++++++------ lcl/interfaces/gtk2/gtk2int.pas | 17 ++---- lcl/interfaces/gtk2/gtk2interface.lpk | 8 ++- packager/packagedefs.pas | 3 + 5 files changed, 99 insertions(+), 36 deletions(-) diff --git a/lcl/controls.pp b/lcl/controls.pp index b0e7b5fc74..a8baa1ed86 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -1239,7 +1239,14 @@ type TDockZone = class private - function GetChildCount: Integer; + FChildControl: TControl; + FChildCount: integer; + FTree: TDockTree; + FZoneLimit: integer; + FParentZone: TDockZone; + FOrientation: TDockOrientation; + FNextSibling: TDockZone; + //FPrevSibling: TDockZone; function GetHeight: Integer; function GetLeft: Integer; function GetLimitBegin: Integer; @@ -1250,8 +1257,10 @@ type function GetWidth: Integer; function GetZoneLimit: Integer; procedure SetZoneLimit(const AValue: Integer); + function IsOrientationValid: boolean; + function GetNextVisibleZone: TDockZone; public - constructor Create(Tree: TDockTree); + constructor Create(TheTree: TDockTree); procedure ExpandZoneLimit(NewLimit: Integer); function FirstVisibleChild: TDockZone; function NextVisible: TDockZone; @@ -1259,7 +1268,8 @@ type procedure ResetChildren; procedure ResetZoneLimits; procedure Update; - property ChildCount: Integer read GetChildCount; + property Tree: TDockTree read FTree; + property ChildCount: Integer read FChildCount; property Height: Integer read GetHeight; property Left: Integer read GetLeft; property LimitBegin: Integer read GetLimitBegin; @@ -1830,6 +1840,9 @@ end. { ============================================================================= $Log$ + Revision 1.147 2003/08/27 20:55:51 mattias + fixed updating codetools on changing pkg output dir + Revision 1.146 2003/08/27 11:01:10 mattias started TDockTree diff --git a/lcl/include/dockzone.inc b/lcl/include/dockzone.inc index b611051e52..22cc140894 100644 --- a/lcl/include/dockzone.inc +++ b/lcl/include/dockzone.inc @@ -18,12 +18,6 @@ ***************************************************************************** } -function TDockZone.GetChildCount: Integer; -begin - // ToDo - Result:=0; -end; - function TDockZone.GetHeight: Integer; begin // ToDo @@ -37,15 +31,37 @@ begin end; function TDockZone.GetLimitBegin: Integer; +// retunrs the zone limits. All childs are bounded to this value. +// Aka returns top for orientation doHorizontal and left for doVertical +var + Zone: TDockZone; begin - // ToDo - Result:=0; + if FTree.FTopZone = Self then + Zone := Self + else + Zone := FParentZone; + if Zone.FOrientation = doHorizontal then + Result := Top + else if Zone.FOrientation = doVertical then + Result := Left + else + raise Exception.Create('TDockZone.GetLimitBegin'); end; function TDockZone.GetLimitSize: Integer; +var + Zone: TDockZone; begin - // ToDo - Result:=0; + if FTree.FTopZone = Self then + Zone := Self + else + Zone := FParentZone; + if Zone.FOrientation = doHorizontal then + Result := Height + else if Zone.FOrientation = doVertical then + Result := Width + else + raise Exception.Create('TDockZone.GetLimitSize'); end; function TDockZone.GetTop: Integer; @@ -55,15 +71,33 @@ begin end; function TDockZone.GetVisible: Boolean; +var + Zone: TDockZone; begin - // ToDo - Result:=false; + if Assigned(FChildControl) then + Result := FChildControl.Visible + else + begin + Result := True; + Zone := FirstVisibleChild; + while Assigned(Zone) do begin + if Zone.Visible then Exit; + Zone := Zone.FNextSibling; + end; + Result := False; + end; end; function TDockZone.GetVisibleChildCount: Integer; +var + Zone: TDockZone; begin - // ToDo - Result:=0; + Result := 0; + Zone := FirstVisibleChild; + while Zone <> nil do begin + Zone := Zone.NextVisible; + Inc(Result); + end; end; function TDockZone.GetWidth: Integer; @@ -74,18 +108,34 @@ end; function TDockZone.GetZoneLimit: Integer; begin - // ToDo - Result:=0; + if (not Visible) and IsOrientationValid then + // LimitSize will be zero and zone will take up no space + Result := GetLimitBegin + else + Result := FZoneLimit; end; procedure TDockZone.SetZoneLimit(const AValue: Integer); begin - // ToDo + FZoneLimit := AValue; end; -constructor TDockZone.Create(Tree: TDockTree); +function TDockZone.IsOrientationValid: boolean; begin - // ToDo + Result := (Assigned(FParentZone) and (FParentZone.FOrientation <> doNoOrient)) + or ((FTree.FTopZone = Self) and (FOrientation <> doNoOrient)); +end; + +function TDockZone.GetNextVisibleZone: TDockZone; +begin + Result := FNextSibling; + while Assigned(Result) and not Result.Visible do + Result := Result.FNextSibling; +end; + +constructor TDockZone.Create(TheTree: TDockTree); +begin + FTree:=TheTree; end; procedure TDockZone.ExpandZoneLimit(NewLimit: Integer); diff --git a/lcl/interfaces/gtk2/gtk2int.pas b/lcl/interfaces/gtk2/gtk2int.pas index 2c422dad29..8187d1af1c 100644 --- a/lcl/interfaces/gtk2/gtk2int.pas +++ b/lcl/interfaces/gtk2/gtk2int.pas @@ -22,8 +22,7 @@ unit Gtk2Int; -{$mode objfpc} -{$LONGSTRINGS ON} +{$mode objfpc}{$H+} interface @@ -32,9 +31,7 @@ interface {$endif} uses - Classes, SysUtils, InterfaceBase, gdk2pixbuf, gtk2, gdk2, glib2, LMessages, - Controls, Forms, VclGlobals, LCLLinux, LCLType, gtkDef, DynHashArray, - LazQueue, GraphType, GraphMath, gtkInt; + Classes, SysUtils, gdk2pixbuf, gtk2, gdk2, glib2, gtkInt; type TGtk2Object = class(TGtkObject) @@ -43,16 +40,14 @@ type implementation -uses - Graphics, Buttons, Menus, GTKWinApiWindow, StdCtrls, ComCtrls, CListBox, - KeyMap, Calendar, Arrow, Spin, CommCtrl, ExtCtrls, Dialogs, FileCtrl, - LResources, Math, gtkglobals, gtkproc, LCLStrConsts; - end. { $Log$ + Revision 1.2 2003/08/27 20:55:51 mattias + fixed updating codetools on changing pkg output dir + Revision 1.1 2002/12/15 11:52:28 mattias started gtk2 interface @@ -99,6 +94,4 @@ end. Revision 1.3 2002/10/10 13:29:08 lazarus AJ: added LoadStockPixmap routine & minor fixes to/for GNOMEInt - - } diff --git a/lcl/interfaces/gtk2/gtk2interface.lpk b/lcl/interfaces/gtk2/gtk2interface.lpk index 6df11f7606..e682a448bc 100644 --- a/lcl/interfaces/gtk2/gtk2interface.lpk +++ b/lcl/interfaces/gtk2/gtk2interface.lpk @@ -2,7 +2,7 @@ - + @@ -11,6 +11,10 @@ + + + + @@ -32,7 +36,7 @@ - + diff --git a/packager/packagedefs.pas b/packager/packagedefs.pas index d218888e29..405834afd5 100644 --- a/packager/packagedefs.pas +++ b/packager/packagedefs.pas @@ -350,6 +350,7 @@ type property LazPackage: TLazPackage read FLazPackage; end; + { TLazPackageDefineTemplates } TLazPkgDefineTemplatesFlag = ( @@ -2926,6 +2927,8 @@ begin FOutputDir.SetDefineOwner(LazPackage,false); FOutputDir.SetFlags([dtfAutoGenerated],[],false); FMain.AddChild(FOutputDir); + end else begin + FOutputDir.Value:=LazPackage.GetOutputDirectory; end; if (FOutPutSrcPath=nil)