NCBI C++ ToolKit
table_data_listctrl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS___LOADERS___TABLE_DATA_LIST_CTRL__HPP
2 #define GUI_WIDGETS___LOADERS___TABLE_DATA_LIST_CTRL__HPP
3 
4 /* $Id: table_data_listctrl.hpp 28595 2013-08-05 16:29:38Z katargir $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. `This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Bob Falk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 
40 
41 #include <wx/wx.h>
42 #include <wx/listctrl.h>
43 #include <wx/imaglist.h>
44 
45 
47 
48 
49 ///////////////////////////////////////////////////////////////////////////////
50 /// CTableDataListCtrl -
51 ///
52 /// This class is a specialized version of wxListCtrl....
53 ///
55  : public wxListCtrl
56 {
57 public:
58  /// ctor
60 
61  /// ctor
63  wxWindow* parent,
64  wxWindowID id = wxID_ANY,
65  const wxPoint& pos = wxDefaultPosition,
66  const wxSize& size = wxDefaultSize,
67  long style = wxLC_REPORT | wxLC_VIRTUAL,
68  const wxValidator& validator = wxDefaultValidator,
69  const wxString& name = wxListCtrlNameStr
70  );
71 
72  /// dtor
73  virtual ~CTableDataListCtrl() {}
74 
75  /// Set/update data source
76  void InitDataSource(ITableData& table_data);
77 
78  /// Returns image ID for column headers
79  int GetColumnImageID(int col) const;
80 
81 protected:
82  /// Get the requested field
83  wxString OnGetItemText( long row, long col ) const;
84 
85  /// Required function if I want to put icons in column headers (but this
86  /// function indicates what icon to put in list items (so I return -1)
87  virtual int OnGetItemColumnImage(long item, long column) const { return -1; }
88 
89  /// Convert strings with tab characters to wxStrings with 4 spaces for each
90  /// tab. Gets around bug/issue in windows where wxListCtrl ignores tabs
91  static wxString x_ToWxStringWithTabs(const string& str);
92 
93 protected:
94 
95  /// Data table to be rendered in the list
97 
98  /// Holds column icons (shows whether column currently selected or not)
99  wxImageList m_ImageList;
100 
101  /// Need font width for calculating how many chars fit in a column
103 
104 private:
105 
106  DECLARE_DYNAMIC_CLASS(CTableDataListCtrl)
107  DECLARE_NO_COPY_CLASS(CTableDataListCtrl)
108  DECLARE_EVENT_TABLE()
109 };
110 
112 
113 #endif // GUI_WIDGETS___LOADERS___TABLE_DATA_LIST_CTRL__HPP
CTableDataListCtrl -.
CIRef< ITableData > m_TableData
Data table to be rendered in the list.
virtual ~CTableDataListCtrl()
dtor
virtual int OnGetItemColumnImage(long item, long column) const
Required function if I want to put icons in column headers (but this function indicates what icon to ...
int m_FontWidth
Need font width for calculating how many chars fit in a column.
wxImageList m_ImageList
Holds column icons (shows whether column currently selected or not)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
Definition: stats.c:84
static const char * column
Definition: stats.c:23
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_LOADERS_EXPORT
Definition: gui_export.h:525
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
#define row(bind, expected)
Definition: string_bind.c:73
Modified on Mon Apr 22 04:04:57 2024 by modify_doxy.py rev. 669887