~ubuntu-branches/ubuntu/maverick/poedit/maverick

« back to all changes in this revision

Viewing changes to src/fileviewer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-09-16 19:47:00 UTC
  • mfrom: (0.2.9 upstream) (1.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20080916194700-ueyef0pgklk3u50k
Tags: 1.4.2-2
Adding debug package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
22
 *  DEALINGS IN THE SOFTWARE.
23
23
 *
24
 
 *  $Id: fileviewer.cpp 1175 2007-10-03 06:38:00Z vaclavslavik $
 
24
 *  $Id: fileviewer.cpp 1304 2008-02-23 15:39:32Z vaclavslavik $
25
25
 *
26
26
 *  Shows part of file around specified line
27
27
 *
43
43
                       const wxString& basePath,
44
44
                       const wxArrayString& references,
45
45
                       size_t startAt)
46
 
        : wxFrame(parent, -1, _("Source file"),
47
 
                            wxPoint(
48
 
                                 wxConfig::Get()->Read(_T("fileviewer/frame_x"), -1),
49
 
                                 wxConfig::Get()->Read(_T("fileviewer/frame_y"), -1)),
50
 
                             wxSize(
51
 
                                 wxConfig::Get()->Read(_T("fileviewer/frame_w"), 600),
52
 
                                 wxConfig::Get()->Read(_T("fileviewer/frame_h"), 400))),
 
46
        : wxFrame(parent, -1, _("Source file")),
53
47
          m_references(references)
54
48
{
55
49
    m_basePath = basePath;
75
69
    // are accepted on all platforms:
76
70
    ref.Replace(wxT("\\"), wxT("/"));
77
71
    ShowReference(ref);
 
72
 
 
73
    wxConfigBase *cfg = wxConfig::Get();
 
74
    int posx = cfg->Read(_T("fileviewer/frame_x"), -1);
 
75
    int posy = cfg->Read(_T("fileviewer/frame_y"), -1);
 
76
    int width = cfg->Read(_T("fileviewer/frame_w"), 600);
 
77
    int height = cfg->Read(_T("fileviewer/frame_h"), 400);
 
78
 
 
79
    Move(posx, posy);
 
80
    SetClientSize(width, height);
78
81
}
79
82
 
80
83
void FileViewer::ShowReference(const wxString& ref)
126
129
 
127
130
FileViewer::~FileViewer()
128
131
{
129
 
    wxSize sz = GetSize();
 
132
    wxSize sz = GetClientSize();
130
133
    wxPoint pos = GetPosition();
131
134
    wxConfigBase *cfg = wxConfig::Get();
132
135
    cfg->Write(_T("fileviewer/frame_w"), (long)sz.x);