From 070e9023870ad209f9b1fb7059067b17d62d6800 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Fri, 31 Oct 2014 16:20:17 +0000 Subject: [PATCH] Patch from bug #26762 git-svn-id: trunk@46730 - --- lcl/interfaces/wince/wincewsmenus.pp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lcl/interfaces/wince/wincewsmenus.pp b/lcl/interfaces/wince/wincewsmenus.pp index 02be3b455f..a8b67b9f1e 100644 --- a/lcl/interfaces/wince/wincewsmenus.pp +++ b/lcl/interfaces/wince/wincewsmenus.pp @@ -1033,14 +1033,23 @@ begin end; class function TWinCEWSMenuItem.SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; +const + uCheck: array[boolean] of uInt = (mf_Unchecked, mf_Checked); var - uCheck: UINT; + Sibling: TMenuItem; begin - if Checked then - uCheck := MF_CHECKED - else - uCheck := MF_UNCHECKED; - Result := Boolean(Windows.CheckMenuItem(AMenuItem.Parent.Handle, AMenuItem.Command, uCheck)); + with AMenuItem do + if not radioItem or (groupIndex=0) then + result := longBool(CheckMenuItem(AMenuItem.Parent.handle, + AMenuItem.Command, uCheck[checked])) + else if checked then + begin + result := CheckMenuRadioItem(AMenuItem.Parent.handle, + AMenuItem.Command, AMenuItem.Command, AMenuItem.Command, mf_ByCommand); + for Sibling in AMenuItem.Parent do + if Sibling.radioItem and (Sibling.groupIndex=groupIndex) and (Sibling<>AMenuItem) then + CheckMenuRadioItem(AMenuItem.Parent.handle, Sibling.command, Sibling.command, command, mf_ByCommand); + end; end; class procedure TWinCEWSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut);