Jump to content


Photo

TuniPopupMenu的CloseMenu方法无效

TuniPopupMenu CloseMenu

  • Please log in to reply
7 replies to this topic

#1 tony

tony

    Member

  • Members
  • PipPip
  • 15 posts

Posted 17 July 2015 - 06:59 AM

如题,是BUG吗?


  • 0

#2 tony

tony

    Member

  • Members
  • PipPip
  • 15 posts

Posted 17 July 2015 - 07:00 AM

//菜单能正常弹出
procedure TMainForm.UniBitBtn1MouseEnter(Sender: TObject);
begin
    PM_contEdu.Popup(0,28,UniBitBtn1);
end;

//无法自动关闭
procedure TMainForm.UniBitBtn1MouseLeave(Sender: TObject);
begin
   PM_contEdu.CloseMenu;
end;

  • 0

#3 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9820 posts

Posted 17 July 2015 - 08:14 AM

You don't have to call CloseMenu. Menu is closed when an item is selected.


  • 0

#4 tony

tony

    Member

  • Members
  • PipPip
  • 15 posts

Posted 20 July 2015 - 02:28 AM

You don't have to call CloseMenu. Menu is closed when an item is selected.

 

谢谢您的回复,不过我想得到的是自动弹出和自动隐藏的popupmenu效果。

 

Thanks for your reply Farshad !

But what I want is a auto-popup and auto-hide popupmenu, by check out mouse over event.


  • 0

#5 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 9820 posts

Posted 20 July 2015 - 12:36 PM

谢谢您的回复,不过我想得到的是自动弹出和自动隐藏的popupmenu效果。

 

Thanks for your reply Farshad !

But what I want is a auto-popup and auto-hide popupmenu, by check out mouse over event.

 

This must be done on client side using a proper script.


  • 0

#6 tony

tony

    Member

  • Members
  • PipPip
  • 15 posts

Posted 20 July 2015 - 02:38 PM

This must be done on client side using a proper script.

I know,but, how? please...

 

I think , it can be writing some script at  a button's client side ExtEvents like these:

 
Ext.button.Button
function mousemove(sender, x, y, eOpts)
{
    Mainform.UniPopupMenu1.popup;
}
 
function mouseout(sender, e, eOpts)
{
   mainform.UniPopupMenu1.close;
}

 

----------------------------------

but don't work...


  • 0

#7 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 3450 posts

Posted 21 July 2015 - 05:43 AM

Hi,

You can like this, But here you have to understand that then you can not select menu items ...
You need to change the logic:

Try:

1.

type
  TMMainPopupMenu = class(TUniPopupMenu)

  end;

2.

procedure TMainForm.UniButton1MouseEnter(Sender: TObject);
begin
  UniPopupMenu1.Popup(0, 28, Sender);
end;

procedure TMainForm.UniButton1MouseLeave(Sender: TObject);
var
  PopupMenuJSName: string;
begin
  PopupMenuJSName := TMMainPopupMenu(UniPopupMenu1).GetMenuControl.JSName;
  UniSession.AddJS(PopupMenuJSName + '.hide()');
end;
Best regards.

  • 1

#8 tony

tony

    Member

  • Members
  • PipPip
  • 15 posts

Posted 21 July 2015 - 02:58 PM

 

Hi,

You can like this, But here you have to understand that then you can not select menu items ...

 

 

eh...This could be a bigger problem... :( 

 

It seems like the effect I want is not to be realized.

 

是的,菜单是会自动消失了,但它也无法进行选取操作了……两全齐美不容易啊

 

Thank you very much for your help ! :rolleyes:


  • 0





Also tagged with one or more of these keywords: TuniPopupMenu, CloseMenu

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users