mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 22:50:22 +02:00
Fixes wince menus in secondary forms
git-svn-id: trunk@26853 -
This commit is contained in:
parent
8e7181cd43
commit
c6b619e53e
@ -137,7 +137,7 @@ var
|
|||||||
mi: MENUITEMINFO;
|
mi: MENUITEMINFO;
|
||||||
tb: TBButton;
|
tb: TBButton;
|
||||||
tbbi: TBBUTTONINFO;
|
tbbi: TBBUTTONINFO;
|
||||||
i, j, k: integer;
|
i, j, k, lIndex: integer;
|
||||||
buf: array[0..255] of WideChar;
|
buf: array[0..255] of WideChar;
|
||||||
R, BR, WR: TRect;
|
R, BR, WR: TRect;
|
||||||
LeftMenuCount: Integer = -1;
|
LeftMenuCount: Integer = -1;
|
||||||
@ -165,6 +165,12 @@ begin
|
|||||||
mbi.hwndMB := 0;
|
mbi.hwndMB := 0;
|
||||||
end;}
|
end;}
|
||||||
|
|
||||||
|
// Remove previously installed top-level menu click handlers
|
||||||
|
if MenuItemsList.Find('1001', lIndex) then
|
||||||
|
MenuItemsList.Delete(lIndex);
|
||||||
|
if MenuItemsList.Find('1002', lIndex) then
|
||||||
|
MenuItemsList.Delete(lIndex);
|
||||||
|
|
||||||
GetWindowRect(Wnd, BR);
|
GetWindowRect(Wnd, BR);
|
||||||
|
|
||||||
// If no menu is currently associated in the application
|
// If no menu is currently associated in the application
|
||||||
@ -305,6 +311,7 @@ begin
|
|||||||
if SendMessage(mbi.hwndMB, TB_SETBUTTONINFO, tbbi.idCommand, LPARAM(@tbbi)) = 0 then
|
if SendMessage(mbi.hwndMB, TB_SETBUTTONINFO, tbbi.idCommand, LPARAM(@tbbi)) = 0 then
|
||||||
DebugLn('[CeSetMenu] TB_SETBUTTONINFO failed');
|
DebugLn('[CeSetMenu] TB_SETBUTTONINFO failed');
|
||||||
|
|
||||||
|
// Add to the list to receive click events though WM_COMMAND
|
||||||
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
|
||||||
@ -403,6 +410,9 @@ begin
|
|||||||
if SendMessage(mbi.hwndMB, TB_INSERTBUTTON, i, LPARAM(@tb)) = 0 then
|
if SendMessage(mbi.hwndMB, TB_INSERTBUTTON, i, LPARAM(@tb)) = 0 then
|
||||||
DebugLn('TB_INSERTBUTTON failed');
|
DebugLn('TB_INSERTBUTTON failed');
|
||||||
|
|
||||||
|
// Add to the list to receive click events though WM_COMMAND
|
||||||
|
MenuItemsList.AddObject(IntToStr(tb.idCommand), LCLMenu.Items.Items[j]);
|
||||||
|
|
||||||
Inc(i);
|
Inc(i);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user