[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master e00fb75 05/13: Spell 'color' one way only
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master e00fb75 05/13: Spell 'color' one way only |
Date: |
Sat, 12 May 2018 12:00:22 -0400 (EDT) |
branch: master
commit e00fb75f48e97ad078db008c5805cc884070c44b
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Spell 'color' one way only
---
group_quote_pdf_gen_wx.cpp | 3 ++-
ledger_pdf_generator_wx.cpp | 6 +++---
multidimgrid_any.cpp | 33 +++++++++++++++++----------------
multidimgrid_any.hpp | 12 ++++++------
wx_workarounds.hpp | 7 +++++++
5 files changed, 35 insertions(+), 26 deletions(-)
diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index 4319c1f..491bacb 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -41,6 +41,7 @@
#include "version.hpp"
#include "wx_table_generator.hpp"
#include "wx_utility.hpp" // ConvertDateToWx()
+#include "wx_workarounds.hpp" // wxDCTextColorChanger
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
@@ -877,7 +878,7 @@ void group_quote_pdf_generator_wx::output_image_header
auto& pdf_dc = pdf_writer.dc();
wxDCFontChanger set_bigger_font(pdf_dc, pdf_dc.GetFont().Scaled(1.5));
- wxDCTextColourChanger set_white_text(pdf_dc, *wxWHITE);
+ wxDCTextColorChanger set_white_text(pdf_dc, *wxWHITE);
// Don't use html::text::from() here: instead, call
// wxString::FromUTF8() directly, e.g., to preserve literal '&'.
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index b0219d0..7927bdc 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -67,8 +67,8 @@ LMI_FORCE_LINKING_IN_SITU(ledger_pdf_generator_wx)
namespace
{
-// Colour used for lines and border in the generated illustrations.
-const wxColour HIGHLIGHT_COL(0x00, 0x2f, 0x6c);
+// Color used for lines and border in the generated illustrations.
+const wxColor HIGHLIGHT_COL(0x00, 0x2f, 0x6c);
// This function is also provided in <boost/algorithm/string/predicate.hpp>,
// but it's arguably not worth adding dependency on this Boost library just for
@@ -398,7 +398,7 @@ class using_illustration_table
illustration_table_generator table_gen(writer);
- // But set the highlight colour for drawing separator lines after
+ // But set the highlight color for drawing separator lines after
// creating it to override its default pen.
dc.SetPen(HIGHLIGHT_COL);
diff --git a/multidimgrid_any.cpp b/multidimgrid_any.cpp
index 593977f..50da143 100644
--- a/multidimgrid_any.cpp
+++ b/multidimgrid_any.cpp
@@ -25,6 +25,7 @@
#include "alert.hpp"
#include "wx_new.hpp"
+#include "wx_workarounds.hpp" // wx[GS]et.*groundColor()
#include <wx/checkbox.h>
#include <wx/colour.h>
@@ -278,9 +279,9 @@ void MultiDimGrid::Init()
first_grid_axis_ = wxNOT_FOUND;
second_grid_axis_ = wxNOT_FOUND;
- // setting default colour to both X and Y axis
- selected_first_color_ = GetForegroundColour();
- selected_second_color_ = GetForegroundColour();
+ // setting default color to both X and Y axis
+ selected_first_color_ = GetForegroundColor();
+ selected_second_color_ = GetForegroundColor();
// intialize refresh counter
table_data_refresh_counter_ = 0;
@@ -727,25 +728,25 @@ bool MultiDimGrid::DoApplyAxisAdjustment(unsigned int n)
return updated;
}
-void MultiDimGrid::SetXAxisColour(wxColour const& color)
+void MultiDimGrid::SetXAxisColor(wxColor const& color)
{
selected_first_color_ = color;
- first_axis_choice_->SetForegroundColour(color);
+ first_axis_choice_->SetForegroundColor(color);
// WX !! In the future wx releases wxGrid might add support
// for label coloring.
- // grid().SetColLabelColour(colour);
+ // grid().SetColLabelColor(color);
// Update select axis labels
DoSetGridAxisSelection();
}
-void MultiDimGrid::SetYAxisColour(wxColour const& colour)
+void MultiDimGrid::SetYAxisColor(wxColor const& color)
{
- selected_second_color_ = colour;
- second_axis_choice_->SetForegroundColour(colour);
+ selected_second_color_ = color;
+ second_axis_choice_->SetForegroundColor(color);
// WX !! In the future wx releases wxGrid might add support
// for label coloring.
- // grid().SetRowLabelColour(colour);
+ // grid().SetRowLabelColor(color);
// Update select axis labels
DoSetGridAxisSelection();
@@ -766,7 +767,7 @@ std::pair<int,int> MultiDimGrid::GetGridAxisSelection()
const
wxChoice* MultiDimGrid::CreateGridAxisSelection
(enum_axis_x_or_y x_or_y
,std::string const& label
- ,wxColour const& selected_color
+ ,wxColor const& selected_color
)
{
// wxChoice will grow to its default size if all choice strings are empty,
@@ -782,7 +783,7 @@ wxChoice* MultiDimGrid::CreateGridAxisSelection
,&only_empty_choice
);
- win->SetOwnForegroundColour(selected_color);
+ win->SetOwnForegroundColor(selected_color);
unsigned int row =
(x_or_y == e_axis_x)
@@ -958,8 +959,8 @@ void MultiDimGrid::DoSetGridAxisSelection()
|| (static_cast<int>(i) == second_grid_axis_)
;
- // different colour to the selected axis
- wxColour color = GetForegroundColour();
+ // different color to the selected axis
+ wxColor color = GetForegroundColor();
if(selected)
{
color = (static_cast<int>(i) == first_grid_axis_)
@@ -967,9 +968,9 @@ void MultiDimGrid::DoSetGridAxisSelection()
: selected_second_color_
;
}
- axis_labels_[i]->SetOwnForegroundColour(color);
+ axis_labels_[i]->SetOwnForegroundColor(color);
- // text does not get repainted after font and colour changes, force it
+ // text does not get repainted after font and color changes, force it
axis_labels_[i]->Refresh();
// disable selected window choice control
diff --git a/multidimgrid_any.hpp b/multidimgrid_any.hpp
index 0c6dc07..a986671 100644
--- a/multidimgrid_any.hpp
+++ b/multidimgrid_any.hpp
@@ -444,7 +444,7 @@ inline void MultiDimTableAny::SetValueAny
/// See also ApplyAxisAdjustment, DoRefreshAxisAdjustment,
/// MultiDimAxisAny::RefreshAdjustment, MultiDimTableAny::RefreshAxisAdjustment
///
-/// SetXAxisColour(colour) and SetYAxisColour(colour): Set the X and Y axis
+/// SetXAxisColor(color) and SetYAxisColor(color): Set the X and Y axis
/// highlighting color.
/// Color used to highlight X/Y axis selection controls, vertical/horizontal
/// labels in the data table and selected axis controls.
@@ -502,8 +502,8 @@ class MultiDimGrid
bool RefreshTableFull();
bool ApplyAxisAdjustment(std::string const& name);
bool RefreshAxisAdjustment(std::string const& name);
- void SetXAxisColour(wxColour const& colour);
- void SetYAxisColour(wxColour const& colour);
+ void SetXAxisColor(wxColor const& color);
+ void SetYAxisColor(wxColor const& color);
bool SetGridAxisSelection(std::pair<int,int> const&);
std::pair<int,int> GetGridAxisSelection() const;
@@ -592,7 +592,7 @@ class MultiDimGrid
wxChoice* CreateGridAxisSelection
(enum_axis_x_or_y
,std::string const& label
- ,wxColour const& selectedColour
+ ,wxColor const& selectedColor
);
/// Places the axis label control into the widget
void SetAxisLabel(int axis_id, wxWindow&);
@@ -686,10 +686,10 @@ class MultiDimGrid
CheckBoxes axis_varies_checkboxes_;
/// Color used to highlight X axis selections
- wxColour selected_first_color_;
+ wxColor selected_first_color_;
/// Color used to highlight Y axis selections
- wxColour selected_second_color_;
+ wxColor selected_second_color_;
/// Refresh counter
unsigned int table_data_refresh_counter_;
diff --git a/wx_workarounds.hpp b/wx_workarounds.hpp
index c13598f..ba8f1d9 100644
--- a/wx_workarounds.hpp
+++ b/wx_workarounds.hpp
@@ -26,5 +26,12 @@
#include <wx/defs.h>
+class WXDLLIMPEXP_FWD_CORE wxDCTextColourChanger;
+typedef wxDCTextColourChanger wxDCTextColorChanger;
+
+#define GetForegroundColor GetForegroundColour
+#define SetForegroundColor SetForegroundColour
+#define SetOwnForegroundColor SetOwnForegroundColour
+
#endif // wx_workarounds_hpp
- [lmi-commits] [lmi] master updated (0c90de6 -> 45b086a), Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 914ea72 02/13: Remove a "helper" lambda, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 990dbe2 01/13: Improve encapsulation, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 0188828 07/13: Improve alignment, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master be2f05a 09/13: Improve a variable's name, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master e00fb75 05/13: Spell 'color' one way only,
Greg Chicares <=
- [lmi-commits] [lmi] master cccd64c 04/13: Remove disused header, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 111f2bd 03/13: Correct a misleading comment, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 02c6f2e 12/13: Pass column data to table generator as an aggregate parameter, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 45b086a 13/13: Simplify logic, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 5c9a0db 08/13: Improve typography, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 8e0a46c 11/13: Regularize names, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master e7b741f 10/13: Write 'const' after the type it modifies, Greg Chicares, 2018/05/12
- [lmi-commits] [lmi] master 0870adc 06/13: Document function definitions, Greg Chicares, 2018/05/12