Skip to content

Commit

Permalink
Fix issues reported in SAM 896 NREL/SAM#896
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Feb 8, 2022
1 parent 4e76d0c commit 868c0ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/wex/dview/dvstatisticstablectrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class dvStatisticsTreeModel : public wxDataViewModel {

virtual unsigned int GetChildren(const wxDataViewItem &parent, wxDataViewItemArray &array) const;

virtual bool GetAttr(const wxDataViewItem& item, unsigned int col, wxDataViewItemAttr& attr) const wxOVERRIDE;
virtual bool GetAttr(const wxDataViewItem& item, unsigned int col, wxDataViewItemAttr& attr) const;

private:

Expand Down
11 changes: 2 additions & 9 deletions src/dview/dvstatisticstablectrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ bool dvStatisticsTreeModel::IsContainer(const wxDataViewItem &item) const {

bool dvStatisticsTreeModel::GetAttr(const wxDataViewItem& item, unsigned int col, wxDataViewItemAttr& attr) const
{
attr.SetColour(*wxRED); // fails
//attr.SetColour(*wxRED); // fails
attr.SetBold(true); // works
//attr.SetBackgroundColour(clr); // works
// attr.SetStrikethrough(true); // works
Expand Down Expand Up @@ -416,17 +416,10 @@ END_EVENT_TABLE()
wxDVStatisticsTableCtrl::wxDVStatisticsTableCtrl(wxWindow *parent, wxWindowID id)
: wxPanel(parent, id) {
m_showMonths = false;
// SetForegroundColour(*wxBLACK);

m_ctrl = new wxDataViewCtrl(this, ID_STATISTICS_CTRL, wxDefaultPosition, wxSize(1040, 720),
wxDV_MULTIPLE | wxDV_ROW_LINES | wxDV_VERT_RULES | wxDV_HORIZ_RULES);// | wxBORDER_NONE);

/* m_ctrl->SetForegroundColour(*wxBLACK); // supposed to set text color
auto fn = m_ctrl->GetFont();
fn.set
fn.SetWeight(wxFONTWEIGHT_MEDIUM);
m_ctrl->SetFont(fn);
*/
m_ctrl->Bind(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, &wxDVStatisticsTableCtrl::OnContextMenu, this);

m_StatisticsModel = new dvStatisticsTreeModel();
Expand Down Expand Up @@ -497,7 +490,7 @@ void wxDVStatisticsTableCtrl::RebuildDataViewCtrl() {
m_ctrl->ClearColumns();
m_ctrl->AssociateModel(m_StatisticsModel.get());

//TODO: Is there a way to highlight "Total" nodes (i.e. bold, background color, etc...)?
//TODO: Is there a way to highlight "Total" nodes (i.e. bold, background color, etc...)? Use GetAttr in underlying model - howwever SetColour does not work in 3.1.5

tr = new wxDataViewTextRenderer("string", wxDATAVIEW_CELL_INERT, wxALIGN_LEFT);
wxDataViewColumn *column0 = new wxDataViewColumn("", tr, 0, 350, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE);
Expand Down
2 changes: 2 additions & 0 deletions src/extgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ wxExtGridCtrl::wxExtGridCtrl(wxWindow *parent, int id,
m_lastSelBottomRow = -1;
m_lastSelLeftCol = -1;
m_lastSelRightCol = -1;

SetGridLineColour(wxColor(99, 102, 106)); // darker cell lines for wx3.1.5
}

void wxExtGridCtrl::EnablePasteEvent(bool b) {
Expand Down

0 comments on commit 868c0ab

Please sign in to comment.