NCBI C++ ToolKit
save_images_setup_dlg.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_WX___SAVE_IMAGES_SETUP_DLG_WX__HPP
2 #define GUI_WIDGETS_WX___SAVE_IMAGES_SETUP_DLG_WX__HPP
3 
4 /* $Id: save_images_setup_dlg.hpp 27937 2013-04-26 13:38:43Z falkrb $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Bob Falk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 #include <gui/gui_export.h>
37 
39 
40 #include <wx/defs.h>
41 
42 #include <wx/dialog.h>
43 #include <wx/cmndata.h>
44 #include <wx/prntbase.h>
45 #include <wx/printdlg.h>
46 #include <wx/listctrl.h>
47 
48 class wxTextCtrl;
49 class wxButton;
50 class wxCheckBox;
51 class wxComboBox;
52 class wxStaticText;
53 class wxRadioBox;
54 class wxSlider;
55 class wxPageSetupData;
56 
58 
60 class IImageGrabber;
61 class CImage;
62 
64 {
65 public:
67  eDirSelectID = eLastPreviewSetupID + 1,
72  eSizeRatioID
73  };
74 
76  IImageGrabber* img_saver,
77  wxWindow *parent = NULL);
78  virtual ~CSaveImagesSetupDlg();
79 
80  virtual bool TransferDataFromWindow();
81  virtual bool TransferDataToWindow();
82 
83  /// @name wxWidgets events implementation
84  /// @{
85  void OnPrinter(wxCommandEvent& event);
86  void OnDirSelect(wxCommandEvent& event);
87  void OnImageTypeChange(wxCommandEvent& event);
88  void OnSave(wxCommandEvent& event);
89  void OnPreview(wxCommandEvent& event);
90  /// Called to update image on screen
91  void OnFileTextChange(wxCommandEvent& evt);
92  void OnTilePreview(wxCommandEvent& event);
93  /// @}
94 
95  void UpdateMargins();
96 
97  std::string GetDirectoryName() const;
98  std::string GetFileRootName() const;
99  std::string GetImageFormat() const;
100  std::string GetNumberingFormat() const;
101  std::string GetOutputFormat() const;
102 
103 protected:
104  virtual void x_Init(wxBoxSizer* mainsizer, int widget_width);
105 
106  // Get aspect ratio from s_ImageAspectRatios[] using value from m_SizeRatio.
107  // Invert this ratio if output image aspect ratio (w/h) > 1.
108  float x_getAspectRatio() const;
109 
110  /// Directory in which to save the image
111  wxTextCtrl* m_Directory;
112  wxButton* m_DirSelectButton;
113  /// Part of file name before image number
114  wxTextCtrl* m_FileRootName;
115  /// Image save format (jpeg, png...)
116  wxComboBox* m_ImageFormat;
117  /// How the numbers are included in filenames, e.g. img_{1..n} or img_x_y;
118  wxComboBox* m_NumberingFormat;
119  /// Size ratio derived from ouput format - US Letter, A4, ...
120  wxComboBox* m_SizeRatio;
121  /// Aspect ratios for image sizes (w/h)
122  static const float s_ImageAspectRatios[3];
123 
124  /// Output size (this will be the size of larger dimension in output images)
125  wxComboBox* m_ImageSizes;
126 
127  // Interface to object which renders and saves images
129 
130 
131 private:
132  DECLARE_EVENT_TABLE()
133  DECLARE_DYNAMIC_CLASS_NO_COPY(CSaveImagesSetupDlg)
134 };
135 
136 
138 
139 #endif //GUI_WIDGETS_WX___SAVE_IMAGES_SETUP_DLG_WX__HPP
CImage –.
Definition: Image.hpp:66
virtual void UpdateMargins()
virtual bool TransferDataFromWindow()
virtual void OnPrinter(wxCommandEvent &event)
virtual void x_Init(wxBoxSizer *, int)
Provide virtual hook for subclasses to add their own controls below the main controls.
virtual bool TransferDataToWindow()
wxTextCtrl * m_Directory
Directory in which to save the image.
wxComboBox * m_SizeRatio
Size ratio derived from ouput format - US Letter, A4, ...
wxComboBox * m_ImageSizes
Output size (this will be the size of larger dimension in output images)
wxTextCtrl * m_FileRootName
Part of file name before image number.
wxComboBox * m_ImageFormat
Image save format (jpeg, png...)
wxComboBox * m_NumberingFormat
How the numbers are included in filenames, e.g. img_{1..n} or img_x_y;.
Include a standard set of the NCBI C++ Toolkit most basic headers.
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_WX_EXPORT
Definition: gui_export.h:543
Defines to provide correct exporting from DLLs in Windows.
Modified on Fri May 24 14:55:54 2024 by modify_doxy.py rev. 669887