small cosmetic fix for wxListCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -180,7 +180,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
void SetAttributes(wxDC *dc,
|
void SetAttributes(wxDC *dc,
|
||||||
const wxListItemAttr *attr,
|
const wxListItemAttr *attr,
|
||||||
const wxColour& colText, const wxFont& font);
|
const wxColour& colText, const wxFont& font,
|
||||||
|
bool hilight);
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxListLineData);
|
DECLARE_DYNAMIC_CLASS(wxListLineData);
|
||||||
};
|
};
|
||||||
|
@@ -273,7 +273,8 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
|
|||||||
void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxFileDialog dialog(this, "Testing open multiple file dialog",
|
wxFileDialog dialog(this, "Testing open multiple file dialog",
|
||||||
"", "", "*.*", wxMULTIPLE);
|
"", "", wxFileSelectorDefaultWildcardStr,
|
||||||
|
wxMULTIPLE);
|
||||||
|
|
||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
|
@@ -586,9 +586,13 @@ int wxListLineData::GetImage( int index )
|
|||||||
void wxListLineData::SetAttributes(wxDC *dc,
|
void wxListLineData::SetAttributes(wxDC *dc,
|
||||||
const wxListItemAttr *attr,
|
const wxListItemAttr *attr,
|
||||||
const wxColour& colText,
|
const wxColour& colText,
|
||||||
const wxFont& font)
|
const wxFont& font,
|
||||||
|
bool hilight)
|
||||||
{
|
{
|
||||||
if ( attr && attr->HasTextColour() )
|
// don't use foregroud colour for drawing highlighted items - this might
|
||||||
|
// make them completely invisible (and there is no way to do bit
|
||||||
|
// arithmetics on wxColour, unfortunately)
|
||||||
|
if ( !hilight && attr && attr->HasTextColour() )
|
||||||
{
|
{
|
||||||
dc->SetTextForeground(attr->GetTextColour());
|
dc->SetTextForeground(attr->GetTextColour());
|
||||||
}
|
}
|
||||||
@@ -640,7 +644,7 @@ void wxListLineData::DoDraw( wxDC *dc, bool hilight, bool paintBG )
|
|||||||
// customize the subitems (in report mode) too.
|
// customize the subitems (in report mode) too.
|
||||||
wxListItemData *item = (wxListItemData*)m_items.First()->Data();
|
wxListItemData *item = (wxListItemData*)m_items.First()->Data();
|
||||||
wxListItemAttr *attr = item->GetAttributes();
|
wxListItemAttr *attr = item->GetAttributes();
|
||||||
SetAttributes(dc, attr, colText, font);
|
SetAttributes(dc, attr, colText, font, hilight);
|
||||||
|
|
||||||
bool hasBgCol = attr && attr->HasBackgroundColour();
|
bool hasBgCol = attr && attr->HasBackgroundColour();
|
||||||
if ( paintBG || hasBgCol )
|
if ( paintBG || hasBgCol )
|
||||||
@@ -869,7 +873,8 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
if ((i+1 == numColumns) || ( dc.LogicalToDeviceX(x+item.m_width) > w-5))
|
if ((i+1 == numColumns) || ( dc.LogicalToDeviceX(x+item.m_width) > w-5))
|
||||||
cw = dc.DeviceToLogicalX(w)-x-1;
|
cw = dc.DeviceToLogicalX(w)-x-1;
|
||||||
#else
|
#else
|
||||||
if ((i+1 == numColumns) || (x+item.m_width > w-5)) cw = w-x-1;
|
if ((i+1 == numColumns) || (x+item.m_width > w-5))
|
||||||
|
cw = w-x-1;
|
||||||
#endif
|
#endif
|
||||||
dc.SetPen( *wxWHITE_PEN );
|
dc.SetPen( *wxWHITE_PEN );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user