mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-24 07:19:34 +01:00
Fixes menu handler deleting
git-svn-id: trunk@26990 -
This commit is contained in:
parent
015175889d
commit
0af3b0c7d5
@ -278,8 +278,11 @@ Var
|
|||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
// DbgAppendToFile(ExtractFilePath(ParamStr(0)) + '1.log',
|
{$ifdef VerboseWinCEMenu}
|
||||||
// 'MenuClickResponse: ' + IntToStr(PtrInt(Result)));
|
if Result <> nil then
|
||||||
|
DebugLn(Format('[wincecallback] GetMenuItemObject found menu item %s caption %s',
|
||||||
|
[TMenuItem(Result).Name, TMenuItem(Result).Caption]));
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetIsNativeControl(AWindow: HWND): Boolean;
|
function GetIsNativeControl(AWindow: HWND): Boolean;
|
||||||
@ -1122,6 +1125,9 @@ begin
|
|||||||
|
|
||||||
if Hi(WParam) < 2 then //1 for accelerator 0 for menu
|
if Hi(WParam) < 2 then //1 for accelerator 0 for menu
|
||||||
begin
|
begin
|
||||||
|
{$ifdef VerboseWinCEMenu}
|
||||||
|
DebugLn('[wincecallback] Hi(WParam) < 2');
|
||||||
|
{$endif}
|
||||||
TargetObject := GetMenuItemObject();
|
TargetObject := GetMenuItemObject();
|
||||||
end
|
end
|
||||||
else // menuitem or shortcut
|
else // menuitem or shortcut
|
||||||
@ -1131,6 +1137,10 @@ begin
|
|||||||
|
|
||||||
if TargetObject is TMenuItem then
|
if TargetObject is TMenuItem then
|
||||||
begin
|
begin
|
||||||
|
{$ifdef VerboseWinCEMenu}
|
||||||
|
DebugLn('[wincecallback] Sending menuitem Click');
|
||||||
|
{$endif}
|
||||||
|
|
||||||
LMessage.Msg := LM_ACTIVATE;
|
LMessage.Msg := LM_ACTIVATE;
|
||||||
TargetObject.Dispatch(LMessage);
|
TargetObject.Dispatch(LMessage);
|
||||||
lWinControl := nil;
|
lWinControl := nil;
|
||||||
|
|||||||
@ -166,11 +166,25 @@ begin
|
|||||||
mbi.hwndMB := 0;
|
mbi.hwndMB := 0;
|
||||||
end;}
|
end;}
|
||||||
|
|
||||||
|
{$ifdef VerboseWinCEMenu}
|
||||||
|
DebugLn('[CeSetMenu] MenuItemsList.Text ' + MenuItemsList.Text);
|
||||||
|
{$endif}
|
||||||
// Remove previously installed top-level menu click handlers
|
// Remove previously installed top-level menu click handlers
|
||||||
|
MenuItemsList.Sort;
|
||||||
while MenuItemsList.Find('1001', lIndex) do
|
while MenuItemsList.Find('1001', lIndex) do
|
||||||
|
begin
|
||||||
MenuItemsList.Delete(lIndex);
|
MenuItemsList.Delete(lIndex);
|
||||||
|
{$ifdef VerboseWinCEMenu}
|
||||||
|
DebugLn(Format('[CeSetMenu] MenuItemsList.Delete 1001 Index %d', [lIndex]));
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
while MenuItemsList.Find('1002', lIndex) do
|
while MenuItemsList.Find('1002', lIndex) do
|
||||||
|
begin
|
||||||
MenuItemsList.Delete(lIndex);
|
MenuItemsList.Delete(lIndex);
|
||||||
|
{$ifdef VerboseWinCEMenu}
|
||||||
|
DebugLn(Format('[CeSetMenu] MenuItemsList.Delete 1002 Index %d', [lIndex]));
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
|
||||||
GetWindowRect(Wnd, BR);
|
GetWindowRect(Wnd, BR);
|
||||||
|
|
||||||
@ -315,6 +329,10 @@ begin
|
|||||||
;
|
;
|
||||||
|
|
||||||
// Add to the list to receive click events though WM_COMMAND
|
// Add to the list to receive click events though WM_COMMAND
|
||||||
|
{$ifdef VerboseWinCEMenu}
|
||||||
|
DebugLn(Format('[CeSetMenu] MenuItemsList.AddObject %d Name %s',
|
||||||
|
[tbbi.idCommand, LCLMenu.Items.Items[j].Name]));
|
||||||
|
{$endif}
|
||||||
MenuItemsList.AddObject(IntToStr(tbbi.idCommand), LCLMenu.Items.Items[j]);
|
MenuItemsList.AddObject(IntToStr(tbbi.idCommand), LCLMenu.Items.Items[j]);
|
||||||
|
|
||||||
// Adds subitems to a top-level item
|
// Adds subitems to a top-level item
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user