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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___PUBLICATIONTYPE_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___PUBLICATIONTYPE_PANEL__HPP
3 
4 /* $Id: publicationtype_panel.hpp 44569 2020-01-22 20:33:17Z filippov $
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: Colleen Bollin
30  */
31 
32 #include <corelib/ncbistd.hpp>
33 
34 #include <objects/seq/Pubdesc.hpp>
41 #include <objects/pub/Pub.hpp>
42 
47 
48 /*!
49  * Includes
50  */
51 
52 ////@begin includes
53 #include "wx/notebook.h"
54 ////@end includes
55 
56 #include <wx/radiobox.h>
57 #include <wx/checkbox.h>
58 #include <wx/panel.h>
59 #include <wx/frame.h>
60 
61 /*!
62  * Forward declarations
63  */
64 
65 ////@begin forward declarations
66 class wxNotebook;
67 ////@end forward declarations
68 
69 class CPublisherPanel;
70 class CJournalPanel;
71 class CPatentPanel;
72 class CCitSubPanel;
73 
76 class CCit_gen;
77 class CCit_art;
78 
79 /*!
80  * Control identifiers
81  */
82 
83 ////@begin control identifiers
84 #define ID_PUBLICATIONTYPE 10018
85 #define ID_UNPUB_INPRESS_PUB 10019
86 #define ID_PUBCLASS 10020
87 #define ID_TREEBOOK 10017
88 #define ID_DOI_LOOKUP 10021
89 #define ID_DOI_PMID 10022
90 
91 #define SYMBOL_CPUBLICATIONTYPEPANEL_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
92 #define SYMBOL_CPUBLICATIONTYPEPANEL_TITLE _("PublicationType")
93 #define SYMBOL_CPUBLICATIONTYPEPANEL_IDNAME ID_PUBLICATIONTYPE
94 #define SYMBOL_CPUBLICATIONTYPEPANEL_SIZE wxSize(400, 400)
95 #define SYMBOL_CPUBLICATIONTYPEPANEL_POSITION wxDefaultPosition
96 ////@end control identifiers
97 
98 
99 /*!
100  * CPublicationTypePanel class declaration
101  */
102 
103 class CPublicationTypePanel: public wxPanel, public IDescEditorPanel, public CImportExportAccess
104 {
105  DECLARE_DYNAMIC_CLASS( CPublicationTypePanel )
106  DECLARE_EVENT_TABLE()
107 
108 public:
109  /// Constructors
111  CPublicationTypePanel( wxWindow* parent, CRef<objects::CPubdesc> pubdesc,
112  bool create_mode,
113  wxWindowID id = SYMBOL_CPUBLICATIONTYPEPANEL_IDNAME,
114  const wxPoint& pos = SYMBOL_CPUBLICATIONTYPEPANEL_POSITION,
115  const wxSize& size = SYMBOL_CPUBLICATIONTYPEPANEL_SIZE,
116  long style = SYMBOL_CPUBLICATIONTYPEPANEL_STYLE );
117 
118  /// Creation
119  bool Create( wxWindow* parent,
120  wxWindowID id = SYMBOL_CPUBLICATIONTYPEPANEL_IDNAME,
121  const wxPoint& pos = SYMBOL_CPUBLICATIONTYPEPANEL_POSITION,
122  const wxSize& size = SYMBOL_CPUBLICATIONTYPEPANEL_SIZE,
123  long style = SYMBOL_CPUBLICATIONTYPEPANEL_STYLE );
124 
125  /// Destructor
127 
128  /// Initialises member variables
129  void Init();
130 
131  /// Creates the controls and sizers
132  void CreateControls();
133 
134  virtual bool TransferDataToWindow();
135  virtual bool TransferDataFromWindow();
136 
138 
139 ////@begin CPublicationTypePanel event handler declarations
140 
141  /// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_UNPUB_INPRESS_PUB
142  void OnUnpubInpressPubSelected( wxCommandEvent& event );
143 
144  /// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_PUBCLASS
145  void OnPubclassSelected( wxCommandEvent& event );
146 
147  void OnDoiLookup( wxCommandEvent& event );
148 
149 ////@end CPublicationTypePanel event handler declarations
150 
151 ////@begin CPublicationTypePanel member function declarations
152 
153  /// Retrieves bitmap resources
154  wxBitmap GetBitmapResource( const wxString& name );
155 
156  /// Retrieves icon resources
157  wxIcon GetIconResource( const wxString& name );
158 ////@end CPublicationTypePanel member function declarations
159 
160  /// Should we show tooltips?
161  static bool ShowToolTips();
162 
163 ////@begin CPublicationTypePanel member variables
164  wxRadioBox* m_Status;
165  wxRadioBox* m_PubClass;
166  wxNotebook* m_PubdescDetails;
167  wxTextCtrl* m_PmidCtrl;
168  wxButton* m_LookupButton;
169 ////@end CPublicationTypePanel member variables
170 
171  void SetPub(const objects::CPubdesc& pubdesc);
172 
173  // IDescEditorPanel implementation
174  virtual void ChangeSeqdesc(const objects::CSeqdesc& desc);
175  virtual void UpdateSeqdesc(objects::CSeqdesc& desc);
176  virtual bool IsImportEnabled(void);
177  virtual bool IsExportEnabled(void);
178  virtual CRef<CSerialObject> OnExport(void);
179  virtual void OnImport( CNcbiIfstream &istr);
180  void SetFinalValidation(void);
181 
182 private:
186 
187  enum EPubType {
196  };
197 
200  long m_Pmid;
201  long m_Muid;
202 
208 
210  void x_CreateUnpubControls(objects::CCit_gen& cit_gen);
211  void x_CreateJournalArticleControls(objects::CCit_art& art);
212  void x_CreateBookChapterControls(objects::CCit_art& art);
213  void x_CreateBookControls(objects::CCit_book& book, bool is_chapter);
214  void x_CreateProcChapterControls(objects::CCit_art& art);
215  void x_CreateProcControls(objects::CCit_proc& proc);
216  void x_CreateSubControls(objects::CCit_sub& sub);
217  void x_CreatePatentControls(objects::CCit_pat &pat);
218  void x_CreateThesisControls(objects::CCit_let &let);
219  void x_SetStatus (const objects::CImprint& imprint);
221  bool x_CollectAuthors (void);
223  bool x_CollectDetails (void);
224  CRef<CPub> x_PutMainPubFirst(int pubtype, int status);
225 };
226 
229 
230 #endif // GUI_WIDGETS_EDIT___PUBLICATIONTYPE_PANEL__HPP
User-defined methods of the data storage class.
void Init()
Initialises member variables.
void x_CreatePubControls(CRef< objects::CPub > pub)
virtual void ChangeSeqdesc(const objects::CSeqdesc &desc)
void OnDoiLookup(wxCommandEvent &event)
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=10018, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 400), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
virtual void OnImport(CNcbiIfstream &istr)
void x_CreateProcChapterControls(objects::CCit_art &art)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnPubclassSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_PUBCLASS
void x_CreateSubControls(objects::CCit_sub &sub)
CRef< objects::CPubdesc > m_Pubdesc
void SetPub(const objects::CPubdesc &pubdesc)
void x_SetStatusAndClass(CRef< objects::CPub > pub)
void x_SetStatus(const objects::CImprint &imprint)
virtual bool IsImportEnabled(void)
CUnpublishedPanel * m_Unpublished
virtual bool IsExportEnabled(void)
void x_CreateThesisControls(objects::CCit_let &let)
void x_CreateProcControls(objects::CCit_proc &proc)
void OnUnpubInpressPubSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_UNPUB_INPRESS_PUB
void x_CreatePatentControls(objects::CCit_pat &pat)
void x_CreateBookChapterControls(objects::CCit_art &art)
CPublisherPanel * m_PublisherPanel
virtual void UpdateSeqdesc(objects::CSeqdesc &desc)
void x_CreateUnpubControls(objects::CCit_gen &cit_gen)
CRef< CPub > x_PutMainPubFirst(int pubtype, int status)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
virtual CRef< CSerialObject > OnExport(void)
void x_CreateBookControls(objects::CCit_book &book, bool is_chapter)
CRef< objects::CPubdesc > GetPubdesc() const
CRef< objects::CPub > x_GetMainPub(void)
void x_CreateJournalArticleControls(objects::CCit_art &art)
void CreateControls()
Creates the controls and sizers.
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * proc
Definition: stats.c:21
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CPUBLICATIONTYPEPANEL_POSITION
#define SYMBOL_CPUBLICATIONTYPEPANEL_SIZE
#define SYMBOL_CPUBLICATIONTYPEPANEL_STYLE
#define SYMBOL_CPUBLICATIONTYPEPANEL_IDNAME
Modified on Sat Jul 13 13:40:35 2024 by modify_doxy.py rev. 669887