diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index f6b61f7a37..e3bdd76f21 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -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); diff --git a/ide/newdialog.pas b/ide/newdialog.pas index fd0c8d32cd..7641bb92ea 100644 --- a/ide/newdialog.pas +++ b/ide/newdialog.pas @@ -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; diff --git a/ide/newprojectdlg.pp b/ide/newprojectdlg.pp index 16625eff50..e112b9c093 100644 --- a/ide/newprojectdlg.pp +++ b/ide/newprojectdlg.pp @@ -38,7 +38,7 @@ type { TNewProjectDialog } -TNewProjectDialog = class(TForm) + TNewProjectDialog = class(TForm) CreateButton: TButton; CancelButton: TButton; ListBox: TListBox; diff --git a/lcl/controls.pp b/lcl/controls.pp index 224bec493f..e8ec1d3afd 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -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 diff --git a/lcl/include/docktree.inc b/lcl/include/docktree.inc index 52b4995ad3..dd232937d3 100644 --- a/lcl/include/docktree.inc +++ b/lcl/include/docktree.inc @@ -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