Changeset 0aca693 in sasview for sansguiframe/src/sans/guiframe/pdfview.py
- Timestamp:
- Apr 9, 2012 11:44:49 AM (12 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 8b1d759
- Parents:
- cce182ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/pdfview.py
r03a8b16 r0aca693 7 7 from wx.lib.pdfwin import PDFWindow 8 8 9 from wx.lib.scrolledpanel import ScrolledPanel 10 STYLE = wx.TE_MULTILINE|wx.TE_READONLY|wx.SUNKEN_BORDER|wx.HSCROLL 11 12 class TextPanel(ScrolledPanel): 13 """ 14 Panel that contains the text 15 """ 16 def __init__(self, parent, text=None): 17 """ 18 """ 19 ScrolledPanel.__init__(self, parent, id=-1) 20 self.SetupScrolling() 21 self.parent = parent 22 self.text = text 23 sizer = wx.BoxSizer(wx.VERTICAL) 24 self.textctl = wx.TextCtrl(self, -1, size=(-1, -1), style=STYLE) 25 self.textctl.SetValue(self.text) 26 sizer.Add(self.textctl, proportion=1, flag=wx.EXPAND) 27 self.SetSizer(sizer) 28 self.SetAutoLayout(True) 29 wx.EVT_CLOSE(self.parent, self.OnClose) 30 31 def OnClose(self, event): 32 """ 33 Close panel 34 """ 35 self.parent.Destroy() 36 37 class TextFrame(wx.Frame): 38 """ 39 Frame for PDF panel 40 """ 41 def __init__(self, parent, id, title, text): 42 """ 43 Init 44 45 :param parent: parent panel/container 46 :param path: full path of the pdf file 47 """ 48 # Initialize the Frame object 49 wx.Frame.__init__(self, parent, id, title, 50 wx.DefaultPosition, wx.Size(600, 830)) 51 # make an instance of the class 52 TextPanel(self, text) 53 self.SetFocus() 54 9 55 class PDFPanel(wx.Panel): 10 56 """
Note: See TracChangeset
for help on using the changeset viewer.