Hello,
For the past two weeks I've been trying to find a way to apply native icons to my TBitmapButtons.
I have been scouring the source code for all of Lazarus' components and have found some relevant functions. However, I don't know how to call these functions.
function GetLCLDefaultBtnGlyph(Kind: TBitBtnKind): TGraphic;
begin
Result := GetDefaultButtonIcon(BitBtnImages[Kind]);
end;
I believe the above function controls the TBitmapButton property "kind" which includes some of the icons that I am talking about. However it does not include other essential button icons such as "Save", "Copy", etc. Thus, the following function has caught my attention a little more:
function GetDefaultButtonIcon(idButton: Integer): TCustomBitmap;
begin
Result := nil;
if (idButton < Low(BitBtnResNames)) or (idButton > High(BitBtnResNames)) then
Exit;
if BitBtnResNames[idButton] = '' then
Exit;
Result := TPortableNetworkGraphic.Create;
Result.LoadFromResourceName(hInstance, BitBtnResNames[idButton]);
end;
Does anybody know how I can assign default system button icons to, for example, a "Save As" button using this function?
Thanks a lot for your help! :)
What I have tried:
I have tried learning about functions, however I don't know how to apply what I have learned in this context.
I have also tried other forums, however, nobody has replied with any Pascal-related solutions; only solutions in other languages such as Java.