mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 22:36:10 +02:00
started Menu icons for win32 intf from Martin Smat
git-svn-id: trunk@4789 -
This commit is contained in:
parent
f0b04df808
commit
27e1973d80
@ -853,7 +853,7 @@ activate_time : the time at which the activation event occurred.
|
|||||||
End;
|
End;
|
||||||
LM_SETFORMICON:
|
LM_SETFORMICON:
|
||||||
Begin
|
Begin
|
||||||
SetClassLong(Handle, GCL_HIcon, (Sender As TCustomForm).GetIconHandle);
|
SetClassLong(Handle, GCL_HIcon, integer(Data));
|
||||||
End;
|
End;
|
||||||
LM_GETITEMS :
|
LM_GETITEMS :
|
||||||
Begin
|
Begin
|
||||||
@ -1312,6 +1312,7 @@ Begin
|
|||||||
Pixmap := CreatePixmapIndirect(PixmapData, 0);
|
Pixmap := CreatePixmapIndirect(PixmapData, 0);
|
||||||
DrawIcon(DC, TWinControl(Surface).Left, TWinControl(Surface).Top, Pixmap);
|
DrawIcon(DC, TWinControl(Surface).Left, TWinControl(Surface).Top, Pixmap);
|
||||||
ReleaseDC(TWinControl(Surface).Handle, DC);
|
ReleaseDC(TWinControl(Surface).Handle, DC);
|
||||||
|
DeleteObject(Pixmap);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -2765,14 +2766,14 @@ Begin
|
|||||||
cbsize:=sizeof(MENUITEMINFO);
|
cbsize:=sizeof(MENUITEMINFO);
|
||||||
fMask:=Mask;
|
fMask:=Mask;
|
||||||
fType:=Style;
|
fType:=Style;
|
||||||
{fState:=MFS_ENABLED;} {not needed}
|
|
||||||
wID:=TMenuItem(Sender).Command; {value may only be 16 bit wide!}
|
wID:=TMenuItem(Sender).Command; {value may only be 16 bit wide!}
|
||||||
hSubmenu:=MenuHandle;
|
hSubmenu:=MenuHandle;
|
||||||
{hbmpChecked:=0;
|
|
||||||
hbmpUnchecked:=0;} {not needed}
|
|
||||||
dwItemData:=integer(Sender);
|
dwItemData:=integer(Sender);
|
||||||
{dwTypeData:=LPSTR(TMenuItem(Sender).Caption);}
|
if assigned(TmenuItem(Sender).Graphic) then {adds the menuitem icon}
|
||||||
{cch:=length(TMenuItem(Sender).Caption);} {not needed}
|
begin
|
||||||
|
fMask:=fMask or MIIM_CHECKMARKS;
|
||||||
|
hbmpUnchecked:=(TMenuItem(Sender).Graphic as TBitmap).Handle;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
InsertMenuItem(ParentMenuHandle, High(UINT), true, @MenuInfo);
|
InsertMenuItem(ParentMenuHandle, High(UINT), true, @MenuInfo);
|
||||||
if TMenuItem(Sender).ShortCut <> 0 then
|
if TMenuItem(Sender).ShortCut <> 0 then
|
||||||
@ -2806,6 +2807,9 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.127 2003/11/09 10:35:19 mattias
|
||||||
|
started Menu icons for win32 intf from Martin Smat
|
||||||
|
|
||||||
Revision 1.126 2003/11/08 17:41:03 micha
|
Revision 1.126 2003/11/08 17:41:03 micha
|
||||||
compiler warning cleanups
|
compiler warning cleanups
|
||||||
|
|
||||||
|
@ -223,13 +223,11 @@ End;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Function TWin32Object.CheckMenuItem(HndMenu: HMENU; uIDEnableItem: Integer; BChecked: Boolean): Boolean;
|
Function TWin32Object.CheckMenuItem(HndMenu: HMENU; uIDEnableItem: Integer; BChecked: Boolean): Boolean;
|
||||||
var CheckFlag: integer;
|
var CheckFlag: integer;
|
||||||
PrevState: integer;
|
|
||||||
Begin
|
Begin
|
||||||
if BChecked then CheckFlag := MF_CHECKED
|
if BChecked then CheckFlag := MF_CHECKED
|
||||||
else CheckFlag := MF_UNCHECKED;
|
else CheckFlag := MF_UNCHECKED;
|
||||||
CheckFlag := CheckFlag or MF_BYCOMMAND;
|
CheckFlag := CheckFlag or MF_BYCOMMAND;
|
||||||
PrevState := Windows.CheckMenuItem(FMenu, UIDEnableItem, CheckFlag);
|
Result := Windows.CheckMenuItem(FMenu, UIDEnableItem, CheckFlag)=MF_ENABLED;
|
||||||
Result := PrevState = MF_ENABLED;
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -718,6 +716,7 @@ Begin
|
|||||||
CreateColorMap;
|
CreateColorMap;
|
||||||
DoDrawBitmap;
|
DoDrawBitmap;
|
||||||
DestroyColorMap;
|
DestroyColorMap;
|
||||||
|
SelectObject(hdcBitmap, OldObject);
|
||||||
ReleaseDC(GetDesktopWindow, hdcScreen);
|
ReleaseDC(GetDesktopWindow, hdcScreen);
|
||||||
SelectObject(hdcBitmap, OldObject);
|
SelectObject(hdcBitmap, OldObject);
|
||||||
DeleteDC(hdcBitmap);
|
DeleteDC(hdcBitmap);
|
||||||
@ -2534,6 +2533,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.70 2003/11/09 10:35:19 mattias
|
||||||
|
started Menu icons for win32 intf from Martin Smat
|
||||||
|
|
||||||
Revision 1.69 2003/11/08 17:41:03 micha
|
Revision 1.69 2003/11/08 17:41:03 micha
|
||||||
compiler warning cleanups
|
compiler warning cleanups
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user