1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
//
// Copyright (C) 2002 - 2014, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// ctlListView.h - enhanced listview control
//
//////////////////////////////////////////////////////////////////////////
#ifndef CTLLISTVIEW_H
#define CTLLISTVIEW_H
// wxWindows headers
#include <wx/wx.h>
#include <wx/listctrl.h>
#include "utils/misc.h"
class frmMain;
class ctlListView : public wxListView
{
public:
ctlListView(wxWindow *p, int id, wxPoint pos, wxSize siz, long attr = 0);
long GetSelection();
wxString GetText(long row, long col = 0);
void CreateColumns(wxImageList *images, const wxString &left, const wxString &right, int leftSize = 60);
void CreateColumns(wxImageList *images, const wxString &str1, const wxString &str2, const wxString &str3, int leftSize = 60);
void AddColumn(const wxString &text, int size = wxLIST_AUTOSIZE_USEHEADER, int format = wxLIST_FORMAT_LEFT);
long AppendItem(int icon, const wxString &val, const wxString &val2 = wxString(), const wxString &val3 = wxString(), const wxString &val4 = wxString());
long AppendItem(const wxString &val, const wxString &val2 = wxString(), const wxString &val3 = wxString())
{
return AppendItem(PGICON_PROPERTY, val, val2, val3);
}
void AppendItem(const wxString &str, long l)
{
AppendItem(str, NumToStr(l));
}
void AppendItem(const wxString &str, double d)
{
AppendItem(str, NumToStr(d));
}
void AppendItem(const wxString &str, OID o)
{
AppendItem(str, NumToStr(o));
}
void AppendItem(const wxString &str, const wxDateTime &d)
{
AppendItem(str, DateToStr(d));
}
void AppendItem(const wxString &str, const wxLongLong &l)
{
AppendItem(str, l.ToString());
}
void AppendItem(const wxString &str, const wxULongLong &l)
{
AppendItem(str, l.ToString());
}
void AppendYesNoItem(const wxString &str, bool b)
{
AppendItem(str, BoolToYesNo(b));
}
void DeleteCurrentItem()
{
DeleteItem(GetSelection());
}
};
#endif
|