mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 22:40:15 +02:00
fixed register color prop edit
git-svn-id: trunk@4543 -
This commit is contained in:
parent
3a6dd972da
commit
8867c27b0f
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -334,6 +334,8 @@ ide/codeexplorer.pas svneol=native#text/pascal
|
|||||||
ide/codetemplatedialog.pp svneol=native#text/pascal
|
ide/codetemplatedialog.pp svneol=native#text/pascal
|
||||||
ide/codetoolsdefines.lrs svneol=native#text/pascal
|
ide/codetoolsdefines.lrs svneol=native#text/pascal
|
||||||
ide/codetoolsdefines.pas 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/codetoolsdefpreview.pas svneol=native#text/pascal
|
||||||
ide/codetoolsoptions.pas svneol=native#text/pascal
|
ide/codetoolsoptions.pas svneol=native#text/pascal
|
||||||
ide/compiler.pp svneol=native#text/pascal
|
ide/compiler.pp svneol=native#text/pascal
|
||||||
|
@ -836,7 +836,7 @@ initialization
|
|||||||
// Normally it should use something like this;
|
// Normally it should use something like this;
|
||||||
// RegisterPropertyEditor(TypeInfo(TColor),nil,'',TColorPropertyEditor);
|
// RegisterPropertyEditor(TypeInfo(TColor),nil,'',TColorPropertyEditor);
|
||||||
DummyClassForPropTypes:=TDummyClassForGraphPropTypes.Create;
|
DummyClassForPropTypes:=TDummyClassForGraphPropTypes.Create;
|
||||||
RegisterPropertyEditor(DummyClassForPropTypes.PTypeInfos('TColor'),
|
RegisterPropertyEditor(DummyClassForPropTypes.PTypeInfos('TGraphicsColor'),
|
||||||
nil,'',TColorPropertyEditor);
|
nil,'',TColorPropertyEditor);
|
||||||
RegisterPropertyEditor(DummyClassForPropTypes.PTypeInfos('TBrushStyle'),
|
RegisterPropertyEditor(DummyClassForPropTypes.PTypeInfos('TBrushStyle'),
|
||||||
nil,'',TBrushStylePropertyEditor);
|
nil,'',TBrushStylePropertyEditor);
|
||||||
|
@ -148,7 +148,7 @@ type
|
|||||||
InsertFilePathBitBtn: TBitBtn;
|
InsertFilePathBitBtn: TBitBtn;
|
||||||
|
|
||||||
// preview
|
// preview
|
||||||
DefinePreview: TCodeToolsDefinesPreview;
|
//DefinePreview: TCodeToolsDefinesPreview;
|
||||||
|
|
||||||
// misc
|
// misc
|
||||||
procedure FormResize(Sender: TObject);
|
procedure FormResize(Sender: TObject);
|
||||||
@ -581,13 +581,13 @@ end;
|
|||||||
|
|
||||||
procedure TCodeToolsDefinesEditor.OpenPreviewMenuItemClick(Sender: TObject);
|
procedure TCodeToolsDefinesEditor.OpenPreviewMenuItemClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if DefinePreview=nil then begin
|
//if DefinePreview=nil then begin
|
||||||
DefinePreview:=TCodeToolsDefinesPreview.Create(Self);
|
// DefinePreview:=TCodeToolsDefinesPreview.Create(Self);
|
||||||
DefinePreview.DefineTree:=DefineTree;
|
// DefinePreview.DefineTree:=DefineTree;
|
||||||
DefinePreview.Show;
|
// DefinePreview.Show;
|
||||||
end;
|
//end;
|
||||||
RefreshPreview;
|
//RefreshPreview;
|
||||||
BringWindowToTop(DefinePreview.Handle);
|
//BringWindowToTop(DefinePreview.Handle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeToolsDefinesEditor.InsertFPCProjectDefinesTemplateMenuItemClick(
|
procedure TCodeToolsDefinesEditor.InsertFPCProjectDefinesTemplateMenuItemClick(
|
||||||
@ -959,8 +959,8 @@ end;
|
|||||||
|
|
||||||
procedure TCodeToolsDefinesEditor.RefreshPreview;
|
procedure TCodeToolsDefinesEditor.RefreshPreview;
|
||||||
begin
|
begin
|
||||||
if DefinePreview=nil then exit;
|
//if DefinePreview=nil then exit;
|
||||||
DefinePreview.ShowDefines;
|
//DefinePreview.ShowDefines;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeToolsDefinesEditor.CreateComponents;
|
procedure TCodeToolsDefinesEditor.CreateComponents;
|
||||||
|
11
ide/codetoolsdefpreview.lfm
Normal file
11
ide/codetoolsdefpreview.lfm
Normal file
@ -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
|
7
ide/codetoolsdefpreview.lrs
Normal file
7
ide/codetoolsdefpreview.lrs
Normal file
@ -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
|
||||||
|
]);
|
@ -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 <http://www.gnu.org/copyleft/gpl.html>. 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;
|
unit CodeToolsDefPreview;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
@ -39,124 +5,21 @@ unit CodeToolsDefPreview;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLLinux, Forms, Controls, Buttons, StdCtrls, ComCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs;
|
||||||
ExtCtrls, Menus, LResources, Graphics, Dialogs, ImgList, SynEdit,
|
|
||||||
LazarusIDEStrConsts, ExprEval, DefineTemplates;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TCodeToolsDefinesPreview = class(TForm)
|
TForm2 = class(TForm)
|
||||||
DirectoryLabel: TLabel;
|
|
||||||
DirectoryEdit: TEdit;
|
|
||||||
DefListBox: TListBox;
|
|
||||||
|
|
||||||
// misc
|
|
||||||
procedure FormResize(Sender: TObject);
|
|
||||||
private
|
private
|
||||||
FDefineTree: TDefineTree;
|
|
||||||
procedure CreateComponents;
|
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
|
||||||
destructor Destroy; override;
|
|
||||||
procedure ShowDefines;
|
|
||||||
property DefineTree: TDefineTree read FDefineTree write FDefineTree;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form2: TForm2;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
initialization
|
||||||
{ TCodeToolsDefinesPreview }
|
{$I codetoolsdefpreview.lrs}
|
||||||
|
|
||||||
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 i<DefListBox.Items.Count then
|
|
||||||
// replace old value
|
|
||||||
DefListBox.Items[i]:=ExprEval.Items(i)
|
|
||||||
else
|
|
||||||
// add value
|
|
||||||
DefListBox.Items.Add(ExprEval.Items(i));
|
|
||||||
end;
|
|
||||||
while DefListBox.Items.Count>ExprEval.Count do
|
|
||||||
// delete old value
|
|
||||||
DefListBox.Items.Delete(DefListBox.Items.Count-1);
|
|
||||||
end else
|
|
||||||
DefListBox.Items.Clear;
|
|
||||||
end;
|
|
||||||
DefListBox.Items.EndUpdate;
|
|
||||||
end;
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ type
|
|||||||
property Caption;
|
property Caption;
|
||||||
property ClientHeight;
|
property ClientHeight;
|
||||||
property ClientWidth;
|
property ClientWidth;
|
||||||
property Color;
|
property Color default clBtnFace;
|
||||||
property Constraints;
|
property Constraints;
|
||||||
property Enabled;
|
property Enabled;
|
||||||
property Font;
|
property Font;
|
||||||
|
@ -991,7 +991,7 @@ Begin
|
|||||||
// FInCMParentBiDiModeChanged := False;
|
// FInCMParentBiDiModeChanged := False;
|
||||||
{apply a drawing surface}
|
{apply a drawing surface}
|
||||||
FKeyPreview := False;
|
FKeyPreview := False;
|
||||||
Color := clBtnface;
|
Color := clBtnFace;
|
||||||
// FPixelsPerInch := Screen.PixelsPerInch;
|
// FPixelsPerInch := Screen.PixelsPerInch;
|
||||||
// FPrintScale := poProportional;
|
// FPrintScale := poProportional;
|
||||||
// FloatingDockSiteClass := TWinControlClass(ClassType);
|
// FloatingDockSiteClass := TWinControlClass(ClassType);
|
||||||
@ -1426,6 +1426,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.110 2003/08/27 09:20:44 mattias
|
||||||
added TFrame definition, no implementation
|
added TFrame definition, no implementation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user