mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-02-19 18:36:42 +01:00
lcl, win32: cleanup
git-svn-id: trunk@26732 -
This commit is contained in:
parent
424162b12c
commit
47c3b8be53
@ -64,22 +64,22 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPopupMenu.PopUp();
|
procedure TPopupMenu.PopUp;
|
||||||
var
|
var
|
||||||
MousePos: TPoint;
|
MousePos: TPoint;
|
||||||
begin
|
begin
|
||||||
GetCursorPos(MousePos);
|
GetCursorPos(MousePos);
|
||||||
PopUp(MousePos.x,MousePos.y);
|
PopUp(MousePos.x, MousePos.y);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPopupMenu.PopUp(X,Y : Integer);
|
procedure TPopupMenu.PopUp(X, Y: Integer);
|
||||||
begin
|
begin
|
||||||
if ActivePopupMenu <> nil then ActivePopupMenu.Close;
|
if ActivePopupMenu <> nil then ActivePopupMenu.Close;
|
||||||
FPopupPoint := Point(X, Y);
|
FPopupPoint := Point(X, Y);
|
||||||
ReleaseCapture;
|
ReleaseCapture;
|
||||||
DoPopup(Self);
|
DoPopup(Self);
|
||||||
if Items.Count=0 then exit;
|
if Items.Count = 0 then exit;
|
||||||
ActivePopupMenu:=Self;
|
ActivePopupMenu := Self;
|
||||||
Items.InitiateActions;
|
Items.InitiateActions;
|
||||||
DestroyHandle;
|
DestroyHandle;
|
||||||
CreateHandle;
|
CreateHandle;
|
||||||
|
|||||||
@ -117,7 +117,6 @@ procedure RedrawMenus;
|
|||||||
function MeasureTextForWnd(const AWindow: HWND; Text: string; var Width, Height: integer): boolean;
|
function MeasureTextForWnd(const AWindow: HWND; Text: string; var Width, Height: integer): boolean;
|
||||||
function MeasureText(const AWinControl: TWinControl; Text: string; var Width, Height: integer): boolean;
|
function MeasureText(const AWinControl: TWinControl; Text: string; var Width, Height: integer): boolean;
|
||||||
function GetControlText(AHandle: HWND): string;
|
function GetControlText(AHandle: HWND): string;
|
||||||
procedure SetMenuFlag(const Menu: HMenu; Flag: Cardinal; Value: boolean);
|
|
||||||
|
|
||||||
procedure FillRawImageDescriptionColors(var ADesc: TRawImageDescription);
|
procedure FillRawImageDescriptionColors(var ADesc: TRawImageDescription);
|
||||||
procedure FillRawImageDescription(const ABitmapInfo: Windows.TBitmap; out ADesc: TRawImageDescription);
|
procedure FillRawImageDescription(const ABitmapInfo: Windows.TBitmap; out ADesc: TRawImageDescription);
|
||||||
@ -1172,35 +1171,6 @@ begin
|
|||||||
ChangedMenus.Clear;
|
ChangedMenus.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
|
||||||
Method: SetMenuFlags
|
|
||||||
Returns: Nothing
|
|
||||||
|
|
||||||
Change the menu flags for handle of TMenuItem or TMenu,
|
|
||||||
added for BidiMode Menus
|
|
||||||
------------------------------------------------------------------------------}
|
|
||||||
procedure SetMenuFlag(const Menu: HMenu; Flag: Cardinal; Value: boolean);
|
|
||||||
var
|
|
||||||
MenuInfo: MENUITEMINFO;
|
|
||||||
MenuItemInfoSize: DWORD;
|
|
||||||
const
|
|
||||||
W95_MENUITEMINFO_SIZE = 44;
|
|
||||||
begin
|
|
||||||
if (Win32MajorVersion = 4) and (Win32MinorVersion = 0) then
|
|
||||||
MenuItemInfoSize := W95_MENUITEMINFO_SIZE
|
|
||||||
else
|
|
||||||
MenuItemInfoSize := sizeof(MENUITEMINFO);
|
|
||||||
FillChar(MenuInfo, SizeOf(MenuInfo), 0);
|
|
||||||
MenuInfo.cbSize := MenuItemInfoSize;
|
|
||||||
MenuInfo.fMask := MIIM_TYPE;
|
|
||||||
GetMenuItemInfo(Menu, 0, True, @MenuInfo);
|
|
||||||
if Value then
|
|
||||||
MenuInfo.fType := MenuInfo.fType or Flag
|
|
||||||
else
|
|
||||||
MenuInfo.fType := MenuInfo.fType and not Flag;
|
|
||||||
SetMenuItemInfo(Menu, 0, True, @MenuInfo);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function MeasureTextForWnd(const AWindow: HWND; Text: string; var Width,
|
function MeasureTextForWnd(const AWindow: HWND; Text: string; var Width,
|
||||||
Height: integer): boolean;
|
Height: integer): boolean;
|
||||||
var
|
var
|
||||||
|
|||||||
@ -1155,9 +1155,9 @@ function ChangeMenuFlag(const AMenuItem: TMenuItem; Flag: Cardinal; Value: boole
|
|||||||
var
|
var
|
||||||
MenuInfo: MENUITEMINFO;
|
MenuInfo: MENUITEMINFO;
|
||||||
begin
|
begin
|
||||||
|
FillChar(MenuInfo, SizeOf(MenuInfo), 0);
|
||||||
MenuInfo.cbSize := menuiteminfosize;
|
MenuInfo.cbSize := menuiteminfosize;
|
||||||
MenuInfo.fMask := MIIM_TYPE;
|
MenuInfo.fMask := MIIM_TYPE;
|
||||||
MenuInfo.dwTypeData := nil; // don't retrieve caption
|
|
||||||
GetMenuItemInfo(AMenuItem.Parent.Handle, AMenuItem.Command, False, @MenuInfo);
|
GetMenuItemInfo(AMenuItem.Parent.Handle, AMenuItem.Command, False, @MenuInfo);
|
||||||
if Value then
|
if Value then
|
||||||
MenuInfo.fType := MenuInfo.fType or Flag
|
MenuInfo.fType := MenuInfo.fType or Flag
|
||||||
@ -1168,6 +1168,28 @@ begin
|
|||||||
TriggerFormUpdate(AMenuItem);
|
TriggerFormUpdate(AMenuItem);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: SetMenuFlag
|
||||||
|
Returns: Nothing
|
||||||
|
|
||||||
|
Change the menu flags for handle of TMenuItem or TMenu,
|
||||||
|
added for BidiMode Menus
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
procedure SetMenuFlag(const Menu: HMenu; Flag: Cardinal; Value: boolean);
|
||||||
|
var
|
||||||
|
MenuInfo: MENUITEMINFO;
|
||||||
|
begin
|
||||||
|
FillChar(MenuInfo, SizeOf(MenuInfo), 0);
|
||||||
|
MenuInfo.cbSize := menuiteminfosize;
|
||||||
|
MenuInfo.fMask := MIIM_TYPE;
|
||||||
|
GetMenuItemInfo(Menu, 0, True, @MenuInfo);
|
||||||
|
if Value then
|
||||||
|
MenuInfo.fType := MenuInfo.fType or Flag
|
||||||
|
else
|
||||||
|
MenuInfo.fType := MenuInfo.fType and not Flag;
|
||||||
|
SetMenuItemInfo(Menu, 0, True, @MenuInfo);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TWin32WSMenuItem }
|
{ TWin32WSMenuItem }
|
||||||
|
|
||||||
procedure UpdateCaption(const AMenuItem: TMenuItem; ACaption: String);
|
procedure UpdateCaption(const AMenuItem: TMenuItem; ACaption: String);
|
||||||
|
|||||||
@ -341,7 +341,7 @@ type
|
|||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure DestroyHandle; virtual;
|
procedure DestroyHandle; virtual;
|
||||||
function FindItem(AValue: PtrInt; Kind: TFindItemKind) : TMenuItem;
|
function FindItem(AValue: PtrInt; Kind: TFindItemKind): TMenuItem;
|
||||||
function GetHelpContext(AValue: PtrInt; ByCommand: Boolean): THelpContext;
|
function GetHelpContext(AValue: PtrInt; ByCommand: Boolean): THelpContext;
|
||||||
function IsShortcut(var Message: TLMKey): boolean;
|
function IsShortcut(var Message: TLMKey): boolean;
|
||||||
function HandleAllocated: Boolean;
|
function HandleAllocated: Boolean;
|
||||||
@ -402,7 +402,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure PopUp();
|
procedure PopUp;
|
||||||
procedure PopUp(X, Y: Integer); virtual;
|
procedure PopUp(X, Y: Integer); virtual;
|
||||||
property PopupComponent: TComponent read FPopupComponent write FPopupComponent;
|
property PopupComponent: TComponent read FPopupComponent write FPopupComponent;
|
||||||
property PopupPoint: TPoint read FPopupPoint;
|
property PopupPoint: TPoint read FPopupPoint;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user