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

Go to the SVN repository for this file.

1 #ifndef GUI_CORE___FILE_LOAD_PANEL__HPP
2 #define GUI_CORE___FILE_LOAD_PANEL__HPP
3 
4 /* $Id: file_load_panel.hpp 41045 2018-05-15 19:36:32Z katargir $
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: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 #include <corelib/ncbistl.hpp>
35 #include <corelib/ncbistd.hpp>
36 
37 
38 #include <wx/panel.h>
39 
41 
42 ////@begin includes
43 #include "wx/html/htmlwin.h"
44 ////@end includes
45 
46 ////@begin forward declarations
47 class CMultiFileInput;
48 class CwxHtmlWindow;
49 ////@end forward declarations
50 
51 class wxChoice;
52 class wxStaticBox;
53 
54 ////@begin control identifiers
55 #define SYMBOL_CFILELOADPANEL_STYLE wxTAB_TRAVERSAL
56 #define SYMBOL_CFILELOADPANEL_TITLE _("File Load Option Panel")
57 #define SYMBOL_CFILELOADPANEL_IDNAME ID_CFILELOADPANEL
58 #define SYMBOL_CFILELOADPANEL_SIZE wxSize(400, 300)
59 #define SYMBOL_CFILELOADPANEL_POSITION wxDefaultPosition
60 ////@end control identifiers
61 
62 
64 
65 class CMultiFileInput;
66 class CwxHtmlWindow;
67 class CFileLoadWizard;
68 
69 class CFileLoadPanel: public wxPanel
70 {
71  DECLARE_DYNAMIC_CLASS( CFileLoadPanel )
72  DECLARE_EVENT_TABLE()
73 
74 public:
76  CFileLoadPanel( wxWindow* parent, wxWindowID id = SYMBOL_CFILELOADPANEL_IDNAME, const wxPoint& pos = SYMBOL_CFILELOADPANEL_POSITION, const wxSize& size = SYMBOL_CFILELOADPANEL_SIZE, long style = SYMBOL_CFILELOADPANEL_STYLE );
77 
78  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CFILELOADPANEL_IDNAME, const wxPoint& pos = SYMBOL_CFILELOADPANEL_POSITION, const wxSize& size = SYMBOL_CFILELOADPANEL_SIZE, long style = SYMBOL_CFILELOADPANEL_STYLE );
79 
81 
82  void Init();
83 
84  void CreateControls();
85 
86 ////@begin CFileLoadPanel event handler declarations
87 
88  /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE
89  void OnFormatListSelected( wxCommandEvent& event );
90 
91  /// wxEVT_COMMAND_HTML_LINK_CLICKED event handler for ID_HTMLWINDOW
92  void OnMRUWindowLinkClicked( wxHtmlLinkEvent& event );
93 
94 ////@end CFileLoadPanel event handler declarations
95 
96 ////@begin CFileLoadPanel member function declarations
97 
98  /// Retrieves bitmap resources
99  wxBitmap GetBitmapResource( const wxString& name );
100 
101  /// Retrieves icon resources
102  wxIcon GetIconResource( const wxString& name );
103 ////@end CFileLoadPanel member function declarations
104 
105  static bool ShowToolTips();
106 
107 ////@begin CFileLoadPanel member variables
108  wxChoice* m_FormatList;
111  /// Control identifiers
112  enum {
114  ID_CHOICE = 10007,
115  ID_FILE_INPUT = 10010,
116  ID_HTMLWINDOW = 10056
117  };
118 ////@end CFileLoadPanel member variables
119 
120 public:
121  void SetManager(CFileLoadWizard* manager);
122 
123  void SelectFormat(int format);
124  int GetSelectedFormat();
125 
126  void SetWorkDir(const wxString& workDir);
127 
128  void GetFilenames(vector<wxString>& filenames) const;
129  void SetFilenames(const vector<wxString>& filenames);
130 
131  void OnLoadFiles(wxCommandEvent& event);
132  void OnActivatePanel();
133 
134 protected:
135  void x_SetCurrentFormat(int index);
136  void x_FillMRUList();
137  void x_LoadMRUFile(int index);
138 
139 protected:
142 
143  vector<CFileLoadDescriptor> m_MRUFilenames;
146  wxString m_MRUFile;
147 };
148 
149 
151 
152 #endif // GUI_CORE___FILE_LOAD_PANEL__HPP
bool Create(wxWindow *parent, wxWindowID id=ID_CFILELOADPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
void SetWorkDir(const wxString &workDir)
vector< CFileLoadDescriptor > m_MRUFilenames
void OnFormatListSelected(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE
void SetManager(CFileLoadWizard *manager)
void x_LoadMRUFile(int index)
void x_SetCurrentFormat(int index)
CFileLoadWizard * m_Manager
CMultiFileInput * m_FileInput
void OnLoadFiles(wxCommandEvent &event)
wxChoice * m_FormatList
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnMRUWindowLinkClicked(wxHtmlLinkEvent &event)
wxEVT_COMMAND_HTML_LINK_CLICKED event handler for ID_HTMLWINDOW
CwxHtmlWindow * m_MRUWindow
static bool ShowToolTips()
void SelectFormat(int format)
void GetFilenames(vector< wxString > &filenames) const
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void SetFilenames(const vector< wxString > &filenames)
CMultiFileInput.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define SYMBOL_CFILELOADPANEL_POSITION
#define SYMBOL_CFILELOADPANEL_SIZE
#define SYMBOL_CFILELOADPANEL_IDNAME
#define SYMBOL_CFILELOADPANEL_STYLE
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const struct ncbi::grid::netcache::search::fields::SIZE size
The NCBI C++/STL use hints.
static Format format
Definition: njn_ioutil.cpp:53
static int filenames
Definition: pcregrep.c:172
Modified on Tue Jun 18 13:40:14 2024 by modify_doxy.py rev. 669887