TSkinPopUpMenu =
class(TInterfacedObject, ISkinPopUpMenu, ISkinPopUpMenuEx)
private
dwTitle: PWideChar;
dwExStyle: DWORD;
dwStyle: DWORD;
wc: TWndClassEx;
IsInitialized: BOOL;
FHeight: Integer;
FWidth: Integer;
FHPopupWindow: HWND;
FSkinConfigFile: PWideChar;
FUseVistaBlur: BOOL;
FUseVistaCrystal: BOOL;
FGlassOpacity: Integer;
FLeft: Integer;
FTop: Integer;
FPrivateFont: Pointer;
FPrivateFontPath: PWideChar;
FFontName: WideString;
FSideBarCaption: WideString;
FSideBarCaptionLeft: Integer;
FSideBarCaptionTop: Integer;
FSelectedImgPath: WideString;
FFontSize: Integer;
FIcon:
array of TIconType;
FSideBarImgPath: WideString;
FUseSideBar: BOOL;
FItemIconPath: WideString;
FItemHiliteColor: COLORREF;
FItemToolTip: PWideChar;
FItemTextAlligment: TTextAlligment;
FImageStateMax: Integer;
FItemHeight: Integer;
FItemWidth: Integer;
FItemLeft: Integer;
FItemTop: Integer;
FItemShadow: Integer;
FItemTextLeft: Integer;
FItemEnabled: BOOL;
FIconArrowPath: WideString;
FSeperatorImgPath: WideString;
FSubMenuItemCount: Integer;
FClientInstance, FPrevClientProc: TFNWndProc;
FIsSubMenu: BOOL;
imgW, ImgH: Cardinal;
ImgSideBar: Cardinal;
FTrackUser32: Boolean;
FMouseTracking: BOOL;
SideBarWidth: Integer;
ButtonCount: Integer;
SideBarCount: Integer;
SubMenuHandleCount: Integer;
function GetHeight: Integer;
function GetWidth: Integer;
procedure SetHeight(
const Height: Integer);
procedure SetWidth(
const Width: Integer);
function GetHandle: HWND;
function GetSkinConfigFile: PWideChar;
procedure SetSkinConfigFile(
const Value: PWideChar);
function GetUseVistaBlur: BOOL;
function GetUseVistaCrystal: BOOL;
procedure SetUseVistaBlur(
const Value: BOOL);
procedure SetUseVistaCrystal(
const Value: BOOL);
function GetGlassOpacity: Integer;
procedure SetGlassOpacity(
const Value: Integer);
function GetLeft: Integer;
function GetTop: Integer;
procedure SetLeft(
const Value: Integer);
procedure SetTop(
const Value: Integer);
function GetFontName: WideString;
procedure SetFontName(
const Value: WideString);
function GetSideBarCaption: WideString;
function GetSideBarCaptionLeft: Integer;
function GetSideBarCaptionTop: Integer;
procedure SetSideBarCaption(
const Value: WideString);
procedure SetSideBarCaptionLeft(
const Value: Integer);
procedure SetSideBarCaptionTop(
const Value: Integer);
function GetFontSize: Integer;
procedure SetFontSize(
const Value: Integer);
procedure ChangeButtonPicture(ButtonCount: Integer; ImageIcon: WideString; HButton: HWND;
X, Y, W, H: Integer; ArrowIcon: WideString = '
');
function GetHIconFromFile(AFileName: WideString; ASmall: Boolean = false; AIndex: Integer = 0)
: HIcon;
function GetSideBarImgPath: WideString;
procedure SetSideBarImgPath(
const Value: WideString);
function GetUseSideBar: BOOL;
procedure SetUseSideBar(
const Value: BOOL);
function GetSelectedImgPath: WideString;
procedure SetSelectedImgPath(
const Value: WideString);
function GetItemIconPath: WideString;
procedure SetItemIconPath(
const Value: WideString);
function GetItemHiliteColor: COLORREF;
procedure SetItemHiliteColor(
const Value: COLORREF);
function GetItemToolTip: PWideChar;
procedure SetItemToolTip(
const Value: PWideChar);
function GetItemTextAlligment: TTextAlligment;
procedure SetItemTextAlligment(
const Value: TTextAlligment);
function GetImageStateMax: Integer;
procedure SetImageStateMax(
const Value: Integer);
function GetItemHeight: Integer;
procedure SetItemHeight(
const Value: Integer);
function GetItemLeft: Integer;
function GetItemTop: Integer;
function GetItemWidth: Integer;
procedure SetItemLeft(
const Value: Integer);
procedure SetItemTop(
const Value: Integer);
procedure SetItemWidth(
const Value: Integer);
function GetItemShadow: Integer;
procedure SetItemShadow(
const Value: Integer);
function GetItemTextLeft: Integer;
procedure SetItemTextLeft(
const Value: Integer);
function GetItemEnabled: BOOL;
procedure SetItemEnabled(
const Value: BOOL);
function GetIconArrowPath: WideString;
procedure SetIconArrowPath(
const Value: WideString);
function GetSeperatorImgPath: WideString;
procedure SetSeperatorImgPath(
const Value: WideString);
function FuncExported(stFunc, stModul: PWideChar): Boolean;
function GetSubMenuItemCount: Integer;
procedure SetSubMenuItemCount(
const Value: Integer);
function GetIsSubMenu: BOOL;
procedure SetIsSubMenu(
const Value: BOOL);
procedure ClientWndProc(
var Message: TMessage);
procedure SubClass(WinHandle: HWND);
procedure UnSubClass(WinHandle: hWnd);
function GetMouseTracking: BOOL;
procedure SetMouseTracking(
const Value: BOOL);
function GetPrivateFont: Pointer;
procedure SetPrivateFont(
const Value: Pointer);
function GetTrackUser32: BOOL;
procedure SetTrackUser32(
const Value: BOOL);
public
procedure TrackMouse(WinHandle: HWND);
procedure CreatePrivateFont(PrivateFontPath: PWideChar;
var FontName:
string);
function TrackPopupMenu(WinHandle: HWND; Left, Top, Width, Height: Integer): BOOL;
stdcall;
function AddButton(WinHandle: HWND; DlgItemID: Integer; ImagePath: WideString;
ItemIconPath: WideString; Text: PWideChar; Left, Top, Width, Height: Integer;
TextCol: COLORREF; Label3D, ImageStateMax: Integer; TextAlligment: TTextAlligment;
TextLeft: Integer; ItemToolTip: PWideChar; uFlags: UINT; Enabled: BOOL = True;
IconArrowPath: WideString = '
'): HWND;
procedure AddSideBar(WinHandle: HWND; DlgItemID: Integer; ImagePath: WideString;
Left, Top, Width, Height, ImageStateMax: Integer; Enabled, Visible: BOOL);
procedure GetTextWidth(Text: WideString;
var bW: Integer;
var bH: Integer);
function AppendMenu(WinHandle: HWND; uFlags, DlgItemID: UINT; Text: PWideChar): BOOL;
function GetSubMenuHandle: HWND;
property Left: Integer
read GetLeft
write SetLeft;
property Top: Integer
read GetTop
write SetTop;
property Width: Integer
read GetWidth
write SetWidth;
property Height: Integer
read GetHeight
write SetHeight;
property Handle: HWND
read GetHandle;
property GlassOpacity: Integer
read GetGlassOpacity
write SetGlassOpacity;
property UseVistaBlur: BOOL
read GetUseVistaBlur
write SetUseVistaBlur;
property UseVistaCrystal: BOOL
read GetUseVistaCrystal
write SetUseVistaCrystal;
property SkinConfigFile: PWideChar
Read GetSkinConfigFile
write SetSkinConfigFile;
property FontName: WideString
read GetFontName
write SetFontName;
property FontSize: Integer
read GetFontSize
write SetFontSize;
property SelectedImgPath: WideString
read GetSelectedImgPath
write SetSelectedImgPath;
property SeperatorImgPath: WideString
read GetSeperatorImgPath
write SetSeperatorImgPath;
property IconArrowPath: WideString
read GetIconArrowPath
write SetIconArrowPath;
property ItemHiliteColor: COLORREF
read GetItemHiliteColor
write SetItemHiliteColor;
property ItemToolTip: PWideChar
read GetItemToolTip
write SetItemToolTip;
property ItemIconPath: WideString
read GetItemIconPath
write SetItemIconPath;
property ItemTextAlligment: TTextAlligment
read GetItemTextAlligment
write SetItemTextAlligment;
property ItemHeight: Integer
read GetItemHeight
write SetItemHeight;
property ItemWidth: Integer
read GetItemWidth
write SetItemWidth;
property ItemLeft: Integer
read GetItemLeft
write SetItemLeft;
property ItemTop: Integer
read GetItemTop
write SetItemTop;
property ItemShadow: Integer
read GetItemShadow
write SetItemShadow;
property ItemTextLeft: Integer
read GetItemTextLeft
write SetItemTextLeft;
property ItemEnabled: BOOL
read GetItemEnabled
write SetItemEnabled;
property SubMenuItemCount: Integer
read GetSubMenuItemCount
write SetSubMenuItemCount;
property ImageStateMax: Integer
read GetImageStateMax
write SetImageStateMax;
property UseSideBar: BOOL
read GetUseSideBar
write SetUseSideBar;
property SideBarImgPath: WideString
read GetSideBarImgPath
write SetSideBarImgPath;
property SideBarCaption: WideString
read GetSideBarCaption
write SetSideBarCaption;
property SideBarCaptionLeft: Integer
read GetSideBarCaptionLeft
write SetSideBarCaptionLeft;
property SideBarCaptionTop: Integer
read GetSideBarCaptionTop
write SetSideBarCaptionTop;
property IsSubMenu: BOOL
read GetIsSubMenu
write SetIsSubMenu;
property MouseTracking: BOOL
read GetMouseTracking
write SetMouseTracking;
property PrivateFont: Pointer
read GetPrivateFont
write SetPrivateFont;
property TrackUser32: BOOL
read GetTrackUser32
write SetTrackUser32;
function GetWndInfo(WinHandle: HWND;
var WndInfo: TSubMenuWindow): Boolean;
procedure CreateSubMenu(ItemHandle: HWND; Count: Integer);
function SubWindowProc(WinHandle: HWND; Msg: UINT; wP: WParam; lP: LParam): LRESULT;
stdcall;
function CreatePopUpMenu(ParentHandle: HWND): HWND;
destructor Destroy;
override;
constructor Create;
procedure DestroyWindow;
end;