Share and Money Management  0.16
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
gui.MainWindow Class Reference

Main window of our application. More...

Public Member Functions

def __init__
 Constructor.
def createMenus
 Create all menus.
def createMenuEntry
 Create a single menu item.
def createFileMenu
 Create "File" menu.
def createManageMenu
 Create "Manage" menu.
def createReportMenu
 Create "Reports" menu.
def createViewMenu
 Create "View" menu.
def createHelpMenu
 Create "Help" menu.
def OnAbout
 Open about dialog.
def OnFileExit
 Finish this application.
def OnFetchQuotes
 Open fetch quotes dialog.
def OnNewIndex
 Open new index dialog.
def OnNewShare
 Open new share dialog.
def OnNewTransaction
 Open new transaction dialog.
def OnPositionReport
 Open a new dialog to show a position report.
def OnPortfolioReport
 Open a new dialog to show a depot report.
def OnPreferences
 Open preferences dialog.
def handleMDIChild
 Creates and closes MDI child windows.
def OnCreateSummary
 Show a summary about the current deposit.
def OnCreateCurrency
 Show and maintain all currencies.
def OnCreateExchange
 Show and maintain all exchanges.
def OnCreateShare
 Show and maintain all shares.
def OnCreateTransaction
 Show and maintain all transactions.
def OnCreateIndex
 Show and maintain all indices.
def OnCreatePositionList
 Show all open positions.
def OnCreatePositionDetails
 Show all open positions.
def OnCreateWatchList
 Show all watch list entries.
def OnCloseSummary
 Cleanup / udate actions on closing summary panel.
def OnCloseCurrency
 Cleanup / udate actions on closing currency panel.
def OnCloseExchange
 Cleanup / udate actions on closing exchange panel.
def OnCloseShare
 Cleanup / udate actions on closing share panel.
def OnCloseTransaction
 Cleanup / udate actions on closing transaction panel.
def OnCloseIndex
 Cleanup / udate actions on closing indices panel.
def OnClosePositionList
 Cleanup / udate actions on closing open position panel.
def OnClosePositionDetails
 Cleanup / udate actions on closing open position panel.
def OnCloseWatchList
 Cleanup / udate actions on closing watch list panel.
def closeView
 Close a open view and perform all cleanup actions.
def OnClose
 Save the current configuration before the GUI is closed.
def restoreGUIConfig
 Restore general GUI configuration.
def restoreSMMConfig
 Restore GUI configuration of all SMM elements.
def saveGUIConfig
 Store general GUI configuration.
def saveSMMConfig
 Store general GUI configuration.

Public Attributes

 filemenu
 All menue entries grouped to the "File" menu.
 helpmenu
 All menue entries grouped to the "Help" menu.
 managemenu
 All menue entries grouped to the "Manage" menu.
 reportmenu
 All menue entries grouped to the "Reports" menu.
 viewmenu
 All menue entries grouped to the "View" menu.
 menubar
 Main menubar with all submenus.
 ViewSummary
 Reference to the "Summary" MDI client panel.
 ViewCurrency
 Reference to the "Currency" MDI client panel.
 ViewExchange
 Reference to the "Exchange" MDI client panel.
 ViewShare
 Reference to the "Share" MDI client panel.
 ViewTransaction
 Reference to the "Transaction" MDI client panel.
 ViewIndex
 Reference to the "Indices" MDI client panel.
 ViewPositionList
 Reference to the "OpenPositionList" MDI client panel.
 ViewPositionDetails
 Reference to the "OpenPositionDetails" MDI client panel.
 ViewWatchList

Static Public Attributes

 nativeMDI = False
 Indicates native MDI support.
list views_open = []
 List of all open views.
