42 static const long kDefStyle = wxLC_REPORT | wxLC_VIRTUAL | wxLC_HRULES | wxLC_VRULES;
50 const wxValidator& validator,
53 parent, id, pos,
size,
54 (style & ~wxLC_MASK_TYPE) |
kDefStyle, validator, name)
55 , m_ImageList(16, 16,
TRUE)
63 if (style & wxLC_ALIGN_LEFT) {
70 wxIcon ico = provider->GetIcon(
wxT(
"tablelist_import::checked"));
75 ico = provider->GetIcon(
wxT(
"tablelist_import::skipped"));
93 m_TableData.Reset(&table_data);
98 if (m_TableData.IsNull()) {
103 int num_rows = (
int)m_TableData->GetRowsCount();
109 wxFont
f = GetFont();
112 m_FontWidth = dc.GetCharWidth();
114 SetItemCount(num_rows);
117 size_t width_calc_rows =
std::min(num_rows, 100);
120 for (
size_t col=0; col<m_TableData->GetColsCount(); ++col) {
123 for (
size_t row=0;
row<width_calc_rows; ++
row) {
124 m_TableData->GetStringValue(
row, col, s);
125 width =
std::max(width, (
int)s.length());
135 width = (width+2) * m_FontWidth;
139 if (GetColumnCount() <= (
int)col) {
140 InsertColumn(
int(col),
141 wxString(
ToWxString(m_TableData->GetColumnLabel(col))),
147 GetColumn(
int(col), item);
148 item.SetWidth(width);
149 item.SetText(
ToWxString(m_TableData->GetColumnLabel(col)));
150 SetColumn(
int(col), item);
188 wxString tabstr(
" ", 1);
190 for (
size_t i=0;
i<
str.size(); ++
i) {
191 if (
str[
i] !=
'\t') {
194 else result.append(tabstr);
CIRef< ITableData > m_TableData
Data table to be rendered in the list.
wxImageList m_ImageList
Holds column icons (shows whether column currently selected or not)
wxString OnGetItemText(long row, long col) const
Get the requested field.
int GetColumnImageID(int col) const
Returns image ID for column headers.
static wxString x_ToWxStringWithTabs(const string &str)
Convert strings with tab characters to wxStrings with 4 spaces for each tab.
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
static const char * str(char *buf, int n)
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
#define TRUE
bool replacment for C indicating true.
#define row(bind, expected)
static const long kDefStyle
wxFileArtProvider * GetDefaultFileArtProvider()
wxString ToWxString(const string &s)