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.You are not allowed to attach a file to this page.