NCBI C++ ToolKit
wx_save_pdf_dlg.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: wx_save_pdf_dlg.cpp 34423 2016-01-05 17:30:12Z katargir $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Liangshou Wu
27  *
28  * File Description:
29  *
30  */
31 #include <ncbi_pch.hpp>////@begin includes
32 ////@end includes
33 
34 #include "wx_save_pdf_dlg.hpp"
35 #include <wx/filename.h>
36 #include <wx/msgdlg.h>
37 #include <wx/checkbox.h>
38 #include <wx/filedlg.h>
39 #include <wx/panel.h>
40 #include <wx/artprov.h>
41 
49 #include <gui/objutils/utils.hpp>
51 #include <corelib/ncbifile.hpp>
52 #include "seqgraphic_pane.hpp"
53 
54 ////@begin XPM images
55 ////@end XPM images
56 
58 
59 static TVPUnit kMaxPdfSize = 14400;
60 
61 IMPLEMENT_DYNAMIC_CLASS( CwxSavePdfDlg, wxDialog )
62 
63 BEGIN_EVENT_TABLE( CwxSavePdfDlg, wxDialog )
64 
65 ////@begin CwxSavePdfDlg event table entries
66  EVT_TEXT( ID_TEXTCTRL5, CwxSavePdfDlg::OnTextctrl5TextUpdated )
67 
68  EVT_BUTTON( ID_BITMAPBUTTON, CwxSavePdfDlg::OnFilepathClick )
69 
70  EVT_BUTTON( ID_SAVE, CwxSavePdfDlg::OnSaveClick )
71 
72  EVT_BUTTON( ID_OPEN, CwxSavePdfDlg::OnOpenClick )
73 
74  EVT_BUTTON( ID_CANCEL, CwxSavePdfDlg::OnCancelClick )
75 
76 ////@end CwxSavePdfDlg event table entries
77  EVT_TIMER(-1, CwxSavePdfDlg::OnTimer)
78 
80 
81 CwxSavePdfDlg::CwxSavePdfDlg()
82  : m_Timer(this)
83  , m_Pane(NULL)
84  , m_ProgressBar(NULL)
85 {
86  Init();
87 }
88 
90  wxWindow *parent)
91  : m_Timer(this)
92  , m_Pane(pane)
93 {
94  Init();
95  Create(parent);
96 
97 }
98 
99 bool CwxSavePdfDlg::Create( wxWindow* parent, wxWindowID id,
100  const wxString& caption,
101  const wxPoint& pos,
102  const wxSize& size,
103  long style )
104 {
105 ////@begin CwxSavePdfDlg creation
106  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
107  wxDialog::Create( parent, id, caption, pos, size, style );
108 
109  CreateControls();
110  Centre();
111 ////@end CwxSavePdfDlg creation
112  return true;
113 }
114 
116 {
117 ////@begin CwxSavePdfDlg destruction
118 ////@end CwxSavePdfDlg destruction
119  SaveSettings();
120 }
121 
123 {
124 ////@begin CwxSavePdfDlg member initialisation
125  m_SeqRange = _("0:0");
126  m_Panel = NULL;
131  m_InfoSizer = NULL;
132  m_Info = NULL;
133  m_SaveButton = NULL;
134  m_OpenButton = NULL;
135 ////@end CwxSavePdfDlg member initialisation
136  m_NewFrom = 0;
137  m_NewTo = 0;
138  m_NewImgWidth = 1;
139  m_State = eInitial;
140  m_OpenPdf = false;
141  m_UserSelectedFilename = false;
142  LoadSettings();
143 }
144 
146 {
147 ////@begin CwxSavePdfDlg content construction
148  CwxSavePdfDlg* itemDialog1 = this;
149 
150  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
151  itemDialog1->SetSizer(itemBoxSizer2);
152 
153  m_Panel = new wxPanel( itemDialog1, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
154  m_Panel->SetName(_T("aaaaa"));
155  itemBoxSizer2->Add(m_Panel, 0, wxALIGN_CENTER_HORIZONTAL, 5);
156 
157  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
158  m_Panel->SetSizer(itemBoxSizer4);
159 
160  wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
161  itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
162 
163  wxStaticText* itemStaticText6 = new wxStaticText( m_Panel, wxID_STATIC, _("Save As:"), wxDefaultPosition, wxSize(100, -1), wxALIGN_RIGHT );
164  itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
165 
166  m_FileNameBox = new wxTextCtrl( m_Panel, ID_TEXTCTRL5, wxEmptyString, wxDefaultPosition, wxSize(200, -1), 0 );
167  itemBoxSizer5->Add(m_FileNameBox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
168 
169  wxBitmapButton* itemBitmapButton8 = new wxBitmapButton( m_Panel, ID_BITMAPBUTTON, itemDialog1->GetBitmapResource(wxT("menu::open")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
170  itemBitmapButton8->SetHelpText(_("Select File"));
172  itemBitmapButton8->SetToolTip(_("Select File"));
173  itemBoxSizer5->Add(itemBitmapButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
174 
175  wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
176  itemBoxSizer4->Add(itemBoxSizer9, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
177 
178  wxStaticText* itemStaticText10 = new wxStaticText( m_Panel, wxID_STATIC, _("Sequence Range:"), wxDefaultPosition, wxSize(100, -1), wxALIGN_RIGHT );
179  itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
180 
181  m_SeqRangeBox = new wxTextCtrl( m_Panel, ID_TEXTCTRL6, wxEmptyString, wxDefaultPosition, wxSize(200, -1), 0 );
182  m_SeqRangeBox->SetHelpText(_("Range examples: 1000-2000; 1000..2000; 10,000:2,000,000; 100k:1m; 1000[space]2000; 1000[tab]2000"));
184  m_SeqRangeBox->SetToolTip(_("Range examples: 1000-2000; 1000..2000; 10,000:2,000,000; 100k:1m; 1000[space]2000; 1000[tab]2000"));
185  itemBoxSizer9->Add(m_SeqRangeBox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
186 
187  itemBoxSizer9->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
188 
189  wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
190  itemBoxSizer4->Add(itemBoxSizer13, 0, wxGROW|wxLEFT|wxRIGHT, 5);
191 
192  m_SaveSimplified = new wxCheckBox( m_Panel, ID_CHECKBOX6, _("Save Simplified PDF"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
193  m_SaveSimplified->SetValue(false);
194  m_SaveSimplified->SetHelpText(_("Removes gradient shading from some elements to support Adobe Illustrator"));
196  m_SaveSimplified->SetToolTip(_("Makes PDF Adobe Illustrator Compatible"));
197  itemBoxSizer13->Add(m_SaveSimplified, 0, wxALIGN_TOP|wxALL, 5);
198 
199  m_DisplayTitle = new wxCheckBox( m_Panel, ID_CHECKBOX7, _("Add Title Bar"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
200  m_DisplayTitle->SetValue(false);
201  m_DisplayTitle->SetHelpText(_("Add title to top of PDF"));
203  m_DisplayTitle->SetToolTip(_("Add title bar to the PDF with sequence name and range."));
204  itemBoxSizer13->Add(m_DisplayTitle, 0, wxALIGN_TOP|wxALL, 5);
205 
206  m_InfoSizer = new wxBoxSizer(wxVERTICAL);
207  itemBoxSizer2->Add(m_InfoSizer, 0, wxGROW|wxALL, 5);
208 
209  m_Info = new wxStaticText( itemDialog1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
210  m_InfoSizer->Add(m_Info, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);
211 
212  itemBoxSizer2->Add(5, 1, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
213 
214  wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL);
215  itemBoxSizer2->Add(itemBoxSizer19, 0, wxALIGN_RIGHT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
216 
217  m_SaveButton = new wxButton( itemDialog1, ID_SAVE, _("Save"), wxDefaultPosition, wxDefaultSize, 0 );
218  itemBoxSizer19->Add(m_SaveButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5);
219 
220  m_OpenButton = new wxButton( itemDialog1, ID_OPEN, _("Save && Open"), wxDefaultPosition, wxDefaultSize, 0 );
221  itemBoxSizer19->Add(m_OpenButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5);
222 
223  wxButton* itemButton22 = new wxButton( itemDialog1, ID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
224  itemBoxSizer19->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5);
225 
226  // Set validators
227  m_SeqRangeBox->SetValidator( CRegexpValidator("^[ \t]*[1-9][0-9,]*[ \t]*[kKmM]?((([ \t]*([-:]|\\.\\.)[ \t]*)|([ \t]+))[1-9][0-9,]*[ \t]*[kKmM]?)?[ \t]*$","1000\n1000-2000\n1000..2000\n10,000:2,000,000\n100k:1m\n1000 2000\n1000 2000" , & m_SeqRange) );
228 ////@end CwxSavePdfDlg content construction
229 }
230 
232 {
233  m_OrgRange.Set(from, to);
234  string range_str = NStr::NumericToString(from + 1, NStr::fWithCommas);
235  range_str += "-";
236  range_str += NStr::NumericToString(to, NStr::fWithCommas);
237  m_SeqRange = ToWxString(range_str);
238  //m_SeqRangeBox->SetValue(m_SeqRange);
239  m_Panel->TransferDataToWindow();
240 
242  m_Pane->GetDataSource()->GetBioseqHandle().GetSeqId();
243  id->GetLabel(&m_FileName, objects::CSeq_id::eContent);
244  wxString path = ToWxString(m_Path);
245  path += wxFileName::GetPathSeparator();
246  path += ToStdString(m_FileName + ".pdf");
247  m_FileNameBox->SetValue(path);
248 }
249 
250 
252 {
253  m_VP = vp;
254 }
255 
256 
258 {
259  return true;
260 }
261 
262 wxBitmap CwxSavePdfDlg::GetBitmapResource( const wxString& name )
263 {
264  return wxArtProvider::GetBitmap(name);
265 }
266 wxIcon CwxSavePdfDlg::GetIconResource( const wxString& name )
267 {
268  // Icon retrieval
269 ////@begin CwxSavePdfDlg icon retrieval
270  wxUnusedVar(name);
271  return wxNullIcon;
272 ////@end CwxSavePdfDlg icon retrieval
273 }
274 
275 
276 void CwxSavePdfDlg::OnOpenClick( wxCommandEvent& event )
277 {
278  m_OpenPdf = true;
279  OnSaveClick(event);
280 }
281 
282 
283 void CwxSavePdfDlg::OnSaveClick( wxCommandEvent& event )
284 {
285  if ( !m_Pane ) return;
286 
287  if ( !Validate() ) {
288  NcbiMessageBox("The input range is invlaid!");
289  return;
290  }
291 
292  m_Panel->TransferDataFromWindow();
293  m_NewFrom = 0;
294  m_NewTo = 0;
295 
296  // validate sequence range
298  NcbiMessageBox("The input range is invalid!");
299  return;
300  }
301 
302  // validate file path
303  wxFileName file(m_FileNameBox->GetValue());
304  wxString filename = file.GetFullName();
305  wxString n = filename.Lower();
306  size_t pos = filename.rfind(wxT(".pdf"));
307  if (pos != string::npos) {
308  filename = filename.SubString(0, pos-1);
309  }
310  wxString path = file.GetPath();
311 
312  if (path.IsEmpty()) {
313  NcbiMessageBox("A directory must be specified!");
314  return;
315  }
316  else if (!wxFileName::DirExists(path) ) {
317  NcbiMessageBox("The given directory doesn't exist!");
318  return;
319  }
320  else if (filename.IsEmpty()) {
321  NcbiMessageBox("A file name must be specified!");
322  return;
323  }
324 
325  m_Path = ToStdString(path);
326  m_FileName = ToStdString(filename);
327  string full_path = CDir::ConcatPath(m_Path, m_FileName + ".pdf");
328 
329  // Make sure directory is writable:
330  CDir dir(m_Path);
331  if (!dir.CheckAccess(CDirEntry::fWrite)) {
332  NcbiMessageBox("Error - You do not have write permission to the directory: " + m_Path);
333  return;
334  }
335 
336  if (!m_UserSelectedFilename) {
337  // Warn user if file exists. If the file was selected from the file selection
338  // dialog we do not need to do this (if not the file came from the registry and probably
339  // does already exist)
340  CFile f(full_path);
341  if (f.Exists()) {
342  if (!f.CheckAccess(CDirEntry::fWrite)) {
343  NcbiMessageBox("Error - You do not have write permission to the file: " + full_path);
344  return;
345  }
346 
347  int choice = wxMessageBox(wxT("Selected file already exists. Are you sure you want to overwrite it?"),
348  wxT("Warning"), wxYES_NO | wxICON_ERROR, this);
349  if (choice != wxYES) {
350  return;
351  }
352  }
353  }
354 
355  m_NewImgWidth =
356  (TVPUnit)((double)m_VP.Width() / m_OrgRange.GetLength() * (m_NewTo - m_NewFrom + 1));
357 
358  if (m_NewImgWidth > kMaxPdfSize) {
359  string msg = "The Image is too wide. The projected width is ";
361  msg += " which is over the limit (";
363  msg += "pixels) permitted!";
364  NcbiMessageBox(msg);
365  return;
366  }
367 
368  // add a progress bar to indicate that data are being updated
369  m_Info->SetLabel(_("Preparing data... Please Wait!"));
370  m_ProgressBar = new CIndProgressBar(this, wxID_ANY, wxDefaultPosition, 240);
371  m_InfoSizer->Add(m_ProgressBar, 0, wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5);
372  m_InfoSizer->Layout();
373  Layout();
374  m_Panel->Enable(false);
375  m_OpenButton->Enable(false);
376  m_SaveButton->Enable(false);
378 
379  // start the timer to check if the data loading is finished
380  m_Timer.Start(300);
381 }
382 
383 
384 void CwxSavePdfDlg::OnTimer(wxTimerEvent&)
385 {
386  if (m_State == eReadyToSave) {
387  m_Timer.Stop();
388  m_State = eInitial;
389  //m_Pane->AdjustViewPortHeightToImage();
390  CPdfGrabber grb_pdf(*m_Pane);
391 
392  if (m_DisplayTitle->GetValue()) {
393  // Get height of title (if chosen) so that it can be added to the final output size
394  TModelUnit title_height = m_Pane->GetConfig()->GetTitleFont()->TextHeight() + TModelUnit(2) -
396  grb_pdf.SetTitleHeight(title_height);
397  }
398  else {
399  grb_pdf.SetTitleHeight(0);
400  }
401 
402  grb_pdf.SetOutputInfo(m_Path, m_FileName, "pdf");
403  grb_pdf.DisableGouraudShading(m_SaveSimplified->GetValue());
405  grb_pdf.GrabImages(0/*dummy value, not used currently*/);
406 
407  // Set the cursor to its value prior to the save
408  SetCursor(*wxSTANDARD_CURSOR);
409  if (res == IImageGrabber::eOpenGLError) {
410  wxMessageBox(wxT("Graphics system does not support in-memory image save feature"),
411  wxT("Error Saving"), wxOK);
412  } else if (res == IImageGrabber::eFileError) {
413  wxMessageBox(wxT("File error occured during save. Make sure file and directory names are valid."),
414  wxT("Error Saving"), wxOK);
415  } else if (m_OpenPdf) {
416  // May vary from actual name if user did not end file name with ".pdf"
417  wxString full_path = ToWxString(CDir::ConcatPath(m_Path, m_FileName + ".pdf"));
418  wxLaunchDefaultApplication(full_path);
419  m_OpenPdf = false;
420  }
421  EndModal(wxID_CANCEL);
422  } else if (m_State == eLoadingData && m_Pane->AllJobsFinished()) {
423  m_Timer.Stop();
424  m_Info->SetLabel(_("Saving image to PDF..."));
425  m_ProgressBar->Show(false);
426  m_Timer.Start(100);
428  SetCursor(*wxHOURGLASS_CURSOR);
429  } else if (m_State == eCreatingTracks && m_Pane->AllTracksCreated()) {
434  }
435 }
436 
437 static const string kSavePdfBaseKey("GBPlugins.SavePdfDialog");
438 static const string kPdfPathKey = "PdfPath";
439 
441 {
444  string file_path = view.GetString(kPdfPathKey, "");
445 
446  wxFileName file(ToWxString(file_path));
447  wxString filename = file.GetFullName();
448  wxString path = file.GetPath();
449 
450  if ( !path.empty() && wxFileName::DirExists(path) ) {
451  m_Path = file_path;
452  } else {
453  // create a default path under user folder
454  m_Path = ToStdString(wxGetHomeDir());
455  }
456 }
457 
458 
460 {
461  if ( !m_Path.empty() ) {
464  view.Set(kPdfPathKey, m_Path);
465  }
466 }
467 
468 
469 void CwxSavePdfDlg::OnFilepathClick( wxCommandEvent& event )
470 {
471  string full_name = ToAsciiStdString(m_FileNameBox->GetValue());
472 
473  // If full_name is just a directory
474  string path = full_name;
475  string fname;
476 
477  CFile f(ToAsciiStdString(m_FileNameBox->GetValue()));
478  // If full_name is a valid directory and (existing) file
479  if (f.IsFile()) {
480  path = f.GetDir();
481  fname = f.GetName();
482  }
483  else if (!f.IsDir()) {
484  string d = f.GetDir();
485  CDir dir(d);
486  // if file_name is valid direcotry and not-yet-created file:
487  if (dir.IsDir()) {
488  path = f.GetDir();
489  fname = f.GetName();
490  }
491  }
492 
493  wxFileDialog dlg(this, wxT("Set File Name"),
494  ToWxString(path), ToWxString(fname),
495  wxT("*.pdf"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
496 
497  if (dlg.ShowModal() != wxID_OK)
498  return;
499 
500  wxString filename = dlg.GetPath();
501  m_FileNameBox->SetValue(filename);
502  m_FileName = dlg.GetFilename();
503  m_Path = dlg.GetDirectory();
504  m_UserSelectedFilename = true;
505 }
506 
507 
508 void CwxSavePdfDlg::OnCancelClick( wxCommandEvent& event )
509 {
510  // Cancel all jobs
511  m_Timer.Stop();
512  EndModal(wxID_CANCEL);
513 }
514 
515 
517 {
518  string pos_str = ToStdString(m_SeqRange);
519  long f, t;
520  bool valid = CSeqUtils::StringToRange(pos_str, f, t);
521  if (valid && f > 0 && t > 0) {
522  from = (TSeqPos)(f - 1);
523  to = (TSeqPos)t;
524  return true;
525  }
526  return false;
527 }
528 
529 void CwxSavePdfDlg::OnTextctrl5TextUpdated( wxCommandEvent& event )
530 {
531  m_UserSelectedFilename = false;
532  event.Skip();
533 }
534 
536 
537 
static static static static wxID_ANY
bool m_OpenPdf
view PDF file after finished.
bool Create(wxWindow *parent, wxWindowID id=10048, const wxString &caption=_("Save Image As PDF"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(440, 210), long style=wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Use commas as thousands separator.
Definition: ncbistr.hpp:269
bool AllJobsFinished() const
TReadView GetReadView(const string &section, const string &delim=CGuiRegistry::kDecimalDot) const
get a read-only view at a particular level.
Definition: registry.cpp:1155
static const unsigned char msg[]
Definition: ccm.c:378
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:1124
GLdouble TModelUnit
Definition: gltypes.hpp:48
void OnSaveClick(wxCommandEvent &event)
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:844
static TVPUnit kMaxPdfSize
wxBoxSizer * m_InfoSizer
END_EVENT_TABLE()
#define ID_TEXTCTRL6
position_type GetLength(void) const
Definition: range.hpp:158
CIndProgressBar * m_ProgressBar
wxString ToWxString(const char *s)
Definition: wx_utils.hpp:157
wxCheckBox * m_SaveSimplified
virtual eCaptureResult GrabImages(int tex_size, IImageGrabberProgress *p=NULL)
Grab the requested images.
Definition: pdf_grabber.cpp:61
#define ID_TEXTCTRL5
string GetDir(EIfEmptyPath mode=eIfEmptyPath_Current) const
Get the directory component for this directory entry.
Definition: ncbifile.cpp:465
int TVPUnit
Definition: gltypes.hpp:47
bool CheckAccess(TMode access_mode) const
Check access rights.
Definition: ncbifile.cpp:1714
void OnOpenClick(wxCommandEvent &event)
wxButton * m_OpenButton
#define NULL
Definition: ncbistd.hpp:225
static const unsigned char res[3][32]
Definition: ccm.c:389
void SetOutputInfo(const std::string &dir, const std::string &base_name, const std::string &img_format)
Set file output information.
wxTextCtrl * m_SeqRangeBox
T Width() const
Definition: glrect.hpp:86
FILE * file
class CSeqGraphicPane
string ToAsciiStdString(const wxString &input)
Definition: wx_utils.hpp:150
wxButton * m_SaveButton
void UpdateData(TSeqPos from, TSeqPos to)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
CRef< CSeqGraphicConfig > GetConfig()
TThisType & Set(position_type from, position_type to)
Definition: range.hpp:188
wxBitmap GetBitmapResource(const wxString &name)
void SetSeqRange(TSeqPos from, TSeqPos to)
void OnCancelClick(wxCommandEvent &event)
void SetViewportWidth(TSeqPos from, TSeqPos to, TVPUnit vp_width)
CRef< CGlTextureFont > GetTitleFont() const
CFile –.
Definition: ncbifile.hpp:1574
objects::CBioseq_Handle GetBioseqHandle(void) const
Get the underlying bioseq handle.
CDir –.
Definition: ncbifile.hpp:1665
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
CSGSequenceDS * GetDataSource(void)
TSeqRange m_OrgRange
string GetName(void) const
Get the base entry name with extension (if any).
Definition: ncbifile.hpp:3855
virtual bool Exists(void) const
Check existence of file.
Definition: ncbifile.hpp:3977
void AdjustViewPortHeightToImage()
wxTextCtrl * m_FileNameBox
static bool StringToRange(const string &range_str, long &from, long &to)
Convert a range string to a range.
Definition: utils.cpp:1086
int size
Write permission.
Definition: ncbifile.hpp:1137
string GetString(const string &key, const string &default_val=kEmptyStr, const string &delim=CGuiRegistry::kDecimalDot) const
Definition: registry.cpp:1412
EDialogReturnValue NcbiMessageBox(const string &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const string &title="Error", EDialogTextMode text_mode=eRaw)
Definition: message_box.cpp:48
TReadWriteView GetReadWriteView(const string &section, const string &delim=CGuiRegistry::kDecimalDot)
get a read-write view at a particular level.
Definition: registry.cpp:1200
CSeqGraphicPane * m_Pane
static const string kPdfPathKey
void DisableGouraudShading(bool b)
Set to true force all triangles to be printed flat (no shadingtype 4) This makes the file compatible ...
#define ID_PANEL3
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock, CFileIO, CFileReader, CFileWriter, CFileReaderWriter, CFileException.
void OnTimer(wxTimerEvent &)
#define ID_CHECKBOX6
static void Init(void)
Definition: cursor6.c:79
#define wxT(x)
Definition: muParser.cpp:41
bool AllTracksCreated() const
#define ID_OPEN
void SaveSettings() const
yy_size_t n
void Set(const string &key, int val, const string &delim=CGuiRegistry::kDecimalDot)
access a named key at this level, with no recursion
Definition: registry.cpp:1813
#define ID_SAVE
static const string kSavePdfBaseKey("GBPlugins.SavePdfDialog")
void OnTextctrl5TextUpdated(wxCommandEvent &event)
bool x_GetSeqRange(TSeqPos &from, TSeqPos &to) const
wxStaticText * m_Info
#define ID_CANCEL
#define ID_BITMAPBUTTON
void SetTitleHeight(TModelUnit h)
Set size for optional pdf title.
Definition: pdf_grabber.hpp:83
virtual TModelUnit TextHeight(void) const
wxCheckBox * m_DisplayTitle
wxIcon GetIconResource(const wxString &name)
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
Definition: ncbifile.cpp:771
void SetViewport(const TVPRect &vp)
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:145
void OnFilepathClick(wxCommandEvent &event)
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
virtual TModelUnit GetFontDescender() const
bool IsFile(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a file.
Definition: ncbifile.hpp:3879
static string NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:4277
static bool ShowToolTips()
#define ID_CHECKBOX7
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
Definition: ncbifile.hpp:3885
Modified on Mon Oct 16 16:16:16 2017 by modify_doxy.py rev. 546573