fixed updating codetools on changing pkg output dir

git-svn-id: trunk@4538 -
This commit is contained in:
mattias 2003-08-27 20:55:51 +00:00
parent 495577e5b8
commit 67c3678880
5 changed files with 99 additions and 36 deletions

View File

@ -1239,7 +1239,14 @@ type
TDockZone = class TDockZone = class
private private
function GetChildCount: Integer; FChildControl: TControl;
FChildCount: integer;
FTree: TDockTree;
FZoneLimit: integer;
FParentZone: TDockZone;
FOrientation: TDockOrientation;
FNextSibling: TDockZone;
//FPrevSibling: TDockZone;
function GetHeight: Integer; function GetHeight: Integer;
function GetLeft: Integer; function GetLeft: Integer;
function GetLimitBegin: Integer; function GetLimitBegin: Integer;
@ -1250,8 +1257,10 @@ type
function GetWidth: Integer; function GetWidth: Integer;
function GetZoneLimit: Integer; function GetZoneLimit: Integer;
procedure SetZoneLimit(const AValue: Integer); procedure SetZoneLimit(const AValue: Integer);
function IsOrientationValid: boolean;
function GetNextVisibleZone: TDockZone;
public public
constructor Create(Tree: TDockTree); constructor Create(TheTree: TDockTree);
procedure ExpandZoneLimit(NewLimit: Integer); procedure ExpandZoneLimit(NewLimit: Integer);
function FirstVisibleChild: TDockZone; function FirstVisibleChild: TDockZone;
function NextVisible: TDockZone; function NextVisible: TDockZone;
@ -1259,7 +1268,8 @@ type
procedure ResetChildren; procedure ResetChildren;
procedure ResetZoneLimits; procedure ResetZoneLimits;
procedure Update; procedure Update;
property ChildCount: Integer read GetChildCount; property Tree: TDockTree read FTree;
property ChildCount: Integer read FChildCount;
property Height: Integer read GetHeight; property Height: Integer read GetHeight;
property Left: Integer read GetLeft; property Left: Integer read GetLeft;
property LimitBegin: Integer read GetLimitBegin; property LimitBegin: Integer read GetLimitBegin;
@ -1830,6 +1840,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $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 Revision 1.146 2003/08/27 11:01:10 mattias
started TDockTree started TDockTree

View File

@ -18,12 +18,6 @@
***************************************************************************** *****************************************************************************
} }
function TDockZone.GetChildCount: Integer;
begin
// ToDo
Result:=0;
end;
function TDockZone.GetHeight: Integer; function TDockZone.GetHeight: Integer;
begin begin
// ToDo // ToDo
@ -37,15 +31,37 @@ begin
end; end;
function TDockZone.GetLimitBegin: Integer; 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 begin
// ToDo if FTree.FTopZone = Self then
Result:=0; 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; end;
function TDockZone.GetLimitSize: Integer; function TDockZone.GetLimitSize: Integer;
var
Zone: TDockZone;
begin begin
// ToDo if FTree.FTopZone = Self then
Result:=0; 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; end;
function TDockZone.GetTop: Integer; function TDockZone.GetTop: Integer;
@ -55,15 +71,33 @@ begin
end; end;
function TDockZone.GetVisible: Boolean; function TDockZone.GetVisible: Boolean;
var
Zone: TDockZone;
begin begin
// ToDo if Assigned(FChildControl) then
Result:=false; 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; end;
function TDockZone.GetVisibleChildCount: Integer; function TDockZone.GetVisibleChildCount: Integer;
var
Zone: TDockZone;
begin begin
// ToDo Result := 0;
Result:=0; Zone := FirstVisibleChild;
while Zone <> nil do begin
Zone := Zone.NextVisible;
Inc(Result);
end;
end; end;
function TDockZone.GetWidth: Integer; function TDockZone.GetWidth: Integer;
@ -74,18 +108,34 @@ end;
function TDockZone.GetZoneLimit: Integer; function TDockZone.GetZoneLimit: Integer;
begin begin
// ToDo if (not Visible) and IsOrientationValid then
Result:=0; // LimitSize will be zero and zone will take up no space
Result := GetLimitBegin
else
Result := FZoneLimit;
end; end;
procedure TDockZone.SetZoneLimit(const AValue: Integer); procedure TDockZone.SetZoneLimit(const AValue: Integer);
begin begin
// ToDo FZoneLimit := AValue;
end; end;
constructor TDockZone.Create(Tree: TDockTree); function TDockZone.IsOrientationValid: boolean;
begin 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; end;
procedure TDockZone.ExpandZoneLimit(NewLimit: Integer); procedure TDockZone.ExpandZoneLimit(NewLimit: Integer);

View File

@ -22,8 +22,7 @@
unit Gtk2Int; unit Gtk2Int;
{$mode objfpc} {$mode objfpc}{$H+}
{$LONGSTRINGS ON}
interface interface
@ -32,9 +31,7 @@ interface
{$endif} {$endif}
uses uses
Classes, SysUtils, InterfaceBase, gdk2pixbuf, gtk2, gdk2, glib2, LMessages, Classes, SysUtils, gdk2pixbuf, gtk2, gdk2, glib2, gtkInt;
Controls, Forms, VclGlobals, LCLLinux, LCLType, gtkDef, DynHashArray,
LazQueue, GraphType, GraphMath, gtkInt;
type type
TGtk2Object = class(TGtkObject) TGtk2Object = class(TGtkObject)
@ -43,16 +40,14 @@ type
implementation implementation
uses
Graphics, Buttons, Menus, GTKWinApiWindow, StdCtrls, ComCtrls, CListBox,
KeyMap, Calendar, Arrow, Spin, CommCtrl, ExtCtrls, Dialogs, FileCtrl,
LResources, Math, gtkglobals, gtkproc, LCLStrConsts;
end. end.
{ {
$Log$ $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 Revision 1.1 2002/12/15 11:52:28 mattias
started gtk2 interface started gtk2 interface
@ -99,6 +94,4 @@ end.
Revision 1.3 2002/10/10 13:29:08 lazarus Revision 1.3 2002/10/10 13:29:08 lazarus
AJ: added LoadStockPixmap routine & minor fixes to/for GNOMEInt AJ: added LoadStockPixmap routine & minor fixes to/for GNOMEInt
} }

View File

@ -2,7 +2,7 @@
<CONFIG> <CONFIG>
<Package> <Package>
<Name Value="GTK2Interface"/> <Name Value="GTK2Interface"/>
<Files Count="2"> <Files Count="3">
<Item1> <Item1>
<Filename Value="interfaces.pas"/> <Filename Value="interfaces.pas"/>
<UnitName Value="Interfaces"/> <UnitName Value="Interfaces"/>
@ -11,6 +11,10 @@
<Filename Value="gtk2int.pas"/> <Filename Value="gtk2int.pas"/>
<UnitName Value="Gtk2Int"/> <UnitName Value="Gtk2Int"/>
</Item2> </Item2>
<Item3>
<Filename Value="../gtk/gtkglobals.pp"/>
<UnitName Value="GTKGlobals"/>
</Item3>
</Files> </Files>
<Type Value="RunAndDesignTime"/> <Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="2"> <RequiredPkgs Count="2">
@ -32,7 +36,7 @@
</Package> </Package>
<CompilerOptions> <CompilerOptions>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value=".;../gtk/;../../units"/> <OtherUnitFiles Value="./;../gtk/;../../units/"/>
<UnitOutputDirectory Value="../../units/gtk2"/> <UnitOutputDirectory Value="../../units/gtk2"/>
<LCLWidgetType Value="gtk"/> <LCLWidgetType Value="gtk"/>
</SearchPaths> </SearchPaths>

View File

@ -350,6 +350,7 @@ type
property LazPackage: TLazPackage read FLazPackage; property LazPackage: TLazPackage read FLazPackage;
end; end;
{ TLazPackageDefineTemplates } { TLazPackageDefineTemplates }
TLazPkgDefineTemplatesFlag = ( TLazPkgDefineTemplatesFlag = (
@ -2926,6 +2927,8 @@ begin
FOutputDir.SetDefineOwner(LazPackage,false); FOutputDir.SetDefineOwner(LazPackage,false);
FOutputDir.SetFlags([dtfAutoGenerated],[],false); FOutputDir.SetFlags([dtfAutoGenerated],[],false);
FMain.AddChild(FOutputDir); FMain.AddChild(FOutputDir);
end else begin
FOutputDir.Value:=LazPackage.GetOutputDirectory;
end; end;
if (FOutPutSrcPath=nil) if (FOutPutSrcPath=nil)