def build_info_panel(self, data): html_win = ClickableHtmlWindow(self.lst, size=(-1, 180)) html_win.attach_to_frame(self, 0) #style=wx.html.HW_SCROLLBAR_NEVER) html_text = u"<table><tr>" img_file = os.path.join(config.images_folder, data['filename'] + '.jpg') if os.path.exists(img_file): html_text += u'<td width="100" rowspan="2">\ <img src="{0}"></td>\n'.format(img_file) else: html_text += u'<td width="100" rowspan="2"></td>' # imdb icon html_text += u'<td><a href="http://imdb.com/title/{0}">\ <img src="{1}"></a></td></tr>'.format(data['imdbID'], config.get_resource('images', 'imdb-logo.png')) print html_text # details html_text += u"<tr><td>" + self.generate_label_text(data) + u"</td></tr>" html_text += u"</table>" html_win.SetPage(html_text) return html_win
class HtmlDialog(wx.Dialog): def __init__(self, parent, content, *args, **kwds): kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, parent, *args, **kwds) self.SetBackgroundColour((240, 240, 240)) self.html_panel = ClickableHtmlWindow(self) self.SetTitle(content['title']) self.html_panel.SetPage(content['body']) self.html_panel.attach_to_frame(parent, 0) self.button_1 = wx.Button(self, -1, "Close") self.Bind(wx.EVT_BUTTON, self.on_close) self.__set_properties() self.__do_layout() def __set_properties(self): self.SetSize((400, 180)) def __do_layout(self): sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_1.Add(self.html_panel, 1, wx.EXPAND, 0) sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER, 0) self.SetSizer(sizer_1) self.Layout() def on_close(self, evt): self.Destroy()
def __init__(self, parent, content, *args, **kwds): kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, parent, *args, **kwds) self.SetBackgroundColour((240, 240, 240)) self.html_panel = ClickableHtmlWindow(self) self.SetTitle(content['title']) self.html_panel.SetPage(content['body']) self.html_panel.attach_to_frame(parent, 0) self.button_1 = wx.Button(self, -1, "Close") self.Bind(wx.EVT_BUTTON, self.on_close) self.__set_properties() self.__do_layout()