From 8867c27b0f84beb0cadbca9e198cc164bc112f33 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 28 Aug 2003 12:08:30 +0000 Subject: [PATCH] fixed register color prop edit git-svn-id: trunk@4543 - --- .gitattributes | 2 + designer/graphpropedits.pas | 2 +- ide/codetoolsdefines.pas | 20 ++--- ide/codetoolsdefpreview.lfm | 11 +++ ide/codetoolsdefpreview.lrs | 7 ++ ide/codetoolsdefpreview.pas | 151 ++---------------------------------- lcl/forms.pp | 4 +- lcl/include/customform.inc | 5 +- 8 files changed, 44 insertions(+), 158 deletions(-) create mode 100644 ide/codetoolsdefpreview.lfm create mode 100644 ide/codetoolsdefpreview.lrs diff --git a/.gitattributes b/.gitattributes index 0bb5443d09..f6dfe5d40c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -334,6 +334,8 @@ ide/codeexplorer.pas svneol=native#text/pascal ide/codetemplatedialog.pp svneol=native#text/pascal ide/codetoolsdefines.lrs svneol=native#text/pascal ide/codetoolsdefines.pas svneol=native#text/pascal +ide/codetoolsdefpreview.lfm svneol=native#text/plain +ide/codetoolsdefpreview.lrs svneol=native#text/pascal ide/codetoolsdefpreview.pas svneol=native#text/pascal ide/codetoolsoptions.pas svneol=native#text/pascal ide/compiler.pp svneol=native#text/pascal diff --git a/designer/graphpropedits.pas b/designer/graphpropedits.pas index be959f5cad..e97971fd47 100644 --- a/designer/graphpropedits.pas +++ b/designer/graphpropedits.pas @@ -836,7 +836,7 @@ initialization // Normally it should use something like this; // RegisterPropertyEditor(TypeInfo(TColor),nil,'',TColorPropertyEditor); DummyClassForPropTypes:=TDummyClassForGraphPropTypes.Create; - RegisterPropertyEditor(DummyClassForPropTypes.PTypeInfos('TColor'), + RegisterPropertyEditor(DummyClassForPropTypes.PTypeInfos('TGraphicsColor'), nil,'',TColorPropertyEditor); RegisterPropertyEditor(DummyClassForPropTypes.PTypeInfos('TBrushStyle'), nil,'',TBrushStylePropertyEditor); diff --git a/ide/codetoolsdefines.pas b/ide/codetoolsdefines.pas index e01a50154a..d179f1caab 100644 --- a/ide/codetoolsdefines.pas +++ b/ide/codetoolsdefines.pas @@ -148,7 +148,7 @@ type InsertFilePathBitBtn: TBitBtn; // preview - DefinePreview: TCodeToolsDefinesPreview; + //DefinePreview: TCodeToolsDefinesPreview; // misc procedure FormResize(Sender: TObject); @@ -581,13 +581,13 @@ end; procedure TCodeToolsDefinesEditor.OpenPreviewMenuItemClick(Sender: TObject); begin - if DefinePreview=nil then begin - DefinePreview:=TCodeToolsDefinesPreview.Create(Self); - DefinePreview.DefineTree:=DefineTree; - DefinePreview.Show; - end; - RefreshPreview; - BringWindowToTop(DefinePreview.Handle); + //if DefinePreview=nil then begin + // DefinePreview:=TCodeToolsDefinesPreview.Create(Self); + // DefinePreview.DefineTree:=DefineTree; + // DefinePreview.Show; + //end; + //RefreshPreview; + //BringWindowToTop(DefinePreview.Handle); end; procedure TCodeToolsDefinesEditor.InsertFPCProjectDefinesTemplateMenuItemClick( @@ -959,8 +959,8 @@ end; procedure TCodeToolsDefinesEditor.RefreshPreview; begin - if DefinePreview=nil then exit; - DefinePreview.ShowDefines; + //if DefinePreview=nil then exit; + //DefinePreview.ShowDefines; end; procedure TCodeToolsDefinesEditor.CreateComponents; diff --git a/ide/codetoolsdefpreview.lfm b/ide/codetoolsdefpreview.lfm new file mode 100644 index 0000000000..c1ea4e459f --- /dev/null +++ b/ide/codetoolsdefpreview.lfm @@ -0,0 +1,11 @@ +object Form2: TForm2 + CAPTION = 'Form2' + CLIENTHEIGHT = 451 + CLIENTWIDTH = 463 + HORZSCROLLBAR.PAGE = 464 + VERTSCROLLBAR.PAGE = 452 + LEFT = 423 + HEIGHT = 451 + TOP = 228 + WIDTH = 463 +end diff --git a/ide/codetoolsdefpreview.lrs b/ide/codetoolsdefpreview.lrs new file mode 100644 index 0000000000..dead7ed19b --- /dev/null +++ b/ide/codetoolsdefpreview.lrs @@ -0,0 +1,7 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TForm2','FORMDATA',[ + 'TPF0'#6'TForm2'#5'Form2'#7'CAPTION'#6#5'Form2'#12'CLIENTHEIGHT'#3#195#1#11'C' + +'LIENTWIDTH'#3#207#1#18'HORZSCROLLBAR.PAGE'#3#208#1#18'VERTSCROLLBAR.PAGE'#3 + +#196#1#4'LEFT'#3#167#1#6'HEIGHT'#3#195#1#3'TOP'#3#228#0#5'WIDTH'#3#207#1#0#0 +]); diff --git a/ide/codetoolsdefpreview.pas b/ide/codetoolsdefpreview.pas index a5493a05a3..def15ad981 100644 --- a/ide/codetoolsdefpreview.pas +++ b/ide/codetoolsdefpreview.pas @@ -1,37 +1,3 @@ -{ /*************************************************************************** - codetoolsdefpreview.pas - Lazarus IDE unit - -------------------------------------------- - - ***************************************************************************/ - - *************************************************************************** - * * - * This source is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This code is distributed in the hope that it will be useful, but * - * WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * General Public License for more details. * - * * - * A copy of the GNU General Public License is available on the World * - * Wide Web at . You can also * - * obtain it by writing to the Free Software Foundation, * - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - *************************************************************************** - - Author: Mattias Gaertner - - Abstract: - - TCodeToolsDefinesPreview is a preview for the defines of a single - directory, used by TCodeToolsDefinesEditor. - - Not complete. - -} unit CodeToolsDefPreview; {$mode objfpc}{$H+} @@ -39,124 +5,21 @@ unit CodeToolsDefPreview; interface uses - Classes, SysUtils, LCLLinux, Forms, Controls, Buttons, StdCtrls, ComCtrls, - ExtCtrls, Menus, LResources, Graphics, Dialogs, ImgList, SynEdit, - LazarusIDEStrConsts, ExprEval, DefineTemplates; + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs; type - TCodeToolsDefinesPreview = class(TForm) - DirectoryLabel: TLabel; - DirectoryEdit: TEdit; - DefListBox: TListBox; - - // misc - procedure FormResize(Sender: TObject); + TForm2 = class(TForm) private - FDefineTree: TDefineTree; - procedure CreateComponents; public - constructor Create(TheOwner: TComponent); override; - destructor Destroy; override; - procedure ShowDefines; - property DefineTree: TDefineTree read FDefineTree write FDefineTree; end; +var + Form2: TForm2; + implementation - -{ TCodeToolsDefinesPreview } - -procedure TCodeToolsDefinesPreview.FormResize(Sender: TObject); -var MaxX, MaxY: integer; -begin - MaxX:=ClientWidth-2; - MaxY:=ClientHeight-2; - - DirectoryLabel.SetBounds(5,3,150,DirectoryLabel.Height); - - with DirectoryEdit do begin - Left:=0; - Top:=DirectoryLabel.Top+DirectoryLabel.Height+2; - Width:=MaxX; - end; - - with DefListBox do begin - Left:=0; - Top:=DirectoryEdit.Top+DirectoryEdit.Height+3; - Width:=MaxX; - Height:=MaxY-Top; - end; -end; - -procedure TCodeToolsDefinesPreview.CreateComponents; -begin - DirectoryLabel:=TLabel.Create(Self); - with DirectoryLabel do begin - Name:='DirectoryLabel'; - Parent:=Self; - Visible:=true; - end; - - DirectoryEdit:=TEdit.Create(Self); - with DirectoryEdit do begin - Name:='DirectoryEdit'; - Parent:=Self; - Visible:=true; - end; - - DefListBox:=TListBox.Create(Self); - with DefListBox do begin - Name:='DefListBox'; - Parent:=Self; - Visible:=true; - end; -end; - -constructor TCodeToolsDefinesPreview.Create(TheOwner: TComponent); -begin - inherited Create(TheOwner); - if LazarusResources.Find(ClassName)=nil then begin - SetBounds((Screen.Width-400) div 2,(Screen.Height-400) div 2, 420, 420); - Caption:=lisCodeToolsDefsCodeToolsDefinesPreview; - OnResize:=@FormResize; - - CreateComponents; - end; - Resize; -end; - -destructor TCodeToolsDefinesPreview.Destroy; -begin - - inherited Destroy; -end; - -procedure TCodeToolsDefinesPreview.ShowDefines; -var - ExprEval: TExpressionEvaluator; - i: integer; -begin - DefListBox.Items.BeginUpdate; - if DefineTree<>nil then begin - DefineTree.ClearCache; - ExprEval:=DefineTree.GetDefinesForDirectory(DirectoryLabel.Text,false); - if ExprEval<>nil then begin - for i:=0 to ExprEval.Count-1 do begin - if iExprEval.Count do - // delete old value - DefListBox.Items.Delete(DefListBox.Items.Count-1); - end else - DefListBox.Items.Clear; - end; - DefListBox.Items.EndUpdate; -end; +initialization + {$I codetoolsdefpreview.lrs} end. diff --git a/lcl/forms.pp b/lcl/forms.pp index 0d420452a7..053c38ae41 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -481,7 +481,7 @@ type TForm = class(TCustomForm) private FClientHandle: HWND; - FDummyPPI : longint; + FDummyPPI: longint; public property ClientHandle: HWND read FClientHandle; published @@ -492,7 +492,7 @@ type property Caption; property ClientHeight; property ClientWidth; - property Color; + property Color default clBtnFace; property Constraints; property Enabled; property Font; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 4a14d1744f..fc5fb75e35 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -991,7 +991,7 @@ Begin // FInCMParentBiDiModeChanged := False; {apply a drawing surface} FKeyPreview := False; - Color := clBtnface; + Color := clBtnFace; // FPixelsPerInch := Screen.PixelsPerInch; // FPrintScale := poProportional; // FloatingDockSiteClass := TWinControlClass(ClassType); @@ -1426,6 +1426,9 @@ end; { ============================================================================= $Log$ + Revision 1.111 2003/08/28 12:08:30 mattias + fixed register color prop edit + Revision 1.110 2003/08/27 09:20:44 mattias added TFrame definition, no implementation