NCBI C++ Toolkit Cross Reference


#ifndef GUI_WIDGETS_EDIT___LOCATION_LIST_CTRL__HPP #define GUI_WIDGETS_EDIT___LOCATION_LIST_CTRL__HPP /* $Id: locationl_list_ctrl.hpp 32953 2015-05-08 18:31:26Z filippov $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * Authors: Roman Katargin */ #include <corelib/ncbistd.hpp> /*! * Includes */ ////@begin includes #include "wx/statline.h" #include "wx/valgen.h" ////@end includes #include <wx/panel.h> #include <wx/checkbox.h> #include <wx/sizer.h> #include <wx/statbox.h> #include <objects/seqloc/Seq_loc.hpp> #include <objects/seqloc/Seq_interval.hpp> #include <objects/seqloc/Seq_id.hpp> #include <objmgr/scope.hpp> /*! * Forward declarations */ ////@begin forward declarations ////@end forward declarations class wxHyperlinkEvent; class wxScrolledWindow; class wxFlexGridSizer; BEGIN_NCBI_SCOPE /*! * Control identifiers */ ////@begin control identifiers #define SYMBOL_CLOCATIONLISTCTRL_STYLE wxSUNKEN_BORDER|wxTAB_TRAVERSAL #define SYMBOL_CLOCATIONLISTCTRL_TITLE _("Location List Control") #define SYMBOL_CLOCATIONLISTCTRL_IDNAME ID_CLOCATIONLISTCTRL #define SYMBOL_CLOCATIONLISTCTRL_SIZE wxDefaultSize #define SYMBOL_CLOCATIONLISTCTRL_POSITION wxDefaultPosition ////@end control identifiers /*! * CLocationListCtrl class declaration */ class CLocationListCtrl: public wxPanel { DECLARE_DYNAMIC_CLASS( CLocationListCtrl ) DECLARE_EVENT_TABLE() public: /// Constructors CLocationListCtrl(); CLocationListCtrl( wxWindow* parent, objects::CScope& scope, bool allow_nuc = true, bool allow_prot = true, wxWindowID id = SYMBOL_CLOCATIONLISTCTRL_IDNAME, const wxPoint& pos = SYMBOL_CLOCATIONLISTCTRL_POSITION, const wxSize& size = SYMBOL_CLOCATIONLISTCTRL_SIZE, long style = SYMBOL_CLOCATIONLISTCTRL_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CLOCATIONLISTCTRL_IDNAME, const wxPoint& pos = SYMBOL_CLOCATIONLISTCTRL_POSITION, const wxSize& size = SYMBOL_CLOCATIONLISTCTRL_SIZE, long style = SYMBOL_CLOCATIONLISTCTRL_STYLE ); /// Destructor ~CLocationListCtrl(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); ////@begin CLocationListCtrl event handler declarations /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON1 void OnSortClick( wxCommandEvent& event ); ////@end CLocationListCtrl event handler declarations ////@begin CLocationListCtrl member function declarations int GetLocType() const { return m_LocType ; } void SetLocType(int value) { m_LocType = value ; } /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); ////@end CLocationListCtrl member function declarations /// Should we show tooltips? static bool ShowToolTips(); ////@begin CLocationListCtrl member variables wxScrolledWindow* m_ScrolledWindow; wxCheckBox* m_Partial5; wxCheckBox* m_Partial3; private: int m_LocType; /// Control identifiers enum { ID_CLOCATIONLISTCTRL = 10032, ID_PANEL1 = 10039, ID_SCROLLEDWINDOW1 = 10035, ID_CHECKBOX1 = 10025, ID_CHECKBOX2 = 10109, ID_RADIOBOX6 = 10040, ID_BUTTON1 = 10038 }; ////@end CLocationListCtrl member variables wxFlexGridSizer* m_Sizer; public: void OnDelete ( wxHyperlinkEvent& event ); void OnSpinCtrl ( wxCommandEvent& evt ); void AddRow(int from, int to, int strand, const wxString& seqID); void AddEmptyRow(); void ClearRows(); void SetPartials(bool partial5, bool partial3); CRef<objects::CSeq_loc> GetSeq_loc(); virtual bool TransferDataToWindow(); virtual bool TransferDataFromWindow(); void PopulateIdListFromScope(); bool IsInIdList(wxString str); wxString GetListIdStrForSeqId(const objects::CSeq_id& seq_id); private: struct SIntData { int m_From; int m_To; int m_Strand; wxString m_SeqId; bool m_Empty; bool operator==(const SIntData& intData) const { return m_SeqId== intData.m_SeqId && m_From == intData.m_From && m_To == intData.m_To; } bool operator<(const SIntData& intData) const { if (m_SeqId == intData.m_SeqId) { if (m_From < intData.m_From) return true; if (m_From == intData.m_From) return m_To < intData.m_To; return false; } else return (m_SeqId < intData.m_SeqId); } }; void x_AddRow(int from, int to, int strand, const wxString& seqID, size_t rowPos = -1); void x_AddEmptyRow(size_t rowPos = -1); objects::ENa_strand GetStrandFromForm(size_t index); objects::ENa_strand x_GetStrandFromForm(size_t index); CRef<objects::CSeq_interval> x_GetInterval(size_t index); vector<SIntData> m_Data; wxArrayString m_SeqIds; private: bool m_AllowNuc; bool m_AllowProt; CRef<objects::CScope> m_Scope; }; END_NCBI_SCOPE #endif // GUI_WIDGETS_EDIT___LOCATION_LIST_CTRL__HPP

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.