Changeset 69a6897 in sasview for src/sas/sasgui/guiframe/report_dialog.py
- Timestamp:
- Sep 26, 2017 5:18:01 PM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 9be22cd, fca1f50
- Parents:
- 24d9e84
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/report_dialog.py
r463e7ffc r69a6897 13 13 if sys.platform == "win32": 14 14 _STATICBOX_WIDTH = 450 15 PANEL_WIDTH = 500 15 PANEL_WIDTH = 500 16 16 PANEL_HEIGHT = 700 17 17 FONT_VARIANT = 0 … … 26 26 27 27 class BaseReportDialog(wx.Dialog): 28 28 29 29 def __init__(self, report_list, *args, **kwds): 30 30 """ 31 31 Initialization. The parameters added to Dialog are: 32 32 33 33 :param report_list: list of html_str, text_str, image for report 34 34 """ … … 48 48 self.report_list = report_list 49 49 # wild card 50 # pdf supporting only on MAC 51 if self.is_pdf: 52 self.wild_card = ' PDF files (*.pdf)|*.pdf|' 50 if self.is_pdf: # pdf writer is available 51 self.wild_card = 'PDF files (*.pdf)|*.pdf|' 53 52 self.index_offset = 0 54 53 else: … … 63 62 """ 64 63 hbox = wx.BoxSizer(wx.HORIZONTAL) 65 64 66 65 # buttons 67 66 button_close = wx.Button(self, wx.ID_OK, "Close") … … 75 74 id=button_print.GetId()) 76 75 hbox.Add(button_print) 77 76 78 77 button_save = wx.Button(self, wx.NewId(), "Save") 79 78 button_save.SetToolTipString("Save this report.") 80 79 button_save.Bind(wx.EVT_BUTTON, self.onSave, id=button_save.GetId()) 81 80 hbox.Add(button_save) 82 81 83 82 # panel for report page 84 83 vbox = wx.BoxSizer(wx.VERTICAL) … … 87 86 # set the html page with the report string 88 87 self.hwindow.SetPage(self.report_html) 89 88 90 89 # add panels to boxsizers 91 90 vbox.Add(hbox) … … 103 102 previewh = html.HtmlEasyPrinting(name="Printing", parentWindow=self) 104 103 previewh.PreviewText(self.report_html) 105 104 106 105 def onPrint(self, event=None): 107 106 """ … … 118 117 """ 119 118 self.Close() 120 119 121 120 def HTML2PDF(self, data, filename): 122 121 """ 123 122 Create a PDF file from html source string. 124 Returns True is the file creation was successful. 123 Returns True is the file creation was successful. 125 124 : data: html string 126 125 : filename: name of file to be saved … … 136 135 self.Update() 137 136 return pisaStatus.err 138 except :137 except Exception: 139 138 logger.error("Error creating pdf: %s" % sys.exc_value) 140 139 return False 141
Note: See TracChangeset
for help on using the changeset viewer.