tuple ID_FILEMENU_PREFERENCES = wx.NewId()
tuple ID_MANAGEMENU_FETCHQUOTES = wx.NewId()
tuple ID_MANAGEMENU_ADDINDEX = wx.NewId()
tuple ID_MANAGEMENU_ADDSHARE = wx.NewId()
tuple ID_MANAGEMENU_TRADE = wx.NewId()
tuple ID_REPORTMENU_POSITIONREPORT = wx.NewId()
tuple ID_REPORTMENU_PORTFOLIOREPORT = wx.NewId()
tuple ID_VIEWMENU_SUMMARY = wx.NewId()
tuple ID_VIEWMENU_CURRENCY = wx.NewId()
tuple ID_VIEWMENU_EXCHANGE = wx.NewId()
tuple ID_VIEWMENU_SHARE = wx.NewId()
tuple ID_VIEWMENU_TRANSACTION = wx.NewId()
tuple ID_VIEWMENU_INDEX = wx.NewId()
tuple ID_VIEWMENU_POSITIONLIST = wx.NewId()
tuple ID_VIEWMENU_POSITIONDETAILS = wx.NewId()
tuple ID_VIEWMENU_WATCHLIST = wx.NewId()
dictionary attr2menu
 Mapping between view name and menu id.

Detailed Description

Main window of our application.

The application is an MDI application to provide the user more flexibility in selection and positioning of the displayed data.

The content of an MDI child is a simple wx.Frame. That unifies the handling of the MDI childs.

Constructor & Destructor Documentation

def gui.MainWindow.__init__ (   self,
  parent,
  id,
  title 
)

Constructor.

Member Function Documentation

def gui.MainWindow.closeView (   self,
  attr,
  event 
)

Close a open view and perform all cleanup actions.

References gui.MainWindow.attr2menu.

Referenced by gui.MainWindow.OnCloseCurrency(), gui.MainWindow.OnCloseExchange(), gui.MainWindow.OnCloseIndex(), gui.MainWindow.OnClosePositionDetails(), gui.MainWindow.OnClosePositionList(), gui.MainWindow.OnCloseShare(), gui.MainWindow.OnCloseSummary(), gui.MainWindow.OnCloseTransaction(), and gui.MainWindow.OnCloseWatchList().

Here is the caller graph for this function:

def gui.MainWindow.createFileMenu (   self)

Create "File" menu.

References gui.MainWindow.createMenuEntry(), gui.MainWindow.filemenu, gui.MainWindow.ID_FILEMENU_PREFERENCES, gui.MainWindow.OnFileExit(), and gui.MainWindow.OnPreferences().

Referenced by gui.MainWindow.createMenus().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.createHelpMenu (   self)

Create "Help" menu.

References gui.MainWindow.createMenuEntry(), gui.MainWindow.helpmenu, and gui.MainWindow.OnAbout().

Referenced by gui.MainWindow.createMenus().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.createManageMenu (   self)

Create "Manage" menu.

References gui.MainWindow.createMenuEntry(), gui.MainWindow.ID_MANAGEMENU_ADDINDEX, gui.MainWindow.ID_MANAGEMENU_ADDSHARE, gui.MainWindow.ID_MANAGEMENU_FETCHQUOTES, gui.MainWindow.ID_MANAGEMENU_TRADE, gui.MainWindow.managemenu, gui.MainWindow.OnFetchQuotes(), gui.MainWindow.OnNewIndex(), gui.MainWindow.OnNewShare(), and gui.MainWindow.OnNewTransaction().

Referenced by gui.MainWindow.createMenus().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.createMenuEntry (   self,
  menu,
  mid,
  item,
  htext,
  func,
  kind = wx.ITEM_NORMAL 
)

Create a single menu item.

Parameters
selfThe object pointer
menuMenu to append
midID of the entry
itemMenu text
htextHelp text
funcFunction to call if the menu event occure
kindKind of the menu entry

Referenced by gui.MainWindow.createFileMenu(), gui.MainWindow.createHelpMenu(), gui.MainWindow.createManageMenu(), gui.MainWindow.createReportMenu(), and gui.MainWindow.createViewMenu().

Here is the caller graph for this function:

def gui.MainWindow.createMenus (   self)
def gui.MainWindow.createReportMenu (   self)

Create "Reports" menu.

