Skip to content

Commit c55def5

Browse files
author
Joachim Marder
committed
Fixed issue #29 (After the window handle is recreated the Ribbon is missing).
1 parent 7b35f98 commit c55def5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/UIRibbon.pas

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ TUIRibbon = class(TWinControl, IUIApplication)
195195
procedure SetTextColor(const Value: TColor);
196196
protected
197197
procedure CreateWnd(); override;
198+
procedure DestroyWnd(); override;
198199
procedure AddCommand(const Command: TUICommand);
199200
function GetColor(const PropKey: TUIPropertyKey): TUIHsbColor;
200201
procedure SetColor(const PropKey: TUIPropertyKey; const Value: TUIHsbColor);
@@ -996,9 +997,18 @@ procedure TUIRibbon.Load();
996997
procedure TUIRibbon.CreateWnd;
997998
begin
998999
inherited;
1000+
if csRecreating in ControlState then
1001+
FFramework.Initialize(Parent.Handle, Self);
9991002
Load();
10001003
end;
10011004

1005+
procedure TUIRibbon.DestroyWnd;
1006+
begin
1007+
inherited;
1008+
FFramework.Destroy();
1009+
fLoaded := False;
1010+
end;
1011+
10021012
function TUIRibbon.LoadRibbonSettings(): boolean;
10031013
var
10041014
lSettingsFileFullPath: string;

0 commit comments

Comments
 (0)