diff --git a/docs/changes.txt b/docs/changes.txt index 1c82160ae2..99680a7aac 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -181,6 +181,7 @@ All (GUI): - Add wxEVT_SEARCH[_CANCEL] synonyms for wxSearchCtrl events. - Generate wxEVT_SEARCH on Enter under all platforms. - Extend wxRendererNative::DrawGauge() to work for vertical gauges too. +- Add wxHD_BITMAP_ON_RIGHT style to wxHeaderCtrl. wxGTK: diff --git a/include/wx/headerctrl.h b/include/wx/headerctrl.h index 928ed7aa5e..f491fcbc7a 100644 --- a/include/wx/headerctrl.h +++ b/include/wx/headerctrl.h @@ -37,6 +37,9 @@ enum // right clicking the header wxHD_ALLOW_HIDE = 0x0002, + // force putting column images on right + wxHD_BITMAP_ON_RIGHT = 0x0004, + // style used by default when creating the control wxHD_DEFAULT_STYLE = wxHD_ALLOW_REORDER }; diff --git a/interface/wx/headerctrl.h b/interface/wx/headerctrl.h index 662d20df0e..8a9907d546 100644 --- a/interface/wx/headerctrl.h +++ b/interface/wx/headerctrl.h @@ -17,6 +17,9 @@ enum // right clicking the header wxHD_ALLOW_HIDE = 0x0002, + // force putting column images on right + wxHD_BITMAP_ON_RIGHT = 0x0004, + // style used by default when creating the control wxHD_DEFAULT_STYLE = wxHD_ALLOW_REORDER }; @@ -76,6 +79,11 @@ enum user to change the columns visibility on right mouse click. Notice that the program can always hide or show the columns, this style only affects the users capability to do it. + @style{wxHD_BITMAP_ON_RIGHT} + The column image, if any, will be shown on the right side if this style + is used. Note that this style is only implemented in wxMSW currently + and doesn't do anything under the other platforms. It is available + since wxWidgets 3.1.1. @style{wxHD_DEFAULT_STYLE} Symbolic name for the default control style, currently equal to @c wxHD_ALLOW_REORDER. diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index 267775f582..1694a8e288 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -314,6 +314,9 @@ void wxHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx) { hdi.mask |= HDI_IMAGE; + if ( HasFlag(wxHD_BITMAP_ON_RIGHT) ) + hdi.fmt |= HDF_BITMAP_ON_RIGHT; + if ( bmp.IsOk() ) { const int bmpWidth = bmp.GetWidth(),