References gui.MainWindow.createMenuEntry(), gui.MainWindow.ID_REPORTMENU_PORTFOLIOREPORT, gui.MainWindow.ID_REPORTMENU_POSITIONREPORT, gui.MainWindow.OnPortfolioReport(), gui.MainWindow.OnPositionReport(), and gui.MainWindow.reportmenu.

Referenced by gui.MainWindow.createMenus().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.createViewMenu (   self)
def gui.MainWindow.handleMDIChild (   self,
  panelClass,
  attr,
  closeEvent,
  title 
)

Creates and closes MDI child windows.

The function toggles the state of a MDI child between created and closed. A created child has a valid reference.

New childs are setted up by creating a wx.MDIChildFrame and placing the content in form of a wx.Frame in it.

The menu item will be disables for native MDI platforms and a event handler for the close event will be installed to reenable the menu item.

The state of the menu entry is set depending of the platform.

Parameters
selfThe object pointer
panelClassClass that provides the content of the window.
attrName of the attribute to store the reference to the MDI child.
closeEventHandler for MDI childs close event
titleTitle of the MDI child window

References gui.MainWindow.attr2menu.

Referenced by gui.MainWindow.OnCreateCurrency(), gui.MainWindow.OnCreateExchange(), gui.MainWindow.OnCreateIndex(), gui.MainWindow.OnCreatePositionDetails(), gui.MainWindow.OnCreatePositionList(), gui.MainWindow.OnCreateShare(), gui.MainWindow.OnCreateSummary(), gui.MainWindow.OnCreateTransaction(), and gui.MainWindow.OnCreateWatchList().

Here is the caller graph for this function:

def gui.MainWindow.OnAbout (   self,
  event 
)

Open about dialog.

See Also
gui.dialogs.showAboutDialog()

Referenced by gui.MainWindow.createHelpMenu().

Here is the caller graph for this function:

def gui.MainWindow.OnClose (   self,
  event 
)

Save the current configuration before the GUI is closed.

See Also
saveGUIConfig(), saveSMMConfig(), restoreGUIConfig() and restoreConfig()

References gui.MainWindow.saveGUIConfig(), gui.MainWindow.saveSMMConfig(), and gui.MainWindow.views_open.

Here is the call graph for this function:

def gui.MainWindow.OnCloseCurrency (   self,
  event 
)

Cleanup / udate actions on closing currency panel.

See Also
gui.panel.PanelCurrency

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreateCurrency().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCloseExchange (   self,
  event 
)

Cleanup / udate actions on closing exchange panel.

See Also
gui.panel.PanelExchange

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreateExchange().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCloseIndex (   self,
  event 
)

Cleanup / udate actions on closing indices panel.

See Also
gui.panel.PanelIndex

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreateIndex().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnClosePositionDetails (   self,
  event 
)

Cleanup / udate actions on closing open position panel.

See Also
gui.panel.PanelOpenPositionDetails

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreatePositionDetails().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnClosePositionList (   self,
  event 
)

Cleanup / udate actions on closing open position panel.

See Also
gui.panel.PanelOpenPositionList

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreatePositionList().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCloseShare (   self,
  event 
)

Cleanup / udate actions on closing share panel.

See Also
gui.panel.PanelShare

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreateShare().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCloseSummary (   self,
  event 
)

Cleanup / udate actions on closing summary panel.

See Also
gui.panel.PanelSummary

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreateSummary().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCloseTransaction (   self,
  event 
)

Cleanup / udate actions on closing transaction panel.

See Also
gui.panel.PanelTransaction

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreateTransaction().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCloseWatchList (   self,
  event 
)

Cleanup / udate actions on closing watch list panel.

See Also
gui.panel.PanelWatch

References gui.MainWindow.closeView().

Referenced by gui.MainWindow.OnCreateWatchList().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreateCurrency (   self,
  event 
)

Show and maintain all currencies.

See Also
gui.panel.PanelCurrency
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnCloseCurrency().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreateExchange (   self,
  event 
)

