From: Andreas H. <ah...@us...> - 2005-05-11 23:39:22
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19359/run Modified Files: JvTabBar.pas Log Message: Fixed "only one assigned tabbar gets repainted on painter.Changed" Index: JvTabBar.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvTabBar.pas,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** JvTabBar.pas 11 May 2005 23:20:45 -0000 1.28 --- JvTabBar.pas 11 May 2005 23:39:07 -0000 1.29 *************** *** 38,42 **** System.Windows.Forms, System.Drawing, Borland.Vcl.Windows, Borland.Vcl.Messages, Borland.Vcl.SysUtils, ! Borland.Vcl.Classes, Borland.Vcl.Types, Jedi.WinForms.Vcl.Graphics, Jedi.WinForms.Vcl.Controls, Jedi.WinForms.Vcl.Forms, Jedi.WinForms.Vcl.ImgList, Jedi.WinForms.Vcl.Menus, --- 38,42 ---- System.Windows.Forms, System.Drawing, Borland.Vcl.Windows, Borland.Vcl.Messages, Borland.Vcl.SysUtils, ! Borland.Vcl.Classes, Borland.Vcl.Types, Borland.Vcl.Contnrs, Jedi.WinForms.Vcl.Graphics, Jedi.WinForms.Vcl.Controls, Jedi.WinForms.Vcl.Forms, Jedi.WinForms.Vcl.ImgList, Jedi.WinForms.Vcl.Menus, *************** *** 52,56 **** Types, Qt, QTypes, QGraphics, QControls, QForms, QImgList, QMenus, QButtons, {$ENDIF VisualCLX} ! SysUtils, Classes; {$ENDIF WINFORMS} --- 52,56 ---- Types, Qt, QTypes, QGraphics, QControls, QForms, QImgList, QMenus, QButtons, {$ENDIF VisualCLX} ! SysUtils, Classes, Contnrs; {$ENDIF WINFORMS} *************** *** 177,181 **** TJvTabBarPainter = class(TComponent) private ! FOnChange: TNotifyEvent; protected procedure Changed; virtual; --- 177,181 ---- TJvTabBarPainter = class(TComponent) private ! FOnChangeList: TList; protected procedure Changed; virtual; *************** *** 193,196 **** --- 193,199 ---- State: TJvTabBarScrollButtonState; R: TRect); virtual; procedure GetScrollButtons(TabBar: TJvCustomTabBar; var LeftButton, RightButton: TRect); {virtual; reserved for future use } + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; end; *************** *** 659,663 **** if Assigned(FPainter) then begin ! FPainter.FOnChange := nil; FPainter.RemoveFreeNotification(Self); end; --- 662,666 ---- if Assigned(FPainter) then begin ! FPainter.FOnChangeList.Extract(Self); FPainter.RemoveFreeNotification(Self); end; *************** *** 667,671 **** FreeAndNil(FDefaultPainter); FPainter.FreeNotification(Self); ! FPainter.FOnChange := ImagesChanged; end; --- 670,674 ---- FreeAndNil(FDefaultPainter); FPainter.FreeNotification(Self); ! FPainter.FOnChangeList.Add(Self); end; *************** *** 1829,1836 **** //=== { TJvTabBarPainter } =================================================== procedure TJvTabBarPainter.Changed; begin ! if Assigned(FOnChange) then ! FOnChange(Self); end; --- 1832,1853 ---- //=== { TJvTabBarPainter } =================================================== + constructor TJvTabBarPainter.Create(AOwner: TComponent); + begin + inherited Create(AOwner); + FOnChangeList := TList.Create; + end; + + destructor TJvTabBarPainter.Destroy; + begin + FOnChangeList.Free; + inherited Destroy; + end; + procedure TJvTabBarPainter.Changed; + var + i: Integer; begin ! for i := 0 to FOnChangeList.Count - 1 do ! TJvCustomTabBar(FOnChangeList[i]).ImagesChanged(Self); end; |