do not show the timestamp column in the details pane of the wxLogDialog when timestamping has been disabled
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -917,6 +917,9 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
|||||||
|
|
||||||
void wxLogDialog::CreateDetailsControls(wxWindow *parent)
|
void wxLogDialog::CreateDetailsControls(wxWindow *parent)
|
||||||
{
|
{
|
||||||
|
wxString fmt = wxLog::GetTimestamp();
|
||||||
|
bool hasTimeStamp = !fmt.IsEmpty();
|
||||||
|
|
||||||
// create the list ctrl now
|
// create the list ctrl now
|
||||||
m_listctrl = new wxListCtrl(parent, wxID_ANY,
|
m_listctrl = new wxListCtrl(parent, wxID_ANY,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
@@ -933,7 +936,9 @@ void wxLogDialog::CreateDetailsControls(wxWindow *parent)
|
|||||||
// no need to translate these strings as they're not shown to the
|
// no need to translate these strings as they're not shown to the
|
||||||
// user anyhow (we use wxLC_NO_HEADER style)
|
// user anyhow (we use wxLC_NO_HEADER style)
|
||||||
m_listctrl->InsertColumn(0, _T("Message"));
|
m_listctrl->InsertColumn(0, _T("Message"));
|
||||||
m_listctrl->InsertColumn(1, _T("Time"));
|
|
||||||
|
if (hasTimeStamp)
|
||||||
|
m_listctrl->InsertColumn(1, _T("Time"));
|
||||||
|
|
||||||
// prepare the imagelist
|
// prepare the imagelist
|
||||||
static const int ICON_SIZE = 16;
|
static const int ICON_SIZE = 16;
|
||||||
@@ -968,14 +973,7 @@ void wxLogDialog::CreateDetailsControls(wxWindow *parent)
|
|||||||
|
|
||||||
m_listctrl->SetImageList(imageList, wxIMAGE_LIST_SMALL);
|
m_listctrl->SetImageList(imageList, wxIMAGE_LIST_SMALL);
|
||||||
|
|
||||||
// and fill it
|
// fill the listctrl
|
||||||
wxString fmt = wxLog::GetTimestamp();
|
|
||||||
if ( !fmt )
|
|
||||||
{
|
|
||||||
// default format
|
|
||||||
fmt = _T("%c");
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t count = m_messages.GetCount();
|
size_t count = m_messages.GetCount();
|
||||||
for ( size_t n = 0; n < count; n++ )
|
for ( size_t n = 0; n < count; n++ )
|
||||||
{
|
{
|
||||||
@@ -1007,12 +1005,15 @@ void wxLogDialog::CreateDetailsControls(wxWindow *parent)
|
|||||||
msg = EllipsizeString(msg);
|
msg = EllipsizeString(msg);
|
||||||
|
|
||||||
m_listctrl->InsertItem(n, msg, image);
|
m_listctrl->InsertItem(n, msg, image);
|
||||||
m_listctrl->SetItem(n, 1, TimeStamp(fmt, (time_t)m_times[n]));
|
|
||||||
|
if (hasTimeStamp)
|
||||||
|
m_listctrl->SetItem(n, 1, TimeStamp(fmt, (time_t)m_times[n]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// let the columns size themselves
|
// let the columns size themselves
|
||||||
m_listctrl->SetColumnWidth(0, wxLIST_AUTOSIZE);
|
m_listctrl->SetColumnWidth(0, wxLIST_AUTOSIZE);
|
||||||
m_listctrl->SetColumnWidth(1, wxLIST_AUTOSIZE);
|
if (hasTimeStamp)
|
||||||
|
m_listctrl->SetColumnWidth(1, wxLIST_AUTOSIZE);
|
||||||
|
|
||||||
// calculate an approximately nice height for the listctrl
|
// calculate an approximately nice height for the listctrl
|
||||||
int height = GetCharHeight()*(count + 4);
|
int height = GetCharHeight()*(count + 4);
|
||||||
|
Reference in New Issue
Block a user