Jump to content

Recommended Posts

Posted

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.

post-892-0-97607600-1457090654_thumb.png

Posted

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;

Posted

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 ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...