Changeset bc7bc839 in sasview for guiframe/pdfview.py


Ignore:
Timestamp:
Jul 25, 2011 3:24:12 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
486aa43
Parents:
463eb76e
Message:

finished tutorial help menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/pdfview.py

    r60c7011 rbc7bc839  
    33 
    44import  wx 
     5import os 
    56if wx.Platform == '__WXMSW__': 
    67    from wx.lib.pdfwin import PDFWindow 
     
    1617         
    1718        self.parent = parent 
     19        self.path = path 
    1820        sizer = wx.BoxSizer(wx.VERTICAL) 
    1921        btnSizer = wx.BoxSizer(wx.HORIZONTAL) 
     
    2729        btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) 
    2830 
    29         self.pdf.LoadFile(path) 
     31        self.pdf.LoadFile(self.path) 
    3032        btn = wx.Button(self, wx.NewId(), "Previous Page") 
    3133        self.Bind(wx.EVT_BUTTON, self.OnPrevPageButton, btn) 
     
    5153        # make sure you have PDF files available on your drive 
    5254        dlg = wx.FileDialog(self, wildcard="*.pdf") 
     55        dlg.SetDirectory(os.path.dirname(self.path)) 
    5356        if dlg.ShowModal() == wx.ID_OK: 
    5457            wx.BeginBusyCursor() 
    55             self.pdf.LoadFile(dlg.GetPath()) 
    56  
     58            file = dlg.GetPath() 
     59            self.pdf.LoadFile(file) 
     60            self.parent.SetTitle(os.path.basename(file.split('.')[0])) 
    5761            wx.EndBusyCursor() 
    5862        dlg.Destroy() 
Note: See TracChangeset for help on using the changeset viewer.