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

Go to the SVN repository for this file.

1 /* $Id: taxtree_tool_panel.cpp 37336 2016-12-23 21:13:16Z katargir $
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: Roman Katargin
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
34 #include <corelib/ncbifile.hpp>
35 
38 
39 #include "taxtree_tool_panel.hpp"
40 
41 #include "wx/sizer.h"
42 #include "wx/bitmap.h"
43 #include "wx/icon.h"
44 
45 ////@begin includes
46 ////@end includes
47 
49 
50 IMPLEMENT_DYNAMIC_CLASS( CTaxTreeToolPanel, CAlgoToolManagerParamsPanel )
51 
53 
54 ////@begin CTaxTreeToolPanel event table entries
55 ////@end CTaxTreeToolPanel event table entries
56 
58 
60 {
61  Init();
62 }
63 
64 CTaxTreeToolPanel::CTaxTreeToolPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, bool visible )
65 {
66  Init();
67  Create(parent, id, pos, size, style, visible);
68 }
69 
70 bool CTaxTreeToolPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, bool visible )
71 {
72  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
73  CAlgoToolManagerParamsPanel::Create( parent, id, pos, size, style );
74 
75  if (!visible) {
76  Hide();
77  }
78 
80  if (GetSizer())
81  {
82  GetSizer()->SetSizeHints(this);
83  }
84  Centre();
85  return true;
86 }
87 
89 {
90 ////@begin CTaxTreeToolPanel destruction
91 ////@end CTaxTreeToolPanel destruction
92 }
93 
95 {
96 ////@begin CTaxTreeToolPanel member initialisation
97  m_SeqIds = NULL;
98 ////@end CTaxTreeToolPanel member initialisation
99 }
100 
102 {
103 ////@begin CTaxTreeToolPanel content construction
104  CTaxTreeToolPanel* itemCAlgoToolManagerParamsPanel1 = this;
105 
106  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
107  itemCAlgoToolManagerParamsPanel1->SetSizer(itemBoxSizer2);
108 
109  m_SeqIds = new CObjectListWidgetSel( itemCAlgoToolManagerParamsPanel1, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
110  itemBoxSizer2->Add(m_SeqIds, 1, wxGROW|wxALL, 0);
111 
112 ////@end CTaxTreeToolPanel content construction
113 
114  m_SeqIds->SetDoSelectAll(true);
115  m_SeqIds->SetTitle(wxT("Select SeqIds"));
116 }
117 
119 {
121 }
122 
124 {
125  return true;
126 }
127 wxBitmap CTaxTreeToolPanel::GetBitmapResource( const wxString& name )
128 {
129  // Bitmap retrieval
130 ////@begin CTaxTreeToolPanel bitmap retrieval
131  wxUnusedVar(name);
132  return wxNullBitmap;
133 ////@end CTaxTreeToolPanel bitmap retrieval
134 }
135 wxIcon CTaxTreeToolPanel::GetIconResource( const wxString& name )
136 {
137  // Icon retrieval
138 ////@begin CTaxTreeToolPanel icon retrieval
139  wxUnusedVar(name);
140  return wxNullIcon;
141 ////@end CTaxTreeToolPanel icon retrieval
142 }
143 
145 {
146  if (!CAlgoToolManagerParamsPanel::TransferDataFromWindow())
147  return false;
148 
150  GetData().SetObjects() = selection;
151 
152  return true;
153 }
154 
155 static const char* kLocationSel = ".LocationSel";
156 
157 void CTaxTreeToolPanel::SetRegistryPath(const string& path)
158 {
159  m_RegPath = path;
161 }
162 
164 {
166 }
167 
169 {
171 }
172 
174 {
175  GetData().Init();
176  TransferDataToWindow();
177 }
178 
CAlgoToolManagerParamsPanel.
string m_RegPath
registry path to the settings
virtual void SetRegistryPath(const string &path)
IRegSettings.
TConstScopedObjects GetSelection() const
void SetObjects(const TObjectListMap &value)
void SetTitle(const wxString &value)
virtual void SaveSettings() const
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
wxIcon GetIconResource(const wxString &name)
void SetObjects(map< string, TConstScopedObjects > *objects)
CTaxTreeToolParams & GetData()
void RestoreDefaults()
override in derived classes
TConstScopedObjects & SetObjects()
bool Create(wxWindow *parent, wxWindowID id=ID_CTAXTREETOOLPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL, bool visibale=true)
virtual void SetRegistryPath(const string &path)
CAlgoToolManagerParamsPanel.
wxBitmap GetBitmapResource(const wxString &name)
virtual void SaveSettings() const
override in derived classes
virtual bool TransferDataFromWindow()
virtual void LoadSettings()
CObjectListWidgetSel * m_SeqIds
static bool ShowToolTips()
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
END_EVENT_TABLE()
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
static const char * kLocationSel
Modified on Tue May 28 05:49:26 2024 by modify_doxy.py rev. 669887