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

Go to the SVN repository for this file.

1 /* $Id: unreviewed_panel.cpp 47155 2022-09-26 18:13:59Z 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: Andrea Asztalos
27  */
28 
29 
30 #include <ncbi_pch.hpp>
34 
35 #include <wx/checkbox.h>
36 #include <wx/sizer.h>
37 #include <wx/icon.h>
38 
39 
42 
43 /*!
44  * CUnreviewedPanel type definition
45  */
46 
47 IMPLEMENT_DYNAMIC_CLASS( CUnreviewedPanel, wxPanel )
48 
49 
50 /*!
51  * CUnreviewedPanel event table definition
52  */
53 
54 BEGIN_EVENT_TABLE( CUnreviewedPanel, wxPanel )
55 
57 
58 
59 /*!
60  * CUnreviewedPanel constructors
61  */
62 
64 {
65  Init();
66 }
67 
68 CUnreviewedPanel::CUnreviewedPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
69 {
70  Init();
71  Create(parent, id, pos, size, style);
72 }
73 
74 
75 /*!
76  * CUnreviewedPanel creator
77  */
78 
79 bool CUnreviewedPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
80 {
81 ////@begin CUnreviewedPanel creation
82  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
83  wxPanel::Create( parent, id, pos, size, style );
84 
86  if (GetSizer())
87  {
88  GetSizer()->SetSizeHints(this);
89  }
90  Centre();
91 ////@end CUnreviewedPanel creation
92  return true;
93 }
94 
95 
96 /*!
97  * CUnreviewedPanel destructor
98  */
99 
101 {
102 }
103 
104 
105 /*!
106  * Member initialisation
107  */
108 
110 {
111 ////@begin CUnreviewedPanel member initialisation
113 ////@end CUnreviewedPanel member initialisation
114 }
115 
116 
117 /*!
118  * Control creation for CUnreviewedPanel
119  */
120 
122 {
123 ////@begin CUnreviewedPanel content construction
124  CUnreviewedPanel* itemPanel1 = this;
125 
126  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
127  itemPanel1->SetSizer(itemBoxSizer2);
128 
129  m_Unannotated = new wxCheckBox( itemPanel1, ID_UNREVCHBX01, _("Unannotated"), wxDefaultPosition, wxDefaultSize, 0 );
130  m_Unannotated->SetValue(false);
131  itemBoxSizer2->Add(m_Unannotated, 0, wxALIGN_LEFT |wxALL, 5);
132 
133 ////@end CUnreviewedPanel content construction
134 }
135 
136 
137 /*!
138  * Should we show tooltips?
139  */
140 
142 {
143  return true;
144 }
145 
146 /*!
147  * Get bitmap resources
148  */
149 
150 wxBitmap CUnreviewedPanel::GetBitmapResource( const wxString& name )
151 {
152  // Bitmap retrieval
153 ////@begin CUnreviewedPanel bitmap retrieval
154  wxUnusedVar(name);
155  return wxNullBitmap;
156 ////@end CUnreviewedPanel bitmap retrieval
157 }
158 
159 /*!
160  * Get icon resources
161  */
162 
163 wxIcon CUnreviewedPanel::GetIconResource( const wxString& name )
164 {
165  // Icon retrieval
166 ////@begin CUnreviewedPanel icon retrieval
167  wxUnusedVar(name);
168  return wxNullIcon;
169 ////@end CUnreviewedPanel icon retrieval
170 }
171 
173 {
174  if (user) {
175  m_User.Reset(new CUser_object());
176  m_User->Assign(*user);
177  }
178  else {
179  m_User.Reset(NULL);
180  }
181  bool is_unannotated = false;
182 
183  if (m_User) {
184  // search for fields in user object
185  is_unannotated = m_User->IsUnreviewedUnannotated();
186  }
187  m_Unannotated->SetValue(is_unannotated);
188 }
189 
191 {
192  CRef<CUser_object> user(new CUser_object());
193 
194  if (m_User) {
195  user->Assign(*m_User);
196  }
197  else {
199  }
200 
202 
203  if (m_Unannotated->GetValue()) {
204  user->AddUnreviewedUnannotated();
205  }
206 
207  return user;
208 }
209 
211 {
213  tmp->Assign(desc.GetUser());
215  TransferDataToWindow();
216 }
217 
219 {
220  TransferDataFromWindow();
222  desc.SetUser(*user);
223 }
224 
static bool ShowToolTips()
Should we show tooltips?
~CUnreviewedPanel()
Destructor.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxCheckBox * m_Unannotated
void SetUser_object(CRef< objects::CUser_object > user)
CUnreviewedPanel()
Constructors.
virtual void ChangeSeqdesc(const objects::CSeqdesc &desc)
CRef< objects::CUser_object > m_User
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
virtual void UpdateSeqdesc(objects::CSeqdesc &desc)
CRef< objects::CUser_object > GetUser_object()
bool Create(wxWindow *parent, wxWindowID id=ID_CUNREVIEWEDPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
void SetObjectType(EObjectType obj_type)
void RemoveUnreviewedUnannotated()
void AddUnreviewedUnannotated()
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#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 TUser & GetUser(void) const
Get the variant data.
Definition: Seqdesc_.cpp:384
TUser & SetUser(void)
Select the variant.
Definition: Seqdesc_.cpp:390
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
static char tmp[2048]
Definition: utf8.c:42
USING_SCOPE(objects)
Modified on Sat Mar 02 10:56:50 2024 by modify_doxy.py rev. 669887