Show and maintain all exchanges.

See Also
gui.panel.PanelExchange
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnCloseExchange().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreateIndex (   self,
  event 
)

Show and maintain all indices.

See Also
gui.panel.PanelIndex
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnCloseIndex().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreatePositionDetails (   self,
  event 
)

Show all open positions.

See Also
gui.panel.PanelOpenPositionDetails
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnClosePositionDetails().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreatePositionList (   self,
  event 
)

Show all open positions.

See Also
gui.panel.PanelOpenPositionList
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnClosePositionList().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreateShare (   self,
  event 
)

Show and maintain all shares.

See Also
gui.panel.PanelShare
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnCloseShare().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreateSummary (   self,
  event 
)

Show a summary about the current deposit.

See Also
gui.panel.PanelSummary
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnCloseSummary().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreateTransaction (   self,
  event 
)

Show and maintain all transactions.

See Also
gui.panel.PanelTransaction
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnCloseTransaction().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnCreateWatchList (   self,
  event 
)

Show all watch list entries.

See Also
gui.panel.PanelWatchList
handleMDIChild()

References gui.MainWindow.handleMDIChild(), and gui.MainWindow.OnCloseWatchList().

Referenced by gui.MainWindow.createViewMenu(), and gui.MainWindow.restoreSMMConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnFetchQuotes (   self,
  event 
)

Open fetch quotes dialog.

See Also
gui.dialogs.DlgFetchQuotes

Referenced by gui.dialogs.DlgFetchQuotes.__init__(), and gui.MainWindow.createManageMenu().

Here is the caller graph for this function:

def gui.MainWindow.OnFileExit (   self,
  event 
)

Finish this application.

References smm.objects.Position.Close().

Referenced by gui.MainWindow.createFileMenu().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.MainWindow.OnNewIndex (   self,
  event 
)

Open new index dialog.

See Also
gui.dialogs.DlgShare and gui.dialogs.DlgShare.setFixedShareKind

Referenced by gui.MainWindow.createManageMenu().

Here is the caller graph for this function:

def gui.MainWindow.OnNewShare (   self,
  event 
)

Open new share dialog.

See Also
gui.dialogs.DlgShare

Referenced by gui.MainWindow.createManageMenu().

Here is the caller graph for this function:

def gui.MainWindow.OnNewTransaction (   self,
  event 
)

Open new transaction dialog.

See Also
gui.dialogs.DlgTrade

Referenced by gui.MainWindow.createManageMenu().

Here is the caller graph for this function:

def gui.MainWindow.OnPortfolioReport (   self,
  event 
)

Open a new dialog to show a depot report.

See Also
gui.dialogs.DlgHtml

Referenced by gui.MainWindow.createReportMenu().

Here is the caller graph for this function:

def gui.MainWindow.OnPositionReport (   self,
  event 
)

Open a new dialog to show a position report.

See Also
gui.dialogs.DlgHtml

Referenced by gui.MainWindow.createReportMenu().

Here is the caller graph for this function:

def gui.MainWindow.OnPreferences (   self,
  event 
)

Open preferences dialog.

See Also
gui.dialogs.DlgPreferences

Referenced by gui.MainWindow.createFileMenu().

Here is the caller graph for this function:

def gui.MainWindow.restoreGUIConfig (   self)

Restore general GUI configuration.

See Also
restoreSMMConfig(), saveGUIConfig() and saveSMMConfig()
def gui.MainWindow.restoreSMMConfig (   self)
def gui.MainWindow.saveGUIConfig (   self)

Store general GUI configuration.

See Also
saveSMMConfig(), restoreGUIConfig() and restoreSMMConfig()

Referenced by gui.MainWindow.OnClose().

Here is the caller graph for this function:

def gui.MainWindow.saveSMMConfig (   self)

Store general GUI configuration.

See Also
saveGUIConfig(), restoreGUIConfig() and restoreSMMConfig()

References gui.MainWindow.views_open.

Referenced by gui.MainWindow.OnClose().

