--- nfo/projects/netfraggle/bin/FraggleTopicFrame.py 2004/08/27 04:47:35 1.3 +++ nfo/projects/netfraggle/bin/FraggleTopicFrame.py 2004/08/31 02:25:34 1.6 @@ -1,7 +1,19 @@ #Boa:MDIChild:FraggleTopicFrame -# $Id: FraggleTopicFrame.py,v 1.3 2004/08/27 04:47:35 joko Exp $ +# $Id: FraggleTopicFrame.py,v 1.6 2004/08/31 02:25:34 joko Exp $ # $Log: FraggleTopicFrame.py,v $ +# Revision 1.6 2004/08/31 02:25:34 joko +# U removed FraggleTopicDetailFrame in favor of FraggleItemFrame and FraggleListFrame +# U now clearing topicListBox before updating it +# +# Revision 1.5 2004/08/30 13:06:16 joko +# U now gets config via self.engine +# +# Revision 1.4 2004/08/27 21:14:02 xabbu +# TopicDetails can now be closed. +# GUI change on Preferences Dialog in order to prepare multiple server profiles. +# Small bugfixes to get the new topic windows working on posix platform. +# # Revision 1.3 2004/08/27 04:47:35 joko # instance of FraggleEngine now available in self.engine # added event handler "OnTopicListBoxListboxDclick" and logic to open "FraggleTopicDetailFrame"s @@ -16,10 +28,11 @@ from wxPython.wx import * from wxPython.stc import * -import FraggleTopicDetailFrame +import FraggleItemFrame +import FraggleListFrame -def create(parent, config): - return FraggleTopicFrame(parent, config) +def create(parent): + return FraggleTopicFrame(parent) [wxID_FRAGGLETOPICFRAME, wxID_FRAGGLETOPICFRAMETOPICLISTBOX, wxID_FRAGGLETOPICFRAMEUPDATEBUTTON, @@ -29,8 +42,9 @@ def _init_ctrls(self, prnt): # generated method, don't edit wxMDIChildFrame.__init__(self, id=wxID_FRAGGLETOPICFRAME, name='', - parent=prnt, pos=wxPoint(352, 280), size=wxSize(177, 219), + parent=prnt, pos=wxPoint(494, 328), size=wxSize(169, 192), style=wxSIMPLE_BORDER | wxDEFAULT_FRAME_STYLE, title='Topics') + self._init_utils() self.SetClientSize(wxSize(169, 192)) self.updateButton = wxButton(id=wxID_FRAGGLETOPICFRAMEUPDATEBUTTON, @@ -46,18 +60,25 @@ wxID_FRAGGLETOPICFRAMETOPICLISTBOX, self.OnTopicListBoxListboxDclick) - def __init__(self, parent, config): + def _init_utils(self): + # generated method, don't edit + pass + + def __init__(self, parent): self.parent = parent - self.config = config + + # render widgets self._init_ctrls(parent) + + # get engine-instance (singleton) import __main__ self.engine = __main__.engine def OnUpdateButtonButton(self, event): #event.Skip() - # todo: make fraggleEngine read config on its own - self.engine.fraggleSync(self.config) + self.engine.fraggleSync() topics = self.engine.getTopics() + self.topicListBox.Clear() i = 0 for topic in topics: self.topicListBox.Append(topic['name'], i) @@ -81,8 +102,12 @@ # resolve associated topic entry topics = self.engine.getTopics() title = topics[seldata]['name'] + result = topics[seldata]['result'] - frame = FraggleTopicDetailFrame.create(self.parent) + if result == 'item': + frame = FraggleItemFrame.create(self.parent) + elif result == 'list': + frame = FraggleListFrame.create(self.parent) frame.SetName(str(seldata)) frame.SetTitle(title) @@ -91,5 +116,6 @@ frame.Move(pos) self.parent.Fit() + frame.load_content() \ No newline at end of file