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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___SRCMOD_LIST_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___SRCMOD_LIST_PANEL__HPP
3 
4 /* $Id: srcmod_list_panel.hpp 42655 2019-03-28 20:17:09Z asztalos $
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: Vasuki Palanigobu
30  */
31 
32 #include <corelib/ncbistd.hpp>
35 #include <wx/panel.h>
36 #include <wx/hyperlink.h>
38 #include "pcr_primers_panel.hpp"
40 #include "wx/hyperlink.h"
41 
42 class wxFlexGridSizer;
43 class wxCheckListBox;
44 
46 
47 /*!
48  * Control identifiers
49  */
50 
51 ////@begin control identifiers
52 #define SYMBOL_CSRCMODLISTPANEL_STYLE wxTAB_TRAVERSAL
53 #define SYMBOL_CSRCMODLISTPANEL_TITLE _("Source Modifiers")
54 #define SYMBOL_CSRCMODLISTPANEL_IDNAME ID_CSRCMODLISTPANEL
55 #define SYMBOL_CSRCMODLISTPANEL_SIZE wxSize(400, 300)
56 #define SYMBOL_CSRCMODLISTPANEL_POSITION wxDefaultPosition
57 ////@end control identifiers
58 #define ID_PCR_CHECKBOX 10032
59 
60 
61 /*!
62  * CSrcModListPanel class declaration
63  */
64 
65 class CSrcModListPanel: public wxPanel
66 {
67  DECLARE_DYNAMIC_CLASS( CSrcModListPanel )
68  DECLARE_EVENT_TABLE()
69 
70 public:
71 
72  using TVecModData = list<CSrcModPanel::SModData>;
73 
74  /// Constructors
76  CSrcModListPanel( wxWindow* parent, objects::CBioSource& source, wxWindowID id = SYMBOL_CSRCMODLISTPANEL_IDNAME, const wxPoint& pos = SYMBOL_CSRCMODLISTPANEL_POSITION, const wxSize& size = SYMBOL_CSRCMODLISTPANEL_SIZE, long style = SYMBOL_CSRCMODLISTPANEL_STYLE );
77 
78  /// Creation
79  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CSRCMODLISTPANEL_IDNAME, const wxPoint& pos = SYMBOL_CSRCMODLISTPANEL_POSITION, const wxSize& size = SYMBOL_CSRCMODLISTPANEL_SIZE, long style = SYMBOL_CSRCMODLISTPANEL_STYLE );
80 
81  /// Destructor
83 
84  /// Initialises member variables
85  void Init();
86 
87  /// Creates the controls and sizers
88  void CreateControls();
89 
90 ////@begin CSrcModListPanel event handler declarations
91 
92  /// wxEVT_COMMAND_HYPERLINK event handler for ID_CLR_SRC_NOTE
93  void OnClrSrcNoteHyperlinkClicked( wxHyperlinkEvent& event );
94 
95  /// wxEVT_COMMAND_HYPERLINK event handler for ID_CLR_ORG_NOTE
96  void OnClrOrgNoteHyperlinkClicked( wxHyperlinkEvent& event );
97 
98 ////@end CSrcModListPanel event handler declarations
99  virtual bool TransferDataToWindow();
100  virtual bool TransferDataFromWindow();
101  void PopulateModifiers(objects::CBioSource& biosrc);
102  void SetSource(const objects::CBioSource& biosrc);
103 
104  void AddLastSrcMod (wxWindow* link);
105 
106 ////@begin CSrcModListPanel member function declarations
107 
108  /// Retrieves bitmap resources
109  wxBitmap GetBitmapResource( const wxString& name );
110 
111  /// Retrieves icon resources
112  wxIcon GetIconResource( const wxString& name );
113 ////@end CSrcModListPanel member function declarations
114 
115  /// Should we show tooltips?
116  static bool ShowToolTips();
117 
118 ////@begin CSrcModListPanel member variables
119  wxScrolledWindow* m_ScrolledWindow;
120  wxFlexGridSizer* m_Sizer;
123  /// Control identifiers
124  enum {
127  ID_TEXTCTRL7 = 10031,
129  ID_TEXTCTRL4 = 10036,
130  ID_CLR_ORG_NOTE = 10038
131  };
132 ////@end CSrcModListPanel member variables
133 
134  void OnDelete (wxHyperlinkEvent& event);
135  void OnPCRCheckBox(wxCommandEvent& event);
136  void OnAddPCRPrimer(wxCommandEvent& event);
137  void OnChangedTaxname(void);
138 
139 private:
148  list<CRef<objects::COrgMod> > m_ReadOnlyQuals;
149 
150  //int m_MaxRowsDisplayed;
155  wxCheckBox* m_PCRCheckbox;
156 
157  void x_FillDataList();
158  void x_UpdateList();
159  void x_SetSrcSubMod(int subtype, const string& value);
160  void x_SetSrcOrgMod(int subtype, const string& value);
161  void x_SetBioSourceModifier(const string& name, const string& value);
162  void x_AddEmptyRow();
163  void x_AddRow(wxString name, wxString value);
164  wxSizerItemList::iterator x_FindRow(wxWindow* wnd, wxSizerItemList& itemList);
165  void x_CollectTextMods ();
166  void x_AddTextSrcMods ();
167  void x_ShowPCRPrimerItems(bool value);
168 };
169 
171 
172 #endif
173  // GUI_WIDGETS_EDIT___SRCMOD_LIST_PANEL__HPP
174 
CRichTextCtrl - a wrapper for wxRichTextCtrl that handles additional keyboard events (such as Clipboa...
void OnPCRCheckBox(wxCommandEvent &event)
void OnAddPCRPrimer(wxCommandEvent &event)
void OnDelete(wxHyperlinkEvent &event)
list< CRef< objects::COrgMod > > m_ReadOnlyQuals
void OnClrSrcNoteHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_CLR_SRC_NOTE
void OnClrOrgNoteHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_CLR_ORG_NOTE
void x_SetSrcOrgMod(int subtype, const string &value)
CSrcModListPanel(wxWindow *parent, objects::CBioSource &source, wxWindowID id=ID_CSRCMODLISTPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
wxSizerItemList::iterator x_FindRow(wxWindow *wnd, wxSizerItemList &itemList)
virtual bool TransferDataFromWindow()
CRef< objects::CBioSource > m_Source
wxScrolledWindow * m_ScrolledWindow
wxBoxSizer * m_PCRPrimersBoxSizer1
CRichTextCtrl * m_OrgNote
void PopulateModifiers(objects::CBioSource &biosrc)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
virtual bool TransferDataToWindow()
CRichTextCtrl * m_SrcInfo
void x_AddRow(wxString name, wxString value)
static bool ShowToolTips()
Should we show tooltips?
wxBoxSizer * m_PCRPrimersBoxSizer2
void CreateControls()
Creates the controls and sizers.
list< CSrcModPanel::SModData > TVecModData
wxFlexGridSizer * m_Sizer
void SetSource(const objects::CBioSource &biosrc)
void x_SetSrcSubMod(int subtype, const string &value)
wxCheckBox * m_PCRCheckbox
CSrcModListPanel()
Constructors.
void x_ShowPCRPrimerItems(bool value)
CPCRPrimersPanel * m_PCRPrimersPanel
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void Init()
Initialises member variables.
wxBoxSizer * m_PCRPrimersBoxSizer3
bool Create(wxWindow *parent, wxWindowID id=ID_CSRCMODLISTPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
void AddLastSrcMod(wxWindow *link)
~CSrcModListPanel()
Destructor.
void x_SetBioSourceModifier(const string &name, const string &value)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#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
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
const CharType(& source)[N]
Definition: pointer.h:1149
#define SYMBOL_CSRCMODLISTPANEL_STYLE
#define SYMBOL_CSRCMODLISTPANEL_IDNAME
#define SYMBOL_CSRCMODLISTPANEL_POSITION
#define SYMBOL_CSRCMODLISTPANEL_SIZE
Modified on Fri May 10 16:27:05 2024 by modify_doxy.py rev. 669887