36 #include <wx/filename.h>
37 #include <wx/msgdlg.h>
38 #include <wx/checkbox.h>
39 #include <wx/filedlg.h>
41 #include <wx/artprov.h>
42 #include <wx/valgen.h>
78 : m_AlnMultiWidget(widget)
88 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
89 wxDialog::Create( parent,
id, caption, pos,
size, style );
104 path += wxFileName::GetPathSeparator();
143 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
144 itemDialog1->SetSizer(itemBoxSizer2);
146 m_Panel =
new wxPanel( itemDialog1,
ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
148 itemBoxSizer2->Add(
m_Panel, 0, wxALIGN_CENTER_HORIZONTAL, 5);
150 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer(wxVERTICAL);
151 m_Panel->SetSizer(itemBoxSizer4);
153 wxBoxSizer* itemBoxSizer5 =
new wxBoxSizer(wxHORIZONTAL);
154 itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
156 wxStaticText* itemStaticText6 =
new wxStaticText(
m_Panel, wxID_STATIC,
_(
"Save As:"), wxDefaultPosition, wxSize(100, -1), wxALIGN_RIGHT );
157 itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
160 itemBoxSizer5->Add(
m_FileNameBox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
163 itemBitmapButton8->SetHelpText(
_(
"Select File"));
165 itemBitmapButton8->SetToolTip(
_(
"Select File"));
166 itemBoxSizer5->Add(itemBitmapButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
168 wxBoxSizer* itemBoxSizer1 =
new wxBoxSizer(wxHORIZONTAL);
169 itemBoxSizer4->Add(itemBoxSizer1, 0, wxGROW|wxLEFT|wxRIGHT, 5);
171 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxVERTICAL);
172 itemBoxSizer4->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
183 m_SaveSimplified->SetHelpText(
_(
"Removes gradient shading from some elements to support Adobe Illustrator"));
189 itemBoxSizer2->Add(
m_InfoSizer, 0, wxGROW|wxALL, 5);
191 m_Info =
new wxStaticText( itemDialog1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
194 itemBoxSizer2->Add(5, 1, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 1);
196 wxBoxSizer* itemBoxSizer19 =
new wxBoxSizer(wxHORIZONTAL);
197 itemBoxSizer2->Add(itemBoxSizer19, 0, wxALIGN_RIGHT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
199 m_SaveButton =
new wxButton( itemDialog1,
ID_SAVE,
_(
"Save"), wxDefaultPosition, wxDefaultSize, 0 );
200 itemBoxSizer19->Add(
m_SaveButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5);
202 m_OpenButton =
new wxButton( itemDialog1,
ID_OPEN,
_(
"Save && Open"), wxDefaultPosition, wxDefaultSize, 0 );
203 itemBoxSizer19->Add(
m_OpenButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5);
205 wxButton* itemButton22 =
new wxButton( itemDialog1,
ID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
206 itemBoxSizer19->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5);
225 string path = full_name;
234 else if (!
f.IsDir()) {
235 string d =
f.GetDir();
244 wxFileDialog dlg(
this,
wxT(
"Set File Name"),
248 if (dlg.ShowModal() != wxID_OK)
251 wxString filename = dlg.GetPath();
254 m_Path = dlg.GetDirectory();
260 TransferDataFromWindow();
264 wxString filename =
file.GetFullName();
265 wxString
n = filename.Lower();
267 if (pos != string::npos) {
268 filename = filename.SubString(0, pos - 1);
270 wxString path =
file.GetPath();
272 if (path.IsEmpty()) {
276 else if (!wxFileName::DirExists(path)) {
280 else if (filename.IsEmpty()) {
303 NcbiMessageBox(
"Error - You do not have write permission to the file: " + full_path);
307 int choice = wxMessageBox(
wxT(
"Selected file already exists. Are you sure you want to overwrite it?"),
308 wxT(
"Warning"), wxYES_NO | wxICON_ERROR,
this);
309 if (choice != wxYES) {
330 wxLaunchDefaultApplication(full_path);
344 EndModal(wxID_CANCEL);
353 return wxArtProvider::GetBitmap(name);
374 wxString filename =
file.GetFullName();
375 wxString path =
file.GetPath();
377 if (!path.empty() && wxFileName::DirExists(path)) {
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
static const string & GetFileExtension(EOutputFormat format)
class CRegistryReadView provides a nested hierarchical view at a particular key.
string GetString(const string &key, const string &default_val=kEmptyStr) const
void Set(const string &key, int val)
access a named key at this level, with no recursion
static bool ShowToolTips()
void SaveSettings() const
wxTextCtrl * m_FileNameBox
wxCheckBox * m_SaveSimplified
void OnTextctrl5TextUpdated(wxCommandEvent &event)
CPrintOptions::EOutputFormat m_OutputFormat
bool Create(wxWindow *parent, wxWindowID id=ID_CWXSAVEMULTIALNIMGDLG, const wxString &caption=_("Save Image As "), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(440, 210), long style=wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
void OnSaveClick(wxCommandEvent &event)
CwxExportAlnmultiImgDlg()
wxIcon GetIconResource(const wxString &name)
wxBitmap GetBitmapResource(const wxString &name)
CAlnMultiWidget * m_AlnMultiWidget
void OnCancelClick(wxCommandEvent &event)
void OnFilepathClick(wxCommandEvent &event)
bool m_SimplifiedGraphics
~CwxExportAlnmultiImgDlg()
void OnOpenClick(wxCommandEvent &event)
wxCheckBox * m_DisplayHeaderRow
bool m_UserSelectedFilename
view file after finished.
virtual TNumrow GetNumRows(void) const =0
number of rows in alignment
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
bool CheckAccess(TMode access_mode) const
Check access rights.
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
@ fWrite
Write permission.
EDialogReturnValue NcbiMessageBox(const string &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const string &title="Error", EDialogTextMode text_mode=eRaw)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string & ToUpper(string &str)
Convert string to upper case – string& version.
const struct ncbi::grid::netcache::search::fields::SIZE size
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
static void SetTitle(CRef< CSeq_entry > entry, string title)
static const string kExportAlnmultiImagePathKey
static const string kExportAlnmultiImageBaseKey("GBPlugins.ExportAlnmultiImageDialog")
#define SYMBOL_CWXEXPORTALNMULTIIMGDLG_TITLE
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
string ToAsciiStdString(const wxString &input)