![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Помогите начинающему в некоторых вопросах!
Yurka R © (2006-02-17 21:35:00)1. Как задать ToolBar`у картинки для кнопок, чтоб на них действовало tboTransparent, а то они у меня не прозрачные!
2. Я установил событие OnMouse у Tray`я, и хочу обработать сообщение WM_LBUTTONUP, но ничего не получается
Tray.OnMouse := TOnTrayIconMouse(MakeMethod(Tray, @OnTrayIconMouse));
...
procedure OnTrayIconMouse(Sender: PObj; Message : Word);
begin
case Message of
WM_LBUTTONUP: begin
msgok('Ok');
end;
end;
end;
Yurka R (2006-02-17 22:38:00) [1]Thank you very much Thaddy! :)
Thaddy (2006-02-17 22:20:00) [2]1.
var
Bitmap:Pbitmap;
Imagelist:PImagelist;
try
Bitmap:=newbitmap (14*7,14);
Bitmap.LoadFromFile('d:\program files\borland\kol\fonts.bmp');
Imagelist:=NewImagelist(form);
ImageList.ImgWidth:=16;
ImageList.ImgHeight:=15;
// here's my trick:
ImageList.AddMasked(Bitmap.Handle,bitmap.pixels[0,0]);
//-----------------------------------------^^^^^^^
finally
Bitmap.free;
end;
// set the bitmap
Toolbar.Perform(TB_SETIMAGELIST,0,Form1.ImageList. Handle );
The trick is reading the pixel at 0,0. This is almost always the transparent color.
Maybe someone else can show the same code for MCK version ;)
2.
instead of
procedure OnTrayIconMouse(Sender: PObj; Message : Word);
It should be:
procedure OnTrayIconMouse(Dummy:Pointer;Sender: PObj; Message : Word);
Because it is a procedure of object, which has a hidden pointer to self as first parameter. (See kol.pas!)