Add wxLIST_DEFAULT_COL_WIDTH constant

The same value of 80px was used in both the generic and MSW versions of
wxListCtrl, so introduce a symbolic name for it and define it only once,
similarly to how it's already done for wxDVC_DEFAULT_WIDTH and
WXGRID_DEFAULT_COL_WIDTH.

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-08-17 23:23:53 +02:00
parent ac1fa83c20
commit 2727926608
4 changed files with 6 additions and 8 deletions

View File

@@ -135,11 +135,12 @@ enum wxListColumnFormat
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
}; };
// Autosize values for SetColumnWidth // Values for SetColumnWidth()
enum enum
{ {
wxLIST_AUTOSIZE = -1, wxLIST_AUTOSIZE = -1,
wxLIST_AUTOSIZE_USEHEADER = -2 // partly supported by generic version wxLIST_AUTOSIZE_USEHEADER = -2, // partly supported by generic version
wxLIST_DEFAULT_COL_WIDTH = 80
}; };
// Flag values for GetItemRect // Flag values for GetItemRect

View File

@@ -89,7 +89,7 @@ enum wxListColumnFormat
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
}; };
/// Autosize values for SetColumnWidth /// Values for SetColumnWidth()
enum enum
{ {
wxLIST_AUTOSIZE = -1, wxLIST_AUTOSIZE = -1,

View File

@@ -96,9 +96,6 @@ static const int MARGIN_BETWEEN_ROWS = 6;
// when autosizing the columns, add some slack // when autosizing the columns, add some slack
static const int AUTOSIZE_COL_MARGIN = 10; static const int AUTOSIZE_COL_MARGIN = 10;
// default width for the header columns
static const int WIDTH_COL_DEFAULT = 80;
// the space between the image and the text in the report mode // the space between the image and the text in the report mode
static const int IMAGE_MARGIN_IN_REPORT_MODE = 5; static const int IMAGE_MARGIN_IN_REPORT_MODE = 5;
@@ -336,7 +333,7 @@ void wxListHeaderData::SetHeight( int h )
void wxListHeaderData::SetWidth( int w ) void wxListHeaderData::SetWidth( int w )
{ {
m_width = w < 0 ? WIDTH_COL_DEFAULT : w; m_width = w < 0 ? wxLIST_DEFAULT_COL_WIDTH : w;
} }
void wxListHeaderData::SetState( int flag ) void wxListHeaderData::SetState( int flag )

View File

@@ -2057,7 +2057,7 @@ long wxListCtrl::DoInsertColumn(long col, const wxListItem& item)
// always give some width to the new column: this one is compatible // always give some width to the new column: this one is compatible
// with the generic version // with the generic version
lvCol.mask |= LVCF_WIDTH; lvCol.mask |= LVCF_WIDTH;
lvCol.cx = 80; lvCol.cx = wxLIST_DEFAULT_COL_WIDTH;
} }
long n = ListView_InsertColumn(GetHwnd(), col, &lvCol); long n = ListView_InsertColumn(GetHwnd(), col, &lvCol);