Here is the caller graph for this function:

Member Data Documentation

dictionary gui.MainWindow.attr2menu
static
Initial value:
{
'ViewSummary': ID_VIEWMENU_SUMMARY,
'ViewCurrency': ID_VIEWMENU_CURRENCY,
'ViewExchange': ID_VIEWMENU_EXCHANGE,
'ViewShare': ID_VIEWMENU_SHARE,
'ViewTransaction': ID_VIEWMENU_TRANSACTION,
'ViewIndex': ID_VIEWMENU_INDEX,
'ViewPositionList': ID_VIEWMENU_POSITIONLIST,
'ViewPositionDetails': ID_VIEWMENU_POSITIONDETAILS,
'ViewWatchList': ID_VIEWMENU_WATCHLIST,
}

Mapping between view name and menu id.

Referenced by gui.MainWindow.closeView(), and gui.MainWindow.handleMDIChild().

gui.MainWindow.filemenu

All menue entries grouped to the "File" menu.

Referenced by gui.MainWindow.createFileMenu(), and gui.MainWindow.createMenus().

gui.MainWindow.helpmenu

All menue entries grouped to the "Help" menu.

Referenced by gui.MainWindow.createHelpMenu(), and gui.MainWindow.createMenus().

tuple gui.MainWindow.ID_FILEMENU_PREFERENCES = wx.NewId()
static
tuple gui.MainWindow.ID_MANAGEMENU_ADDINDEX = wx.NewId()
static
tuple gui.MainWindow.ID_MANAGEMENU_ADDSHARE = wx.NewId()
static
tuple gui.MainWindow.ID_MANAGEMENU_FETCHQUOTES = wx.NewId()
static
tuple gui.MainWindow.ID_MANAGEMENU_TRADE = wx.NewId()
static
tuple gui.MainWindow.ID_REPORTMENU_PORTFOLIOREPORT = wx.NewId()
static
tuple gui.MainWindow.ID_REPORTMENU_POSITIONREPORT = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_CURRENCY = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_EXCHANGE = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_INDEX = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_POSITIONDETAILS = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_POSITIONLIST = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_SHARE = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_SUMMARY = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_TRANSACTION = wx.NewId()
static
tuple gui.MainWindow.ID_VIEWMENU_WATCHLIST = wx.NewId()
static
gui.MainWindow.managemenu

All menue entries grouped to the "Manage" menu.

Referenced by gui.MainWindow.createManageMenu(), and gui.MainWindow.createMenus().

gui.MainWindow.menubar

Main menubar with all submenus.

See Also
filemenu and helpmenu

Referenced by gui.MainWindow.createMenus().

gui.MainWindow.nativeMDI = False
static

Indicates native MDI support.

gui.MainWindow.reportmenu

All menue entries grouped to the "Reports" menu.

Referenced by gui.MainWindow.createMenus(), and gui.MainWindow.createReportMenu().

gui.MainWindow.ViewCurrency

Reference to the "Currency" MDI client panel.

gui.MainWindow.ViewExchange

Reference to the "Exchange" MDI client panel.

gui.MainWindow.ViewIndex

Reference to the "Indices" MDI client panel.

gui.MainWindow.viewmenu

All menue entries grouped to the "View" menu.

Referenced by gui.MainWindow.createMenus(), and gui.MainWindow.createViewMenu().

gui.MainWindow.ViewPositionDetails

Reference to the "OpenPositionDetails" MDI client panel.

gui.MainWindow.ViewPositionList

Reference to the "OpenPositionList" MDI client panel.

gui.MainWindow.views_open = []
static

List of all open views.

Referenced by gui.MainWindow.OnClose(), and gui.MainWindow.saveSMMConfig().

gui.MainWindow.ViewShare

Reference to the "Share" MDI client panel.

gui.MainWindow.ViewSummary

Reference to the "Summary" MDI client panel.

gui.MainWindow.ViewTransaction

Reference to the "Transaction" MDI client panel.

gui.MainWindow.ViewWatchList

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