diff --git a/components/trayicon/examples/frmtest.lrs b/components/trayicon/examples/frmtest.lrs index fa309f030e..1000dd717b 100644 --- a/components/trayicon/examples/frmtest.lrs +++ b/components/trayicon/examples/frmtest.lrs @@ -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' diff --git a/components/trayicon/examples/wndtray.lpi b/components/trayicon/examples/wndtray.lpi index 4696686515..62ada3cebf 100644 --- a/components/trayicon/examples/wndtray.lpi +++ b/components/trayicon/examples/wndtray.lpi @@ -23,10 +23,10 @@ - + - + @@ -36,7 +36,7 @@ - + diff --git a/examples/exploremenu/frmexploremenu.pas b/examples/exploremenu/frmexploremenu.pas index 4ef5ac5f7d..3de61be88b 100644 --- a/examples/exploremenu/frmexploremenu.pas +++ b/examples/exploremenu/frmexploremenu.pas @@ -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; diff --git a/lcl/graphics.pp b/lcl/graphics.pp index c54d4a013d..07c9604396 100644 --- a/lcl/graphics.pp +++ b/lcl/graphics.pp @@ -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; diff --git a/lcl/include/control.inc b/lcl/include/control.inc index bfd4800ec7..64de8282c5 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -2125,6 +2125,7 @@ end; procedure TControl.SetFont(Value: TFont); begin + if FFont.IsEqual(Value) then exit; FFont.Assign(Value); Invalidate; end; diff --git a/lcl/include/font.inc b/lcl/include/font.inc index e2d3e0eca0..c714f205a9 100644 --- a/lcl/include/font.inc +++ b/lcl/include/font.inc @@ -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); diff --git a/lcl/interfaces/gtk/gtkproc.inc b/lcl/interfaces/gtk/gtkproc.inc index 189d5e7ca6..c6be0f5d59 100644 --- a/lcl/interfaces/gtk/gtkproc.inc +++ b/lcl/interfaces/gtk/gtkproc.inc @@ -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;