NCBI C++ ToolKit
srcmod_edit_panel.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: srcmod_edit_panel.cpp 42655 2019-03-28 20:17:09Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Colleen Bollin
27  */
28 
29 #include <ncbi_pch.hpp>
37 
40 
41 
43 {
44  EEditorType rval = eText;
45  switch (st) {
51  rval = eCheckbox;
52  break;
54  rval = eAltitude;
55  break;
57  rval = eLatLon;
58  break;
59  default:
60  break;
61  }
62  return rval;
63 }
64 
65 
67 {
68  EEditorType rval = eText;
69  switch (st) {
73  rval = eVoucher;
74  break;
75  default:
76  break;
77  }
78  return rval;
79 }
80 
81 
83 {
84  wxWindow* parent = this->GetParent();
85 
86  CSrcModPanel* mod_panel = dynamic_cast<CSrcModPanel*>(parent);
87 
88  while (parent && !mod_panel) {
89  parent = parent->GetParent();
90  mod_panel = dynamic_cast<CSrcModPanel*>(parent);
91  }
92 
93  if (mod_panel) {
94  mod_panel->OnEditorChange();
95  }
96 }
97 
98 
101 {
102  CSrcModEditPanel* rval = NULL;
103  switch (editor_type) {
105  rval = new CVoucherPanel(parent);
106  break;
108  rval = new CSrcModTextPanel(parent);
109  break;
111  rval = new CSrcModCheckboxPanel(parent);
112  break;
114  rval = new CAltitudePanel(parent);
115  break;
117  rval = new CLatLonPanel(parent);
118  break;
119  }
120  return rval;
121 }
122 
123 
124 
static CSrcModEditPanel * Create(wxWindow *parent, CSrcModEditPanel::EEditorType editor_type)
static EEditorType GetEditorTypeForSubSource(objects::CSubSource::TSubtype st)
static EEditorType GetEditorTypeForOrgMod(objects::COrgMod::TSubtype st)
void OnEditorChange()
#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
@ eSubtype_lat_lon
+/- decimal degrees
Definition: SubSource_.hpp:113
@ eSubtype_environmental_sample
Definition: SubSource_.hpp:111
@ eSubtype_specimen_voucher
Definition: OrgMod_.hpp:106
@ eSubtype_bio_material
Definition: OrgMod_.hpp:119
@ eSubtype_culture_collection
Definition: OrgMod_.hpp:118
USING_SCOPE(objects)
Modified on Mon Apr 22 04:06:07 2024 by modify_doxy.py rev. 669887