Beispiel #1
0
 void tree_NodeMouseReleased(object sender, TreeMouseEventArgs e)
 {
     if (e.Button == MouseButtonCode.MB_BUTTON1)
     {
         EditInterfaceTreeNode node = e.Node as EditInterfaceTreeNode;
         tree.SelectedNode    = e.Node;
         currentMenuInterface = node.EditInterface;
         if (currentMenuInterface.hasCommands())
         {
             PopupMenu menu = Gui.Instance.createWidgetT("PopupMenu", "PopupMenu", 0, 0, 1000, 1000, Align.Default, "Overlapped", "") as PopupMenu;
             menu.ItemAccept += new MyGUIEvent(menu_ItemAccept);
             menu.Closed     += new MyGUIEvent(menu_Closed);
             menu.Visible     = false;
             foreach (EditInterfaceCommand command in currentMenuInterface.getCommands())
             {
                 MenuItem item = menu.addItem(command.Name);
                 item.UserObject = command;
             }
             LayerManager.Instance.upLayerItem(menu);
             menu.setPosition(e.MousePosition.x, e.MousePosition.y);
             menu.ensureVisible();
             menu.setVisibleSmooth(true);
         }
     }
 }