Skip to content

Commit f2971c0

Browse files
author
joachim.marder
committed
* ResourceInstance must be THandle, it does not make sense to store a handle in a DFM, so stored is False now
* Minor tweaks
1 parent 9005f2f commit f2971c0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Lib/UIRibbon.pas

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ TUIRibbon = class(TWinControl, IUIApplication)
9898
FFramework: IUIFramework;
9999
FRibbon: IUIRibbon;
100100
FResourceName: String;
101-
FResourceInstance: Integer;
101+
FResourceInstance: THandle;
102102
FCommands: TObjectDictionary<Cardinal, TUICommand>;
103103
FAvailable: Boolean;
104104
FOnCommandCreate: TUIRibbomCommandEvent;
@@ -333,7 +333,7 @@ TUIRibbon = class(TWinControl, IUIApplication)
333333
/// </summary>
334334
/// <param name="pAction"></param>
335335
/// <returns>TUICommand</returns>
336-
function GetCommand(pAction: TCustomAction): TUICommand; overload;
336+
function GetCommand(pAction: TCustomAction): TUICommand;
337337

338338
/// <summary>
339339
/// Sets the "Recent items" list in the application menu.
@@ -412,7 +412,7 @@ TUIRibbon = class(TWinControl, IUIApplication)
412412
{ The name of the Ribbon resource as it is stored in the resource file. }
413413
property ResourceName: String read FResourceName write FResourceName;
414414
{ The module instance from which to load the Ribbon resource. }
415-
property ResourceInstance: Integer read FResourceInstance write FResourceInstance;
415+
property ResourceInstance: THandle read FResourceInstance write FResourceInstance stored False;
416416

417417
/// <summary>
418418
/// Filename of the XML settings file that is used to store ribbon specific
@@ -492,6 +492,7 @@ function TRibbonMarkupElementList.TryGetItem(pID: integer; out pItem: TRibbonMar
492492
pItem := lElement;
493493
Exit(true);
494494
end;
495+
pItem := TRibbonMarkupElement.Create('', 0);
495496
Exit(false);
496497
end;
497498

@@ -949,7 +950,7 @@ function TUIRibbon.LoadRibbonSettings(): boolean;
949950
exit(false);
950951
// Otherwise, try to load the file.
951952
Result := Self.LoadSettings(lSettingsFileFullPath);
952-
Assert(Result, 'Loading ribbon settings failed with unknown error.');
953+
Assert(Result, 'Loading ribbon settings failed with unknown error. File: ' + lSettingsFileFullPath);
953954
end;
954955

955956
function TUIRibbon.LoadSettings(const Stream: TStream): Boolean;
@@ -1014,6 +1015,7 @@ function TUIRibbon.OnCreateUICommand(CommandId: UInt32; TypeId: _UICommandType;
10141015
Command := CommandClass.Create(Self, CommandId);
10151016
DoCommandCreated(Command);
10161017
end;
1018+
10171019
CommandHandler := Command;
10181020
TUICommandAccess(Command).Alive := True;
10191021
Result := S_OK;

0 commit comments

Comments
 (0)