Commit 7eca7be1 authored by twanvl's avatar twanvl

use correct border style instead of always using wxBORDER_THEME. This issue is...

use correct border style instead of always using wxBORDER_THEME. This issue is fixed in wxMSW 2.9, but we are not ready for that yet.
parent cbc7015b
...@@ -20,7 +20,7 @@ DEFINE_EVENT_TYPE(EVENT_SIZE_CHANGE); ...@@ -20,7 +20,7 @@ DEFINE_EVENT_TYPE(EVENT_SIZE_CHANGE);
// ----------------------------------------------------------------------------- : CardViewer // ----------------------------------------------------------------------------- : CardViewer
CardViewer::CardViewer(Window* parent, int id, long style) CardViewer::CardViewer(Window* parent, int id, long style)
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, style) : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(style))
, up_to_date(false) , up_to_date(false)
{} {}
......
...@@ -22,7 +22,7 @@ DEFINE_EVENT_TYPE(EVENT_GALLERY_ACTIVATE); ...@@ -22,7 +22,7 @@ DEFINE_EVENT_TYPE(EVENT_GALLERY_ACTIVATE);
// ----------------------------------------------------------------------------- : GalleryList // ----------------------------------------------------------------------------- : GalleryList
GalleryList::GalleryList(Window* parent, int id, int direction, bool always_focused) GalleryList::GalleryList(Window* parent, int id, int direction, bool always_focused)
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME | wxWANTS_CHARS | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) ) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME) | wxWANTS_CHARS | (direction == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL) )
, active_subcolumn(0) , active_subcolumn(0)
, direction(direction) , direction(direction)
, column_count(1) , column_count(1)
......
...@@ -1029,7 +1029,7 @@ void GraphContainer::add(const GraphP& graph) { ...@@ -1029,7 +1029,7 @@ void GraphContainer::add(const GraphP& graph) {
// ----------------------------------------------------------------------------- : GraphControl // ----------------------------------------------------------------------------- : GraphControl
GraphControl::GraphControl(Window* parent, int id) GraphControl::GraphControl(Window* parent, int id)
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_THEME) : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_THEME_FIX(wxBORDER_THEME))
, layout(GRAPH_TYPE_BAR) , layout(GRAPH_TYPE_BAR)
{} {}
......
...@@ -123,8 +123,8 @@ size_t TreeList::findParent(size_t start) const { ...@@ -123,8 +123,8 @@ size_t TreeList::findParent(size_t start) const {
// ----------------------------------------------------------------------------- : TreeList : UI // ----------------------------------------------------------------------------- : TreeList : UI
TreeList::TreeList(Window* parent, int id, long style) TreeList::TreeList(Window* parent, int id)
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, style | wxWANTS_CHARS | wxVSCROLL) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME) | wxWANTS_CHARS | wxVSCROLL)
, selection(NOTHING) , selection(NOTHING)
, total_lines(0) , total_lines(0)
, first_line(0) , first_line(0)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
/// A combination of a TreeCtrl and a ListCtrl. A tree with multiple columns. /// A combination of a TreeCtrl and a ListCtrl. A tree with multiple columns.
class TreeList : public wxPanel { class TreeList : public wxPanel {
public: public:
TreeList(Window* parent, int id, long style = wxBORDER_THEME); TreeList(Window* parent, int id);
/// Expand/collapse an item /// Expand/collapse an item
void expand(size_t item, bool expand = true); void expand(size_t item, bool expand = true);
......
...@@ -350,7 +350,7 @@ END_EVENT_TABLE () ...@@ -350,7 +350,7 @@ END_EVENT_TABLE ()
// ----------------------------------------------------------------------------- : ImageSlicePreview // ----------------------------------------------------------------------------- : ImageSlicePreview
ImageSlicePreview::ImageSlicePreview(Window* parent, int id, ImageSlice& slice, const AlphaMask& mask) ImageSlicePreview::ImageSlicePreview(Window* parent, int id, ImageSlice& slice, const AlphaMask& mask)
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME) : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME))
, slice(slice) , slice(slice)
, mask(mask) , mask(mask)
, mouse_down(false) , mouse_down(false)
...@@ -440,7 +440,7 @@ END_EVENT_TABLE () ...@@ -440,7 +440,7 @@ END_EVENT_TABLE ()
// ----------------------------------------------------------------------------- : ImageSliceSelector // ----------------------------------------------------------------------------- : ImageSliceSelector
ImageSliceSelector::ImageSliceSelector(Window* parent, int id, ImageSlice& slice) ImageSliceSelector::ImageSliceSelector(Window* parent, int id, ImageSlice& slice)
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME) : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME))
, slice(slice) , slice(slice)
, mouse_down(false) , mouse_down(false)
{} {}
......
...@@ -121,7 +121,7 @@ class PackageInfoPanel : public wxPanel { ...@@ -121,7 +121,7 @@ class PackageInfoPanel : public wxPanel {
}; };
PackageInfoPanel::PackageInfoPanel(Window* parent) PackageInfoPanel::PackageInfoPanel(Window* parent)
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME) : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME))
{} {}
void PackageInfoPanel::setPackage(const InstallablePackageP& package) { void PackageInfoPanel::setPackage(const InstallablePackageP& package) {
......
...@@ -46,7 +46,7 @@ class ConsoleMessage : public IntrusivePtrBase<ConsoleMessage> { ...@@ -46,7 +46,7 @@ class ConsoleMessage : public IntrusivePtrBase<ConsoleMessage> {
class MessageCtrl : public wxScrolledWindow { class MessageCtrl : public wxScrolledWindow {
public: public:
MessageCtrl(wxWindow* parent, int id) MessageCtrl(wxWindow* parent, int id)
: wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME) : wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME))
{ {
SetBackgroundStyle(wxBG_STYLE_CUSTOM); SetBackgroundStyle(wxBG_STYLE_CUSTOM);
SetScrollRate(0, 1); SetScrollRate(0, 1);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
// ----------------------------------------------------------------------------- : SymbolControl // ----------------------------------------------------------------------------- : SymbolControl
SymbolControl::SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol) SymbolControl::SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol)
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME) : wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME))
, SymbolViewer(symbol, true) , SymbolViewer(symbol, true)
, parent(parent) , parent(parent)
{ {
......
...@@ -29,7 +29,7 @@ DEFINE_EVENT_TYPE(EVENT_PART_ACTIVATE); ...@@ -29,7 +29,7 @@ DEFINE_EVENT_TYPE(EVENT_PART_ACTIVATE);
SymbolPartList::SymbolPartList(Window* parent, int id, SymbolPartsSelection& selection, SymbolP symbol) SymbolPartList::SymbolPartList(Window* parent, int id, SymbolPartsSelection& selection, SymbolP symbol)
: wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME | wxVSCROLL) : wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME) | wxVSCROLL)
, selection(selection) , selection(selection)
, state_icons(9,8) , state_icons(9,8)
{ {
......
...@@ -167,8 +167,8 @@ void show_update_dialog(Window* parent) { ...@@ -167,8 +167,8 @@ void show_update_dialog(Window* parent) {
// A HTML control that opens all pages in an actual browser // A HTML control that opens all pages in an actual browser
struct HtmlWindowToBrowser : public wxHtmlWindow { struct HtmlWindowToBrowser : public wxHtmlWindow {
HtmlWindowToBrowser(Window* parent, int id, const wxPoint& pos, const wxSize& size, long flags) HtmlWindowToBrowser(Window* parent, int id, const wxPoint& pos, const wxSize& size, long style)
: wxHtmlWindow(parent, id, pos, size, flags) : wxHtmlWindow(parent, id, pos, size, style | wxBORDER_THEME_FIX(wxBORDER_THEME))
{} {}
virtual void OnLinkClicked(const wxHtmlLinkInfo& info) { virtual void OnLinkClicked(const wxHtmlLinkInfo& info) {
...@@ -181,7 +181,7 @@ void show_update_dialog(Window* parent) { ...@@ -181,7 +181,7 @@ void show_update_dialog(Window* parent) {
// Show update dialog // Show update dialog
wxDialog* dlg = new wxDialog(parent, wxID_ANY, _TITLE_("updates available"), wxDefaultPosition); wxDialog* dlg = new wxDialog(parent, wxID_ANY, _TITLE_("updates available"), wxDefaultPosition);
// controls // controls
wxHtmlWindow* html = new HtmlWindowToBrowser(dlg, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO | wxBORDER_THEME); wxHtmlWindow* html = new HtmlWindowToBrowser(dlg, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
html->SetPage(update_version_data->description); html->SetPage(update_version_data->description);
wxButton* close = new wxButton(dlg, wxID_OK, _BUTTON_("close")); wxButton* close = new wxButton(dlg, wxID_OK, _BUTTON_("close"));
close->SetDefault(); close->SetDefault();
......
...@@ -57,6 +57,12 @@ typedef wxDateTime DateTime; ...@@ -57,6 +57,12 @@ typedef wxDateTime DateTime;
#if wxVERSION_NUMBER < 2805 #if wxVERSION_NUMBER < 2805
#define wxBORDER_THEME wxSUNKEN_BORDER #define wxBORDER_THEME wxSUNKEN_BORDER
#endif #endif
#if wxVERSION_NUMBER < 2900 && defined(__WXMSW__)
// see http://docs.wxwidgets.org/2.8.11/wx_wxmswport.html
#define wxBORDER_THEME_FIX(x) (x&wxBORDER_THEME ? (x&~wxBORDER_THEME)|wxWindow::GetThemedBorderStyle() : x)
#else
#define wxBORDER_THEME_FIX(x) x
#endif
#if wxVERSION_NUMBER < 2900 #if wxVERSION_NUMBER < 2900
// wx >= 2.9 requires the use of HandleWindowEvent on windows, instead of ProcessEvent // wx >= 2.9 requires the use of HandleWindowEvent on windows, instead of ProcessEvent
#define HandleWindowEvent ProcessEvent #define HandleWindowEvent ProcessEvent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment