made New Dialog buttons context sensitive

git-svn-id: trunk@6902 -
This commit is contained in:
mattias 2005-03-05 19:45:22 +00:00
parent 2db9ede5e0
commit ab6d1b24b4
5 changed files with 34 additions and 12 deletions

View File

@ -2946,7 +2946,7 @@ var
for i:=Low(FPCOperatingSystemNames) to High(FPCOperatingSystemNames)
do
if FPCOperatingSystemNames[i]=DirName then begin
if AnsiCompareText(DirName,DefaultTargetOS)=0 then
if CompareText(DirName,DefaultTargetOS)=0 then
inc(DefaultMacroCount);
Result:=copy(Result,1,DirStart-1)+TargetOS+
copy(Result,DirEnd,length(Result)-DirEnd+1);
@ -2959,7 +2959,7 @@ var
to High(FPCOperatingSystemAlternativeNames)
do
if FPCOperatingSystemAlternativeNames[i]=DirName then begin
if AnsiCompareText(DirName,DefaultSrcOS)=0 then
if CompareText(DirName,DefaultSrcOS)=0 then
inc(DefaultMacroCount);
Result:=copy(Result,1,DirStart-1)+SrcOS+
copy(Result,DirEnd,length(Result)-DirEnd+1);
@ -2970,7 +2970,7 @@ var
// replace processor type
for i:=Low(FPCProcessorNames) to High(FPCProcessorNames) do
if FPCProcessorNames[i]=DirName then begin
if AnsiCompareText(DirName,DefaultProcessorName)=0 then
if CompareText(DirName,DefaultProcessorName)=0 then
inc(DefaultMacroCount);
Result:=copy(Result,1,DirStart-1)+TargetProcessor+
copy(Result,DirEnd,length(Result)-DirEnd+1);

View File

@ -133,6 +133,7 @@ type
CancelButton: TButton;
procedure ItemsTreeViewClick(Sender: TObject);
procedure ItemsTreeViewDblClick(Sender: TObject);
procedure ItemsTreeViewSelectionChanged(Sender: TObject);
procedure NewOtherDialogResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject);
private
@ -253,6 +254,12 @@ begin
OkButtonClick(Self);
end;
procedure TNewOtherDialog.ItemsTreeViewSelectionChanged(Sender: TObject);
begin
OkButton.Enabled:=(ItemsTreeView.Selected<>nil)
and (TObject(ItemsTreeView.Selected.Data) is TNewIDEItemTemplate);
end;
procedure TNewOtherDialog.SetupComponents;
begin
ItemsTreeView:=TTreeView.Create(Self);
@ -263,6 +270,7 @@ begin
Top:=5;
OnClick:=@ItemsTreeViewClick;
OnDblClick:=@ItemsTreeViewDblClick;
OnSelectionChanged:=@ItemsTreeViewSelectionChanged;
end;
DescriptionGroupBox:=TGroupBox.Create(Self);
@ -291,6 +299,7 @@ begin
Top:=100;
Caption:=lisLazBuildOk;
OnClick:=@OkButtonClick;
Enabled:=false;
end;
CancelButton:=TButton.Create(Self);
@ -302,6 +311,8 @@ begin
Caption:=dlgCancel;
ModalResult := mrCancel;
end;
DefaultControl:=OkButton;
CancelControl:=CancelButton;
end;

View File

@ -38,7 +38,7 @@ type
{ TNewProjectDialog }
TNewProjectDialog = class(TForm)
TNewProjectDialog = class(TForm)
CreateButton: TButton;
CancelButton: TButton;
ListBox: TListBox;

View File

@ -1825,9 +1825,12 @@ type
property Width: Integer read GetWidth;
property ZoneLimit: Integer read GetZoneLimit write SetZoneLimit;
end;
TDockZoneClass = class of TDockZone;
{ TDockTree - a tree of TDockZones - Every docked window has one tree
This is an abstract class. The real implementation is in ldocktree.pas
Docking means here: Combining several windows to one. A window can here be
a TCustomForm or a floating control (undocked) or a TDockForm.
@ -1854,9 +1857,9 @@ type
|+---+|+----+|
+------------+
If "A" or "B" were floating controls, the floating dock sites are kept ???.
If "A" or "B" were forms, they loose there decorations (title bars and
borders) ???.
If "A" or "B" were floating controls, the floating dock sites are freed.
If "A" or "B" were forms, their decorations (title bars and borders) are
replaced by docked decorations.
If "A" had a TDockTree, it is freed and its child dockzones are merged to
the docktree of "B".
@ -1882,9 +1885,9 @@ type
+-------+
Every DockZone has siblings and childs. Siblings can either be
horizontally (left to right, splitter),
vertically (top to bottom, splitter)
or upon each other (as pages, left to right).
- horizontally (left to right, splitter),
- vertically (top to bottom, splitter)
- or upon each other (as pages, left to right).
}
TForEachZoneProc = procedure(Zone: TDockZone) of object;
@ -1896,10 +1899,13 @@ type
);
TDockTreeFlags = set of TDockTreeFlag;
{ TDockTree }
TDockTree = class(TDockManager)
private
FBorderWidth: Integer;
FDockSite: TWinControl;
FDockZoneClass: TDockZoneClass;
FGrabberSize: Integer;
FGrabbersOnTop: Boolean;
FFlags: TDockTreeFlags;
@ -1930,6 +1936,7 @@ type
constructor Create(TheDockSite: TWinControl); virtual;
destructor Destroy; override;
procedure PaintSite(DC: HDC); override;
property DockZoneClass: TDockZoneClass read FDockZoneClass;
end;
@ -2982,6 +2989,9 @@ end.
{ =============================================================================
$Log$
Revision 1.287 2005/03/05 19:45:22 mattias
made New Dialog buttons context sensitive
Revision 1.286 2005/03/04 17:55:34 micha
fix bug 605: resizing upward or leftward should not move control

View File

@ -120,12 +120,13 @@ constructor TDockTree.Create(TheDockSite: TWinControl);
var
i: Integer;
begin
FDockZoneClass:=TDockZone;
inherited Create;
FBorderWidth:=4;
FDockSite:=TheDockSite;
FGrabberSize:=DefaultDockGrabberSize;
FGrabbersOnTop:=(FDockSite.Align <> alTop) and (FDockSite.Align <> alBottom);
FTopZone:=TDockZone.Create(Self);
FTopZone:=FDockZoneClass.Create(Self);
// insert existing controls into tree
BeginUpdate;
try
@ -145,7 +146,7 @@ end;
procedure TDockTree.PaintSite(DC: HDC);
begin
// TODO
end;
// included by controls.pp