mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:09:41 +02:00
added TFont.IsEqual
git-svn-id: trunk@8541 -
This commit is contained in:
parent
1f51beb255
commit
1f08229ba5
@ -1,5 +1,3 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TForm1','FORMDATA',[
|
||||
'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#7'Button1'#7'Caption'#6#5'Form1'
|
||||
+#12'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#8'OnCreate'#7#10'FormCreate'
|
||||
|
@ -23,10 +23,10 @@
|
||||
<Loaded Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="wndtray"/>
|
||||
<UsageCount Value="31"/>
|
||||
<UsageCount Value="32"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<CursorPos X="17" Y="19"/>
|
||||
<CursorPos X="13" Y="19"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<Filename Value="frmtest.pas"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
@ -36,7 +36,7 @@
|
||||
<ResourceFilename Value="frmtest.lrs"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="frmtest"/>
|
||||
<UsageCount Value="31"/>
|
||||
<UsageCount Value="32"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
<PublishOptions>
|
||||
|
@ -61,6 +61,7 @@ Resourcestring
|
||||
Procedure ShowMenu(Sender : TObject);
|
||||
|
||||
begin
|
||||
if Sender=nil then ;
|
||||
With TExploreIDEMenuForm.Create(Application) do
|
||||
try
|
||||
ShowModal;
|
||||
@ -72,7 +73,8 @@ end;
|
||||
Procedure Register;
|
||||
|
||||
begin
|
||||
RegisterIDEMenuCommand(itmSecondaryTools,SExploreIDEMEnu,SExploreIDEMenuCaption,Nil,@ShowMenu,Nil);
|
||||
RegisterIDEMenuCommand(itmSecondaryTools,SExploreIDEMEnu,
|
||||
SExploreIDEMenuCaption,Nil,@ShowMenu,Nil);
|
||||
end;
|
||||
|
||||
|
||||
@ -84,6 +86,7 @@ Var
|
||||
I : Integer;
|
||||
|
||||
begin
|
||||
if Sender=nil then ;
|
||||
With TVIDEMenu.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
@ -103,13 +106,16 @@ Var
|
||||
N : TTreeNode;
|
||||
|
||||
begin
|
||||
if Sender=nil then ;
|
||||
if Node=nil then ;
|
||||
N:=TVIDEMenu.Selected;
|
||||
If Assigned(N) and Assigned(N.Data) then
|
||||
With TIDEMenuItem(N.Data) do
|
||||
LPath.Text:=SSelectedPath+GetPath;
|
||||
end;
|
||||
|
||||
procedure TExploreIDEMenuForm.AddMenuItem(ParentNode : TTreeNode;Item : TIDEMenuItem);
|
||||
procedure TExploreIDEMenuForm.AddMenuItem(ParentNode : TTreeNode;
|
||||
Item : TIDEMenuItem);
|
||||
|
||||
Var
|
||||
N : TTreeNode;
|
||||
|
@ -486,6 +486,7 @@ type
|
||||
destructor Destroy; override;
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Assign(const ALogFont: TLogFont);
|
||||
function IsEqual(AFont: TFont): boolean; virtual;
|
||||
procedure BeginUpdate;
|
||||
procedure EndUpdate;
|
||||
function HandleAllocated: boolean;
|
||||
|
@ -2125,6 +2125,7 @@ end;
|
||||
|
||||
procedure TControl.SetFont(Value: TFont);
|
||||
begin
|
||||
if FFont.IsEqual(Value) then exit;
|
||||
FFont.Assign(Value);
|
||||
Invalidate;
|
||||
end;
|
||||
|
@ -611,6 +611,23 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFont.IsEqual(AFont: TFont): boolean;
|
||||
begin
|
||||
if (AFont=Self) then exit(true);
|
||||
if (AFont=nil)
|
||||
or (CharSet<>AFont.CharSet)
|
||||
or (Color<>AFont.Color)
|
||||
or (PixelsPerInch<>AFont.PixelsPerInch)
|
||||
or (Size<>AFont.Size)
|
||||
or (Height<>AFont.Height)
|
||||
or (Name<>AFont.Name)
|
||||
or (Pitch<>AFont.Pitch)
|
||||
or (Style<>AFont.Style) then
|
||||
Result:=false
|
||||
else
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure TFont.BeginUpdate;
|
||||
begin
|
||||
inc(FUpdateCount);
|
||||
|
@ -6506,15 +6506,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function GdkAtomToStr(const Atom: TGdkAtom): string;
|
||||
|
||||
Returns the associated string
|
||||
------------------------------------------------------------------------------}
|
||||
|
||||
|
||||
|
||||
|
||||
procedure SetWidgetColor(aWidget : PGTKwidget; data : gpointer); cdecl;
|
||||
begin
|
||||
gtk_widget_set_style(aWidget,data);
|
||||
@ -6527,24 +6518,25 @@ procedure setWidgetBG(aColor: longint;var aWidget : pGTKWidget);
|
||||
var
|
||||
WindowStyle: PGtkStyle;
|
||||
begin
|
||||
windowStyle:=gtk_widget_get_style(aWidget);
|
||||
windowstyle^.bg[0]:=AllocGDKColor(aColor);
|
||||
SetWidgetColor(aWidget,windowStyle);
|
||||
windowStyle:=gtk_widget_get_style(aWidget);
|
||||
windowstyle^.bg[0]:=AllocGDKColor(aColor);
|
||||
SetWidgetColor(aWidget,windowStyle);
|
||||
end;
|
||||
|
||||
procedure setWidgetFG(aColor: longint;var aWidget : pGTKWidget);
|
||||
var
|
||||
WindowStyle: PGtkStyle;
|
||||
xColor:tGDKColor;
|
||||
|
||||
begin
|
||||
windowStyle:=gtk_widget_get_style(aWidget);
|
||||
windowstyle^.fg[0]:=AllocGDKColor(aColor);
|
||||
SetWidgetColor(aWidget,windowStyle);
|
||||
windowStyle:=gtk_widget_get_style(aWidget);
|
||||
windowstyle^.fg[0]:=AllocGDKColor(aColor);
|
||||
SetWidgetColor(aWidget,windowStyle);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
function GdkAtomToStr(const Atom: TGdkAtom): string;
|
||||
|
||||
Returns the associated string
|
||||
------------------------------------------------------------------------------}
|
||||
function GdkAtomToStr(const Atom: TGdkAtom): string;
|
||||
var
|
||||
p: Pgchar;
|
||||
@ -7559,7 +7551,6 @@ procedure UpdateWidgetStyleOfControl(AWinControl: TWinControl);
|
||||
var
|
||||
RCStyle : PGtkRCStyle;
|
||||
Widget, FixWidget : PGTKWidget;
|
||||
NewColor: TGdkColor;
|
||||
MainWidget: PGtkWidget;
|
||||
FontHandle: HFONT;
|
||||
FreeFontName: boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user