
Is it possible to extend the TImageList component, so it can accept TPicture in addition to TBitmap?
TBitmap is very limited (.BMP and .ICO) and doesn't allow for alpha channel transparency like in .PNG files.
Code: Select all
var ImgList = TImageList.Create(dockForm);
ImgList.ColorDepth = 6;
ImgList.DrawingStyle = 3;
ImgList.SetSize(32, 32);
var B = TBitmap.Create;
B.LoadFromFile("c:\\temp\\account_balances.bmp");
var i = ImgList.Add(B, nil);
delete B;
btnOk.Images = ImgList;
btnOk.ImageIndex = i;
I send you the gulpdock.js file + a video capture of the OnReady problem.Aivars wrote:Yes, please send it, since the gulpdock.js that you sent me earlier doesn't appear to have this problem.
Code: Select all
Edit1.Name = "testing";
Could be, as I calculate the width/height based on the font size, like this:Aivars wrote:I'll add classes required for accessing ImageMargins and ImageAlignment from pluginscripts. Regarding Top/Bottom margin - probably there's odd number of pixels left over.
Code: Select all
Button.Width = PSForm.Canvas.TextWidth(Button.Caption) + Imagelist1.Width + bhPadding + bhPadding;
Button.Height = PSForm.Canvas.TextHeight("Jj") + bvPadding + bvPadding;
I probably could "fix" the margin/alignment issue by creating larger images on the TImageList, to compensate for the margins.Aivars wrote:Regarding wrong offset - there's no trickery, that's the standard TButton as they come. Usually when we want buttons with images we avoid using TButton. TBitBtn looks better (but has issues with image lists). I would recommend using plain-text buttons anyway, they look more modern.