{$REGION 'WM_DRAWITEM'}
WM_DRAWITEM:
begin
PDis := Pointer(lP);
case PDis^.CtlType
of
ODT_MENU:
// 1 Ownerdrawn menu
begin
hMenuWnd := WindowFromDC(PDis.HDC);
if (IsWindow(hMenuWnd))
then
begin
if OnTransMenu
then
begin
if ckAeroBlur.GetCheckButtonStatus(ckAeroBlur.Handle)
or ckCrystal.GetCheckButtonStatus(ckCrystal.Handle)
then
if trbGlassOpacity.GetTrackValue(trbGlassOpacity.Handle) >= 128
then
SKAERO_SetLayeredAlpha
(hMenuWnd, trbGlassOpacity.GetTrackValue(trbGlassOpacity.Handle))
else
SKAERO_SetLayeredAlpha(hMenuWnd, 128);
end
else
SKAERO_SetLayeredAlpha(hMenuWnd, 255)
end;
if hSubSkinMenu = PDis.ItemId
then
PDis.ItemId := IDM_Skin;
GDIP_DisposeImage(Img);
GDIP_DisposeImage(ImgItem);
SetBkMode(PDis.HDC, OPAQUE);
Txt := PWideChar(GetMenuTxt(PDis.ItemId, Img, ImgItem, ImgSep));
// Create Graphics
if GDIP_CreateFromHDC(PDis.HDC, Graphics) = 0
then
begin
// DrawButton
if (PDis.itemState
and ODS_SELECTED) <> 0
then
SKAERO_PaintButton(Graphics, 3, ImgItem, 20, PDis.rcItem.Top,
PDis.rcItem.Right, ImgItemHeight, BS_PUSHBUTTON)
else
begin
ImgBack := Cardinal(SKAERO_GetProperty(WinHandle, FORM_Center));
GetClientRect(hMenuWnd, Rect);
GDIP_GetImageSize(ImgBack, imgW, imgH);
GDIP_SetInterpolationMode(Graphics, InterpolationModeHighQualityBicubic);
GDIP_DrawImageRectRectI(Graphics, ImgBack, 20, PDis.rcItem.Top,
Rect.Right, ImgItemHeight, 0, PDis.rcItem.Top * (integer(imgH)
div Rect.Bottom),
imgW, (integer(imgH)
div Rect.Bottom) * ImgItemHeight, 2,
nil, False,
nil);
if (PDis.ItemId = IDM_SeperatorFiles)
or (PDis.ItemId = IDM_SeperatorPList)
or (PDis.ItemId = IDM_SeperatorSkins)
or
(PDis.ItemId = IDM_SeperatorClose)
then
SKAERO_PaintButton(Graphics, 4, ImgItem, 20, PDis.rcItem.Top,
PDis.rcItem.Right, ImgItemHeight, BS_PUSHBUTTON)
end;
// DrawText
GDIP_GetImageSize(Img, imgW, imgH);
if not(PDis.ItemId = IDM_SeperatorFiles)
and not(PDis.ItemId = IDM_SeperatorPList)
and not(PDis.ItemId = IDM_SeperatorSkins)
and not
(PDis.ItemId = IDM_SeperatorClose)
then
begin
PDis.rcItem.Left := 38;
PDis.rcItem.Top := PDis.rcItem.Top + 2;
GDIP_DrawTextToDC(PDis.HDC, Txt, PDis.rcItem, SKAERO_INACTIVECAPTION, PWideChar
(SKAERO_TEXTFONT), SKAERO_PUSHBUTFONTSIZE, FontStyleBoldItalic, 1.1, 0);
end
else
begin
// Allign Text Center
hFDefault := TFont.Create(PDis.hDC);
TxtLen := GetTextWidth(hFDefault, Txt);
PDis.rcItem.Left := ((PDis.rcItem.Right - TxtLen)
div 2) - 6;
PDis.rcItem.Top := PDis.rcItem.Top;
GDIP_DrawTextToDC(PDis.HDC, Txt, PDis.rcItem, SKAERO_ACTIVECAPTION, PWideChar
(SKAERO_TEXTFONT), 13, FontStyleBold, 1.1, 0);
hFDefault.Free;
end;
PDis.rcItem.Left := 0;
case PDis.ItemId
of
IDM_WMPPRESET .. IDM_WMPPRESET_LAST:
begin
newItem := WMPVisPreset[PlgSelectedPreset];
if Txt = newItem
then
begin
imgW := imgW
div 2;
GDIP_DrawImageRectRectI
(Graphics, Img, PDis.rcItem.Left + 23, PDis.rcItem.Top + 2, imgW, imgH,
imgW, 0, imgW, imgH, 2,
nil, False,
nil);
GDIP_DisposeImage(Img);
end
else
begin
if (PDis.ItemId >= IDM_WMPPRESET)
and (PDis.ItemId <= IDM_WMPPRESET_LAST)
then
imgW := imgW
div 2;
GDIP_DrawImageRectRectI
(Graphics, Img, PDis.rcItem.Left + 23, PDis.rcItem.Top + 2, imgW, imgH, 0,
0, imgW, imgH, 2,
nil, False,
nil);
GDIP_DisposeImage(Img);
end;
end;
IDM_AMPMODULE .. IDM_AMPMODULE_LAST:
begin
newItem := AmpVisPreset[PlgSelectedModule];
if Txt = newItem
then
begin
imgW := imgW
div 2;
GDIP_DrawImageRectRectI
(Graphics, Img, PDis.rcItem.Left + 23, PDis.rcItem.Top + 2, imgW, imgH,
imgW, 0, imgW, imgH, 2,
nil, False,
nil);
GDIP_DisposeImage(Img);
end
else
begin
if (PDis.ItemId >= IDM_AMPMODULE)
and (PDis.ItemId <= IDM_AMPMODULE_LAST)
then
imgW := imgW
div 2;
GDIP_DrawImageRectRectI
(Graphics, Img, PDis.rcItem.Left + 23, PDis.rcItem.Top + 2, imgW, imgH, 0,
0, imgW, imgH, 2,
nil, False,
nil);
GDIP_DisposeImage(Img);
end;
end;
IDM_SKINS .. IDM_SKINS_LAST:
begin
newItem := SkinList[ActiveSkin];
if Txt = newItem
then
begin
imgW := imgW
div 2;
GDIP_DrawImageRectRectI
(Graphics, Img, PDis.rcItem.Left + 23, PDis.rcItem.Top + 2, imgW, imgH,
imgW, 0, imgW, imgH, 2,
nil, False,
nil);
GDIP_DisposeImage(Img);
end
else
begin
if (PDis.ItemId >= IDM_SKINS)
and (PDis.ItemId <= IDM_SKINS_LAST)
then
imgW := imgW
div 2;
GDIP_DrawImageRectRectI
(Graphics, Img, PDis.rcItem.Left + 23, PDis.rcItem.Top + 2, imgW, imgH, 0,
0, imgW, imgH, 2,
nil, False,
nil);
GDIP_DisposeImage(Img);
end;
PDis.rcItem.Left := 0;
end;
else
begin
GDIP_GetImageSize(Img, imgW, imgH);
GDIP_DrawImageRectRectI(Graphics, Img, 23, PDis.rcItem.Top,
imgW, imgH, 0, 0, imgW, imgH, 2,
nil, False,
nil);
end;
end;
if (PDis.itemAction
and ODA_DRAWENTIRE) <> 0
then
begin
GetClipBox(PDis.hDC, Rect);
GDIP_FillRect(Graphics, 0, 0, 20, Rect.Bottom, SKAERO_INACTIVECAPTION);
if Rect.Bottom > 100
then
begin
hFDefault := TFont.Create(PDis.hDC);
hFDefault.
Name := SKAERO_TEXTFONT;
hFDefault.Size := 10;
hFDefault.Style := [fsBold, fsUnderline];
hFDefault.Orientation := 900;
hFDefault.Color :=
RGB(255,255,250);
Rect.Bottom := Rect.Bottom + 12;
DrawText(PDis.hDC, '
Sound Machine', length('
Sound Machine'), Rect,
DT_BOTTOM
or DT_LEFT
or DT_SINGLELINE);
hFDefault.Free;
end;
end;
GDIP_DeleteGraphics(Graphics);
end;
Result := 1;
exit;
end;
ODT_LISTBOX:
begin
Result := 1;
exit;
end;
end;
end;
{$ENDREGION}