objects.gui.mainFramePopupMenu.mainFramePopupMenu Class Reference

Right click Popup menu object. More...

Inherits objects::gui::mainFrameContainer::mainFrameContainer.

List of all members.

Public Member Functions

def __init__
def constructStaticItems
 Creates all static menu items.
def constructFilterMenu
 Creates the all the dynamically generated filter items.
def buildMenuFromEntList
 Builds the entire popup menu.
def addMenuItem
 Attach a Menu Item to the Menu object.
def getMenu
 returns the Menu object
def getMenuItem
 returns an Item from the Menu object

Public Attributes

 hideMenu
 traceMenu
 FilterSubmenu
 mainFrmPopupMenu
 menu_items_ids
 DisplaySubmenu


Detailed Description

Right click Popup menu object.

Invoked whenever the Right Click is used over the main window.

Definition at line 24 of file mainFramePopupMenu.py.


Member Function Documentation

def objects.gui.mainFramePopupMenu.mainFramePopupMenu.__init__ (   self,
  mainFrm 
)

Reimplemented from objects.gui.mainFrameContainer.mainFrameContainer.

Definition at line 26 of file mainFramePopupMenu.py.

00026                                :
00027         mainFrameContainer.__init__(self, mainFrm)
00028         
00029         self.hideMenu  = None
00030         self.traceMenu = None
00031 
    ## Creates all static menu items. These are the items which never change and always show up on the menu.

def objects.gui.mainFramePopupMenu.mainFramePopupMenu.addMenuItem (   self,
  itemTuple,
  whichMenu 
)

Attach a Menu Item to the Menu object.

Parameters:
itemTuple Tuple in the form of (itemName, itemCategory, itemParams)
whichMenu wx.Menu object to which attach this item

Definition at line 100 of file mainFramePopupMenu.py.

00100                                                :
00101         id = wx.NewId()
00102         self.menu_items_ids[id] = itemTuple
00103         
00104         itemName, itemAction, itemParams = itemTuple        
00105             
00106         ret = whichMenu.Append(id, itemName)
00107         
00108         wx.EVT_MENU(self.mainFrmPopupMenu, id, self.mainFrame.popupMenuCallBack)
00109         
00110         return ret
00111     
    ## returns the Menu object

def objects.gui.mainFramePopupMenu.mainFramePopupMenu.buildMenuFromEntList (   self,
  entList 
)

Builds the entire popup menu.

This is usually what it called in response to the user right clicking onto the main window

Parameters:
entList list of Networked Entity objects used for the dynamic menu items

Definition at line 70 of file mainFramePopupMenu.py.

00070                                            :        
00071         self.mainFrmPopupMenu = wx.Menu()
00072         self.menu_items_ids = dict()        
00073         
00074         self.DisplaySubmenu = wx.Menu()
00075         
00076         self.addMenuItem(("All Peers", "SHOWDETAILSALL", ""), self.DisplaySubmenu)
00077         self.addMenuItem(("Visible Peers", "SHOWDETAILSVIS", ""), self.DisplaySubmenu)
00078         
00079         self.mainFrmPopupMenu .AppendMenu(-1, "Show Details", self.DisplaySubmenu)        
00080                         
00081         if entList != None:        
00082             if len(entList) == 1:
00083                 self.addMenuItem(("Peer", "SHOWDETAILS", ""), self.DisplaySubmenu)
00084                                 
00085                 self.traceMenu = self.addMenuItem(("Display Network Trace", "DISPLAY_TRACE", ""),    self.mainFrmPopupMenu)
00086                 self.mainFrmPopupMenu.AppendSeparator()                                          
00087                 
00088             else:
00089                 self.addMenuItem(("Peer Group", "SHOWDETAILS", ""), self.DisplaySubmenu)
00090                 
00091             self.constructFilterMenu(entList)
00092         
00093         self.constructStaticItems()
00094         
00095         
00096         

def objects.gui.mainFramePopupMenu.mainFramePopupMenu.constructFilterMenu (   self,
  entList 
)

Creates the all the dynamically generated filter items.

These are entirely dependent on the supplied Networked Entity list

Parameters:
entList list of Networked Entity objects

Definition at line 42 of file mainFramePopupMenu.py.

00042                                           :
00043         self.FilterSubmenu = wx.Menu()
00044         
00045         menuItemNames = dict()
00046         
00047         filterDict = filterDictionary()
00048         
00049         for menuName, attrTuple in filterDict.filter.iteritems():
00050             attr, dataType = attrTuple
00051             for ent in entList:
00052                 
00053                 if ent[attr] is not None and unicode(ent[attr]) != "": 
00054                     nextItem = "%s: %s" % (menuName, unicode(ent[attr]))
00055                     
00056                     if not menuItemNames.has_key(nextItem):
00057                         # add the item to the sub menu
00058                         self.addMenuItem( (nextItem, "FILTERITEM", (menuName, ent[attr])), self.FilterSubmenu)
00059                                           
00060                         menuItemNames[nextItem] = 1
00061         
00062         # now append the submen to main one
00063         self.hideMenu = self.mainFrmPopupMenu.AppendMenu(-1, "Hide", self.FilterSubmenu)
00064     
00065     
00066     
    ## Builds the entire popup menu. This is usually what it called in response to the 

def objects.gui.mainFramePopupMenu.mainFramePopupMenu.constructStaticItems (   self  ) 

Creates all static menu items.

These are the items which never change and always show up on the menu.

Definition at line 33 of file mainFramePopupMenu.py.

00033                                   :
00034         self.addMenuItem(("View Filters",     "VIEW_FILTERS", ""),    self.mainFrmPopupMenu)                          
00035         self.mainFrmPopupMenu.AppendSeparator()          
00036         self.addMenuItem(("Display Settings", "DISPLAY_SETTING", ""), self.mainFrmPopupMenu)
00037         self.addMenuItem(("Options",          "SHOW_OPTIONS", ""),     self.mainFrmPopupMenu)                
00038 
    ## Creates the all the dynamically generated filter items. These are entirely dependent on the

def objects.gui.mainFramePopupMenu.mainFramePopupMenu.getMenu (   self  ) 

returns the Menu object

Returns:
wx.Menu

Definition at line 114 of file mainFramePopupMenu.py.

00114                      :
00115         return self.mainFrmPopupMenu
00116     
00117     
    ## returns an Item from the Menu object

def objects.gui.mainFramePopupMenu.mainFramePopupMenu.getMenuItem (   self,
  id 
)

returns an Item from the Menu object

Parameters:
id wx.NewId, this is usually attached to the wx.Event object
Returns:
Tuple in the form of (itemName, itemCategory, itemParams)

Definition at line 121 of file mainFramePopupMenu.py.

00121                              :
00122         return self.menu_items_ids[id]
00123             
00124         
00125             
00126             
00127      
     


Member Data Documentation

Definition at line 74 of file mainFramePopupMenu.py.

Definition at line 43 of file mainFramePopupMenu.py.

Definition at line 29 of file mainFramePopupMenu.py.

Definition at line 71 of file mainFramePopupMenu.py.

Definition at line 72 of file mainFramePopupMenu.py.

Definition at line 30 of file mainFramePopupMenu.py.


The documentation for this class was generated from the following file:

Generated on Mon Mar 30 00:26:28 2009 for EyeSpy by  doxygen 1.5.8