Attachment 'interactors.py'

Download

   1 #----------------------------------------------------------------------------
   2 # Name:         interactors.py
   3 # Purpose:      Event Management
   4 #
   5 # Author:       Peter Damoc (peter at sigmacore.net)
   6 #               
   7 # Created:      January 2006
   8 # Version:      0.2 
   9 # Licence:      wxWindows license
  10 
  11 import wx
  12 
  13 class AlbumInteractor(object):
  14     '''
  15     This class translates the low level events into the "higher level language" of the presenter
  16     '''
  17     def Install(self, presenter, view):
  18         self.presenter = presenter
  19         self.view = view
  20         view.albums.Bind(wx.EVT_LISTBOX, self.OnReloadNeeded)
  21         view.title.Bind(wx.EVT_TEXT, self.OnDataFieldUpdated)
  22         view.artist.Bind(wx.EVT_TEXT, self.OnDataFieldUpdated)
  23         view.composer.Bind(wx.EVT_TEXT, self.OnDataFieldUpdated)
  24         view.classical.Bind(wx.EVT_CHECKBOX, self.OnDataFieldUpdated)
  25         view.apply.Bind(wx.EVT_BUTTON, self.OnApply)
  26         view.cancel.Bind(wx.EVT_BUTTON, self.OnReloadNeeded)
  27         view.add.Bind(wx.EVT_BUTTON, self.OnAddNewAlbum)
  28         view.order.Bind(wx.EVT_BUTTON, self.OnToggleOrder)
  29         
  30     def OnAddNewAlbum(self, evt):
  31         self.presenter.addNewAlbum()
  32         
  33     def OnToggleOrder(self, evt):
  34         self.presenter.toggleOrder()
  35         
  36     def OnApply(self, evt):
  37         self.presenter.updateModel()
  38         
  39     def OnReloadNeeded(self, evt):
  40         self.presenter.loadViewFromModel()
  41         
  42     def OnDataFieldUpdated(self, evt):
  43         self.presenter.dataFieldUpdated()

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-10-04 09:16:02, 0.7 KB) [[attachment:albums.pyw]]
  • [get | view] (2009-10-04 09:16:02, 1.5 KB) [[attachment:interactors.py]]
  • [get | view] (2009-10-04 09:16:02, 2.3 KB) [[attachment:mock_objects.py]]
  • [get | view] (2009-10-04 09:16:02, 1.1 KB) [[attachment:models.py]]
  • [get | view] (2009-10-04 09:16:02, 12.4 KB) [[attachment:mvp.png]]
  • [get | view] (2009-10-04 09:16:02, 5.5 KB) [[attachment:mvp.zip]]
  • [get | view] (2009-10-04 09:16:02, 12.9 KB) [[attachment:mvp2.png]]
  • [get | view] (2009-10-04 09:16:02, 5.9 KB) [[attachment:mvp2.zip]]
  • [get | view] (2009-10-04 09:16:02, 3.8 KB) [[attachment:package.zip]]
  • [get | view] (2009-10-04 09:16:02, 4.4 KB) [[attachment:presenters.py]]
  • [get | view] (2009-10-04 09:16:02, 2.2 KB) [[attachment:test_presenters.py]]
  • [get | view] (2009-10-04 09:16:02, 4.3 KB) [[attachment:views.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.