47 #include <wx/checkbox.h>
48 #include <wx/button.h>
49 #include <wx/filedlg.h>
84 : m_Workbench(workbench)
87 Create( parent,
id, caption, pos,
size, style );
96 bool CFeatureTblFr::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
99 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
100 wxFrame::Create(parent,
id, caption, pos,
size, style);
101 wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
102 if (attr.colBg != wxNullColour)
103 SetOwnBackgroundColour(attr.colBg);
118 wxWindow::TransferDataFromWindow();
154 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
155 itemFrame1->SetSizer(itemBoxSizer2);
157 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
158 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
160 wxStaticText* itemStaticText4 =
new wxStaticText( itemFrame1, wxID_STATIC,
_(
"Show"), wxDefaultPosition, wxDefaultSize, 0 );
161 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
164 itemBoxSizer3->Add(
m_ProteinId, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
166 m_Source =
new wxCheckBox( itemFrame1,
ID_FTBL_CHCKBX2,
_(
"Source Descriptor/Feature"), wxDefaultPosition, wxDefaultSize, 0 );
167 itemBoxSizer3->Add(
m_Source, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
170 itemBoxSizer3->Add(
m_ProteinFeats, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
172 wxButton* itemButton1 =
new wxButton( itemFrame1,
ID_FTBL_REFRESHBTN,
_(
"Refresh"), wxDefaultPosition, wxDefaultSize, 0 );
173 itemBoxSizer3->Add(itemButton1, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
184 wxWindow::InitDialog();
281 struct SFeatTableParams {
287 bool showProteinFeats;
289 SFeatTableParams(
bool protein_id,
bool src_feat,
bool show_prot_feats)
291 showProteinId(protein_id),
292 showSrcFeature(src_feat),
293 showProteinFeats(show_prot_feats) {}
311 vector<CSeq_feat_Handle> handles;
312 for (TConstScopedObjects::const_iterator it =
objects.begin(); it !=
objects.end(); ++it) {
316 handles.push_back(fh);
322 if (handles.empty() && !only_na && !
all) {
327 const CSeq_loc* loc =
dynamic_cast<const CSeq_loc*
>(it->object.GetPointer());
354 if (!
input.showProteinId) {
357 if (!
input.showSrcFeature) {
366 if (!handles.empty()) {
367 for (vector<CSeq_feat_Handle>::const_iterator it = handles.begin(); it != handles.end(); ++it) {
384 if (!
input.filename.empty()) {
390 LOG_POST(
"Unable to open file for writing: " <<
input.filename);
399 catch (
const std::exception& e) {
421 string err_msg =
"Failed: ";
422 if (!errMsg.empty()) {
426 err_msg +=
"Unknown fatal error";
440 sel_srv->GetActiveObjects(
objects);
457 input.filename = path;
CFeatureTblFr()
Constructors.
virtual void OnJobResult(CObject *result, CJobAdapter &adapter)
CGenericPanel * m_GenericPanel
static bool ShowToolTips()
Should we show tooltips?
virtual void LoadSettings()
virtual void OnJobFailed(const string &, CJobAdapter &adapter)
virtual void SetRegistryPath(const string ®_path)
void OnCloseWindow(wxCloseEvent &event)
void SetWorkDir(const wxString &workDir)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
~CFeatureTblFr()
Destructor.
void x_RefreshTable(const string &path=kEmptyStr)
void Init()
Initialises member variables.
wxCheckBox * m_ProteinFeats
void OnRefreshClick(wxCommandEvent &event)
void CreateControls()
Creates the controls and sizers.
virtual void SaveSettings() const
CRef< CJobAdapter > m_JobAdapter
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Create(wxWindow *parent, wxWindowID id=ID_CFEATURETBLFR, const wxString &caption=_("Feature Table"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(700, 600), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX)
CFlatFileConfig & SetShowPeptides(bool val=true)
CFlatFileConfig & SetHideSourceFeatures(bool val=true)
CFlatFileConfig & SetHideProteinID(bool val=true)
CFlatFileConfig & SetShowContigFeatures(bool val=true)
CFlatFileConfig & SetShowContigSources(bool val=true)
CFlatFileConfig & SetShowFtablePeptides(bool val=true)
void SetFormatFTable(void)
void Generate(const CSeq_entry_Handle &entry, CFlatItemOStream &item_os, const multiout &={})
SAnnotSelector & SetAnnotSelector(void)
static string GetSeqFeatText(const CMappedFeat &feat, CScope &scope, const CFlatFileConfig &cfg, CRef< feature::CFeatTree > ftree=null)
void SetHelpUrl(const wxString &url)
void SetText(const wxString &text)
void SetWorkDir(const wxString &workDir)
void SetFindMode(int mode)
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
class CRegistryReadView provides a nested hierarchical view at a particular key.
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
bool GetBool(const string &key, bool default_val=false) const
void Set(const string &key, int val)
access a named key at this level, with no recursion
namespace ncbi::objects::
Interface for testing cancellation request in a long lasting operation.
IWorkbench is the central interface in the application framework.
IMPLEMENT_CLASS(CFloatingFrame, CFloatingFrameBaseClass) const static long kFloatFrameStyle
CFloatingFrame.
static const char * kCaseSensitive
static const char * kShowProteinFeats
static bool s_Create5ColFeatTable(SFeatTableParams &input, string &output, string &error, ICanceled &canceled)
static const char * kShowTranscriptID
static const char * kShowSources
static SQLCHAR output[256]
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
objects::CSeq_entry_Handle GetTopSeqEntryFromScopedObject(SConstScopedObject &obj)
void NcbiWarningBox(const string &message, const string &title="Warning")
specialized Message Box function for reporting non-critical errors
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
vector< SConstScopedObject > TConstScopedObjects
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual bool IsCanceled(void) const =0
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is smart and slim</td> n<td> orig</td> n</tr> n<tr> n<td> last_modified</td> n<td> optional</td> n<td> Integer</td> n<td class=\"description\"> The blob last modification If provided then the exact match will be requested with n the Cassandra storage corresponding field value</td> n<td> Positive integer Not provided means that the most recent match will be selected</td> n<td></td> n</tr> n<tr> n<td> use_cache</td> n<td> optional</td> n<td> String</td> n<td class=\"description\"> The option controls if the Cassandra LMDB cache and or database should be used It n affects the seq id resolution step and the blob properties lookup step The following n options are BIOSEQ_INFO and BLOB_PROP at all
bool FocusedOnNucleotides(TConstScopedObjects &objects, const objects::CSeq_entry_Handle &tse)
void GetViewObjects(IWorkbench *workbench, TConstScopedObjects &objects)
bool FocusedOnAll(TConstScopedObjects &objects, const objects::CSeq_entry_Handle &tse)
void ReportUsage(const wxString &dialog_name)
Report opening & accepting events in the editing package.
const struct ncbi::grid::netcache::search::fields::SIZE size
wxString ToWxString(const string &s)