delagoutte Posted March 4, 2016 Posted March 4, 2016 I have a unibutton attach to a unipopupmenu. the itemmenu have the property CheckItem = true. graphically its is like the png attach to this post. Actually if i check or uncheck a checkbox the event itemonclick is fired. how can i have the folowing behavior : checkbox serve only for select. when i check, the popupmenu don't close itself and don't fire onclick event. if i click on the caption of the menu item , it must fired itemonclick event. If i click on unibuton , i have the list of item that are checked. Quote
delagoutte Posted March 4, 2016 Author Posted March 4, 2016 The event oncheck is fire before onclick Issue : GLobal Var MenuChecked : boolean; TUniMenuItem.HideOnClick := true; TUniMenuItem.Oncheck := Oncheckeditemmenu; TUniMenuItem.onclick := OnClickmenuItem; procedure TMyForm.Oncheckeditemmenu(sender : tobject); begin MenuChecked := true; end; procedure TMyForm.OnClickmenuItem(sender : tobject); begin if menuchecked then begin MenuChecked:=false; end else begin // normal click function end end; Quote
delagoutte Posted March 4, 2016 Author Posted March 4, 2016 sorry , i's not work. when i click on caption the oncheck event is fired. so theres no difference between caption click and checkbox click. any idea ? Quote
bugra Posted March 4, 2016 Posted March 4, 2016 Unfortunately Menuitem's Check and Click cannot seperated. It's default uses of ExtJS. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.