From 3dc16a7419a69dfda8b23510531dceac15dc8854 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Dec 2018 03:19:42 +0100 Subject: [PATCH 001/553] Compute wxDCImpl::m_mm_to_pix_[xy] on demand If nothing else, this avoids 2 calls to each of wxGetDisplaySize() and wxGetDisplaySizeMM() on each and every wxGCDC construction which are completely unnecessary as wxGCDCImpl uses its own hardcoded resolution of 72 DPI, as do some other classes deriving from wxDCImpl. And even for the classes which do compute these fields using the display resolution, it may still be unnecessary to do it as they can be never used if neither GetSizeMM() nor SetLogicalScale() are called on the corresponding wxDC object. Finally, this is more than an optimization as when using Cairo-based wxGCDC without display (which is explicitly supported), calling wxGetDisplaySize() simply doesn't work at all. --- include/wx/dc.h | 19 ++++++++++++++++--- src/common/dcbase.cpp | 36 +++++++++++++++++++++++++++--------- src/common/dcgraph.cpp | 4 ++-- src/common/dcsvg.cpp | 4 ++-- src/dfb/dc.cpp | 8 ++++---- src/gtk/dc.cpp | 4 ++-- src/gtk/dcclient.cpp | 2 +- src/gtk1/dc.cpp | 4 ++-- src/gtk1/dcclient.cpp | 2 +- src/motif/dc.cpp | 4 ++-- src/x11/dc.cpp | 4 ++-- 11 files changed, 61 insertions(+), 30 deletions(-) diff --git a/include/wx/dc.h b/include/wx/dc.h index a34a73b698..8d445e9f6b 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -686,6 +686,16 @@ protected: // for rendering on higher-resolution DCs such as printer ones static float GetFontPointSizeAdjustment(float dpi); + // Return the number of pixels per mm in the horizontal and vertical + // directions, respectively. + // + // If the physical size of the DC is not known, or doesn't make sense, as + // for a SVG DC, for example, a fixed value corresponding to the standard + // DPI is used. + double GetMMToPXx() const; + double GetMMToPXy() const; + + // window on which the DC draws or NULL wxWindow *m_window; @@ -715,9 +725,12 @@ protected: double m_contentScaleFactor; // used by high resolution displays (retina) - // what is a mm on a screen you don't know the size of? - double m_mm_to_pix_x, - m_mm_to_pix_y; + // Pixel per mm in horizontal and vertical directions. + // + // These variables are computed on demand by GetMMToPX[xy]() functions, + // don't access them directly other than for assigning to them. + mutable double m_mm_to_pix_x, + m_mm_to_pix_y; // bounding and clipping boxes wxCoord m_minX, m_minY, m_maxX, m_maxY; // Bounding box is stored in device units. diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 8b070995d8..47000e5f1f 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -331,6 +331,7 @@ wxDCImpl::wxDCImpl( wxDC *owner ) , m_scaleX(1.0), m_scaleY(1.0) , m_signX(1), m_signY(1) , m_contentScaleFactor(1) + , m_mm_to_pix_x(0.0), m_mm_to_pix_y(0.0) , m_minX(0), m_minY(0), m_maxX(0), m_maxY(0) , m_clipX1(0), m_clipY1(0), m_clipX2(0), m_clipY2(0) , m_logicalFunction(wxCOPY) @@ -348,11 +349,6 @@ wxDCImpl::wxDCImpl( wxDC *owner ) #endif // wxUSE_PALETTE { m_owner = owner; - - m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() / - (double)wxGetDisplaySizeMM().GetWidth(); - m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() / - (double)wxGetDisplaySizeMM().GetHeight(); } wxDCImpl::~wxDCImpl() @@ -517,16 +513,16 @@ void wxDCImpl::SetMapMode( wxMappingMode mode ) switch (mode) { case wxMM_TWIPS: - SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y ); + SetLogicalScale( twips2mm*GetMMToPXx(), twips2mm*GetMMToPXy() ); break; case wxMM_POINTS: - SetLogicalScale( pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y ); + SetLogicalScale( pt2mm*GetMMToPXx(), pt2mm*GetMMToPXy() ); break; case wxMM_METRIC: - SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y ); + SetLogicalScale( GetMMToPXx(), GetMMToPXy() ); break; case wxMM_LOMETRIC: - SetLogicalScale( m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0 ); + SetLogicalScale( GetMMToPXx()/10.0, GetMMToPXy()/10.0 ); break; default: case wxMM_TEXT: @@ -1441,3 +1437,25 @@ float wxDCImpl::GetFontPointSizeAdjustment(float dpi) const wxSize screenPPI = wxGetDisplayPPI(); return float(screenPPI.y) / dpi; } + +double wxDCImpl::GetMMToPXx() const +{ + if ( wxIsNullDouble(m_mm_to_pix_x) ) + { + m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() / + (double)wxGetDisplaySizeMM().GetWidth(); + } + + return m_mm_to_pix_x; +} + +double wxDCImpl::GetMMToPXy() const +{ + if ( wxIsNullDouble(m_mm_to_pix_x) ) + { + m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() / + (double)wxGetDisplaySizeMM().GetHeight(); + } + + return m_mm_to_pix_y; +} diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 5812e393f3..832eb2bdc6 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -390,9 +390,9 @@ void wxGCDCImpl::DoGetSizeMM( int* width, int* height ) const GetOwner()->GetSize( &w, &h ); if (width) - *width = long( double(w) / (m_scaleX * m_mm_to_pix_x) ); + *width = long( double(w) / (m_scaleX * GetMMToPXx()) ); if (height) - *height = long( double(h) / (m_scaleY * m_mm_to_pix_y) ); + *height = long( double(h) / (m_scaleY * GetMMToPXy()) ); } void wxGCDCImpl::SetTextForeground( const wxColour &col ) diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 2913548a12..ff212b8829 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -442,10 +442,10 @@ wxSVGFileDCImpl::~wxSVGFileDCImpl() void wxSVGFileDCImpl::DoGetSizeMM(int *width, int *height) const { if (width) - *width = wxRound( (double)m_width / m_mm_to_pix_x ); + *width = wxRound( (double)m_width / GetMMToPXx() ); if (height) - *height = wxRound( (double)m_height / m_mm_to_pix_y ); + *height = wxRound( (double)m_height / GetMMToPXy() ); } wxSize wxSVGFileDCImpl::GetPPI() const diff --git a/src/dfb/dc.cpp b/src/dfb/dc.cpp index a65f9bca0b..241bcd0562 100644 --- a/src/dfb/dc.cpp +++ b/src/dfb/dc.cpp @@ -563,15 +563,15 @@ void wxDFBDCImpl::DoGetSizeMM(int *width, int *height) const int w = 0; int h = 0; GetSize(&w, &h); - if ( width ) *width = int(double(w) / (m_userScaleX*m_mm_to_pix_x)); - if ( height ) *height = int(double(h) / (m_userScaleY*m_mm_to_pix_y)); + if ( width ) *width = int(double(w) / (m_userScaleX*GetMMToPXx())); + if ( height ) *height = int(double(h) / (m_userScaleY*GetMMToPXy())); } wxSize wxDFBDCImpl::GetPPI() const { #warning "move this to common code?" - return wxSize(int(double(m_mm_to_pix_x) * inches2mm), - int(double(m_mm_to_pix_y) * inches2mm)); + return wxSize(int(double(GetMMToPXx()) * inches2mm), + int(double(GetMMToPXy()) * inches2mm)); } diff --git a/src/gtk/dc.cpp b/src/gtk/dc.cpp index a41910ac32..016c7cd4de 100644 --- a/src/gtk/dc.cpp +++ b/src/gtk/dc.cpp @@ -506,8 +506,8 @@ void wxGTKDCImpl::DoGetSizeMM( int* width, int* height ) const int w = 0; int h = 0; GetOwner()->GetSize( &w, &h ); - if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) ); - if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) ); + if (width) *width = int( double(w) / (m_userScaleX*GetMMToPXx()) ); + if (height) *height = int( double(h) / (m_userScaleY*GetMMToPXy()) ); } // Resolution in pixels per logical inch diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 52349d0e0a..feea364099 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -2072,7 +2072,7 @@ void wxWindowDCImpl::ComputeScaleAndOrigin() // Resolution in pixels per logical inch wxSize wxWindowDCImpl::GetPPI() const { - return wxSize( (int) (m_mm_to_pix_x * 25.4 + 0.5), (int) (m_mm_to_pix_y * 25.4 + 0.5)); + return wxSize( (int) (GetMMToPXx() * 25.4 + 0.5), (int) (GetMMToPXy() * 25.4 + 0.5)); } int wxWindowDCImpl::GetDepth() const diff --git a/src/gtk1/dc.cpp b/src/gtk1/dc.cpp index 7c75e571f2..77f130450c 100644 --- a/src/gtk1/dc.cpp +++ b/src/gtk1/dc.cpp @@ -50,8 +50,8 @@ void wxGTKDCImpl::DoGetSizeMM( int* width, int* height ) const int w = 0; int h = 0; GetSize( &w, &h ); - if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) ); - if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) ); + if (width) *width = int( double(w) / (m_userScaleX*GetMMToPXx()) ); + if (height) *height = int( double(h) / (m_userScaleY*GetMMToPXy()) ); } // Resolution in pixels per logical inch diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 623f049e72..4d3e9d120a 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -2113,7 +2113,7 @@ void wxWindowDCImpl::ComputeScaleAndOrigin() // Resolution in pixels per logical inch wxSize wxWindowDCImpl::GetPPI() const { - return wxSize( (int) (m_mm_to_pix_x * 25.4 + 0.5), (int) (m_mm_to_pix_y * 25.4 + 0.5)); + return wxSize( (int) (GetMMToPXx() * 25.4 + 0.5), (int) (GetMMToPXy() * 25.4 + 0.5)); } int wxWindowDCImpl::GetDepth() const diff --git a/src/motif/dc.cpp b/src/motif/dc.cpp index 908c8f76d1..c79c4eb07d 100644 --- a/src/motif/dc.cpp +++ b/src/motif/dc.cpp @@ -87,9 +87,9 @@ void wxMotifDCImpl::DoGetSizeMM( int* width, int* height ) const GetSize( &w, &h ); if ( width ) - *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) ); + *width = int( double(w) / (m_scaleX*GetMMToPXx()) ); if ( height ) - *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) ); + *height = int( double(h) / (m_scaleY*GetMMToPXy()) ); } // Resolution in pixels per logical inch diff --git a/src/x11/dc.cpp b/src/x11/dc.cpp index 888f15eb58..41e39ef80e 100644 --- a/src/x11/dc.cpp +++ b/src/x11/dc.cpp @@ -51,9 +51,9 @@ void wxX11DCImpl::DoGetSizeMM( int* width, int* height ) const DoGetSize( &w, &h ); if ( width ) - *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) ); + *width = int( double(w) / (m_scaleX*GetMMToPXx()) ); if ( height ) - *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) ); + *height = int( double(h) / (m_scaleY*GetMMToPXy()) ); } // Resolution in pixels per logical inch From 54e9150157fe89fcf6dea78bebecd40540d82ced Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 5 Dec 2018 23:39:00 +0100 Subject: [PATCH 002/553] Remove redundant wxDFBDCImpl::m_mm_to_pix_[xy] members The base class already has exactly the same members, so just use them instead. No real changes, just avoid (or at least reduce) confusion. --- include/wx/dfb/dc.h | 2 -- src/dfb/dc.cpp | 5 ----- 2 files changed, 7 deletions(-) diff --git a/include/wx/dfb/dc.h b/include/wx/dfb/dc.h index 141224ba68..4dac548d98 100644 --- a/include/wx/dfb/dc.h +++ b/include/wx/dfb/dc.h @@ -157,8 +157,6 @@ private: protected: wxIDirectFBSurfacePtr m_surface; - double m_mm_to_pix_x, m_mm_to_pix_y; - friend class WXDLLIMPEXP_FWD_CORE wxOverlayImpl; // for Init wxDECLARE_ABSTRACT_CLASS(wxDFBDCImpl); diff --git a/src/dfb/dc.cpp b/src/dfb/dc.cpp index 241bcd0562..b718de4c98 100644 --- a/src/dfb/dc.cpp +++ b/src/dfb/dc.cpp @@ -51,11 +51,6 @@ void wxDFBDCImpl::DFBInit(const wxIDirectFBSurfacePtr& surface) wxCHECK_RET( surface != NULL, "invalid surface" ); - m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() / - (double)wxGetDisplaySizeMM().GetWidth(); - m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() / - (double)wxGetDisplaySizeMM().GetHeight(); - SetFont(DEFAULT_FONT); SetPen(DEFAULT_PEN); SetBrush(DEFAULT_BRUSH); From 507e331eb15bb8c3b043d9ce327db1d5494cfe9d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Dec 2018 03:40:49 +0100 Subject: [PATCH 003/553] Improve creating wxGCDC from an existing wxGraphicsContext Avoid creating a default wxGraphicsContext unnecessarily, only to immediately delete it and replace it with the provided one. This was at best unnecessary and at worst resulted in a crash if the default context couldn't be created, as happened on a headless system (where wxImage-based wxGraphicsContext can still be created successfully). --- include/wx/dcgraph.h | 4 ++++ src/common/dcgraph.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/wx/dcgraph.h b/include/wx/dcgraph.h index 9a11a19ce4..b75d715c7b 100644 --- a/include/wx/dcgraph.h +++ b/include/wx/dcgraph.h @@ -60,6 +60,10 @@ public: #if defined(__WXMSW__) && wxUSE_ENH_METAFILE wxGCDCImpl( wxDC *owner, const wxEnhMetaFileDC& dc ); #endif + + // Ctor using an existing graphics context given to wxGCDC ctor. + wxGCDCImpl(wxDC *owner, wxGraphicsContext* context); + wxGCDCImpl( wxDC *owner ); virtual ~wxGCDCImpl(); diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 832eb2bdc6..802ba8bf6a 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -106,9 +106,8 @@ wxGCDC::wxGCDC(const wxEnhMetaFileDC& dc) #endif wxGCDC::wxGCDC(wxGraphicsContext* context) : - wxDC( new wxGCDCImpl( this ) ) + wxDC(new wxGCDCImpl(this, context)) { - SetGraphicsContext(context); } wxGCDC::wxGCDC() : @@ -122,6 +121,12 @@ wxGCDC::~wxGCDC() wxIMPLEMENT_ABSTRACT_CLASS(wxGCDCImpl, wxDCImpl); +wxGCDCImpl::wxGCDCImpl(wxDC *owner, wxGraphicsContext* context) : + wxDCImpl(owner) +{ + Init(context); +} + wxGCDCImpl::wxGCDCImpl( wxDC *owner ) : wxDCImpl( owner ) { From aa6a8fbdf0983f48065a4feb15330c210b34ac0f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Dec 2018 03:43:37 +0100 Subject: [PATCH 004/553] Document that wxGCDC takes ownership of the provided context This is a rather important detail which the documentation completely forgot to mention. --- interface/wx/dcgraph.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/interface/wx/dcgraph.h b/interface/wx/dcgraph.h index c60a00e7e0..ed2d01a9c1 100644 --- a/interface/wx/dcgraph.h +++ b/interface/wx/dcgraph.h @@ -40,6 +40,10 @@ public: /** Construct a wxGCDC from an existing graphics context. + + Note that this object takes ownership of @a context and will delete it + when it is destroyed or when SetGraphicsContext() is called with a + different context object. */ wxGCDC(wxGraphicsContext* context); @@ -64,8 +68,11 @@ public: /** Set the graphics context to be used for this wxGCDC. + + Note that this object takes ownership of @a context and will delete it when + it is destroyed or when SetGraphicsContext() is called again. */ - void SetGraphicsContext( wxGraphicsContext* ctx ); + void SetGraphicsContext(wxGraphicsContext* context); }; From 2d18aaf58a1b5c6d6fe9960f282d478e392a5c31 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Dec 2018 20:48:32 +0100 Subject: [PATCH 005/553] Move check for mouse button down events in wxDataViewMainWindow No real changes, just prepare for the next commit. --- src/generic/datavgen.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 448a58bf5b..f5c60b3953 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4525,14 +4525,6 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) return; } - if(event.ButtonDown()) - { - // Not skipping button down events would prevent the system from - // setting focus to this window as most (all?) of them do by default, - // so skip it to enable default handling. - event.Skip(); - } - int x = event.GetX(); int y = event.GetY(); m_owner->CalcUnscrolledPosition( x, y, &x, &y ); @@ -4560,6 +4552,14 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) const unsigned int current = GetLineAt( y ); const wxDataViewItem item = GetItemByRow(current); + if(event.ButtonDown()) + { + // Not skipping button down events would prevent the system from + // setting focus to this window as most (all?) of them do by default, + // so skip it to enable default handling. + event.Skip(); + } + // Handle right clicking here, before everything else as context menu // events should be sent even when we click outside of any item, unlike all // the other ones. From 8cf2b683be2c2878c2406d463f526524c5856b53 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 6 Dec 2018 22:27:25 +0100 Subject: [PATCH 006/553] CMake: Fix installation include directory --- build/cmake/install.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake index 734a2af88a..5e30a933f2 100644 --- a/build/cmake/install.cmake +++ b/build/cmake/install.cmake @@ -12,13 +12,19 @@ if(NOT wxBUILD_INSTALL) endif() install(CODE "message(STATUS \"Installing: Headers...\")") -wx_install( - DIRECTORY "${wxSOURCE_DIR}/include/wx" - DESTINATION "include") -if(MSVC) +if(UNIX) wx_install( - DIRECTORY "${wxSOURCE_DIR}/include/msvc" + DIRECTORY "${wxSOURCE_DIR}/include/wx" + DESTINATION "include/wx-${wxMAJOR_VERSION}.${wxMINOR_VERSION}") +else() + wx_install( + DIRECTORY "${wxSOURCE_DIR}/include/wx" DESTINATION "include") + if(MSVC) + wx_install( + DIRECTORY "${wxSOURCE_DIR}/include/msvc" + DESTINATION "include") + endif() endif() # setup header and wx-config From bc4b56bf88bc02b5c196996e436d6f435ac0e135 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 6 Dec 2018 22:32:44 +0100 Subject: [PATCH 007/553] CMake: Reorder items in config.cmake Group similar items together. --- build/cmake/config.cmake | 80 ++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index b89cbac302..9a1b9b855a 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -43,74 +43,82 @@ endfunction() function(wx_write_config) # TODO: set variables + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix $) + wx_string_append(exec_prefix "{prefix}") set(includedir "$") wx_string_append(includedir "{prefix}/include") set(libdir "$") wx_string_append(libdir "{exec_prefix}/lib") set(bindir "$") wx_string_append(bindir "{exec_prefix}/bin") - if(CMAKE_CROSSCOMPILING) - set(cross_compiling yes) - else() - set(cross_compiling no) - endif() - set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix $) - wx_string_append(exec_prefix "{prefix}") - set(BUILT_WX_LIBS) - foreach(lib IN LISTS wxLIB_TARGETS) - wx_string_append(BUILT_WX_LIBS " ${lib}") - endforeach() - set(CC ${CMAKE_C_COMPILER}) - set(CXX ${CMAKE_CXX_COMPILER}) - set(DMALLOC_LIBS) + find_program(EGREP egrep) mark_as_advanced(EGREP) - set(EXTRALIBS_GUI) - set(EXTRALIBS_HTML) - set(EXTRALIBS_SDL) - set(EXTRALIBS_STC) - set(EXTRALIBS_WEBVIEW) - set(EXTRALIBS_XML) - set(LDFLAGS_GL) + if(wxBUILD_MONOLITHIC) set(MONOLITHIC 1) else() set(MONOLITHIC 0) endif() - set(OPENGL_LIBS) - set(RESCOMP) if(wxBUILD_SHARED) set(SHARED 1) else() set(SHARED 0) endif() - set(STD_BASE_LIBS) - set(STD_GUI_LIBS) - #TODO: setting TOOLCHAIN_NAME produces change results in config folder -# set(TOOLCHAIN_NAME) - set(TOOLKIT_DIR ${wxBUILD_TOOLKIT}) - set(TOOLKIT_VERSION) - set(WIDGET_SET ${wxBUILD_WIDGETSET}) if(wxUSE_UNICODE) set(WX_CHARTYPE unicode) else() set(WX_CHARTYPE ansi) endif() + if(CMAKE_CROSSCOMPILING) + set(cross_compiling yes) + set(host_alias ${CMAKE_SYSTEM_NAME}) + else() + set(cross_compiling no) + endif() + + set(BUILT_WX_LIBS) + foreach(lib IN LISTS wxLIB_TARGETS) + wx_string_append(BUILT_WX_LIBS " ${lib}") + endforeach() + set(STD_BASE_LIBS) + set(STD_GUI_LIBS) + + set(WX_RELEASE ${wxMAJOR_VERSION}.${wxMINOR_VERSION}) + set(WX_VERSION ${wxVERSION}) + set(WX_SUBVERSION ${wxVERSION}.0) set(WX_FLAVOUR) + set(TOOLKIT_DIR ${wxBUILD_TOOLKIT}) + set(TOOLKIT_VERSION) + set(WIDGET_SET ${wxBUILD_WIDGETSET}) + #TODO: setting TOOLCHAIN_NAME produces change results in config folder +# set(TOOLCHAIN_NAME) set(WX_LIBRARY_BASENAME_GUI) set(WX_LIBRARY_BASENAME_NOGUI) - set(WX_RELEASE ${wxMAJOR_VERSION}.${wxMINOR_VERSION}) - set(WX_SUBVERSION ${wxVERSION}.0) - set(WX_VERSION ${wxVERSION}) + + set(WXCONFIG_LIBS) + set(EXTRALIBS_GUI) + set(EXTRALIBS_SDL) + set(EXTRALIBS_HTML) + set(EXTRALIBS_STC) + set(EXTRALIBS_WEBVIEW) + set(EXTRALIBS_XML) + set(EXTRALIBS_MEDIA) + set(OPENGL_LIBS) + set(DMALLOC_LIBS) + + set(CC ${CMAKE_C_COMPILER}) + set(CXX ${CMAKE_CXX_COMPILER}) set(WXCONFIG_CFLAGS) + set(WXCONFIG_LDFLAGS) set(WXCONFIG_CPPFLAGS) set(WXCONFIG_CXXFLAGS) - set(WXCONFIG_LDFLAGS) set(WXCONFIG_LDFLAGS_GUI) - set(WXCONFIG_LIBS) set(WXCONFIG_RESFLAGS) set(WXCONFIG_RPATH) + set(LDFLAGS_GL) + set(RESCOMP) wx_configure_script( "${CMAKE_CURRENT_SOURCE_DIR}/wx-config.in" From 33a550d97f983c24e58c0a6b420adfed21326deb Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 6 Dec 2018 22:35:31 +0100 Subject: [PATCH 008/553] CMake: Set wx-config base, gui and built libraries Remove unused propagated variables. --- build/cmake/config.cmake | 21 ++++++++++++++++++--- build/cmake/functions.cmake | 3 --- build/cmake/lib/CMakeLists.txt | 5 ----- build/cmake/tests/CMakeLists.txt | 3 --- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 9a1b9b855a..fe54de54f4 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -79,11 +79,26 @@ function(wx_write_config) endif() set(BUILT_WX_LIBS) - foreach(lib IN LISTS wxLIB_TARGETS) - wx_string_append(BUILT_WX_LIBS " ${lib}") - endforeach() set(STD_BASE_LIBS) set(STD_GUI_LIBS) + set(STD_BASE_LIBS_ALL xml net base) + set(STD_GUI_LIBS_ALL xrc html qa adv core) + foreach(lib IN ITEMS xrc webview stc richtext ribbon propgrid aui gl media html qa adv core xml net base) + if(TARGET ${lib}) + wx_string_append(BUILT_WX_LIBS "${lib} ") + list(FIND STD_BASE_LIBS_ALL ${lib} index) + if (index GREATER -1) + wx_string_append(STD_BASE_LIBS "${lib} ") + endif() + list(FIND STD_GUI_LIBS_ALL ${lib} index) + if (index GREATER -1) + wx_string_append(STD_GUI_LIBS "${lib} ") + endif() + endif() + endforeach() + string(STRIP ${BUILT_WX_LIBS} BUILT_WX_LIBS) + string(STRIP ${STD_BASE_LIBS} STD_BASE_LIBS) + string(STRIP ${STD_GUI_LIBS} STD_GUI_LIBS) set(WX_RELEASE ${wxMAJOR_VERSION}.${wxMINOR_VERSION}) set(WX_VERSION ${wxVERSION}) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index b12e60d13c..57c24ea068 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -313,8 +313,6 @@ macro(wx_add_library name) RUNTIME DESTINATION "lib${wxPLATFORM_LIB_DIR}" BUNDLE DESTINATION Applications/wxWidgets ) - - list(APPEND wxLIB_TARGETS ${name}) endif() endmacro() @@ -349,7 +347,6 @@ endmacro() # Enable precompiled headers for wx libraries macro(wx_finalize_lib target_name) - set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE) if(wxBUILD_PRECOMP) if(TARGET ${target_name}) wx_target_enable_precomp(${target_name} "${wxSOURCE_DIR}/include/wx/wxprec.h") diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index 4f8fc884c2..4974d48fea 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -9,7 +9,6 @@ include(../source_groups.cmake) -set(wxLIB_TARGETS) if(wxBUILD_MONOLITHIC) # Initialize variables for monolithic build set(wxMONO_SRC_FILES) @@ -98,7 +97,3 @@ if(wxBUILD_MONOLITHIC) endforeach() wx_finalize_lib(mono) endif() - -# Propagate variable(s) to parent scope -set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE) -set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} PARENT_SCOPE) diff --git a/build/cmake/tests/CMakeLists.txt b/build/cmake/tests/CMakeLists.txt index e0f449f9b7..8065a14edf 100644 --- a/build/cmake/tests/CMakeLists.txt +++ b/build/cmake/tests/CMakeLists.txt @@ -16,6 +16,3 @@ add_subdirectory(drawing) add_subdirectory(gui) endif() - -# Propagate variable(s) to parent scope -set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} PARENT_SCOPE) From 12ed604cb38c8045979155283e816f38d53dca69 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 6 Dec 2018 22:36:57 +0100 Subject: [PATCH 009/553] CMake: Set wx-config name variables --- build/cmake/config.cmake | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index fe54de54f4..56fc23ce77 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -42,16 +42,11 @@ endfunction() function(wx_write_config) - # TODO: set variables set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix $) - wx_string_append(exec_prefix "{prefix}") - set(includedir "$") - wx_string_append(includedir "{prefix}/include") - set(libdir "$") - wx_string_append(libdir "{exec_prefix}/lib") - set(bindir "$") - wx_string_append(bindir "{exec_prefix}/bin") + set(exec_prefix "\${prefix}") + set(includedir "\${prefix}/include") + set(libdir "\${exec_prefix}/lib") + set(bindir "\${exec_prefix}/bin") find_program(EGREP egrep) mark_as_advanced(EGREP) @@ -68,8 +63,10 @@ function(wx_write_config) endif() if(wxUSE_UNICODE) set(WX_CHARTYPE unicode) + set(lib_unicode_suffix u) else() set(WX_CHARTYPE ansi) + set(lib_unicode_suffix) endif() if(CMAKE_CROSSCOMPILING) set(cross_compiling yes) @@ -107,10 +104,9 @@ function(wx_write_config) set(TOOLKIT_DIR ${wxBUILD_TOOLKIT}) set(TOOLKIT_VERSION) set(WIDGET_SET ${wxBUILD_WIDGETSET}) - #TODO: setting TOOLCHAIN_NAME produces change results in config folder -# set(TOOLCHAIN_NAME) - set(WX_LIBRARY_BASENAME_GUI) - set(WX_LIBRARY_BASENAME_NOGUI) + set(TOOLCHAIN_NAME "${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}-${WX_RELEASE}") + set(WX_LIBRARY_BASENAME_GUI "wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}") + set(WX_LIBRARY_BASENAME_NOGUI "wx_base${lib_unicode_suffix}") set(WXCONFIG_LIBS) set(EXTRALIBS_GUI) From c28ae123c172e18ce083edb45367c5495673e6c4 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 6 Dec 2018 22:38:33 +0100 Subject: [PATCH 010/553] CMake: Set wx-config extra libraries and flags --- build/cmake/config.cmake | 43 +++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 56fc23ce77..d397f0dca2 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -27,6 +27,18 @@ macro(wx_configure_script input output) ) endmacro() +macro(wx_get_dependencies var lib) + set(${var}) + if(TARGET ${lib}) + get_target_property(deps ${lib} LINK_LIBRARIES) + foreach(dep IN LISTS deps) + get_filename_component(name ${dep} NAME) + wx_string_append(${var} "${name} ") + endforeach() + string(STRIP ${${var}} ${var}) + endif() +endmacro() + function(wx_write_config_inplace) wx_configure_script( "${CMAKE_CURRENT_SOURCE_DIR}/wx-config-inplace.in" @@ -108,26 +120,33 @@ function(wx_write_config) set(WX_LIBRARY_BASENAME_GUI "wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}") set(WX_LIBRARY_BASENAME_NOGUI "wx_base${lib_unicode_suffix}") - set(WXCONFIG_LIBS) - set(EXTRALIBS_GUI) - set(EXTRALIBS_SDL) - set(EXTRALIBS_HTML) - set(EXTRALIBS_STC) - set(EXTRALIBS_WEBVIEW) - set(EXTRALIBS_XML) - set(EXTRALIBS_MEDIA) - set(OPENGL_LIBS) + wx_get_dependencies(WXCONFIG_LIBS base) + wx_get_dependencies(EXTRALIBS_GUI core) + set(EXTRALIBS_SDL) # included in core libs when SDL is enabled + wx_get_dependencies(EXTRALIBS_HTML html) + wx_get_dependencies(EXTRALIBS_STC stc) + wx_get_dependencies(EXTRALIBS_WEBVIEW webview) + wx_get_dependencies(EXTRALIBS_XML xml) + wx_get_dependencies(EXTRALIBS_MEDIA media) + wx_get_dependencies(OPENGL_LIBS gl) set(DMALLOC_LIBS) set(CC ${CMAKE_C_COMPILER}) set(CXX ${CMAKE_CXX_COMPILER}) set(WXCONFIG_CFLAGS) set(WXCONFIG_LDFLAGS) - set(WXCONFIG_CPPFLAGS) - set(WXCONFIG_CXXFLAGS) + if(CMAKE_USE_PTHREADS_INIT) + set(WXCONFIG_CFLAGS "-pthread") + set(WXCONFIG_LDFLAGS "-pthread") + endif() + set(WXCONFIG_CPPFLAGS "-DWXUSINGDLL") + foreach(flag IN LISTS wxTOOLKIT_DEFINITIONS) + wx_string_append(WXCONFIG_CPPFLAGS " -D${flag}") + endforeach() + set(WXCONFIG_CXXFLAGS ${WXCONFIG_CFLAGS}) set(WXCONFIG_LDFLAGS_GUI) set(WXCONFIG_RESFLAGS) - set(WXCONFIG_RPATH) + set(WXCONFIG_RPATH "-Wl,-rpath,\$libdir") set(LDFLAGS_GL) set(RESCOMP) From da612f02b5a8f2a8a8f8832dd12edd5a199cb066 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Dec 2018 22:53:28 +0100 Subject: [PATCH 011/553] Stop editing in generic wxDataViewCtrl when any button is pressed Previously, the editor was hidden if the left mouse button was pressed, but not for the right (or any other) button, which could result in a confusing situation when a user could select a command from a context menu shown from the corresponding event handler and start editing another item while the current one was still being edited too. --- src/generic/datavgen.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index f5c60b3953..f94700b072 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4558,6 +4558,12 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) // setting focus to this window as most (all?) of them do by default, // so skip it to enable default handling. event.Skip(); + + // Also stop editing if any mouse button is pressed: this is not really + // necessary for the left button, as it would result in a focus loss + // that would make the editor close anyhow, but we do need to do it for + // the other ones and it does no harm to do it for the left one too. + FinishEditing(); } // Handle right clicking here, before everything else as context menu From dc1aa3097c15868d124b947fae7b5dc91f350edc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Dec 2018 22:55:42 +0100 Subject: [PATCH 012/553] Avoid warnings on right click in GTK wxDataViewCtrl while editing The code handling right button click used the path of the item under mouse without checking if there was any item, resulting in GTK+ warnings due to the use of an invalid item. Simply add a check for the item validity: we definitely don't want to select it if it's invalid anyhow. --- src/gtk/dataview.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index d2c1abf352..6a7811cf1d 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -4591,11 +4591,14 @@ gtk_dataview_button_press_callback( GtkWidget *WXUNUSED(widget), // If the right click is on an item that isn't selected, select it, as is // commonly done. Do not do it if the item under mouse is already selected, // because it could be a part of multi-item selection. - GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dv->GtkGetTreeView())); - if ( !gtk_tree_selection_path_is_selected(selection, path) ) + if ( path ) { - gtk_tree_selection_unselect_all(selection); - gtk_tree_selection_select_path(selection, path); + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dv->GtkGetTreeView())); + if ( !gtk_tree_selection_path_is_selected(selection, path) ) + { + gtk_tree_selection_unselect_all(selection); + gtk_tree_selection_select_path(selection, path); + } } wxDataViewEvent From 28a13209a2c70871db6539e161aebc27e330fa92 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 6 Dec 2018 23:20:48 +0100 Subject: [PATCH 013/553] CMake: Compile and link with -pthread when using pthread --- build/cmake/functions.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 57c24ea068..088d685eb2 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -105,6 +105,10 @@ function(wx_set_common_target_properties target_name) endif() # TODO: add warning flags for other compilers endif() + if(CMAKE_USE_PTHREADS_INIT) + target_compile_options(${target_name} PRIVATE "-pthread") + set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-pthread") + endif() endfunction() # Set common properties on wx library target From 194936ab26a7b3348892d429c6438e53f5d635eb Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Thu, 6 Dec 2018 11:13:54 +0000 Subject: [PATCH 014/553] Fix doubly-qualified namespace in wxQt wxDC code Avoid (almost certainly accidentally) repeating "QPainter::". See https://github.com/wxWidgets/wxWidgets/pull/1048 --- src/qt/dc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 6fb5ed0e5a..9dd1d4cef5 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -256,7 +256,7 @@ void wxQtDCImpl::SetLogicalFunction(wxRasterOperationMode function) rasterColourOp = wxQtNONE; break; case wxNO_OP: // dst - m_qtPainter->setCompositionMode( QPainter::QPainter::CompositionMode_DestinationOver ); + m_qtPainter->setCompositionMode( QPainter::CompositionMode_DestinationOver ); rasterColourOp = wxQtNONE; break; case wxNOR: // (NOT src) AND (NOT dst) From 82a66e56b2c9e4f4453a13c3f03803d92f8a2f73 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Thu, 6 Dec 2018 11:13:54 +0000 Subject: [PATCH 015/553] Fix possible usage of uninitialized variable in wxQt wxDC code Make sure rasterColourOp is always initialized, even if none of the switch cases matches, to avoid warnings about possibly uninitialized variable. See https://github.com/wxWidgets/wxWidgets/pull/1048 --- src/qt/dc.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 9dd1d4cef5..8098a03dcf 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -220,7 +220,7 @@ void wxQtDCImpl::SetLogicalFunction(wxRasterOperationMode function) { m_logicalFunction = function; - wxQtRasterColourOp rasterColourOp; + wxQtRasterColourOp rasterColourOp = wxQtNONE; switch ( function ) { case wxCLEAR: // 0 @@ -229,7 +229,6 @@ void wxQtDCImpl::SetLogicalFunction(wxRasterOperationMode function) break; case wxXOR: // src XOR dst m_qtPainter->setCompositionMode( QPainter::RasterOp_SourceXorDestination ); - rasterColourOp = wxQtNONE; break; case wxINVERT: // NOT dst => dst XOR WHITE m_qtPainter->setCompositionMode( QPainter::RasterOp_SourceXorDestination ); @@ -241,35 +240,27 @@ void wxQtDCImpl::SetLogicalFunction(wxRasterOperationMode function) break; case wxAND_REVERSE: // src AND (NOT dst) m_qtPainter->setCompositionMode( QPainter::RasterOp_SourceAndNotDestination ); - rasterColourOp = wxQtNONE; break; case wxCOPY: // src m_qtPainter->setCompositionMode( QPainter::CompositionMode_SourceOver ); - rasterColourOp = wxQtNONE; break; case wxAND: // src AND dst m_qtPainter->setCompositionMode( QPainter::RasterOp_SourceAndDestination ); - rasterColourOp = wxQtNONE; break; case wxAND_INVERT: // (NOT src) AND dst m_qtPainter->setCompositionMode( QPainter::RasterOp_NotSourceAndDestination ); - rasterColourOp = wxQtNONE; break; case wxNO_OP: // dst m_qtPainter->setCompositionMode( QPainter::CompositionMode_DestinationOver ); - rasterColourOp = wxQtNONE; break; case wxNOR: // (NOT src) AND (NOT dst) m_qtPainter->setCompositionMode( QPainter::RasterOp_NotSourceAndNotDestination ); - rasterColourOp = wxQtNONE; break; case wxEQUIV: // (NOT src) XOR dst m_qtPainter->setCompositionMode( QPainter::RasterOp_NotSourceXorDestination ); - rasterColourOp = wxQtNONE; break; case wxSRC_INVERT: // (NOT src) m_qtPainter->setCompositionMode( QPainter::RasterOp_NotSource ); - rasterColourOp = wxQtNONE; break; case wxOR_INVERT: // (NOT src) OR dst m_qtPainter->setCompositionMode( QPainter::RasterOp_SourceOrDestination ); @@ -277,11 +268,9 @@ void wxQtDCImpl::SetLogicalFunction(wxRasterOperationMode function) break; case wxNAND: // (NOT src) OR (NOT dst) m_qtPainter->setCompositionMode( QPainter::RasterOp_NotSourceOrNotDestination ); - rasterColourOp = wxQtNONE; break; case wxOR: // src OR dst m_qtPainter->setCompositionMode( QPainter::RasterOp_SourceOrDestination ); - rasterColourOp = wxQtNONE; break; case wxSET: // 1 m_qtPainter->setCompositionMode( QPainter::CompositionMode_SourceOver ); From fd8248762ea87972f846351fc6131e1cfda75927 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 6 Dec 2018 14:42:50 +0000 Subject: [PATCH 016/553] Add support for wxLB_SORT to wxListBox in wxQt --- src/qt/listbox.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index 9723399523..d4b82855be 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -89,6 +89,11 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, QListWidgetItem* item; m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this ); + if ( style == wxLB_SORT ) + { + m_qtListWidget->setSortingEnabled(true); + } + while ( n-- > 0 ) { item = new QListWidgetItem(); From 1f0e456620fd5f0dff7d2ef2c6ab9c144ca4950e Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 6 Dec 2018 14:42:50 +0000 Subject: [PATCH 017/553] Implement wxListBox::GetSelections() in wxQt --- src/qt/listbox.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index d4b82855be..2fa3647bfd 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -135,9 +135,17 @@ bool wxListBox::IsSelected(int n) const return item->isSelected(); } -int wxListBox::GetSelections(wxArrayInt& WXUNUSED(aSelections)) const +int wxListBox::GetSelections(wxArrayInt& aSelections) const { - return 0; + aSelections.clear(); + + for ( unsigned int i = 0; i < GetCount(); ++i) + { + if ( IsSelected(i) ) + aSelections.push_back(i); + } + + return aSelections.size(); } unsigned wxListBox::GetCount() const From 10381cb94e420175ca6874d570d28e6d9de96881 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 6 Dec 2018 14:42:50 +0000 Subject: [PATCH 018/553] Deselect all items in wxQt wxListBox::SetSelection(wxNOT_FOUND) Follow wxWidgets API convention in wxQt too. --- include/wx/qt/listbox.h | 2 ++ src/qt/listbox.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/wx/qt/listbox.h b/include/wx/qt/listbox.h index dc0c761c65..e0086cda58 100644 --- a/include/wx/qt/listbox.h +++ b/include/wx/qt/listbox.h @@ -90,6 +90,8 @@ protected: private: virtual void Init(); //common construction + void UnSelectAll(); + wxDECLARE_DYNAMIC_CLASS(wxListBox); }; diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index 2fa3647bfd..0a6382cca3 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -182,6 +182,12 @@ void wxListBox::DoSetFirstItem(int WXUNUSED(n)) void wxListBox::DoSetSelection(int n, bool select) { + if ( n == wxNOT_FOUND ) + { + UnSelectAll(); + return; + } + return m_qtListWidget->setCurrentRow(n, select ? QItemSelectionModel::Select : QItemSelectionModel::Deselect ); } @@ -248,3 +254,12 @@ QScrollArea *wxListBox::QtGetScrollBarsContainer() const { return (QScrollArea *) m_qtListWidget; } + +void wxListBox::UnSelectAll() +{ + for ( unsigned int i = 0; i < GetCount(); ++i ) + { + if ( IsSelected(i) ) + DoSetSelection(i, false); + } +} From effdec75bde7765ce612f3dacd2cba1982430736 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 6 Dec 2018 09:32:21 +0000 Subject: [PATCH 019/553] Fix crash when changing wxQt wxScrollBar position wxScrollBar::SetScrollbar() now blocks the signals of QScrollBar before setting a value, which avoids behaviour where slots are called before the QScrollBar is displayed. Closes https://github.com/wxWidgets/wxWidgets/pull/1050 --- src/qt/scrolbar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/scrolbar.cpp b/src/qt/scrolbar.cpp index 99db6cc451..e848bf2c0c 100644 --- a/src/qt/scrolbar.cpp +++ b/src/qt/scrolbar.cpp @@ -100,7 +100,9 @@ void wxScrollBar::SetScrollbar(int position, int WXUNUSED(thumbSize), { m_qtScrollBar->setRange( 0, range - pageSize ); m_qtScrollBar->setPageStep( pageSize ); + m_qtScrollBar->blockSignals(true); m_qtScrollBar->setValue( position ); + m_qtScrollBar->blockSignals(false); m_qtScrollBar->show(); } else From 3d755416626e021815150276ecb6aaa229b52ed3 Mon Sep 17 00:00:00 2001 From: jwiesemann Date: Fri, 7 Dec 2018 03:34:21 +0100 Subject: [PATCH 020/553] Fix bug in template selection in docview framework Don't use the template specified by the filter in the file open dialog if it's incapable of actually handling the current file. This fixes a regression compared to 2.8 in docview code and allows opening a file using the correct template for its extension even if an incorrect (e.g. default) filter is chosen in the file open dialog. Closes #18123. --- docs/changes.txt | 1 + src/common/docview.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 57a5769bcc..4d09c8f13b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -143,6 +143,7 @@ All (GUI): - Add wxToolbook::EnablePage() (Stefan Ziegler). - Adapt AUI colours to system colour changes (Daniel Kulp). - Fix removing and inserting pages in wxToolbook (Stefan Ziegler). +- Fix bug in template selection in docview framework (jwiesemann). wxGTK: diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 54c4f6a5f7..c41b1f60ee 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1805,7 +1805,18 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, // first choose the template using the extension, if this fails (i.e. // wxFileSelectorEx() didn't fill it), then use the path if ( FilterIndex != -1 ) + { theTemplate = templates[FilterIndex]; + if ( theTemplate ) + { + // But don't use this template if it doesn't match the path as + // can happen if the user specified the extension explicitly + // but didn't bother changing the filter. + if ( !theTemplate->FileMatchesTemplate(path) ) + theTemplate = NULL; + } + } + if ( !theTemplate ) theTemplate = FindTemplateForPath(path); if ( !theTemplate ) From d6a137b730d5d249e2fb99b5558ee6dd3a97ce56 Mon Sep 17 00:00:00 2001 From: jensgoe Date: Sun, 18 Nov 2018 22:48:28 +0100 Subject: [PATCH 021/553] Improve wxDataViewCtrl performance with wxDV_VARIABLE_LINE_HEIGHT Store the line heights in a cache to make the (generic) wxDataViewCtrl usable with this style. --- Makefile.in | 36 ++- build/bakefiles/files.bkl | 1 + build/cmake/files.cmake | 1 + build/files | 1 + build/msw/makefile.bcc | 44 ++- build/msw/makefile.gcc | 44 ++- build/msw/makefile.vc | 44 ++- build/msw/wx_core.vcxproj | 1 + build/msw/wx_core.vcxproj.filters | 3 + build/msw/wx_vc7_core.vcproj | 3 + build/msw/wx_vc8_core.vcproj | 4 + build/msw/wx_vc9_core.vcproj | 4 + docs/changes.txt | 1 + include/wx/generic/private/rowheightcache.h | 142 +++++++++ src/generic/datavgen.cpp | 163 +++++++--- src/generic/rowheightcache.cpp | 337 ++++++++++++++++++++ tests/Makefile.in | 4 + tests/makefile.bcc | 4 + tests/makefile.gcc | 4 + tests/makefile.vc | 4 + tests/rowheightcache/rowheightcachetest.cpp | 280 ++++++++++++++++ tests/test.bkl | 1 + tests/test_vc7_test_gui.vcproj | 3 + tests/test_vc8_test_gui.vcproj | 4 + tests/test_vc9_test_gui.vcproj | 4 + 25 files changed, 1068 insertions(+), 69 deletions(-) create mode 100644 include/wx/generic/private/rowheightcache.h create mode 100644 src/generic/rowheightcache.cpp create mode 100644 tests/rowheightcache/rowheightcachetest.cpp diff --git a/Makefile.in b/Makefile.in index e44bc57695..564c1011e7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4579,7 +4579,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS = \ monodll_datavgen.o \ monodll_editlbox.o \ monodll_laywin.o \ - monodll_calctrlg.o + monodll_calctrlg.o \ + monodll_rowheightcache.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS = \ $(__LOWLEVEL_SRC_OBJECTS_1) \ @@ -4839,7 +4840,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS = \ monodll_datavgen.o \ monodll_editlbox.o \ monodll_laywin.o \ - monodll_calctrlg.o + monodll_calctrlg.o \ + monodll_rowheightcache.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS = \ monodll_fontmgrcmn.o \ @@ -6555,7 +6557,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1 = \ monolib_datavgen.o \ monolib_editlbox.o \ monolib_laywin.o \ - monolib_calctrlg.o + monolib_calctrlg.o \ + monolib_rowheightcache.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS_1 = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 = \ $(__LOWLEVEL_SRC_OBJECTS_3) \ @@ -6815,7 +6818,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 = \ monolib_datavgen.o \ monolib_editlbox.o \ monolib_laywin.o \ - monolib_calctrlg.o + monolib_calctrlg.o \ + monolib_rowheightcache.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_1 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_fontmgrcmn.o \ @@ -8678,7 +8682,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2 = \ coredll_datavgen.o \ coredll_editlbox.o \ coredll_laywin.o \ - coredll_calctrlg.o + coredll_calctrlg.o \ + coredll_rowheightcache.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS_2 = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 = \ $(__LOWLEVEL_SRC_OBJECTS_5) \ @@ -8938,7 +8943,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 = \ coredll_datavgen.o \ coredll_editlbox.o \ coredll_laywin.o \ - coredll_calctrlg.o + coredll_calctrlg.o \ + coredll_rowheightcache.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_2 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_fontmgrcmn.o \ @@ -10396,7 +10402,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3 = \ corelib_datavgen.o \ corelib_editlbox.o \ corelib_laywin.o \ - corelib_calctrlg.o + corelib_calctrlg.o \ + corelib_rowheightcache.o @COND_USE_GUI_1_WXUNIV_0@__CORE_SRC_OBJECTS_3 = $(COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3) COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 = \ $(__LOWLEVEL_SRC_OBJECTS_7) \ @@ -10656,7 +10663,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 = \ corelib_datavgen.o \ corelib_editlbox.o \ corelib_laywin.o \ - corelib_calctrlg.o + corelib_calctrlg.o \ + corelib_rowheightcache.o @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_3 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_fontmgrcmn.o \ @@ -20698,6 +20706,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@monodll_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@monodll_rowheightcache.o: $(srcdir)/src/generic/rowheightcache.cpp $(MONODLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/rowheightcache.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monodll_osx_cocoa_mediactrl.o: $(srcdir)/src/osx/cocoa/mediactrl.mm $(MONODLL_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/mediactrl.mm @@ -25951,6 +25962,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@monolib_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@monolib_rowheightcache.o: $(srcdir)/src/generic/rowheightcache.cpp $(MONOLIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/rowheightcache.cpp + @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@monolib_osx_cocoa_mediactrl.o: $(srcdir)/src/osx/cocoa/mediactrl.mm $(MONOLIB_ODEP) @COND_TOOLKIT_OSX_COCOA_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/mediactrl.mm @@ -31297,6 +31311,9 @@ coredll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(COREDLL_ODEP) @COND_USE_GUI_1@coredll_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(COREDLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@coredll_rowheightcache.o: $(srcdir)/src/generic/rowheightcache.cpp $(COREDLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/rowheightcache.cpp + corelib_event.o: $(srcdir)/src/common/event.cpp $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/event.cpp @@ -35545,6 +35562,9 @@ corelib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(CORELIB_ODEP) @COND_USE_GUI_1@corelib_calctrlg.o: $(srcdir)/src/generic/calctrlg.cpp $(CORELIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/calctrlg.cpp +@COND_USE_GUI_1@corelib_rowheightcache.o: $(srcdir)/src/generic/rowheightcache.cpp $(CORELIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/rowheightcache.cpp + advdll_version_rc.o: $(srcdir)/src/msw/version.rc $(ADVDLL_ODEP) $(WINDRES) -i$< -o$@ --define __WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) --define WXBUILDING --define WXDLLNAME=$(WXDLLNAMEPREFIXGUI)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv$(WXCOMPILER)$(VENDORTAG)$(WXDLLVERSIONTAG) $(__RCDEFDIR_p) --include-dir $(top_srcdir)/include $(__INC_TIFF_BUILD_p_66) $(__INC_TIFF_p_66) $(__INC_JPEG_p_66) $(__INC_PNG_p_65) $(__INC_ZLIB_p_67) $(__INC_REGEX_p_65) $(__INC_EXPAT_p_65) --define WXUSINGDLL --define WXMAKINGDLL_ADV diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 3f84e21ae5..6001ccbd34 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -1005,6 +1005,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/generic/editlbox.cpp src/generic/laywin.cpp src/generic/calctrlg.cpp + src/generic/rowheightcache.cpp wx/affinematrix2dbase.h diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index 3111a384c2..c126d0f237 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -908,6 +908,7 @@ set(GUI_CMN_SRC src/generic/wizard.cpp src/generic/editlbox.cpp src/generic/datavgen.cpp + src/generic/rowheightcache.cpp ) set(GUI_CMN_HDR diff --git a/build/files b/build/files index d774633b94..13a542b9c9 100644 --- a/build/files +++ b/build/files @@ -899,6 +899,7 @@ GUI_CMN_SRC = src/generic/renderg.cpp src/generic/richmsgdlgg.cpp src/generic/richtooltipg.cpp + src/generic/rowheightcache.cpp src/generic/sashwin.cpp src/generic/scrlwing.cpp src/generic/selstore.cpp diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index 8112f30f89..ca37c2f67e 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -2126,7 +2126,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_OBJECTS = \ @@ -2451,7 +2452,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_rowheightcache.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_OBJECTS = \ @@ -2955,7 +2957,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_1_OBJECTS = \ @@ -3280,7 +3283,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_rowheightcache.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_1_OBJECTS = \ @@ -3659,7 +3663,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_2_OBJECTS = \ @@ -3984,7 +3989,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_rowheightcache.obj !endif !if "$(MONOLITHIC)" == "0" && "$(SHARED)" == "0" && "$(USE_GUI)" == "1" __corelib___depname = \ @@ -4329,7 +4335,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_3_OBJECTS = \ @@ -4654,7 +4661,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_rowheightcache.obj !endif !if "$(SHARED)" == "1" ____wxcore_namedll_DEP = $(__coredll___depname) @@ -8937,6 +8945,11 @@ $(OBJS)\monodll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\monodll_version.res: ..\..\src\msw\version.rc brcc32 -32 -r -fo$@ -i$(BCCDIR)\include -d__WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) $(__UNICODE_DEFINE_p_67) -i$(SETUPHDIR) -i..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_4) -dWXBUILDING -dWXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG) -i$(BCCDIR)\include\windows\sdk -i..\..\src\tiff\libtiff -i..\..\src\jpeg -i..\..\src\png -i..\..\src\zlib -i..\..\src\regex -i..\..\src\expat\expat\lib -i..\..\src\stc\scintilla\include -i..\..\src\stc\scintilla\lexlib -i..\..\src\stc\scintilla\src -d__WX__ -dSCI_LEXER -dNO_CXX11_REGEX -dLINK_LEXERS -dwxUSE_BASE=1 -dWXMAKINGDLL ..\..\src\msw\version.rc @@ -11478,6 +11491,11 @@ $(OBJS)\monolib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\basedll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(BASEDLL_CXXFLAGS) -H ..\..\src\common\dummy.cpp @@ -13983,6 +14001,11 @@ $(OBJS)\coredll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\corelib_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) -H ..\..\src\common\dummy.cpp @@ -15711,6 +15734,11 @@ $(OBJS)\corelib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\advdll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) -q -c -P -o$@ $(ADVDLL_CXXFLAGS) -H ..\..\src\common\dummy.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index c6a2042c6b..6de7992c59 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -2152,7 +2152,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.o \ $(OBJS)\monodll_editlbox.o \ $(OBJS)\monodll_laywin.o \ - $(OBJS)\monodll_calctrlg.o + $(OBJS)\monodll_calctrlg.o \ + $(OBJS)\monodll_rowheightcache.o endif endif ifeq ($(USE_GUI),1) @@ -2479,7 +2480,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.o \ $(OBJS)\monodll_editlbox.o \ $(OBJS)\monodll_laywin.o \ - $(OBJS)\monodll_calctrlg.o + $(OBJS)\monodll_calctrlg.o \ + $(OBJS)\monodll_rowheightcache.o endif endif ifeq ($(USE_STC),1) @@ -2987,7 +2989,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.o \ $(OBJS)\monolib_editlbox.o \ $(OBJS)\monolib_laywin.o \ - $(OBJS)\monolib_calctrlg.o + $(OBJS)\monolib_calctrlg.o \ + $(OBJS)\monolib_rowheightcache.o endif endif ifeq ($(USE_GUI),1) @@ -3314,7 +3317,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.o \ $(OBJS)\monolib_editlbox.o \ $(OBJS)\monolib_laywin.o \ - $(OBJS)\monolib_calctrlg.o + $(OBJS)\monolib_calctrlg.o \ + $(OBJS)\monolib_rowheightcache.o endif endif ifeq ($(USE_STC),1) @@ -3707,7 +3711,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.o \ $(OBJS)\coredll_editlbox.o \ $(OBJS)\coredll_laywin.o \ - $(OBJS)\coredll_calctrlg.o + $(OBJS)\coredll_calctrlg.o \ + $(OBJS)\coredll_rowheightcache.o endif endif ifeq ($(USE_GUI),1) @@ -4034,7 +4039,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.o \ $(OBJS)\coredll_editlbox.o \ $(OBJS)\coredll_laywin.o \ - $(OBJS)\coredll_calctrlg.o + $(OBJS)\coredll_calctrlg.o \ + $(OBJS)\coredll_rowheightcache.o endif endif ifeq ($(MONOLITHIC),0) @@ -4385,7 +4391,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.o \ $(OBJS)\corelib_editlbox.o \ $(OBJS)\corelib_laywin.o \ - $(OBJS)\corelib_calctrlg.o + $(OBJS)\corelib_calctrlg.o \ + $(OBJS)\corelib_rowheightcache.o endif endif ifeq ($(USE_GUI),1) @@ -4712,7 +4719,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.o \ $(OBJS)\corelib_editlbox.o \ $(OBJS)\corelib_laywin.o \ - $(OBJS)\corelib_calctrlg.o + $(OBJS)\corelib_calctrlg.o \ + $(OBJS)\corelib_rowheightcache.o endif endif ifeq ($(SHARED),1) @@ -9119,6 +9127,11 @@ $(OBJS)\monodll_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monodll_rowheightcache.o: ../../src/generic/rowheightcache.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\monodll_version_rc.o: ../../src/msw/version.rc $(WINDRES) -i$< -o$@ --define __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) $(__UNICODE_DEFINE_p_67) --include-dir $(SETUPHDIR) --include-dir ../../include $(__CAIRO_INCLUDEDIR_p) --define WXBUILDING --define WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG) --include-dir ../../src/tiff/libtiff --include-dir ../../src/jpeg --include-dir ../../src/png --include-dir ../../src/zlib --include-dir ../../src/regex --include-dir ../../src/expat/expat/lib --include-dir ../../src/stc/scintilla/include --include-dir ../../src/stc/scintilla/lexlib --include-dir ../../src/stc/scintilla/src --define __WX__ --define SCI_LEXER --define NO_CXX11_REGEX --define LINK_LEXERS --define wxUSE_BASE=1 --define WXMAKINGDLL @@ -11660,6 +11673,11 @@ $(OBJS)\monolib_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monolib_rowheightcache.o: ../../src/generic/rowheightcache.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\basedll_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(BASEDLL_CXXFLAGS) $(CPPDEPS) $< @@ -14165,6 +14183,11 @@ $(OBJS)\coredll_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\coredll_rowheightcache.o: ../../src/generic/rowheightcache.cpp + $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\corelib_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< @@ -15893,6 +15916,11 @@ $(OBJS)\corelib_calctrlg.o: ../../src/generic/calctrlg.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\corelib_rowheightcache.o: ../../src/generic/rowheightcache.cpp + $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< +endif + $(OBJS)\advdll_dummy.o: ../../src/common/dummy.cpp $(CXX) -c -o $@ $(ADVDLL_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index c1ce7f10bd..13d3cc7abc 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -2443,7 +2443,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_OBJECTS = \ @@ -2768,7 +2769,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_datavgen.obj \ $(OBJS)\monodll_editlbox.obj \ $(OBJS)\monodll_laywin.obj \ - $(OBJS)\monodll_calctrlg.obj + $(OBJS)\monodll_calctrlg.obj \ + $(OBJS)\monodll_rowheightcache.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_OBJECTS = \ @@ -3278,7 +3280,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_1_OBJECTS = \ @@ -3603,7 +3606,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_datavgen.obj \ $(OBJS)\monolib_editlbox.obj \ $(OBJS)\monolib_laywin.obj \ - $(OBJS)\monolib_calctrlg.obj + $(OBJS)\monolib_calctrlg.obj \ + $(OBJS)\monolib_rowheightcache.obj !endif !if "$(USE_STC)" == "1" ____MONOLIB_STC_SRC_FILENAMES_1_OBJECTS = \ @@ -4048,7 +4052,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_2_OBJECTS = \ @@ -4373,7 +4378,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_datavgen.obj \ $(OBJS)\coredll_editlbox.obj \ $(OBJS)\coredll_laywin.obj \ - $(OBJS)\coredll_calctrlg.obj + $(OBJS)\coredll_calctrlg.obj \ + $(OBJS)\coredll_rowheightcache.obj !endif !if "$(MONOLITHIC)" == "0" && "$(SHARED)" == "0" && "$(USE_GUI)" == "1" __corelib___depname = \ @@ -4724,7 +4730,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_rowheightcache.obj !endif !if "$(USE_GUI)" == "1" && "$(WXUNIV)" == "1" ____CORE_SRC_FILENAMES_3_OBJECTS = \ @@ -5049,7 +5056,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_datavgen.obj \ $(OBJS)\corelib_editlbox.obj \ $(OBJS)\corelib_laywin.obj \ - $(OBJS)\corelib_calctrlg.obj + $(OBJS)\corelib_calctrlg.obj \ + $(OBJS)\corelib_rowheightcache.obj !endif !if "$(SHARED)" == "1" ____wxcore_namedll_DEP = $(__coredll___depname) @@ -9646,6 +9654,11 @@ $(OBJS)\monodll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\monodll_version.res: ..\..\src\msw\version.rc rc /fo$@ /d WIN32 $(____DEBUGRUNTIME_6) /d _CRT_SECURE_NO_DEPRECATE=1 /d _CRT_NON_CONFORMING_SWPRINTFS=1 /d _SCL_SECURE_NO_WARNINGS=1 $(__NO_VC_CRTDBG_p_72) /d __WXMSW__ $(__WXUNIV_DEFINE_p_67) $(__DEBUG_DEFINE_p_66) $(__NDEBUG_DEFINE_p_65) $(__EXCEPTIONS_DEFINE_p_65) $(__RTTI_DEFINE_p_65) $(__THREAD_DEFINE_p_65) $(__UNICODE_DEFINE_p_67) /i $(SETUPHDIR) /i ..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_4) /d WXBUILDING /d WXDLLNAME=wx$(PORTNAME)$(WXUNIVNAME)$(WX_VERSION_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(WXCOMPILER)$(VENDORTAG) /i ..\..\src\tiff\libtiff /i ..\..\src\jpeg /i ..\..\src\png /i ..\..\src\zlib /i ..\..\src\regex /i ..\..\src\expat\expat\lib /i ..\..\src\stc\scintilla\include /i ..\..\src\stc\scintilla\lexlib /i ..\..\src\stc\scintilla\src /d __WX__ /d SCI_LEXER /d NO_CXX11_REGEX /d LINK_LEXERS /d wxUSE_BASE=1 /d WXMAKINGDLL ..\..\src\msw\version.rc @@ -12187,6 +12200,11 @@ $(OBJS)\monolib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\basedll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(BASEDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp @@ -14692,6 +14710,11 @@ $(OBJS)\coredll_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\corelib_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp @@ -16420,6 +16443,11 @@ $(OBJS)\corelib_calctrlg.obj: ..\..\src\generic\calctrlg.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\calctrlg.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_rowheightcache.obj: ..\..\src\generic\rowheightcache.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\generic\rowheightcache.cpp +!endif + $(OBJS)\advdll_dummy.obj: ..\..\src\common\dummy.cpp $(CXX) /c /nologo /TP /Fo$@ $(ADVDLL_CXXFLAGS) /Ycwx/wxprec.h ..\..\src\common\dummy.cpp diff --git a/build/msw/wx_core.vcxproj b/build/msw/wx_core.vcxproj index bf3ea86b5a..87c60a35e1 100644 --- a/build/msw/wx_core.vcxproj +++ b/build/msw/wx_core.vcxproj @@ -1061,6 +1061,7 @@ + diff --git a/build/msw/wx_core.vcxproj.filters b/build/msw/wx_core.vcxproj.filters index 7e17bd7ad0..83c265118a 100644 --- a/build/msw/wx_core.vcxproj.filters +++ b/build/msw/wx_core.vcxproj.filters @@ -603,6 +603,9 @@ Generic Sources + + Generic Sources + Generic Sources diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index f64feb56e0..abd7d4a0ad 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -1286,6 +1286,9 @@ + + diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index b734aa02bd..c2f829be68 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -2127,6 +2127,10 @@ RelativePath="..\..\src\generic\richtooltipg.cpp" > + + diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 0b33c64c19..6f8f12e632 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -2123,6 +2123,10 @@ RelativePath="..\..\src\generic\richtooltipg.cpp" > + + diff --git a/docs/changes.txt b/docs/changes.txt index 4d09c8f13b..1bda884cde 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -144,6 +144,7 @@ All (GUI): - Adapt AUI colours to system colour changes (Daniel Kulp). - Fix removing and inserting pages in wxToolbook (Stefan Ziegler). - Fix bug in template selection in docview framework (jwiesemann). +- Improve wxDataViewCtrl performance with variable line heights (Jens Goepfert). wxGTK: diff --git a/include/wx/generic/private/rowheightcache.h b/include/wx/generic/private/rowheightcache.h new file mode 100644 index 0000000000..d9586f16e7 --- /dev/null +++ b/include/wx/generic/private/rowheightcache.h @@ -0,0 +1,142 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/private/rowheightcache.h +// Purpose: height cache of rows in a dataview +// Author: Jens Goepfert (mail@jensgoepfert.de) +// Created: 2018-03-06 +// Copyright: (c) wxWidgets team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_PRIVATE_ROWHEIGHTCACHE_H_ +#define _WX_PRIVATE_ROWHEIGHTCACHE_H_ + +#include "wx/hashmap.h" +#include "wx/vector.h" + +// struct describing a range of rows which contains rows .. +struct RowRange +{ + unsigned int from; + unsigned int to; +}; + +/** +@class RowRanges +A helper class that manages a set of RowRange objects. +It stores the indices that are members of a group in a memory +efficiant way. +*/ +class WXDLLIMPEXP_CORE RowRanges +//class RowRanges +{ +public: + /** + Adds a row index to this group by adding it to an existing RowRange + or by creating a new one. + */ + void Add(unsigned int row); + + /** + Removes a row index and all indices after idx from this group. + */ + void Remove(unsigned int row); + + /** + Checks whether a row index is contained in this group. + */ + bool Has(unsigned int row) const; + + /** + Returns the number of row indices that are contained in this group. + */ + unsigned int CountAll() const; + + /** + Returns the number of rows that are in this group before the given row index. + not including given row. + */ + unsigned int CountTo(unsigned int row) const; + unsigned int GetSize() const; // for debugging statistics + +private: + wxVector m_ranges; + /** + If a new row index was inserted Cleanup checks if the neighbour ranges + of idx can includes the same row indices and discards + unnecessary RowRange objects. + */ + void CleanUp(unsigned int idx); +}; + +WX_DECLARE_HASH_MAP(unsigned int, RowRanges*, wxIntegerHash, wxIntegerEqual, + HeightToRowRangesMap); + +/** +@class HeightCache + +HeightCache implements a cache mechanism for the DataViewCtrl to give +fast access to: +* the height of one line (GetLineHeight) +* the y-coordinate where a row starts (GetLineStart) +* and vice versa (GetLineAt) + +The layout of the cache is a hashmap where the keys are all exisiting +row heights in pixels. The values are RowRange objects that represents +all having the specified height. + +{ +22: RowRange([0..10], [15..17], [20..2000]), +42: RowRange([11..12], [18..18]), +62: RowRange([13..14], [19..19]) +} + +Examples +======== + +GetLineStart +------------ +To retrieve the y-coordinate of item 1000 it is neccessary to look into +each key of the hashmap *m_heightToRowRange*. Get the row count of +indices lower than 1000 (RowRange::CountTo) and multiplies it wich the +according height. + +RowRange([0..10], [15..17], [20..2000]).CountTo(1000) +--> 0..10 are 11 items, 15..17 are 3 items and 20..1000 are 980 items (1000-20) += 11 + 3 + 980 = 994 items + +GetLineStart(1000) --> (22 * 994) + (42 * 3) + (62 * 3) = 22180 + +GetLineHeight +------------- +To retrieve the line height look into each key and check if row is +contained in RowRange (RowRange::Has) + +GetLineAt +--------- +To retrieve the row that starts at a specific y-coordinate. +Look into each key and count all rows. +Use bisect algorithm in combination with GetLineStart() to +find the appropriate item +*/ +class WXDLLIMPEXP_ADV HeightCache +{ +public: + bool GetLineStart(unsigned int row, int &start); + bool GetLineHeight(unsigned int row, int &height); + bool GetLineAt(int y, unsigned int &row); + + void Put(const unsigned int row, const int height); + /** + removes the stored height of the given row from the cache + and invalidates all cached rows (including row) + */ + void Remove(const unsigned int row); + void Clear(); + +private: + bool GetLineInfo(unsigned int row, int &start, int &height); + HeightToRowRangesMap m_heightToRowRange; +}; + + +#endif // _WX_PRIVATE_ROWHEIGHTCACHE_H_ diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 448a58bf5b..9674e53d5b 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -53,6 +53,7 @@ #include "wx/stopwatch.h" #include "wx/weakref.h" #include "wx/generic/private/markuptext.h" +#include "wx/generic/private/rowheightcache.h" #include "wx/generic/private/widthcalc.h" #if wxUSE_ACCESSIBILITY #include "wx/private/markupparser.h" @@ -910,6 +911,7 @@ private: bool m_hasFocus; bool m_useCellFocus; bool m_currentColSetByKeyboard; + HeightCache *m_rowHeightCache; #if wxUSE_DRAG_AND_DROP int m_dragCount; @@ -1946,6 +1948,14 @@ wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID i m_useCellFocus = false; m_currentRow = (unsigned)-1; m_lineHeight = GetDefaultRowHeight(); + if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + { + m_rowHeightCache = new HeightCache(); + } + else + { + m_rowHeightCache = NULL; + } #if wxUSE_DRAG_AND_DROP m_dragCount = 0; @@ -1982,6 +1992,11 @@ wxDataViewMainWindow::~wxDataViewMainWindow() { DestroyTree(); delete m_renameTimer; + if (m_rowHeightCache != NULL) + { + m_rowHeightCache->Clear(); + delete m_rowHeightCache; + } } @@ -2739,6 +2754,12 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData } else { + if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + { + // specific position (row) is unclear, so clear whole height cache + m_rowHeightCache->Clear(); + } + wxDataViewTreeNode *parentNode = FindNode(parent); if ( !parentNode ) @@ -2880,6 +2901,9 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, return true; } + if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + m_rowHeightCache->Remove(GetRowByItem(parent) + itemPosInNode); + // Delete the item from wxDataViewTreeNode representation: const int itemsDeleted = 1 + itemNode->GetSubTreeCount(); @@ -2944,6 +2968,9 @@ bool wxDataViewMainWindow::DoItemChanged(const wxDataViewItem & item, int view_c { if ( !IsVirtualList() ) { + if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + m_rowHeightCache->Remove(GetRowByItem(item)); + // Move this node to its new correct place after it was updated. // // In principle, we could skip the call to PutInSortOrder() if the modified @@ -3277,6 +3304,9 @@ void wxDataViewMainWindow::SendSelectionChangedEvent( const wxDataViewItem& item void wxDataViewMainWindow::RefreshRows( unsigned int from, unsigned int to ) { + if (from == to && from == ((unsigned)-1)) + return; + wxRect rect = GetLinesRect(from, to); m_owner->CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y); @@ -3325,21 +3355,35 @@ int wxDataViewMainWindow::GetLineStart( unsigned int row ) const if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) { - // TODO make more efficient - int start = 0; + if (m_rowHeightCache->GetLineStart(row, start)) + return start; unsigned int r; for (r = 0; r < row; r++) { - const wxDataViewTreeNode* node = GetTreeNodeByRow(r); - if (!node) return start; + int height = 0; + if (m_rowHeightCache->GetLineHeight(r, height)) + { + start += height; + continue; + } - wxDataViewItem item = node->GetItem(); + wxDataViewItem item; + if (IsList()) + { + item = GetItemByRow(r); + } + else + { + const wxDataViewTreeNode* node = GetTreeNodeByRow(r); + if (!node) return start; + item = node->GetItem(); + } unsigned int cols = GetOwner()->GetColumnCount(); unsigned int col; - int height = m_lineHeight; + height = m_lineHeight; for (col = 0; col < cols; col++) { const wxDataViewColumn *column = GetOwner()->GetColumn(col); @@ -3359,6 +3403,8 @@ int wxDataViewMainWindow::GetLineStart( unsigned int row ) const } start += height; + + m_rowHeightCache->Put(r, height); } return start; @@ -3377,39 +3423,58 @@ int wxDataViewMainWindow::GetLineAt( unsigned int y ) const if ( !GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) ) return y / m_lineHeight; - // TODO make more efficient unsigned int row = 0; unsigned int yy = 0; + + if (m_rowHeightCache->GetLineAt(y, row)) + return row; + for (;;) { - const wxDataViewTreeNode* node = GetTreeNodeByRow(row); - if (!node) + int height = 0; + if (!m_rowHeightCache->GetLineHeight(row, height)) { - // not really correct... - return row + ((y-yy) / m_lineHeight); - } + // row height not in cache -> get it from the renderer... - wxDataViewItem item = node->GetItem(); + wxDataViewItem item; + if (IsList()) + { + item = GetItemByRow(row); + } + else + { + const wxDataViewTreeNode* node = GetTreeNodeByRow(row); + if (!node) + { + // not really correct... + return row + ((y - yy) / m_lineHeight); + } + item = node->GetItem(); + } - unsigned int cols = GetOwner()->GetColumnCount(); - unsigned int col; - int height = m_lineHeight; - for (col = 0; col < cols; col++) - { - const wxDataViewColumn *column = GetOwner()->GetColumn(col); - if (column->IsHidden()) - continue; // skip it! + unsigned int cols = GetOwner()->GetColumnCount(); + unsigned int col; + height = m_lineHeight; + for (col = 0; col < cols; col++) + { + const wxDataViewColumn *column = GetOwner()->GetColumn(col); + if (column->IsHidden()) + continue; // skip it! - if ((col != 0) && - model->IsContainer(item) && - !model->HasContainerColumns(item)) - continue; // skip it! + if ((col != 0) && + model->IsContainer(item) && + !model->HasContainerColumns(item)) + continue; // skip it! - wxDataViewRenderer *renderer = - const_cast(column->GetRenderer()); - renderer->PrepareForItem(model, item, column->GetModelColumn()); + wxDataViewRenderer *renderer = + const_cast(column->GetRenderer()); + renderer->PrepareForItem(model, item, column->GetModelColumn()); - height = wxMax( height, renderer->GetSize().y ); + height = wxMax( height, renderer->GetSize().y ); + } + + // ... and store the height in the cache + m_rowHeightCache->Put(row, height); } yy += height; @@ -3426,16 +3491,24 @@ int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) { - wxASSERT( !IsVirtualList() ); + int height = 0; + if (m_rowHeightCache->GetLineHeight(row, height)) + return height; - const wxDataViewTreeNode* node = GetTreeNodeByRow(row); - // wxASSERT( node ); - if (!node) return m_lineHeight; - - wxDataViewItem item = node->GetItem(); - - int height = m_lineHeight; + wxDataViewItem item; + if (IsList()) + { + item = GetItemByRow(row); + } + else + { + const wxDataViewTreeNode* node = GetTreeNodeByRow(row); + // wxASSERT( node ); + if (!node) return m_lineHeight; + item = node->GetItem(); + } + height = m_lineHeight; unsigned int cols = GetOwner()->GetColumnCount(); unsigned int col; for (col = 0; col < cols; col++) @@ -3456,6 +3529,8 @@ int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const height = wxMax( height, renderer->GetSize().y ); } + m_rowHeightCache->Put(row, height); + return height; } else @@ -3602,6 +3677,13 @@ void wxDataViewMainWindow::Expand( unsigned int row ) if (!node->HasChildren()) return; + if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + { + // Expand makes new rows visible thus we invalidates all following + // rows in the height cache + m_rowHeightCache->Remove(row); + } + if (!node->IsOpen()) { if ( !SendExpanderEvent(wxEVT_DATAVIEW_ITEM_EXPANDING, node->GetItem()) ) @@ -3651,6 +3733,13 @@ void wxDataViewMainWindow::Collapse(unsigned int row) if (!node->HasChildren()) return; + if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + { + // Collapse hides rows thus we invalidates all following + // rows in the height cache + m_rowHeightCache->Remove(row); + } + if (node->IsOpen()) { if ( !SendExpanderEvent(wxEVT_DATAVIEW_ITEM_COLLAPSING,node->GetItem()) ) diff --git a/src/generic/rowheightcache.cpp b/src/generic/rowheightcache.cpp new file mode 100644 index 0000000000..f3c43d5aa1 --- /dev/null +++ b/src/generic/rowheightcache.cpp @@ -0,0 +1,337 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/private/rowheightcache.h +// Purpose: height cache of rows in a dataview +// Author: Jens Goepfert (mail@jensgoepfert.de) +// Created: 2018-03-06 +// Copyright: (c) wxWidgets team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/log.h" +#endif // WX_PRECOMP + +#include "wx/generic/private/rowheightcache.h" + +// ---------------------------------------------------------------------------- +// private structs +// ---------------------------------------------------------------------------- + +// ============================================================================ +// implementation +// ============================================================================ + + +// ---------------------------------------------------------------------------- +// RowRanges +// ---------------------------------------------------------------------------- + +void RowRanges::Add(const unsigned int row) +{ + size_t count = m_ranges.size(); + size_t rngIdx = 0; + for (rngIdx = 0; rngIdx < count; ++rngIdx) + { + RowRange &rng = m_ranges[rngIdx]; + + if (row >= rng.from && rng.to > row) + { + // index already in range + return; + } + + if (row == rng.from - 1) + { + // extend range at the beginning (to the left) + rng.from = row; + // no cleanup necessary + return; + } + if (row == rng.to) + { + // extend range at the end (set to row+1 because 'to' is not including) + rng.to = row + 1; + CleanUp(rngIdx); + return; + } + + if (rng.from > row + 1) + { + // this range is already behind row index, so break here and insert a new range before + break; + } + } + // wxLogMessage("New Range: %d" , count); + + RowRange newRange; + newRange.from = row; + newRange.to = row + 1; + m_ranges.insert(m_ranges.begin() + rngIdx, newRange); +} + +void RowRanges::Remove(const unsigned int row) +{ + size_t count = m_ranges.size(); + size_t rngIdx = 0; + while (rngIdx < count) + { + RowRange &rng = m_ranges[rngIdx]; + if (rng.from >= row) + { + // this range starts behind row index, so remove it + m_ranges.erase(m_ranges.begin() + rngIdx); + count--; + continue; + } + if (rng.to > row) + { + // this ranges includes row, so cut off at row index to exclude row + rng.to = row; + } + + rngIdx += 1; + } +} + + +void RowRanges::CleanUp(unsigned int idx) +{ + size_t count = m_ranges.size(); + size_t rngIdx = 0; + if (idx > 0) + { + // start one RowRange before + rngIdx = idx - 1; + } + if (idx >= count) + { + // should never reached, due CleanUp is private and internal called correctly + return; + } + RowRange *prevRng = &m_ranges[rngIdx]; + rngIdx++; + while (rngIdx <= idx + 1 && rngIdx < count) + { + RowRange &rng = m_ranges[rngIdx]; + + if (prevRng->to == rng.from) + { + // this range starts where the previous range began, so remove this + // and set the to-value of the previous range to the to-value of this range + prevRng->to = rng.to; + m_ranges.erase(m_ranges.begin() + rngIdx); + count--; + continue; + } + + prevRng = &rng; + rngIdx += 1; + } +} + +bool RowRanges::Has(unsigned int row) const +{ + size_t count = m_ranges.size(); + for (size_t rngIdx = 0; rngIdx < count; rngIdx++) + { + const RowRange &rng = m_ranges[rngIdx]; + if (rng.from <= row && row < rng.to) + { + return true; + } + } + return false; +} + +unsigned int RowRanges::CountAll() const +{ + unsigned int ctr = 0; + size_t count = m_ranges.size(); + for (size_t rngIdx = 0; rngIdx < count; rngIdx++) + { + const RowRange &rng = m_ranges[rngIdx]; + ctr += rng.to - rng.from; + } + return ctr; +} + +unsigned int RowRanges::CountTo(unsigned int row) const +{ + unsigned int ctr = 0; + size_t count = m_ranges.size(); + for (size_t rngIdx = 0; rngIdx < count; rngIdx++) + { + const RowRange &rng = m_ranges[rngIdx]; + if (rng.from > row) + { + break; + } + else if (rng.to < row) + { + ctr += rng.to - rng.from; + } + else + { + ctr += row - rng.from; + break; + } + } + return ctr; +} + +unsigned int RowRanges::GetSize() const // for debugging statistics +{ + return m_ranges.size(); +} + + +// ---------------------------------------------------------------------------- +// HeightCache +// ---------------------------------------------------------------------------- + +bool HeightCache::GetLineInfo(unsigned int row, int &start, int &height) +{ + int y = 0; + bool found = false; + HeightToRowRangesMap::iterator it; + for (it = m_heightToRowRange.begin(); it != m_heightToRowRange.end(); ++it) + { + int rowHeight = it->first; + RowRanges* rowRanges = it->second; + if (rowRanges->Has(row)) + { + height = rowHeight; + found = true; + } + y += rowHeight * (rowRanges->CountTo(row)); + } + if (found) + { + start = y; + } + return found; +} + +bool HeightCache::GetLineStart(unsigned int row, int &start) +{ + int height = 0; + return GetLineInfo(row, start, height); +} + +bool HeightCache::GetLineHeight(unsigned int row, int &height) +{ + HeightToRowRangesMap::iterator it; + for (it = m_heightToRowRange.begin(); it != m_heightToRowRange.end(); ++it) + { + int rowHeight = it->first; + RowRanges* rowRanges = it->second; + if (rowRanges->Has(row)) + { + height = rowHeight; + return true; + } + } + return false; +} + +bool HeightCache::GetLineAt(int y, unsigned int &row) +{ + unsigned int total = 0; + HeightToRowRangesMap::iterator it; + for (it = m_heightToRowRange.begin(); it != m_heightToRowRange.end(); ++it) + { + RowRanges* rowRanges = it->second; + total += rowRanges->CountAll(); + } + + if (total == 0) + { + return false; + } + + int lo = 0; + int hi = total; + int start, height; + while (lo < hi) + { + int mid = (lo + hi) / 2; + if (GetLineInfo(mid, start, height)) + { + if (start + height <= y) + { + lo = mid + 1; + } + else + { + hi = mid; + } + } + else + { + // should never happen, except the HeightCache has gaps which is an invalid state + return false; + } + } + if (GetLineInfo(lo, start, height)) + { + if (y < start) + { + // given y point is before the first row + return false; + } + row = lo; + return true; + } + else + { + // given y point is after the last row + return false; + } +} + +void HeightCache::Put(const unsigned int row, const int height) +{ + RowRanges *rowRanges = m_heightToRowRange[height]; + if (rowRanges == NULL) + { + rowRanges = new RowRanges(); + m_heightToRowRange[height] = rowRanges; + } + rowRanges->Add(row); +} + +void HeightCache::Remove(const unsigned int row) +{ + HeightToRowRangesMap::iterator it; + for (it = m_heightToRowRange.begin(); it != m_heightToRowRange.end(); ++it) + { + RowRanges* rowRanges = it->second; + rowRanges->Remove(row); + } +} + +void HeightCache::Clear() +{ + HeightToRowRangesMap::iterator it; + for (it = m_heightToRowRange.begin(); it != m_heightToRowRange.end(); ++it) + { + RowRanges* rowRanges = it->second; + delete rowRanges; + } + m_heightToRowRange.clear(); +} diff --git a/tests/Makefile.in b/tests/Makefile.in index f5dfdc06dc..ce5b95441e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -254,6 +254,7 @@ TEST_GUI_OBJECTS = \ test_gui_socket.o \ test_gui_tlw.o \ test_gui_dataview.o \ + test_gui_rowheightcachetest.o \ test_gui_boxsizer.o \ test_gui_gridsizer.o \ test_gui_wrapsizer.o \ @@ -1030,6 +1031,9 @@ test_gui_tlw.o: $(srcdir)/persistence/tlw.cpp $(TEST_GUI_ODEP) test_gui_dataview.o: $(srcdir)/persistence/dataview.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/persistence/dataview.cpp +test_gui_rowheightcachetest.o: $(srcdir)/rowheightcache/rowheightcachetest.cpp $(TEST_GUI_ODEP) + $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/rowheightcache/rowheightcachetest.cpp + test_gui_boxsizer.o: $(srcdir)/sizers/boxsizer.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/sizers/boxsizer.cpp diff --git a/tests/makefile.bcc b/tests/makefile.bcc index a0892cbd57..8d81a43d47 100644 --- a/tests/makefile.bcc +++ b/tests/makefile.bcc @@ -241,6 +241,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_socket.obj \ $(OBJS)\test_gui_tlw.obj \ $(OBJS)\test_gui_dataview.obj \ + $(OBJS)\test_gui_rowheightcachetest.obj \ $(OBJS)\test_gui_boxsizer.obj \ $(OBJS)\test_gui_gridsizer.obj \ $(OBJS)\test_gui_wrapsizer.obj \ @@ -1084,6 +1085,9 @@ $(OBJS)\test_gui_tlw.obj: .\persistence\tlw.cpp $(OBJS)\test_gui_dataview.obj: .\persistence\dataview.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\persistence\dataview.cpp +$(OBJS)\test_gui_rowheightcachetest.obj: .\rowheightcache\rowheightcachetest.cpp + $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\rowheightcache\rowheightcachetest.cpp + $(OBJS)\test_gui_boxsizer.obj: .\sizers\boxsizer.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\sizers\boxsizer.cpp diff --git a/tests/makefile.gcc b/tests/makefile.gcc index a4e16537b8..5df276613e 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -236,6 +236,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_socket.o \ $(OBJS)\test_gui_tlw.o \ $(OBJS)\test_gui_dataview.o \ + $(OBJS)\test_gui_rowheightcachetest.o \ $(OBJS)\test_gui_boxsizer.o \ $(OBJS)\test_gui_gridsizer.o \ $(OBJS)\test_gui_wrapsizer.o \ @@ -1061,6 +1062,9 @@ $(OBJS)\test_gui_tlw.o: ./persistence/tlw.cpp $(OBJS)\test_gui_dataview.o: ./persistence/dataview.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_gui_rowheightcachetest.o: ./rowheightcache/rowheightcachetest.cpp + $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_gui_boxsizer.o: ./sizers/boxsizer.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index e197998717..0fbadd461a 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -247,6 +247,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_socket.obj \ $(OBJS)\test_gui_tlw.obj \ $(OBJS)\test_gui_dataview.obj \ + $(OBJS)\test_gui_rowheightcachetest.obj \ $(OBJS)\test_gui_boxsizer.obj \ $(OBJS)\test_gui_gridsizer.obj \ $(OBJS)\test_gui_wrapsizer.obj \ @@ -1275,6 +1276,9 @@ $(OBJS)\test_gui_tlw.obj: .\persistence\tlw.cpp $(OBJS)\test_gui_dataview.obj: .\persistence\dataview.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\persistence\dataview.cpp +$(OBJS)\test_gui_rowheightcachetest.obj: .\rowheightcache\rowheightcachetest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\rowheightcache\rowheightcachetest.cpp + $(OBJS)\test_gui_boxsizer.obj: .\sizers\boxsizer.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\sizers\boxsizer.cpp diff --git a/tests/rowheightcache/rowheightcachetest.cpp b/tests/rowheightcache/rowheightcachetest.cpp new file mode 100644 index 0000000000..51e0ac1daa --- /dev/null +++ b/tests/rowheightcache/rowheightcachetest.cpp @@ -0,0 +1,280 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: tests/rowheightcache/rowheightcachetest.cpp +// Purpose: unit tests for the row height cache of a dataview +// Author: Jens Goepfert (mail@jensgoepfert.de) +// Created: 2018-03-06 +// Copyright: (c) wxWidgets team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#include "testprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#endif + +#include "wx/generic/private/rowheightcache.h" + +// ---------------------------------------------------------------------------- +// local functions +// ---------------------------------------------------------------------------- + + +// ---------------------------------------------------------------------------- +// TestRowRangesAdd +// ---------------------------------------------------------------------------- +TEST_CASE("RowHeightCacheTestCase::TestRowRangesSimple", "[dataview][heightcache]") +{ + RowRanges *rr = new RowRanges(); + + CHECK(rr->CountAll() == 0); + + for (unsigned int i = 0; i <= 10; i++) + { + CHECK(rr->Has(i) == false); + + rr->Add(i); + + CHECK(rr->CountAll() == i+1); + CHECK(rr->CountTo(i) == i); + CHECK(rr->Has(i) == true); + } + + CHECK(rr->GetSize() == 1); // every row is sorted in the same range, so count == 1 + CHECK(rr->CountAll() == 11); // 11 rows collected + CHECK(rr->CountTo(10) == 10); + + rr->Add(5); // row 5 already contained -> does nothing + + CHECK(rr->GetSize() == 1); // every row is sorted in the same range, so count == 1 + CHECK(rr->CountAll() == 11); // 11 rows collected + CHECK(rr->CountTo(10) == 10); + + for (int i = 10; i >= 0; i--) + { + CHECK(rr->CountAll() == (unsigned)i+1); + CHECK(rr->CountTo((unsigned)i) == (unsigned)i); + + rr->Remove(i); + + CHECK(rr->CountAll() == (unsigned)i); + CHECK(rr->CountTo((unsigned)i) == (unsigned)i); + } + + CHECK(rr->CountAll() == 0); // everything removed, no row range is left behind + for (int i = 10; i > 0; i--) + { + CHECK(rr->CountTo(i) == 0); + } + CHECK(rr->GetSize() == 0); +} + +// ---------------------------------------------------------------------------- +// TestRowRangesRemove +// ---------------------------------------------------------------------------- +TEST_CASE("RowHeightCacheTestCase::TestRowRangesGapsMod2", "[dataview][heightcache]") +{ + RowRanges *rr = new RowRanges(); + for (int i = 0; i < 100; i++) + { + CHECK(rr->Has(i) == false); + + if (i % 2 == 0) + { + rr->Add(i); + } + } + CHECK(rr->CountAll() == 50); + CHECK(rr->CountTo(100) == 50); + + for (unsigned int i = 99; i > 0; i--) + { + if (i % 2 == 0) + { + CHECK(rr->Has(i) == true); + rr->Remove(i); + CHECK(rr->Has(i) == false); + } + else + { + CHECK(rr->Has(i) == false); + } + } + + // only row 0 is in the RowRanges, so remove 1 does nothing + rr->Remove(1); + + CHECK(rr->CountAll() == 1); + CHECK(rr->CountTo(0) == 0); + CHECK(rr->CountTo(1) == 1); + CHECK(rr->CountTo(100) == 1); + CHECK(rr->GetSize() == 1); + + rr->Remove(0); // last row is beeing removed + + CHECK(rr->CountAll() == 0); + CHECK(rr->CountTo(0) == 0); + CHECK(rr->CountTo(1) == 0); + CHECK(rr->CountTo(100) == 0); + CHECK(rr->GetSize() == 0); + + rr->Add(10); + CHECK(rr->GetSize() == 1); + CHECK(rr->CountTo(1) == 0); // tests CountTo first break + rr->Add(5); // inserts a range at the beginning + CHECK(rr->GetSize() == 2); + rr->Remove(10); + rr->Remove(5); + CHECK(rr->GetSize() == 0); +} + +// ---------------------------------------------------------------------------- +// TestRowRangesCleanUp1 +// ---------------------------------------------------------------------------- +TEST_CASE("RowHeightCacheTestCase::TestRowRangesCleanUp1", "[dataview][heightcache]") +{ + RowRanges *rr = new RowRanges(); + for (unsigned int i = 0; i < 100; i++) + { + CHECK(rr->Has(i) == false); + + if (i % 2 == 0) + { + rr->Add(i); + } + } + CHECK(rr->GetSize() == 50); // adding 50 rows (only even) results in 50 range objects + CHECK(rr->CountAll() == 50); + CHECK(rr->CountTo(100) == 50); + + for (unsigned int i = 0; i < 100; i++) + { + if (i % 2 == 1) + { + rr->Add(i); + } + } + + CHECK(rr->GetSize() == 1); // adding 50 rows (only odd) should combined to 1 range object + CHECK(rr->CountAll() == 100); + CHECK(rr->CountTo(100) == 100); +} + +// ---------------------------------------------------------------------------- +// TestRowRangesCleanUp2 +// ---------------------------------------------------------------------------- +TEST_CASE("RowHeightCacheTestCase::TestRowRangesCleanUp2", "[dataview][heightcache]") +{ + RowRanges *rr = new RowRanges(); + for (unsigned int i = 0; i < 10; i++) + { + rr->Add(i); + } + CHECK(rr->GetSize() == 1); // adding 10 sequent rows results in 1 range objects + CHECK(rr->CountAll() == 10); + CHECK(rr->CountTo(100) == 10); + + for (unsigned int i = 12; i < 20; i++) + { + rr->Add(i); + } + + CHECK(rr->GetSize() == 2); + rr->Add(11); // tests extending a range at the beginning (to the left) + CHECK(rr->GetSize() == 2); + rr->Add(10); // extends a range and reduces them + CHECK(rr->GetSize() == 1); +} + +// ---------------------------------------------------------------------------- +// TestHeightCache +// ---------------------------------------------------------------------------- +TEST_CASE("RowHeightCacheTestCase::TestHeightCache", "[dataview][heightcache]") +{ + HeightCache *hc = new HeightCache(); + + for (unsigned int i = 0; i <= 10; i++) + { + hc->Put(i, 22); + } + for (unsigned int i = 15; i <= 17; i++) + { + hc->Put(i, 22); + } + for (unsigned int i = 20; i <= 2000; i++) + { + hc->Put(i, 22); + } + + hc->Put(11, 42); + hc->Put(12, 42); + hc->Put(18, 42); + + hc->Put(13, 62); + hc->Put(14, 62); + hc->Put(19, 62); + + int start = 0; + int height = 0; + unsigned int row = 666; + + CHECK(hc->GetLineStart(1000, start) == true); + CHECK(start == 22180); + + CHECK(hc->GetLineHeight(1000, height) == true); + CHECK(height == 22); + + CHECK(hc->GetLineHeight(5000, start) == false); + + // test invalid y + CHECK(hc->GetLineAt(-1, row) == false); + CHECK(row == 666); + + // test start of first row + CHECK(hc->GetLineAt(0, row) == true); + CHECK(row == 0); + + // test end of first row + CHECK(hc->GetLineAt(21, row) == true); + CHECK(row == 0); + + // test start of second row + CHECK(hc->GetLineAt(22, row) == true); + CHECK(row == 1); + + hc->Remove(1000); // Delete row 1000 and everything behind + + CHECK(hc->GetLineAt(22179, row) == true); + CHECK(row == 999); + CHECK(hc->GetLineHeight(999, height) == true); + CHECK(height == 22); + + row = 666; + height = 666; + CHECK(hc->GetLineAt(22180, row) == false); + CHECK(row == 666); + CHECK(hc->GetLineHeight(1000, height) == false); + CHECK(height == 666); + + hc->Clear(); // Clear all items + for (int i = 20; i <= 2000; i++) + { + height = 666; + CHECK(hc->GetLineHeight(i, height) == false); + CHECK(height == 666); + } + + hc->Clear(); // Clear twice should not crash + + row = 666; + height = 666; + CHECK(hc->GetLineAt(22180, row) == false); + CHECK(row == 666); +} diff --git a/tests/test.bkl b/tests/test.bkl index b8c42324c8..62eeddde4f 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -266,6 +266,7 @@ net/socket.cpp persistence/tlw.cpp persistence/dataview.cpp + rowheightcache/rowheightcachetest.cpp sizers/boxsizer.cpp sizers/gridsizer.cpp sizers/wrapsizer.cpp diff --git a/tests/test_vc7_test_gui.vcproj b/tests/test_vc7_test_gui.vcproj index d02aa25b43..62698892cc 100644 --- a/tests/test_vc7_test_gui.vcproj +++ b/tests/test_vc7_test_gui.vcproj @@ -523,6 +523,9 @@ + + diff --git a/tests/test_vc8_test_gui.vcproj b/tests/test_vc8_test_gui.vcproj index f82a0b7ed7..cc0031584f 100644 --- a/tests/test_vc8_test_gui.vcproj +++ b/tests/test_vc8_test_gui.vcproj @@ -1166,6 +1166,10 @@ RelativePath=".\controls\richtextctrltest.cpp" > + + diff --git a/tests/test_vc9_test_gui.vcproj b/tests/test_vc9_test_gui.vcproj index 9c5b2a55b9..dc7119cdfc 100644 --- a/tests/test_vc9_test_gui.vcproj +++ b/tests/test_vc9_test_gui.vcproj @@ -1138,6 +1138,10 @@ RelativePath=".\controls\richtextctrltest.cpp" > + + From 7a949b456636035d15386f70bd71174225edcd46 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 03:57:07 +0100 Subject: [PATCH 022/553] Remove unnecessary wx/log.h from rowheightcache.cpp Also remove commented out wxLogMessage() call. --- src/generic/rowheightcache.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/generic/rowheightcache.cpp b/src/generic/rowheightcache.cpp index f3c43d5aa1..f1e3e57768 100644 --- a/src/generic/rowheightcache.cpp +++ b/src/generic/rowheightcache.cpp @@ -23,7 +23,6 @@ #endif #ifndef WX_PRECOMP - #include "wx/log.h" #endif // WX_PRECOMP #include "wx/generic/private/rowheightcache.h" @@ -76,7 +75,6 @@ void RowRanges::Add(const unsigned int row) break; } } - // wxLogMessage("New Range: %d" , count); RowRange newRange; newRange.from = row; From 85557d818d9b79cb01cdd27194312cd1992331e5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 03:58:54 +0100 Subject: [PATCH 023/553] Replace a silent "impossible" return with a wxCHECK_RET() Instead of writing a comment saying that something is not supposed to happen, add an assertion verifying that it actually doesn't happen. --- src/generic/rowheightcache.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/generic/rowheightcache.cpp b/src/generic/rowheightcache.cpp index f1e3e57768..c5fa2b665b 100644 --- a/src/generic/rowheightcache.cpp +++ b/src/generic/rowheightcache.cpp @@ -110,17 +110,16 @@ void RowRanges::Remove(const unsigned int row) void RowRanges::CleanUp(unsigned int idx) { size_t count = m_ranges.size(); + + wxCHECK_RET( idx < count, "Wrong index" ); + size_t rngIdx = 0; if (idx > 0) { // start one RowRange before rngIdx = idx - 1; } - if (idx >= count) - { - // should never reached, due CleanUp is private and internal called correctly - return; - } + RowRange *prevRng = &m_ranges[rngIdx]; rngIdx++; while (rngIdx <= idx + 1 && rngIdx < count) From 9eea5cae23af8dce2e6c974204938a8378ff1f21 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 04:00:35 +0100 Subject: [PATCH 024/553] Make RowRanges::GetSize() inline No real changes. --- include/wx/generic/private/rowheightcache.h | 8 +++++++- src/generic/rowheightcache.cpp | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/wx/generic/private/rowheightcache.h b/include/wx/generic/private/rowheightcache.h index d9586f16e7..23dbcbbd1b 100644 --- a/include/wx/generic/private/rowheightcache.h +++ b/include/wx/generic/private/rowheightcache.h @@ -56,7 +56,13 @@ public: not including given row. */ unsigned int CountTo(unsigned int row) const; - unsigned int GetSize() const; // for debugging statistics + + /** + Returns the size of the range. + + This is only used for testing and debugging. + */ + unsigned int GetSize() const { return m_ranges.size(); } private: wxVector m_ranges; diff --git a/src/generic/rowheightcache.cpp b/src/generic/rowheightcache.cpp index c5fa2b665b..5168b86622 100644 --- a/src/generic/rowheightcache.cpp +++ b/src/generic/rowheightcache.cpp @@ -191,12 +191,6 @@ unsigned int RowRanges::CountTo(unsigned int row) const return ctr; } -unsigned int RowRanges::GetSize() const // for debugging statistics -{ - return m_ranges.size(); -} - - // ---------------------------------------------------------------------------- // HeightCache // ---------------------------------------------------------------------------- From 090491cdbc4c1bd2b83c341e5e821f607221fa6f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 04:00:52 +0100 Subject: [PATCH 025/553] Minor style and formatting clean up of the new code Fix typos in comments and indent them. Wrap over-long lines. Remove useless top-level const. --- include/wx/generic/private/rowheightcache.h | 125 +++++++++++--------- src/generic/datavgen.cpp | 2 +- src/generic/rowheightcache.cpp | 27 ++--- tests/rowheightcache/rowheightcachetest.cpp | 5 - 4 files changed, 80 insertions(+), 79 deletions(-) diff --git a/include/wx/generic/private/rowheightcache.h b/include/wx/generic/private/rowheightcache.h index 23dbcbbd1b..6cb4489e7c 100644 --- a/include/wx/generic/private/rowheightcache.h +++ b/include/wx/generic/private/rowheightcache.h @@ -21,39 +21,40 @@ struct RowRange }; /** -@class RowRanges -A helper class that manages a set of RowRange objects. -It stores the indices that are members of a group in a memory -efficiant way. + A helper class that manages a set of RowRange objects. + + It stores the indices that are members of a group in a memory + efficient way. */ class WXDLLIMPEXP_CORE RowRanges -//class RowRanges { public: /** - Adds a row index to this group by adding it to an existing RowRange - or by creating a new one. + Adds a row index to this group by adding it to an existing RowRange + or by creating a new one. */ void Add(unsigned int row); /** - Removes a row index and all indices after idx from this group. + Removes a row index and all indices after idx from this group. */ void Remove(unsigned int row); /** - Checks whether a row index is contained in this group. + Checks whether a row index is contained in this group. */ bool Has(unsigned int row) const; /** - Returns the number of row indices that are contained in this group. + Returns the number of row indices that are contained in this group. */ unsigned int CountAll() const; /** - Returns the number of rows that are in this group before the given row index. - not including given row. + Returns the number of rows that are in this group before the given row + index. + + Not that this doesn't include the given row. */ unsigned int CountTo(unsigned int row) const; @@ -66,10 +67,11 @@ public: private: wxVector m_ranges; + /** - If a new row index was inserted Cleanup checks if the neighbour ranges - of idx can includes the same row indices and discards - unnecessary RowRange objects. + If a new row index was inserted, Cleanup() checks if the neighbour + ranges of idx can includes the same row indices and discards + unnecessary RowRange objects. */ void CleanUp(unsigned int idx); }; @@ -78,70 +80,75 @@ WX_DECLARE_HASH_MAP(unsigned int, RowRanges*, wxIntegerHash, wxIntegerEqual, HeightToRowRangesMap); /** -@class HeightCache + HeightCache implements a cache mechanism for wxDataViewCtrl. -HeightCache implements a cache mechanism for the DataViewCtrl to give -fast access to: -* the height of one line (GetLineHeight) -* the y-coordinate where a row starts (GetLineStart) -* and vice versa (GetLineAt) + It gives fast access to: + * the height of one line (GetLineHeight) + * the y-coordinate where a row starts (GetLineStart) + * and vice versa (GetLineAt) -The layout of the cache is a hashmap where the keys are all exisiting -row heights in pixels. The values are RowRange objects that represents -all having the specified height. + The layout of the cache is a hashmap where the keys are all existing row + heights in pixels. The values are RowRange objects that represent all rows + having the specified height. -{ -22: RowRange([0..10], [15..17], [20..2000]), -42: RowRange([11..12], [18..18]), -62: RowRange([13..14], [19..19]) -} + An example: + @code + { + 22: RowRange([0..10], [15..17], [20..2000]), + 42: RowRange([11..12], [18..18]), + 62: RowRange([13..14], [19..19]) + } + @endcode -Examples -======== + Examples + ======== -GetLineStart ------------- -To retrieve the y-coordinate of item 1000 it is neccessary to look into -each key of the hashmap *m_heightToRowRange*. Get the row count of -indices lower than 1000 (RowRange::CountTo) and multiplies it wich the -according height. + GetLineStart + ------------ + To retrieve the y-coordinate of item 1000 it is necessary to look into + each key of the hashmap *m_heightToRowRange*. Get the row count of + indices lower than 1000 (RowRange::CountTo) and multiplies it which the + according height. -RowRange([0..10], [15..17], [20..2000]).CountTo(1000) ---> 0..10 are 11 items, 15..17 are 3 items and 20..1000 are 980 items (1000-20) -= 11 + 3 + 980 = 994 items + RowRange([0..10], [15..17], [20..2000]).CountTo(1000) + --> 0..10 are 11 items, 15..17 are 3 items and 20..1000 are 980 items (1000-20) + = 11 + 3 + 980 = 994 items -GetLineStart(1000) --> (22 * 994) + (42 * 3) + (62 * 3) = 22180 + GetLineStart(1000) --> (22 * 994) + (42 * 3) + (62 * 3) = 22180 -GetLineHeight -------------- -To retrieve the line height look into each key and check if row is -contained in RowRange (RowRange::Has) + GetLineHeight + ------------- + To retrieve the line height look into each key and check if row is + contained in RowRange (RowRange::Has) -GetLineAt ---------- -To retrieve the row that starts at a specific y-coordinate. -Look into each key and count all rows. -Use bisect algorithm in combination with GetLineStart() to -find the appropriate item + GetLineAt + --------- + To retrieve the row that starts at a specific y-coordinate. + Look into each key and count all rows. + Use bisect algorithm in combination with GetLineStart() to + find the appropriate item */ class WXDLLIMPEXP_ADV HeightCache { public: - bool GetLineStart(unsigned int row, int &start); - bool GetLineHeight(unsigned int row, int &height); - bool GetLineAt(int y, unsigned int &row); + bool GetLineStart(unsigned int row, int& start); + bool GetLineHeight(unsigned int row, int& height); + bool GetLineAt(int y, unsigned int& row); + + void Put(unsigned int row, int height); - void Put(const unsigned int row, const int height); /** - removes the stored height of the given row from the cache - and invalidates all cached rows (including row) + Removes the stored height of the given row from the cache and + invalidates all cached rows (including the given one). */ - void Remove(const unsigned int row); + void Remove(unsigned int row); + void Clear(); private: bool GetLineInfo(unsigned int row, int &start, int &height); - HeightToRowRangesMap m_heightToRowRange; + + HeightToRowRangesMap m_heightToRowRange; }; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 9674e53d5b..1c601f583f 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3447,7 +3447,7 @@ int wxDataViewMainWindow::GetLineAt( unsigned int y ) const if (!node) { // not really correct... - return row + ((y - yy) / m_lineHeight); + return row + ((y-yy) / m_lineHeight); } item = node->GetItem(); } diff --git a/src/generic/rowheightcache.cpp b/src/generic/rowheightcache.cpp index 5168b86622..21529bccb6 100644 --- a/src/generic/rowheightcache.cpp +++ b/src/generic/rowheightcache.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: wx/private/rowheightcache.h +// Name: generic/rowheightcache.cpp // Purpose: height cache of rows in a dataview // Author: Jens Goepfert (mail@jensgoepfert.de) // Created: 2018-03-06 @@ -27,20 +27,15 @@ #include "wx/generic/private/rowheightcache.h" -// ---------------------------------------------------------------------------- -// private structs -// ---------------------------------------------------------------------------- - // ============================================================================ // implementation // ============================================================================ - // ---------------------------------------------------------------------------- // RowRanges // ---------------------------------------------------------------------------- -void RowRanges::Add(const unsigned int row) +void RowRanges::Add(unsigned int row) { size_t count = m_ranges.size(); size_t rngIdx = 0; @@ -63,7 +58,8 @@ void RowRanges::Add(const unsigned int row) } if (row == rng.to) { - // extend range at the end (set to row+1 because 'to' is not including) + // extend range at the end (set to row+1 because 'to' is not + // including) rng.to = row + 1; CleanUp(rngIdx); return; @@ -71,7 +67,8 @@ void RowRanges::Add(const unsigned int row) if (rng.from > row + 1) { - // this range is already behind row index, so break here and insert a new range before + // this range is already behind row index, so break here and insert + // a new range before break; } } @@ -82,7 +79,7 @@ void RowRanges::Add(const unsigned int row) m_ranges.insert(m_ranges.begin() + rngIdx, newRange); } -void RowRanges::Remove(const unsigned int row) +void RowRanges::Remove(unsigned int row) { size_t count = m_ranges.size(); size_t rngIdx = 0; @@ -129,7 +126,8 @@ void RowRanges::CleanUp(unsigned int idx) if (prevRng->to == rng.from) { // this range starts where the previous range began, so remove this - // and set the to-value of the previous range to the to-value of this range + // and set the to-value of the previous range to the to-value of + // this range prevRng->to = rng.to; m_ranges.erase(m_ranges.begin() + rngIdx); count--; @@ -274,7 +272,8 @@ bool HeightCache::GetLineAt(int y, unsigned int &row) } else { - // should never happen, except the HeightCache has gaps which is an invalid state + // should never happen, except the HeightCache has gaps which is an + // invalid state return false; } } @@ -295,7 +294,7 @@ bool HeightCache::GetLineAt(int y, unsigned int &row) } } -void HeightCache::Put(const unsigned int row, const int height) +void HeightCache::Put(unsigned int row, int height) { RowRanges *rowRanges = m_heightToRowRange[height]; if (rowRanges == NULL) @@ -306,7 +305,7 @@ void HeightCache::Put(const unsigned int row, const int height) rowRanges->Add(row); } -void HeightCache::Remove(const unsigned int row) +void HeightCache::Remove(unsigned int row) { HeightToRowRangesMap::iterator it; for (it = m_heightToRowRange.begin(); it != m_heightToRowRange.end(); ++it) diff --git a/tests/rowheightcache/rowheightcachetest.cpp b/tests/rowheightcache/rowheightcachetest.cpp index 51e0ac1daa..35867565a1 100644 --- a/tests/rowheightcache/rowheightcachetest.cpp +++ b/tests/rowheightcache/rowheightcachetest.cpp @@ -22,11 +22,6 @@ #include "wx/generic/private/rowheightcache.h" -// ---------------------------------------------------------------------------- -// local functions -// ---------------------------------------------------------------------------- - - // ---------------------------------------------------------------------------- // TestRowRangesAdd // ---------------------------------------------------------------------------- From d1b02b8dd691e607f1180715bb35bbb59a9eb336 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 04:06:51 +0100 Subject: [PATCH 026/553] Fix memory leaks in newly added unit test There is no need to allocate neither RowRanges nor HeightCache on the heap, just create them on the stack -- if nothing else, this ensures we don't leak memory, unlike before. --- tests/rowheightcache/rowheightcachetest.cpp | 196 ++++++++++---------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/tests/rowheightcache/rowheightcachetest.cpp b/tests/rowheightcache/rowheightcachetest.cpp index 35867565a1..04085cc745 100644 --- a/tests/rowheightcache/rowheightcachetest.cpp +++ b/tests/rowheightcache/rowheightcachetest.cpp @@ -27,48 +27,48 @@ // ---------------------------------------------------------------------------- TEST_CASE("RowHeightCacheTestCase::TestRowRangesSimple", "[dataview][heightcache]") { - RowRanges *rr = new RowRanges(); + RowRanges rr; - CHECK(rr->CountAll() == 0); + CHECK(rr.CountAll() == 0); for (unsigned int i = 0; i <= 10; i++) { - CHECK(rr->Has(i) == false); + CHECK(rr.Has(i) == false); - rr->Add(i); + rr.Add(i); - CHECK(rr->CountAll() == i+1); - CHECK(rr->CountTo(i) == i); - CHECK(rr->Has(i) == true); + CHECK(rr.CountAll() == i+1); + CHECK(rr.CountTo(i) == i); + CHECK(rr.Has(i) == true); } - CHECK(rr->GetSize() == 1); // every row is sorted in the same range, so count == 1 - CHECK(rr->CountAll() == 11); // 11 rows collected - CHECK(rr->CountTo(10) == 10); + CHECK(rr.GetSize() == 1); // every row is sorted in the same range, so count == 1 + CHECK(rr.CountAll() == 11); // 11 rows collected + CHECK(rr.CountTo(10) == 10); - rr->Add(5); // row 5 already contained -> does nothing + rr.Add(5); // row 5 already contained -> does nothing - CHECK(rr->GetSize() == 1); // every row is sorted in the same range, so count == 1 - CHECK(rr->CountAll() == 11); // 11 rows collected - CHECK(rr->CountTo(10) == 10); + CHECK(rr.GetSize() == 1); // every row is sorted in the same range, so count == 1 + CHECK(rr.CountAll() == 11); // 11 rows collected + CHECK(rr.CountTo(10) == 10); for (int i = 10; i >= 0; i--) { - CHECK(rr->CountAll() == (unsigned)i+1); - CHECK(rr->CountTo((unsigned)i) == (unsigned)i); + CHECK(rr.CountAll() == (unsigned)i+1); + CHECK(rr.CountTo((unsigned)i) == (unsigned)i); - rr->Remove(i); + rr.Remove(i); - CHECK(rr->CountAll() == (unsigned)i); - CHECK(rr->CountTo((unsigned)i) == (unsigned)i); + CHECK(rr.CountAll() == (unsigned)i); + CHECK(rr.CountTo((unsigned)i) == (unsigned)i); } - CHECK(rr->CountAll() == 0); // everything removed, no row range is left behind + CHECK(rr.CountAll() == 0); // everything removed, no row range is left behind for (int i = 10; i > 0; i--) { - CHECK(rr->CountTo(i) == 0); + CHECK(rr.CountTo(i) == 0); } - CHECK(rr->GetSize() == 0); + CHECK(rr.GetSize() == 0); } // ---------------------------------------------------------------------------- @@ -76,58 +76,58 @@ TEST_CASE("RowHeightCacheTestCase::TestRowRangesSimple", "[dataview][heightcache // ---------------------------------------------------------------------------- TEST_CASE("RowHeightCacheTestCase::TestRowRangesGapsMod2", "[dataview][heightcache]") { - RowRanges *rr = new RowRanges(); + RowRanges rr; for (int i = 0; i < 100; i++) { - CHECK(rr->Has(i) == false); + CHECK(rr.Has(i) == false); if (i % 2 == 0) { - rr->Add(i); + rr.Add(i); } } - CHECK(rr->CountAll() == 50); - CHECK(rr->CountTo(100) == 50); + CHECK(rr.CountAll() == 50); + CHECK(rr.CountTo(100) == 50); for (unsigned int i = 99; i > 0; i--) { if (i % 2 == 0) { - CHECK(rr->Has(i) == true); - rr->Remove(i); - CHECK(rr->Has(i) == false); + CHECK(rr.Has(i) == true); + rr.Remove(i); + CHECK(rr.Has(i) == false); } else { - CHECK(rr->Has(i) == false); + CHECK(rr.Has(i) == false); } } // only row 0 is in the RowRanges, so remove 1 does nothing - rr->Remove(1); + rr.Remove(1); - CHECK(rr->CountAll() == 1); - CHECK(rr->CountTo(0) == 0); - CHECK(rr->CountTo(1) == 1); - CHECK(rr->CountTo(100) == 1); - CHECK(rr->GetSize() == 1); + CHECK(rr.CountAll() == 1); + CHECK(rr.CountTo(0) == 0); + CHECK(rr.CountTo(1) == 1); + CHECK(rr.CountTo(100) == 1); + CHECK(rr.GetSize() == 1); - rr->Remove(0); // last row is beeing removed + rr.Remove(0); // last row is beeing removed - CHECK(rr->CountAll() == 0); - CHECK(rr->CountTo(0) == 0); - CHECK(rr->CountTo(1) == 0); - CHECK(rr->CountTo(100) == 0); - CHECK(rr->GetSize() == 0); + CHECK(rr.CountAll() == 0); + CHECK(rr.CountTo(0) == 0); + CHECK(rr.CountTo(1) == 0); + CHECK(rr.CountTo(100) == 0); + CHECK(rr.GetSize() == 0); - rr->Add(10); - CHECK(rr->GetSize() == 1); - CHECK(rr->CountTo(1) == 0); // tests CountTo first break - rr->Add(5); // inserts a range at the beginning - CHECK(rr->GetSize() == 2); - rr->Remove(10); - rr->Remove(5); - CHECK(rr->GetSize() == 0); + rr.Add(10); + CHECK(rr.GetSize() == 1); + CHECK(rr.CountTo(1) == 0); // tests CountTo first break + rr.Add(5); // inserts a range at the beginning + CHECK(rr.GetSize() == 2); + rr.Remove(10); + rr.Remove(5); + CHECK(rr.GetSize() == 0); } // ---------------------------------------------------------------------------- @@ -135,31 +135,31 @@ TEST_CASE("RowHeightCacheTestCase::TestRowRangesGapsMod2", "[dataview][heightcac // ---------------------------------------------------------------------------- TEST_CASE("RowHeightCacheTestCase::TestRowRangesCleanUp1", "[dataview][heightcache]") { - RowRanges *rr = new RowRanges(); + RowRanges rr; for (unsigned int i = 0; i < 100; i++) { - CHECK(rr->Has(i) == false); + CHECK(rr.Has(i) == false); if (i % 2 == 0) { - rr->Add(i); + rr.Add(i); } } - CHECK(rr->GetSize() == 50); // adding 50 rows (only even) results in 50 range objects - CHECK(rr->CountAll() == 50); - CHECK(rr->CountTo(100) == 50); + CHECK(rr.GetSize() == 50); // adding 50 rows (only even) results in 50 range objects + CHECK(rr.CountAll() == 50); + CHECK(rr.CountTo(100) == 50); for (unsigned int i = 0; i < 100; i++) { if (i % 2 == 1) { - rr->Add(i); + rr.Add(i); } } - CHECK(rr->GetSize() == 1); // adding 50 rows (only odd) should combined to 1 range object - CHECK(rr->CountAll() == 100); - CHECK(rr->CountTo(100) == 100); + CHECK(rr.GetSize() == 1); // adding 50 rows (only odd) should combined to 1 range object + CHECK(rr.CountAll() == 100); + CHECK(rr.CountTo(100) == 100); } // ---------------------------------------------------------------------------- @@ -167,25 +167,25 @@ TEST_CASE("RowHeightCacheTestCase::TestRowRangesCleanUp1", "[dataview][heightcac // ---------------------------------------------------------------------------- TEST_CASE("RowHeightCacheTestCase::TestRowRangesCleanUp2", "[dataview][heightcache]") { - RowRanges *rr = new RowRanges(); + RowRanges rr; for (unsigned int i = 0; i < 10; i++) { - rr->Add(i); + rr.Add(i); } - CHECK(rr->GetSize() == 1); // adding 10 sequent rows results in 1 range objects - CHECK(rr->CountAll() == 10); - CHECK(rr->CountTo(100) == 10); + CHECK(rr.GetSize() == 1); // adding 10 sequent rows results in 1 range objects + CHECK(rr.CountAll() == 10); + CHECK(rr.CountTo(100) == 10); for (unsigned int i = 12; i < 20; i++) { - rr->Add(i); + rr.Add(i); } - CHECK(rr->GetSize() == 2); - rr->Add(11); // tests extending a range at the beginning (to the left) - CHECK(rr->GetSize() == 2); - rr->Add(10); // extends a range and reduces them - CHECK(rr->GetSize() == 1); + CHECK(rr.GetSize() == 2); + rr.Add(11); // tests extending a range at the beginning (to the left) + CHECK(rr.GetSize() == 2); + rr.Add(10); // extends a range and reduces them + CHECK(rr.GetSize() == 1); } // ---------------------------------------------------------------------------- @@ -193,83 +193,83 @@ TEST_CASE("RowHeightCacheTestCase::TestRowRangesCleanUp2", "[dataview][heightcac // ---------------------------------------------------------------------------- TEST_CASE("RowHeightCacheTestCase::TestHeightCache", "[dataview][heightcache]") { - HeightCache *hc = new HeightCache(); + HeightCache hc; for (unsigned int i = 0; i <= 10; i++) { - hc->Put(i, 22); + hc.Put(i, 22); } for (unsigned int i = 15; i <= 17; i++) { - hc->Put(i, 22); + hc.Put(i, 22); } for (unsigned int i = 20; i <= 2000; i++) { - hc->Put(i, 22); + hc.Put(i, 22); } - hc->Put(11, 42); - hc->Put(12, 42); - hc->Put(18, 42); + hc.Put(11, 42); + hc.Put(12, 42); + hc.Put(18, 42); - hc->Put(13, 62); - hc->Put(14, 62); - hc->Put(19, 62); + hc.Put(13, 62); + hc.Put(14, 62); + hc.Put(19, 62); int start = 0; int height = 0; unsigned int row = 666; - CHECK(hc->GetLineStart(1000, start) == true); + CHECK(hc.GetLineStart(1000, start) == true); CHECK(start == 22180); - CHECK(hc->GetLineHeight(1000, height) == true); + CHECK(hc.GetLineHeight(1000, height) == true); CHECK(height == 22); - CHECK(hc->GetLineHeight(5000, start) == false); + CHECK(hc.GetLineHeight(5000, start) == false); // test invalid y - CHECK(hc->GetLineAt(-1, row) == false); + CHECK(hc.GetLineAt(-1, row) == false); CHECK(row == 666); // test start of first row - CHECK(hc->GetLineAt(0, row) == true); + CHECK(hc.GetLineAt(0, row) == true); CHECK(row == 0); // test end of first row - CHECK(hc->GetLineAt(21, row) == true); + CHECK(hc.GetLineAt(21, row) == true); CHECK(row == 0); // test start of second row - CHECK(hc->GetLineAt(22, row) == true); + CHECK(hc.GetLineAt(22, row) == true); CHECK(row == 1); - hc->Remove(1000); // Delete row 1000 and everything behind + hc.Remove(1000); // Delete row 1000 and everything behind - CHECK(hc->GetLineAt(22179, row) == true); + CHECK(hc.GetLineAt(22179, row) == true); CHECK(row == 999); - CHECK(hc->GetLineHeight(999, height) == true); + CHECK(hc.GetLineHeight(999, height) == true); CHECK(height == 22); row = 666; height = 666; - CHECK(hc->GetLineAt(22180, row) == false); + CHECK(hc.GetLineAt(22180, row) == false); CHECK(row == 666); - CHECK(hc->GetLineHeight(1000, height) == false); + CHECK(hc.GetLineHeight(1000, height) == false); CHECK(height == 666); - hc->Clear(); // Clear all items + hc.Clear(); // Clear all items for (int i = 20; i <= 2000; i++) { height = 666; - CHECK(hc->GetLineHeight(i, height) == false); + CHECK(hc.GetLineHeight(i, height) == false); CHECK(height == 666); } - hc->Clear(); // Clear twice should not crash + hc.Clear(); // Clear twice should not crash row = 666; height = 666; - CHECK(hc->GetLineAt(22180, row) == false); + CHECK(hc.GetLineAt(22180, row) == false); CHECK(row == 666); } From 39e540edb7491079464c856f30d790b57a2c6340 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 04:12:39 +0100 Subject: [PATCH 027/553] Fix HeightCache DLL export declaration Use CORE, not ADV, which doesn't exist any more. --- include/wx/generic/private/rowheightcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/generic/private/rowheightcache.h b/include/wx/generic/private/rowheightcache.h index 6cb4489e7c..61394223f6 100644 --- a/include/wx/generic/private/rowheightcache.h +++ b/include/wx/generic/private/rowheightcache.h @@ -128,7 +128,7 @@ WX_DECLARE_HASH_MAP(unsigned int, RowRanges*, wxIntegerHash, wxIntegerEqual, Use bisect algorithm in combination with GetLineStart() to find the appropriate item */ -class WXDLLIMPEXP_ADV HeightCache +class WXDLLIMPEXP_CORE HeightCache { public: bool GetLineStart(unsigned int row, int& start); From cee89508d38bd3e06871040ce1ef53d207e6c81a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 04:14:59 +0100 Subject: [PATCH 028/553] Simply destroying row heights cache There is no reason to neither check that the pointer is non-null nor to call Clear() on it before deleting it, so don't do it. --- src/generic/datavgen.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 1c601f583f..34e6237a16 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1992,11 +1992,7 @@ wxDataViewMainWindow::~wxDataViewMainWindow() { DestroyTree(); delete m_renameTimer; - if (m_rowHeightCache != NULL) - { - m_rowHeightCache->Clear(); - delete m_rowHeightCache; - } + delete m_rowHeightCache; } From 9a91f593991360e7d5fe4700e4e276b7ff723ade Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 04:16:29 +0100 Subject: [PATCH 029/553] Revert the change to RefreshRows() in a recent commit There doesn't seem to be any reason for this check to exist. --- src/generic/datavgen.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 34e6237a16..471ac78fc6 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3300,9 +3300,6 @@ void wxDataViewMainWindow::SendSelectionChangedEvent( const wxDataViewItem& item void wxDataViewMainWindow::RefreshRows( unsigned int from, unsigned int to ) { - if (from == to && from == ((unsigned)-1)) - return; - wxRect rect = GetLinesRect(from, to); m_owner->CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y); From aee926f2d54b40db8f66217a7b69074f0d86bfcd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 14:52:51 +0100 Subject: [PATCH 030/553] Make wxVector::reverse_iterator satisfy RandomAccessIterator RandomAccessIterator requirements include LessThanComparable, so implement the missing comparison operators for this class, as well as for const_reverse_iterator. This also fixes compilation problems with MSVS 2013 in debug mode, where the CRT uses these operators to check the iterators correctness. See https://github.com/wxWidgets/wxWidgets/pull/1048 --- include/wx/vector.h | 16 ++++++++++++++++ tests/vectors/vectors.cpp | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/include/wx/vector.h b/include/wx/vector.h index 113157875c..25067081b4 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -219,6 +219,14 @@ public: { return m_ptr == it.m_ptr; } bool operator !=(const reverse_iterator& it) const { return m_ptr != it.m_ptr; } + bool operator<(const reverse_iterator& it) const + { return m_ptr > it.m_ptr; } + bool operator>(const reverse_iterator& it) const + { return m_ptr < it.m_ptr; } + bool operator<=(const reverse_iterator& it) const + { return m_ptr >= it.m_ptr; } + bool operator>=(const reverse_iterator& it) const + { return m_ptr <= it.m_ptr; } private: value_type *m_ptr; @@ -274,6 +282,14 @@ public: { return m_ptr == it.m_ptr; } bool operator !=(const const_reverse_iterator& it) const { return m_ptr != it.m_ptr; } + bool operator<(const const_reverse_iterator& it) const + { return m_ptr > it.m_ptr; } + bool operator>(const const_reverse_iterator& it) const + { return m_ptr < it.m_ptr; } + bool operator<=(const const_reverse_iterator& it) const + { return m_ptr >= it.m_ptr; } + bool operator>=(const const_reverse_iterator& it) const + { return m_ptr <= it.m_ptr; } protected: const value_type *m_ptr; diff --git a/tests/vectors/vectors.cpp b/tests/vectors/vectors.cpp index e3f6734c14..bf0fffa752 100644 --- a/tests/vectors/vectors.cpp +++ b/tests/vectors/vectors.cpp @@ -365,6 +365,13 @@ TEST_CASE("wxVector::reverse_iterator", "[vector][reverse_iterator]") CHECK( ri - rb == 2 ); CHECK( re - ri == 8 ); + CHECK( rb < ri ); + CHECK( rb <= ri ); + CHECK( ri <= ri ); + CHECK( ri >= ri ); + CHECK( ri < re ); + CHECK( ri <= re ); + #if wxUSE_STD_CONTAINERS_COMPATIBLY std::vector stdvec(rb, re); REQUIRE( stdvec.size() == 10 ); From 3e79f903b458fbe90ed6e099b53e2502a2f8f7b5 Mon Sep 17 00:00:00 2001 From: chris2oph Date: Thu, 6 Dec 2018 09:52:08 +0000 Subject: [PATCH 031/553] Make wxListBox::SetString() actually work in wxQt Do set the string on QListWidgetItem. Closes https://github.com/wxWidgets/wxWidgets/pull/1047 --- src/qt/listbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index 0a6382cca3..be40ae320f 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -160,7 +160,7 @@ wxString wxListBox::GetString(unsigned int n) const return wxQtConvertString( item->text() ); } -void wxListBox::SetString(unsigned int n, const wxString& WXUNUSED(s)) +void wxListBox::SetString(unsigned int n, const wxString& s) { QListWidgetItem* item = m_qtListWidget->item(n); wxCHECK_RET(item != NULL, wxT("wrong listbox index") ); @@ -169,6 +169,7 @@ void wxListBox::SetString(unsigned int n, const wxString& WXUNUSED(s)) item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); item->setCheckState(Qt::Unchecked); } + item->setText(wxQtConvertString(s)); } int wxListBox::GetSelection() const From 87bd82ab6f699bd6a3bea9986e06d0696940147f Mon Sep 17 00:00:00 2001 From: ashishmore Date: Fri, 19 Jan 2018 13:25:30 -0500 Subject: [PATCH 032/553] Fix wxMediaCtrl::SetPosition() in MSW WMP backend Step the control one frame forward to actually show the frame at the given position, otherwise the control only showed black screen. Closes https://github.com/wxWidgets/wxWidgets/pull/678 --- docs/changes.txt | 1 + src/msw/mediactrl_wmp10.cpp | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 4d09c8f13b..70fc9f5c6d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -173,6 +173,7 @@ wxMSW: - Send wxEVT_WEBVIEW_NAVIGATING when redirecting (Josue Andrade Gomes). - Fix build with MSVS 2005 broken in 3.1.1. - Add wxwidgets.props property sheet file for MSVS users. +- Fix jumping to the given position in wxMediaCtrl (ashishmore). wxOSX: diff --git a/src/msw/mediactrl_wmp10.cpp b/src/msw/mediactrl_wmp10.cpp index c220a5a6fb..c8d0d5e399 100644 --- a/src/msw/mediactrl_wmp10.cpp +++ b/src/msw/mediactrl_wmp10.cpp @@ -105,6 +105,7 @@ const IID IID_IWMPPlayer2 = {0x0E6B01D1,0xD407,0x4C85,{0xBF,0x5F,0x1C,0x01,0xF6, const IID IID_IWMPCore2 = {0xBC17E5B7,0x7561,0x4C18,{0xBB,0x90,0x17,0xD4,0x85,0x77,0x56,0x59}}; const IID IID_IWMPCore3 = {0x7587C667,0x628F,0x499F,{0x88,0xE7,0x6A,0x6F,0x4E,0x88,0x84,0x64}}; const IID IID_IWMPNetwork = {0xEC21B779,0xEDEF,0x462D,{0xBB,0xA4,0xAD,0x9D,0xDE,0x2B,0x29,0xA7}}; +const IID IID_IWMPControls2 = {0X6F030D25,0X0890,0X480F,{0X97, 0X75, 0X1F,0X7E,0X40,0XAB,0X5B,0X8E}}; enum WMPOpenState { @@ -265,6 +266,12 @@ public: }; +struct IWMPControls2 : public IWMPControls +{ +public: + virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE step( + /* [in] */ long lStep ) = 0; +}; struct IWMPSettings : public IDispatch { @@ -665,6 +672,8 @@ public: IWMPPlayer* m_pWMPPlayer; // Main activex interface IWMPSettings* m_pWMPSettings; // Settings such as volume IWMPControls* m_pWMPControls; // Control interface (play etc.) + IWMPControls2* m_pWMPControls2; // Control interface (play etc.) + wxSize m_bestSize; // Actual movie size bool m_bWasStateChanged; // See the "introduction" @@ -717,7 +726,8 @@ wxWMP10MediaBackend::wxWMP10MediaBackend() #endif m_pWMPPlayer(NULL), m_pWMPSettings(NULL), - m_pWMPControls(NULL) + m_pWMPControls(NULL), + m_pWMPControls2(NULL) { m_evthandler = NULL; @@ -749,6 +759,8 @@ wxWMP10MediaBackend::~wxWMP10MediaBackend() m_pWMPSettings->Release(); if (m_pWMPControls) m_pWMPControls->Release(); + if (m_pWMPControls2) + m_pWMPControls->Release(); } } @@ -787,6 +799,8 @@ bool wxWMP10MediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, wxLogSysError(wxT("Could not obtain controls from WMP10!")); return false; } + if (m_pWMPControls ) + m_pWMPControls->QueryInterface(IID_IWMPControls2, (void**)&m_pWMPControls2); } #endif @@ -1136,8 +1150,18 @@ bool wxWMP10MediaBackend::Stop() //--------------------------------------------------------------------------- bool wxWMP10MediaBackend::SetPosition(wxLongLong where) { + // The display does not update if only put_currentPosition is called. + // We have to find the time for the previous frame, set the control + // to that position and then tell it to step forward one frame. This + // forces the control to draw the frame to the screen, otherwise we get + // just a black screen. + + double timePerFrameInMSec = 0; + if (m_pWMPControls2) + timePerFrameInMSec = 1000 / GetPlaybackRate(); + HRESULT hr = m_pWMPControls->put_currentPosition( - ((LONGLONG)where.GetValue()) / 1000.0 + ((LONGLONG)where.GetValue() - timePerFrameInMSec) / 1000.0 ); if(FAILED(hr)) { @@ -1145,6 +1169,10 @@ bool wxWMP10MediaBackend::SetPosition(wxLongLong where) return false; } + if (m_pWMPControls2) + m_pWMPControls2->step(1); + + return true; } From 0e9d1908784ca350e6e211a0255eacedaeced28f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Dec 2018 16:19:10 +0100 Subject: [PATCH 033/553] Fix wrong Release() call in the previous commit The last commit had a bad bug as it called Release() on a wrong pointer. Also use "0x" prefix for hexadecimal numbers and not "0X". See https://github.com/wxWidgets/wxWidgets/pull/678 --- src/msw/mediactrl_wmp10.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/mediactrl_wmp10.cpp b/src/msw/mediactrl_wmp10.cpp index c8d0d5e399..06ab5d889d 100644 --- a/src/msw/mediactrl_wmp10.cpp +++ b/src/msw/mediactrl_wmp10.cpp @@ -105,7 +105,7 @@ const IID IID_IWMPPlayer2 = {0x0E6B01D1,0xD407,0x4C85,{0xBF,0x5F,0x1C,0x01,0xF6, const IID IID_IWMPCore2 = {0xBC17E5B7,0x7561,0x4C18,{0xBB,0x90,0x17,0xD4,0x85,0x77,0x56,0x59}}; const IID IID_IWMPCore3 = {0x7587C667,0x628F,0x499F,{0x88,0xE7,0x6A,0x6F,0x4E,0x88,0x84,0x64}}; const IID IID_IWMPNetwork = {0xEC21B779,0xEDEF,0x462D,{0xBB,0xA4,0xAD,0x9D,0xDE,0x2B,0x29,0xA7}}; -const IID IID_IWMPControls2 = {0X6F030D25,0X0890,0X480F,{0X97, 0X75, 0X1F,0X7E,0X40,0XAB,0X5B,0X8E}}; +const IID IID_IWMPControls2 = {0x6F030D25,0x0890,0x480F,{0x97, 0x75, 0x1F,0x7E,0x40,0xAB,0x5B,0x8E}}; enum WMPOpenState { @@ -760,7 +760,7 @@ wxWMP10MediaBackend::~wxWMP10MediaBackend() if (m_pWMPControls) m_pWMPControls->Release(); if (m_pWMPControls2) - m_pWMPControls->Release(); + m_pWMPControls2->Release(); } } From b5944a07309199afb1c5374a1031f536e357221b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 8 Dec 2018 00:47:03 +0100 Subject: [PATCH 034/553] Fix wxAUI build with wxUSE_MDI==0 Include wx/frame.h explicitly as it's not included by wx/aui/tabmdi.h in this case. Closes #18291. --- src/aui/auibook.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 9bfe2a7589..12afa3a9b6 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -26,6 +26,7 @@ #include "wx/settings.h" #include "wx/dcclient.h" #include "wx/dcmemory.h" + #include "wx/frame.h" #endif #include "wx/aui/tabmdi.h" From 84f788ff8975941dcbc47a6592862c1c4dca009b Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 7 Dec 2018 15:47:03 +0000 Subject: [PATCH 035/553] Implement missing wxTopLevel methods for wxQt This allows the unit test wxPersistTLW to pass. Closes https://github.com/wxWidgets/wxWidgets/pull/1055 --- src/qt/toplevel.cpp | 46 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/src/qt/toplevel.cpp b/src/qt/toplevel.cpp index e4a6fa54d8..4ab7344dbb 100644 --- a/src/qt/toplevel.cpp +++ b/src/qt/toplevel.cpp @@ -62,37 +62,69 @@ bool wxTopLevelWindowQt::Create( wxWindow *parent, wxWindowID winId, return true; } -void wxTopLevelWindowQt::Maximize(bool WXUNUSED(maximize)) +void wxTopLevelWindowQt::Maximize(bool maximize) { + QWidget *widget = GetHandle(); + + if ( maximize ) + { + widget->showMaximized(); + } + else + { + widget->showNormal(); + } } void wxTopLevelWindowQt::Restore() { + GetHandle()->showNormal(); } -void wxTopLevelWindowQt::Iconize(bool WXUNUSED(iconize) ) +void wxTopLevelWindowQt::Iconize(bool iconize ) { + QWidget *widget = GetHandle(); + + if ( iconize ) + { + widget->showMinimized(); + } + else + { + widget->showNormal(); + } } bool wxTopLevelWindowQt::IsMaximized() const { - return false; + return GetHandle()->isMaximized(); } bool wxTopLevelWindowQt::IsIconized() const { - return false; + return GetHandle()->isMinimized(); } -bool wxTopLevelWindowQt::ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) +bool wxTopLevelWindowQt::ShowFullScreen(bool show, long WXUNUSED(style)) { - return false; + QWidget *widget = GetHandle(); + + if ( show ) + { + widget->showFullScreen(); + } + else + { + widget->showNormal(); + } + + return true; } bool wxTopLevelWindowQt::IsFullScreen() const { - return false; + return GetHandle()->isFullScreen(); } void wxTopLevelWindowQt::SetTitle(const wxString& title) From 36aa63f2fd5ca1b311fe62d0b1af7e118dde2b1f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 8 Dec 2018 18:26:21 +0100 Subject: [PATCH 036/553] Slightly improve README wording Also add direct links to the installation instructions. --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3ec9d03626..b3c9bcb231 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Platforms [![AppVeyor](https://img.shields.io/appveyor/ci/wxWidgets/wxWidgets/master.svg?label=Windows)](https://ci.appveyor.com/project/wxWidgets/wxwidgets) [![Travis](https://img.shields.io/travis/wxWidgets/wxWidgets/master.svg?label=Linux)](https://travis-ci.org/wxWidgets/wxWidgets) -wxWidgets currently supports the following primary platforms: +This version of wxWidgets supports the following primary platforms: - Windows XP, Vista, 7, 8 and 10 (32/64 bits). - Most Unix variants using the GTK+ toolkit (version 2.6 or newer or 3.x). @@ -49,25 +49,32 @@ Building -------- For building the library, please see platform-specific documentation under -`docs/` directory. +`docs/` directory, e.g. here are the instructions for +[wxGTK](docs/gtk/install.md), [wxMSW](docs/msw/install.md) and +[wxOSX](docs/osx/install.md). If you're building the sources checked out from Git, and not from a released -versions, please see these additional [Git-specific notes](README-GIT.md). +version, please see these additional [Git-specific notes](README-GIT.md). Further information ------------------- -If you are looking for support, you can get it from +If you are looking for community support, you can get it from - [Mailing Lists](https://www.wxwidgets.org/support/mailing-lists/) - [Discussion Forums](https://forums.wxwidgets.org/) - [#wxwidgets IRC channel](https://www.wxwidgets.org/support/irc/) - [Stack Overflow](https://stackoverflow.com/questions/tagged/wxwidgets) (tag your questions with `wxwidgets`) -- Please report bugs at https://trac.wxwidgets.org/newticket +- And you can report bugs at https://trac.wxwidgets.org/newticket -We would also gladly welcome [your contributions](.github/CONTRIBUTING.md). +[Commercial support](https://www.wxwidgets.org/support/commercial/) is also +available. + +Finally, keep in mind that wxWidgets is an open source project collaboratively +developed by its users and your contributions to it are always welcome. Please +check [our guidelines](.github/CONTRIBUTING.md) if you'd like to do it. Have fun! From facb06a1b8788a08617b41f44f637e8c942239e5 Mon Sep 17 00:00:00 2001 From: Pavel Kalugin Date: Sat, 8 Dec 2018 20:41:00 +0300 Subject: [PATCH 037/553] Fix wxSize member names in the documentation wxSize members x and y were incorrectly mentioned as width and height in the docs. Closes https://github.com/vadz/wxWidgets/pull/6 --- interface/wx/gdicmn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index 0e8ffd53c8..a31a702ffe 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -902,7 +902,7 @@ wxColourDatabase* wxTheColourDatabase; @class wxSize A wxSize is a useful data structure for graphics operations. - It simply contains integer @e width and @e height members. + It simply contains integer @e x and @e y members. Note that the width and height stored inside a wxSize object may be negative and that wxSize functions do not perform any check against negative values From 2e007cb3ec18c54c9436c989bac5c2b3a9315619 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 8 Dec 2018 18:57:36 +0100 Subject: [PATCH 038/553] Update the list of changes before 3.1.2 release Update both the (more detailed) README and the (shorter) announcement message. Also update the statistics and the cumulated changes since 3.0. --- docs/publicity/announce.txt | 37 ++++++++++-------- docs/readme.txt | 75 ++++++++++++++++++++----------------- 2 files changed, 61 insertions(+), 51 deletions(-) diff --git a/docs/publicity/announce.txt b/docs/publicity/announce.txt index 5434c56687..bfa2e20ab1 100644 --- a/docs/publicity/announce.txt +++ b/docs/publicity/announce.txt @@ -1,39 +1,44 @@ -February 19, 2018 -- The wxWidgets team is pleased to announce a new +December 10, 2018 -- The wxWidgets team is pleased to announce a new release of our open source framework for the development of native cross-platform applications in C++. -wxWidgets 3.1.1 is the second release in the 3.1 development +wxWidgets 3.1.2 is the latest release in the 3.1 development branch and is now available at - https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.1 + https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.2 Compared to the stable 3.0.x series, this version brings many improvements and even more bug fixes, please see the change log -https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.1/docs/changes.txt +https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.2/docs/changes.txt for the incomplete list of the most important ones. Here is the maximally condensed summary of the changes compared to 3.0: +- Build system improvements: support for new compilers (MSVS 2017, g++ 8) and + OS versions (macOS 10.14 and its dark mode) as well as an entirely new new + CMake build system. - New features: support for mouse gesture events (GSoC 2017 project); - fractional pen widths in wxGraphicsContext; arbitrary label windows in - wxStaticBox; markup in wxDataViewCtrl items text; better support for high DPI - monitors; support for ZIP 64 files; much improved accessibility support under + non-integer font sizes and arbitrary font weights in wxFont; fractional pen + widths in wxGraphicsContext; arbitrary label windows in wxStaticBox; markup + in wxDataViewCtrl items text; better support for high DPI monitors; support + for ZIP 64 files; LZMA compression; much improved accessibility support under MSW. - New classes: wxActivityIndicator, wxAddRemoveCtrl, wxAppProgressIndicator, wxNativeWindow, wxPowerResourceBlocker, wxSecretStore. -- And methods: wxDateTime::GetWeekBasedYear(), wxListBox::GetTopItem(), - wxProcess::Activate(), wxTextEntry::ForceUpper(), several ones in - wxRendererNative, wxStandardPaths::GetUserDir(), wxUIActionSimulator - ::Select() and many others. -- Significant improvements to: wxBusyInfo, wxNotificationMessage. +- And methods: wxDataViewToggleRenderer::ShowAsRadio(), wxDateTime:: + GetWeekBasedYear(), wxDisplay::GetPPI(), wxGrid::SetCornerLabelValue(), + wxHtmlEasyPrinting::SetPromptMode(), wxJoystickEvent::GetButtonOrdinal(), + wxListBox::GetTopItem(), wxProcess::Activate(), wxTextEntry::ForceUpper(), + several ones in wxRendererNative, wxStandardPaths::GetUserDir(), + wxToolbook::EnablePage(), wxUIActionSimulator::Select() and many others. +- Significant improvements to: wxBusyInfo, wxDataViewCtrl, + wxNotificationMessage, wxStaticBox, wxStyledTextCtrl. - Latest versions of all bundled 3rd party libraries, including all the security fixed and support for WebKit 2 and GStreamer 1.7 under Unix. - Revamped OpenGL support better suited to modern OpenGL (3.2+). - Further C++11 support improvements. -- New CMake-based alternative build system. -- Support for latest compilers: MSVS 2017, g++ 7, clang 6. - A lot of bug fixes, especially in wxGTK3 and wxOSX/Cocoa ports. - New experimental wxQt port. @@ -42,8 +47,8 @@ This release is a "development" one as it makes (very few) incompatible API changes compared to 3.0 and does not guarantee the ABI stability, unlike the 3.0.x series. It is not inherently more buggy or less stable than the "stable" releases and you're encouraged -to use it. If you're already using 3.0, upgrading shouldn't require -any special effort, so please try it out. +to use it, including in production. If you're already using 3.0, upgrading +shouldn't require any special effort, so please try it out. We hope that you will enjoy using the new release! diff --git a/docs/readme.txt b/docs/readme.txt index 6caebb7e9a..8a5d0c649f 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -24,53 +24,52 @@ download from: * https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.2/ -Changes since 3.1.0 +Changes since 3.1.1 ------------------- -There have been more than 2800 commits from more than 160 contributors (79 with -multiple contributions) since 3.1.0 release. New features added since then -include: +There have been more than 1200 commits from 75 contributors (41 with multiple +contributions) since 3.1.1 release. This release primarily contains bug fixes +(closing more than 100 bugs from wxTrac) and incremental improvements in +preparation for the next stable 3.2.0 release, however there is a usual lot of +new features as well, including: -- Support for gesture events has been added (GSoC 2017 project). -- wxWebView can now return JavaScript results to the C++ code (GSoC 2017). -- New wxSecretStore class for securely storing user passwords. +- Initial support for macOS 10.14 and its dark mode. +- Support for non-integer font sizes and arbitrary font weights. +- New wxLZMA{Input,Output}Stream classes. +- Add wxDataViewToggleRenderer::ShowAsRadio(), wxDisplay::GetPPI(), + wxGrid::SetCornerLabelValue(), wxHtmlEasyPrinting::SetPromptMode(), + wxJoystickEvent::GetButtonOrdinal(), wxToolbook::EnablePage(). Some of the other improvements: -- wxWidgets can now be built with CMake too. -- Strings can now be translated differently depending on their context. -- Converting between wxString and UTF-8 encoded std::string is now - simpler and unsafe wxString can now be disabled on the opt-in basis - (see http://wxwidgets.blogspot.com/2017/02/safer-s.html) -- It is possible to use any window (e.g. wxCheckBox) as wxStaticBox label now. -- Many improvements to accessibility support under MSW. -- wxGraphicsContext now supports pens with fractional widths. -- Support for XDG file layout under Unix. -- Many bug fixes to the behaviour (including TAB navigation) and appearances, - especially in wxGTK3 and wxOSX ports. -- wxDataViewCtrl items and headers can be formatted using simple markup - and it is simpler to combine to put items with checkboxes into it. Many bugs - and inconsistencies between platforms in this control have been fixed too. -- Several enhancements to wxStyledTextCtrl including better support for - custom lexers and auto-completion. -- Many improvements to the (still experimental) wxQt port. - -Additionally, the latest versions of compilers (e.g. MSVS 2017) and -operating systems (macOS 10.12) are now supported and all the third -party libraries have been updated to their latest versions. +- There were again many improvements to the (still experimental) wxQt port. +- Fix several bugs related to focus handling and TAB navigation in wxGTK. +- Make it possible to control pagination in wxHTML more precisely. +- Fix several problems with high-DPI displays. +- wxOSX now uses native NSImage/UIImage representation for wxBitmap. +- Support strike-through font attribute in XRC and wxDataViewCtrl markup too. +- Support more than 4 buttons in wxJoystick. +- Add wxwidgets.props property sheet file for MSVS users. Please refer to the detailed change log for the full list of changes: https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.2/docs/changes.txt +Notice that this release is almost completely compatible with 3.1.1 at the API +level, so upgrading to it if you're already using wxWidgets 3 should be +straightforward. + + Changes since 3.0 ----------------- Compared to the stable 3.0.x series, this version brings too many -improvements and even more bug fixes to list them them all. Here is the +improvements and even more bug fixes to list them all, but here is the maximally condensed summary: +- Build system improvements: support for new compilers (MSVS 2017, g++ 8) and + OS versions as well as an entirely new new CMake build system. - New features: support for mouse gesture events (GSoC 2017 project); fractional pen widths in wxGraphicsContext; arbitrary label windows in wxStaticBox; markup in wxDataViewCtrl items text; better support for high DPI @@ -83,13 +82,12 @@ maximally condensed summary: wxProcess::Activate(), wxTextEntry::ForceUpper(), several ones in wxRendererNative, wxStandardPaths::GetUserDir(), wxUIActionSimulator ::Select() and many others. -- Significant improvements to: wxBusyInfo, wxNotificationMessage. +- Significant improvements to: wxBusyInfo, wxDataViewCtrl, + wxNotificationMessage, wxStaticBox, wxStyledTextCtrl. - Latest versions of all bundled 3rd party libraries, including all the security fixed and support for WebKit 2 and GStreamer 1.7 under Unix. - Revamped OpenGL support better suited to modern OpenGL (3.2+). - Further C++11 support improvements. -- New CMake-based alternative build system. -- Support for latest compilers: MSVS 2017, g++ 7, clang 6. - A lot of bug fixes, especially in wxGTK3 and wxOSX/Cocoa ports. - New experimental wxQt port. @@ -98,7 +96,7 @@ maximally condensed summary: Platforms Supported ------------------- -wxWidgets currently supports the following primary platforms: +This version of wxWidgets supports the following primary platforms: * Windows XP, Vista, 7, 8 and 10 (32/64 bits). * Most Unix variants using the GTK+ toolkit (version 2.6 or newer) @@ -200,7 +198,7 @@ problems so this ensures that your report will be addressed sooner. Further Information ------------------- -If you are looking for support, you can get it from +If you are looking for community support, you can get it from * Mailing Lists: https://www.wxwidgets.org/support/mailing-lists/ * Discussion Forums: https://forums.wxwidgets.org/ @@ -208,6 +206,13 @@ If you are looking for support, you can get it from * Stack Overflow (tag your questions with "wxwidgets"): https://stackoverflow.com/questions/tagged/wxwidgets +Commercial support is also available, please see +https://www.wxwidgets.org/support/commercial/ + +Finally, keep in mind that wxWidgets is an open source project collaboratively +developed by its users and your contributions to it are always welcome! + + Have fun! -The wxWidgets Team, February 2018 +The wxWidgets Team, December 2018 From aef36f912ae8df813397d71526b3ecc0cf46071c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 8 Dec 2018 19:09:17 +0100 Subject: [PATCH 039/553] Fix 3.1.2 release date in the change log and the manual --- docs/changes.txt | 2 +- docs/doxygen/mainpages/manual.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 70fc9f5c6d..e12299d2ad 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -102,7 +102,7 @@ Changes in behaviour which may result in build errors removing its name. -3.1.2: (released 2018-??-??) +3.1.2: (released 2018-12-10) ---------------------------- All: diff --git a/docs/doxygen/mainpages/manual.h b/docs/doxygen/mainpages/manual.h index aa180ff0df..5251aebe80 100644 --- a/docs/doxygen/mainpages/manual.h +++ b/docs/doxygen/mainpages/manual.h @@ -14,7 +14,7 @@ @author Julian Smart, Vadim Zeitlin, Robin Dunn, Stefan Csomor, Bryan Petty, Francesco Montorsi, Robert Roebling et al -@date February 19, 2018 +@date December 10, 2018 @n From b408e4c630635f48f37bd14be7dd123f046093b0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 8 Dec 2018 19:09:43 +0100 Subject: [PATCH 040/553] Update the release notes for 3.1.2 Change the version and update the list of MinGW compilers for which the binaries are provided in this release. --- docs/release.md | 129 +++++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 63 deletions(-) diff --git a/docs/release.md b/docs/release.md index 4856571a66..7ce86bec92 100644 --- a/docs/release.md +++ b/docs/release.md @@ -1,102 +1,105 @@ Welcome to wxWidgets, a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls. -wxWidgets 3.1.1 is the second release in the 3.1 development branch. This release is a "development" one as it makes (very few) incompatible API changes compared to 3.0 and does not guarantee the ABI stability, unlike the 3.0.x series. It is not inherently more buggy or less stable than the "stable" releases and you're encouraged to use it. If you're already using 3.0, upgrading shouldn't require any special effort, so please try it out. +wxWidgets 3.1.2 is the latest release in the 3.1 development branch. This release is a "development" one as it makes (very few) incompatible API changes compared to 3.0 and does not guarantee the ABI stability, unlike the 3.0.x series. It is not inherently more buggy or less stable than the "stable" releases and you're encouraged to use it, including in production. If you're already using 3.0, upgrading shouldn't require any special effort, so please try it out. -Please see [**README**](https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.1/docs/readme.txt) for more information about this release and the [change log](https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.1/docs/changes.txt) for details of the changes in it. +Please see [**README**](https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.2/docs/readme.txt) for more information about this release and the [change log](https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.2/docs/changes.txt) for the details of the changes in it. ## Source Files and Documentation If you intend to build wxWidgets from sources (which is recommended), please do **NOT** download the files using the "Source code" links just above, which are automatically generated by GitHub and don't contain the submodules sources which are necessary for building wxWidgets. -Instead, download one of [wxWidgets-3.1.1.zip](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.zip) or [wxWidgets-3.1.1.7z](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.7z), for much smaller size, for Microsoft Windows systems or [wxWidgets-3.1.1.tar.bz2](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.tar.bz2) for Unix ones, including macOS. These archives have exactly the same contents, but use the line endings appropriate for the corresponding platform. +Instead, download one of [wxWidgets-3.1.2.zip](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.zip) or [wxWidgets-3.1.2.7z](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.7z), for much smaller size, for Microsoft Windows systems or [wxWidgets-3.1.2.tar.bz2](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.tar.bz2) for Unix ones, including macOS. These archives have exactly the same contents, but use the line endings appropriate for the corresponding platform. -In addition, we provide archives containing the documentation in either HTML or Microsoft CHM formats. Notice that the documentation is also [available online](https://docs.wxwidgets.org/3.1). +In addition, we provide archives containing the documentation in either HTML or Microsoft CHM formats. Notice that the documentation is also [available online](https://docs.wxwidgets.org/3.1.2). -Finally, Microsoft Windows users may download [Setup.exe file](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxMSW-3.1.1-Setup.exe) containing both sources and documentation, however please note that this file does _not_ contain any binaries, please see below for those. +Finally, Microsoft Windows users may download [Setup.exe file](https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxMSW-3.1.2-Setup.exe) containing both sources and documentation, however please note that this file does _not_ contain any binaries, please see below for those. To verify your download please use the following SHA-1 checksums: - 0000000000000000000000000000000000000000 wxMSW-3.1.1-Setup.exe - 0000000000000000000000000000000000000000 wxWidgets-3.1.1-docs-chm.zip - 0000000000000000000000000000000000000000 wxWidgets-3.1.1-docs-html.tar.bz2 - 0000000000000000000000000000000000000000 wxWidgets-3.1.1-docs-html.zip - 0000000000000000000000000000000000000000 wxWidgets-3.1.1-headers.7z - 0000000000000000000000000000000000000000 wxWidgets-3.1.1.7z - 0000000000000000000000000000000000000000 wxWidgets-3.1.1.tar.bz2 - 0000000000000000000000000000000000000000 wxWidgets-3.1.1.zip + 0000000000000000000000000000000000000000 wxMSW-3.1.2-Setup.exe + 0000000000000000000000000000000000000000 wxWidgets-3.1.2-docs-chm.zip + 0000000000000000000000000000000000000000 wxWidgets-3.1.2-docs-html.tar.bz2 + 0000000000000000000000000000000000000000 wxWidgets-3.1.2-docs-html.zip + 0000000000000000000000000000000000000000 wxWidgets-3.1.2-headers.7z + 0000000000000000000000000000000000000000 wxWidgets-3.1.2.7z + 0000000000000000000000000000000000000000 wxWidgets-3.1.2.tar.bz2 + 0000000000000000000000000000000000000000 wxWidgets-3.1.2.zip ## Binaries We provide pre-built binary files for the following compilers: * Microsoft Visual C++ compiler versions 9.0, 10.0, 11.0, 12.0, 14.0 and 14.1 (corresponding to marketing product names of Microsoft Visual Studio 2008, 2010, 2012, 2013, 2015 and 2017 respectively). -* TDM-GCC version 5.1 and MinGW-w64 version 7.2 (with the default SJLJ exceptions propagation method, using C++11). Please note that you need to use the very latest MinGW-w64 7.2 compiler release with this version of the compiler which can be downloaded from [here for 32 bits](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/7.2.0/threads-win32/sjlj/i686-7.2.0-release-win32-sjlj-rt_v5-rev1.7z/download) and [here for 64 bits](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.2.0/threads-win32/seh/x86_64-7.2.0-release-win32-seh-rt_v5-rev1.7z/download), the older "rev0" release has a known bug affecting building wxWidgets in some scenarios. +* TDM-GCC version 5.1 and MinGW-w64 versions 7.3 and 8.1 (with the default SJLJ exceptions propagation method, using C++11). ### For Developers -For developing applications with wxWidgets you need to download the compiler-independent `wxWidgets-3.1.1_Headers.7z` file and one of `wxMSW-3.1.1-vcXXX_Dev.7z` or `wxMSW-3.1.1_gccXXX_Dev.7z` files depending on your compiler, its version and the target architecture (x86 if not specified or x64). +For developing applications with wxWidgets you need to download the compiler-independent `wxWidgets-3.1.2_Headers.7z` file and one of `wxMSW-3.1.2-vcXXX_Dev.7z` or `wxMSW-3.1.2_gccXXX_Dev.7z` files depending on your compiler, its version and the target architecture (x86 if not specified or x64). Unpack both files into the same directory so that `include` and `lib` directories are at the same level after unpacking. You should be able to compile and link applications using wxWidgets in both debug and release modes but the debug symbols are provided only for debug libraries in this archive, see below for the release build debug symbols. ### For End Users -End users may download one of `wxMSW-3.1.1_vcXXX_ReleaseDLL.7z` or `wxMSW-3.1.1_gccXXX_ReleaseDLL.7z` files to get just the DLLs required for running the applications using wxWidgets. +End users may download one of `wxMSW-3.1.2_vcXXX_ReleaseDLL.7z` or `wxMSW-3.1.2_gccXXX_ReleaseDLL.7z` files to get just the DLLs required for running the applications using wxWidgets. ### For Debugging -* Microsoft Visual C++ users: Files `wxMSW-3.1.1_vcXXX_ReleasePDB.7z` contain the debug symbols for the release build of the DLLs. Download them if you want to debug your own applications in release build or if you want to get meaningful information from mini-dumps retrieved from your users machines. -* MinGW-TDM users: Currently the debug symbols are not available for the release build of the DLLs (only the debug versions of the DLLs contains the debug - symbols). +* Microsoft Visual C++ users: Files `wxMSW-3.1.2_vcXXX_ReleasePDB.7z` contain the debug symbols for the release build of the DLLs. Download them if you want to debug your own applications in release build or if you want to get meaningful information from mini-dumps retrieved from your users machines. +* MinGW-TDM users: Currently the debug symbols are not available for the release build of the DLLs (only the debug versions of the DLLs contains the debug symbols). ### Binary File Download Verification To verify your download please use the following SHA-1 checksums: - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc510TDM_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc510TDM_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc510TDM_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc510TDM_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc720_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc720_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc720_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_gcc720_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc90_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc90_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc90_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc90_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc90_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc90_x64_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc100_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc100_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc100_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc100_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc100_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc100_x64_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc110_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc110_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc110_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc110_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc110_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc110_x64_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc120_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc120_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc120_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc120_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc120_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc120_x64_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc140_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc140_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc140_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc140_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc140_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc140_x64_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc141_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc141_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc141_ReleasePDB.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc141_x64_Dev.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc141_x64_ReleaseDLL.7z - 0000000000000000000000000000000000000000 wxMSW-3.1.1_vc141_x64_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc510TDM_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc510TDM_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc510TDM_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc510TDM_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc730_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc730_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc730_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc730_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc810_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc810_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc810_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_gcc810_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc90_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc90_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc90_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc90_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc90_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc90_x64_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc100_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc100_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc100_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc100_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc100_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc100_x64_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc110_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc110_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc110_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc110_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc110_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc110_x64_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc120_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc120_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc120_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc120_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc120_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc120_x64_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc140_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc140_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc140_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc140_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc140_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc140_x64_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc141_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc141_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc141_ReleasePDB.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc141_x64_Dev.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc141_x64_ReleaseDLL.7z + 0000000000000000000000000000000000000000 wxMSW-3.1.2_vc141_x64_ReleasePDB.7z ## Reporting Problems From fd5c62bc41d7cb82848a06759e09a1e5df497cd8 Mon Sep 17 00:00:00 2001 From: "oleksii.vorobiov" Date: Mon, 19 Nov 2018 13:17:32 +0200 Subject: [PATCH 041/553] Make updating the value in wxEVT_SPINCTRL work in wxMSW In wxMSW, the value of the control was modified after executing the user-defined wxEVT_SPINCTRL handler which meant that any calls to SetValue() there were effectively ignored. Fix this and add a unit test checking for the described scenario. Closes https://github.com/wxWidgets/wxWidgets/pull/1027 Closes #18187. --- src/msw/spinctrl.cpp | 9 +++---- tests/controls/spinctrltest.cpp | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index fbb9e2b387..058e08ed3d 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -244,6 +244,7 @@ void wxSpinCtrl::NormalizeValue() if ( changed ) { + m_oldValue = value; SendSpinUpdate(value); } } @@ -666,10 +667,7 @@ void wxSpinCtrl::SendSpinUpdate(int value) wxSpinEvent event(wxEVT_SPINCTRL, GetId()); event.SetEventObject(this); event.SetInt(value); - (void)HandleWindowEvent(event); - - m_oldValue = value; } bool wxSpinCtrl::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, @@ -687,7 +685,10 @@ bool wxSpinCtrl::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, // might be using 32 bit range. int new_value = GetValue(); if (m_oldValue != new_value) - SendSpinUpdate( new_value ); + { + m_oldValue = new_value; + SendSpinUpdate(new_value); + } return true; } diff --git a/tests/controls/spinctrltest.cpp b/tests/controls/spinctrltest.cpp index da4df9363f..e91079de3c 100644 --- a/tests/controls/spinctrltest.cpp +++ b/tests/controls/spinctrltest.cpp @@ -38,6 +38,7 @@ private: WXUISIM_TEST( Wrap ); CPPUNIT_TEST( Range ); CPPUNIT_TEST( Value ); + WXUISIM_TEST( SetValueInsideEventHandler ); CPPUNIT_TEST_SUITE_END(); void Initial(); @@ -46,6 +47,10 @@ private: void Wrap(); void Range(); void Value(); + void SetValueInsideEventHandler(); + + // Helper event handler for SetValueInsideEventHandler() test. + void OnSpinSetValue(wxSpinEvent &e); wxSpinCtrl* m_spin; @@ -224,4 +229,41 @@ void SpinCtrlTestCase::Value() CPPUNIT_ASSERT_EQUAL(0, updatedText.GetCount()); } +void SpinCtrlTestCase::OnSpinSetValue(wxSpinEvent &e) +{ + // Constrain the value to be in the 1..16 range or 32. + int newVal = e.GetValue(); + + if ( newVal == 31 ) + m_spin->SetValue(16); + else if ( newVal > 16 ) + m_spin->SetValue(32); +} + +void SpinCtrlTestCase::SetValueInsideEventHandler() +{ +#if wxUSE_UIACTIONSIMULATOR + m_spin->Bind(wxEVT_SPINCTRL, &SpinCtrlTestCase::OnSpinSetValue, this); + + wxUIActionSimulator sim; + + // run multiple times to make sure there are no issues with keeping old value + for ( size_t i = 0; i < 2; i++ ) + { + m_spin->SetFocus(); + wxYield(); + + sim.Char(WXK_DELETE); + sim.Char(WXK_DELETE); + sim.Text("20"); + wxYield(); + + wxTheApp->GetTopWindow()->SetFocus(); + wxYield(); + + CPPUNIT_ASSERT_EQUAL(32, m_spin->GetValue()); + } +#endif // wxUSE_UIACTIONSIMULATOR +} + #endif From 089eeea3ef80e51c71d2487b484ad56c11f4eafd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 8 Dec 2018 20:17:57 +0100 Subject: [PATCH 042/553] Fix wxMSW build with wxUSE_UXTHEME==0 Make wxUxThemeIsActive() available even in this case to fix compilation in some places and add the unavoidable preprocessor checks in other ones. Closes #18207. --- include/wx/aui/auibar.h | 2 +- include/wx/aui/tabart.h | 2 +- include/wx/msw/uxtheme.h | 8 ++++++++ include/wx/systhemectrl.h | 2 +- src/aui/barartmsw.cpp | 6 +++--- src/aui/tabartmsw.cpp | 6 +++--- src/generic/richtooltipg.cpp | 29 ++++++++++++++++------------- src/msw/combo.cpp | 6 ------ src/msw/menuitem.cpp | 11 ++++++++++- 9 files changed, 43 insertions(+), 29 deletions(-) diff --git a/include/wx/aui/auibar.h b/include/wx/aui/auibar.h index 274757d88e..ac5131f274 100644 --- a/include/wx/aui/auibar.h +++ b/include/wx/aui/auibar.h @@ -759,7 +759,7 @@ typedef void (wxEvtHandler::*wxAuiToolBarEventFunction)(wxAuiToolBarEvent&); #define wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK wxEVT_AUITOOLBAR_MIDDLE_CLICK #define wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG wxEVT_AUITOOLBAR_BEGIN_DRAG -#ifdef __WXMSW__ +#if defined(__WXMSW__) && wxUSE_UXTHEME #define wxHAS_NATIVE_TOOLBAR_ART #include "wx/aui/barartmsw.h" #define wxAuiDefaultToolBarArt wxAuiMSWToolBarArt diff --git a/include/wx/aui/tabart.h b/include/wx/aui/tabart.h index f11e75b4ba..565ac1067a 100644 --- a/include/wx/aui/tabart.h +++ b/include/wx/aui/tabart.h @@ -318,7 +318,7 @@ protected: #define wxHAS_NATIVE_TABART #include "wx/aui/tabartgtk.h" #define wxAuiDefaultTabArt wxAuiGtkTabArt - #elif defined(__WXMSW__) + #elif defined(__WXMSW__) && wxUSE_UXTHEME #define wxHAS_NATIVE_TABART #include "wx/aui/tabartmsw.h" #define wxAuiDefaultTabArt wxAuiMSWTabArt diff --git a/include/wx/msw/uxtheme.h b/include/wx/msw/uxtheme.h index 3207521c0a..9d7000cd3b 100644 --- a/include/wx/msw/uxtheme.h +++ b/include/wx/msw/uxtheme.h @@ -13,6 +13,8 @@ #include "wx/defs.h" +#if wxUSE_UXTHEME + #include "wx/msw/private.h" // we use GetHwndOf() #include @@ -253,5 +255,11 @@ private: wxDECLARE_NO_COPY_CLASS(wxUxThemeHandle); }; +#else // !wxUSE_UXTHEME + +inline bool wxUxThemeIsActive() { return false; } + +#endif // wxUSE_UXTHEME/!wxUSE_UXTHEME + #endif // _WX_UXTHEME_H_ diff --git a/include/wx/systhemectrl.h b/include/wx/systhemectrl.h index 8af2d5d9c1..269c361855 100644 --- a/include/wx/systhemectrl.h +++ b/include/wx/systhemectrl.h @@ -12,7 +12,7 @@ #include "wx/defs.h" -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) +#if defined(__WXMSW__) && wxUSE_UXTHEME && !defined(__WXUNIVERSAL__) #define wxHAS_SYSTEM_THEMED_CONTROL #endif diff --git a/src/aui/barartmsw.cpp b/src/aui/barartmsw.cpp index b479bc31a2..ee1b4b10e4 100644 --- a/src/aui/barartmsw.cpp +++ b/src/aui/barartmsw.cpp @@ -13,6 +13,8 @@ #pragma hdrstop #endif +#if wxUSE_AUI && wxUSE_UXTHEME + #ifndef WX_PRECOMP #include "wx/bitmap.h" #include "wx/dcclient.h" @@ -25,8 +27,6 @@ #include "wx/msw/uxtheme.h" #include "wx/msw/private.h" -#if wxUSE_AUI - wxAuiMSWToolBarArt::wxAuiMSWToolBarArt() { if ( wxUxThemeIsActive() ) @@ -470,4 +470,4 @@ int wxAuiMSWToolBarArt::ShowDropDown(wxWindow* wnd, return wxAuiGenericToolBarArt::ShowDropDown(wnd, items); } -#endif // wxUSE_AUI +#endif // wxUSE_AUI && wxUSE_UXTHEME diff --git a/src/aui/tabartmsw.cpp b/src/aui/tabartmsw.cpp index 9f17fa27fe..de069d1f4d 100644 --- a/src/aui/tabartmsw.cpp +++ b/src/aui/tabartmsw.cpp @@ -13,6 +13,8 @@ #pragma hdrstop #endif +#if wxUSE_AUI && wxUSE_UXTHEME && !defined(__WXUNIVERSAL__) + #ifndef WX_PRECOMP #include "wx/dc.h" #endif @@ -23,8 +25,6 @@ #include "wx/msw/private.h" #include "wx/renderer.h" -#if wxUSE_AUI && !defined(__WXUNIVERSAL__) - wxAuiMSWTabArt::wxAuiMSWTabArt() { m_closeBtnSize = wxDefaultSize; @@ -469,4 +469,4 @@ bool wxAuiMSWTabArt::IsThemed() const } -#endif // wxUSE_AUI +#endif // wxUSE_AUI && wxUSE_UXTHEME && !defined(__WXUNIVERSAL__) diff --git a/src/generic/richtooltipg.cpp b/src/generic/richtooltipg.cpp index b774341d33..1905538a08 100644 --- a/src/generic/richtooltipg.cpp +++ b/src/generic/richtooltipg.cpp @@ -47,7 +47,10 @@ #include "wx/textwrapper.h" #ifdef __WXMSW__ - #include "wx/msw/uxtheme.h" + #if wxUSE_UXTHEME + #include "wx/msw/uxtheme.h" + #define HAVE_MSW_THEME + #endif #endif // ---------------------------------------------------------------------------- @@ -86,7 +89,7 @@ public: // Determine the appropriate title font for the current platform. titleFont = labelTitle->GetFont(); -#ifdef __WXMSW__ +#ifdef HAVE_MSW_THEME // When using themes MSW tooltips use larger bluish version of the // normal font. if ( UseTooltipTheme() ) @@ -110,7 +113,7 @@ public: labelTitle->SetForegroundColour(wxRGBToColour(c)); } else -#endif // __WXMSW__ +#endif // HAVE_MSW_THEME { // Everything else, including "classic" MSW look uses just the // bold version of the base font. @@ -132,7 +135,7 @@ public: wxTextSizerWrapper wrapper(this); wxSizer* sizerText = wrapper.CreateSizer(message, -1 /* No wrapping */); -#ifdef __WXMSW__ +#ifdef HAVE_MSW_THEME if ( icon.IsOk() && UseTooltipTheme() ) { // Themed tooltips under MSW align the text with the title, not @@ -144,7 +147,7 @@ public: sizerText = sizerTextIndent; } -#endif // !__WXMSW__ +#endif // HAVE_MSW_THEME sizerTop->Add(sizerText, wxSizerFlags().DoubleBorder(wxLEFT|wxRIGHT|wxBOTTOM) .Centre()); @@ -167,7 +170,7 @@ public: if ( !colStart.IsOk() ) { // Determine the best colour(s) to use on our own. -#ifdef __WXMSW__ +#ifdef HAVE_MSW_THEME if ( UseTooltipTheme() ) { wxUxThemeHandle hTheme(GetParent(), L"TOOLTIP"); @@ -198,7 +201,7 @@ public: colEnd = wxRGBToColour(c2); } else -#endif // __WXMSW__ +#endif // HAVE_MSW_THEME { colStart = wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK); } @@ -270,26 +273,26 @@ protected: } private: -#ifdef __WXMSW__ +#ifdef HAVE_MSW_THEME // Returns non-NULL theme only if we're using Win7-style tooltips. static bool UseTooltipTheme() { // Even themed applications under XP still use "classic" tooltips. if ( wxGetWinVersion() <= wxWinVersion_XP ) return false; - else - return wxUxThemeIsActive(); + else + return wxUxThemeIsActive(); } -#endif // __WXMSW__ +#endif // HAVE_MSW_THEME // For now we just hard code the tip height, would be nice to do something // smarter in the future. static int GetTipHeight() { -#ifdef __WXMSW__ +#ifdef HAVE_MSW_THEME if ( UseTooltipTheme() ) return 20; -#endif // __WXMSW__ +#endif // HAVE_MSW_THEME return 15; } diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 2923f575c7..c46abf2fa0 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -37,9 +37,7 @@ #include "wx/combo.h" #include "wx/msw/registry.h" -#if wxUSE_UXTHEME #include "wx/msw/uxtheme.h" -#endif #include "wx/msw/dc.h" #define NATIVE_TEXT_INDENT_XP 4 @@ -87,7 +85,6 @@ bool wxComboCtrl::Create(wxWindow *parent, if ( !border ) { -#if wxUSE_UXTHEME if ( wxUxThemeIsActive() ) { // For XP, have 1-width custom border, for older version use sunken @@ -95,7 +92,6 @@ bool wxComboCtrl::Create(wxWindow *parent, m_widthCustomBorder = 1; } else -#endif border = wxBORDER_SUNKEN; style = (style & ~(wxBORDER_MASK)) | border; @@ -112,10 +108,8 @@ bool wxComboCtrl::Create(wxWindow *parent, name) ) return false; -#if wxUSE_UXTHEME if ( wxUxThemeIsActive() && ::wxGetWinVersion() >= wxWinVersion_Vista ) m_iFlags |= wxCC_BUTTON_STAYS_DOWN |wxCC_BUTTON_COVERS_BORDER; -#endif if ( style & wxCC_STD_BUTTON ) m_iFlags |= wxCC_POPUP_ON_MOUSE_UP; diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index f39af0763f..1c53d8de1d 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -165,7 +165,10 @@ class MenuDrawData public: // Wrapper around standard MARGINS structure providing some helper // functions and automatically initializing the margin fields to 0. - struct Margins : MARGINS + struct Margins +#if wxUSE_UXTHEME + : MARGINS +#endif // wxUSE_UXTHEME { Margins() { @@ -193,6 +196,12 @@ public: rect.right += cyTopHeight; rect.bottom += cyBottomHeight; } + +#if !wxUSE_UXTHEME + // When MARGINS struct is not available, we need to define the fields + // we use ourselves. + int cxLeftWidth, cxRightWidth, cyTopHeight, cyBottomHeight; +#endif // !wxUSE_UXTHEME }; Margins ItemMargin; // popup item margins From f170ab3b61bbe1576fc78e8e31c70f2d8bfab67b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 00:35:27 +0100 Subject: [PATCH 043/553] Remove duplicate words s/new new/new/ --- docs/publicity/announce.txt | 4 ++-- docs/readme.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/publicity/announce.txt b/docs/publicity/announce.txt index bfa2e20ab1..cedfcfdb85 100644 --- a/docs/publicity/announce.txt +++ b/docs/publicity/announce.txt @@ -16,8 +16,8 @@ for the incomplete list of the most important ones. Here is the maximally condensed summary of the changes compared to 3.0: - Build system improvements: support for new compilers (MSVS 2017, g++ 8) and - OS versions (macOS 10.14 and its dark mode) as well as an entirely new new - CMake build system. + OS versions (macOS 10.14 and its dark mode) as well as an entirely new CMake + build system. - New features: support for mouse gesture events (GSoC 2017 project); non-integer font sizes and arbitrary font weights in wxFont; fractional pen widths in wxGraphicsContext; arbitrary label windows in wxStaticBox; markup diff --git a/docs/readme.txt b/docs/readme.txt index 8a5d0c649f..c84dcbb8cf 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -69,7 +69,7 @@ improvements and even more bug fixes to list them all, but here is the maximally condensed summary: - Build system improvements: support for new compilers (MSVS 2017, g++ 8) and - OS versions as well as an entirely new new CMake build system. + OS versions as well as an entirely new CMake build system. - New features: support for mouse gesture events (GSoC 2017 project); fractional pen widths in wxGraphicsContext; arbitrary label windows in wxStaticBox; markup in wxDataViewCtrl items text; better support for high DPI From ab1fd56977191d1dc5380b6bd775729c55074e2e Mon Sep 17 00:00:00 2001 From: Sebastian Walderich Date: Sat, 8 Dec 2018 20:46:08 +0100 Subject: [PATCH 044/553] Implement wxAuiNotebook::HitTest() Check if point is on window or a certain tab. Closes https://github.com/wxWidgets/wxWidgets/pull/1059 --- docs/changes.txt | 1 + src/aui/auibook.cpp | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 70fc9f5c6d..cd22de9e52 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -144,6 +144,7 @@ All (GUI): - Adapt AUI colours to system colour changes (Daniel Kulp). - Fix removing and inserting pages in wxToolbook (Stefan Ziegler). - Fix bug in template selection in docview framework (jwiesemann). +- Implement wxAuiNotebook::HitTest() (Sebastian Walderich). wxGTK: diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 12afa3a9b6..bbba6cd33e 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3359,10 +3359,37 @@ void wxAuiNotebook::SetPageSize (const wxSize& WXUNUSED(size)) wxFAIL_MSG("Not implemented for wxAuiNotebook"); } -int wxAuiNotebook::HitTest (const wxPoint& WXUNUSED(pt), long* WXUNUSED(flags)) const +int wxAuiNotebook::HitTest (const wxPoint &pt, long *flags) const { - wxFAIL_MSG("Not implemented for wxAuiNotebook"); - return wxNOT_FOUND; + wxWindow *w = NULL; + long position = wxBK_HITTEST_NOWHERE; + const wxAuiPaneInfoArray& all_panes = const_cast(m_mgr).GetAllPanes(); + const size_t pane_count = all_panes.GetCount(); + for (size_t i = 0; i < pane_count; ++i) + { + if (all_panes.Item(i).name == wxT("dummy")) + continue; + + wxTabFrame* tabframe = (wxTabFrame*) all_panes.Item(i).window; + if (tabframe->m_tab_rect.Contains(pt)) + { + wxPoint tabpos = tabframe->m_tabs->ScreenToClient(ClientToScreen(pt)); + if (tabframe->m_tabs->TabHitTest(tabpos.x, tabpos.y, &w)) + position = wxBK_HITTEST_ONITEM; + break; + } + else if (tabframe->m_rect.Contains(pt)) + { + w = tabframe->m_tabs->GetWindowFromIdx(tabframe->m_tabs->GetActivePage()); + if (w) + position = wxBK_HITTEST_ONPAGE; + break; + } + } + + if (flags) + *flags = position; + return w ? GetPageIndex(w) : wxNOT_FOUND; } int wxAuiNotebook::GetPageImage(size_t WXUNUSED(n)) const From a18fc6ce96fc2d8986d78a2322dc0e57924756dd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:09:54 +0100 Subject: [PATCH 045/553] Normalize line endings in wxwidgets.iss This file was a mix of DOS and Unix EOLs, convert it entirely to the former. No real changes. --- build/tools/wxwidgets.iss | 56 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/build/tools/wxwidgets.iss b/build/tools/wxwidgets.iss index ac503056b7..95c6bd2533 100644 --- a/build/tools/wxwidgets.iss +++ b/build/tools/wxwidgets.iss @@ -1,23 +1,23 @@ ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! -#if GetEnv("INNO") != "" - #define WXW_DIR GetEnv("INNO") -#else - #define WXW_DIR "..\.." -#endif - -#if GetEnv("WXW_VER") == "Snapshot" - #define INFOFILE WXW_DIR + "\BuildGit.txt" - #define WX_VERSION "Snapshot" -#elif GetEnv("WXW_VER") != "" - #define INFOFILE WXW_DIR + "\docs\msw\install.txt" - #define WX_VERSION GetEnv("WXW_VER") +#if GetEnv("INNO") != "" + #define WXW_DIR GetEnv("INNO") #else - #error "WXW_VER environment variable must be defined." + #define WXW_DIR "..\.." #endif -#define SETUPFILENAME "wxMSW-" + GetEnv("WXW_VER") + "-Setup" +#if GetEnv("WXW_VER") == "Snapshot" + #define INFOFILE WXW_DIR + "\BuildGit.txt" + #define WX_VERSION "Snapshot" +#elif GetEnv("WXW_VER") != "" + #define INFOFILE WXW_DIR + "\docs\msw\install.txt" + #define WX_VERSION GetEnv("WXW_VER") +#else + #error "WXW_VER environment variable must be defined." +#endif + +#define SETUPFILENAME "wxMSW-" + GetEnv("WXW_VER") + "-Setup" @@ -32,22 +32,22 @@ DefaultDirName={sd}\wxWidgets-{#WX_VERSION} DefaultGroupName=wxWidgets {#WX_VERSION} UsePreviousAppDir=no DisableProgramGroupPage=yes -LicenseFile={#WXW_DIR}\docs\licence.txt -InfoBeforeFile={#WXW_DIR}\docs\readme.txt -InfoAfterFile={#INFOFILE} -OutputDir={#WXW_DIR}\.. -OutputBaseFilename={#SETUPFILENAME} -PrivilegesRequired=none -SetupIconFile={#WXW_DIR}\art\wxwin.ico +LicenseFile={#WXW_DIR}\docs\licence.txt +InfoBeforeFile={#WXW_DIR}\docs\readme.txt +InfoAfterFile={#INFOFILE} +OutputDir={#WXW_DIR}\.. +OutputBaseFilename={#SETUPFILENAME} +PrivilegesRequired=none +SetupIconFile={#WXW_DIR}\art\wxwin.ico Compression=lzma SolidCompression=yes - -[Files] -; source files -Source: "{#WXW_DIR}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs - -[INI] -Filename: "{app}\wx.url"; Section: "InternetShortcut"; Key: "URL"; String: "https://www.wxwidgets.org" + +[Files] +; source files +Source: "{#WXW_DIR}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs + +[INI] +Filename: "{app}\wx.url"; Section: "InternetShortcut"; Key: "URL"; String: "https://www.wxwidgets.org" [Icons] Name: "{group}\{cm:ProgramOnTheWeb,wxWidgets}"; Filename: "{app}\wx.url" From 653f9b14f087eb589af0155dc4e4e079d56cd1a2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:18:06 +0100 Subject: [PATCH 046/553] Don't reference inexistent docs/msw/install.txt in wxwidgets.iss Use install.md which is probably not ideal, but it at least allows Inno Setup to successfully build the installer. --- build/tools/wxwidgets.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tools/wxwidgets.iss b/build/tools/wxwidgets.iss index 95c6bd2533..8feab2250a 100644 --- a/build/tools/wxwidgets.iss +++ b/build/tools/wxwidgets.iss @@ -54,7 +54,7 @@ Name: "{group}\{cm:ProgramOnTheWeb,wxWidgets}"; Filename: "{app}\wx.url" Name: {group}\wxWidgets Manual; Filename: {app}\docs\htmlhelp\wx.chm; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths Name: {group}\Changes; Filename: {app}\docs\changes.txt; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths Name: {group}\Readme; Filename: {app}\docs\readme.txt; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths -Name: {group}\Compiling wxWidgets; Filename: {app}\docs\msw\install.txt; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths +Name: {group}\Setting up wxWidgets; Filename: {app}\docs\msw\install.md; WorkingDir: {app}; IconIndex: 0; Flags: useapppaths Name: "{group}\Uninstall wxWidgets {#WX_VERSION}"; Filename: "{uninstallexe}" From f456f52493d602bd7a207804ea763fd128bce17d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:38:32 +0100 Subject: [PATCH 047/553] Add a text file to be shown after finishing wxMSW installation We used docs/msw/install.txt for this previously, but it was too long to be comfortably viewed in the installation wizard and also incidentally doesn't exist any more, so add a new, short file just referring the user to its replacement. --- build/tools/wxwidgets.iss | 4 +--- docs/msw/setup_after.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 docs/msw/setup_after.txt diff --git a/build/tools/wxwidgets.iss b/build/tools/wxwidgets.iss index 8feab2250a..67c8dc3adf 100644 --- a/build/tools/wxwidgets.iss +++ b/build/tools/wxwidgets.iss @@ -8,10 +8,8 @@ #endif #if GetEnv("WXW_VER") == "Snapshot" - #define INFOFILE WXW_DIR + "\BuildGit.txt" #define WX_VERSION "Snapshot" #elif GetEnv("WXW_VER") != "" - #define INFOFILE WXW_DIR + "\docs\msw\install.txt" #define WX_VERSION GetEnv("WXW_VER") #else #error "WXW_VER environment variable must be defined." @@ -34,7 +32,7 @@ UsePreviousAppDir=no DisableProgramGroupPage=yes LicenseFile={#WXW_DIR}\docs\licence.txt InfoBeforeFile={#WXW_DIR}\docs\readme.txt -InfoAfterFile={#INFOFILE} +InfoAfterFile={#WXW_DIR}\docs\msw\setup_after.txt OutputDir={#WXW_DIR}\.. OutputBaseFilename={#SETUPFILENAME} PrivilegesRequired=none diff --git a/docs/msw/setup_after.txt b/docs/msw/setup_after.txt new file mode 100644 index 0000000000..d539cea2d2 --- /dev/null +++ b/docs/msw/setup_after.txt @@ -0,0 +1,9 @@ +wxWidgets was installed successfully! + +Please note: before using wxWidgets in your application, +you must build the library using the same compiler you +use for building your program. + +Please see docs/msw/install.md file in the installation +directory for the detailed instructions about how to build +wxWidgets and use it from your application. From 33cb18f5e1cdb172cb280ca6bf1cd68b55f845a5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:21:40 +0100 Subject: [PATCH 048/553] Link to the installation instructions from the main manual page Installation is traditionally the worst (or at least the first) problem for new wxWidgets users, so make it simpler to find these instructions. --- docs/doxygen/mainpages/manual.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/doxygen/mainpages/manual.h b/docs/doxygen/mainpages/manual.h index 5251aebe80..f7b0866269 100644 --- a/docs/doxygen/mainpages/manual.h +++ b/docs/doxygen/mainpages/manual.h @@ -16,18 +16,17 @@ @date December 10, 2018 -@n - Welcome to wxWidgets, a stable and powerful open source framework for developing native cross-platform GUI applications in C++! -@n - If you are new to wxWidgets, please start with the @ref page_introduction -and follow with the @ref page_topics, with maybe a look at -@ref page_samples as you go. If you are already familiar with wxWidgets, -please read about @ref overview_changes_since28 "the changes" in the latest -version compared to 2.8 series. And you can also follow the links in the +and follow with the @ref page_topics, with maybe a look at @ref page_samples as +you go. Installation instructions for various platforms are available from the +@ref page_port page. + +If you are already familiar with wxWidgets and are upgrading from an older +release, please read about @ref overview_changes_since28 "the changes" in the +latest version compared to 2.8 series. And you can also follow the links in the reference section or jump directly to the alphabetical list of classes to find out more about the topic you are interested in. From 2b612603d35c152a8ba0fc43ed1f7597c02d06c2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:51:29 +0100 Subject: [PATCH 049/553] Give an error from build/tools/post-release.sh if it didn't work The script gave a misleading success message even if it didn't find anything to update. --- build/tools/post-release.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/tools/post-release.sh b/build/tools/post-release.sh index dc1ba31a8d..90199a8d89 100755 --- a/build/tools/post-release.sh +++ b/build/tools/post-release.sh @@ -8,6 +8,11 @@ topdir=`dirname $0`/../.. # Build the file list for sha1sums, from `docs/release.md` declare -a files=(`sed -n '/^## Download Verification/,/^## Binaries/p' $topdir/docs/release.md | sed -n -E 's/^\s*0{40}\s{2}(wx.*)/\1/p'`) +if [ -z "$files" ]; then + echo "No lines with SHA-1 sums, has release.md format changed?" >&2 + exit 1 +fi + # Get the release version unless it's given explicitly on the command line. if [ -z $1 ]; then ver_string=`grep '#define wxVERSION_STRING ' $topdir/include/wx/version.h | sed 's/^.*"wxWidgets \(.*\)")/\1/'` From b8f791877eafdbd48e99d38b7c24e9683f7ec2f8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:52:40 +0100 Subject: [PATCH 050/553] Fix SHA-1 update script to work with the current release.md Change the regex used to find the lines to update to actually find them. --- build/tools/post-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tools/post-release.sh b/build/tools/post-release.sh index 90199a8d89..83806f0694 100755 --- a/build/tools/post-release.sh +++ b/build/tools/post-release.sh @@ -6,7 +6,7 @@ set -e topdir=`dirname $0`/../.. # Build the file list for sha1sums, from `docs/release.md` -declare -a files=(`sed -n '/^## Download Verification/,/^## Binaries/p' $topdir/docs/release.md | sed -n -E 's/^\s*0{40}\s{2}(wx.*)/\1/p'`) +declare -a files=(`sed -n '/^To verify your download/,/^## Binaries/p' $topdir/docs/release.md | sed -n -E 's/^\s*0{40}\s{2}(wx.*)/\1/p'`) if [ -z "$files" ]; then echo "No lines with SHA-1 sums, has release.md format changed?" >&2 From d06720d4c9088c60962d5e7e3ba0a45688580b40 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:53:25 +0100 Subject: [PATCH 051/553] Update SHA-1 sums for 3.1.2 release source archives This is the result of running ./build/tools/post-release.sh --- docs/release.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/release.md b/docs/release.md index 7ce86bec92..82b9958762 100644 --- a/docs/release.md +++ b/docs/release.md @@ -17,14 +17,14 @@ Finally, Microsoft Windows users may download [Setup.exe file](https://github.co To verify your download please use the following SHA-1 checksums: - 0000000000000000000000000000000000000000 wxMSW-3.1.2-Setup.exe - 0000000000000000000000000000000000000000 wxWidgets-3.1.2-docs-chm.zip - 0000000000000000000000000000000000000000 wxWidgets-3.1.2-docs-html.tar.bz2 - 0000000000000000000000000000000000000000 wxWidgets-3.1.2-docs-html.zip - 0000000000000000000000000000000000000000 wxWidgets-3.1.2-headers.7z - 0000000000000000000000000000000000000000 wxWidgets-3.1.2.7z - 0000000000000000000000000000000000000000 wxWidgets-3.1.2.tar.bz2 - 0000000000000000000000000000000000000000 wxWidgets-3.1.2.zip + 85ac5b18de191d9d5504b7106466b21b64e7249d wxMSW-3.1.2-Setup.exe + 40a1469a13023f12a56bcbcfec2c1172fe1b86d6 wxWidgets-3.1.2-docs-chm.zip + 393f6bca6c5c4fc178a9312fae5bddc04233b7bb wxWidgets-3.1.2-docs-html.tar.bz2 + e51475ec38628b7080af01963bbf43f2151121c8 wxWidgets-3.1.2-docs-html.zip + e6335af2fc8c9058d442bbb7ef456c3c5594e7fe wxWidgets-3.1.2-headers.7z + 0737ccc29f8d625496e425cb7d0ff8207343609b wxWidgets-3.1.2.7z + 29cbbba946d2a7b4d28ca1db12315810cc8de74d wxWidgets-3.1.2.tar.bz2 + ec7114242f2df2706bb90bd76fa3b79f83f1b05d wxWidgets-3.1.2.zip ## Binaries From edbee125f954d31529578f1306589a1533b70bd0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 16:55:42 +0100 Subject: [PATCH 052/553] Slightly improve instructions for updating docs/release.md It makes more sense to update it manually once and then run the script rather than partially updating it manually first, then updating it again and then running the script. --- docs/contributing/how-to-release.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/contributing/how-to-release.md b/docs/contributing/how-to-release.md index 18d59664f8..780396db92 100644 --- a/docs/contributing/how-to-release.md +++ b/docs/contributing/how-to-release.md @@ -51,7 +51,7 @@ and then run it using the new DLLs. automatically, but please also review and update the contents of the README and announcement text. * Update `docs/readme.txt`: version needs to be changed, content updated. - * Update `docs/release.md`: the release sha1sums should be set to zeroes. + * Update `docs/release.md`: also version and reset SHA-1 sums to zeroes. * Put a date on the release line in `docs/changes.txt`. * Update the date in the manual (`docs/doxygen/mainpages/manual.h`). * Update the release announcement post in `docs/publicity/announce.txt`. @@ -91,10 +91,9 @@ ensure you have the appropriate tag or commit checked out. and copy/move it to the same directory. -5. Update the version in `docs/release.md` (typically just a global search and - replace) and run `./build/tools/post-release.sh` to update the sha1sums in - it, then commit the changes. Notice that when making an RC, the version must - be explicitly specified on this script command line. +5. Run `./build/tools/post-release.sh` to update the SHA-1 sums in + `docs/release.md`, then commit the changes. Notice that when making an RC, + the version must be explicitly specified on this script command line. ## Uploading From dfec7aa0c08617ed61fc1ee04551aea19dc6abd0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 01:01:49 +0100 Subject: [PATCH 053/553] Make disabling the window before creating it actually work Disabling a window before actually creating it ought to work, similarly to hiding a window before creating it which can be used to avoid showing the window on screen at all, even briefly. However it didn't under MSW where the window was disabled from wxWidgets point of view, but not at the MSW level. Fix this by accounting for the enabled state in MSWGetStyle(). Closes #16385. --- docs/changes.txt | 8 ++++++++ src/msw/window.cpp | 3 +++ tests/controls/buttontest.cpp | 17 +++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index ea37991c44..5ce2c6c4c2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -102,6 +102,14 @@ Changes in behaviour which may result in build errors removing its name. +3.1.?: (released 2012-??-??) +---------------------------- + +All (GUI): + +- Make disabling the window before creating it actually work. + + 3.1.2: (released 2018-12-10) ---------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index e17b851b59..609f6e8c19 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1518,6 +1518,9 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const // wxTopLevelWindow) should remove WS_CHILD in their MSWGetStyle() WXDWORD style = WS_CHILD; + if ( !IsThisEnabled() ) + style |= WS_DISABLED; + // using this flag results in very significant reduction in flicker, // especially with controls inside the static boxes (as the interior of the // box is not redrawn twice), but sometimes results in redraw problems, so diff --git a/tests/controls/buttontest.cpp b/tests/controls/buttontest.cpp index 764de5b28e..4f84523828 100644 --- a/tests/controls/buttontest.cpp +++ b/tests/controls/buttontest.cpp @@ -102,8 +102,21 @@ void ButtonTestCase::Disabled() wxUIActionSimulator sim; - //In this test we disable the button and check events are not sent - m_button->Disable(); + // In this test we disable the button and check events are not sent and we + // do it once by disabling the previously enabled button and once by + // creating the button in the disabled state. + SECTION("Disable after creation") + { + m_button->Disable(); + } + + SECTION("Create disabled") + { + delete m_button; + m_button = new wxButton(); + m_button->Disable(); + m_button->Create(wxTheApp->GetTopWindow(), wxID_ANY, "wxButton"); + } sim.MouseMove(m_button->GetScreenPosition() + wxPoint(10, 10)); wxYield(); From 5ba1ba1162b51a838f4fe2cbfae6b7bdff583ce6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 01:15:08 +0100 Subject: [PATCH 054/553] Fix creating disabled windows in wxGTK too Don't forbid calling Enable() before creating the window and just do nothing in this case and do disable the window when it's actually created if it's supposed to be disabled. Note that this doesn't work for classes overriding Enable() directly, such as wxButton or wxCheckBox, currently. --- src/gtk/window.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index e440422ab7..32340aaa62 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2913,6 +2913,11 @@ void wxWindowGTK::PostCreation() SetLayoutDirection(wxLayout_Default); + // if the window had been disabled before being created, it should be + // created in the initially disabled state + if ( !m_isEnabled ) + DoEnable(false); + // unless the window was created initially hidden (i.e. Hide() had been // called before Create()), we should show it at GTK+ level as well if (m_isShown) @@ -4196,7 +4201,12 @@ bool wxWindowGTK::IsShown() const void wxWindowGTK::DoEnable( bool enable ) { - wxCHECK_RET( (m_widget != NULL), wxT("invalid window") ); + if ( !m_widget ) + { + // The window can be disabled before being created, so just don't do + // anything in this case and, in particular, don't assert. + return; + } gtk_widget_set_sensitive( m_widget, enable ); if (m_wxwindow && (m_wxwindow != m_widget)) From 96f3832d52e3c6bfd1fd351d2fdbabc6c48a19e8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 01:31:43 +0100 Subject: [PATCH 055/553] Override DoEnable() instead of Enable() in wxGTK controls This is slightly simpler, as it doesn't require checking whether the control state really changes or not (it always does if DoEnable() is called) and allows disabling the controls before creating them, e.g. code like wxButton* const b = new wxButton(); b->Disable(); b->Create(this, wxID_OK); works as expected now instead of spewing GTK+ errors. --- include/wx/gtk/anybutton.h | 4 ++-- include/wx/gtk/checkbox.h | 3 ++- include/wx/gtk/radiobox.h | 2 ++ include/wx/gtk/radiobut.h | 3 ++- include/wx/gtk/spinbutt.h | 4 ++-- include/wx/gtk/textctrl.h | 3 ++- src/gtk/anybutton.cpp | 11 ++++++----- src/gtk/checkbox.cpp | 10 +++++----- src/gtk/radiobox.cpp | 16 ++++++++++++---- src/gtk/radiobut.cpp | 10 +++++----- src/gtk/spinbutt.cpp | 10 +++++----- src/gtk/textctrl.cpp | 13 +++++-------- 12 files changed, 50 insertions(+), 39 deletions(-) diff --git a/include/wx/gtk/anybutton.h b/include/wx/gtk/anybutton.h index ad0357a659..0b149ec085 100644 --- a/include/wx/gtk/anybutton.h +++ b/include/wx/gtk/anybutton.h @@ -23,8 +23,6 @@ public: m_isPressed = false; } - virtual bool Enable( bool enable = true ) wxOVERRIDE; - // implementation // -------------- @@ -41,6 +39,8 @@ public: protected: virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE; + virtual void DoEnable(bool enable) wxOVERRIDE; + virtual wxBitmap DoGetBitmap(State which) const wxOVERRIDE; virtual void DoSetBitmap(const wxBitmap& bitmap, State which) wxOVERRIDE; virtual void DoSetBitmapPosition(wxDirection dir) wxOVERRIDE; diff --git a/include/wx/gtk/checkbox.h b/include/wx/gtk/checkbox.h index 8068f0b556..e16bc4f3ff 100644 --- a/include/wx/gtk/checkbox.h +++ b/include/wx/gtk/checkbox.h @@ -39,7 +39,6 @@ public: bool GetValue() const wxOVERRIDE; virtual void SetLabel( const wxString& label ) wxOVERRIDE; - virtual bool Enable( bool enable = true ) wxOVERRIDE; static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); @@ -52,6 +51,8 @@ protected: virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE; virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE; + virtual void DoEnable(bool enable) wxOVERRIDE; + void DoSet3StateValue(wxCheckBoxState state) wxOVERRIDE; wxCheckBoxState DoGet3StateValue() const wxOVERRIDE; diff --git a/include/wx/gtk/radiobox.h b/include/wx/gtk/radiobox.h index 9e7df61a93..f38f82a599 100644 --- a/include/wx/gtk/radiobox.h +++ b/include/wx/gtk/radiobox.h @@ -141,6 +141,8 @@ protected: virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE; virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE; + virtual void DoEnable(bool enable) wxOVERRIDE; + virtual bool GTKNeedsToFilterSameWindowFocus() const wxOVERRIDE { return true; } virtual bool GTKWidgetNeedsMnemonic() const wxOVERRIDE; diff --git a/include/wx/gtk/radiobut.h b/include/wx/gtk/radiobut.h index 340c671c1e..7ef6a6a162 100644 --- a/include/wx/gtk/radiobut.h +++ b/include/wx/gtk/radiobut.h @@ -41,7 +41,6 @@ public: virtual void SetLabel(const wxString& label) wxOVERRIDE; virtual void SetValue(bool val); virtual bool GetValue() const; - virtual bool Enable( bool enable = true ) wxOVERRIDE; static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); @@ -52,6 +51,8 @@ protected: virtual void DoApplyWidgetStyle(GtkRcStyle *style) wxOVERRIDE; virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE; + virtual void DoEnable(bool enable) wxOVERRIDE; + private: typedef wxControl base_type; diff --git a/include/wx/gtk/spinbutt.h b/include/wx/gtk/spinbutt.h index ae974200b7..437198173c 100644 --- a/include/wx/gtk/spinbutt.h +++ b/include/wx/gtk/spinbutt.h @@ -44,8 +44,6 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - virtual bool Enable( bool enable = true ) wxOVERRIDE; - // implementation int m_pos; @@ -56,6 +54,8 @@ protected: virtual wxSize DoGetBestSize() const wxOVERRIDE; virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE; + virtual void DoEnable(bool enable) wxOVERRIDE; + private: typedef wxSpinButtonBase base_type; diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h index f27d38cfa7..d411188a66 100644 --- a/include/wx/gtk/textctrl.h +++ b/include/wx/gtk/textctrl.h @@ -95,7 +95,6 @@ public: // Overridden wxWindow methods virtual void SetWindowStyleFlag( long style ) wxOVERRIDE; - virtual bool Enable( bool enable = true ) wxOVERRIDE; // Implementation from now on void OnDropFiles( wxDropFilesEvent &event ); @@ -178,6 +177,8 @@ protected: private: void Init(); + virtual void DoEnable(bool enable) wxOVERRIDE; + // overridden wxTextEntry virtual methods virtual GtkEditable *GetEditable() const wxOVERRIDE; virtual GtkEntry *GetEntry() const wxOVERRIDE; diff --git a/src/gtk/anybutton.cpp b/src/gtk/anybutton.cpp index 0742eed15f..9859016a37 100644 --- a/src/gtk/anybutton.cpp +++ b/src/gtk/anybutton.cpp @@ -69,10 +69,13 @@ wxgtk_button_released_callback(GtkWidget *WXUNUSED(widget), wxAnyButton *button) // wxAnyButton //----------------------------------------------------------------------------- -bool wxAnyButton::Enable( bool enable ) +void wxAnyButton::DoEnable(bool enable) { - if (!base_type::Enable(enable)) - return false; + // See wxWindow::DoEnable() + if ( !m_widget ) + return; + + base_type::DoEnable(enable); gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(m_widget)), enable); @@ -80,8 +83,6 @@ bool wxAnyButton::Enable( bool enable ) GTKFixSensitivity(); GTKUpdateBitmap(); - - return true; } GdkWindow *wxAnyButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index 401f94358d..d11c7ef205 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -222,17 +222,17 @@ void wxCheckBox::SetLabel( const wxString& label ) GTKSetLabelForLabel(GTK_LABEL(m_widgetLabel), label); } -bool wxCheckBox::Enable( bool enable ) +void wxCheckBox::DoEnable(bool enable) { - if (!base_type::Enable(enable)) - return false; + if ( !m_widgetLabel ) + return; + + base_type::DoEnable(enable); gtk_widget_set_sensitive( m_widgetLabel, enable ); if (enable) GTKFixSensitivity(); - - return true; } void wxCheckBox::DoApplyWidgetStyle(GtkRcStyle *style) diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index b75e127ecd..c93fde74d2 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -487,8 +487,18 @@ void wxRadioBox::SetString(unsigned int item, const wxString& label) bool wxRadioBox::Enable( bool enable ) { - if ( !wxControl::Enable( enable ) ) - return false; + // Explicitly forward to the base class just because we need to override + // this function to prevent it from being hidden by Enable(int, bool) + // overload. + return wxControl::Enable(enable); +} + +void wxRadioBox::DoEnable(bool enable) +{ + if ( !m_widget ) + return; + + wxControl::DoEnable(enable); wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst(); while (node) @@ -503,8 +513,6 @@ bool wxRadioBox::Enable( bool enable ) if (enable) GTKFixSensitivity(); - - return true; } bool wxRadioBox::Enable(unsigned int item, bool enable) diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp index 9b87a178ad..b77a52cdd6 100644 --- a/src/gtk/radiobut.cpp +++ b/src/gtk/radiobut.cpp @@ -149,17 +149,17 @@ bool wxRadioButton::GetValue() const return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_widget)) != 0; } -bool wxRadioButton::Enable( bool enable ) +void wxRadioButton::DoEnable(bool enable) { - if (!base_type::Enable(enable)) - return false; + if ( !m_widget ) + return; + + base_type::DoEnable(enable); gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(m_widget)), enable); if (enable) GTKFixSensitivity(); - - return true; } void wxRadioButton::DoApplyWidgetStyle(GtkRcStyle *style) diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp index a0a3ebef55..56f86fb1f0 100644 --- a/src/gtk/spinbutt.cpp +++ b/src/gtk/spinbutt.cpp @@ -173,16 +173,16 @@ void wxSpinButton::SetRange(int minVal, int maxVal) GtkEnableEvents(); } -bool wxSpinButton::Enable( bool enable ) +void wxSpinButton::DoEnable(bool enable) { - if (!base_type::Enable(enable)) - return false; + if ( !m_widget ) + return; + + base_type::DoEnable(enable); // Work around lack of visual update when enabling if (enable) GTKFixSensitivity(false /* fix even if not under mouse */); - - return true; } void wxSpinButton::GtkDisableEvents() const diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index b8551d37c7..fe47602ac6 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1350,17 +1350,14 @@ void wxTextCtrl::SetEditable( bool editable ) } } -bool wxTextCtrl::Enable( bool enable ) +void wxTextCtrl::DoEnable(bool enable) { - if (!wxWindowBase::Enable(enable)) - { - // nothing to do - return false; - } + if ( !m_text ) + return; + + wxTextCtrlBase::DoEnable(enable); gtk_widget_set_sensitive( m_text, enable ); - - return true; } void wxTextCtrl::MarkDirty() From 0de31f03a1ad63f8b779c8a85a8ffc08ee57714f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Dec 2018 01:48:49 +0100 Subject: [PATCH 056/553] Document that Enable() can be called before creating the window Explicitly mention that calling Enable() for a window which hasn't been created yet is allowed. --- interface/wx/window.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/wx/window.h b/interface/wx/window.h index 97184e1c28..64b3c1d58d 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -2834,6 +2834,14 @@ public: disabled, all of its children are disabled as well and they are reenabled again when the parent is. + A window can be created initially disabled by calling this method on it + @e before calling Create() to create the actual underlying window, e.g. + @code + wxWindow* w = new MyWindow(); // Note: default ctor is used here. + w->Enable(false); + w->Create(parent, ... all the usual non-default ctor arguments ...); + @endcode + @param enable If @true, enables the window for input. If @false, disables the window. From 1f0e32e48562110029df44328e5138d79c0805fb Mon Sep 17 00:00:00 2001 From: jensgoe Date: Mon, 10 Dec 2018 00:14:15 +0100 Subject: [PATCH 057/553] fixed handling of NULL items --- src/generic/datavgen.cpp | 167 ++++++++++++--------------------------- 1 file changed, 50 insertions(+), 117 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 471ac78fc6..b5e37120d8 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -710,6 +710,7 @@ public: bool Cleared(); void Resort() { + m_rowHeightCache->Clear(); if (!IsVirtualList()) { m_root->Resort(this); @@ -822,6 +823,7 @@ public: int GetLineStart( unsigned int row ) const; // row * m_lineHeight in fixed mode int GetLineHeight( unsigned int row ) const; // m_lineHeight in fixed mode int GetLineAt( unsigned int y ) const; // y / m_lineHeight in fixed mode + int QueryAndCacheLineHeight(unsigned int row, wxDataViewItem item) const; void SetRowHeight( int lineHeight ) { m_lineHeight = lineHeight; } int GetRowHeight() const { return m_lineHeight; } @@ -3344,60 +3346,29 @@ wxRect wxDataViewMainWindow::GetLinesRect( unsigned int rowFrom, unsigned int ro int wxDataViewMainWindow::GetLineStart( unsigned int row ) const { - const wxDataViewModel *model = GetModel(); - if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) { int start = 0; - if (m_rowHeightCache->GetLineStart(row, start)) + if ( m_rowHeightCache->GetLineStart(row, start) ) return start; unsigned int r; for (r = 0; r < row; r++) { int height = 0; - if (m_rowHeightCache->GetLineHeight(r, height)) + if ( m_rowHeightCache->GetLineHeight(r, height) ) { start += height; continue; } - wxDataViewItem item; - if (IsList()) - { - item = GetItemByRow(r); - } - else - { - const wxDataViewTreeNode* node = GetTreeNodeByRow(r); - if (!node) return start; - item = node->GetItem(); - } + wxDataViewItem item = GetItemByRow(r); + if ( !item ) + break; - unsigned int cols = GetOwner()->GetColumnCount(); - unsigned int col; - height = m_lineHeight; - for (col = 0; col < cols; col++) - { - const wxDataViewColumn *column = GetOwner()->GetColumn(col); - if (column->IsHidden()) - continue; // skip it! - - if ((col != 0) && - model->IsContainer(item) && - !model->HasContainerColumns(item)) - continue; // skip it! - - wxDataViewRenderer *renderer = - const_cast(column->GetRenderer()); - renderer->PrepareForItem(model, item, column->GetModelColumn()); - - height = wxMax( height, renderer->GetSize().y ); - } + height = QueryAndCacheLineHeight(r, item); start += height; - - m_rowHeightCache->Put(r, height); } return start; @@ -3410,8 +3381,6 @@ int wxDataViewMainWindow::GetLineStart( unsigned int row ) const int wxDataViewMainWindow::GetLineAt( unsigned int y ) const { - const wxDataViewModel *model = GetModel(); - // check for the easy case first if ( !GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) ) return y / m_lineHeight; @@ -3419,55 +3388,21 @@ int wxDataViewMainWindow::GetLineAt( unsigned int y ) const unsigned int row = 0; unsigned int yy = 0; - if (m_rowHeightCache->GetLineAt(y, row)) + if ( m_rowHeightCache->GetLineAt(y, row) ) return row; for (;;) { int height = 0; - if (!m_rowHeightCache->GetLineHeight(row, height)) + if ( !m_rowHeightCache->GetLineHeight(row, height) ) { // row height not in cache -> get it from the renderer... - wxDataViewItem item; - if (IsList()) - { - item = GetItemByRow(row); - } - else - { - const wxDataViewTreeNode* node = GetTreeNodeByRow(row); - if (!node) - { - // not really correct... - return row + ((y-yy) / m_lineHeight); - } - item = node->GetItem(); - } + wxDataViewItem item = GetItemByRow(row); + if ( !item ) + return row; // should be the last row - unsigned int cols = GetOwner()->GetColumnCount(); - unsigned int col; - height = m_lineHeight; - for (col = 0; col < cols; col++) - { - const wxDataViewColumn *column = GetOwner()->GetColumn(col); - if (column->IsHidden()) - continue; // skip it! - - if ((col != 0) && - model->IsContainer(item) && - !model->HasContainerColumns(item)) - continue; // skip it! - - wxDataViewRenderer *renderer = - const_cast(column->GetRenderer()); - renderer->PrepareForItem(model, item, column->GetModelColumn()); - - height = wxMax( height, renderer->GetSize().y ); - } - - // ... and store the height in the cache - m_rowHeightCache->Put(row, height); + height = QueryAndCacheLineHeight(row, item); } yy += height; @@ -3480,50 +3415,17 @@ int wxDataViewMainWindow::GetLineAt( unsigned int y ) const int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const { - const wxDataViewModel *model = GetModel(); - if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) { int height = 0; - if (m_rowHeightCache->GetLineHeight(row, height)) + if ( m_rowHeightCache->GetLineHeight(row, height) ) return height; - wxDataViewItem item; - if (IsList()) - { - item = GetItemByRow(row); - } - else - { - const wxDataViewTreeNode* node = GetTreeNodeByRow(row); - // wxASSERT( node ); - if (!node) return m_lineHeight; - item = node->GetItem(); - } - - height = m_lineHeight; - unsigned int cols = GetOwner()->GetColumnCount(); - unsigned int col; - for (col = 0; col < cols; col++) - { - const wxDataViewColumn *column = GetOwner()->GetColumn(col); - if (column->IsHidden()) - continue; // skip it! - - if ((col != 0) && - model->IsContainer(item) && - !model->HasContainerColumns(item)) - continue; // skip it! - - wxDataViewRenderer *renderer = - const_cast(column->GetRenderer()); - renderer->PrepareForItem(model, item, column->GetModelColumn()); - - height = wxMax( height, renderer->GetSize().y ); - } - - m_rowHeightCache->Put(row, height); + wxDataViewItem item = GetItemByRow(row); + if ( !item ) + return m_lineHeight; + height = QueryAndCacheLineHeight(row, item); return height; } else @@ -3533,6 +3435,37 @@ int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const } +int wxDataViewMainWindow::QueryAndCacheLineHeight(unsigned int row, wxDataViewItem item) const +{ + const wxDataViewModel *model = GetModel(); + int height = m_lineHeight; + unsigned int cols = GetOwner()->GetColumnCount(); + unsigned int col; + for (col = 0; col < cols; col++) + { + const wxDataViewColumn *column = GetOwner()->GetColumn(col); + if (column->IsHidden()) + continue; // skip it! + + if ((col != 0) && + model->IsContainer(item) && + !model->HasContainerColumns(item)) + continue; // skip it! + + wxDataViewRenderer *renderer = + const_cast(column->GetRenderer()); + renderer->PrepareForItem(model, item, column->GetModelColumn()); + + height = wxMax(height, renderer->GetSize().y); + } + + // ... and store the height in the cache + m_rowHeightCache->Put(row, height); + + return height; +} + + class RowToTreeNodeJob: public DoJob { public: From d8a41187eda8ff47baab5e1a6d1ec3e189973ece Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Dec 2018 18:35:48 +0100 Subject: [PATCH 058/553] Update "How to make releases" instructions Remove update steps for wxBlog (because it's redundant with the news post on www.wxwidgets.org now that both are hosted at the same site), Google+ (because of its extinction) and Buildbot (because we're going to stop using it soon anyhow). Add a step for updating the list of compilers used for building binaries. --- docs/contributing/how-to-release.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/docs/contributing/how-to-release.md b/docs/contributing/how-to-release.md index 780396db92..03531fe6d0 100644 --- a/docs/contributing/how-to-release.md +++ b/docs/contributing/how-to-release.md @@ -120,28 +120,23 @@ Update https://www.wxwidgets.org: * Update release information (at least `version` and `released`) in `_data/relases.yml`. * Download information can then be updated by running `update_release_info.rb`. This will update the asset information from GitHub. +* Update the list of compilers used for making MSW binaries in + `downloads/index.md` if necessary (note that there is no need to update + anything else, the page will dynamically show the release files with the + specified prefixes). * Add a news item. Usually a news item is enough but something more can be called for for major releases Post `docs/publicity/announce.txt` at least to wx-announce@googlegroups.com and to wx-users. -Submit a link to https://www.reddit.com/r/programming +Submit a link to https://www.reddit.com/r/cpp or r/programming (depending on +the release importance). -Submit to https://isocpp.org/blog/suggest +Submit to https://isocpp.org/blog/suggest (need to be logged in to do it). For major releases, submit the announcement to https://slashdot.org/submission -Modify the links at downloads/index.html to point to the new release. Also -update the release date on this page. - -Also update docs/index.htm for the minor or major (i.e. not micro) releases. - -Post to wxBlog if necessary. - -Create a new post on our official Google+ page here: -https://plus.google.com/+wxwidgets/ (contact Bryan for access) - ## Version Updates Trac: mark the milestone corresponding to the release as completed and add a @@ -156,9 +151,6 @@ with x.y.z+1 (minor or major versions updates require manual intervention) and rerun both `bakefile_gen` and `autoconf` afterwards to update the version in the generated files too. -Update `master.cfg` in [wx/buildbot](https://github.com/wxWidgets/buildbot) -repository after a minor or major version change. - ## MSW Visual Studio Official Builds To build official x86 and x64 shared binaries the following are prerequisites: From c0cb5cacd9632895ec736a1a6e002b685a8233fe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Dec 2018 18:41:54 +0100 Subject: [PATCH 059/553] Don't try updating version in non-existent docs/msw/install.txt This file doesn't exist any more and install.md which replaced it doesn't contain any references to the version. --- docs/contributing/about-version-numbers.md | 1 - misc/scripts/inc_release | 3 --- 2 files changed, 4 deletions(-) diff --git a/docs/contributing/about-version-numbers.md b/docs/contributing/about-version-numbers.md index c2dc21b184..7c6ea11aa1 100644 --- a/docs/contributing/about-version-numbers.md +++ b/docs/contributing/about-version-numbers.md @@ -23,7 +23,6 @@ Here is the list of files that need to be updated: docs/readme.txt (date needs manual editing) [NOT UPDATED AUTOMATICALLY] docs/doxygen/Doxyfile (PROJECT_NUMBER and DOCSET_FEEDNAME) docs/doxygen/mainpages/manual.h (just date) [NOT UPDATED AUTOMATICALLY] - docs/msw/install.txt {major release only} include/wx/version.h include/wx/osx/config_xcode.h samples/docview/Info.plist diff --git a/misc/scripts/inc_release b/misc/scripts/inc_release index 4a81ad9d91..00bd8eee95 100755 --- a/misc/scripts/inc_release +++ b/misc/scripts/inc_release @@ -83,9 +83,6 @@ run_sed docs/readme.txt \ "/\//s/$ver_for_sed/$ver_string_new/" \ "/naming: while/s/$ver_for_sed/$ver_string_new/" -run_sed docs/msw/install.txt \ - "/^wxWidgets\/releases\//s/$ver_for_sed/$ver_string_new/" - run_sed docs/doxygen/Doxyfile \ "/^PROJECT_NUMBER/s/$ver_for_sed/$ver_string_new/" From e1185d8bf0785e7d152d2554f5bddae741daaa02 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Dec 2018 18:43:43 +0100 Subject: [PATCH 060/553] Increment version number to 3.1.3 Done by running misc/scripts/inc_release, manually updating version.bkl, rebaking and rerunning autoconf. --- Makefile.in | 16 ++++++------ build/bakefiles/version.bkl | 2 +- build/msw/makefile.bcc | 4 +-- build/msw/makefile.gcc | 4 +-- build/msw/makefile.vc | 4 +-- build/msw/wx_setup.props | 2 +- build/msw/wx_vc7_adv.vcproj | 16 ++++++------ build/msw/wx_vc7_aui.vcproj | 16 ++++++------ build/msw/wx_vc7_base.vcproj | 16 ++++++------ build/msw/wx_vc7_core.vcproj | 16 ++++++------ build/msw/wx_vc7_gl.vcproj | 16 ++++++------ build/msw/wx_vc7_html.vcproj | 16 ++++++------ build/msw/wx_vc7_media.vcproj | 16 ++++++------ build/msw/wx_vc7_net.vcproj | 16 ++++++------ build/msw/wx_vc7_propgrid.vcproj | 16 ++++++------ build/msw/wx_vc7_qa.vcproj | 16 ++++++------ build/msw/wx_vc7_ribbon.vcproj | 16 ++++++------ build/msw/wx_vc7_richtext.vcproj | 16 ++++++------ build/msw/wx_vc7_stc.vcproj | 16 ++++++------ build/msw/wx_vc7_webview.vcproj | 16 ++++++------ build/msw/wx_vc7_xml.vcproj | 16 ++++++------ build/msw/wx_vc7_xrc.vcproj | 16 ++++++------ build/msw/wx_vc8_adv.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_aui.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_base.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_core.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_gl.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_html.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_media.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_net.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_propgrid.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_qa.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_ribbon.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_richtext.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_stc.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_webview.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_xml.vcproj | 32 ++++++++++++------------ build/msw/wx_vc8_xrc.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_adv.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_aui.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_base.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_core.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_gl.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_html.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_media.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_net.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_propgrid.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_qa.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_ribbon.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_richtext.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_stc.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_webview.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_xml.vcproj | 32 ++++++++++++------------ build/msw/wx_vc9_xrc.vcproj | 32 ++++++++++++------------ build/osx/wxvers.xcconfig | 2 +- build/tools/msvs/getversion.bat | 2 +- configure | 20 +++++++-------- configure.in | 4 +-- demos/bombs/Makefile.in | 2 +- demos/forty/Makefile.in | 2 +- demos/fractal/Makefile.in | 2 +- demos/life/Makefile.in | 2 +- demos/poem/Makefile.in | 2 +- docs/doxygen/Doxyfile | 2 +- docs/readme.txt | 8 +++--- include/wx/osx/config_xcode.h | 4 +-- include/wx/version.h | 4 +-- samples/access/Makefile.in | 2 +- samples/animate/Makefile.in | 2 +- samples/artprov/Makefile.in | 2 +- samples/aui/Makefile.in | 2 +- samples/calendar/Makefile.in | 2 +- samples/caret/Makefile.in | 2 +- samples/clipboard/Makefile.in | 2 +- samples/collpane/Makefile.in | 2 +- samples/combo/Makefile.in | 2 +- samples/config/Makefile.in | 2 +- samples/dataview/Makefile.in | 2 +- samples/debugrpt/Makefile.in | 2 +- samples/dialogs/Makefile.in | 8 +++--- samples/dialup/Makefile.in | 2 +- samples/display/Makefile.in | 2 +- samples/dll/Makefile.in | 2 +- samples/dnd/Makefile.in | 2 +- samples/docview/Info.plist | 8 +++--- samples/docview/Makefile.in | 2 +- samples/dragimag/Makefile.in | 2 +- samples/drawing/Makefile.in | 2 +- samples/erase/Makefile.in | 2 +- samples/event/Makefile.in | 2 +- samples/except/Makefile.in | 2 +- samples/exec/Makefile.in | 2 +- samples/font/Makefile.in | 2 +- samples/fswatcher/Makefile.in | 2 +- samples/grid/Makefile.in | 2 +- samples/help/Makefile.in | 2 +- samples/htlbox/Makefile.in | 2 +- samples/html/about/Makefile.in | 2 +- samples/html/help/Makefile.in | 2 +- samples/html/helpview/Makefile.in | 2 +- samples/html/htmlctrl/Makefile.in | 2 +- samples/html/printing/Makefile.in | 2 +- samples/html/test/Makefile.in | 2 +- samples/html/virtual/Makefile.in | 2 +- samples/html/widget/Makefile.in | 2 +- samples/html/zip/Makefile.in | 2 +- samples/image/Makefile.in | 2 +- samples/internat/Makefile.in | 2 +- samples/ipc/Makefile.in | 2 +- samples/joytest/Makefile.in | 2 +- samples/keyboard/Makefile.in | 2 +- samples/layout/Makefile.in | 2 +- samples/listctrl/Makefile.in | 2 +- samples/mdi/Makefile.in | 2 +- samples/mediaplayer/Makefile.in | 2 +- samples/memcheck/Makefile.in | 2 +- samples/menu/Makefile.in | 2 +- samples/minimal/Info_cocoa.plist | 8 +++--- samples/minimal/Makefile.in | 2 +- samples/nativdlg/Makefile.in | 2 +- samples/notebook/Makefile.in | 2 +- samples/oleauto/Makefile.in | 2 +- samples/opengl/cube/Makefile.in | 2 +- samples/opengl/isosurf/Makefile.in | 2 +- samples/opengl/penguin/Makefile.in | 2 +- samples/opengl/pyramid/Makefile.in | 2 +- samples/ownerdrw/Makefile.in | 2 +- samples/popup/Makefile.in | 2 +- samples/power/Makefile.in | 2 +- samples/preferences/Makefile.in | 2 +- samples/printing/Makefile.in | 2 +- samples/propgrid/Makefile.in | 2 +- samples/regtest/Makefile.in | 2 +- samples/render/Makefile.in | 4 +-- samples/render/makefile.bcc | 2 +- samples/render/makefile.gcc | 2 +- samples/render/makefile.vc | 2 +- samples/render/render_vc7_renddll.vcproj | 12 ++++----- samples/render/render_vc8_renddll.vcproj | 24 +++++++++--------- samples/render/render_vc9_renddll.vcproj | 24 +++++++++--------- samples/ribbon/Makefile.in | 2 +- samples/richtext/Makefile.in | 2 +- samples/sashtest/Makefile.in | 2 +- samples/scroll/Makefile.in | 2 +- samples/shaped/Makefile.in | 2 +- samples/sockets/Makefile.in | 2 +- samples/sound/Makefile.in | 2 +- samples/splash/Makefile.in | 2 +- samples/splitter/Makefile.in | 2 +- samples/statbar/Makefile.in | 2 +- samples/stc/Makefile.in | 2 +- samples/svg/Makefile.in | 2 +- samples/taborder/Makefile.in | 2 +- samples/taskbar/Makefile.in | 2 +- samples/taskbarbutton/Makefile.in | 2 +- samples/text/Makefile.in | 2 +- samples/thread/Makefile.in | 2 +- samples/toolbar/Makefile.in | 2 +- samples/treectrl/Makefile.in | 2 +- samples/treelist/Makefile.in | 2 +- samples/typetest/Makefile.in | 2 +- samples/uiaction/Makefile.in | 2 +- samples/validate/Makefile.in | 2 +- samples/vscroll/Makefile.in | 2 +- samples/webview/Makefile.in | 2 +- samples/widgets/Makefile.in | 2 +- samples/wizard/Makefile.in | 2 +- samples/wrapsizer/Makefile.in | 2 +- samples/xrc/Makefile.in | 2 +- samples/xti/Makefile.in | 2 +- tests/Makefile.in | 2 +- tests/benchmarks/Makefile.in | 2 +- utils/helpview/src/Makefile.in | 2 +- utils/screenshotgen/src/Makefile.in | 2 +- 174 files changed, 828 insertions(+), 828 deletions(-) diff --git a/Makefile.in b/Makefile.in index e44bc57695..59f1e05acc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -74,8 +74,8 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 WX_RELEASE_NODOT = 31 -WX_VERSION = $(WX_RELEASE).2 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION = $(WX_RELEASE).3 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 LIBDIRNAME = $(wx_top_builddir)/lib WXREGEX_CFLAGS = -DNDEBUG -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(____SHARED) \ $(CPPFLAGS) $(CFLAGS) @@ -13678,17 +13678,17 @@ COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_HTML_1___htmldll_library_link_LIBR_0 \ @COND_USE_EXCEPTIONS_0@__EXCEPTIONS_DEFINE_p_65 = --define wxNO_EXCEPTIONS @COND_USE_RTTI_0@__RTTI_DEFINE_p_65 = --define wxNO_RTTI @COND_USE_THREADS_0@__THREAD_DEFINE_p_65 = --define wxNO_THREADS -@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@dll___targetsuf2 = .$(SO_SUFFIX).2 -@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@dll___targetsuf2 = .2.$(SO_SUFFIX) +@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@dll___targetsuf2 = .$(SO_SUFFIX).3 +@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@dll___targetsuf2 = .3.$(SO_SUFFIX) @COND_USE_SOVERSION_0@dll___targetsuf2 = .$(SO_SUFFIX) @COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@dll___targetsuf3 \ @COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@ = \ -@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@ .$(SO_SUFFIX).2.0.0 +@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@ .$(SO_SUFFIX).3.0.0 @COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@dll___targetsuf3 \ -@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@ = .2.0.0.$(SO_SUFFIX) -@COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1@dll___targetsuf3 = -2.$(SO_SUFFIX) +@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@ = .3.0.0.$(SO_SUFFIX) +@COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1@dll___targetsuf3 = -3.$(SO_SUFFIX) @COND_USE_SOVERSION_0@dll___targetsuf3 = .$(SO_SUFFIX) -@COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1@dll___targetsuf3 = .$(SO_SUFFIX).2 +@COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1@dll___targetsuf3 = .$(SO_SUFFIX).3 @COND_TOOLKIT_MSW@__RCDEFDIR_p = --include-dir \ @COND_TOOLKIT_MSW@ $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME) @COND_wxUSE_LIBTIFF_builtin@__INC_TIFF_BUILD_p_66 \ diff --git a/build/bakefiles/version.bkl b/build/bakefiles/version.bkl index 83efd1778b..87384325c7 100644 --- a/build/bakefiles/version.bkl +++ b/build/bakefiles/version.bkl @@ -22,7 +22,7 @@ 3. Else, i.e. if there were no changes at all to API but only internal changes, change C:R:A to C:R+1:A --> - 2 + 3 0 0 diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index 8112f30f89..61a863bb2b 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -38,7 +38,7 @@ MAKEARGS = -DCC="$(CC)" -DCXX="$(CXX)" -DCFLAGS="$(CFLAGS)" \ -DWX_FLAVOUR="$(WX_FLAVOUR)" -DWX_LIB_FLAVOUR="$(WX_LIB_FLAVOUR)" \ -DCFG="$(CFG)" -DRUNTIME_LIBS="$(RUNTIME_LIBS)" WX_RELEASE_NODOT = 31 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 COMPILER_PREFIX = bcc OBJS = \ $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) @@ -5563,7 +5563,7 @@ $(SETUPHDIR)\wx\msw\rcdefs.h: $(SETUPHDIR)\wx\msw ..\..\include\wx\msw\genrcdefs build_cfg_file: $(SETUPHDIR) @echo WXVER_MAJOR=3 >$(BUILD_CFG_FILE) @echo WXVER_MINOR=1 >>$(BUILD_CFG_FILE) - @echo WXVER_RELEASE=2 >>$(BUILD_CFG_FILE) + @echo WXVER_RELEASE=3 >>$(BUILD_CFG_FILE) @echo BUILD=$(BUILD) >>$(BUILD_CFG_FILE) @echo MONOLITHIC=$(MONOLITHIC) >>$(BUILD_CFG_FILE) @echo SHARED=$(SHARED) >>$(BUILD_CFG_FILE) diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index c6a2042c6b..792e88f599 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -32,7 +32,7 @@ MAKEARGS = LINK_DLL_FLAGS="$(LINK_DLL_FLAGS)" \ WINDRES="$(WINDRES)" CPPDEPS = -MT$@ -MF$@.d -MD -MP WX_RELEASE_NODOT = 31 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 COMPILER_PREFIX = gcc OBJS = \ $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) @@ -5745,7 +5745,7 @@ $(SETUPHDIR)\wx\msw\rcdefs.h: $(SETUPHDIR)\wx\msw ..\..\include\wx\msw\genrcdefs build_cfg_file: $(SETUPHDIR) @echo WXVER_MAJOR=3 >$(BUILD_CFG_FILE) @echo WXVER_MINOR=1 >>$(BUILD_CFG_FILE) - @echo WXVER_RELEASE=2 >>$(BUILD_CFG_FILE) + @echo WXVER_RELEASE=3 >>$(BUILD_CFG_FILE) @echo BUILD=$(BUILD) >>$(BUILD_CFG_FILE) @echo MONOLITHIC=$(MONOLITHIC) >>$(BUILD_CFG_FILE) @echo SHARED=$(SHARED) >>$(BUILD_CFG_FILE) diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index c1ce7f10bd..6b918dd50d 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -29,7 +29,7 @@ MAKEARGS = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \ WX_FLAVOUR="$(WX_FLAVOUR)" WX_LIB_FLAVOUR="$(WX_LIB_FLAVOUR)" CFG="$(CFG)" \ RUNTIME_LIBS="$(RUNTIME_LIBS)" WX_RELEASE_NODOT = 31 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 COMPILER_PREFIX = vc OBJS = \ $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)$(ARCH_SUFFIX) @@ -6272,7 +6272,7 @@ $(SETUPHDIR)\wx\msw\rcdefs.h: $(SETUPHDIR)\wx\msw ..\..\include\wx\msw\genrcdefs build_cfg_file: $(SETUPHDIR) @echo WXVER_MAJOR=3 >$(BUILD_CFG_FILE) @echo WXVER_MINOR=1 >>$(BUILD_CFG_FILE) - @echo WXVER_RELEASE=2 >>$(BUILD_CFG_FILE) + @echo WXVER_RELEASE=3 >>$(BUILD_CFG_FILE) @echo BUILD=$(BUILD) >>$(BUILD_CFG_FILE) @echo MONOLITHIC=$(MONOLITHIC) >>$(BUILD_CFG_FILE) @echo SHARED=$(SHARED) >>$(BUILD_CFG_FILE) diff --git a/build/msw/wx_setup.props b/build/msw/wx_setup.props index 2933d0052c..facf4a7e5b 100644 --- a/build/msw/wx_setup.props +++ b/build/msw/wx_setup.props @@ -1,7 +1,7 @@  - 312 + 313 31 msw vc diff --git a/build/msw/wx_vc7_adv.vcproj b/build/msw/wx_vc7_adv.vcproj index f1b0fa89cb..1a37048247 100644 --- a/build/msw/wx_vc7_adv.vcproj +++ b/build/msw/wx_vc7_adv.vcproj @@ -156,7 +156,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_advdll.pch" ObjectFile="vc_mswuddll\adv\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="TRUE" Detect64BitPortabilityProblems="TRUE" @@ -167,13 +167,13 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_adv.lib" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateDebugInformation="TRUE" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.pdb" TargetMachine="1"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,7 +254,7 @@ Name="VCPreLinkEventTool"/> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_adv_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_adv_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_advdll.pch" ObjectFile="vc_mswuddll_x64\adv\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_adv_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_adv_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_adv_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_adv_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_adv_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_aui.vcproj b/build/msw/wx_vc8_aui.vcproj index d0fb853e97..be68250504 100644 --- a/build/msw/wx_vc8_aui.vcproj +++ b/build/msw/wx_vc8_aui.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_auidll.pch" ObjectFile="vc_mswuddll\aui\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_aui_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_aui_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_aui_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_aui_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_aui_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_auidll.pch" ObjectFile="vc_mswuddll_x64\aui\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_aui_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_aui_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_aui_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_aui_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_aui_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_base.vcproj b/build/msw/wx_vc8_base.vcproj index cf9f52adfe..2ed24c6293 100644 --- a/build/msw/wx_vc8_base.vcproj +++ b/build/msw/wx_vc8_base.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_basedll.pch" ObjectFile="vc_mswuddll\base\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase312ud_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase313ud_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_dll\wxbase312ud_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313ud_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxbase31ud.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312ud_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313ud_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_dll\wxbase312u_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313u_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxbase31u.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312u_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313u_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_basedll.pch" ObjectFile="vc_mswuddll_x64\base\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase312ud_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase313ud_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312ud_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313ud_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31ud.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312ud_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313ud_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312u_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313u_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31u.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312u_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313u_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index b734aa02bd..701ec8da4e 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_coredll.pch" ObjectFile="vc_mswuddll\core\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_core_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_core_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_core_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_core_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_core_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_core_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_core_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_coredll.pch" ObjectFile="vc_mswuddll_x64\core\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_core_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_core_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_core_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_core_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_core_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_core_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_core_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_gl.vcproj b/build/msw/wx_vc8_gl.vcproj index aafbc68c01..59b6fceec4 100644 --- a/build/msw/wx_vc8_gl.vcproj +++ b/build/msw/wx_vc8_gl.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_gldll.pch" ObjectFile="vc_mswuddll\gl\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_gl_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31ud_core.lib wxbase31ud.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_gl_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_gl_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31u_core.lib wxbase31u.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_gl_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_gl_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_gldll.pch" ObjectFile="vc_mswuddll_x64\gl\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_gl_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31ud_core.lib wxbase31ud.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_gl_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_gl_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31u_core.lib wxbase31u.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_gl_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_gl_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_html.vcproj b/build/msw/wx_vc8_html.vcproj index 917a7418d9..9d4b4e4695 100644 --- a/build/msw/wx_vc8_html.vcproj +++ b/build/msw/wx_vc8_html.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_htmldll.pch" ObjectFile="vc_mswuddll\html\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_html_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_html_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_html_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_html_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_html_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_html_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_html_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_htmldll.pch" ObjectFile="vc_mswuddll_x64\html\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_html_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_html_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_html_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_html_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_html_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_html_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_html_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_media.vcproj b/build/msw/wx_vc8_media.vcproj index 06eebf66ce..d65e76f754 100644 --- a/build/msw/wx_vc8_media.vcproj +++ b/build/msw/wx_vc8_media.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_mediadll.pch" ObjectFile="vc_mswuddll\media\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_media_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_media_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_media_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_media_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_media_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_media_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_media_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_mediadll.pch" ObjectFile="vc_mswuddll_x64\media\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_media_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_media_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_media_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_media_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_media_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_media_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_media_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_net.vcproj b/build/msw/wx_vc8_net.vcproj index 31bf4accd3..1ceb1e9bf1 100644 --- a/build/msw/wx_vc8_net.vcproj +++ b/build/msw/wx_vc8_net.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_netdll.pch" ObjectFile="vc_mswuddll\net\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase313ud_net_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxbase312ud_net_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313ud_net_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxbase31ud_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313ud_net_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxbase312u_net_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313u_net_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxbase31u_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312u_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313u_net_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_netdll.pch" ObjectFile="vc_mswuddll_x64\net\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase313ud_net_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312ud_net_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313ud_net_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31ud_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313ud_net_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312u_net_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313u_net_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31u_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312u_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313u_net_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_propgrid.vcproj b/build/msw/wx_vc8_propgrid.vcproj index e91f29b651..25d48e09d0 100644 --- a/build/msw/wx_vc8_propgrid.vcproj +++ b/build/msw/wx_vc8_propgrid.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_propgriddll.pch" ObjectFile="vc_mswuddll\propgrid\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_propgrid_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_propgrid_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_propgrid_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_propgrid_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_propgrid_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_propgriddll.pch" ObjectFile="vc_mswuddll_x64\propgrid\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_propgrid_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_propgrid_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_propgrid_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_propgrid_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_propgrid_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_qa.vcproj b/build/msw/wx_vc8_qa.vcproj index 527643dd00..e181e0b8b5 100644 --- a/build/msw/wx_vc8_qa.vcproj +++ b/build/msw/wx_vc8_qa.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_qadll.pch" ObjectFile="vc_mswuddll\qa\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_qa_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib ..\..\lib\vc_dll\wxbase31ud_xml.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_qa_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_qa_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib ..\..\lib\vc_dll\wxbase31u_xml.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_qa_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_qa_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_qadll.pch" ObjectFile="vc_mswuddll_x64\qa\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_qa_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib ..\..\lib\vc_x64_dll\wxbase31ud_xml.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_qa_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_qa_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib ..\..\lib\vc_x64_dll\wxbase31u_xml.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_qa_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_qa_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_ribbon.vcproj b/build/msw/wx_vc8_ribbon.vcproj index c981557dfa..d1738d08e7 100644 --- a/build/msw/wx_vc8_ribbon.vcproj +++ b/build/msw/wx_vc8_ribbon.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_ribbondll.pch" ObjectFile="vc_mswuddll\ribbon\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_ribbon_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_ribbon_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_ribbon_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_ribbon_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_ribbon_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_ribbondll.pch" ObjectFile="vc_mswuddll_x64\ribbon\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_ribbon_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_ribbon_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_ribbon_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_ribbon_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_ribbon_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_richtext.vcproj b/build/msw/wx_vc8_richtext.vcproj index d7de7993dc..2417569b21 100644 --- a/build/msw/wx_vc8_richtext.vcproj +++ b/build/msw/wx_vc8_richtext.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_richtextdll.pch" ObjectFile="vc_mswuddll\richtext\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_richtext_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_html.lib ..\..\lib\vc_dll\wxbase31ud_xml.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_richtext_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_richtext_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_html.lib ..\..\lib\vc_dll\wxbase31u_xml.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_richtext_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_richtext_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_richtextdll.pch" ObjectFile="vc_mswuddll_x64\richtext\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_richtext_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_html.lib ..\..\lib\vc_x64_dll\wxbase31ud_xml.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_richtext_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_richtext_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_html.lib ..\..\lib\vc_x64_dll\wxbase31u_xml.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_richtext_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_richtext_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_stc.vcproj b/build/msw/wx_vc8_stc.vcproj index 45fdaee256..31b10dfd63 100644 --- a/build/msw/wx_vc8_stc.vcproj +++ b/build/msw/wx_vc8_stc.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_stcdll.pch" ObjectFile="vc_mswuddll\stc\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_stc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxscintillad.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_stc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_stc_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxscintilla.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_stc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_stc_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_stcdll.pch" ObjectFile="vc_mswuddll_x64\stc\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_stc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxscintillad.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_stc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_stc_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxscintilla.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_stc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_stc_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_webview.vcproj b/build/msw/wx_vc8_webview.vcproj index 6e191c3c4c..05673768c1 100644 --- a/build/msw/wx_vc8_webview.vcproj +++ b/build/msw/wx_vc8_webview.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_webviewdll.pch" ObjectFile="vc_mswuddll\webview\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_webview_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_webview_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_webview_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_webview_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_webview_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_webviewdll.pch" ObjectFile="vc_mswuddll_x64\webview\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_webview_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_webview_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_webview_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_webview_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_webview_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_xml.vcproj b/build/msw/wx_vc8_xml.vcproj index bc8f471460..9a8b394661 100644 --- a/build/msw/wx_vc8_xml.vcproj +++ b/build/msw/wx_vc8_xml.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_xmldll.pch" ObjectFile="vc_mswuddll\xml\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase313ud_xml_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxbase312ud_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313ud_xml_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxbase31ud_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313ud_xml_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxbase312u_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313u_xml_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxbase31u_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312u_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313u_xml_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_xmldll.pch" ObjectFile="vc_mswuddll_x64\xml\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase313ud_xml_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312ud_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313ud_xml_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31ud_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313ud_xml_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312u_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313u_xml_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31u_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312u_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313u_xml_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc8_xrc.vcproj b/build/msw/wx_vc8_xrc.vcproj index 763263fdf9..2c1facc1d1 100644 --- a/build/msw/wx_vc8_xrc.vcproj +++ b/build/msw/wx_vc8_xrc.vcproj @@ -232,7 +232,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_xrcdll.pch" ObjectFile="vc_mswuddll\xrc\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_xrc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -243,7 +243,7 @@ /> @@ -254,14 +254,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_html.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud_xml.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_xrc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_xrc_vc_custom.pdb" TargetMachine="1" /> @@ -345,14 +345,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_html.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u_xml.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_xrc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_xrc_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -586,7 +586,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_xrcdll.pch" ObjectFile="vc_mswuddll_x64\xrc\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_xrc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -597,7 +597,7 @@ /> @@ -608,14 +608,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_html.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud_xml.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_xrc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_xrc_vc_custom.pdb" TargetMachine="17" /> @@ -699,14 +699,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_html.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u_xml.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_xrc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_xrc_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_adv.vcproj b/build/msw/wx_vc9_adv.vcproj index e557c01b33..9383d38179 100644 --- a/build/msw/wx_vc9_adv.vcproj +++ b/build/msw/wx_vc9_adv.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_advdll.pch" ObjectFile="vc_mswuddll\adv\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_adv_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_adv_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_adv_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_advdll.pch" ObjectFile="vc_mswuddll_x64\adv\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_adv_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_adv_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_adv_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_adv_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_adv_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_adv.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_adv_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_adv_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_aui.vcproj b/build/msw/wx_vc9_aui.vcproj index 5fce5618fb..52ddd2d228 100644 --- a/build/msw/wx_vc9_aui.vcproj +++ b/build/msw/wx_vc9_aui.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_auidll.pch" ObjectFile="vc_mswuddll\aui\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_aui_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_aui_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_aui_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_aui_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_aui_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_auidll.pch" ObjectFile="vc_mswuddll_x64\aui\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_aui_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_aui_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_aui_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_aui_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_aui_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_aui.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_aui_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_aui_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_base.vcproj b/build/msw/wx_vc9_base.vcproj index 747fc6838a..c2ff20dcde 100644 --- a/build/msw/wx_vc9_base.vcproj +++ b/build/msw/wx_vc9_base.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_basedll.pch" ObjectFile="vc_mswuddll\base\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase312ud_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase313ud_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_dll\wxbase312ud_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313ud_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxbase31ud.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312ud_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313ud_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_dll\wxbase312u_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313u_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxbase31u.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312u_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313u_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_basedll.pch" ObjectFile="vc_mswuddll_x64\base\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase312ud_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase313ud_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312ud_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313ud_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31ud.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312ud_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313ud_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312u_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313u_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31u.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312u_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313u_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 0b33c64c19..c235625f90 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_coredll.pch" ObjectFile="vc_mswuddll\core\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_core_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_core_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_core_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_core_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_core_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_core_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_core_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_coredll.pch" ObjectFile="vc_mswuddll_x64\core\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_core_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_core_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_core_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_core_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_core_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_core_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_core.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_core_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_core_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_gl.vcproj b/build/msw/wx_vc9_gl.vcproj index 0e1953cda8..24a60e620f 100644 --- a/build/msw/wx_vc9_gl.vcproj +++ b/build/msw/wx_vc9_gl.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_gldll.pch" ObjectFile="vc_mswuddll\gl\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_gl_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31ud_core.lib wxbase31ud.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_gl_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_gl_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31u_core.lib wxbase31u.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_gl_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_gl_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_gldll.pch" ObjectFile="vc_mswuddll_x64\gl\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_gl_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31ud_core.lib wxbase31ud.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_gl_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_gl_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib wxmsw31u_core.lib wxbase31u.lib opengl32.lib glu32.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_gl_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_gl_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_gl.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_gl_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_gl_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_html.vcproj b/build/msw/wx_vc9_html.vcproj index f7db5c0beb..ec95e4ddfd 100644 --- a/build/msw/wx_vc9_html.vcproj +++ b/build/msw/wx_vc9_html.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_htmldll.pch" ObjectFile="vc_mswuddll\html\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_html_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_html_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_html_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_html_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_html_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_html_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_html_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_htmldll.pch" ObjectFile="vc_mswuddll_x64\html\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_html_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_html_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_html_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_html_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_html_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_html_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_html.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_html_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_html_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_media.vcproj b/build/msw/wx_vc9_media.vcproj index b8424ebec1..d67bbb15b3 100644 --- a/build/msw/wx_vc9_media.vcproj +++ b/build/msw/wx_vc9_media.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_mediadll.pch" ObjectFile="vc_mswuddll\media\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_media_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_media_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_media_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_media_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_media_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_media_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_media_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_mediadll.pch" ObjectFile="vc_mswuddll_x64\media\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_media_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_media_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_media_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_media_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_media_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_media_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_media.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_media_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_media_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_net.vcproj b/build/msw/wx_vc9_net.vcproj index f23b6ad85f..a9a35efbd9 100644 --- a/build/msw/wx_vc9_net.vcproj +++ b/build/msw/wx_vc9_net.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_netdll.pch" ObjectFile="vc_mswuddll\net\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase313ud_net_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxbase312ud_net_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313ud_net_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxbase31ud_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313ud_net_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxbase312u_net_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313u_net_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxbase31u_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312u_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313u_net_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_netdll.pch" ObjectFile="vc_mswuddll_x64\net\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase313ud_net_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312ud_net_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313ud_net_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31ud_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312ud_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313ud_net_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312u_net_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313u_net_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31u_net.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312u_net_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313u_net_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_propgrid.vcproj b/build/msw/wx_vc9_propgrid.vcproj index ac9cf34856..6e666de470 100644 --- a/build/msw/wx_vc9_propgrid.vcproj +++ b/build/msw/wx_vc9_propgrid.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_propgriddll.pch" ObjectFile="vc_mswuddll\propgrid\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_propgrid_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_propgrid_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_propgrid_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_propgrid_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_propgrid_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_propgriddll.pch" ObjectFile="vc_mswuddll_x64\propgrid\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_propgrid_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_propgrid_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_propgrid_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_propgrid_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_propgrid_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_propgrid.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_propgrid_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_propgrid_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_qa.vcproj b/build/msw/wx_vc9_qa.vcproj index e2b61a555c..ed0d965686 100644 --- a/build/msw/wx_vc9_qa.vcproj +++ b/build/msw/wx_vc9_qa.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_qadll.pch" ObjectFile="vc_mswuddll\qa\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_qa_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib ..\..\lib\vc_dll\wxbase31ud_xml.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_qa_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_qa_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib ..\..\lib\vc_dll\wxbase31u_xml.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_qa_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_qa_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_qadll.pch" ObjectFile="vc_mswuddll_x64\qa\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_qa_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib ..\..\lib\vc_x64_dll\wxbase31ud_xml.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_qa_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_qa_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib ..\..\lib\vc_x64_dll\wxbase31u_xml.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_qa_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_qa_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_qa.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_qa_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_qa_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_ribbon.vcproj b/build/msw/wx_vc9_ribbon.vcproj index 80048af5bd..b25892a82f 100644 --- a/build/msw/wx_vc9_ribbon.vcproj +++ b/build/msw/wx_vc9_ribbon.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_ribbondll.pch" ObjectFile="vc_mswuddll\ribbon\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_ribbon_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_ribbon_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_ribbon_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_ribbon_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_ribbon_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_ribbondll.pch" ObjectFile="vc_mswuddll_x64\ribbon\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_ribbon_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_ribbon_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_ribbon_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_ribbon_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_ribbon_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_ribbon.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_ribbon_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_ribbon_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_richtext.vcproj b/build/msw/wx_vc9_richtext.vcproj index ec1f74f5f5..1b53a5b687 100644 --- a/build/msw/wx_vc9_richtext.vcproj +++ b/build/msw/wx_vc9_richtext.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_richtextdll.pch" ObjectFile="vc_mswuddll\richtext\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_richtext_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_html.lib ..\..\lib\vc_dll\wxbase31ud_xml.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_richtext_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_richtext_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_html.lib ..\..\lib\vc_dll\wxbase31u_xml.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_richtext_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_richtext_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_richtextdll.pch" ObjectFile="vc_mswuddll_x64\richtext\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_richtext_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_html.lib ..\..\lib\vc_x64_dll\wxbase31ud_xml.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_richtext_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_richtext_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_html.lib ..\..\lib\vc_x64_dll\wxbase31u_xml.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_richtext_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_richtext_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_richtext.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_richtext_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_richtext_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_stc.vcproj b/build/msw/wx_vc9_stc.vcproj index 085a10c834..e571c75370 100644 --- a/build/msw/wx_vc9_stc.vcproj +++ b/build/msw/wx_vc9_stc.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_stcdll.pch" ObjectFile="vc_mswuddll\stc\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_stc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxscintillad.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_stc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_stc_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxscintilla.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_stc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_stc_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_stcdll.pch" ObjectFile="vc_mswuddll_x64\stc\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_stc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxscintillad.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_stc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_stc_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxscintilla.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_stc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_stc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_stc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_stc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_stc_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_webview.vcproj b/build/msw/wx_vc9_webview.vcproj index 47754d8067..5f7ef0245e 100644 --- a/build/msw/wx_vc9_webview.vcproj +++ b/build/msw/wx_vc9_webview.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_webviewdll.pch" ObjectFile="vc_mswuddll\webview\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_webview_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_webview_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_webview_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_webview_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_webview_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_webviewdll.pch" ObjectFile="vc_mswuddll_x64\webview\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_webview_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_webview_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_webview_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_webview_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_webview_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_webview.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_webview_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_webview_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_xml.vcproj b/build/msw/wx_vc9_xml.vcproj index bd305d4c9b..9689c27f66 100644 --- a/build/msw/wx_vc9_xml.vcproj +++ b/build/msw/wx_vc9_xml.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_xmldll.pch" ObjectFile="vc_mswuddll\xml\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxbase313ud_xml_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxbase312ud_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313ud_xml_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxbase31ud_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313ud_xml_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxbase312u_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxbase313u_xml_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxbase31u_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxbase312u_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxbase313u_xml_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_xmldll.pch" ObjectFile="vc_mswuddll_x64\xml\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxbase313ud_xml_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312ud_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313ud_xml_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31ud_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312ud_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313ud_xml_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxbase312u_xml_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxbase313u_xml_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxbase31u_xml.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase312u_xml_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxbase313u_xml_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/msw/wx_vc9_xrc.vcproj b/build/msw/wx_vc9_xrc.vcproj index fe14540933..80e1a0f154 100644 --- a/build/msw/wx_vc9_xrc.vcproj +++ b/build/msw/wx_vc9_xrc.vcproj @@ -231,7 +231,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll\wxprec_xrcdll.pch" ObjectFile="vc_mswuddll\xrc\" - ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_dll\wxmsw313ud_xrc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -241,7 +241,7 @@ /> @@ -252,14 +252,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31ud_html.lib ..\..\lib\vc_dll\wxmsw31ud_core.lib ..\..\lib\vc_dll\wxbase31ud_xml.lib ..\..\lib\vc_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312ud_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313ud_xrc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_dll\wxmsw31ud_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313ud_xrc_vc_custom.pdb" TargetMachine="1" /> @@ -343,14 +343,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_dll\wxmsw31u_html.lib ..\..\lib\vc_dll\wxmsw31u_core.lib ..\..\lib\vc_dll\wxbase31u_xml.lib ..\..\lib\vc_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_dll\wxmsw312u_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_dll\wxmsw313u_xrc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_dll\wxmsw31u_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw312u_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_dll\wxmsw313u_xrc_vc_custom.pdb" TargetMachine="1" OptimizeReferences="2" EnableCOMDATFolding="2" @@ -583,7 +583,7 @@ PrecompiledHeaderThrough="wx/wxprec.h" PrecompiledHeaderFile="vc_mswuddll_x64\wxprec_xrcdll.pch" ObjectFile="vc_mswuddll_x64\xrc\" - ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDataBaseFileName="..\..\lib\vc_x64_dll\wxmsw313ud_xrc_vc_custom.pdb" WarningLevel="4" SuppressStartupBanner="true" DebugInformationFormat="3" @@ -593,7 +593,7 @@ /> @@ -604,14 +604,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31ud_html.lib ..\..\lib\vc_x64_dll\wxmsw31ud_core.lib ..\..\lib\vc_x64_dll\wxbase31ud_xml.lib ..\..\lib\vc_x64_dll\wxbase31ud.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312ud_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313ud_xrc_vc_custom.dll" LinkIncremental="2" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31ud_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312ud_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313ud_xrc_vc_custom.pdb" TargetMachine="17" /> @@ -695,14 +695,14 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregexu.lib wxexpat.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib ..\..\lib\vc_x64_dll\wxmsw31u_html.lib ..\..\lib\vc_x64_dll\wxmsw31u_core.lib ..\..\lib\vc_x64_dll\wxbase31u_xml.lib ..\..\lib\vc_x64_dll\wxbase31u.lib" - OutputFile="..\..\lib\vc_x64_dll\wxmsw312u_xrc_vc_custom.dll" + OutputFile="..\..\lib\vc_x64_dll\wxmsw313u_xrc_vc_custom.dll" LinkIncremental="1" ImportLibrary="..\..\lib\vc_x64_dll\wxmsw31u_xrc.lib" SuppressStartupBanner="true" AdditionalLibraryDirectories="..\..\lib\vc_x64_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw312u_xrc_vc_custom.pdb" + ProgramDatabaseFile="..\..\lib\vc_x64_dll\wxmsw313u_xrc_vc_custom.pdb" TargetMachine="17" OptimizeReferences="2" EnableCOMDATFolding="2" diff --git a/build/osx/wxvers.xcconfig b/build/osx/wxvers.xcconfig index 2e4f173d30..61f0b5bd12 100644 --- a/build/osx/wxvers.xcconfig +++ b/build/osx/wxvers.xcconfig @@ -1,4 +1,4 @@ // update this file with new version numbers DYLIB_COMPATIBILITY_VERSION = 3.1 -DYLIB_CURRENT_VERSION = 3.1.2 +DYLIB_CURRENT_VERSION = 3.1.3 diff --git a/build/tools/msvs/getversion.bat b/build/tools/msvs/getversion.bat index 181acd8582..00440b353f 100644 --- a/build/tools/msvs/getversion.bat +++ b/build/tools/msvs/getversion.bat @@ -1,3 +1,3 @@ set wxMAJOR_VERSION=3 set wxMINOR_VERSION=1 -set wxRELEASE_NUMBER=2 +set wxRELEASE_NUMBER=3 diff --git a/configure b/configure index 18146f9527..031ff5c97b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for wxWidgets 3.1.2. +# Generated by GNU Autoconf 2.69 for wxWidgets 3.1.3. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='wxWidgets' PACKAGE_TARNAME='wxwidgets' -PACKAGE_VERSION='3.1.2' -PACKAGE_STRING='wxWidgets 3.1.2' +PACKAGE_VERSION='3.1.3' +PACKAGE_STRING='wxWidgets 3.1.3' PACKAGE_BUGREPORT='wx-dev@googlegroups.com' PACKAGE_URL='' @@ -1946,7 +1946,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures wxWidgets 3.1.2 to adapt to many kinds of systems. +\`configure' configures wxWidgets 3.1.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2015,7 +2015,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of wxWidgets 3.1.2:";; + short | recursive ) echo "Configuration of wxWidgets 3.1.3:";; esac cat <<\_ACEOF @@ -2480,7 +2480,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -wxWidgets configure 3.1.2 +wxWidgets configure 3.1.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3297,7 +3297,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by wxWidgets $as_me 3.1.2, which was +It was created by wxWidgets $as_me 3.1.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3760,7 +3760,7 @@ fi wx_major_version_number=3 wx_minor_version_number=1 -wx_release_number=2 +wx_release_number=3 wx_subrelease_number=0 WX_RELEASE=$wx_major_version_number.$wx_minor_version_number @@ -42294,7 +42294,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by wxWidgets $as_me 3.1.2, which was +This file was extended by wxWidgets $as_me 3.1.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -42360,7 +42360,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -wxWidgets config.status 3.1.2 +wxWidgets config.status 3.1.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.in b/configure.in index 2c91781ff0..b2aadfa781 100644 --- a/configure.in +++ b/configure.in @@ -14,7 +14,7 @@ dnl --------------------------------------------------------------------------- dnl initialization dnl --------------------------------------------------------------------------- -AC_INIT([wxWidgets], [3.1.2], [wx-dev@googlegroups.com]) +AC_INIT([wxWidgets], [3.1.3], [wx-dev@googlegroups.com]) dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package AC_CONFIG_SRCDIR([wx-config.in]) @@ -40,7 +40,7 @@ dnl wx_release_number += 1 wx_major_version_number=3 wx_minor_version_number=1 -wx_release_number=2 +wx_release_number=3 wx_subrelease_number=0 WX_RELEASE=$wx_major_version_number.$wx_minor_version_number diff --git a/demos/bombs/Makefile.in b/demos/bombs/Makefile.in index a319a1b999..d1e54782de 100644 --- a/demos/bombs/Makefile.in +++ b/demos/bombs/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib BOMBS_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/demos/forty/Makefile.in b/demos/forty/Makefile.in index 69ad8f09fe..bf7d342a44 100644 --- a/demos/forty/Makefile.in +++ b/demos/forty/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib FORTY_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/demos/fractal/Makefile.in b/demos/fractal/Makefile.in index 6d2b3b8c16..bb2d45c29b 100644 --- a/demos/fractal/Makefile.in +++ b/demos/fractal/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib FRACTAL_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/demos/life/Makefile.in b/demos/life/Makefile.in index c2e582b4d2..32e5797288 100644 --- a/demos/life/Makefile.in +++ b/demos/life/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib LIFE_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/demos/poem/Makefile.in b/demos/poem/Makefile.in index 528d0b28b7..5fa3a16b37 100644 --- a/demos/poem/Makefile.in +++ b/demos/poem/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib WXPOEM_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index e6e63965c5..3c7b5d26b1 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -6,7 +6,7 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = wxWidgets -PROJECT_NUMBER = 3.1.2 +PROJECT_NUMBER = 3.1.3 PROJECT_BRIEF = PROJECT_LOGO = logo.png OUTPUT_DIRECTORY = out diff --git a/docs/readme.txt b/docs/readme.txt index c84dcbb8cf..cd9746f178 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -1,4 +1,4 @@ -wxWidgets 3.1.2 Release Notes +wxWidgets 3.1.3 Release Notes ============================= Welcome to the latest development release of wxWidgets, a free and open source @@ -16,12 +16,12 @@ more about wxWidgets at: Documentation is available online at: -* https://docs.wxwidgets.org/3.1.2/ +* https://docs.wxwidgets.org/3.1.3/ wxWidgets sources and binaries for the selected platforms are available for download from: -* https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.2/ +* https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.3/ Changes since 3.1.1 @@ -53,7 +53,7 @@ Some of the other improvements: Please refer to the detailed change log for the full list of changes: -https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.2/docs/changes.txt +https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.3/docs/changes.txt Notice that this release is almost completely compatible with 3.1.1 at the API diff --git a/include/wx/osx/config_xcode.h b/include/wx/osx/config_xcode.h index 1a4946c0e1..ab61d65363 100644 --- a/include/wx/osx/config_xcode.h +++ b/include/wx/osx/config_xcode.h @@ -126,9 +126,9 @@ #define PACKAGE_BUGREPORT "wx-dev@googlegroups.com" #define PACKAGE_NAME "wxWidgets" -#define PACKAGE_STRING "wxWidgets 3.1.2" +#define PACKAGE_STRING "wxWidgets 3.1.3" #define PACKAGE_TARNAME "wxwidgets" -#define PACKAGE_VERSION "3.1.2" +#define PACKAGE_VERSION "3.1.3" // for regex #define WX_NO_REGEX_ADVANCED 1 diff --git a/include/wx/version.h b/include/wx/version.h index f977b5364b..cdb72af195 100644 --- a/include/wx/version.h +++ b/include/wx/version.h @@ -27,9 +27,9 @@ /* NB: this file is parsed by automatic tools so don't change its format! */ #define wxMAJOR_VERSION 3 #define wxMINOR_VERSION 1 -#define wxRELEASE_NUMBER 2 +#define wxRELEASE_NUMBER 3 #define wxSUBRELEASE_NUMBER 0 -#define wxVERSION_STRING wxT("wxWidgets 3.1.2") +#define wxVERSION_STRING wxT("wxWidgets 3.1.3") /* nothing to update below this line when updating the version */ /* ---------------------------------------------------------------------------- */ diff --git a/samples/access/Makefile.in b/samples/access/Makefile.in index f571d79ef2..183006d277 100644 --- a/samples/access/Makefile.in +++ b/samples/access/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib ACCESSTEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/animate/Makefile.in b/samples/animate/Makefile.in index 89535addaa..4dda2ce105 100644 --- a/samples/animate/Makefile.in +++ b/samples/animate/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib ANITEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/artprov/Makefile.in b/samples/artprov/Makefile.in index c0872109c3..22ad1b48fb 100644 --- a/samples/artprov/Makefile.in +++ b/samples/artprov/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib ARTTEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/aui/Makefile.in b/samples/aui/Makefile.in index 707f37ac52..8e69ef8364 100644 --- a/samples/aui/Makefile.in +++ b/samples/aui/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib AUIDEMO_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/calendar/Makefile.in b/samples/calendar/Makefile.in index 98aa08a38e..c3b1cf5db5 100644 --- a/samples/calendar/Makefile.in +++ b/samples/calendar/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib CALENDAR_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/caret/Makefile.in b/samples/caret/Makefile.in index 0cde6e4fb8..b5bbac3cf6 100644 --- a/samples/caret/Makefile.in +++ b/samples/caret/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib CARET_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/clipboard/Makefile.in b/samples/clipboard/Makefile.in index b19c7f9b16..3b2cbcfe38 100644 --- a/samples/clipboard/Makefile.in +++ b/samples/clipboard/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib CLIPBOARD_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/collpane/Makefile.in b/samples/collpane/Makefile.in index 3a87aef156..8eb9e4357a 100644 --- a/samples/collpane/Makefile.in +++ b/samples/collpane/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib COLLPANE_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/combo/Makefile.in b/samples/combo/Makefile.in index 977d7b21aa..60e251d7ae 100644 --- a/samples/combo/Makefile.in +++ b/samples/combo/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib COMBO_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/config/Makefile.in b/samples/config/Makefile.in index 3b613f8bcb..5a737e2f5c 100644 --- a/samples/config/Makefile.in +++ b/samples/config/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib CONFTEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/dataview/Makefile.in b/samples/dataview/Makefile.in index 7d9dfdb4fb..dddf56da70 100644 --- a/samples/dataview/Makefile.in +++ b/samples/dataview/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DATAVIEW_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/debugrpt/Makefile.in b/samples/debugrpt/Makefile.in index 3fcda9313e..a09717f94e 100644 --- a/samples/debugrpt/Makefile.in +++ b/samples/debugrpt/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DEBUGRPT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/dialogs/Makefile.in b/samples/dialogs/Makefile.in index f9e618bff3..5c29eb0ef2 100644 --- a/samples/dialogs/Makefile.in +++ b/samples/dialogs/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DIALOGS_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ @@ -198,6 +198,9 @@ dialogs_sample_rc.o: $(srcdir)/../../samples/sample.rc dialogs_dialogs.o: $(srcdir)/dialogs.cpp $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/dialogs.cpp +dialogs_fontdlgg.o: $(srcdir)/../../src/generic/fontdlgg.cpp + $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/fontdlgg.cpp + @COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0@dialogs_colrdlgg.o: $(srcdir)/../../src/generic/colrdlgg.cpp @COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0@ $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/colrdlgg.cpp @@ -220,9 +223,6 @@ dialogs_dialogs.o: $(srcdir)/dialogs.cpp @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@ $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/filedlgg.cpp -@COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0@dialogs_fontdlgg.o: $(srcdir)/../../src/generic/fontdlgg.cpp -@COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0@ $(CXXC) -c -o $@ $(DIALOGS_CXXFLAGS) $(srcdir)/../../src/generic/fontdlgg.cpp - # Include dependency info, if present: @IF_GNU_MAKE@-include ./.deps/*.d diff --git a/samples/dialup/Makefile.in b/samples/dialup/Makefile.in index 68bd936bf0..fe259471c4 100644 --- a/samples/dialup/Makefile.in +++ b/samples/dialup/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib NETTEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/display/Makefile.in b/samples/display/Makefile.in index bafb9800c7..919fa34ed0 100644 --- a/samples/display/Makefile.in +++ b/samples/display/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DISPLAY_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/dll/Makefile.in b/samples/dll/Makefile.in index 5eec3e1e1a..67fa0f4189 100644 --- a/samples/dll/Makefile.in +++ b/samples/dll/Makefile.in @@ -47,7 +47,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib MY_DLL_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/dnd/Makefile.in b/samples/dnd/Makefile.in index f1b6583b40..09eef17aa4 100644 --- a/samples/dnd/Makefile.in +++ b/samples/dnd/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DND_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/docview/Info.plist b/samples/docview/Info.plist index e4e80b1619..ef98445d90 100644 --- a/samples/docview/Info.plist +++ b/samples/docview/Info.plist @@ -51,7 +51,7 @@ CFBundleExecutable $(PRODUCT_NAME) CFBundleGetInfoString - $(PRODUCT_NAME) version 3.1.2, (c) 2005-2018 wxWidgets + $(PRODUCT_NAME) version 3.1.3, (c) 2005-2018 wxWidgets CFBundleIconFile doc CFBundleIdentifier @@ -66,17 +66,17 @@ it CFBundleLongVersionString - 3.1.2, (c) 2005-2018 wxWidgets + 3.1.3, (c) 2005-2018 wxWidgets CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString - 3.1.2 + 3.1.3 CFBundleSignature WXMA CFBundleVersion - 3.1.2 + 3.1.3 CSResourcesFileMapped LSRequiresCarbon diff --git a/samples/docview/Makefile.in b/samples/docview/Makefile.in index 9c174054d5..ed013660c0 100644 --- a/samples/docview/Makefile.in +++ b/samples/docview/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DOCVIEW_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/dragimag/Makefile.in b/samples/dragimag/Makefile.in index cdcd5c3002..f5974b4ee3 100644 --- a/samples/dragimag/Makefile.in +++ b/samples/dragimag/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DRAGIMAG_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/drawing/Makefile.in b/samples/drawing/Makefile.in index 12385f46ea..690ce31287 100644 --- a/samples/drawing/Makefile.in +++ b/samples/drawing/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib DRAWING_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/erase/Makefile.in b/samples/erase/Makefile.in index 8c04bfff92..60f1c79ee1 100644 --- a/samples/erase/Makefile.in +++ b/samples/erase/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib ERASE_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/event/Makefile.in b/samples/event/Makefile.in index c99d2b6932..ebef4ff7f5 100644 --- a/samples/event/Makefile.in +++ b/samples/event/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib EVENT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/except/Makefile.in b/samples/except/Makefile.in index 78abbfb69c..85a876d838 100644 --- a/samples/except/Makefile.in +++ b/samples/except/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib EXCEPT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/exec/Makefile.in b/samples/exec/Makefile.in index 4e6222a271..302de8a82e 100644 --- a/samples/exec/Makefile.in +++ b/samples/exec/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib EXEC_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/font/Makefile.in b/samples/font/Makefile.in index eca4325ffd..24a137b536 100644 --- a/samples/font/Makefile.in +++ b/samples/font/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib FONT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/fswatcher/Makefile.in b/samples/fswatcher/Makefile.in index b88bf03ab5..878268a606 100644 --- a/samples/fswatcher/Makefile.in +++ b/samples/fswatcher/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib FSWATCHER_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/grid/Makefile.in b/samples/grid/Makefile.in index ba1ff71dc3..6b2f41c7e1 100644 --- a/samples/grid/Makefile.in +++ b/samples/grid/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib GRID_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/help/Makefile.in b/samples/help/Makefile.in index f4fac29686..242dc27163 100644 --- a/samples/help/Makefile.in +++ b/samples/help/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib HELP_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/htlbox/Makefile.in b/samples/htlbox/Makefile.in index fe33e17a97..75093b2b44 100644 --- a/samples/htlbox/Makefile.in +++ b/samples/htlbox/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib HTLBOX_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/html/about/Makefile.in b/samples/html/about/Makefile.in index 28ab32229b..3da1940d53 100644 --- a/samples/html/about/Makefile.in +++ b/samples/html/about/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib ABOUT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/html/help/Makefile.in b/samples/html/help/Makefile.in index e07831b562..244d179c71 100644 --- a/samples/html/help/Makefile.in +++ b/samples/html/help/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib HTMLHELP_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/html/helpview/Makefile.in b/samples/html/helpview/Makefile.in index 33739f4716..fd71f74ae4 100644 --- a/samples/html/helpview/Makefile.in +++ b/samples/html/helpview/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib HELPVIEW_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/html/htmlctrl/Makefile.in b/samples/html/htmlctrl/Makefile.in index 689aaf8eab..edd0c6f43a 100644 --- a/samples/html/htmlctrl/Makefile.in +++ b/samples/html/htmlctrl/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib HTMLCTRL_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/html/printing/Makefile.in b/samples/html/printing/Makefile.in index 250602ff17..354273db3e 100644 --- a/samples/html/printing/Makefile.in +++ b/samples/html/printing/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib HTMLPRINTING_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/html/test/Makefile.in b/samples/html/test/Makefile.in index 1b9c6052fa..a5723a79f2 100644 --- a/samples/html/test/Makefile.in +++ b/samples/html/test/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib TEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/html/virtual/Makefile.in b/samples/html/virtual/Makefile.in index 211077ef89..faa9924287 100644 --- a/samples/html/virtual/Makefile.in +++ b/samples/html/virtual/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib VIRTUAL_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/html/widget/Makefile.in b/samples/html/widget/Makefile.in index 39a71c056a..a2cb354287 100644 --- a/samples/html/widget/Makefile.in +++ b/samples/html/widget/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib WIDGET_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/html/zip/Makefile.in b/samples/html/zip/Makefile.in index 7ed0473a94..65f1a8ecf3 100644 --- a/samples/html/zip/Makefile.in +++ b/samples/html/zip/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib ZIP_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/image/Makefile.in b/samples/image/Makefile.in index e2c1229337..6a06bfc027 100644 --- a/samples/image/Makefile.in +++ b/samples/image/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib IMAGE_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/internat/Makefile.in b/samples/internat/Makefile.in index 3ef989d92d..c518bb8c60 100644 --- a/samples/internat/Makefile.in +++ b/samples/internat/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib INTERNAT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/ipc/Makefile.in b/samples/ipc/Makefile.in index 92ea202001..1743cd69b6 100644 --- a/samples/ipc/Makefile.in +++ b/samples/ipc/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib IPCCLIENT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/joytest/Makefile.in b/samples/joytest/Makefile.in index c8ac8839e9..2ed708d4fa 100644 --- a/samples/joytest/Makefile.in +++ b/samples/joytest/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib JOYTEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/keyboard/Makefile.in b/samples/keyboard/Makefile.in index 81699ecf03..bc66367950 100644 --- a/samples/keyboard/Makefile.in +++ b/samples/keyboard/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib KEYBOARD_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/layout/Makefile.in b/samples/layout/Makefile.in index e5c429f7d5..647d032bf4 100644 --- a/samples/layout/Makefile.in +++ b/samples/layout/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib LAYOUT_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/listctrl/Makefile.in b/samples/listctrl/Makefile.in index eff840df3f..47db8a86df 100644 --- a/samples/listctrl/Makefile.in +++ b/samples/listctrl/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib LISTCTRL_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/mdi/Makefile.in b/samples/mdi/Makefile.in index 43aaacff3c..5956c64ea4 100644 --- a/samples/mdi/Makefile.in +++ b/samples/mdi/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib MDI_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/mediaplayer/Makefile.in b/samples/mediaplayer/Makefile.in index 66452d80b0..b17a1aa205 100644 --- a/samples/mediaplayer/Makefile.in +++ b/samples/mediaplayer/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib MEDIAPLAYER_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/memcheck/Makefile.in b/samples/memcheck/Makefile.in index b8df990e07..fdc9eecbd1 100644 --- a/samples/memcheck/Makefile.in +++ b/samples/memcheck/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib MEMCHECK_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/menu/Makefile.in b/samples/menu/Makefile.in index 4c0b4ad669..3d0b33925e 100644 --- a/samples/menu/Makefile.in +++ b/samples/menu/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib MENU_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/minimal/Info_cocoa.plist b/samples/minimal/Info_cocoa.plist index 42d8369cb5..8b2b276be9 100644 --- a/samples/minimal/Info_cocoa.plist +++ b/samples/minimal/Info_cocoa.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(PRODUCT_NAME) CFBundleGetInfoString - $(PRODUCT_NAME) version 3.1.2, (c) 2005-2018 wxWidgets + $(PRODUCT_NAME) version 3.1.3, (c) 2005-2018 wxWidgets CFBundleIconFile wxmac.icns CFBundleIdentifier @@ -22,17 +22,17 @@ it CFBundleLongVersionString - 3.1.2, (c) 2005-2018 wxWidgets + 3.1.3, (c) 2005-2018 wxWidgets CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString - 3.1.2 + 3.1.3 CFBundleSignature ???? CFBundleVersion - 3.1.2 + 3.1.3 NSHumanReadableCopyright Copyright 2005-2018 wxWidgets NSPrincipalClass diff --git a/samples/minimal/Makefile.in b/samples/minimal/Makefile.in index 602f911640..9414fe380b 100644 --- a/samples/minimal/Makefile.in +++ b/samples/minimal/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib MINIMAL_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/nativdlg/Makefile.in b/samples/nativdlg/Makefile.in index c1fd94a974..9c10d003ae 100644 --- a/samples/nativdlg/Makefile.in +++ b/samples/nativdlg/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib NATIVDLG_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/notebook/Makefile.in b/samples/notebook/Makefile.in index 786a2d9335..18f5e8eb6b 100644 --- a/samples/notebook/Makefile.in +++ b/samples/notebook/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib NOTEBOOK_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/oleauto/Makefile.in b/samples/oleauto/Makefile.in index 1d0d6e8b7c..4d2bdad54c 100644 --- a/samples/oleauto/Makefile.in +++ b/samples/oleauto/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib OLEAUTO_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/opengl/cube/Makefile.in b/samples/opengl/cube/Makefile.in index 93c44642a8..b870a69ad4 100644 --- a/samples/opengl/cube/Makefile.in +++ b/samples/opengl/cube/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib CUBE_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/opengl/isosurf/Makefile.in b/samples/opengl/isosurf/Makefile.in index ec6a5136fa..ba6c84ea09 100644 --- a/samples/opengl/isosurf/Makefile.in +++ b/samples/opengl/isosurf/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib ISOSURF_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/opengl/penguin/Makefile.in b/samples/opengl/penguin/Makefile.in index cd5d9e0bfa..bf6f92de7b 100644 --- a/samples/opengl/penguin/Makefile.in +++ b/samples/opengl/penguin/Makefile.in @@ -44,7 +44,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib PENGUIN_CFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/opengl/pyramid/Makefile.in b/samples/opengl/pyramid/Makefile.in index fec47d7616..3717f50e3a 100644 --- a/samples/opengl/pyramid/Makefile.in +++ b/samples/opengl/pyramid/Makefile.in @@ -42,7 +42,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib PYRAMID_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/ownerdrw/Makefile.in b/samples/ownerdrw/Makefile.in index e9a805d717..ca632ed03e 100644 --- a/samples/ownerdrw/Makefile.in +++ b/samples/ownerdrw/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib OWNERDRW_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/popup/Makefile.in b/samples/popup/Makefile.in index 0bee55e6ae..f5ee9ea45d 100644 --- a/samples/popup/Makefile.in +++ b/samples/popup/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib POPUP_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/power/Makefile.in b/samples/power/Makefile.in index 8057d940a3..4a4d3cb1cc 100644 --- a/samples/power/Makefile.in +++ b/samples/power/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib POWER_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/preferences/Makefile.in b/samples/preferences/Makefile.in index e791885b28..bde2b0b488 100644 --- a/samples/preferences/Makefile.in +++ b/samples/preferences/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib PREFERENCES_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/printing/Makefile.in b/samples/printing/Makefile.in index 888a1fe4c1..3e52b7b637 100644 --- a/samples/printing/Makefile.in +++ b/samples/printing/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib PRINTING_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/propgrid/Makefile.in b/samples/propgrid/Makefile.in index e5daff2296..435062c92a 100644 --- a/samples/propgrid/Makefile.in +++ b/samples/propgrid/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib PROPGRID_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ diff --git a/samples/regtest/Makefile.in b/samples/regtest/Makefile.in index 001aa862db..5c919b5d36 100644 --- a/samples/regtest/Makefile.in +++ b/samples/regtest/Makefile.in @@ -41,7 +41,7 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 -WX_VERSION = $(WX_RELEASE).2 +WX_VERSION = $(WX_RELEASE).3 LIBDIRNAME = $(wx_top_builddir)/lib REGTEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ diff --git a/samples/render/Makefile.in b/samples/render/Makefile.in index ca9053cb44..512fd136c5 100644 --- a/samples/render/Makefile.in +++ b/samples/render/Makefile.in @@ -50,8 +50,8 @@ wx_top_builddir = @wx_top_builddir@ DESTDIR = WX_RELEASE = 3.1 WX_RELEASE_NODOT = 31 -WX_VERSION = $(WX_RELEASE).2 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION = $(WX_RELEASE).3 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 LIBDIRNAME = $(wx_top_builddir)/lib PLUGINS_INST_DIR = $(libdir)/wx/$(PLUGIN_VERSION0) RENDER_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ diff --git a/samples/render/makefile.bcc b/samples/render/makefile.bcc index 65279c4cbe..6c79b4ec41 100644 --- a/samples/render/makefile.bcc +++ b/samples/render/makefile.bcc @@ -22,7 +22,7 @@ BCCDIR = $(MAKEDIR)\.. ### Variables: ### WX_RELEASE_NODOT = 31 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 COMPILER_PREFIX = bcc OBJS = \ $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) diff --git a/samples/render/makefile.gcc b/samples/render/makefile.gcc index 305e82c4de..9b6149be57 100644 --- a/samples/render/makefile.gcc +++ b/samples/render/makefile.gcc @@ -14,7 +14,7 @@ include ../../build/msw/config.gcc CPPDEPS = -MT$@ -MF$@.d -MD -MP WX_RELEASE_NODOT = 31 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 COMPILER_PREFIX = gcc OBJS = \ $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG) diff --git a/samples/render/makefile.vc b/samples/render/makefile.vc index a5260c882d..a4ccf72d15 100644 --- a/samples/render/makefile.vc +++ b/samples/render/makefile.vc @@ -13,7 +13,7 @@ ### Variables: ### WX_RELEASE_NODOT = 31 -WX_VERSION_NODOT = $(WX_RELEASE_NODOT)2 +WX_VERSION_NODOT = $(WX_RELEASE_NODOT)3 COMPILER_PREFIX = vc OBJS = \ $(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)$(ARCH_SUFFIX) diff --git a/samples/render/render_vc7_renddll.vcproj b/samples/render/render_vc7_renddll.vcproj index dad8bd0396..e8ad523288 100644 --- a/samples/render/render_vc7_renddll.vcproj +++ b/samples/render/render_vc7_renddll.vcproj @@ -36,7 +36,7 @@ BufferSecurityCheck="TRUE" RuntimeTypeInfo="TRUE" ObjectFile="vc_mswuddll\renddll\" - ProgramDataBaseFileName="vc_mswuddll\renddll_mswud312_vc.pdb" + ProgramDataBaseFileName="vc_mswuddll\renddll_mswud313_vc.pdb" WarningLevel="4" SuppressStartupBanner="TRUE" Detect64BitPortabilityProblems="TRUE" @@ -47,12 +47,12 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxmsw31ud_core.lib wxbase31ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="vc_mswuddll\renddll_mswud312_vc.dll" + OutputFile="vc_mswuddll\renddll_mswud313_vc.dll" LinkIncremental="2" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories=".\..\..\lib\vc_dll" GenerateDebugInformation="TRUE" - ProgramDatabaseFile="vc_mswuddll\renddll_mswud312_vc.pdb" + ProgramDatabaseFile="vc_mswuddll\renddll_mswud313_vc.pdb" TargetMachine="1"/> diff --git a/samples/render/render_vc8_renddll.vcproj b/samples/render/render_vc8_renddll.vcproj index 336bdf2ef2..dd843c672a 100644 --- a/samples/render/render_vc8_renddll.vcproj +++ b/samples/render/render_vc8_renddll.vcproj @@ -62,7 +62,7 @@ BufferSecurityCheck="true" RuntimeTypeInfo="true" ObjectFile="vc_mswuddll\renddll\" - ProgramDataBaseFileName="vc_mswuddll\renddll_mswud312_vc.pdb" + ProgramDataBaseFileName="vc_mswuddll\renddll_mswud313_vc.pdb" WarningLevel="4" SuppressStartupBanner="true" Detect64BitPortabilityProblems="true" @@ -84,13 +84,13 @@ Name="VCLinkerTool" AdditionalOptions="" AdditionalDependencies="wxmsw31ud_core.lib wxbase31ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexud.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib" - OutputFile="vc_mswuddll\renddll_mswud312_vc.dll" + OutputFile="vc_mswuddll\renddll_mswud313_vc.dll" LinkIncremental="2" SuppressStartupBanner="true" AdditionalLibraryDirectories=".\..\..\lib\vc_dll" GenerateManifest="true" GenerateDebugInformation="true" - ProgramDatabaseFile="vc_mswuddll\renddll_mswud312_vc.pdb" + ProgramDatabaseFile="vc_mswuddll\renddll_mswud313_vc.pdb" TargetMachine="1" /> Date: Mon, 10 Dec 2018 18:55:42 +0100 Subject: [PATCH 061/553] Remove the list of changes since 3.1.1 from the README This will hopefully make things less confusing when preparing for the next release. --- docs/readme.txt | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/docs/readme.txt b/docs/readme.txt index cd9746f178..e9332ce9af 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -24,39 +24,12 @@ download from: * https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.3/ -Changes since 3.1.1 +Changes since 3.1.2 ------------------- -There have been more than 1200 commits from 75 contributors (41 with multiple -contributions) since 3.1.1 release. This release primarily contains bug fixes -(closing more than 100 bugs from wxTrac) and incremental improvements in -preparation for the next stable 3.2.0 release, however there is a usual lot of -new features as well, including: +TODO: Fill in -- Initial support for macOS 10.14 and its dark mode. -- Support for non-integer font sizes and arbitrary font weights. -- New wxLZMA{Input,Output}Stream classes. -- Add wxDataViewToggleRenderer::ShowAsRadio(), wxDisplay::GetPPI(), - wxGrid::SetCornerLabelValue(), wxHtmlEasyPrinting::SetPromptMode(), - wxJoystickEvent::GetButtonOrdinal(), wxToolbook::EnablePage(). - -Some of the other improvements: - -- There were again many improvements to the (still experimental) wxQt port. -- Fix several bugs related to focus handling and TAB navigation in wxGTK. -- Make it possible to control pagination in wxHTML more precisely. -- Fix several problems with high-DPI displays. -- wxOSX now uses native NSImage/UIImage representation for wxBitmap. -- Support strike-through font attribute in XRC and wxDataViewCtrl markup too. -- Support more than 4 buttons in wxJoystick. -- Add wxwidgets.props property sheet file for MSVS users. - -Please refer to the detailed change log for the full list of changes: - -https://raw.githubusercontent.com/wxWidgets/wxWidgets/v3.1.3/docs/changes.txt - - -Notice that this release is almost completely compatible with 3.1.1 at the API +Notice that this release is almost completely compatible with 3.1.2 at the API level, so upgrading to it if you're already using wxWidgets 3 should be straightforward. From cf28473d9fc6e04df3ccb6de7d93301c2b823a61 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Dec 2018 18:56:19 +0100 Subject: [PATCH 062/553] Mention that wx.bkl doesn't need to be updated for micro releases Only WX_VERSION_DEFAULT value, which doesn't include the micro version component, needs to be updated in this file. --- docs/contributing/about-version-numbers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing/about-version-numbers.md b/docs/contributing/about-version-numbers.md index 7c6ea11aa1..372eb50b65 100644 --- a/docs/contributing/about-version-numbers.md +++ b/docs/contributing/about-version-numbers.md @@ -6,7 +6,7 @@ All about wxWidgets Version Numbers There are several places in the wxWidgets source tree that define the version number for the library. -The script misc/scripts/inc_release can be used for incrementing the release +The script `misc/scripts/inc_release` can be used for incrementing the release field of the version, i.e. changing 2.8.x to 2.8.x+1 but it does not take care of version.bkl and can't be used for changing the other version components, this needs to be done manually. It also doesn't update @@ -16,7 +16,7 @@ instructions there. Here is the list of files that need to be updated: build/bakefiles/version.bkl {C:R:A} [NOT UPDATED AUTOMATICALLY] - build/bakefiles/wxpresets/presets/wx.bkl [NOT UPDATED AUTOMATICALLY] + build/bakefiles/wxpresets/presets/wx.bkl [NOT UPDATED AUTOMATICALLY, not-micro] configure.in build/osx/wxvers.xcconfig docs/changes.txt @@ -27,7 +27,7 @@ Here is the list of files that need to be updated: include/wx/osx/config_xcode.h samples/docview/Info.plist samples/minimal/Info_cocoa.plist - samples/minimal/borland_ide.cpp {major release only} + samples/minimal/borland_ide.cpp [not-micro] Do not forget to rebake everything after updating version.bkl! From 251561172a886d45ef355473ec31525caaab1ce3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Dec 2018 18:59:03 +0100 Subject: [PATCH 063/553] Remove mentions of non-existent docs/$toolkit/install.txt Don't include these files in "make dist" (which seems completely unused anyhow, and probably broken because of this). --- Makefile.in | 1 - build/bakefiles/make_dist.mk | 1 - docs/base/readme.txt | 2 +- docs/index.htm | 12 ++++++------ docs/readme.txt | 6 ++++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 59f1e05acc..c07f2d317d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -36866,7 +36866,6 @@ ALL_DIST: distrib_clean # but is not used when building wxBase distribution ALL_GUI_DIST: ALL_DIST $(CP_P) $(DOCDIR)/readme.txt $(DISTDIR)/README.txt - $(CP_P) $(DOCDIR)/$(TOOLKITDIR)/install.txt $(DISTDIR)/INSTALL.txt if test -f $(DOCDIR)/$(TOOLKITDIR)/changes.txt ; then \ $(CP_P) $(DOCDIR)/$(TOOLKITDIR)/changes.txt $(DISTDIR)/CHANGES-$(TOOLKIT).txt ; fi $(CP_P) $(DOCDIR)/$(TOOLKITDIR)/readme.txt $(DISTDIR)/README-$(TOOLKIT).txt diff --git a/build/bakefiles/make_dist.mk b/build/bakefiles/make_dist.mk index ced718bac6..839aa9938f 100644 --- a/build/bakefiles/make_dist.mk +++ b/build/bakefiles/make_dist.mk @@ -142,7 +142,6 @@ ALL_DIST: distrib_clean # but is not used when building wxBase distribution ALL_GUI_DIST: ALL_DIST $(CP_P) $(DOCDIR)/readme.txt $(DISTDIR)/README.txt - $(CP_P) $(DOCDIR)/$(TOOLKITDIR)/install.txt $(DISTDIR)/INSTALL.txt if test -f $(DOCDIR)/$(TOOLKITDIR)/changes.txt ; then \ $(CP_P) $(DOCDIR)/$(TOOLKITDIR)/changes.txt $(DISTDIR)/CHANGES-$(TOOLKIT).txt ; fi $(CP_P) $(DOCDIR)/$(TOOLKITDIR)/readme.txt $(DISTDIR)/README-$(TOOLKIT).txt diff --git a/docs/base/readme.txt b/docs/base/readme.txt index 22c3eb7572..015a970c79 100644 --- a/docs/base/readme.txt +++ b/docs/base/readme.txt @@ -65,7 +65,7 @@ b) Cygwin c) Borland - Please refer to the docs/msw/install.txt. The console sample compiles and + Please refer to the docs/msw/install.md. The console sample compiles and runs but does not pass all tests. d) Other compilers diff --git a/docs/index.htm b/docs/index.htm index 880723d2f0..5d1c28d77e 100644 --- a/docs/index.htm +++ b/docs/index.htm @@ -51,12 +51,12 @@ wxiOS
  • Installation: - wxMSW, - wxGTK, - wxMotif, - wxX11, - wxOSX, - wxQt, + wxMSW, + wxGTK, + wxMotif, + wxX11, + wxOSX, + wxQt,
  • General change log
  • Licence: diff --git a/docs/readme.txt b/docs/readme.txt index e9332ce9af..a831d5a500 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -111,8 +111,10 @@ Installation Unless you have downloaded the binaries for your compiler, you will need to build wxWidgets before you can test out the samples or write your own -applications. For installation information, please see the install.txt file in -the docs subdirectory appropriate for the platform you use. +applications. For installation information, please see the install.md files in +the docs subdirectory appropriate for the platform you use or the "Platform +Details" page of the manual, which contains links to the rendered versions of +these files. Licence From 611f678b51bf52dcd22356b515e6c51179fe808f Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 7 Dec 2018 16:30:47 +0000 Subject: [PATCH 064/553] Implement of wxFontEnumerator::EnumerateFacenames() in wxQt Closes https://github.com/wxWidgets/wxWidgets/pull/1056 --- src/qt/fontenum.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/qt/fontenum.cpp b/src/qt/fontenum.cpp index c47692ee36..51f7270ef7 100644 --- a/src/qt/fontenum.cpp +++ b/src/qt/fontenum.cpp @@ -9,11 +9,28 @@ #include "wx/wxprec.h" #include "wx/fontenum.h" +#include "wx/qt/private/converter.h" -bool wxFontEnumerator::EnumerateFacenames( wxFontEncoding WXUNUSED(encoding), - bool WXUNUSED(fixedWidthOnly)) +#include +#include + +bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding WXUNUSED(encoding), bool fixedWidthOnly) { - return false; + QFontDatabase fontDatabase; + const QStringList allFonts = fontDatabase.families(QFontDatabase::Any); + for( QStringList::const_iterator i = allFonts.begin(); i != allFonts.end(); ++i ) + { + const QString& fontFamily = *i; + if ( !fixedWidthOnly || fontDatabase.isFixedPitch(fontFamily) ) + { + if ( !OnFacename(wxQtConvertString(fontFamily)) ) + { + break; + } + } + } + + return true; } bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(facename)) From 8ec8a0cf6663ec398bc89f3d1fa02d8bf66aff21 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Dec 2018 19:31:40 +0100 Subject: [PATCH 065/553] Define WX_WEB_EXTENSIONS_DIRECTORY in static builds too This definition is needed when building both shared and static webview library when using WebKit 2, but for some reason wasn't included for the latter. Closes https://github.com/wxWidgets/wxWidgets/pull/1061 --- Makefile.in | 12 +++++++----- build/bakefiles/multilib.bkl | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index c07f2d317d..a996c31157 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1667,12 +1667,14 @@ WEBVIEWLIB_CXXFLAGS = $(__webviewlib_PCH_INC) -D__WX$(TOOLKIT)__ \ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING $(__INC_TIFF_BUILD_p) \ $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) \ - $(__INC_REGEX_p) $(__INC_EXPAT_p) $(CXXWARNINGS) $(CPPFLAGS) $(CXXFLAGS) + $(__INC_REGEX_p) $(__INC_EXPAT_p) $(__webviewdll_ext_dir_define_p) \ + $(CXXWARNINGS) $(CPPFLAGS) $(CXXFLAGS) WEBVIEWLIB_OBJCXXFLAGS = $(__webviewlib_PCH_INC) -D__WX$(TOOLKIT)__ \ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \ $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) -DWXBUILDING $(__INC_TIFF_BUILD_p) \ $(__INC_TIFF_p) $(__INC_JPEG_p) $(__INC_PNG_p) $(__INC_ZLIB_p) \ - $(__INC_REGEX_p) $(__INC_EXPAT_p) $(CPPFLAGS) $(OBJCXXFLAGS) + $(__INC_REGEX_p) $(__INC_EXPAT_p) $(__webviewdll_ext_dir_define_p) \ + $(CPPFLAGS) $(OBJCXXFLAGS) WEBVIEWLIB_OBJECTS = \ $(__WEBVIEW_SRC_PLATFORM_OBJECTS_3) \ webviewlib_webview.o \ @@ -13386,9 +13388,6 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_17 = \ monolib_core_timer.o \ monolib_utilsexc_cf.o @COND_PLATFORM_MACOSX_1@__OSX_LOWLEVEL_SRC_OBJECTS_17 = $(COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_17) -@COND_USE_WEBVIEW_WEBKIT2_1@__webviewdll_ext_dir_define_p \ -@COND_USE_WEBVIEW_WEBKIT2_1@ = \ -@COND_USE_WEBVIEW_WEBKIT2_1@ -DWX_WEB_EXTENSIONS_DIRECTORY=\"$(PLUGINS_INST_DIR)/web-extensions\" @COND_PLATFORM_MACOSX_1@__PLATFORM_SRC_OBJECTS_8 = coredll_unix_apptraits.o @COND_PLATFORM_UNIX_1@__PLATFORM_SRC_OBJECTS_8 = coredll_unix_apptraits.o COND_PLATFORM_MACOSX_1___OSX_COMMON_SRC_OBJECTS_8 = \ @@ -13665,6 +13664,9 @@ COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_4 = \ corelib_core_timer.o \ corelib_utilsexc_cf.o @COND_PLATFORM_MACOSX_1@__OSX_LOWLEVEL_SRC_OBJECTS_1_4 = $(COND_PLATFORM_MACOSX_1___OSX_LOWLEVEL_SRC_OBJECTS_1_4) +@COND_USE_WEBVIEW_WEBKIT2_1@__webviewdll_ext_dir_define_p \ +@COND_USE_WEBVIEW_WEBKIT2_1@ = \ +@COND_USE_WEBVIEW_WEBKIT2_1@ -DWX_WEB_EXTENSIONS_DIRECTORY=\"$(PLUGINS_INST_DIR)/web-extensions\" @COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_HTML_1@__htmldll_library_link_DEP \ @COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_HTML_1@ = $(__htmldll___depname) @COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_HTML_1@__htmldll_library_link_LIBR \ diff --git a/build/bakefiles/multilib.bkl b/build/bakefiles/multilib.bkl index 0aab9c3236..dedebdb51a 100644 --- a/build/bakefiles/multilib.bkl +++ b/build/bakefiles/multilib.bkl @@ -190,6 +190,7 @@ + $(webviewdll_ext_dir_define) $(WEBVIEW_SRC) $(WEBVIEW_HDR) From 0c2956be091f1040314a48181333e530dc50ebe8 Mon Sep 17 00:00:00 2001 From: Stefan Ziegler Date: Mon, 10 Dec 2018 10:47:56 +0100 Subject: [PATCH 066/553] Fix wxInfoBar close button size in high DPI Don't apply the scaling factor twice when dynamically creating the close button bitmap. Closes https://github.com/wxWidgets/wxWidgets/pull/1063 Closes #18283. --- docs/changes.txt | 8 ++++++++ src/common/bmpbtncmn.cpp | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index ea37991c44..fd1b14acb7 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -102,6 +102,14 @@ Changes in behaviour which may result in build errors removing its name. +3.1.3: (released 2019-??-??) +---------------------------- + +All (GUI): + +- Fix wxInfoBar close button size in high DPI (Stefan Ziegler). + + 3.1.2: (released 2018-12-10) ---------------------------- diff --git a/src/common/bmpbtncmn.cpp b/src/common/bmpbtncmn.cpp index ff2ea043ce..039f977c54 100644 --- a/src/common/bmpbtncmn.cpp +++ b/src/common/bmpbtncmn.cpp @@ -103,13 +103,13 @@ GetCloseButtonBitmap(wxWindow *win, const wxColour& colBg, int flags = 0) { + // size is physical here because it comes from wxArtProvider::GetSizeHint wxBitmap bmp; - bmp.CreateScaled(size.x, size.y, wxBITMAP_SCREEN_DEPTH, win->GetContentScaleFactor()); + bmp.Create(size.x, size.y, wxBITMAP_SCREEN_DEPTH); wxMemoryDC dc(bmp); dc.SetBackground(colBg); dc.Clear(); - wxRendererNative::Get(). - DrawTitleBarBitmap(win, dc, win->FromDIP(size), wxTITLEBAR_BUTTON_CLOSE, flags); + wxRendererNative::Get().DrawTitleBarBitmap(win, dc, size, wxTITLEBAR_BUTTON_CLOSE, flags); return bmp; } From 91a87e765b7b47ac09a5b464985af8220c0a8f6d Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 10 Dec 2018 11:23:50 +0000 Subject: [PATCH 067/553] Don't omit "int" in wxQt wxRadioBox::GetCount() signature No real changes, just use "unsigned int" instead of just "unsigned". See https://github.com/wxWidgets/wxWidgets/pull/1064 --- src/qt/radiobox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 32ccb686b1..693e673170 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -200,7 +200,7 @@ bool wxRadioBox::IsItemShown(unsigned int n) const return qtButton->isVisible(); } -unsigned wxRadioBox::GetCount() const +unsigned int wxRadioBox::GetCount() const { QList< QAbstractButton * > buttons = m_qtButtonGroup->buttons(); return buttons.size(); From 2a64b6514921b6b24e1ca4ba1d0194bcc88e8f02 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 10 Dec 2018 11:23:50 +0000 Subject: [PATCH 068/553] Fix enabling radiobox buttons in wxQt If a QGroupBox is disabled, then you cannot set any of its items to be enabled without first enabling it. Enabling/disabling it will set that value (true/false) on all of its items, although setting the QGroupBox to an enabled state which it already has does not result in this behaviour. Fix wxQt to match the expected wxRadioBox behaviour and allow the unit test to pass. Closes https://github.com/wxWidgets/wxWidgets/pull/1064 --- include/wx/qt/radiobox.h | 9 +++++---- src/qt/radiobox.cpp | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/include/wx/qt/radiobox.h b/include/wx/qt/radiobox.h index f858a576f6..2c84083aa3 100644 --- a/include/wx/qt/radiobox.h +++ b/include/wx/qt/radiobox.h @@ -65,10 +65,11 @@ public: using wxWindowBase::Enable; using wxRadioBoxBase::GetDefaultBorder; - virtual bool Enable(unsigned int n, bool enable = true); - virtual bool Show(unsigned int n, bool show = true); - virtual bool IsItemEnabled(unsigned int n) const; - virtual bool IsItemShown(unsigned int n) const; + virtual bool Enable(unsigned int n, bool enable = true) wxOVERRIDE; + virtual bool Enable(bool enable = true) wxOVERRIDE; + virtual bool Show(unsigned int n, bool show = true) wxOVERRIDE; + virtual bool IsItemEnabled(unsigned int n) const wxOVERRIDE; + virtual bool IsItemShown(unsigned int n) const wxOVERRIDE; virtual unsigned int GetCount() const; virtual wxString GetString(unsigned int n) const; diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 693e673170..beede99053 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -168,10 +168,42 @@ static QAbstractButton *GetButtonAt( const QButtonGroup *group, unsigned int n ) bool wxRadioBox::Enable(unsigned int n, bool enable) { - QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, n ); - CHECK_BUTTON( qtButton, false ); + if ( enable && !m_qtGroupBox->isEnabled() ) + { + m_qtGroupBox->setEnabled( true ); + + for ( unsigned int i = 0; i < GetCount(); ++i ) + { + QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, i ); + CHECK_BUTTON( qtButton, false ); + + qtButton->setEnabled( i == n ); + } + } + else + { + QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, n ); + CHECK_BUTTON( qtButton, false ); + qtButton->setEnabled(enable); + } + + return true; +} + +bool wxRadioBox::Enable( bool enable ) +{ + if ( m_qtGroupBox->isEnabled() == enable ) + { + for ( unsigned int i = 0; i < GetCount(); ++i ) + { + QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, i ); + CHECK_BUTTON( qtButton, false ); + qtButton->setEnabled( enable ); + } + } + + m_qtGroupBox->setEnabled( enable ); - qtButton->setEnabled( enable ); return true; } From 418a1b747e28614ca07e41f413b636a35fe2a3ef Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 10 Dec 2018 13:57:14 +0000 Subject: [PATCH 069/553] Select first item of wxRadioBox by default in wxQt too Follow the other ports and select the first radio box item when it's created, to ensure that it always has selection. See https://github.com/wxWidgets/wxWidgets/pull/1065 --- src/qt/radiobox.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index beede99053..b02c5a1596 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -111,11 +111,19 @@ template < typename Button > static void AddChoices( QButtonGroup *qtButtonGroup, QBoxLayout *qtBoxLayout, int count, const wxString choices[] ) { Button *btn; + bool isFirst = true; + while ( count-- > 0 ) { btn = new Button( wxQtConvertString( *choices++ )); qtButtonGroup->addButton( btn ); qtBoxLayout->addWidget( btn ); + + if ( isFirst ) + { + btn->setChecked(true); + isFirst = false; + } } } From e7260cffe0cfeacb859bfe161ee29c4190026683 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 10 Dec 2018 14:11:37 +0000 Subject: [PATCH 070/553] Fix wxRadioBox::Show() behaviour in wxQt If a QGroupBox is not visible, then you cannot set any of items to be visible. Update the implementation to match that expected by wx. Closes https://github.com/wxWidgets/wxWidgets/pull/1065 --- include/wx/qt/radiobox.h | 1 + src/qt/radiobox.cpp | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/include/wx/qt/radiobox.h b/include/wx/qt/radiobox.h index 2c84083aa3..679298b83b 100644 --- a/include/wx/qt/radiobox.h +++ b/include/wx/qt/radiobox.h @@ -68,6 +68,7 @@ public: virtual bool Enable(unsigned int n, bool enable = true) wxOVERRIDE; virtual bool Enable(bool enable = true) wxOVERRIDE; virtual bool Show(unsigned int n, bool show = true) wxOVERRIDE; + virtual bool Show(bool show = true) wxOVERRIDE; virtual bool IsItemEnabled(unsigned int n) const wxOVERRIDE; virtual bool IsItemShown(unsigned int n) const wxOVERRIDE; diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index b02c5a1596..b8c82a8a37 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -217,10 +217,43 @@ bool wxRadioBox::Enable( bool enable ) bool wxRadioBox::Show(unsigned int n, bool show) { - QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, n ); - CHECK_BUTTON( qtButton, false ); + if ( show && !m_qtGroupBox->isVisible() ) + { + m_qtGroupBox->setVisible(true); + + for ( unsigned int i = 0; i < GetCount(); ++i ) + { + QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, i ); + CHECK_BUTTON( qtButton, false ); + + i == n ? qtButton->setVisible( true ) : qtButton->setVisible( false ); + } + } + else + { + QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, n ); + CHECK_BUTTON( qtButton, false ); + + qtButton->setVisible( show ); + } + + return true; +} + +bool wxRadioBox::Show( bool show ) +{ + if( m_qtGroupBox->isVisible() == show ) + { + for( unsigned int i = 0; i < GetCount(); ++i ) + { + QAbstractButton *qtButton = GetButtonAt( m_qtButtonGroup, i ); + CHECK_BUTTON( qtButton, false ); + qtButton->setVisible( show ); + } + } + + m_qtGroupBox->setVisible( show ); - qtButton->setVisible( show ); return true; } From 3a24beca62c1130b887bb53ef40de5076a11e257 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 12 Dec 2018 18:01:41 +0100 Subject: [PATCH 071/553] Document that wxDataViewCtrl now always expands its last column This has been changed back in 4156e1a5c94283cb037132518dfb80dbc1403e12 and is a (mildly) incompatible change, so document it in the appropriate change log section. See #18295. --- docs/changes.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index fd1b14acb7..b5779afb0b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -94,6 +94,9 @@ Changes in behaviour which may result in build errors not long. Its return value hasn't changed, however, and is still always either true or false, so normally the existing code should continue to work. +- Generic wxDataViewCtrl now always resizes its last column to fill all the + available space, as the GTK+ version always did. + - configure only accepts the options it knows about now and doesn't silently ignore all the rest. If you get errors about unknown options, you may either specify --disable-option-checking argument to continue accepting them (which From 6c5c9e578b7e6feb826f47ad7776ca84ee91973b Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 12 Dec 2018 09:21:14 +0000 Subject: [PATCH 072/553] wxCarioContext:Flush now draws back to the QT image wxCairoContext::Flush was flushing back to the internal image but this image wasn't drawn back to the QPainter until the wxCarioContext instance was destroyed. This fix ensure that after a call to Flush, anything drawn by Cario is drawn back to the QImage. Closes https://github.com/wxWidgets/wxWidgets/pull/1068 --- src/generic/graphicc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index ebebea96df..a610eabf64 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -2566,6 +2566,7 @@ void wxCairoContext::Flush() if ( m_qtSurface ) { cairo_surface_flush(m_qtSurface); + m_qtPainter->drawImage( 0,0, *m_qtImage ); } #endif } From 331dc1fdfe3aa1a2df6c0fa97ffe2bd2c92b2b24 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 12 Dec 2018 09:59:49 +0000 Subject: [PATCH 073/553] Change wxFont::GetEncoding to return UTF8 for wxQt QT doesn't have the concept of font encoding and is generally Unicode aware throughout. The previous implementation of wxFont::GetEncoding for wxQT returned a nonsensical value. Closes https://github.com/wxWidgets/wxWidgets/pull/1070 --- src/qt/font.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qt/font.cpp b/src/qt/font.cpp index 7e328d099a..c01903ec42 100644 --- a/src/qt/font.cpp +++ b/src/qt/font.cpp @@ -451,10 +451,7 @@ wxFontFamily wxNativeFontInfo::GetFamily() const wxFontEncoding wxNativeFontInfo::GetEncoding() const { -// QFontInfo info = QFontInfo(m_qtFont); - wxMISSING_IMPLEMENTATION( __FUNCTION__ ); - - return wxFONTENCODING_MAX; + return wxFONTENCODING_UTF8; } void wxNativeFontInfo::SetFractionalPointSize(float pointsize) From ac55d06bc194acf704b1b6b10ad73ded8d9de779 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 12 Dec 2018 10:27:11 +0000 Subject: [PATCH 074/553] Fix a crash when setting a menu icon to a null bitmap in wxQt Previous implementation didn't take into account that wxBitmap::GetHandle() could return NULL for wxQt. Specifically when wxBitmap::IsNull returns true. Closes https://github.com/wxWidgets/wxWidgets/pull/1071 --- src/qt/menuitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qt/menuitem.cpp b/src/qt/menuitem.cpp index fa729e33de..59f82e32a2 100644 --- a/src/qt/menuitem.cpp +++ b/src/qt/menuitem.cpp @@ -111,7 +111,10 @@ void wxMenuItem::SetBitmap(const wxBitmap& bitmap) if ( m_kind == wxITEM_NORMAL ) { m_bitmap = bitmap; - m_qtAction->setIcon( QIcon( *m_bitmap.GetHandle() ) ); + if ( !m_bitmap.IsNull() ) + { + m_qtAction->setIcon( QIcon(*m_bitmap.GetHandle()) ); + } } else { From 9f21af693c0cebc5ddfb94dfc1eef9287ae892db Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 9 Dec 2018 15:51:14 +0100 Subject: [PATCH 075/553] CMake: Install wxrc on all platforms, closes #18289 --- build/cmake/utils/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt index a242fdec66..21acfa3dfe 100644 --- a/build/cmake/utils/CMakeLists.txt +++ b/build/cmake/utils/CMakeLists.txt @@ -20,8 +20,8 @@ if(wxUSE_XRC) set_target_properties(wxrc PROPERTIES FOLDER "Utilities") + wx_install(TARGETS wxrc RUNTIME DESTINATION "bin") if(UNIX) - wx_install(TARGETS wxrc RUNTIME DESTINATION "bin") install(CODE "execute_process( \ COMMAND ${CMAKE_COMMAND} -E rename \ ${CMAKE_INSTALL_PREFIX}/bin/wxrc \ From 981555b7889a3d31f874915d01c5b36d2b6e4175 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 9 Dec 2018 15:55:04 +0100 Subject: [PATCH 076/553] CMake: Do not add -pthread to link flags with clang on Windows It causes argument unused warnings. --- build/cmake/functions.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 088d685eb2..dfab1ccc95 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -105,9 +105,13 @@ function(wx_set_common_target_properties target_name) endif() # TODO: add warning flags for other compilers endif() + if(CMAKE_USE_PTHREADS_INIT) target_compile_options(${target_name} PRIVATE "-pthread") - set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-pthread") + # clang++.exe: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument] + if(NOT (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) + set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-pthread") + endif() endif() endfunction() From 0665db6c1d8004978bedda4e58d934c014688396 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Tue, 11 Dec 2018 20:36:47 +0100 Subject: [PATCH 077/553] CMake: Fix html zip sample dependency check --- build/cmake/samples/html.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/cmake/samples/html.cmake b/build/cmake/samples/html.cmake index 402d0618d2..a13c405e9f 100644 --- a/build/cmake/samples/html.cmake +++ b/build/cmake/samples/html.cmake @@ -37,7 +37,7 @@ wx_add_sample(test LIBRARIES net html NAME htmltest) wx_add_sample(virtual DATA start.htm LIBRARIES html) wx_add_sample(widget DATA start.htm LIBRARIES html) -wx_add_sample(zip DATA pages.zip start.htm LIBRARIES html DEPENDS wxUSE_FSZIP) +wx_add_sample(zip DATA pages.zip start.htm LIBRARIES html DEPENDS wxUSE_FS_ZIP) set(wxSAMPLE_SUBDIR) set(wxSAMPLE_FOLDER) From 79344fc5b6f0a561b4ec6e6ec52e4149929ab9f6 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Tue, 11 Dec 2018 20:37:41 +0100 Subject: [PATCH 078/553] CMake: Fix locale_t type check Test failed when xlocale.h did not exist. --- build/cmake/setup.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index 5656b9dc30..c3d66de91e 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -641,7 +641,10 @@ endif() if(wxUSE_XLOCALE) check_include_file(xlocale.h HAVE_XLOCALE_H) - set(CMAKE_EXTRA_INCLUDE_FILES xlocale.h locale.h) + set(CMAKE_EXTRA_INCLUDE_FILES locale.h) + if(HAVE_XLOCALE_H) + list(APPEND CMAKE_EXTRA_INCLUDE_FILES xlocale.h) + endif() check_type_size(locale_t LOCALE_T) set(CMAKE_EXTRA_INCLUDE_FILES) endif() From 14570b4fa3f385c979601148d4804a66bab09209 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Tue, 11 Dec 2018 20:49:14 +0100 Subject: [PATCH 079/553] CMake: Find more external libraries Check for LibNotify, MSpack, XTest and GnomeVFS2. --- build/cmake/init.cmake | 53 +++++++++++++++ build/cmake/lib/core/CMakeLists.txt | 4 ++ build/cmake/lib/html/CMakeLists.txt | 7 +- build/cmake/modules/FindGnomeVFS2.cmake | 90 +++++++++++++++++++++++++ build/cmake/modules/FindLibNotify.cmake | 55 +++++++++++++++ build/cmake/modules/FindMSPACK.cmake | 40 +++++++++++ build/cmake/modules/FindXTest.cmake | 51 ++++++++++++++ build/cmake/options.cmake | 6 +- 8 files changed, 304 insertions(+), 2 deletions(-) create mode 100644 build/cmake/modules/FindGnomeVFS2.cmake create mode 100644 build/cmake/modules/FindLibNotify.cmake create mode 100644 build/cmake/modules/FindMSPACK.cmake create mode 100644 build/cmake/modules/FindXTest.cmake diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index b5b207924a..462bb50729 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -295,4 +295,57 @@ if(wxUSE_GUI) wx_option_force_value(wxUSE_LIBSDL OFF) endif() endif() + + if(wxUSE_NOTIFICATION_MESSAGE AND UNIX AND WXGTK2 AND wxUSE_LIBNOTIFY) + find_package(LibNotify) + if(NOT LIBNOTIFY_FOUND) + message(WARNING "Libnotify not found, it won't be used for notifications") + wx_option_force_value(wxUSE_LIBNOTIFY OFF) + elseif((LIBNOTIFY_VERSION GREATER 0.7) OR (LIBNOTIFY_VERSION EQUAL 0.7)) + set(wxUSE_LIBNOTIFY_0_7 ON) + endif() + endif() + + if(wxUSE_UIACTIONSIMULATOR AND UNIX AND WXGTK) + if(wxUSE_XTEST) + find_package(XTest) + if(XTEST_FOUND) + list(APPEND wxTOOLKIT_INCLUDE_DIRS ${XTEST_INCLUDE_DIRS}) + list(APPEND wxTOOLKIT_LIBRARIES ${XTEST_LIBRARIES}) + else() + if(WXGTK3) + # This class can't work without XTest with GTK+ 3 + # which uses XInput2 and so ignores XSendEvent(). + message(STATUS "XTest not found, wxUIActionSimulator won't be available") + wx_option_force_value(wxUSE_UIACTIONSIMULATOR OFF) + endif() + # The other ports can use XSendEvent(), so don't warn + wx_option_force_value(wxUSE_XTEST OFF) + endif() + else(WXGTK3) + # As per above, wxUIActionSimulator can't be used in this case, + # but there is no need to warn, presumably the user knows what + # he's doing if wxUSE_XTEST was explicitly disabled. + wx_option_force_value(wxUSE_UIACTIONSIMULATOR OFF) + endif() + endif() + + if(wxUSE_HTML AND UNIX AND wxUSE_LIBMSPACK) + find_package(MSPACK) + if(NOT MSPACK_FOUND) + message(STATUS "libmspack not found") + wx_option_force_value(wxUSE_LIBMSPACK OFF) + endif() + endif() + + if(WXGTK2 AND wxUSE_MIMETYPE AND wxUSE_LIBGNOMEVFS) + find_package(GnomeVFS2) + if(GNOMEVFS2_FOUND) + list(APPEND wxTOOLKIT_INCLUDE_DIRS ${GNOMEVFS2_INCLUDE_DIRS}) + list(APPEND wxTOOLKIT_LIBRARIES ${GNOMEVFS2_LIBRARIES}) + else() + message(STATUS "libgnomevfs not found, library won't be used to associate MIME type") + wx_option_force_value(wxUSE_LIBGNOMEVFS OFF) + endif() + endif() endif() diff --git a/build/cmake/lib/core/CMakeLists.txt b/build/cmake/lib/core/CMakeLists.txt index 54c2810051..439b4c567b 100644 --- a/build/cmake/lib/core/CMakeLists.txt +++ b/build/cmake/lib/core/CMakeLists.txt @@ -86,5 +86,9 @@ if(UNIX AND wxUSE_LIBSDL) wx_lib_link_libraries(core PUBLIC ${SDL_LIBRARY}) endif() endif() +if(wxUSE_LIBNOTIFY) + wx_lib_include_directories(core PUBLIC ${LIBNOTIFY_INCLUDE_DIRS}) + wx_lib_link_libraries(core PUBLIC ${LIBNOTIFY_LIBRARIES}) +endif() wx_finalize_lib(core) diff --git a/build/cmake/lib/html/CMakeLists.txt b/build/cmake/lib/html/CMakeLists.txt index b9dbd5a553..d4b8b6d19c 100644 --- a/build/cmake/lib/html/CMakeLists.txt +++ b/build/cmake/lib/html/CMakeLists.txt @@ -11,10 +11,15 @@ include(../../source_groups.cmake) wx_append_sources(HTML_FILES HTML_CMN) -if(WIN32) +if(WIN32 OR wxUSE_LIBMSPACK) wx_append_sources(HTML_FILES HTML_MSW) endif() wx_add_library(html ${HTML_FILES}) +if(wxUSE_LIBMSPACK) + wx_lib_include_directories(html PRIVATE ${MSPACK_INCLUDE_DIRS}) + wx_lib_link_libraries(html PRIVATE ${MSPACK_LIBRARIES}) +endif() + wx_finalize_lib(html) diff --git a/build/cmake/modules/FindGnomeVFS2.cmake b/build/cmake/modules/FindGnomeVFS2.cmake new file mode 100644 index 0000000000..d942addac3 --- /dev/null +++ b/build/cmake/modules/FindGnomeVFS2.cmake @@ -0,0 +1,90 @@ +# - Try to find GnomeVFS2 +# Once done this will define +# +# GNOMEVFS2_FOUND - system has GnomeVFS2 +# GNOMEVFS2_INCLUDE_DIRS - the GnomeVFS2 include directory +# GNOMEVFS2_LIBRARIES - Link these to use GnomeVFS2 +# GNOMEVFS2_DEFINITIONS - Compiler switches required for using GnomeVFS2 +# +# Copyright (c) 2008 Joshua L. Blocher +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS) + # in cache already + set(GNOMEVFS2_FOUND TRUE) +else (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + include(UsePkgConfig) + pkgconfig(gnome-vfs-2.0 _GNOMEVFS2_INCLUDEDIR _GNOMEVFS2_LIBDIR _GNOMEVFS2_LDFLAGS _GNOMEVFS2_CFLAGS) + else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(_GNOMEVFS2 gnome-vfs-2.0) + endif (PKG_CONFIG_FOUND) + endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_path(GNOMEVFS2_INCLUDE_DIR + NAMES + libgnomevfs/gnome-vfs.h + PATHS + ${_GNOMEVFS2_INCLUDEDIR} + /usr/include + /usr/local/include + /opt/local/include + /sw/include + $ENV{DEVLIBS_PATH}//include// + PATH_SUFFIXES + gnome-vfs-2.0 + ) + + find_library(GNOMEVFS-2_LIBRARY + NAMES + gnomevfs-2 + PATHS + ${_GNOMEVFS2_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + if (GNOMEVFS-2_LIBRARY) + set(GNOMEVFS-2_FOUND TRUE) + endif (GNOMEVFS-2_LIBRARY) + + set(GNOMEVFS2_INCLUDE_DIRS + ${GNOMEVFS2_INCLUDE_DIR} + ) + + if (GNOMEVFS-2_FOUND) + set(GNOMEVFS2_LIBRARIES + ${GNOMEVFS2_LIBRARIES} + ${GNOMEVFS-2_LIBRARY} + ) + endif (GNOMEVFS-2_FOUND) + + if (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES) + set(GNOMEVFS2_FOUND TRUE) + endif (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES) + + if (GNOMEVFS2_FOUND) + if (NOT GnomeVFS2_FIND_QUIETLY) + message(STATUS "Found GnomeVFS2: ${GNOMEVFS2_LIBRARIES}") + endif (NOT GnomeVFS2_FIND_QUIETLY) + else (GNOMEVFS2_FOUND) + if (GnomeVFS2_FIND_REQUIRED) + message(FATAL_ERROR "Could not find GnomeVFS2") + endif (GnomeVFS2_FIND_REQUIRED) + endif (GNOMEVFS2_FOUND) + + # show the GNOMEVFS2_INCLUDE_DIRS and GNOMEVFS2_LIBRARIES variables only in the advanced view + mark_as_advanced(GNOMEVFS2_INCLUDE_DIRS GNOMEVFS2_LIBRARIES) + +endif (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS) + diff --git a/build/cmake/modules/FindLibNotify.cmake b/build/cmake/modules/FindLibNotify.cmake new file mode 100644 index 0000000000..e76b199ba7 --- /dev/null +++ b/build/cmake/modules/FindLibNotify.cmake @@ -0,0 +1,55 @@ +# - Try to find LibNotify +# This module defines the following variables: +# +# LIBNOTIFY_FOUND - LibNotify was found +# LIBNOTIFY_INCLUDE_DIRS - the LibNotify include directories +# LIBNOTIFY_LIBRARIES - link these to use LibNotify +# +# Copyright (C) 2012 Raphael Kubo da Costa +# Copyright (C) 2014 Collabora Ltd. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(LIBNOTIFY QUIET libnotify) + +find_path(LIBNOTIFY_INCLUDE_DIRS + NAMES notify.h + HINTS ${LIBNOTIFY_INCLUDEDIR} + ${LIBNOTIFY_INCLUDE_DIRS} + PATH_SUFFIXES libnotify +) + +find_library(LIBNOTIFY_LIBRARIES + NAMES notify + HINTS ${LIBNOTIFY_LIBDIR} + ${LIBNOTIFY_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibNotify REQUIRED_VARS LIBNOTIFY_INCLUDE_DIRS LIBNOTIFY_LIBRARIES + VERSION_VAR LIBNOTIFY_VERSION) + +mark_as_advanced( + LIBNOTIFY_INCLUDE_DIRS + LIBNOTIFY_LIBRARIES +) diff --git a/build/cmake/modules/FindMSPACK.cmake b/build/cmake/modules/FindMSPACK.cmake new file mode 100644 index 0000000000..c82e8caa60 --- /dev/null +++ b/build/cmake/modules/FindMSPACK.cmake @@ -0,0 +1,40 @@ +## FindMSPACK.cmake +## +## Copyright (C) 2016 Christian Schenk +## +## This file is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published +## by the Free Software Foundation; either version 2, or (at your +## option) any later version. +## +## This file is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this file; if not, write to the Free Software +## Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +## USA. + +find_path(MSPACK_INCLUDE_DIR + NAMES + mspack.h +) + +find_library(MSPACK_LIBRARY + NAMES + mspack +) + +find_package_handle_standard_args(MSPACK DEFAULT_MSG MSPACK_LIBRARY MSPACK_INCLUDE_DIR) + +if(MSPACK_FOUND) + set(MSPACK_INCLUDE_DIRS ${MSPACK_INCLUDE_DIR}) + set(MSPACK_LIBRARIES ${MSPACK_LIBRARY}) +else() + set(MSPACK_INCLUDE_DIRS) + set(MSPACK_LIBRARIES) +endif() + +mark_as_advanced(MSPACK_LIBRARY MSPACK_INCLUDE_DIR) diff --git a/build/cmake/modules/FindXTest.cmake b/build/cmake/modules/FindXTest.cmake new file mode 100644 index 0000000000..8fb21f682e --- /dev/null +++ b/build/cmake/modules/FindXTest.cmake @@ -0,0 +1,51 @@ +# - Find XTEST +# Find the XTEST libraries +# +# This module defines the following variables: +# XTEST_FOUND - true if XTEST_INCLUDE_DIR & XTEST_LIBRARY are found +# XTEST_LIBRARIES - Set when XTEST_LIBRARY is found +# XTEST_INCLUDE_DIRS - Set when XTEST_INCLUDE_DIR is found +# +# XTEST_INCLUDE_DIR - where to find XTest.h, etc. +# XTEST_LIBRARY - the XTEST library +# + +#============================================================================= +# Copyright 2011 O.S. Systems Software Ltda. +# Copyright 2011 Otavio Salvador +# Copyright 2011 Marc-Andre Moreau +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +find_path(XTEST_INCLUDE_DIR NAMES X11/extensions/XTest.h + PATH_SUFFIXES X11/extensions + PATHS /opt/X11/include + DOC "The XTest include directory" +) + +find_library(XTEST_LIBRARY NAMES Xtst + PATHS /opt/X11/lib + DOC "The XTest library" +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(XTest DEFAULT_MSG XTEST_LIBRARY XTEST_INCLUDE_DIR) + +if(XTEST_FOUND) + set( XTEST_LIBRARIES ${XTEST_LIBRARY} ) + set( XTEST_INCLUDE_DIRS ${XTEST_INCLUDE_DIR} ) +endif() + +mark_as_advanced(XTEST_INCLUDE_DIR XTEST_LIBRARY) + diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 1ea8458bda..df57e1023b 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -76,8 +76,12 @@ set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBLZMA "use liblzm wx_option(wxUSE_OPENGL "use OpenGL (or Mesa)") wx_option(wxUSE_LIBSDL "use SDL for audio on Unix") -if(NOT WIN32) +if(UNIX) wx_option(wxUSE_LIBICONV "use libiconv (character conversion)") + wx_option(wxUSE_LIBNOTIFY "use libnotify for notifications") + wx_option(wxUSE_XTEST "use XTest extension") + wx_option(wxUSE_LIBMSPACK "use libmspack (CHM help files loading)") + wx_option(wxUSE_LIBGNOMEVFS "use GNOME VFS for associating MIME types") endif() # --------------------------------------------------------------------------- From b9d31dffc5e3c97c54a3569e1700506aa0c33543 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 12 Dec 2018 20:37:14 +0100 Subject: [PATCH 080/553] CMake: Improve finding Iconv Continue when Iconv can not be found. Silence warnings when testing if second argument for iconv() is const. Use correct include dir. --- build/cmake/init.cmake | 26 ++++++++++++++++++-------- build/cmake/lib/base/CMakeLists.txt | 4 ++-- build/cmake/modules/FindIconv.cmake | 2 ++ build/cmake/setup.cmake | 9 ++++----- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 462bb50729..9738f69859 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -154,15 +154,25 @@ if(wxUSE_LIBLZMA) find_package(LibLZMA REQUIRED) endif() -if(UNIX AND wxUSE_SECRETSTORE) - # The required APIs are always available under MSW and OS X but we must - # have GNOME libsecret under Unix to be able to compile this class. - find_package(Libsecret REQUIRED) - if(NOT LIBSECRET_FOUND) - message(WARNING "libsecret not found, wxSecretStore won't be available") - wx_option_force_value(wxUSE_SECRETSTORE OFF) +if(UNIX) + if(wxUSE_SECRETSTORE) + # The required APIs are always available under MSW and OS X but we must + # have GNOME libsecret under Unix to be able to compile this class. + find_package(Libsecret REQUIRED) + if(NOT LIBSECRET_FOUND) + message(WARNING "libsecret not found, wxSecretStore won't be available") + wx_option_force_value(wxUSE_SECRETSTORE OFF) + endif() endif() -endif() + + if(wxUSE_LIBICONV) + find_package(Iconv) + if(NOT ICONV_FOUND) + message(WARNING "iconv not found") + wx_option_force_value(wxUSE_LIBICONV OFF) + endif() + endif() +endif(UNIX) if(wxUSE_GUI) if(WXMSW AND wxUSE_METAFILE) diff --git a/build/cmake/lib/base/CMakeLists.txt b/build/cmake/lib/base/CMakeLists.txt index 8f526afebe..08a1f74f22 100644 --- a/build/cmake/lib/base/CMakeLists.txt +++ b/build/cmake/lib/base/CMakeLists.txt @@ -48,8 +48,8 @@ if(UNIX AND wxUSE_SECRETSTORE) wx_lib_include_directories(base PRIVATE ${LIBSECRET_INCLUDE_DIRS}) wx_lib_link_libraries(base PRIVATE ${LIBSECRET_LIBRARIES}) endif() -if(wxUSE_LIBICONV AND ICONV_FOUND) - wx_lib_include_directories(base PRIVATE ${ICONV_INCLUDE_DIRS}) +if(wxUSE_LIBICONV) + wx_lib_include_directories(base PRIVATE ${ICONV_INCLUDE_DIR}) wx_lib_link_libraries(base PRIVATE ${ICONV_LIBRARIES}) endif() if(wxUSE_THREADS AND CMAKE_THREAD_LIBS_INIT) diff --git a/build/cmake/modules/FindIconv.cmake b/build/cmake/modules/FindIconv.cmake index 79e4b34f37..9d95da030b 100644 --- a/build/cmake/modules/FindIconv.cmake +++ b/build/cmake/modules/FindIconv.cmake @@ -25,6 +25,7 @@ ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) +set(CMAKE_REQUIRED_QUIET ON) IF(ICONV_FOUND) check_cxx_source_compiles(" #include @@ -41,6 +42,7 @@ IF(ICONV_FOUND) ENDIF(ICONV_FOUND) set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) +set(CMAKE_REQUIRED_QUIET) IF(ICONV_FOUND) IF(NOT ICONV_FIND_QUIETLY) diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index c3d66de91e..a102731af9 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -217,9 +217,8 @@ macro(wx_get_socket_param_type name code) endmacro() # the following tests are for Unix(like) systems only -if(NOT WIN32) - if(wxUSE_LIBICONV AND NOT APPLE) - find_package(Iconv REQUIRED) +if(UNIX) + if(wxUSE_LIBICONV) set(HAVE_ICONV ON) set(ICONV_CONST " ") if(ICONV_SECOND_ARGUMENT_IS_CONST) @@ -419,8 +418,8 @@ if(NOT WIN32) check_symbol_exists(getservbyname netdb.h HAVE_GETSERVBYNAME) check_symbol_exists(inet_aton arpa/inet.h HAVE_INET_ATON) check_symbol_exists(inet_addr arpa/inet.h HAVE_INET_ADDR) - endif() # wxUSE_SOCKETS -endif() # NOT WIN32 + endif(wxUSE_SOCKETS) +endif(UNIX) if(CMAKE_USE_PTHREADS_INIT) cmake_push_check_state(RESET) From 042b17512ec222cf597692c042b33dfdf697e797 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 12 Dec 2018 20:38:32 +0100 Subject: [PATCH 081/553] CMake: Check for libSDL only on Unix --- build/cmake/lib/core/CMakeLists.txt | 2 +- build/cmake/options.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/cmake/lib/core/CMakeLists.txt b/build/cmake/lib/core/CMakeLists.txt index 439b4c567b..e991c3d3e3 100644 --- a/build/cmake/lib/core/CMakeLists.txt +++ b/build/cmake/lib/core/CMakeLists.txt @@ -77,7 +77,7 @@ if(WXGTK AND wxUSE_PRIVATE_FONTS) wx_lib_include_directories(core PUBLIC ${FONTCONFIG_INCLUDE_DIR}) wx_lib_link_libraries(core PUBLIC ${FONTCONFIG_LIBRARIES}) endif() -if(UNIX AND wxUSE_LIBSDL) +if(wxUSE_LIBSDL) if(SDL2_FOUND) wx_lib_include_directories(core PUBLIC ${SDL2_INCLUDE_DIR}) wx_lib_link_libraries(core PUBLIC ${SDL2_LIBRARY}) diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index df57e1023b..948e1fa414 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -74,9 +74,9 @@ wx_option(wxUSE_LIBLZMA "use LZMA compression" OFF) set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBLZMA "use liblzma for LZMA compression") wx_option(wxUSE_OPENGL "use OpenGL (or Mesa)") -wx_option(wxUSE_LIBSDL "use SDL for audio on Unix") if(UNIX) + wx_option(wxUSE_LIBSDL "use SDL for audio on Unix") wx_option(wxUSE_LIBICONV "use libiconv (character conversion)") wx_option(wxUSE_LIBNOTIFY "use libnotify for notifications") wx_option(wxUSE_XTEST "use XTest extension") From 91b6305dcd057faaa922e8ed645b732410ce2a92 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 12 Dec 2018 20:41:37 +0100 Subject: [PATCH 082/553] CMake: Improve checking for external libraries Do not abort when libLZMA or libSecret can not be found, just show a warning. Do not search for libSecret on macOS. Disable libraries internally (not in cache) when not searching for them. --- build/cmake/init.cmake | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 9738f69859..2d67e48c90 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -151,14 +151,18 @@ if(wxUSE_THREADS) endif() if(wxUSE_LIBLZMA) - find_package(LibLZMA REQUIRED) + find_package(LibLZMA) + if(NOT LIBLZMA_FOUND) + message(WARNING "libLZMA not found, LZMA compression won't be available") + wx_option_force_value(wxUSE_LIBLZMA OFF) + endif() endif() if(UNIX) - if(wxUSE_SECRETSTORE) + if(wxUSE_SECRETSTORE AND NOT APPLE) # The required APIs are always available under MSW and OS X but we must # have GNOME libsecret under Unix to be able to compile this class. - find_package(Libsecret REQUIRED) + find_package(Libsecret) if(NOT LIBSECRET_FOUND) message(WARNING "libsecret not found, wxSecretStore won't be available") wx_option_force_value(wxUSE_SECRETSTORE OFF) @@ -293,9 +297,12 @@ if(wxUSE_GUI) message(WARNING "GStreamer not found, wxMediaCtrl won't be available") wx_option_force_value(wxUSE_MEDIACTRL OFF) endif() + else() + set(wxUSE_GSTREAMER OFF) + set(wxUSE_GSTREAMER_PLAYER OFF) endif() - if(UNIX AND wxUSE_LIBSDL) + if(wxUSE_SOUND AND UNIX AND wxUSE_LIBSDL) find_package(SDL2) if(NOT SDL2_FOUND) find_package(SDL) @@ -304,6 +311,8 @@ if(wxUSE_GUI) message(WARNING "SDL not found, SDL Audio back-end won't be available") wx_option_force_value(wxUSE_LIBSDL OFF) endif() + else() + set(wxUSE_LIBSDL OFF) endif() if(wxUSE_NOTIFICATION_MESSAGE AND UNIX AND WXGTK2 AND wxUSE_LIBNOTIFY) @@ -314,6 +323,8 @@ if(wxUSE_GUI) elseif((LIBNOTIFY_VERSION GREATER 0.7) OR (LIBNOTIFY_VERSION EQUAL 0.7)) set(wxUSE_LIBNOTIFY_0_7 ON) endif() + else() + set(wxUSE_LIBNOTIFY OFF) endif() if(wxUSE_UIACTIONSIMULATOR AND UNIX AND WXGTK) @@ -346,6 +357,8 @@ if(wxUSE_GUI) message(STATUS "libmspack not found") wx_option_force_value(wxUSE_LIBMSPACK OFF) endif() + else() + set(wxUSE_LIBMSPACK OFF) endif() if(WXGTK2 AND wxUSE_MIMETYPE AND wxUSE_LIBGNOMEVFS) @@ -357,5 +370,7 @@ if(wxUSE_GUI) message(STATUS "libgnomevfs not found, library won't be used to associate MIME type") wx_option_force_value(wxUSE_LIBGNOMEVFS OFF) endif() + else() + set(wxUSE_LIBGNOMEVFS OFF) endif() endif() From 5348b4fa3b4b91e7fedbbe42cc95fc862b081153 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 12 Dec 2018 20:43:17 +0100 Subject: [PATCH 083/553] CMake: Improve layout of third party libraries summary Add more external libraries to the summary, like configure does. --- build/cmake/functions.cmake | 32 ++++++++++++++++++++++++++------ build/cmake/options.cmake | 4 ++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index dfab1ccc95..6e0e528c0d 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -524,16 +524,36 @@ function(wx_add_thirdparty_library var_name lib_name help_str) endfunction() function(wx_print_thirdparty_library_summary) + set(nameLength 0) + set(nameValLength 0) set(var_name) - set(message "Which libraries should wxWidgets use?\n") - foreach(entry IN - LISTS wxTHIRD_PARTY_LIBRARIES - ITEMS wxUSE_STL "Use C++ STL classes") - + foreach(entry IN LISTS wxTHIRD_PARTY_LIBRARIES) if(NOT var_name) set(var_name ${entry}) else() - wx_string_append(message " ${var_name}: ${${var_name}} (${entry})\n") + string(LENGTH ${var_name} len) + if(len GREATER nameLength) + set(nameLength ${len}) + endif() + string(LENGTH ${${var_name}} len) + if(len GREATER nameValLength) + set(nameValLength ${len}) + endif() + set(var_name) + endif() + endforeach() + math(EXPR nameLength "${nameLength}+1") # account for : + + set(message "Which libraries should wxWidgets use?\n") + foreach(entry IN LISTS wxTHIRD_PARTY_LIBRARIES) + if(NOT var_name) + set(var_name ${entry}) + else() + set(namestr "${var_name}: ") + set(nameval "${${var_name}} ") + string(SUBSTRING ${namestr} 0 ${nameLength} namestr) + string(SUBSTRING ${nameval} 0 ${nameValLength} nameval) + wx_string_append(message " ${namestr} ${nameval} (${entry})\n") set(var_name) endif() endforeach() diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 948e1fa414..3a2a13d42a 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -46,6 +46,7 @@ endif() # STL options wx_option(wxUSE_STL "use standard C++ classes for everything" OFF) +set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_STL "use C++ STL classes") wx_dependent_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" ON "wxUSE_STL" OFF) wx_option(wxUSE_UNICODE "compile with Unicode support (NOT RECOMMENDED to be turned off)") @@ -82,6 +83,9 @@ if(UNIX) wx_option(wxUSE_XTEST "use XTest extension") wx_option(wxUSE_LIBMSPACK "use libmspack (CHM help files loading)") wx_option(wxUSE_LIBGNOMEVFS "use GNOME VFS for associating MIME types") + + set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBSDL "use SDL for audio on Unix") + set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBMSPACK "use libmspack (CHM help files loading)") endif() # --------------------------------------------------------------------------- From c1013d9bfcd0bf826d91fded00d7b682bbe9a63b Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 12 Dec 2018 20:43:50 +0100 Subject: [PATCH 084/553] CMake: Add more option validity checks --- build/cmake/init.cmake | 57 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 2d67e48c90..cbbdb81dbf 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -134,9 +134,6 @@ if(NOT wxUSE_EXPAT) set(wxUSE_XRC OFF) endif() set(wxUSE_XML ${wxUSE_XRC}) -if(wxUSE_CONFIG) - set(wxUSE_CONFIG_NATIVE ON) -endif() if(DEFINED wxUSE_OLE AND wxUSE_OLE) set(wxUSE_OLE_AUTOMATION ON) @@ -146,6 +143,60 @@ if(wxUSE_OPENGL) set(wxUSE_GLCANVAS ON) endif() +if(wxUSE_ARCHIVE_STREAMS AND NOT wxUSE_STREAMS) + message(WARNING "wxArchive requires wxStreams... disabled") + wx_option_force_value(wxUSE_ARCHIVE_STREAMS OFF) +endif() + +if(wxUSE_ZIPSTREAM AND (NOT wxUSE_ARCHIVE_STREAMS OR NOT wxUSE_ZLIB)) + message(WARNING "wxZip requires wxArchive or wxZlib... disabled") + wx_option_force_value(wxUSE_ZIPSTREAM OFF) +endif() + +if(wxUSE_TARSTREAM AND NOT wxUSE_ARCHIVE_STREAMS) + message(WARNING "wxTar requires wxArchive... disabled") + wx_option_force_value(wxUSE_TARSTREAM OFF) +endif() + +if(wxUSE_FILESYSTEM AND (NOT wxUSE_STREAMS OR (NOT wxUSE_FILE AND NOT wxUSE_FFILE))) + message(WARNING "wxFileSystem requires wxStreams and wxFile or wxFFile... disabled") + wx_option_force_value(wxUSE_FILESYSTEM OFF) +endif() + +if(wxUSE_FS_ARCHIVE AND (NOT wxUSE_FILESYSTEM OR NOT wxUSE_ARCHIVE_STREAMS)) + message(WARNING "wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled") + wx_option_force_value(wxUSE_FS_ARCHIVE OFF) +endif() + +if(wxUSE_FS_ARCHIVE AND (NOT wxUSE_FILESYSTEM OR NOT wxUSE_ARCHIVE_STREAMS)) + message(WARNING "wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled") + wx_option_force_value(wxUSE_FS_ARCHIVE OFF) +endif() + +if(wxUSE_FS_ZIP AND NOT wxUSE_FS_ARCHIVE) + message(WARNING "wxZipFSHandler requires wxArchiveFSHandler... disabled") + wx_option_force_value(wxUSE_FS_ZIP OFF) +endif() + +if(wxUSE_TEXTFILE AND (NOT wxUSE_FILE OR NOT wxUSE_TEXTBUFFER)) + message(WARNING "wxTextFile requires wxFile and wxTextBuffer... disabled") + wx_option_force_value(wxUSE_TEXTFILE OFF) +endif() + +if(wxUSE_CONFIG) + if(NOT wxUSE_TEXTFILE) + message(WARNING "wxConfig requires wxTextFile... disabled") + wx_option_force_value(wxUSE_CONFIG OFF) + else() + set(wxUSE_CONFIG_NATIVE ON) + endif() +endif() + +if(wxUSE_INTL AND NOT wxUSE_FILE) + message(WARNING "I18n code requires wxFile... disabled") + wx_option_force_value(wxUSE_INTL OFF) +endif() + if(wxUSE_THREADS) find_package(Threads REQUIRED) endif() From 141f0cb0e452293bc1df91a780e34d0b92bc34c1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 12 Dec 2018 23:45:09 +0100 Subject: [PATCH 085/553] Suppress harmless gcc missing initializers warnings in a test Suppressing the warnings is ugly but less ugly than explicitly specifying all the omitted elements in the array. --- tests/sizers/boxsizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sizers/boxsizer.cpp b/tests/sizers/boxsizer.cpp index 77c33cc9fb..2033e1f344 100644 --- a/tests/sizers/boxsizer.cpp +++ b/tests/sizers/boxsizer.cpp @@ -130,6 +130,8 @@ void BoxSizerTestCase::Size1() void BoxSizerTestCase::Size3() { + wxGCC_WARNING_SUPPRESS(missing-field-initializers) + // check that various combinations of minimal sizes and proportions work as // expected for different window sizes static const struct LayoutTestData @@ -189,6 +191,8 @@ void BoxSizerTestCase::Size3() { { 1, 2, 3, }, { 100, 100, 100, }, 0, { 0, 0, 0, }, true }, }; + wxGCC_WARNING_RESTORE(missing-field-initializers) + wxWindow *child[3]; child[0] = new wxWindow(m_win, wxID_ANY); child[1] = new wxWindow(m_win, wxID_ANY); From c95f668b217720372b9d448d5b12520c8fca7337 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Dec 2018 00:39:25 +0100 Subject: [PATCH 086/553] Fix use of dangling pointer in ButtonTestCase::Disabled() Fix the test added in dfec7aa0c08617ed61fc1ee04551aea19dc6abd0 which deleted the button pointer used by EventCounter by simply moving EventCounter initialization after the button re-creation. See #16385. --- tests/controls/buttontest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/controls/buttontest.cpp b/tests/controls/buttontest.cpp index 4f84523828..ffc4480f8c 100644 --- a/tests/controls/buttontest.cpp +++ b/tests/controls/buttontest.cpp @@ -98,8 +98,6 @@ void ButtonTestCase::Click() void ButtonTestCase::Disabled() { - EventCounter clicked(m_button, wxEVT_BUTTON); - wxUIActionSimulator sim; // In this test we disable the button and check events are not sent and we @@ -118,6 +116,8 @@ void ButtonTestCase::Disabled() m_button->Create(wxTheApp->GetTopWindow(), wxID_ANY, "wxButton"); } + EventCounter clicked(m_button, wxEVT_BUTTON); + sim.MouseMove(m_button->GetScreenPosition() + wxPoint(10, 10)); wxYield(); From b9fe8ca10c17c221020539bc5b337a33342afbf4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 12 Dec 2018 22:23:16 +0100 Subject: [PATCH 087/553] Try to use pkg-config for detecting libtiff in configure This is more reliable than checking whether we can link with the library manually and may work even if it's installed in a non-standard location. It also allows the user to specify PKG_CONFIG_PATH='pkg-config --static' when running configure to link with all transitional dependencies when linking statically. Closes https://github.com/wxWidgets/wxWidgets/pull/1073 See #18293. --- configure | 180 +++++++++++++++++++++++++++++++++++++++++++++++---- configure.in | 62 +++++++++++------- 2 files changed, 203 insertions(+), 39 deletions(-) diff --git a/configure b/configure index 031ff5c97b..f7dd626d22 100755 --- a/configure +++ b/configure @@ -977,6 +977,8 @@ GTK_CONFIG GTK_LIBS GTK_CFLAGS subdirs +LIBTIFF_LIBS +LIBTIFF_CFLAGS PKG_CONFIG AR HAVE_CXX17 @@ -1364,6 +1366,8 @@ CXX CXXFLAGS CCC PKG_CONFIG +LIBTIFF_CFLAGS +LIBTIFF_LIBS DIRECTFB_CFLAGS DIRECTFB_LIBS XMKMF @@ -2349,6 +2353,10 @@ Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags PKG_CONFIG path to pkg-config utility + LIBTIFF_CFLAGS + C compiler flags for LIBTIFF, overriding pkg-config + LIBTIFF_LIBS + linker flags for LIBTIFF, overriding pkg-config DIRECTFB_CFLAGS C compiler flags for DIRECTFB, overriding pkg-config DIRECTFB_LIBS @@ -23429,30 +23437,94 @@ fi TIFF_LINK= -TIFF_PREREQ_LINKS=-lm if test "$wxUSE_LIBTIFF" != "no" ; then $as_echo "#define wxUSE_LIBTIFF 1" >>confdefs.h if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then - if test "$wxUSE_LIBJPEG" = "sys"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK" + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBTIFF" >&5 +$as_echo_n "checking for LIBTIFF... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$LIBTIFF_CFLAGS"; then + pkg_cv_LIBTIFF_CFLAGS="$LIBTIFF_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtiff-4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBTIFF_CFLAGS=`$PKG_CONFIG --cflags "libtiff-4" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$LIBTIFF_LIBS"; then + pkg_cv_LIBTIFF_LIBS="$LIBTIFF_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtiff-4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtiff-4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBTIFF_LIBS=`$PKG_CONFIG --libs "libtiff-4" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBTIFF_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libtiff-4"` + else + LIBTIFF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libtiff-4"` fi - if test "$wxUSE_ZLIB" = "sys"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" - fi - if test -n "$LZMA_LINK"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $LZMA_LINK" - fi - if test "$wxUSE_LIBJBIG" = "yes"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JBIG_LINK" - fi - ac_fn_c_check_header_compile "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" " + # Put the nasty error message in config.log where it belongs + echo "$LIBTIFF_PKG_ERRORS" >&5 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via pkg-config" >&5 +$as_echo "not found via pkg-config" >&6; } + + TIFF_PREREQ_LINKS=-lm + + if test "$wxUSE_LIBJPEG" = "sys"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK" + fi + if test "$wxUSE_ZLIB" = "sys"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" + fi + if test -n "$LZMA_LINK"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $LZMA_LINK" + fi + if test "$wxUSE_LIBJBIG" = "yes"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JBIG_LINK" + fi + ac_fn_c_check_header_compile "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" " " if test "x$ac_cv_header_tiffio_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFError in -ltiff" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFError in -ltiff" >&5 $as_echo_n "checking for TIFFError in -ltiff... " >&6; } if ${ac_cv_lib_tiff_TIFFError+:} false; then : $as_echo_n "(cached) " >&6 @@ -23497,6 +23569,86 @@ fi +elif test $pkg_failed = untried; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via pkg-config" >&5 +$as_echo "not found via pkg-config" >&6; } + + TIFF_PREREQ_LINKS=-lm + + if test "$wxUSE_LIBJPEG" = "sys"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK" + fi + if test "$wxUSE_ZLIB" = "sys"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" + fi + if test -n "$LZMA_LINK"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $LZMA_LINK" + fi + if test "$wxUSE_LIBJBIG" = "yes"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JBIG_LINK" + fi + ac_fn_c_check_header_compile "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" " + +" +if test "x$ac_cv_header_tiffio_h" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFError in -ltiff" >&5 +$as_echo_n "checking for TIFFError in -ltiff... " >&6; } +if ${ac_cv_lib_tiff_TIFFError+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltiff $TIFF_PREREQ_LINKS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char TIFFError (); +int +main () +{ +return TIFFError (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tiff_TIFFError=yes +else + ac_cv_lib_tiff_TIFFError=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFError" >&5 +$as_echo "$ac_cv_lib_tiff_TIFFError" >&6; } +if test "x$ac_cv_lib_tiff_TIFFError" = xyes; then : + TIFF_LINK=" -ltiff" +fi + + +fi + + + +else + LIBTIFF_CFLAGS=$pkg_cv_LIBTIFF_CFLAGS + LIBTIFF_LIBS=$pkg_cv_LIBTIFF_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + TIFF_LINK=$LIBTIFF_LIBS + CFLAGS="$LIBTIFF_CFLAGS $CFLAGS" + +fi + if test "x$TIFF_LINK" = "x" ; then if test "$wxUSE_LIBTIFF" = "sys" ; then as_fn_error $? "system tiff library not found! Use --with-libtiff=builtin to use built-in version" "$LINENO" 5 diff --git a/configure.in b/configure.in index b2aadfa781..4b427d1804 100644 --- a/configure.in +++ b/configure.in @@ -2612,35 +2612,47 @@ dnl Check for tiff library dnl ------------------------------------------------------------------------ TIFF_LINK= -TIFF_PREREQ_LINKS=-lm if test "$wxUSE_LIBTIFF" != "no" ; then AC_DEFINE(wxUSE_LIBTIFF) if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then - dnl libtiff may depend on libjpeg and libz so use them in the test - dnl below or it would fail - if test "$wxUSE_LIBJPEG" = "sys"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK" - fi - if test "$wxUSE_ZLIB" = "sys"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" - fi - if test -n "$LZMA_LINK"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $LZMA_LINK" - fi - if test "$wxUSE_LIBJBIG" = "yes"; then - TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JBIG_LINK" - fi - AC_CHECK_HEADER(tiffio.h, - [ - AC_CHECK_LIB(tiff, TIFFError, - TIFF_LINK=" -ltiff", - , - $TIFF_PREREQ_LINKS) - ], - [], - [ ] - ) + dnl First try using pkg-config as it's the most reliable way to detect + dnl libtiff. + PKG_CHECK_MODULES(LIBTIFF, [libtiff-4], + [ + TIFF_LINK=$LIBTIFF_LIBS + CFLAGS="$LIBTIFF_CFLAGS $CFLAGS" + ], + [ + AC_MSG_RESULT([not found via pkg-config]) + + TIFF_PREREQ_LINKS=-lm + + dnl libtiff may depend on libjpeg and libz so use them in the test + dnl below or it would fail + if test "$wxUSE_LIBJPEG" = "sys"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK" + fi + if test "$wxUSE_ZLIB" = "sys"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" + fi + if test -n "$LZMA_LINK"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $LZMA_LINK" + fi + if test "$wxUSE_LIBJBIG" = "yes"; then + TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JBIG_LINK" + fi + AC_CHECK_HEADER(tiffio.h, + [ + AC_CHECK_LIB(tiff, TIFFError, + TIFF_LINK=" -ltiff", + , + $TIFF_PREREQ_LINKS) + ], + [], + [ ] + ) + ]) if test "x$TIFF_LINK" = "x" ; then if test "$wxUSE_LIBTIFF" = "sys" ; then From 5189781072cb5e360b7e1937b4187191351515b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Dec 2018 15:09:13 +0100 Subject: [PATCH 088/553] Move wxDataViewCtrl incompatibility note to the correct section 3a24beca62c1130b887bb53ef40de5076a11e257 added this in a wrong place, as this change does not result in any build errors. See #18295. --- docs/changes.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index ba32a67731..fc7fcb1e00 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -59,6 +59,9 @@ Changes in behaviour not resulting in compilation errors return just "N" under Linux and macOS. Use the new GetButtonOrdinal() to update the existing code if necessary. +- Generic wxDataViewCtrl now always resizes its last column to fill all the + available space, as the GTK+ version always did. + Changes in behaviour which may result in build errors ----------------------------------------------------- @@ -94,9 +97,6 @@ Changes in behaviour which may result in build errors not long. Its return value hasn't changed, however, and is still always either true or false, so normally the existing code should continue to work. -- Generic wxDataViewCtrl now always resizes its last column to fill all the - available space, as the GTK+ version always did. - - configure only accepts the options it knows about now and doesn't silently ignore all the rest. If you get errors about unknown options, you may either specify --disable-option-checking argument to continue accepting them (which From 89e4ee1ec0070d4db45cf2d4928b2c270493e22c Mon Sep 17 00:00:00 2001 From: chris2oph Date: Fri, 7 Dec 2018 11:18:53 +0000 Subject: [PATCH 089/553] Ensure items are sorted when added to wxChoice in wxQt Call sort() to resort the model after inserting a new item. Closes https://github.com/wxWidgets/wxWidgets/pull/1054 --- src/qt/choice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 19d074284a..02101b7562 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -148,6 +148,10 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, int wxChoice::DoInsertOneItem(const wxString& item, unsigned int pos) { m_qtComboBox->insertItem(pos, wxQtConvertString(item)); + + if ( IsSorted() ) + m_qtComboBox->model()->sort(0); + return pos; } From 013c6a6b6a5a645d3f918cd6bdfdc3e6b4c93b8f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Dec 2018 15:17:18 +0100 Subject: [PATCH 090/553] Speed up inserting many items in sorted wxChoice in wxQt Only sort the combobox once instead of doing it for every item. See https://github.com/wxWidgets/wxWidgets/pull/1054 --- src/qt/choice.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 02101b7562..2716a9c004 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -141,7 +141,28 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, wxClientDataType type) { InvalidateBestSize(); + + // Hack: to avoid resorting the model many times in DoInsertOneItem(), + // which will be called for each item from DoInsertItemsInLoop(), reset the + // wxCB_SORT style if we have it temporarily and only sort once at the end. + bool wasSorted = false; + if ( IsSorted() ) + { + wasSorted = true; + ToggleWindowStyle(wxCB_SORT); + } + int n = DoInsertItemsInLoop(items, pos, clientData, type); + + if ( wasSorted ) + { + // Restore the flag turned off above. + ToggleWindowStyle(wxCB_SORT); + + // And actually sort items now. + m_qtComboBox->model()->sort(0); + } + return n; } From db15e9988474840e9518c7d2a8f70648add5f370 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 12 Dec 2018 09:03:10 +0000 Subject: [PATCH 091/553] Fix wxBitmap::GetRawData() in wxQt This method used to return a dangling pointer to a temporary buffer, which resulted in a crash when using it, e.g. in the unit test. Fix this by keeping a QImage as a member in wxBitmapRefData, so that the pointer to its data remain valid until UngetRawData() is called. Also check that GetRawData() returns a non-null pointer in the test. Closes https://github.com/wxWidgets/wxWidgets/pull/1067 --- src/qt/bitmap.cpp | 25 +++++++++++++++---------- tests/graphics/bitmap.cpp | 1 + 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/qt/bitmap.cpp b/src/qt/bitmap.cpp index 6f632a1931..31f1380c06 100644 --- a/src/qt/bitmap.cpp +++ b/src/qt/bitmap.cpp @@ -144,6 +144,7 @@ class wxBitmapRefData: public wxGDIRefData virtual ~wxBitmapRefData() { delete m_mask; } QPixmap m_qtPixmap; + QImage m_rawPixelSource; wxMask *m_mask; private: @@ -409,17 +410,19 @@ void wxBitmap::SetDepth(int depth) void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) { void* bits = NULL; - // allow access if bpp is valid and matches existence of alpha - if ( !M_PIXDATA.isNull() ) + + wxBitmapRefData *refData = static_cast(m_refData); + + // allow access if bpp is valid + if ( !refData->m_qtPixmap.isNull() ) { - QImage qimage = M_PIXDATA.toImage(); - bool hasAlpha = M_PIXDATA.hasAlphaChannel(); - if ((bpp == 24 && !hasAlpha) || (bpp == 32 && hasAlpha)) + if ( bpp == 32 ) { - data.m_height = qimage.height(); - data.m_width = qimage.width(); - data.m_stride = qimage.bytesPerLine(); - bits = (void*) qimage.bits(); + refData->m_rawPixelSource = refData->m_qtPixmap.toImage().convertToFormat(QImage::Format_RGBA8888); + data.m_height = refData->m_rawPixelSource.height(); + data.m_width = refData->m_rawPixelSource.width(); + data.m_stride = refData->m_rawPixelSource.bytesPerLine(); + bits = refData->m_rawPixelSource.bits(); } } return bits; @@ -427,7 +430,9 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data)) { - wxMISSING_IMPLEMENTATION( __FUNCTION__ ); + wxBitmapRefData *refData = static_cast(m_refData); + refData->m_qtPixmap = QPixmap::fromImage(refData->m_rawPixelSource); + refData->m_rawPixelSource = QImage(); } QPixmap *wxBitmap::GetHandle() const diff --git a/tests/graphics/bitmap.cpp b/tests/graphics/bitmap.cpp index a93062e157..b07f348b08 100644 --- a/tests/graphics/bitmap.cpp +++ b/tests/graphics/bitmap.cpp @@ -126,6 +126,7 @@ void BitmapTestCase::OverlappingBlit() if ( m_bmp.GetDepth() == 32 ) { wxAlphaPixelData npd( m_bmp ); + CPPUNIT_ASSERT_MESSAGE( "Expected raw pixels to not be NULL", npd ); wxAlphaPixelData::Iterator it( npd ); ASSERT_EQUAL_RGB( it, 255, 0, 0 ); From 841c14c37c878dff35a552626c77c7d7a44ff558 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Dec 2018 18:50:18 +0100 Subject: [PATCH 092/553] Fix expanding last wxDataViewCtrl column in the generic version The code added in 4156e1a5c94283cb037132518dfb80dbc1403e12 didn't quite work correctly because it used the old size of the window, before it was resized, and not the new size. This was almost unnoticeable when drag-resizing the window, but very noticeable when maximizing the containing TLW, as could be seen on the 3rd page of the dataview sample, for example, where the last column kept its size instead of expanding. See #13904, #18295. --- src/generic/datavgen.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index f94700b072..c5aad72db8 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -5172,9 +5172,6 @@ wxSize wxDataViewCtrl::GetSizeAvailableForScrollTarget(const wxSize& size) void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) { - if ( m_clientArea && GetColumnCount() ) - m_clientArea->UpdateColumnSizes(); - // We need to override OnSize so that our scrolled // window a) does call Layout() to use sizers for // positioning the controls but b) does not query @@ -5186,6 +5183,11 @@ void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) AdjustScrollbars(); + // Update the last column size to take all the available space. Note that + // this must be done after calling Layout() to update m_clientArea size. + if ( m_clientArea && GetColumnCount() ) + m_clientArea->UpdateColumnSizes(); + // We must redraw the headers if their height changed. Normally this // shouldn't happen as the control shouldn't let itself be resized beneath // its minimal height but avoid the display artefacts that appear if it From 24054c95d8313cc41cb215f34352fc4d206473d1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Dec 2018 23:42:15 +0100 Subject: [PATCH 093/553] Prevent the user from resizing the last wxDataViewCtrl column This is useless as this column will be automatically expanded to fill all the available space anyhow. See #18295. --- include/wx/generic/dataview.h | 2 ++ src/generic/datavgen.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 815dfcb75b..2ee210ceac 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -107,6 +107,8 @@ public: return m_flags; } + virtual bool IsResizeable() const wxOVERRIDE; + virtual bool IsSortKey() const wxOVERRIDE { return m_sort; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index c5aad72db8..5df51937e1 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -256,6 +256,17 @@ void wxDataViewColumn::SetSortOrder(bool ascending) m_owner->OnColumnChange(idx); } +bool wxDataViewColumn::IsResizeable() const +{ + // The last column in generic wxDataViewCtrl is never resizeable by the + // user because it's always automatically expanded to consume all the + // available space, so prevent the user from resizing it. + if ( this == GetOwner()->GetColumn(GetOwner()->GetColumnCount() - 1) ) + return false; + + return wxDataViewColumnBase::IsResizeable(); +} + //----------------------------------------------------------------------------- // wxDataViewHeaderWindow //----------------------------------------------------------------------------- From 68bb67c009beb850cb5e59ea222071b051f112d4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Dec 2018 23:46:25 +0100 Subject: [PATCH 094/553] Revert "Prevent the user from resizing the last wxDataViewCtrl column" This reverts commit 24054c95d8313cc41cb215f34352fc4d206473d1 as it actually should be possible to increase the size of the last column, even if this shows the horizontal scroll bar. --- include/wx/generic/dataview.h | 2 -- src/generic/datavgen.cpp | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 2ee210ceac..815dfcb75b 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -107,8 +107,6 @@ public: return m_flags; } - virtual bool IsResizeable() const wxOVERRIDE; - virtual bool IsSortKey() const wxOVERRIDE { return m_sort; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 5df51937e1..c5aad72db8 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -256,17 +256,6 @@ void wxDataViewColumn::SetSortOrder(bool ascending) m_owner->OnColumnChange(idx); } -bool wxDataViewColumn::IsResizeable() const -{ - // The last column in generic wxDataViewCtrl is never resizeable by the - // user because it's always automatically expanded to consume all the - // available space, so prevent the user from resizing it. - if ( this == GetOwner()->GetColumn(GetOwner()->GetColumnCount() - 1) ) - return false; - - return wxDataViewColumnBase::IsResizeable(); -} - //----------------------------------------------------------------------------- // wxDataViewHeaderWindow //----------------------------------------------------------------------------- From 8fa32a40a97f7b01fc24d81db21a0a77cdf7b3d3 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 14 Dec 2018 10:12:35 +0000 Subject: [PATCH 095/553] Fix m_qtPainter not being initialised in wxCairoContext ctor For some reason one of the overloads of the c'tor left the m_qtPainter field set to NULL rather than asking the wxDC for it's painter. The rest of the class assumes the painter is not NULL. Closes https://github.com/wxWidgets/wxWidgets/pull/1075 --- src/generic/graphicc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index a610eabf64..d98e68756a 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1869,7 +1869,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxWindowDC& #endif #ifdef __WXQT__ - m_qtPainter = (QPainter*) dc.GetHandle(); + m_qtPainter = static_cast(dc.GetHandle()); // create a internal buffer (fallback if cairo_qt_surface is missing) m_qtImage = new QImage(width, height, QImage::Format_ARGB32_Premultiplied); // clear the buffer to be painted over the current contents @@ -2084,7 +2084,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxMemoryDC& #endif #ifdef __WXQT__ - m_qtPainter = NULL; + m_qtPainter = static_cast(dc.GetHandle()); // create a internal buffer (fallback if cairo_qt_surface is missing) m_qtImage = new QImage(width, height, QImage::Format_ARGB32_Premultiplied); // clear the buffer to be painted over the current contents From 2340a16d180472b1efc4009a693d7aaf0771f21c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 14:27:52 +0100 Subject: [PATCH 096/553] Allow increasing the size of the last column in wxDataViewCtrl Previously, the last column couldn't be effectively resized at all, as its size was always automatically set to the remaining width of the window after subtracting the widths of all the previous columns. Now this is only done if this remaining width is greater than the width given to the column by the user or by the program. Effectively, this means that the user can now drag-resize the column to increase its size (at the price of showing the horizontal scrollbar). See #18295. --- include/wx/generic/dataview.h | 12 ++++++++++++ samples/dataview/dataview.cpp | 2 +- src/generic/datavgen.cpp | 16 +++++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 815dfcb75b..bef6ab1f97 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -74,6 +74,11 @@ public: // UpdateWidth() if the width didn't really change, even if we don't // care about its return value. (void)WXUpdateWidth(width); + + // Do remember the last explicitly set width: this is used to prevent + // UpdateColumnSizes() from resizing the last column to be smaller than + // this size. + m_manuallySetWidth = width; } virtual int GetWidth() const wxOVERRIDE; @@ -137,9 +142,15 @@ public: m_width = width; UpdateWidth(); + // We must not update m_manuallySetWidth here as this method is called by + // UpdateColumnSizes() which resizes the column automatically, and not + // "manually". + return true; } + int WXGetManuallySetWidth() const { return m_manuallySetWidth; } + private: // common part of all ctors void Init(int width, wxAlignment align, int flags); @@ -152,6 +163,7 @@ private: wxString m_title; int m_width, + m_manuallySetWidth, m_minWidth; wxAlignment m_align; int m_flags; diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 51273a6106..9d654828d6 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -793,7 +793,7 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l lc->AppendColumn(colRadio, "bool"); lc->AppendTextColumn( "Text" ); - lc->AppendProgressColumn( "Progress" ); + lc->AppendProgressColumn( "Progress" )->SetMinWidth(100); wxVector data; for (unsigned int i=0; i<10; i++) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index c5aad72db8..80c7c7aa2c 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -180,7 +180,8 @@ wxTextCtrl *CreateEditorTextCtrl(wxWindow *parent, const wxRect& labelRect, cons void wxDataViewColumn::Init(int width, wxAlignment align, int flags) { - m_width = width; + m_width = + m_manuallySetWidth = width; m_minWidth = 0; m_align = align; m_flags = flags; @@ -5022,20 +5023,25 @@ void wxDataViewMainWindow::UpdateColumnSizes() int lastColX = colswidth - lastCol->GetWidth(); if ( lastColX < fullWinWidth ) { - int desiredWidth = wxMax(fullWinWidth - lastColX, lastCol->GetMinWidth()); - if ( !lastCol->WXUpdateWidth(desiredWidth) ) + const int availableWidth = fullWinWidth - lastColX; + + // Never make the column automatically smaller than the last width it + // was explicitly given nor its minimum width. + if ( availableWidth <= wxMax(lastCol->GetMinWidth(), + lastCol->WXGetManuallySetWidth()) ) { - // The column width didn't change, no need to do anything else. return; } + lastCol->WXUpdateWidth(availableWidth); + // All columns fit on screen, so we don't need horizontal scrolling. // To prevent flickering scrollbar when resizing the window to be // narrower, force-set the virtual width to 0 here. It will eventually // be corrected at idle time. SetVirtualSize(0, m_virtualSize.y); - RefreshRect(wxRect(lastColX, 0, fullWinWidth - lastColX, GetSize().y)); + RefreshRect(wxRect(lastColX, 0, availableWidth, GetSize().y)); } else { From 8856715d2d0f4e630de50e81fda4b8bd355060c1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 14:39:38 +0100 Subject: [PATCH 097/553] Use wxVector instead of wxList for wxDataViewCtrl columns storage As wxDataViewColumnList was never public, it should be fine to not define it any more and use a vector instead. This makes the code more clear and also marginally more efficient. --- include/wx/generic/dataview.h | 8 +++----- src/generic/datavgen.cpp | 34 ++++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index bef6ab1f97..6742e048ba 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -12,7 +12,6 @@ #include "wx/defs.h" #include "wx/object.h" -#include "wx/list.h" #include "wx/control.h" #include "wx/scrolwin.h" #include "wx/icon.h" @@ -179,9 +178,6 @@ private: // wxDataViewCtrl // --------------------------------------------------------- -WX_DECLARE_LIST_WITH_DECL(wxDataViewColumn, wxDataViewColumnList, - class WXDLLIMPEXP_CORE); - class WXDLLIMPEXP_CORE wxDataViewCtrl : public wxDataViewCtrlBase, public wxScrollHelper { @@ -366,7 +362,9 @@ private: void InvalidateColBestWidth(int idx); void UpdateColWidths(); - wxDataViewColumnList m_cols; + void DoClearColumns(); + + wxVector m_cols; // cached column best widths information, values are for // respective columns from m_cols and the arrays have same size struct CachedColWidthInfo diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 80c7c7aa2c..2ea515ae00 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -5054,8 +5054,6 @@ void wxDataViewMainWindow::UpdateColumnSizes() // wxDataViewCtrl //----------------------------------------------------------------------------- -WX_DEFINE_LIST(wxDataViewColumnList) - wxIMPLEMENT_DYNAMIC_CLASS(wxDataViewCtrl, wxDataViewCtrlBase); wxBEGIN_EVENT_TABLE(wxDataViewCtrl, wxDataViewCtrlBase) EVT_SIZE(wxDataViewCtrl::OnSize) @@ -5066,8 +5064,7 @@ wxDataViewCtrl::~wxDataViewCtrl() if (m_notifier) GetModel()->RemoveNotifier( m_notifier ); - m_cols.Clear(); - m_colsBestWidths.clear(); + DoClearColumns(); #if wxUSE_ACCESSIBILITY SetAccessible(NULL); @@ -5077,7 +5074,6 @@ wxDataViewCtrl::~wxDataViewCtrl() void wxDataViewCtrl::Init() { - m_cols.DeleteContents(true); m_notifier = NULL; m_headerArea = NULL; @@ -5329,7 +5325,7 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col ) if (!wxDataViewCtrlBase::AppendColumn(col)) return false; - m_cols.Append( col ); + m_cols.push_back( col ); m_colsBestWidths.push_back(CachedColWidthInfo()); OnColumnsCountChanged(); return true; @@ -5340,7 +5336,7 @@ bool wxDataViewCtrl::PrependColumn( wxDataViewColumn *col ) if (!wxDataViewCtrlBase::PrependColumn(col)) return false; - m_cols.Insert( col ); + m_cols.insert(m_cols.begin(), col); m_colsBestWidths.insert(m_colsBestWidths.begin(), CachedColWidthInfo()); OnColumnsCountChanged(); return true; @@ -5351,7 +5347,7 @@ bool wxDataViewCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *col ) if (!wxDataViewCtrlBase::InsertColumn(pos,col)) return false; - m_cols.Insert( pos, col ); + m_cols.insert(m_cols.begin() + pos, col); m_colsBestWidths.insert(m_colsBestWidths.begin() + pos, CachedColWidthInfo()); OnColumnsCountChanged(); return true; @@ -5400,7 +5396,7 @@ void wxDataViewCtrl::DoSetIndent() unsigned int wxDataViewCtrl::GetColumnCount() const { - return m_cols.GetCount(); + return m_cols.size(); } bool wxDataViewCtrl::SetRowHeight( int lineHeight ) @@ -5552,12 +5548,12 @@ void wxDataViewCtrl::ColumnMoved(wxDataViewColumn *col, unsigned int new_pos) bool wxDataViewCtrl::DeleteColumn( wxDataViewColumn *column ) { - wxDataViewColumnList::compatibility_iterator ret = m_cols.Find( column ); - if (!ret) + const int idx = GetColumnIndex(column); + if ( idx == wxNOT_FOUND ) return false; - m_colsBestWidths.erase(m_colsBestWidths.begin() + GetColumnIndex(column)); - m_cols.Erase(ret); + m_colsBestWidths.erase(m_colsBestWidths.begin() + idx); + m_cols.erase(m_cols.begin() + idx); if ( m_clientArea->GetCurrentColumn() == column ) m_clientArea->ClearCurrentColumn(); @@ -5567,10 +5563,20 @@ bool wxDataViewCtrl::DeleteColumn( wxDataViewColumn *column ) return true; } +void wxDataViewCtrl::DoClearColumns() +{ + typedef wxVector::const_iterator citer; + for ( citer it = m_cols.begin(); it != m_cols.end(); ++it ) + delete *it; +} + bool wxDataViewCtrl::ClearColumns() { SetExpanderColumn(NULL); - m_cols.Clear(); + + DoClearColumns(); + + m_cols.clear(); m_sortingColumnIdxs.clear(); m_colsBestWidths.clear(); From 4ed28f681fd9f88decf1b66e39ebe38feeb768bc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 23:00:55 +0100 Subject: [PATCH 098/553] Add a common tag for wxItemContainer-derived classes tests This makes it possible to run the tests for all controls implementing wxItemContainer interface by just passing "[item-container]" on the test command line. --- tests/controls/bitmapcomboboxtest.cpp | 8 ++------ tests/controls/checklistboxtest.cpp | 7 ++----- tests/controls/choicetest.cpp | 7 ++----- tests/controls/comboboxtest.cpp | 7 ++----- tests/controls/htmllboxtest.cpp | 7 ++----- tests/controls/listboxtest.cpp | 7 ++----- tests/controls/ownerdrawncomboboxtest.cpp | 8 ++------ tests/controls/rearrangelisttest.cpp | 7 ++----- 8 files changed, 16 insertions(+), 42 deletions(-) diff --git a/tests/controls/bitmapcomboboxtest.cpp b/tests/controls/bitmapcomboboxtest.cpp index 7ac6c112d5..0ae29e3457 100644 --- a/tests/controls/bitmapcomboboxtest.cpp +++ b/tests/controls/bitmapcomboboxtest.cpp @@ -77,12 +77,8 @@ private: wxDECLARE_NO_COPY_CLASS(BitmapComboBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( BitmapComboBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( BitmapComboBoxTestCase, - "BitmapComboBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(BitmapComboBoxTestCase, + "[BitmapComboBoxTestCase][item-container]"); void BitmapComboBoxTestCase::setUp() { diff --git a/tests/controls/checklistboxtest.cpp b/tests/controls/checklistboxtest.cpp index 27a33ccf54..1c22990298 100644 --- a/tests/controls/checklistboxtest.cpp +++ b/tests/controls/checklistboxtest.cpp @@ -46,11 +46,8 @@ private: wxDECLARE_NO_COPY_CLASS(CheckListBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( CheckListBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CheckListBoxTestCase, "CheckListBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(CheckListBoxTestCase, + "[CheckListBoxTestCase][item-container]"); void CheckListBoxTestCase::setUp() { diff --git a/tests/controls/choicetest.cpp b/tests/controls/choicetest.cpp index eacb0e88e6..f08cf515fe 100644 --- a/tests/controls/choicetest.cpp +++ b/tests/controls/choicetest.cpp @@ -45,11 +45,8 @@ private: wxDECLARE_NO_COPY_CLASS(ChoiceTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( ChoiceTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ChoiceTestCase, "ChoiceTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(ChoiceTestCase, + "[ChoiceTestCase][item-container]"); void ChoiceTestCase::setUp() { diff --git a/tests/controls/comboboxtest.cpp b/tests/controls/comboboxtest.cpp index 6bec622644..c72373321e 100644 --- a/tests/controls/comboboxtest.cpp +++ b/tests/controls/comboboxtest.cpp @@ -88,11 +88,8 @@ private: wxDECLARE_NO_COPY_CLASS(ComboBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( ComboBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ComboBoxTestCase, "ComboBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(ComboBoxTestCase, + "[ComboBoxTestCase][item-container]"); // ---------------------------------------------------------------------------- // test initialization diff --git a/tests/controls/htmllboxtest.cpp b/tests/controls/htmllboxtest.cpp index e9a675a971..28acba6830 100644 --- a/tests/controls/htmllboxtest.cpp +++ b/tests/controls/htmllboxtest.cpp @@ -43,11 +43,8 @@ private: wxDECLARE_NO_COPY_CLASS(HtmlListBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( HtmlListBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlListBoxTestCase, "HtmlListBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(HtmlListBoxTestCase, + "[HtmlListBoxTestCase][item-container]"); void HtmlListBoxTestCase::setUp() { diff --git a/tests/controls/listboxtest.cpp b/tests/controls/listboxtest.cpp index f7e37a375d..2f89a76a50 100644 --- a/tests/controls/listboxtest.cpp +++ b/tests/controls/listboxtest.cpp @@ -68,11 +68,8 @@ private: wxDECLARE_NO_COPY_CLASS(ListBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( ListBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ListBoxTestCase, "ListBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(ListBoxTestCase, + "[ListBoxTestCase][item-container]"); //initialise the static variable bool ListBoxTestCase::ms_ownerdrawn = false; diff --git a/tests/controls/ownerdrawncomboboxtest.cpp b/tests/controls/ownerdrawncomboboxtest.cpp index abeb7a90a1..ffba96a4dc 100644 --- a/tests/controls/ownerdrawncomboboxtest.cpp +++ b/tests/controls/ownerdrawncomboboxtest.cpp @@ -75,12 +75,8 @@ private: wxDECLARE_NO_COPY_CLASS(OwnerDrawnComboBoxTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( OwnerDrawnComboBoxTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( OwnerDrawnComboBoxTestCase, - "OwnerDrawnComboBoxTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(OwnerDrawnComboBoxTestCase, + "[OwnerDrawnComboBoxTestCase][item-container]"); // ---------------------------------------------------------------------------- // test initialization diff --git a/tests/controls/rearrangelisttest.cpp b/tests/controls/rearrangelisttest.cpp index ec83a40f66..e7f6038502 100644 --- a/tests/controls/rearrangelisttest.cpp +++ b/tests/controls/rearrangelisttest.cpp @@ -46,11 +46,8 @@ private: wxDECLARE_NO_COPY_CLASS(RearrangeListTestCase); }; -// register in the unnamed registry so that these tests are run by default -CPPUNIT_TEST_SUITE_REGISTRATION( RearrangeListTestCase ); - -// also include in its own registry so that these tests can be run alone -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( RearrangeListTestCase, "RearrangeListTestCase" ); +wxREGISTER_UNIT_TEST_WITH_TAGS(RearrangeListTestCase, + "[RearrangeListTestCase][item-container]"); void RearrangeListTestCase::setUp() { From e0e4f162827173ac0d17d0756beb5be55b09aa71 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 23:03:31 +0100 Subject: [PATCH 099/553] Fix a typo in ItemContainerTestCase comment No real changes, just fix a copy-and-pasto. --- tests/controls/itemcontainertest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/controls/itemcontainertest.h b/tests/controls/itemcontainertest.h index 981b6f98cf..63923d25e8 100644 --- a/tests/controls/itemcontainertest.h +++ b/tests/controls/itemcontainertest.h @@ -24,7 +24,7 @@ protected: // and this one must be overridden to return the window which implements // wxItemContainer interface -- usually it will return the same pointer as - // GetTestEntry(), just as a different type + // GetContainer(), just as a different type virtual wxWindow *GetContainerWindow() const = 0; // this should be inserted in the derived class CPPUNIT_TEST_SUITE From cdd0430b372e16f903abd1ce3bf9e385c513e6d3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 23:34:01 +0100 Subject: [PATCH 100/553] Remove hard TABs from documentation files No real changes. --- interface/wx/aui/framemanager.h | 2 +- interface/wx/listbox.h | 6 +++--- interface/wx/log.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/wx/aui/framemanager.h b/interface/wx/aui/framemanager.h index 0c0ba66a0f..9daa9d888a 100644 --- a/interface/wx/aui/framemanager.h +++ b/interface/wx/aui/framemanager.h @@ -908,7 +908,7 @@ public: "Safe parts" are all non-UI elements (e.g. all layout determining parameters like the size, position etc.). "Unsafe parts" (pointers to button, frame and window) are not modified by this write operation. - + @remark This method is used when loading perspectives. */ void SafeSet(wxAuiPaneInfo source); diff --git a/interface/wx/listbox.h b/interface/wx/listbox.h index 00b4c53338..7ccb4513e3 100644 --- a/interface/wx/listbox.h +++ b/interface/wx/listbox.h @@ -61,9 +61,9 @@ list is selected or the selection changes. @event{EVT_LISTBOX_DCLICK(id, func)} Process a @c wxEVT_LISTBOX_DCLICK event, when the listbox - is double-clicked. On some platforms (notably wxGTK2) - pressing the enter key is handled as an equivalent of a - double-click. + is double-clicked. On some platforms (notably wxGTK2) + pressing the enter key is handled as an equivalent of a + double-click. @endEventTable @library{wxcore} diff --git a/interface/wx/log.h b/interface/wx/log.h index a701af81af..53bb403bc6 100644 --- a/interface/wx/log.h +++ b/interface/wx/log.h @@ -801,7 +801,7 @@ public: The messages will be written in the encoding specified by the given @c wxMBConv. - The @a conv argument is only available in wxWidgets 3.1.1 and later. + The @a conv argument is only available in wxWidgets 3.1.1 and later. @note In practice, it is only advisable to specify @c wxConvUTF8 as From abc4576ffe65e8621e901e83dc92626a6ce75173 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 23:37:36 +0100 Subject: [PATCH 101/553] Invalidate selection after deleting wxListBox item with GTK+ 3 For consistency with the other ports, invalidate the selection when deleting the selected item or any item before it. Closes #18267. --- docs/changes.txt | 4 ++++ src/gtk/listbox.cpp | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index fc7fcb1e00..33b8cece02 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -113,6 +113,10 @@ All (GUI): - Fix wxInfoBar close button size in high DPI (Stefan Ziegler). - Make disabling the window before creating it actually work. +wxGTK: + +- Invalidate selection after deleting wxListBox item with GTK+ 3 too. + 3.1.2: (released 2018-12-10) ---------------------------- diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 0a0f6a8c0f..954fb060a0 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -497,6 +497,25 @@ void wxListBox::DoDeleteOneItem(unsigned int n) // this returns false if iter is invalid (e.g. deleting item at end) but // since we don't use iter, we ignore the return value gtk_list_store_remove(m_liststore, &iter); + +#ifdef __WXGTK3__ + // Invalidate selection in a single-selection control for consistency with + // MSW and GTK+ 2 where this happens automatically when deleting the + // selected item or any item before it. + if ( !HasMultipleSelection() ) + { + const int sel = GetSelection(); + if ( sel != wxNOT_FOUND && static_cast(sel) >= n ) + { + // Don't call SetSelection() from here, it's not totally clear if + // it is safe to do, so just do this at GTK+ level. + gtk_tree_selection_unselect_all + ( + gtk_tree_view_get_selection(m_treeview) + ); + } + } +#endif // __WXGTK3__ } // ---------------------------------------------------------------------------- From c8d2195791a752bfd046f1a9042b08ccf5340bce Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 23:44:01 +0100 Subject: [PATCH 102/553] Make wxSimpleHtmlListBox::Delete() consistent with wxListBox Also remove the selection when deleting the selected item, or any item before it, in this class, for consistency with the native wxListBox. --- src/generic/htmllbox.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index 507badf53b..cc7ef82ac1 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -672,6 +672,18 @@ void wxSimpleHtmlListBox::Clear() void wxSimpleHtmlListBox::DoDeleteOneItem(unsigned int n) { + // For consistency with the other wxItemContainer-derived classes, deselect + // the currently selected item if it, or any item before it, is being + // deleted, from a single-selection control. + if ( !HasMultipleSelection() ) + { + const int sel = GetSelection(); + if ( sel != wxNOT_FOUND && static_cast(sel) >= n ) + { + SetSelection(wxNOT_FOUND); + } + } + m_items.RemoveAt(n); m_HTMLclientData.RemoveAt(n); From b825c49c2eab4662c45466741e5da1b81c9a6c4c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2018 22:49:33 +0100 Subject: [PATCH 103/553] Document and test wxItemContainer::Delete() selection handling Add test checking that selection is reset when deleting the selected item or any item before, but not after, it. Also explicitly document this behaviour. --- interface/wx/ctrlsub.h | 6 ++++++ tests/controls/itemcontainertest.cpp | 27 +++++++++++++++++++++++++++ tests/controls/itemcontainertest.h | 2 ++ 3 files changed, 35 insertions(+) diff --git a/interface/wx/ctrlsub.h b/interface/wx/ctrlsub.h index 3e1d8d0da6..a9582e7b10 100644 --- a/interface/wx/ctrlsub.h +++ b/interface/wx/ctrlsub.h @@ -354,6 +354,12 @@ public: failure in debug builds) to remove an item with the index negative or greater or equal than the number of items in the control. + If there is a currently selected item below the item being deleted, + i.e. if GetSelection() returns a valid index greater than or equal to + @a n, the selection is invalidated when this function is called. + However if the selected item appears before the item being deleted, the + selection is preserved unchanged. + @param n The zero-based item index. diff --git a/tests/controls/itemcontainertest.cpp b/tests/controls/itemcontainertest.cpp index 874e926794..ffc49d0197 100644 --- a/tests/controls/itemcontainertest.cpp +++ b/tests/controls/itemcontainertest.cpp @@ -270,6 +270,33 @@ void ItemContainerTestCase::SetString() #endif } +void ItemContainerTestCase::SelectionAfterDelete() +{ + wxItemContainer * const container = GetContainer(); + + container->Append("item 0"); + container->Append("item 1"); + container->Append("item 2"); + container->Append("item 3"); + + container->SetSelection(1); + CHECK( container->GetSelection() == 1 ); + + container->Delete(3); + CHECK( container->GetSelection() == 1 ); + + container->Delete(1); + CHECK( container->GetSelection() == wxNOT_FOUND ); + + container->SetSelection(1); + container->Delete(1); + CHECK( container->GetSelection() == wxNOT_FOUND ); + + container->SetSelection(0); + container->Delete(0); + CHECK( container->GetSelection() == wxNOT_FOUND ); +} + void ItemContainerTestCase::SetSelection() { wxItemContainer * const container = GetContainer(); diff --git a/tests/controls/itemcontainertest.h b/tests/controls/itemcontainertest.h index 63923d25e8..49ca3fdcab 100644 --- a/tests/controls/itemcontainertest.h +++ b/tests/controls/itemcontainertest.h @@ -40,6 +40,7 @@ protected: CPPUNIT_TEST( Set ); \ CPPUNIT_TEST( SetSelection ); \ CPPUNIT_TEST( SetString ); \ + CPPUNIT_TEST( SelectionAfterDelete ); \ WXUISIM_TEST( SimSelect ); void Append(); @@ -52,6 +53,7 @@ protected: void Set(); void SetSelection(); void SetString(); + void SelectionAfterDelete(); #if wxUSE_UIACTIONSIMULATOR virtual void SimSelect(); #endif From 5b2e99294709899b8e6b0f05b62e062a40688b69 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 16 Dec 2018 00:02:07 +0100 Subject: [PATCH 104/553] Document wxThread::Delete() behaviour more precisely Delete() doesn't (and can't, under Unix) wait for the detached threads, although it does do it under MSW (but arguably shouldn't), so it can't retrieve the thread exit code there. Document that its "rc" argument is only useful with joinable threads. Closes #18240. --- interface/wx/thread.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/interface/wx/thread.h b/interface/wx/thread.h index f308327a29..c9ba40baf3 100644 --- a/interface/wx/thread.h +++ b/interface/wx/thread.h @@ -1042,11 +1042,19 @@ public: wxThreadError Create(unsigned int stackSize = 0); /** - Calling Delete() gracefully terminates a @b detached thread, either when - the thread calls TestDestroy() or when it finishes processing. + Calling Delete() requests termination of any thread. + + Note that Delete() doesn't actually stop the thread, but simply asks it + to terminate and so will work only if the thread calls TestDestroy() + periodically. For detached threads, Delete() returns immediately, + without waiting for the thread to actually terminate, while for + joinable threads it does wait for the thread to terminate and may also + return its exit code in @a rc argument. @param rc - The thread exit code, if rc is not NULL. + For joinable threads, filled with the thread exit code on + successful return, if non-@NULL. For detached threads this + parameter is not used. @param waitMode As described in wxThreadWait documentation, wxTHREAD_WAIT_BLOCK From 50e098437d3e56050af729dfafc5724ca255c3fb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 17 Dec 2018 14:07:12 +0100 Subject: [PATCH 105/553] Document lack of custom editors in Mac wxDataViewCtrl wxDataViewCustomRenderer::CreateEditorCtrl() is currently never called there. --- interface/wx/dataview.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 00a8069f06..b0ca7f6f0e 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -2551,6 +2551,10 @@ public: } @endcode + @note Currently support for this method is not implemented in the + native macOS version of the control, i.e. it will be never called + there. + @see ActivateCell() */ virtual wxWindow* CreateEditorCtrl(wxWindow* parent, From b0eca3bdde4984d41183f498e34d4c616c23f4d2 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 17 Dec 2018 15:22:38 +0000 Subject: [PATCH 106/553] Fix some more uninitialised wxCairoContext fields in wxQt Closes https://github.com/wxWidgets/wxWidgets/pull/1084 --- src/generic/graphicc.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index d98e68756a..a8876075ef 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -2234,6 +2234,11 @@ wxCairoContext::wxCairoContext(wxGraphicsRenderer* renderer, HWND hWnd) wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, cairo_t *context ) : wxGraphicsContext(renderer) { +#ifdef __WXQT__ + m_qtPainter = NULL; + m_qtImage = NULL; + m_qtSurface = NULL; +#endif #ifdef __WXMSW__ m_mswSurface = NULL; m_mswStateSavedDC = 0; @@ -2288,6 +2293,11 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, wxWindow *window) wxCairoContext::wxCairoContext(wxGraphicsRenderer* renderer) : wxGraphicsContext(renderer) { +#ifdef __WXQT__ + m_qtPainter = NULL; + m_qtImage = NULL; + m_qtSurface = NULL; +#endif #ifdef __WXMSW__ m_mswSurface = NULL; m_mswStateSavedDC = 0; From 14e905858d0c30b03914457f9fb5c49173366cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20S=C5=82odkowicz?= Date: Mon, 17 Dec 2018 02:39:06 +0100 Subject: [PATCH 107/553] Fix regression in wxTranslations::AddCatalog() Do load the catalog corresponding to the language of "msgid" strings in the source code, only skip the languages strictly less preferred than it. This avoids incompatibilities with pre-3.1.2 behaviour and avoids breaking existing applications relying on the old behaviour. Closes https://github.com/wxWidgets/wxWidgets/pull/1081 Closes #18297. --- docs/changes.txt | 4 ++++ src/common/translation.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index fc7fcb1e00..c3d49daf94 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -108,6 +108,10 @@ Changes in behaviour which may result in build errors 3.1.3: (released 2019-??-??) ---------------------------- +All: + +- Fix regression in wxTranslations::AddCatalog() in 3.1.2 (Tomasz Słodkowicz). + All (GUI): - Fix wxInfoBar close button size in high DPI (Stefan Ziegler). diff --git a/src/common/translation.cpp b/src/common/translation.cpp index 7d9937cd18..26515b4c9b 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -1574,18 +1574,18 @@ bool wxTranslations::AddCatalog(const wxString& domain, wxS("adding '%s' translation for domain '%s' (msgid language '%s')"), *lang, domain, msgIdLang); - // No use loading languages that are less preferred than the - // msgid language, as by definition it contains all the strings - // in the msgid language. - if ( msgIdLang == *lang ) - break; - // We determine success by the success of loading/failing to load // the most preferred (i.e. the first one) language's catalog: if ( lang == domain_langs.begin() ) success = LoadCatalog(domain, *lang, msgIdLang); else LoadCatalog(domain, *lang, msgIdLang); + + // No use loading languages that are less preferred than the + // msgid language, as by definition it contains all the strings + // in the msgid language. + if ( msgIdLang == *lang ) + break; } return success; From 80904d1bc786ad2f6f8ab523391edfc82375820d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20S=C5=82odkowicz?= Date: Mon, 17 Dec 2018 04:38:35 +0100 Subject: [PATCH 108/553] Fix crash in translations code when no translations are found Fix another regression in wxTranslations in 3.1.2 and check that the vector of acceptable translations is not empty before using its first element. Closes https://github.com/wxWidgets/wxWidgets/pull/1082 Closes #18299. --- src/common/translation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/translation.cpp b/src/common/translation.cpp index 26515b4c9b..08c4bfd7ad 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -1676,9 +1676,9 @@ wxString wxTranslations::GetBestTranslation(const wxString& domain, const wxString& msgIdLanguage) { const wxArrayString allGoodOnes = GetAcceptableTranslations(domain, msgIdLanguage); - - wxLogTrace(TRACE_I18N, " => using language '%s'", allGoodOnes[0]); - return allGoodOnes[0]; + wxString best(allGoodOnes.empty() ? wxString() : allGoodOnes[0]); + wxLogTrace(TRACE_I18N, " => using language '%s'", best); + return best; } wxArrayString wxTranslations::GetAcceptableTranslations(const wxString& domain, From ae20edb5397f6aa9c5bb6800119d0ebf70750984 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 17 Dec 2018 11:48:59 +0000 Subject: [PATCH 109/553] Fix several problem with wxMemoryDC in wxQt Under wxQT, wxMemoryDC was previously rendering to a temporary image which was only being blitted back to the original wxBitmap when either the DC wx destroyed or a new bitmap was selected (via SelectObject). With these change wxMemoryDCImpl now draws directly to the bitmap managed by wxBitmap, this makes the behaviour more consistent with the MSW and GTK implementations. Closes https://github.com/wxWidgets/wxWidgets/pull/1083 --- include/wx/qt/dc.h | 4 ++-- include/wx/qt/dcscreen.h | 4 +--- src/qt/dc.cpp | 35 +++++++++++++++++++++++------------ src/qt/dcclient.cpp | 2 -- src/qt/dcmemory.cpp | 34 +++++++++------------------------- src/qt/dcscreen.cpp | 20 +++++--------------- 6 files changed, 40 insertions(+), 59 deletions(-) diff --git a/include/wx/qt/dc.h b/include/wx/qt/dc.h index 94623e4201..56849a2124 100644 --- a/include/wx/qt/dc.h +++ b/include/wx/qt/dc.h @@ -111,10 +111,10 @@ public: virtual void* GetHandle() const { return (void*) m_qtPainter; } protected: - virtual QImage *GetQImage() { return m_qtImage; } + virtual QPixmap *GetQPixmap() { return m_qtPixmap; } QPainter *m_qtPainter; - QImage *m_qtImage; + QPixmap *m_qtPixmap; wxRegion *m_clippingRegion; private: diff --git a/include/wx/qt/dcscreen.h b/include/wx/qt/dcscreen.h index c6c19b4848..f2fba75bca 100644 --- a/include/wx/qt/dcscreen.h +++ b/include/wx/qt/dcscreen.h @@ -19,9 +19,7 @@ public: protected: virtual void DoGetSize(int *width, int *height) const wxOVERRIDE; - virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; - - virtual QImage *GetQImage(); + virtual QPixmap *GetQPixmap() wxOVERRIDE; wxDECLARE_ABSTRACT_CLASS(wxScreenDCImpl); }; diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 8098a03dcf..737d1554d1 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -47,7 +47,7 @@ wxQtDCImpl::wxQtDCImpl( wxDC *owner ) : wxDCImpl( owner ) { m_clippingRegion = new wxRegion; - m_qtImage = NULL; + m_qtPixmap = NULL; m_rasterColourOp = wxQtNONE; m_qtPenColor = new QColor; m_qtBrushColor = new QColor; @@ -474,15 +474,18 @@ bool wxQtDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const if ( col ) { - wxCHECK_MSG( m_qtImage != NULL, false, "This DC doesn't support GetPixel()" ); - - QColor pixel = m_qtImage->pixel( x, y ); + wxCHECK_MSG( m_qtPixmap != NULL, false, "This DC doesn't support GetPixel()" ); + QPixmap pixmap1px = m_qtPixmap->copy( x, y, 1, 1 ); + QImage image = pixmap1px.toImage(); + QColor pixel = image.pixel( 0, 0 ); col->Set( pixel.red(), pixel.green(), pixel.blue(), pixel.alpha() ); return true; } else + { return false; + } } void wxQtDCImpl::DoDrawPoint(wxCoord x, wxCoord y) @@ -739,23 +742,31 @@ bool wxQtDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, { wxQtDCImpl *implSource = (wxQtDCImpl*)source->GetImpl(); - QImage *qtSource = implSource->GetQImage(); + QPixmap *qtSource = implSource->GetQPixmap(); // Not a CHECK on purpose if ( !qtSource ) return false; - QImage qtSourceConverted = *qtSource; - if ( !useMask ) - qtSourceConverted = qtSourceConverted.convertToFormat( QImage::Format_RGB32 ); - // Change logical function wxRasterOperationMode savedMode = GetLogicalFunction(); SetLogicalFunction( rop ); - m_qtPainter->drawImage( QRect( xdest, ydest, width, height ), - qtSourceConverted, - QRect( xsrc, ysrc, width, height ) ); + if ( useMask ) + { + m_qtPainter->drawPixmap( QRect( xdest, ydest, width, height ), + *qtSource, + QRect( xsrc, ysrc, width, height ) ); + } + else + { + QImage qtSourceConverted = qtSource->toImage(); + qtSourceConverted = qtSourceConverted.convertToFormat(QImage::Format_RGB32); + + m_qtPainter->drawImage( QRect( xdest, ydest, width, height ), + qtSourceConverted, + QRect( xsrc, ysrc, width, height ) ); + } SetLogicalFunction( savedMode ); diff --git a/src/qt/dcclient.cpp b/src/qt/dcclient.cpp index 696b69e2d4..eea8088a42 100644 --- a/src/qt/dcclient.cpp +++ b/src/qt/dcclient.cpp @@ -31,7 +31,6 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner ) : wxQtDCImpl( owner ) { m_window = NULL; - m_qtImage = NULL; m_ok = false; m_qtPainter = new QPainter(); } @@ -40,7 +39,6 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *win ) : wxQtDCImpl( owner ) { m_window = win; - m_qtImage = NULL; m_qtPainter = m_window->QtGetPainter(); // if we're not inside a Paint event, painter will invalid m_ok = m_qtPainter != NULL; diff --git a/src/qt/dcmemory.cpp b/src/qt/dcmemory.cpp index 3f85c3e3db..563d1cff1f 100644 --- a/src/qt/dcmemory.cpp +++ b/src/qt/dcmemory.cpp @@ -16,7 +16,6 @@ wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner ) : wxQtDCImpl( owner ) { - m_qtImage = NULL; m_ok = false; m_qtPainter = new QPainter(); } @@ -24,7 +23,6 @@ wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner ) wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) : wxQtDCImpl( owner ) { - m_qtImage = NULL; m_ok = false; m_qtPainter = new QPainter(); DoSelect( bitmap ); @@ -33,7 +31,6 @@ wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *WXUNUSED(dc) ) : wxQtDCImpl( owner ) { - m_qtImage = NULL; m_ok = false; m_qtPainter = new QPainter(); } @@ -50,34 +47,21 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) { // Finish the painting in the intermediate image device: m_qtPainter->end(); - - if (m_selected.IsOk() && !m_selected.GetHandle()->isNull()) - { - // Copy intermediate image to the bitmap - m_qtPainter->begin( m_selected.GetHandle() ); - m_qtPainter->drawImage( QPoint( 0, 0 ), *m_qtImage ); - m_qtPainter->end(); - } m_ok = false; } // clean up the intermediate image device: - if ( m_qtImage ) - { - delete m_qtImage; - m_qtImage = NULL; - } - m_selected = bitmap; - if ( bitmap.IsOk() && !bitmap.GetHandle()->isNull() ) { - QPixmap pixmap(*bitmap.GetHandle()); - // apply mask before converting to image - if ( bitmap.GetMask() && bitmap.GetMask()->GetHandle() ) - pixmap.setMask(*bitmap.GetMask()->GetHandle()); - // create the intermediate image for the pixmap: - m_qtImage = new QImage( pixmap.toImage() ); + m_qtPixmap = bitmap.GetHandle(); + if ( bitmap.IsOk() && !m_qtPixmap->isNull() ) + { + // apply mask before drawing + wxMask *mask = bitmap.GetMask(); + if ( mask && mask->GetHandle() ) + m_qtPixmap->setMask(*mask->GetHandle()); + // start drawing on the intermediary device: - m_ok = m_qtPainter->begin( m_qtImage ); + m_ok = m_qtPainter->begin( m_qtPixmap ); SetPen(m_pen); SetBrush(m_brush); diff --git a/src/qt/dcscreen.cpp b/src/qt/dcscreen.cpp index b42445ea3a..12b02f6715 100644 --- a/src/qt/dcscreen.cpp +++ b/src/qt/dcscreen.cpp @@ -21,12 +21,11 @@ wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl); wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner ) : wxWindowDCImpl( owner ) { - m_qtImage = NULL; } wxScreenDCImpl::~wxScreenDCImpl( ) { - delete m_qtImage; + delete m_qtPixmap; } void wxScreenDCImpl::DoGetSize(int *width, int *height) const @@ -34,19 +33,10 @@ void wxScreenDCImpl::DoGetSize(int *width, int *height) const wxDisplaySize(width, height); } -bool wxScreenDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const -{ -// const_cast(this)->GetQImage(); -// return wxQtDCImpl::DoGetPixel(x, y, col); - x = y = 0; - col = 0; - return false; -} - // defered allocation for blit -QImage *wxScreenDCImpl::GetQImage() +QPixmap *wxScreenDCImpl::GetQPixmap() { - if ( !m_qtImage ) - m_qtImage = new QImage(QApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId()).toImage()); - return m_qtImage; + if ( !m_qtPixmap ) + m_qtPixmap = new QPixmap(QApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId())); + return m_qtPixmap; } From c47c7de5eaa25992ab4f1ff8511123f6c67dccb3 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 19 Dec 2018 08:57:04 +0000 Subject: [PATCH 110/553] Allow overriding the label for stock buttons in wxQt Stock label should only be used if passed label is empty. Otherwise, passed label should override the default value. Closes https://github.com/wxWidgets/wxWidgets/pull/1086 --- src/qt/button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/button.cpp b/src/qt/button.cpp index 7b7a2e992e..0bd270f1c9 100644 --- a/src/qt/button.cpp +++ b/src/qt/button.cpp @@ -45,7 +45,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& name ) { QtCreate(parent); - SetLabel( wxIsStockID( id ) ? wxGetStockLabel( id ) : label ); + SetLabel( label.IsEmpty() && wxIsStockID( id ) ? wxGetStockLabel( id ) : label ); return QtCreateControl( parent, id, pos, size, style, validator, name ); } From 7ab9e992b6f9f79b8e658ef35cc1e58a26a260a2 Mon Sep 17 00:00:00 2001 From: jensgoe Date: Wed, 19 Dec 2018 20:45:00 +0100 Subject: [PATCH 111/553] ensure row >= GetRowCount() if GetLineAt reaches invalid item refactored method structure for better readability --- include/wx/generic/private/rowheightcache.h | 3 +- src/generic/datavgen.cpp | 101 +++++++++++--------- 2 files changed, 56 insertions(+), 48 deletions(-) diff --git a/include/wx/generic/private/rowheightcache.h b/include/wx/generic/private/rowheightcache.h index 61394223f6..768edd4687 100644 --- a/include/wx/generic/private/rowheightcache.h +++ b/include/wx/generic/private/rowheightcache.h @@ -134,6 +134,7 @@ public: bool GetLineStart(unsigned int row, int& start); bool GetLineHeight(unsigned int row, int& height); bool GetLineAt(int y, unsigned int& row); + bool GetLineInfo(unsigned int row, int &start, int &height); void Put(unsigned int row, int height); @@ -146,8 +147,6 @@ public: void Clear(); private: - bool GetLineInfo(unsigned int row, int &start, int &height); - HeightToRowRangesMap m_heightToRowRange; }; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index b5e37120d8..09704c2df0 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3346,37 +3346,32 @@ wxRect wxDataViewMainWindow::GetLinesRect( unsigned int rowFrom, unsigned int ro int wxDataViewMainWindow::GetLineStart( unsigned int row ) const { - if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) + // check for the easy case first + if (!GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + return row * m_lineHeight; + + int start = 0; + if ( m_rowHeightCache->GetLineStart(row, start) ) + return start; + + unsigned int r; + for (r = 0; r < row; r++) { - int start = 0; - if ( m_rowHeightCache->GetLineStart(row, start) ) - return start; - - unsigned int r; - for (r = 0; r < row; r++) + int height = 0; + if ( !m_rowHeightCache->GetLineHeight(r, height) ) { - int height = 0; - if ( m_rowHeightCache->GetLineHeight(r, height) ) - { - start += height; - continue; - } - - wxDataViewItem item = GetItemByRow(r); - if ( !item ) + // row height not in cache -> get it from the renderer... + wxDataViewItem item = GetItemByRow(r); + if (!item) break; height = QueryAndCacheLineHeight(r, item); - - start += height; } - return start; - } - else - { - return row * m_lineHeight; + start += height; } + + return start; } int wxDataViewMainWindow::GetLineAt( unsigned int y ) const @@ -3386,54 +3381,68 @@ int wxDataViewMainWindow::GetLineAt( unsigned int y ) const return y / m_lineHeight; unsigned int row = 0; - unsigned int yy = 0; - if ( m_rowHeightCache->GetLineAt(y, row) ) return row; + // OnPaint asks GetLineAt for the very last y position and this is always + // below the last item (--> an invalid item). To prevent iterating over all + // items, check if y is below the last row. + // Because this is done very often (for each repaint) its worth to handle + // this special case separately. + int height = 0; + int start = 0; + unsigned int rowCount = GetRowCount(); + if (rowCount == 0 || + (m_rowHeightCache->GetLineInfo(rowCount - 1, start, height) && + y >= start + height)) + { + return rowCount; + } + + // sum all item heights until y is reached + unsigned int yy = 0; for (;;) { - int height = 0; + height = 0; if ( !m_rowHeightCache->GetLineHeight(row, height) ) { // row height not in cache -> get it from the renderer... - wxDataViewItem item = GetItemByRow(row); if ( !item ) - return row; // should be the last row + { + wxASSERT(row >= GetRowCount()); + break; + } height = QueryAndCacheLineHeight(row, item); } yy += height; if (y < yy) - return row; + break; row++; } + return row; } int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const { - if (GetOwner()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) - { - int height = 0; - if ( m_rowHeightCache->GetLineHeight(row, height) ) - return height; - - wxDataViewItem item = GetItemByRow(row); - if ( !item ) - return m_lineHeight; - - height = QueryAndCacheLineHeight(row, item); - return height; - } - else - { + // check for the easy case first + if (!GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) return m_lineHeight; - } -} + int height = 0; + if ( m_rowHeightCache->GetLineHeight(row, height) ) + return height; + + wxDataViewItem item = GetItemByRow(row); + if ( !item ) + return m_lineHeight; + + height = QueryAndCacheLineHeight(row, item); + return height; +} int wxDataViewMainWindow::QueryAndCacheLineHeight(unsigned int row, wxDataViewItem item) const { From 12edcbccc8e8d180ddb50f4064a6ba47cf3c1e3d Mon Sep 17 00:00:00 2001 From: jensgoe Date: Wed, 19 Dec 2018 20:45:32 +0100 Subject: [PATCH 112/553] clear height cache if model is cleared --- src/generic/datavgen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 09704c2df0..79ee360da9 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3018,6 +3018,7 @@ bool wxDataViewMainWindow::Cleared() DestroyTree(); m_selection.Clear(); m_currentRow = (unsigned)-1; + m_rowHeightCache->Clear(); if (GetModel()) { From c6d3b9c0b9d7f4837c675e1c0c6135d937f06b32 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 19 Dec 2018 09:05:29 +0000 Subject: [PATCH 113/553] Fix background colour used by DrawEllipse() in wxQt wxDC::DrawEllipse() used to use the text background for filling the ellipses drawn with transparent pen, for some reason. According to f9b28cd4325f42936d3122bfe7c847354bbbfee9 which changed this (this commit was part of df13791078f107edda80f50f1ab498ad936ff069 merge done with svn), this was done for compatibility with wxGTK, but wxGTK definitely doesn't do it now and apparently never did, so there must have been some mistake. Simply remove the extra code using the text background for consistency with this method behaviour in the other ports and also other methods behaviour in the same port. Closes https://github.com/wxWidgets/wxWidgets/pull/1087 --- src/qt/dc.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 737d1554d1..e5405276cd 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -577,29 +577,13 @@ void wxQtDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, void wxQtDCImpl::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { - QBrush savedBrush; - int penWidth = m_qtPainter->pen().width(); + const int penWidth = m_qtPainter->pen().width(); x += penWidth / 2; y += penWidth / 2; width -= penWidth; height -= penWidth; - if ( m_pen.IsNonTransparent() ) - { - // Save pen/brush - savedBrush = m_qtPainter->brush(); - // Fill with text background color ("no fill" like in wxGTK): - m_qtPainter->setBrush(QBrush(m_textBackgroundColour.GetQColor())); - } - - // Draw m_qtPainter->drawEllipse( x, y, width, height ); - - if ( m_pen.IsNonTransparent() ) - { - //Restore saved settings - m_qtPainter->setBrush(savedBrush); - } } void wxQtDCImpl::DoCrossHair(wxCoord x, wxCoord y) From c922c95c96a3fded2fae5394d5353f3ce36aaca6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 20 Dec 2018 02:21:53 +0100 Subject: [PATCH 114/553] Fix the just introduced signed/unsigned comparison warning Cast to unsigned before comparing with an unsigned variable. --- src/generic/datavgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 79ee360da9..192a281047 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3395,7 +3395,7 @@ int wxDataViewMainWindow::GetLineAt( unsigned int y ) const unsigned int rowCount = GetRowCount(); if (rowCount == 0 || (m_rowHeightCache->GetLineInfo(rowCount - 1, start, height) && - y >= start + height)) + y >= static_cast(start + height))) { return rowCount; } From bc4d3a455460b917efbdff1f264eb97d4fadc2f0 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 20 Dec 2018 08:06:46 +0000 Subject: [PATCH 115/553] Initialise m_qtPushButton in wxAnyButton's constructor. --- include/wx/qt/anybutton.h | 4 +--- src/qt/anybutton.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/wx/qt/anybutton.h b/include/wx/qt/anybutton.h index f8cc359f97..d697f6be36 100644 --- a/include/wx/qt/anybutton.h +++ b/include/wx/qt/anybutton.h @@ -18,9 +18,7 @@ class QPushButton; class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase { public: - wxAnyButton() - { - } + wxAnyButton(); // implementation // -------------- diff --git a/src/qt/anybutton.cpp b/src/qt/anybutton.cpp index dc56780af2..a282231453 100644 --- a/src/qt/anybutton.cpp +++ b/src/qt/anybutton.cpp @@ -46,6 +46,12 @@ void wxQtPushButton::clicked( bool WXUNUSED(checked) ) } } +wxAnyButton::wxAnyButton() : + m_qtPushButton(NULL) +{ +} + + void wxAnyButton::QtCreate(wxWindow *parent) { // create the default push button (used in button and bmp button) From 57b636b2d439117e3de2d9e7b667d685b2bb2ddf Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 20 Dec 2018 10:33:01 +0000 Subject: [PATCH 116/553] Fix for NULL pixmap when setting button icon in wxQT --- src/qt/anybutton.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qt/anybutton.cpp b/src/qt/anybutton.cpp index a282231453..860399f581 100644 --- a/src/qt/anybutton.cpp +++ b/src/qt/anybutton.cpp @@ -62,8 +62,11 @@ void wxAnyButton::QtSetBitmap( const wxBitmap &bitmap ) { // load the bitmap and resize the button: QPixmap *pixmap = bitmap.GetHandle(); - m_qtPushButton->setIcon( QIcon( *pixmap )); - m_qtPushButton->setIconSize( pixmap->rect().size() ); + if ( pixmap != NULL ) + { + m_qtPushButton->setIcon(QIcon(*pixmap)); + m_qtPushButton->setIconSize(pixmap->rect().size()); + } m_bitmap = bitmap; } From bfb59228c11614761bc1203a19845cc937a51918 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 20 Dec 2018 10:38:50 +0000 Subject: [PATCH 117/553] Fix crashes due to unitialised fields --- src/qt/app.cpp | 2 ++ src/qt/checkbox.cpp | 3 ++- src/qt/choice.cpp | 3 ++- src/qt/combobox.cpp | 5 +++-- src/qt/gauge.cpp | 3 ++- src/qt/listbox.cpp | 3 ++- src/qt/listctrl.cpp | 1 + src/qt/notebook.cpp | 3 ++- src/qt/radiobox.cpp | 10 ++++++++-- src/qt/radiobut.cpp | 3 ++- src/qt/scrolbar.cpp | 3 ++- src/qt/slider.cpp | 3 ++- src/qt/spinbutt.cpp | 3 ++- src/qt/spinctrl.cpp | 3 ++- src/qt/statbmp.cpp | 3 ++- src/qt/statbox.cpp | 3 ++- src/qt/statline.cpp | 3 ++- src/qt/stattext.cpp | 3 ++- src/qt/statusbar.cpp | 1 + src/qt/textctrl.cpp | 4 +++- 20 files changed, 46 insertions(+), 19 deletions(-) diff --git a/src/qt/app.cpp b/src/qt/app.cpp index 93f0ccd3d8..7c6033c0fc 100644 --- a/src/qt/app.cpp +++ b/src/qt/app.cpp @@ -20,6 +20,8 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxApp, wxAppBase); wxApp::wxApp() { m_qtApplication = NULL; + m_qtArgc = 0; + m_qtArgv = NULL; } diff --git a/src/qt/checkbox.cpp b/src/qt/checkbox.cpp index c248531f72..0554e1c6d1 100644 --- a/src/qt/checkbox.cpp +++ b/src/qt/checkbox.cpp @@ -46,7 +46,8 @@ void wxQtCheckBox::clicked( bool checked ) } -wxCheckBox::wxCheckBox() +wxCheckBox::wxCheckBox() : + m_qtCheckBox(NULL) { } diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 2716a9c004..1bd6511202 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -37,7 +37,8 @@ void wxQtChoice::activated(int WXUNUSED(index)) } -wxChoice::wxChoice() +wxChoice::wxChoice() : + m_qtComboBox(NULL) { } diff --git a/src/qt/combobox.cpp b/src/qt/combobox.cpp index 1080721625..4ca376f23d 100644 --- a/src/qt/combobox.cpp +++ b/src/qt/combobox.cpp @@ -112,8 +112,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name ) { - return Create( parent, id, value, pos, size, choices.size(), &choices[ 0 ], - style, validator, name ); + const wxString *pChoices = choices.size() ? &choices[ 0 ] : NULL; + return Create(parent, id, value, pos, size, choices.size(), pChoices, + style, validator, name ); } diff --git a/src/qt/gauge.cpp b/src/qt/gauge.cpp index 8952043db8..38df21aa35 100644 --- a/src/qt/gauge.cpp +++ b/src/qt/gauge.cpp @@ -29,7 +29,8 @@ wxQtProgressBar::wxQtProgressBar( wxWindow *parent, wxGauge *handler ) } -wxGauge::wxGauge() +wxGauge::wxGauge() : + m_qtProgressBar(NULL) { } diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index be40ae320f..2b60223f70 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -45,7 +45,8 @@ void wxQtListWidget::doubleClicked( const QModelIndex &index ) } -wxListBox::wxListBox() +wxListBox::wxListBox() : + m_qtListWidget(NULL) { Init(); } diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 8a087ef07d..556021c003 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -154,6 +154,7 @@ void wxListCtrl::Init() m_ownsImageListSmall = false; m_imageListState = NULL; m_ownsImageListState = false; + m_qtTreeWidget = NULL; } wxListCtrl::~wxListCtrl() diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 3730c67782..4f00fa31f1 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -50,7 +50,8 @@ void wxQtTabWidget::currentChanged(int index) } -wxNotebook::wxNotebook() +wxNotebook::wxNotebook() : + m_qtTabWidget(NULL) { } diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index b8c82a8a37..22706e8038 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -56,7 +56,10 @@ void wxQtButtonGroup::buttonClicked(int index) { wxIMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl); -wxRadioBox::wxRadioBox() +wxRadioBox::wxRadioBox() : + m_qtGroupBox(NULL), + m_qtButtonGroup(NULL), + m_qtBoxLayout(NULL) { } @@ -149,7 +152,7 @@ bool wxRadioBox::Create(wxWindow *parent, // GetMajorDim() is the number of rows. if ( style & wxRA_SPECIFY_COLS ) m_qtBoxLayout = new QHBoxLayout; - else if ( style & wxRA_SPECIFY_ROWS ) + else m_qtBoxLayout = new QVBoxLayout; AddChoices< QRadioButton >( m_qtButtonGroup, m_qtBoxLayout, n, choices ); @@ -242,6 +245,9 @@ bool wxRadioBox::Show(unsigned int n, bool show) bool wxRadioBox::Show( bool show ) { + if (!m_qtGroupBox) + return false; + if( m_qtGroupBox->isVisible() == show ) { for( unsigned int i = 0; i < GetCount(); ++i ) diff --git a/src/qt/radiobut.cpp b/src/qt/radiobut.cpp index 64e2100cd4..1a389997da 100644 --- a/src/qt/radiobut.cpp +++ b/src/qt/radiobut.cpp @@ -13,7 +13,8 @@ #include -wxRadioButton::wxRadioButton() +wxRadioButton::wxRadioButton() : + m_qtRadioButton(NULL) { } diff --git a/src/qt/scrolbar.cpp b/src/qt/scrolbar.cpp index e848bf2c0c..77939a2765 100644 --- a/src/qt/scrolbar.cpp +++ b/src/qt/scrolbar.cpp @@ -27,7 +27,8 @@ class wxQtScrollBar : public wxQtEventSignalHandler< QScrollBar, wxScrollBar > }; -wxScrollBar::wxScrollBar() +wxScrollBar::wxScrollBar() : + m_qtScrollBar(NULL) { } diff --git a/src/qt/slider.cpp b/src/qt/slider.cpp index 9efc54d529..1b8e1f96a7 100644 --- a/src/qt/slider.cpp +++ b/src/qt/slider.cpp @@ -46,7 +46,8 @@ void wxQtSlider::valueChanged(int position) } -wxSlider::wxSlider() +wxSlider::wxSlider() : + m_qtSlider(NULL) { } diff --git a/src/qt/spinbutt.cpp b/src/qt/spinbutt.cpp index 0fca8ba9e4..688649461c 100644 --- a/src/qt/spinbutt.cpp +++ b/src/qt/spinbutt.cpp @@ -41,7 +41,8 @@ void wxQtSpinButton::valueChanged(int value) } -wxSpinButton::wxSpinButton() +wxSpinButton::wxSpinButton() : + m_qtSpinBox(NULL) { } diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index e7cdeddff7..1b9cd3d0ea 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -18,7 +18,8 @@ #include template< typename T, typename Widget > -wxSpinCtrlQt< T, Widget >::wxSpinCtrlQt() +wxSpinCtrlQt< T, Widget >::wxSpinCtrlQt() : + m_qtSpinBox(NULL) { } diff --git a/src/qt/statbmp.cpp b/src/qt/statbmp.cpp index b4dbde30f0..d27a57672f 100644 --- a/src/qt/statbmp.cpp +++ b/src/qt/statbmp.cpp @@ -21,7 +21,8 @@ public: }; -wxStaticBitmap::wxStaticBitmap() +wxStaticBitmap::wxStaticBitmap() : + m_qtLabel(NULL) { } diff --git a/src/qt/statbox.cpp b/src/qt/statbox.cpp index 6af3e2ddb6..cfa585caa0 100644 --- a/src/qt/statbox.cpp +++ b/src/qt/statbox.cpp @@ -23,7 +23,8 @@ public: }; -wxStaticBox::wxStaticBox() +wxStaticBox::wxStaticBox() : + m_qtGroupBox(NULL) { } diff --git a/src/qt/statline.cpp b/src/qt/statline.cpp index 444f59c6e7..82e52f01a8 100644 --- a/src/qt/statline.cpp +++ b/src/qt/statline.cpp @@ -12,7 +12,8 @@ #include -wxStaticLine::wxStaticLine() +wxStaticLine::wxStaticLine() : + m_qtFrame(NULL) { } diff --git a/src/qt/stattext.cpp b/src/qt/stattext.cpp index 8e410bfa10..2eb50b5f18 100644 --- a/src/qt/stattext.cpp +++ b/src/qt/stattext.cpp @@ -22,7 +22,8 @@ public: }; -wxStaticText::wxStaticText() +wxStaticText::wxStaticText() : + m_qtLabel(NULL) { } diff --git a/src/qt/statusbar.cpp b/src/qt/statusbar.cpp index 57881f8a6e..8224c80928 100644 --- a/src/qt/statusbar.cpp +++ b/src/qt/statusbar.cpp @@ -105,6 +105,7 @@ void wxStatusBar::Refresh( bool eraseBackground, const wxRect *rect ) void wxStatusBar::Init() { + m_qtStatusBar = NULL; m_qtPanes = NULL; } diff --git a/src/qt/textctrl.cpp b/src/qt/textctrl.cpp index 5ef1bd97ff..c6498a44d7 100644 --- a/src/qt/textctrl.cpp +++ b/src/qt/textctrl.cpp @@ -90,7 +90,9 @@ void wxQtTextEdit::textChanged() } -wxTextCtrl::wxTextCtrl() +wxTextCtrl::wxTextCtrl() : + m_qtLineEdit(NULL), + m_qtTextEdit(NULL) { } From 172a97e4114ec7b1c5f708f6ce099a7d4b189144 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 20 Dec 2018 13:40:18 +0000 Subject: [PATCH 118/553] Erase event now is now sent with a valid event object --- src/qt/window.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 8342db8c74..f112f3a545 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -1074,6 +1074,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event ) dc.SetDeviceClippingRegion( m_updateRegion ); wxEraseEvent erase( GetId(), &dc ); + erase.SetEventObject(this); if ( ProcessWindowEvent(erase) ) { // background erased, don't do it again From 5c3ddb7a7f56e18f890504b46b37addba00c70b2 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 20 Dec 2018 13:41:02 +0000 Subject: [PATCH 119/553] Prevent crash when attempting to clear a DC with not device under wxQT --- src/qt/dc.cpp | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index e5405276cd..5cd918ba2c 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -115,14 +115,46 @@ bool wxQtDCImpl::CanGetTextExtent() const void wxQtDCImpl::DoGetSize(int *width, int *height) const { - if (width) *width = m_qtPainter->device()->width(); - if (height) *height = m_qtPainter->device()->height(); + QPaintDevice *pDevice = m_qtPainter->device(); + + int deviceWidth; + int deviceHeight; + + if (pDevice) + { + deviceWidth = pDevice->width(); + deviceHeight = pDevice->height(); + } + else + { + deviceWidth = 0; + deviceHeight = 0; + + } + if (width) *width = deviceWidth; + if (height) *height = deviceHeight; } void wxQtDCImpl::DoGetSizeMM(int* width, int* height) const { - if (width) *width = m_qtPainter->device()->widthMM(); - if (height) *height = m_qtPainter->device()->heightMM(); + QPaintDevice *pDevice = m_qtPainter->device(); + + int deviceWidthMM; + int deviceHeightMM; + + if (pDevice) + { + deviceWidthMM = pDevice->widthMM(); + deviceHeightMM = pDevice->heightMM(); + } + else + { + deviceWidthMM = 0; + deviceHeightMM = 0; + } + + if (width) *width = deviceWidthMM; + if (height) *height = deviceHeightMM; } int wxQtDCImpl::GetDepth() const From c7425b8c6447799054c54723ee372d5fdcec3e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Thu, 20 Dec 2018 13:59:11 +0000 Subject: [PATCH 120/553] Update src/qt/dc.cpp Co-Authored-By: ffa-grahamdawes --- src/qt/dc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 5cd918ba2c..22e164613e 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -120,7 +120,7 @@ void wxQtDCImpl::DoGetSize(int *width, int *height) const int deviceWidth; int deviceHeight; - if (pDevice) + if ( pDevice ) { deviceWidth = pDevice->width(); deviceHeight = pDevice->height(); From ae825ecd8667131bd6cfc26a38c0990f3ab241db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Thu, 20 Dec 2018 13:59:18 +0000 Subject: [PATCH 121/553] Update src/qt/dc.cpp Co-Authored-By: ffa-grahamdawes --- src/qt/dc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 22e164613e..8221f6ba21 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -132,7 +132,8 @@ void wxQtDCImpl::DoGetSize(int *width, int *height) const } if (width) *width = deviceWidth; - if (height) *height = deviceHeight; + if ( height ) + *height = deviceHeight; } void wxQtDCImpl::DoGetSizeMM(int* width, int* height) const From 8f5acb341eeee5d27eb6921e26d7ce04aa0cdea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Thu, 20 Dec 2018 13:59:24 +0000 Subject: [PATCH 122/553] Update src/qt/dc.cpp Co-Authored-By: ffa-grahamdawes --- src/qt/dc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 8221f6ba21..fc0db374aa 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -154,7 +154,8 @@ void wxQtDCImpl::DoGetSizeMM(int* width, int* height) const deviceHeightMM = 0; } - if (width) *width = deviceWidthMM; + if ( width ) + *width = deviceWidthMM; if (height) *height = deviceHeightMM; } From f8110c1c2737ec3656d62ce8d47c231c206472cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Thu, 20 Dec 2018 13:59:31 +0000 Subject: [PATCH 123/553] Update src/qt/dc.cpp Co-Authored-By: ffa-grahamdawes --- src/qt/dc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index fc0db374aa..70b69bbb9b 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -156,7 +156,8 @@ void wxQtDCImpl::DoGetSizeMM(int* width, int* height) const if ( width ) *width = deviceWidthMM; - if (height) *height = deviceHeightMM; + if ( height ) + *height = deviceHeightMM; } int wxQtDCImpl::GetDepth() const From 90165488f63a204d33490940d2602c41c6593926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Thu, 20 Dec 2018 13:59:49 +0000 Subject: [PATCH 124/553] Update src/qt/dc.cpp Co-Authored-By: ffa-grahamdawes --- src/qt/dc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 70b69bbb9b..6c3e940bb6 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -131,7 +131,8 @@ void wxQtDCImpl::DoGetSize(int *width, int *height) const deviceHeight = 0; } - if (width) *width = deviceWidth; + if ( width ) + *width = deviceWidth; if ( height ) *height = deviceHeight; } From f0df737326c253e885aa3754a5955a4bc23fcc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Thu, 20 Dec 2018 14:00:03 +0000 Subject: [PATCH 125/553] Update src/qt/dc.cpp Co-Authored-By: ffa-grahamdawes --- src/qt/dc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 6c3e940bb6..2ccb0906ab 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -144,7 +144,7 @@ void wxQtDCImpl::DoGetSizeMM(int* width, int* height) const int deviceWidthMM; int deviceHeightMM; - if (pDevice) + if ( pDevice ) { deviceWidthMM = pDevice->widthMM(); deviceHeightMM = pDevice->heightMM(); From 7d9675472de37347e4bf34dae024804dea8bf6bb Mon Sep 17 00:00:00 2001 From: Pavel Kalugin Date: Thu, 20 Dec 2018 16:58:34 +0300 Subject: [PATCH 126/553] Refine documentation related to wxTimePickerCtrl Specify event types, corresponding to EVT_TIME_CHANGED and EVT_DATE_CHANGED macros, and update 'see also' sections. --- interface/wx/datectrl.h | 6 +++--- interface/wx/timectrl.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/wx/datectrl.h b/interface/wx/datectrl.h index 26ba06496f..01bd909925 100644 --- a/interface/wx/datectrl.h +++ b/interface/wx/datectrl.h @@ -70,15 +70,15 @@ enum @beginEventEmissionTable{wxDateEvent} @event{EVT_DATE_CHANGED(id, func)} - This event fires when the user changes the current selection in the - control. + Process a wxEVT_DATE_CHANGED event, which fires when the user + changes the current selection in the control. @endEventTable @library{wxcore} @category{pickers} @appearance{datepickerctrl} - @see wxCalendarCtrl, wxDateEvent + @see wxTimePickerCtrl, wxCalendarCtrl, wxDateEvent */ class wxDatePickerCtrl : public wxControl { diff --git a/interface/wx/timectrl.h b/interface/wx/timectrl.h index c640f8f1b4..0d1b77c542 100644 --- a/interface/wx/timectrl.h +++ b/interface/wx/timectrl.h @@ -38,15 +38,15 @@ enum @beginEventEmissionTable{wxDateEvent} @event{EVT_TIME_CHANGED(id, func)} - This event fires when the user changes the current selection in the - control. + Process a wxEVT_TIME_CHANGED event, which fires when the user + changes the current selection in the control. @endEventTable @library{wxcore} @category{pickers} @appearance{timepickerctrl} - @see wxDatePickerCtrl, wxDateEvent + @see wxDatePickerCtrl, wxCalendarCtrl, wxDateEvent @since 2.9.3 */ From 622deec2624d4c8bf5549bf749711db985fd128f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 11 Oct 2015 01:13:33 +0200 Subject: [PATCH 127/553] Replace wxSizer::RecalcSizes() with RepositionChildren() The new method takes minimal size just computed by RecalcSizes() as its argument making it unnecessary to store it as a member variable in the derived classes such as wx{Box,FlexGrid}Sizer. The old method can still be overridden for compatibility and by the derived class that don't need minimal size when updating children. --- include/wx/gbsizer.h | 2 +- include/wx/sizer.h | 43 +++++++++++++--------- include/wx/wrapsizer.h | 8 +++-- interface/wx/sizer.h | 13 ++++--- src/common/gbsizer.cpp | 7 ++-- src/common/sizer.cpp | 77 +++++++++++++++++++--------------------- src/common/wrapsizer.cpp | 6 ++-- 7 files changed, 84 insertions(+), 72 deletions(-) diff --git a/include/wx/gbsizer.h b/include/wx/gbsizer.h index 501b5d8188..3ddb9be5c4 100644 --- a/include/wx/gbsizer.h +++ b/include/wx/gbsizer.h @@ -291,8 +291,8 @@ public: // These are what make the sizer do size calculations and layout - virtual void RecalcSizes() wxOVERRIDE; virtual wxSize CalcMin() wxOVERRIDE; + virtual void RepositionChildren(const wxSize& minSize) wxOVERRIDE; // Look at all items and see if any intersect (or would overlap) the given diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 16c86222a1..4f34ccd3ed 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -658,10 +658,26 @@ public: // These virtual functions are used by the layout algorithm: first // CalcMin() is called to calculate the minimal size of the sizer and - // prepare for laying it out and then RecalcSizes() is called to really - // update all the sizer items + // prepare for laying it out and then RepositionChildren() is called with + // this size to really update all the sizer items. virtual wxSize CalcMin() = 0; - virtual void RecalcSizes() = 0; + + // This method should be overridden but isn't pure virtual for backwards + // compatibility. + virtual void RepositionChildren(const wxSize& WXUNUSED(minSize)) + { + RecalcSizes(); + } + + // This is a deprecated version of RepositionChildren() which doesn't take + // the minimal size parameter which is not needed for very simple sizers + // but typically is for anything more complicated, so prefer to override + // RepositionChildren() in new code. + // + // If RepositionChildren() is not overridden, this method must be + // overridden, calling the base class version results in an assertion + // failure. + virtual void RecalcSizes(); virtual void Layout(); @@ -770,7 +786,7 @@ public: wxGridSizer( int rows, int cols, int vgap, int hgap ); wxGridSizer( int rows, int cols, const wxSize& gap ); - virtual void RecalcSizes() wxOVERRIDE; + virtual void RepositionChildren(const wxSize& minSize) wxOVERRIDE; virtual wxSize CalcMin() wxOVERRIDE; void SetCols( int cols ) @@ -901,13 +917,13 @@ public: const wxArrayInt& GetColWidths() const { return m_colWidths; } // implementation - virtual void RecalcSizes() wxOVERRIDE; + virtual void RepositionChildren(const wxSize& minSize) wxOVERRIDE; virtual wxSize CalcMin() wxOVERRIDE; protected: void AdjustForFlexDirection(); - void AdjustForGrowables(const wxSize& sz); - void FindWidthsAndHeights(int nrows, int ncols); + void AdjustForGrowables(const wxSize& sz, const wxSize& minSize); + wxSize FindWidthsAndHeights(int nrows, int ncols); // the heights/widths of all rows/columns wxArrayInt m_rowHeights, @@ -926,9 +942,6 @@ protected: int m_flexDirection; wxFlexSizerGrowMode m_growMode; - // saves CalcMin result to optimize RecalcSizes - wxSize m_calculatedMinSize; - private: wxDECLARE_CLASS(wxFlexGridSizer); wxDECLARE_NO_COPY_CLASS(wxFlexGridSizer); @@ -960,7 +973,7 @@ public: // implementation of our resizing logic virtual wxSize CalcMin() wxOVERRIDE; - virtual void RecalcSizes() wxOVERRIDE; + virtual void RepositionChildren(const wxSize& minSize) wxOVERRIDE; virtual bool InformFirstDirection(int direction, int size, @@ -1022,10 +1035,6 @@ protected: // the sum of proportion of all of our elements int m_totalProportion; - // the minimal size needed for this sizer as calculated by the last call to - // our CalcMin() - wxSize m_calculatedMinSize; - private: wxDECLARE_CLASS(wxBoxSizer); }; @@ -1045,8 +1054,8 @@ public: wxStaticBoxSizer(int orient, wxWindow *win, const wxString& label = wxEmptyString); virtual ~wxStaticBoxSizer(); - void RecalcSizes() wxOVERRIDE; - wxSize CalcMin() wxOVERRIDE; + virtual wxSize CalcMin() wxOVERRIDE; + virtual void RepositionChildren(const wxSize& minSize) wxOVERRIDE; wxStaticBox *GetStaticBox() const { return m_staticBox; } diff --git a/include/wx/wrapsizer.h b/include/wx/wrapsizer.h index f401c260df..d0494a14a4 100644 --- a/include/wx/wrapsizer.h +++ b/include/wx/wrapsizer.h @@ -36,7 +36,7 @@ public: // override base class virtual methods virtual wxSize CalcMin() wxOVERRIDE; - virtual void RecalcSizes() wxOVERRIDE; + virtual void RepositionChildren(const wxSize& minSize) wxOVERRIDE; virtual bool InformFirstDirection(int direction, int size, @@ -84,13 +84,17 @@ protected: bool m_lastUsed; // Indicates whether value from InformFirst... has // been used yet - // The sizes below are computed by RecalcSizes(), i.e. they don't have + // The sizes below are computed by RepositionChildren(), i.e. they don't have // valid values during the initial call to CalcMin() and they are only // valid for the current layout (i.e. the current number of rows) int m_minSizeMinor; // Min size in minor direction int m_maxSizeMajor; // Size of longest row int m_minItemMajor; // Size of smallest item in major direction + // the minimal size needed for this sizer as calculated by the last call to + // our CalcMin() + wxSize m_calculatedMinSize; + wxBoxSizer m_rows; // Sizer containing multiple rows of our items wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWrapSizer); diff --git a/interface/wx/sizer.h b/interface/wx/sizer.h index f1e3295f52..1cc562ac76 100644 --- a/interface/wx/sizer.h +++ b/interface/wx/sizer.h @@ -725,11 +725,16 @@ public: wxSizerItem* PrependStretchSpacer(int prop = 1); /** - This method is abstract and has to be overwritten by any derived class. - Here, the sizer will do the actual calculation of its children's - positions and sizes. + Method which must be overridden in the derived sizer classes. + + The implementation should reposition the children using the current + total size available to the sizer (@c m_size) and the size computed by + the last call to CalcMin(). + + @since 3.1.3, before this version RecalcSizes() method not taking any + arguments had to be overridden in the derived classes instead. */ - virtual void RecalcSizes() = 0; + virtual void RepositionChildren(const wxSize& minSize) = 0; /** Removes a child window from the sizer, but does @b not destroy it diff --git a/src/common/gbsizer.cpp b/src/common/gbsizer.cpp index 3b291872a4..7ee9b8273a 100644 --- a/src/common/gbsizer.cpp +++ b/src/common/gbsizer.cpp @@ -497,13 +497,12 @@ wxSize wxGridBagSizer::CalcMin() for (idx=0; idx < m_rows; idx++) height += m_rowHeights[idx] + ( idx == m_rows-1 ? 0 : m_vgap ); - m_calculatedMinSize = wxSize(width, height); - return m_calculatedMinSize; + return wxSize(width, height); } -void wxGridBagSizer::RecalcSizes() +void wxGridBagSizer::RepositionChildren(const wxSize& minSize) { // We can't lay out our elements if we don't have at least a single row and // a single column. Notice that this may happen even if we have some @@ -519,7 +518,7 @@ void wxGridBagSizer::RecalcSizes() m_cols = m_colWidths.GetCount(); int idx, width, height; - AdjustForGrowables(sz); + AdjustForGrowables(sz, minSize); // Find the start positions on the window of the rows and columns wxArrayInt rowpos; diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 9bc0d295fb..651af1c48f 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -984,16 +984,23 @@ void wxSizer::FitInside( wxWindow *window ) window->SetVirtualSize( size ); } +void wxSizer::RecalcSizes() +{ + // It is recommended to override RepositionChildren() in the derived + // classes, but if they don't do it, this method must be overridden. + wxFAIL_MSG( wxS("Must be overridden if RepositionChildren() is not") ); +} + void wxSizer::Layout() { // (re)calculates minimums needed for each item and other preparations // for layout - CalcMin(); + const wxSize minSize = CalcMin(); // Applies the layout and repositions/resizes the items wxWindow::ChildrenRepositioningGuard repositionGuard(m_containingWindow); - RecalcSizes(); + RepositionChildren(minSize); } void wxSizer::SetSizeHints( wxWindow *window ) @@ -1457,7 +1464,7 @@ int wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const return nitems; } -void wxGridSizer::RecalcSizes() +void wxGridSizer::RepositionChildren(const wxSize& WXUNUSED(minSize)) { int nitems, nrows, ncols; if ( (nitems = CalcRowsCols(nrows, ncols)) == 0 ) @@ -1625,7 +1632,7 @@ wxFlexGridSizer::~wxFlexGridSizer() { } -void wxFlexGridSizer::RecalcSizes() +void wxFlexGridSizer::RepositionChildren(const wxSize& minSize) { int nrows, ncols; if ( !CalcRowsCols(nrows, ncols) ) @@ -1634,7 +1641,7 @@ void wxFlexGridSizer::RecalcSizes() const wxPoint pt(GetPosition()); const wxSize sz(GetSize()); - AdjustForGrowables(sz); + AdjustForGrowables(sz, minSize); wxSizerItemList::const_iterator i = m_children.begin(); const wxSizerItemList::const_iterator end = m_children.end(); @@ -1707,16 +1714,8 @@ static int SumArraySizes(const wxArrayInt& sizes, int gap) return total; } -void wxFlexGridSizer::FindWidthsAndHeights(int nrows, int ncols) +wxSize wxFlexGridSizer::FindWidthsAndHeights(int WXUNUSED(nrows), int ncols) { - // We have to recalculate the sizes in case the item minimum size has - // changed since the previous layout, or the item has been hidden using - // wxSizer::Show(). If all the items in a row/column are hidden, the final - // dimension of the row/column will be -1, indicating that the column - // itself is hidden. - m_rowHeights.assign(nrows, -1); - m_colWidths.assign(ncols, -1); - // n is the index of the item in left-to-right top-to-bottom order size_t n = 0; for ( wxSizerItemList::iterator i = m_children.begin(); @@ -1742,8 +1741,8 @@ void wxFlexGridSizer::FindWidthsAndHeights(int nrows, int ncols) AdjustForFlexDirection(); - m_calculatedMinSize = wxSize(SumArraySizes(m_colWidths, m_hgap), - SumArraySizes(m_rowHeights, m_vgap)); + return wxSize(SumArraySizes(m_colWidths, m_hgap), + SumArraySizes(m_rowHeights, m_vgap)); } wxSize wxFlexGridSizer::CalcMin() @@ -1775,11 +1774,7 @@ wxSize wxFlexGridSizer::CalcMin() } } - // The stage of looking for max values in each row/column has been - // made a separate function, since it's reused in AdjustForGrowables. - FindWidthsAndHeights(nrows,ncols); - - return m_calculatedMinSize; + return FindWidthsAndHeights(nrows,ncols); } void wxFlexGridSizer::AdjustForFlexDirection() @@ -1893,7 +1888,7 @@ DoAdjustForGrowables(int delta, } } -void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz) +void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz, const wxSize& minSize) { #if wxDEBUG_LEVEL // by the time this function is called, the sizer should be already fully @@ -1931,7 +1926,7 @@ void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz) { DoAdjustForGrowables ( - sz.x - m_calculatedMinSize.x, + sz.x - minSize.x, m_growableCols, m_colWidths, m_growMode == wxFLEX_GROWMODE_SPECIFIED ? &m_growableColsProportions @@ -1949,7 +1944,7 @@ void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz) i != m_children.end(); ++i ) { - didAdjustMinSize |= (*i)->InformFirstDirection(wxHORIZONTAL, m_colWidths[col], sz.y - m_calculatedMinSize.y); + didAdjustMinSize |= (*i)->InformFirstDirection(wxHORIZONTAL, m_colWidths[col], sz.y - minSize.y); if ( ++col == ncols ) col = 0; } @@ -1959,7 +1954,7 @@ void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz) { DoAdjustForGrowables ( - sz.x - m_calculatedMinSize.x, + sz.x - minSize.x, m_growableCols, m_colWidths, m_growMode == wxFLEX_GROWMODE_SPECIFIED ? &m_growableColsProportions @@ -1974,7 +1969,7 @@ void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz) // should treat all rows as having proportion of 1 then DoAdjustForGrowables ( - sz.y - m_calculatedMinSize.y, + sz.y - minSize.y, m_growableRows, m_rowHeights, m_growMode == wxFLEX_GROWMODE_SPECIFIED ? &m_growableRowsProportions @@ -2123,9 +2118,9 @@ namespace { /* - Helper of RecalcSizes(): checks if there is enough remaining space for the - min size of the given item and returns its min size or the entire remaining - space depending on which one is greater. + Helper of RepositionChildren(): checks if there is enough remaining space + for the min size of the given item and returns its min size or the entire + remaining space depending on which one is greater. This function updates the remaining space parameter to account for the size effectively allocated to the item. @@ -2163,7 +2158,7 @@ GetMinOrRemainingSize(int orient, const wxSizerItem *item, int *remainingSpace_) } // anonymous namespace -void wxBoxSizer::RecalcSizes() +void wxBoxSizer::RepositionChildren(const wxSize& minSize) { if ( m_children.empty() ) return; @@ -2173,7 +2168,7 @@ void wxBoxSizer::RecalcSizes() // the amount of free space which we should redistribute among the // stretchable items (i.e. those with non zero proportion) - int delta = totalMajorSize - GetSizeInMajorDir(m_calculatedMinSize); + int delta = totalMajorSize - GetSizeInMajorDir(minSize); // declare loop variables used below: wxSizerItemList::const_iterator i; // iterator in m_children list @@ -2492,7 +2487,7 @@ void wxBoxSizer::RecalcSizes() wxSize wxBoxSizer::CalcMin() { m_totalProportion = 0; - m_calculatedMinSize = wxSize(0, 0); + wxSize minSize; // The minimal size for the sizer should be big enough to allocate its // element at least its minimal size but also, and this is the non trivial @@ -2523,19 +2518,19 @@ wxSize wxBoxSizer::CalcMin() else // fixed size item { // Just account for its size directly - SizeInMajorDir(m_calculatedMinSize) += GetSizeInMajorDir(sizeMinThis); + SizeInMajorDir(minSize) += GetSizeInMajorDir(sizeMinThis); } // In the transversal direction we just need to find the maximum. - if ( GetSizeInMinorDir(sizeMinThis) > GetSizeInMinorDir(m_calculatedMinSize) ) - SizeInMinorDir(m_calculatedMinSize) = GetSizeInMinorDir(sizeMinThis); + if ( GetSizeInMinorDir(sizeMinThis) > GetSizeInMinorDir(minSize) ) + SizeInMinorDir(minSize) = GetSizeInMinorDir(sizeMinThis); } // Using the max ratio ensures that the min size is big enough for all // items to have their min size and satisfy the proportions among them. - SizeInMajorDir(m_calculatedMinSize) += (int)(maxMinSizeToProp*m_totalProportion); + SizeInMajorDir(minSize) += (int)(maxMinSizeToProp*m_totalProportion); - return m_calculatedMinSize; + return minSize; } bool @@ -2604,7 +2599,7 @@ wxStaticBoxSizer::~wxStaticBoxSizer() m_staticBox->WXDestroyWithoutChildren(); } -void wxStaticBoxSizer::RecalcSizes() +void wxStaticBoxSizer::RepositionChildren(const wxSize& minSize) { int top_border, other_border; m_staticBox->GetBordersForSizer(&top_border, &other_border); @@ -2621,7 +2616,7 @@ void wxStaticBoxSizer::RecalcSizes() #if defined( __WXGTK20__ ) // if the wxStaticBox has created a wxPizza to contain its children // (see wxStaticBox::AddChild) then we need to place the items it contains - // in the wxBoxSizer::RecalcSizes() call below using coordinates relative + // in the base class version called below using coordinates relative // to the top-left corner of the staticbox: m_position.x = m_position.y = 0; #elif defined(__WXOSX__) && wxOSX_USE_COCOA @@ -2630,7 +2625,7 @@ void wxStaticBoxSizer::RecalcSizes() m_position.x = m_position.y = 10; #else // if the wxStaticBox has children, then these windows must be placed - // by the wxBoxSizer::RecalcSizes() call below using coordinates relative + // by the base class version called below using coordinates relative // to the top-left corner of the staticbox (but unlike wxGTK, we need // to keep in count the static borders here!): m_position.x = other_border; @@ -2646,7 +2641,7 @@ void wxStaticBoxSizer::RecalcSizes() m_position.y += top_border; } - wxBoxSizer::RecalcSizes(); + wxBoxSizer::RepositionChildren(minSize); m_position = old_pos; m_size = old_size; diff --git a/src/common/wrapsizer.cpp b/src/common/wrapsizer.cpp index 90118e3c74..155eb95341 100644 --- a/src/common/wrapsizer.cpp +++ b/src/common/wrapsizer.cpp @@ -92,8 +92,8 @@ void wxWrapSizer::ClearRows() { // all elements of the row sizers are also elements of this one (we // directly add pointers to elements of our own m_children list to the row - // sizers in RecalcSizes()), so we need to detach them from the row sizer - // to avoid double deletion + // sizers in RepositionChildren()), so we need to detach them from the row + // sizer to avoid double deletion wxSizerItemList& rows = m_rows.GetChildren(); for ( wxSizerItemList::iterator i = rows.begin(), end = rows.end(); @@ -485,7 +485,7 @@ void wxWrapSizer::FinishRow(size_t n, AdjustLastRowItemProp(n, itemLast); } -void wxWrapSizer::RecalcSizes() +void wxWrapSizer::RepositionChildren(const wxSize& WXUNUSED(minSize)) { // First restore any proportions we may have changed and remove the old rows ClearRows(); From b890f59bc95c42d2b78803aea1a2aa86ca1e171f Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 21 Dec 2018 08:18:17 +0000 Subject: [PATCH 128/553] Call base class Show from wxRadioBox::Show --- src/qt/radiobox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 22706e8038..58b88b8989 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -245,6 +245,9 @@ bool wxRadioBox::Show(unsigned int n, bool show) bool wxRadioBox::Show( bool show ) { + if ( !wxControl::Show(show) ) + return false; + if (!m_qtGroupBox) return false; From 538cdc0841fb68fa33ed68bff0362b062e127c9e Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 21 Dec 2018 14:55:33 +0000 Subject: [PATCH 129/553] Add missing RTTI to some wxQT classes --- include/wx/qt/brush.h | 3 +++ include/wx/qt/colordlg.h | 2 ++ include/wx/qt/dc.h | 3 +++ include/wx/qt/dcclient.h | 10 ++++++++++ include/wx/qt/dcmemory.h | 3 +++ include/wx/qt/dcprint.h | 4 ++-- include/wx/qt/mdi.h | 3 +++ include/wx/qt/msgdlg.h | 3 +++ include/wx/qt/palette.h | 3 +++ include/wx/qt/pen.h | 3 +++ include/wx/qt/region.h | 5 +++++ include/wx/qt/textentry.h | 2 -- include/wx/qt/tglbtn.h | 1 + src/qt/brush.cpp | 1 + src/qt/colordlg.cpp | 2 ++ src/qt/dc.cpp | 2 ++ src/qt/dcclient.cpp | 5 +++++ src/qt/dcmemory.cpp | 2 ++ src/qt/dcprint.cpp | 2 ++ src/qt/mdi.cpp | 4 ++++ src/qt/msgdlg.cpp | 2 ++ src/qt/palette.cpp | 2 ++ src/qt/pen.cpp | 2 ++ src/qt/region.cpp | 4 ++++ src/qt/tglbtn.cpp | 2 ++ 25 files changed, 71 insertions(+), 4 deletions(-) diff --git a/include/wx/qt/brush.h b/include/wx/qt/brush.h index 7dfe38ee22..9359ac54ea 100644 --- a/include/wx/qt/brush.h +++ b/include/wx/qt/brush.h @@ -41,6 +41,9 @@ public: protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; + +private: + wxDECLARE_DYNAMIC_CLASS(wxBrush); }; #endif // _WX_QT_BRUSH_H_ diff --git a/include/wx/qt/colordlg.h b/include/wx/qt/colordlg.h index fec19d7d94..48c535fa03 100644 --- a/include/wx/qt/colordlg.h +++ b/include/wx/qt/colordlg.h @@ -27,6 +27,8 @@ private: QColorDialog *GetQColorDialog() const; wxColourData m_data; + + wxDECLARE_DYNAMIC_CLASS(wxColourDialog); }; #endif // _WX_QT_COLORDLG_H_ diff --git a/include/wx/qt/dc.h b/include/wx/qt/dc.h index 56849a2124..43bd13e070 100644 --- a/include/wx/qt/dc.h +++ b/include/wx/qt/dc.h @@ -129,6 +129,9 @@ private: QColor *m_qtPenColor; QColor *m_qtBrushColor; void ApplyRasterColourOp(); + + wxDECLARE_CLASS(wxQtDCImpl); + wxDECLARE_NO_COPY_CLASS(wxQtDCImpl); }; diff --git a/include/wx/qt/dcclient.h b/include/wx/qt/dcclient.h index 23d6d8ce69..fdec1abbed 100644 --- a/include/wx/qt/dcclient.h +++ b/include/wx/qt/dcclient.h @@ -20,6 +20,10 @@ public: protected: wxWindow *m_window; + +private: + wxDECLARE_CLASS(wxWindowDCImpl); + wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl); }; @@ -30,6 +34,9 @@ public: wxClientDCImpl( wxDC *owner, wxWindow *win ); ~wxClientDCImpl(); +private: + wxDECLARE_CLASS(wxClientDCImpl); + wxDECLARE_NO_COPY_CLASS(wxClientDCImpl); }; @@ -38,6 +45,9 @@ class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxWindowDCImpl public: wxPaintDCImpl( wxDC *owner ); wxPaintDCImpl( wxDC *owner, wxWindow *win ); +private: + wxDECLARE_CLASS(wxPaintDCImpl); + wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl); }; #endif // _WX_QT_DCCLIENT_H_ diff --git a/include/wx/qt/dcmemory.h b/include/wx/qt/dcmemory.h index 8ed5773a89..5f1e333cf6 100644 --- a/include/wx/qt/dcmemory.h +++ b/include/wx/qt/dcmemory.h @@ -26,6 +26,9 @@ public: private: wxBitmap m_selected; + + DECLARE_CLASS(wxMemoryDCImpl); + DECLARE_NO_COPY_CLASS(wxMemoryDCImpl); }; #endif // _WX_QT_DCMEMORY_H_ diff --git a/include/wx/qt/dcprint.h b/include/wx/qt/dcprint.h index 3c567eef47..09ea99ea94 100644 --- a/include/wx/qt/dcprint.h +++ b/include/wx/qt/dcprint.h @@ -98,9 +98,9 @@ public: wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle = wxODDEVEN_RULE); -protected: - private: + wxDECLARE_CLASS(wxPrinterDCImpl); + wxDECLARE_NO_COPY_CLASS(wxPrinterDCImpl); }; #endif // _WX_QT_DCPRINT_H_ diff --git a/include/wx/qt/mdi.h b/include/wx/qt/mdi.h index f8ec160355..260857902b 100644 --- a/include/wx/qt/mdi.h +++ b/include/wx/qt/mdi.h @@ -65,6 +65,8 @@ public: const wxString& name = wxFrameNameStr); virtual void Activate(); + + wxDECLARE_DYNAMIC_CLASS(wxMDIChildFrame); }; @@ -75,6 +77,7 @@ public: wxMDIClientWindow(); virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); + wxDECLARE_DYNAMIC_CLASS(wxMDIClientWindow); }; #endif // _WX_QT_MDI_H_ diff --git a/include/wx/qt/msgdlg.h b/include/wx/qt/msgdlg.h index 6f1acdc16a..08b3c6437d 100644 --- a/include/wx/qt/msgdlg.h +++ b/include/wx/qt/msgdlg.h @@ -23,6 +23,9 @@ public: // Reimplemented to translate return codes from Qt to wx virtual int ShowModal(); + +private: + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxMessageDialog); }; #endif // _WX_QT_MSGDLG_H_ diff --git a/include/wx/qt/palette.h b/include/wx/qt/palette.h index d3aeff38ab..7f01dfdc25 100644 --- a/include/wx/qt/palette.h +++ b/include/wx/qt/palette.h @@ -23,6 +23,9 @@ protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; +private: + wxDECLARE_DYNAMIC_CLASS(wxPalette); + }; #endif // _WX_QT_PALETTE_H_ diff --git a/include/wx/qt/pen.h b/include/wx/qt/pen.h index 42c57a5304..9a6ce1dc8c 100644 --- a/include/wx/qt/pen.h +++ b/include/wx/qt/pen.h @@ -49,6 +49,9 @@ public: protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; + +private: + wxDECLARE_DYNAMIC_CLASS(wxPen); }; #endif // _WX_QT_PEN_H_ diff --git a/include/wx/qt/region.h b/include/wx/qt/region.h index 17840ead77..7bb2a56d68 100644 --- a/include/wx/qt/region.h +++ b/include/wx/qt/region.h @@ -47,6 +47,9 @@ protected: virtual bool DoIntersect(const wxRegion& region); virtual bool DoSubtract(const wxRegion& region); virtual bool DoXor(const wxRegion& region); + +private: + wxDECLARE_DYNAMIC_CLASS(wxRegion); }; @@ -81,6 +84,8 @@ public: private: QVector < QRect > *m_qtRects; int m_pos; + + wxDECLARE_DYNAMIC_CLASS(wxRegionIterator); }; #endif // _WX_QT_REGION_H_ diff --git a/include/wx/qt/textentry.h b/include/wx/qt/textentry.h index 26261c3132..458e6add68 100644 --- a/include/wx/qt/textentry.h +++ b/include/wx/qt/textentry.h @@ -41,8 +41,6 @@ protected: virtual void DoSetValue(const wxString& value, int flags=0); virtual wxWindow *GetEditableWindow(); - -private: }; #endif // _WX_QT_TEXTENTRY_H_ diff --git a/include/wx/qt/tglbtn.h b/include/wx/qt/tglbtn.h index de7f16e926..4b20ac2f75 100644 --- a/include/wx/qt/tglbtn.h +++ b/include/wx/qt/tglbtn.h @@ -72,6 +72,7 @@ public: virtual QWidget *GetHandle() const; private: + wxDECLARE_DYNAMIC_CLASS(wxToggleButton); }; diff --git a/src/qt/brush.cpp b/src/qt/brush.cpp index 9c16a35c9d..6798e438f1 100644 --- a/src/qt/brush.cpp +++ b/src/qt/brush.cpp @@ -15,6 +15,7 @@ #include +wxIMPLEMENT_DYNAMIC_CLASS(wxBrush,wxBrushBase); static Qt::BrushStyle ConvertBrushStyle(wxBrushStyle style) { diff --git a/src/qt/colordlg.cpp b/src/qt/colordlg.cpp index 5781bd61c2..286f8c8831 100644 --- a/src/qt/colordlg.cpp +++ b/src/qt/colordlg.cpp @@ -21,6 +21,8 @@ public: { } }; +wxIMPLEMENT_DYNAMIC_CLASS(wxColourDialog,wxDialog) + bool wxColourDialog::Create(wxWindow *parent, wxColourData *data ) { m_qtWindow = new wxQtColorDialog( parent, this ); diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index e5405276cd..7715f13037 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -43,6 +43,8 @@ static void SetBrushColour( QPainter *qtPainter, QColor col ) qtPainter->setBrush( b ); } +wxIMPLEMENT_CLASS(wxQtDCImpl,wxDCImpl); + wxQtDCImpl::wxQtDCImpl( wxDC *owner ) : wxDCImpl( owner ) { diff --git a/src/qt/dcclient.cpp b/src/qt/dcclient.cpp index eea8088a42..9c453e7226 100644 --- a/src/qt/dcclient.cpp +++ b/src/qt/dcclient.cpp @@ -27,6 +27,8 @@ //############################################################################## +wxIMPLEMENT_CLASS(wxWindowDCImpl,wxQtDCImpl); + wxWindowDCImpl::wxWindowDCImpl( wxDC *owner ) : wxQtDCImpl( owner ) { @@ -59,6 +61,7 @@ wxWindowDCImpl::~wxWindowDCImpl() //############################################################################## +wxIMPLEMENT_CLASS(wxClientDCImpl,wxQtDCImpl); wxClientDCImpl::wxClientDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) @@ -118,6 +121,8 @@ wxClientDCImpl::~wxClientDCImpl() //############################################################################## +wxIMPLEMENT_CLASS(wxPaintDCImpl,wxQtDCImpl); + wxPaintDCImpl::wxPaintDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) { diff --git a/src/qt/dcmemory.cpp b/src/qt/dcmemory.cpp index 563d1cff1f..ab06f32cdd 100644 --- a/src/qt/dcmemory.cpp +++ b/src/qt/dcmemory.cpp @@ -13,6 +13,8 @@ #include +wxIMPLEMENT_CLASS(wxMemoryDCImpl,wxQtDCImpl); + wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner ) : wxQtDCImpl( owner ) { diff --git a/src/qt/dcprint.cpp b/src/qt/dcprint.cpp index 11a3d59d48..74e4dceae0 100644 --- a/src/qt/dcprint.cpp +++ b/src/qt/dcprint.cpp @@ -11,6 +11,8 @@ #include "wx/dcprint.h" #include "wx/qt/dcprint.h" +wxIMPLEMENT_CLASS(wxPrinterDCImpl,wxDCImpl) + wxPrinterDCImpl::wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData & ) : wxDCImpl( owner ) { diff --git a/src/qt/mdi.cpp b/src/qt/mdi.cpp index 3655a355de..d3e13edff8 100644 --- a/src/qt/mdi.cpp +++ b/src/qt/mdi.cpp @@ -88,6 +88,8 @@ void wxMDIParentFrame::ActivatePrevious() //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxMDIChildFrameBase) + wxMDIChildFrame::wxMDIChildFrame() { } @@ -129,6 +131,8 @@ void wxMDIChildFrame::Activate() //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxMDIClientWindowBase) + wxMDIClientWindow::wxMDIClientWindow() { } diff --git a/src/qt/msgdlg.cpp b/src/qt/msgdlg.cpp index b80c004564..fd0a446f95 100644 --- a/src/qt/msgdlg.cpp +++ b/src/qt/msgdlg.cpp @@ -111,6 +111,8 @@ wxMessageDialog::wxMessageDialog( wxWindow *parent, const wxString& message, PostCreation(); } +wxIMPLEMENT_CLASS(wxMessageDialog,wxMessageDialogBase); + int wxMessageDialog::ShowModal() { wxCHECK_MSG( m_qtWindow, -1, "Invalid dialog" ); diff --git a/src/qt/palette.cpp b/src/qt/palette.cpp index 933a99943b..9fadc79543 100644 --- a/src/qt/palette.cpp +++ b/src/qt/palette.cpp @@ -10,6 +10,8 @@ #include "wx/palette.h" +wxIMPLEMENT_DYNAMIC_CLASS(wxPalette,wxPaletteBase) + wxPalette::wxPalette() { } diff --git a/src/qt/pen.cpp b/src/qt/pen.cpp index f09d93108c..e7310aaa9b 100644 --- a/src/qt/pen.cpp +++ b/src/qt/pen.cpp @@ -13,6 +13,8 @@ #include "wx/qt/private/utils.h" #include +wxIMPLEMENT_DYNAMIC_CLASS(wxPen,wxPenBase); + static Qt::PenStyle ConvertPenStyle(wxPenStyle style) { switch(style) diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 45936ab577..0fa4a3db60 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -53,6 +53,8 @@ class wxRegionRefData: public wxGDIRefData #define M_REGIONDATA ((wxRegionRefData *)m_refData)->m_qtRegion +wxIMPLEMENT_DYNAMIC_CLASS(wxRegion,wxRegionBase); + wxRegion::wxRegion() { m_refData = new wxRegionRefData(); @@ -255,6 +257,8 @@ const QRegion &wxRegion::GetHandle() const //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject); + wxRegionIterator::wxRegionIterator() { m_qtRects = NULL; diff --git a/src/qt/tglbtn.cpp b/src/qt/tglbtn.cpp index f27c72490c..77ee85b15e 100644 --- a/src/qt/tglbtn.cpp +++ b/src/qt/tglbtn.cpp @@ -103,6 +103,8 @@ QWidget *wxBitmapToggleButton::GetHandle() const //############################################################################## +wxIMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxToggleButtonBase); + wxToggleButton::wxToggleButton() { } From 9c77e0b2a5deb2562826de6981381a2c26a0c8b3 Mon Sep 17 00:00:00 2001 From: Pavel Pimenov Date: Fri, 21 Dec 2018 19:23:07 +0300 Subject: [PATCH 130/553] Remove unused variables This fixes PVS Studio static analyzer warnings: V808 'errMsg' object of 'wxString' type was created but was not utilized. docview.cpp 1182 V808 'search' object of 'wxString' type was created but was not utilized. dirctrlg.cpp 697 V808 'filename' object of 'wxString' type was created but was not utilized. dirctrlg.cpp 697 (see full report at http://www.fly-server.ru/pvs-studio/wxWidgets-core/) Closes https://github.com/wxWidgets/wxWidgets/pull/1096 --- src/common/docview.cpp | 1 - src/generic/dirctrlg.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/docview.cpp b/src/common/docview.cpp index c41b1f60ee..9c7b8d1c53 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1179,7 +1179,6 @@ void wxDocManager::DoOpenMRUFile(unsigned n) if ( filename.empty() ) return; - wxString errMsg; // must contain exactly one "%s" if non-empty if ( wxFile::Exists(filename) ) { // Try to open it but don't give an error if it failed: this could be diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 84ceb8b97d..cd5a1970c6 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -694,7 +694,7 @@ void wxGenericDirCtrl::PopulateNode(wxTreeItemId parentId) wxASSERT(data); - wxString search,path,filename; + wxString path; wxString dirName(data->m_path); From 8432726ba813dae8fe96cbd2795c69ed4036ef37 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 22 Dec 2018 12:00:20 +0100 Subject: [PATCH 131/553] Make string literal wxChar* string This macro parameter is passed to wxArrayStringProperty::OnButtonClick() parameter of wxChar* type. char* string interpreted in this function as a wxChar* string results in obtaining invalid Unicode characters. This fixes a regression introduced in b70ed2d8c84cadf10bd42fc052a255fac02391e4. Closes #18307. --- samples/propgrid/sampleprops.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/propgrid/sampleprops.cpp b/samples/propgrid/sampleprops.cpp index 9a3b7a1b41..92ea1316ed 100644 --- a/samples/propgrid/sampleprops.cpp +++ b/samples/propgrid/sampleprops.cpp @@ -277,7 +277,7 @@ wxVariant wxPointProperty::ChildChanged( wxVariant& thisValue, // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(wxDirsProperty, ',', - "Browse") + wxT("Browse")) // This literal has to be of wxChar* type #if wxUSE_VALIDATORS From 686380c3312772e077c20480eb2ec362586315ce Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 22 Dec 2018 12:07:12 +0100 Subject: [PATCH 132/553] Initialize all wxPGArrayEditorDialog members in ctor Initialize members of wxPGArrayEditorDialog class in its Init() method to have just created object in well-defined state. --- src/propgrid/props.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 0d4b3ead19..9a530fe7cc 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -2405,9 +2405,12 @@ wxPGArrayEditorDialog::wxPGArrayEditorDialog() void wxPGArrayEditorDialog::Init() { + m_elb = NULL; + m_elbSubPanel = NULL; m_lastFocused = NULL; m_hasCustomNewAction = false; m_itemPendingAtIndex = -1; + m_modified = false; } // ----------------------------------------------------------------------- From 0fbc4cd6abe9944d0a4c76d4cb04fef51745f824 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 22 Dec 2018 12:30:05 +0100 Subject: [PATCH 133/553] Allow setting custom tooltip text for "New" button in wxPGArrayEditorDialog Ability to change the tooltip can be useful if standard text "New item" is not descriptive enough. --- docs/changes.txt | 2 ++ include/wx/propgrid/props.h | 14 ++++++++++++-- interface/wx/propgrid/props.h | 6 +++++- src/propgrid/props.cpp | 6 ++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index c3d49daf94..9c6647462b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -116,6 +116,8 @@ All (GUI): - Fix wxInfoBar close button size in high DPI (Stefan Ziegler). - Make disabling the window before creating it actually work. +- Allow changing tooltip text for button allowing to enter a new string + in wxPGArrayEditorDialog. 3.1.2: (released 2018-12-10) diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index a5c4a601d9..1a94a422b5 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -796,8 +796,7 @@ wxValidator* PROPNAME::DoGetValidator () const \ #if wxUSE_EDITABLELISTBOX -class WXDLLIMPEXP_FWD_CORE wxEditableListBox; -class WXDLLIMPEXP_FWD_CORE wxListEvent; +#include "wx/editlbox.h" #define wxAEDIALOG_STYLE \ (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE) @@ -829,6 +828,15 @@ public: m_hasCustomNewAction = true; } + void SetNewButtonText(const wxString& text) + { + m_customNewButtonText = text; + if ( m_elb && m_elb->GetNewButton() ) + { + m_elb->GetNewButton()->SetToolTip(text); + } + } + // Set value modified by dialog. virtual void SetDialogValue( const wxVariant& WXUNUSED(value) ) { @@ -880,6 +888,7 @@ protected: bool m_modified; bool m_hasCustomNewAction; + wxString m_customNewButtonText; // These must be overridden - must return true on success. virtual wxString ArrayGet( size_t index ) = 0; @@ -929,6 +938,7 @@ public: if ( !custBtText.empty() ) { EnableCustomNewAction(); + SetNewButtonText(custBtText); m_pCallingClass = pcc; } } diff --git a/interface/wx/propgrid/props.h b/interface/wx/propgrid/props.h index 564916c829..824581b2ae 100644 --- a/interface/wx/propgrid/props.h +++ b/interface/wx/propgrid/props.h @@ -726,7 +726,11 @@ public: const wxSize& sz = wxDefaultSize ); void EnableCustomNewAction(); - + + /** Sets tooltip text for button allowing the user to enter new string. + */ + void SetNewButtonText(const wxString& text); + /** Set value modified by dialog. */ virtual void SetDialogValue( const wxVariant& value ); diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 9a530fe7cc..2587f841b5 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -2467,6 +2467,12 @@ bool wxPGArrayEditorDialog::Create( wxWindow *parent, wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE); + // Set custom text for "New" button, if provided + if ( !m_customNewButtonText.empty() ) + { + m_elb->GetNewButton()->SetToolTip(m_customNewButtonText); + } + // Populate the list box wxArrayString arr; for ( unsigned int i=0; i Date: Sun, 23 Dec 2018 10:47:33 +0100 Subject: [PATCH 134/553] Cleanup wxPGArrayEditorDialog docs --- interface/wx/propgrid/props.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/interface/wx/propgrid/props.h b/interface/wx/propgrid/props.h index 824581b2ae..3526433954 100644 --- a/interface/wx/propgrid/props.h +++ b/interface/wx/propgrid/props.h @@ -749,27 +749,25 @@ public: */ virtual wxValidator* GetTextCtrlValidator() const; - // Returns true if array was actually modified + /** Returns true if array was actually modified + */ bool IsModified() const; - // wxEditableListBox utilities int GetSelection() const; protected: wxEditableListBox* m_elb; - - // These are used for focus repair wxWindow* m_elbSubPanel; wxWindow* m_lastFocused; - // A new item, edited by user, is pending at this index. - // It will be committed once list ctrl item editing is done. + /** A new item, edited by user, is pending at this index. + It will be committed once list ctrl item editing is done. + */ int m_itemPendingAtIndex; bool m_modified; bool m_hasCustomNewAction; - // These must be overridden - must return true on success. virtual wxString ArrayGet( size_t index ) = 0; virtual size_t ArrayGetCount() = 0; virtual bool ArrayInsert( const wxString& str, int index ) = 0; From 7e297ee6670ade3f34dbec8a735a0a2b3c56e115 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 23 Dec 2018 11:28:40 +0100 Subject: [PATCH 135/553] Compilation fix for PCH-less build Include the header required by newly implemented wxPGArrayEditorDialog::SetNewButtonText. --- include/wx/propgrid/props.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 1a94a422b5..1ebfb91699 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -797,6 +797,7 @@ wxValidator* PROPNAME::DoGetValidator () const \ #if wxUSE_EDITABLELISTBOX #include "wx/editlbox.h" +#include #define wxAEDIALOG_STYLE \ (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE) From db4c98388100823216a4127dc7c0503de634b6f0 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sat, 22 Dec 2018 13:40:43 +0100 Subject: [PATCH 136/553] CMake: Add missing stc and wxscintilla compile flags This fixes absence of highlighting and folding in CMake builds. Closes https://github.com/wxWidgets/wxWidgets/pull/1097 Closes #18306. --- build/cmake/lib/stc/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/cmake/lib/stc/CMakeLists.txt b/build/cmake/lib/stc/CMakeLists.txt index 8def395466..82b79518fa 100644 --- a/build/cmake/lib/stc/CMakeLists.txt +++ b/build/cmake/lib/stc/CMakeLists.txt @@ -163,6 +163,8 @@ target_include_directories(wxscintilla PRIVATE target_compile_definitions(wxscintilla PUBLIC NO_CXX11_REGEX __WX__ + SCI_LEXER + LINK_LEXERS ) if(wxBUILD_PRECOMP) @@ -183,6 +185,8 @@ wx_lib_include_directories(stc PRIVATE ${wxSOURCE_DIR}/src/stc/scintilla/src ) wx_lib_compile_definitions(stc PRIVATE + NO_CXX11_REGEX + __WX__ SCI_LEXER LINK_LEXERS ) From d3eb5b38aa70488a23f4ae0c6c1e113d54102acd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 23 Dec 2018 17:02:45 +0100 Subject: [PATCH 137/553] Don't crash when drawing 0-sized wxAuiTabContainer in debug build Attempting to create a bitmap with 0 width or height results in an assertion failure, which is fatal, as it happens in wxEVT_PAINT handler and so quickly results in reentering it and asserting again and recursive assert failures terminate the application. Just avoid doing it, there is nothing to paint anyhow if the associated rectangle is empty. See https://github.com/wxWidgets/wxWidgets/pull/1085 --- src/aui/auibook.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index bbba6cd33e..7f66828770 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -414,6 +414,9 @@ void wxAuiTabContainer::Render(wxDC* raw_dc, wxWindow* wnd) if (!raw_dc || !raw_dc->IsOk()) return; + if (m_rect.IsEmpty()) + return; + wxMemoryDC dc; // use the same layout direction as the window DC uses to ensure that the From e9cbbede005deacfbc5cb861d3679a9879ac2333 Mon Sep 17 00:00:00 2001 From: Sebastian Walderich Date: Tue, 18 Dec 2018 07:57:43 +0100 Subject: [PATCH 138/553] Implement wxAuiNotebook::GetBestSize() Compute the best size of the notebook, taking into account all the different layout possibilities, and add a test checking that this works as expected. Closes https://github.com/wxWidgets/wxWidgets/pull/1085 --- docs/changes.txt | 1 + include/wx/aui/auibook.h | 2 + src/aui/auibook.cpp | 153 +++++++++++++++++++++++++++++++++ tests/Makefile.in | 9 +- tests/controls/auitest.cpp | 130 ++++++++++++++++++++++++++++ tests/makefile.bcc | 10 ++- tests/makefile.gcc | 10 ++- tests/makefile.vc | 10 ++- tests/test.bkl | 2 + tests/test_gui.vcxproj | 19 ++-- tests/test_gui.vcxproj.filters | 3 + tests/test_gui_vc10.sln | 35 ++++++++ tests/test_gui_vc11.sln | 35 ++++++++ tests/test_gui_vc12.sln | 35 ++++++++ tests/test_gui_vc14.sln | 35 ++++++++ tests/test_vc7_test_gui.vcproj | 11 ++- tests/test_vc8_test_gui.vcproj | 20 +++-- tests/test_vc9_test_gui.vcproj | 20 +++-- 18 files changed, 507 insertions(+), 33 deletions(-) create mode 100644 tests/controls/auitest.cpp diff --git a/docs/changes.txt b/docs/changes.txt index 9c6647462b..7d3e0eeb60 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -116,6 +116,7 @@ All (GUI): - Fix wxInfoBar close button size in high DPI (Stefan Ziegler). - Make disabling the window before creating it actually work. +- Implement wxAuiNotebook::GetBestSize() (Sebastian Walderich). - Allow changing tooltip text for button allowing to enter a new string in wxPGArrayEditorDialog. diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index 2571f7d9ac..f7fdd1559c 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -356,6 +356,8 @@ public: virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text, bool select, int imageId) wxOVERRIDE; + virtual wxSize DoGetBestSize() const wxOVERRIDE; + protected: // Common part of all ctors. void Init(); diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 7f66828770..9c516a4690 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3449,6 +3449,159 @@ bool wxAuiNotebook::InsertPage(size_t index, wxWindow *page, } } +namespace +{ + +// Helper class to calculate the best size of a wxAuiNotebook +class wxAuiLayoutObject +{ +public: + enum + { + DockDir_Center, + DockDir_Left, + DockDir_Right, + DockDir_Vertical, // Merge elements from here vertically + DockDir_Top, + DockDir_Bottom, + DockDir_None + }; + + wxAuiLayoutObject(const wxSize &size, const wxAuiPaneInfo &pInfo) + { + m_size = size; + m_pInfo = &pInfo; + /* + To speed up the sorting of the panes, the direction is mapped to a + useful increasing value. This avoids complicated comparison of the + enum values during the sort. The size calculation is done from the + inner to the outermost direction. Therefore CENTER < LEFT/RIGHT < + TOP/BOTTOM (It doesn't matter it LEFT or RIGHT is done first, as + both extend the best size horizontally; the same applies for + TOP/BOTTOM in vertical direction) + */ + switch ( pInfo.dock_direction ) + { + case wxAUI_DOCK_CENTER: m_dir = DockDir_Center; break; + case wxAUI_DOCK_LEFT: m_dir = DockDir_Left; break; + case wxAUI_DOCK_RIGHT: m_dir = DockDir_Right; break; + case wxAUI_DOCK_TOP: m_dir = DockDir_Top; break; + case wxAUI_DOCK_BOTTOM: m_dir = DockDir_Bottom; break; + default: m_dir = DockDir_None; + } + } + void MergeLayout(const wxAuiLayoutObject &lo2) + { + if ( this == &lo2 ) + return; + + bool mergeHorizontal; + if ( m_pInfo->dock_layer != lo2.m_pInfo->dock_layer || m_dir != lo2.m_dir ) + mergeHorizontal = lo2.m_dir < DockDir_Vertical; + else if ( m_pInfo->dock_row != lo2.m_pInfo->dock_row ) + mergeHorizontal = true; + else + mergeHorizontal = lo2.m_dir >= DockDir_Vertical; + + if ( mergeHorizontal ) + { + m_size.x += lo2.m_size.x; + if ( lo2.m_size.y > m_size.y ) + m_size.y = lo2.m_size.y; + } + else + { + if ( lo2.m_size.x > m_size.x ) + m_size.x = lo2.m_size.x; + m_size.y += lo2.m_size.y; + } + } + + wxSize m_size; + const wxAuiPaneInfo *m_pInfo; + unsigned char m_dir; + + /* + As the caulculation is done from the inner to the outermost pane, the + panes are sorted in the following order: layer, direction, row, + position. + */ + bool operator<(const wxAuiLayoutObject& lo2) const + { + int diff = m_pInfo->dock_layer - lo2.m_pInfo->dock_layer; + if ( diff ) + return diff < 0; + diff = m_dir - lo2.m_dir; + if ( diff ) + return diff < 0; + diff = m_pInfo->dock_row - lo2.m_pInfo->dock_row; + if ( diff ) + return diff < 0; + return m_pInfo->dock_pos < lo2.m_pInfo->dock_pos; + } +}; + +} // anonymous namespace + +wxSize wxAuiNotebook::DoGetBestSize() const +{ + /* + The best size of the wxAuiNotebook is a combination of all panes inside + the object. To be able to efficiently calculate the dimensions (i.e. + without iterating over the panes multiple times) the panes need to be + processed in a specific order. Therefore we need to collect them in the + following variable which is sorted later on. + */ + wxVector layouts; + const wxAuiPaneInfoArray& all_panes = + const_cast(m_mgr).GetAllPanes(); + const size_t pane_count = all_panes.GetCount(); + const int tabHeight = GetTabCtrlHeight(); + for ( size_t n = 0; n < pane_count; ++n ) + { + const wxAuiPaneInfo &pInfo = all_panes[n]; + if ( pInfo.name == wxT("dummy") || pInfo.IsFloating() ) + continue; + + const wxTabFrame* tabframe = (wxTabFrame*) all_panes.Item(n).window; + const wxAuiNotebookPageArray &pages = tabframe->m_tabs->GetPages(); + + wxSize bestPageSize; + for ( size_t pIdx = 0; pIdx < pages.GetCount(); pIdx++ ) + bestPageSize.IncTo(pages[pIdx].window->GetBestSize()); + + bestPageSize.y += tabHeight; + // Store the current pane with its largest window dimensions + layouts.push_back(wxAuiLayoutObject(bestPageSize, pInfo)); + } + wxVectorSort(layouts); + + /* + The sizes of the panes are merged here. As the center pane is always at + position 0 all sizes are merged there. As panes can be stacked using + the dock_pos property, different positions are merged at the first + (i.e. dock_pos = 0) element before being merged with the center pane. + */ + size_t pos = 0; + for ( size_t n = 1; n < layouts.size(); n++ ) + { + if ( layouts[n].m_pInfo->dock_layer == layouts[pos].m_pInfo->dock_layer && + layouts[n].m_dir == layouts[pos].m_dir && + layouts[n].m_pInfo->dock_row == layouts[pos].m_pInfo->dock_row ) + { + layouts[pos].MergeLayout(layouts[n]); + } + else + { + layouts[0].MergeLayout(layouts[pos]); + pos = n; + } + } + layouts[0].MergeLayout(layouts[pos]); + + return layouts[0].m_size; +} + int wxAuiNotebook::DoModifySelection(size_t n, bool events) { wxWindow* wnd = m_tabs.GetWindowFromIdx(n); diff --git a/tests/Makefile.in b/tests/Makefile.in index 698e3b0832..9fdee154fb 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -184,6 +184,7 @@ TEST_GUI_OBJECTS = \ test_gui_graphmatrix.o \ test_gui_graphpath.o \ test_gui_config.o \ + test_gui_auitest.o \ test_gui_bitmapcomboboxtest.o \ test_gui_bitmaptogglebuttontest.o \ test_gui_bookctrlbasetest.o \ @@ -327,6 +328,9 @@ TEST_GUI_ODEP = $(_____pch_testprec_test_gui_testprec_h_gch___depname) COND_MONOLITHIC_0_USE_WEBVIEW_1___WXLIB_WEBVIEW_p = \ -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_0_USE_WEBVIEW_1@__WXLIB_WEBVIEW_p = $(COND_MONOLITHIC_0_USE_WEBVIEW_1___WXLIB_WEBVIEW_p) +COND_MONOLITHIC_0___WXLIB_AUI_p = \ + -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui-$(WX_RELEASE)$(HOST_SUFFIX) +@COND_MONOLITHIC_0@__WXLIB_AUI_p = $(COND_MONOLITHIC_0___WXLIB_AUI_p) COND_MONOLITHIC_0___WXLIB_RICHTEXT_p = \ -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext-$(WX_RELEASE)$(HOST_SUFFIX) @COND_MONOLITHIC_0@__WXLIB_RICHTEXT_p = $(COND_MONOLITHIC_0___WXLIB_RICHTEXT_p) @@ -418,7 +422,7 @@ test$(EXEEXT): $(TEST_OBJECTS) @COND_SHARED_1_USE_GUI_1@ $(SHARED_LD_MODULE_CXX) $@ $(TEST_DRAWINGPLUGIN_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) @COND_USE_GUI_1@test_gui$(EXEEXT): $(TEST_GUI_OBJECTS) $(__test_gui___win32rc) -@COND_USE_GUI_1@ $(CXX) -o $@ $(TEST_GUI_OBJECTS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(EXTRALIBS_MEDIA) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_HTML_p) $(EXTRALIBS_HTML) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) +@COND_USE_GUI_1@ $(CXX) -o $@ $(TEST_GUI_OBJECTS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(EXTRALIBS_MEDIA) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_HTML_p) $(EXTRALIBS_HTML) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) @COND_PLATFORM_MACOSX_1_USE_GUI_1@test_gui.app/Contents/PkgInfo: $(__test_gui___depname) $(top_srcdir)/src/osx/carbon/Info.plist.in $(top_srcdir)/src/osx/carbon/wxmac.icns @COND_PLATFORM_MACOSX_1_USE_GUI_1@ mkdir -p test_gui.app/Contents @@ -820,6 +824,9 @@ test_gui_graphpath.o: $(srcdir)/graphics/graphpath.cpp $(TEST_GUI_ODEP) test_gui_config.o: $(srcdir)/config/config.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/config/config.cpp +test_gui_auitest.o: $(srcdir)/controls/auitest.cpp $(TEST_GUI_ODEP) + $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/auitest.cpp + test_gui_bitmapcomboboxtest.o: $(srcdir)/controls/bitmapcomboboxtest.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/bitmapcomboboxtest.cpp diff --git a/tests/controls/auitest.cpp b/tests/controls/auitest.cpp new file mode 100644 index 0000000000..298db57fcf --- /dev/null +++ b/tests/controls/auitest.cpp @@ -0,0 +1,130 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: tests/controls/auitest.cpp +// Purpose: wxAui control tests +// Author: Sebastian Walderich +// Created: 2018-12-19 +// Copyright: (c) 2018 Sebastian Walderich +/////////////////////////////////////////////////////////////////////////////// + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#include "testprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + +#include "wx/panel.h" +#include "wx/scopedptr.h" + +#include "wx/aui/auibook.h" + +#include "asserthelper.h" + +// ---------------------------------------------------------------------------- +// test class +// ---------------------------------------------------------------------------- + +TEST_CASE( "wxAuiNotebook::DoGetBestSize", "[aui]" ) +{ + wxWindow *frame = wxTheApp->GetTopWindow(); + REQUIRE( frame ); + wxAuiNotebook *nb = new wxAuiNotebook(frame); + wxScopedPtr cleanUp(nb); + + wxPanel *p = new wxPanel(nb); + p->SetMinSize(wxSize(100, 100)); + REQUIRE( nb->AddPage(p, "Center Pane") ); + + const int tabHeight = nb->GetTabCtrlHeight(); + + SECTION( "Single pane with multiple tabs" ) + { + p = new wxPanel(nb); + p->SetMinSize(wxSize(300, 100)); + nb->AddPage(p, "Center Tab 2"); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(100, 200)); + nb->AddPage(p, "Center Tab 3"); + + CHECK( nb->GetBestSize() == wxSize(300, 200 + tabHeight) ); + } + + SECTION( "Horizontal split" ) + { + p = new wxPanel(nb); + p->SetMinSize(wxSize(25, 0)); + nb->AddPage(p, "Left Pane"); + nb->Split(nb->GetPageCount()-1, wxLEFT); + + CHECK( nb->GetBestSize() == wxSize(125, 100 + tabHeight) ); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(50, 0)); + nb->AddPage(p, "Right Pane 1"); + nb->Split(nb->GetPageCount()-1, wxRIGHT); + + CHECK( nb->GetBestSize() == wxSize(175, 100 + tabHeight) ); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(100, 0)); + nb->AddPage(p, "Right Pane 2"); + nb->Split(nb->GetPageCount()-1, wxRIGHT); + + CHECK( nb->GetBestSize() == wxSize(275, 100 + tabHeight) ); + } + + SECTION( "Vertical split" ) + { + p = new wxPanel(nb); + p->SetMinSize(wxSize(0, 100)); + nb->AddPage(p, "Top Pane 1"); + nb->Split(nb->GetPageCount()-1, wxTOP); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(0, 50)); + nb->AddPage(p, "Top Pane 2"); + nb->Split(nb->GetPageCount()-1, wxTOP); + + CHECK( nb->GetBestSize() == wxSize(100, 250 + 3*tabHeight) ); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(0, 25)); + nb->AddPage(p, "Bottom Pane"); + nb->Split(nb->GetPageCount()-1, wxBOTTOM); + + CHECK( nb->GetBestSize() == wxSize(100, 275 + 4*tabHeight) ); + } + + SECTION( "Surrounding panes" ) + { + p = new wxPanel(nb); + p->SetMinSize(wxSize(50, 25)); + nb->AddPage(p, "Bottom Pane"); + nb->Split(nb->GetPageCount()-1, wxBOTTOM); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(50, 120)); + nb->AddPage(p, "Right Pane"); + nb->Split(nb->GetPageCount()-1, wxRIGHT); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(225, 50)); + nb->AddPage(p, "Top Pane"); + nb->Split(nb->GetPageCount()-1, wxTOP); + + p = new wxPanel(nb); + p->SetMinSize(wxSize(25, 105)); + nb->AddPage(p, "Left Pane"); + nb->Split(nb->GetPageCount()-1, wxLEFT); + + CHECK( nb->GetBestSize() == wxSize(250, 175 + 3*tabHeight) ); + } +} diff --git a/tests/makefile.bcc b/tests/makefile.bcc index a0892cbd57..97c1cdd1fb 100644 --- a/tests/makefile.bcc +++ b/tests/makefile.bcc @@ -171,6 +171,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_graphmatrix.obj \ $(OBJS)\test_gui_graphpath.obj \ $(OBJS)\test_gui_config.obj \ + $(OBJS)\test_gui_auitest.obj \ $(OBJS)\test_gui_bitmapcomboboxtest.obj \ $(OBJS)\test_gui_bitmaptogglebuttontest.obj \ $(OBJS)\test_gui_bookctrlbasetest.obj \ @@ -332,6 +333,10 @@ __WXLIB_WEBVIEW_p = \ wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview.lib !endif !if "$(MONOLITHIC)" == "0" +__WXLIB_AUI_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui.lib +!endif +!if "$(MONOLITHIC)" == "0" __WXLIB_RICHTEXT_p = \ wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext.lib !endif @@ -518,7 +523,7 @@ $(OBJS)\test_drawingplugin.dll: $(TEST_DRAWINGPLUGIN_OBJECTS) !if "$(USE_GUI)" == "1" $(OBJS)\test_gui.exe: $(OBJS)\test_gui_dummy.obj $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample.res ilink32 -Tpe -q -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -ap $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) @&&| - c0x32.obj $(TEST_GUI_OBJECTS),$@,, $(__WXLIB_WEBVIEW_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) ole2w32.lib oleacc.lib uxtheme.lib import32.lib cw32$(__THREADSFLAG)$(__RUNTIME_LIBS_2).lib,, $(OBJS)\test_gui_sample.res + c0x32.obj $(TEST_GUI_OBJECTS),$@,, $(__WXLIB_WEBVIEW_p) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) ole2w32.lib oleacc.lib uxtheme.lib import32.lib cw32$(__THREADSFLAG)$(__RUNTIME_LIBS_2).lib,, $(OBJS)\test_gui_sample.res | !endif @@ -874,6 +879,9 @@ $(OBJS)\test_gui_graphpath.obj: .\graphics\graphpath.cpp $(OBJS)\test_gui_config.obj: .\config\config.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\config\config.cpp +$(OBJS)\test_gui_auitest.obj: .\controls\auitest.cpp + $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\auitest.cpp + $(OBJS)\test_gui_bitmapcomboboxtest.obj: .\controls\bitmapcomboboxtest.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\bitmapcomboboxtest.cpp diff --git a/tests/makefile.gcc b/tests/makefile.gcc index a4e16537b8..1e70e93aaa 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -166,6 +166,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_graphmatrix.o \ $(OBJS)\test_gui_graphpath.o \ $(OBJS)\test_gui_config.o \ + $(OBJS)\test_gui_auitest.o \ $(OBJS)\test_gui_bitmapcomboboxtest.o \ $(OBJS)\test_gui_bitmaptogglebuttontest.o \ $(OBJS)\test_gui_bookctrlbasetest.o \ @@ -334,6 +335,10 @@ __WXLIB_WEBVIEW_p = \ endif endif ifeq ($(MONOLITHIC),0) +__WXLIB_AUI_p = \ + -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui +endif +ifeq ($(MONOLITHIC),0) __WXLIB_RICHTEXT_p = \ -lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext endif @@ -496,7 +501,7 @@ endif ifeq ($(USE_GUI),1) $(OBJS)\test_gui.exe: $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample_rc.o - $(CXX) -o $@ $(TEST_GUI_OBJECTS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme + $(CXX) -o $@ $(TEST_GUI_OBJECTS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme endif data: @@ -851,6 +856,9 @@ $(OBJS)\test_gui_graphpath.o: ./graphics/graphpath.cpp $(OBJS)\test_gui_config.o: ./config/config.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_gui_auitest.o: ./controls/auitest.cpp + $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_gui_bitmapcomboboxtest.o: ./controls/bitmapcomboboxtest.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index e197998717..204a77a4f8 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -177,6 +177,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_graphmatrix.obj \ $(OBJS)\test_gui_graphpath.obj \ $(OBJS)\test_gui_config.obj \ + $(OBJS)\test_gui_auitest.obj \ $(OBJS)\test_gui_bitmapcomboboxtest.obj \ $(OBJS)\test_gui_bitmaptogglebuttontest.obj \ $(OBJS)\test_gui_bookctrlbasetest.obj \ @@ -484,6 +485,10 @@ __WXLIB_WEBVIEW_p = \ wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_webview.lib !endif !if "$(MONOLITHIC)" == "0" +__WXLIB_AUI_p = \ + wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui.lib +!endif +!if "$(MONOLITHIC)" == "0" __WXLIB_RICHTEXT_p = \ wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext.lib !endif @@ -709,7 +714,7 @@ $(OBJS)\test_drawingplugin.dll: $(TEST_DRAWINGPLUGIN_OBJECTS) !if "$(USE_GUI)" == "1" $(OBJS)\test_gui.exe: $(OBJS)\test_gui_dummy.obj $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample.res link /NOLOGO /OUT:$@ $(__DEBUGINFO_4) /pdb:"$(OBJS)\test_gui.pdb" $(__DEBUGINFO_51) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:CONSOLE $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) @<< - $(TEST_GUI_OBJECTS) $(TEST_GUI_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib + $(TEST_GUI_OBJECTS) $(TEST_GUI_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib << !endif @@ -1065,6 +1070,9 @@ $(OBJS)\test_gui_graphpath.obj: .\graphics\graphpath.cpp $(OBJS)\test_gui_config.obj: .\config\config.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\config\config.cpp +$(OBJS)\test_gui_auitest.obj: .\controls\auitest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\auitest.cpp + $(OBJS)\test_gui_bitmapcomboboxtest.obj: .\controls\bitmapcomboboxtest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\bitmapcomboboxtest.cpp diff --git a/tests/test.bkl b/tests/test.bkl index b8c42324c8..10d70213c2 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -184,6 +184,7 @@ graphics/graphmatrix.cpp graphics/graphpath.cpp config/config.cpp + controls/auitest.cpp controls/bitmapcomboboxtest.cpp controls/bitmaptogglebuttontest.cpp controls/bookctrlbasetest.cpp @@ -282,6 +283,7 @@ wxWebView is not available. --> $(WXLIB_WEBVIEW) + aui richtext media xrc diff --git a/tests/test_gui.vcxproj b/tests/test_gui.vcxproj index 875f33547d..dd60da1d58 100644 --- a/tests/test_gui.vcxproj +++ b/tests/test_gui.vcxproj @@ -154,7 +154,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_aui.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -193,7 +193,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_aui.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -236,7 +236,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_aui.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -275,7 +275,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_aui.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -318,7 +318,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_aui.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -357,7 +357,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_aui.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -400,7 +400,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)ud_webview.lib;wxmsw$(wxShortVersionString)ud_richtext.lib;wxmsw$(wxShortVersionString)ud_aui.lib;wxmsw$(wxShortVersionString)ud_media.lib;wxmsw$(wxShortVersionString)ud_xrc.lib;wxbase$(wxShortVersionString)ud_xml.lib;wxmsw$(wxShortVersionString)ud_html.lib;wxmsw$(wxShortVersionString)ud_core.lib;wxbase$(wxShortVersionString)ud_net.lib;wxbase$(wxShortVersionString)ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -439,7 +439,7 @@ ..\lib\$(wxOutDirName)\$(wxIncSubDir);.\..\include;..\3rdparty\catch\include;.;.\..\samples;%(AdditionalIncludeDirectories) - wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) + wxmsw$(wxShortVersionString)u_webview.lib;wxmsw$(wxShortVersionString)u_richtext.lib;wxmsw$(wxShortVersionString)u_aui.lib;wxmsw$(wxShortVersionString)u_media.lib;wxmsw$(wxShortVersionString)u_xrc.lib;wxbase$(wxShortVersionString)u_xml.lib;wxmsw$(wxShortVersionString)u_html.lib;wxmsw$(wxShortVersionString)u_core.lib;wxbase$(wxShortVersionString)u_net.lib;wxbase$(wxShortVersionString)u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;winspool.lib;winmm.lib;shell32.lib;comctl32.lib;ole32.lib;oleaut32.lib;uuid.lib;rpcrt4.lib;advapi32.lib;wsock32.lib;wininet.lib;%(AdditionalDependencies) true ..\lib\$(wxOutDirName);%(AdditionalLibraryDirectories) true @@ -456,6 +456,7 @@ + @@ -566,4 +567,4 @@ - \ No newline at end of file + diff --git a/tests/test_gui.vcxproj.filters b/tests/test_gui.vcxproj.filters index a8a252cac3..38c0bd0806 100644 --- a/tests/test_gui.vcxproj.filters +++ b/tests/test_gui.vcxproj.filters @@ -299,6 +299,9 @@ Source Files + + Source Files + diff --git a/tests/test_gui_vc10.sln b/tests/test_gui_vc10.sln index e5443de4dc..139d995449 100644 --- a/tests/test_gui_vc10.sln +++ b/tests/test_gui_vc10.sln @@ -6,6 +6,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_gui", "test_gui.vcxpro {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} = {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} = {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} {7FB0902D-8579-5DCE-B883-DAF66A885005} = {7FB0902D-8579-5DCE-B883-DAF66A885005} + {A16D3832-0F42-57CE-8F48-50E06649ADE8} = {A16D3832-0F42-57CE-8F48-50E06649ADE8} {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} = {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} = {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} = {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} @@ -32,6 +33,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "..\build\msw\wx_xrc. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webview", "..\build\msw\wx_webview.vcxproj", "{A8E8442A-078A-5FC5-B495-8D71BA77EE6E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aui", "..\build\msw\wx_aui.vcxproj", "{A16D3832-0F42-57CE-8F48-50E06649ADE8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Static|Win32 = Debug Static|Win32 @@ -300,6 +303,38 @@ Global {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|Win32.Build.0 = Release|Win32 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.ActiveCfg = Release|x64 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.Build.0 = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tests/test_gui_vc11.sln b/tests/test_gui_vc11.sln index 80b9c1d271..1f92cda795 100644 --- a/tests/test_gui_vc11.sln +++ b/tests/test_gui_vc11.sln @@ -6,6 +6,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_gui", "test_gui.vcxpro {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} = {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} = {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} {7FB0902D-8579-5DCE-B883-DAF66A885005} = {7FB0902D-8579-5DCE-B883-DAF66A885005} + {A16D3832-0F42-57CE-8F48-50E06649ADE8} = {A16D3832-0F42-57CE-8F48-50E06649ADE8} {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} = {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} = {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} = {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} @@ -32,6 +33,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "..\build\msw\wx_xrc. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webview", "..\build\msw\wx_webview.vcxproj", "{A8E8442A-078A-5FC5-B495-8D71BA77EE6E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aui", "..\build\msw\wx_aui.vcxproj", "{A16D3832-0F42-57CE-8F48-50E06649ADE8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Static|Win32 = Debug Static|Win32 @@ -300,6 +303,38 @@ Global {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|Win32.Build.0 = Release|Win32 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.ActiveCfg = Release|x64 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.Build.0 = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tests/test_gui_vc12.sln b/tests/test_gui_vc12.sln index d26619e31e..6afcc8f3d8 100644 --- a/tests/test_gui_vc12.sln +++ b/tests/test_gui_vc12.sln @@ -8,6 +8,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_gui", "test_gui.vcxpro {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} = {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} = {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} {7FB0902D-8579-5DCE-B883-DAF66A885005} = {7FB0902D-8579-5DCE-B883-DAF66A885005} + {A16D3832-0F42-57CE-8F48-50E06649ADE8} = {A16D3832-0F42-57CE-8F48-50E06649ADE8} {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} = {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} = {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} = {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} @@ -34,6 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "..\build\msw\wx_xrc. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webview", "..\build\msw\wx_webview.vcxproj", "{A8E8442A-078A-5FC5-B495-8D71BA77EE6E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aui", "..\build\msw\wx_aui.vcxproj", "{A16D3832-0F42-57CE-8F48-50E06649ADE8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Static|Win32 = Debug Static|Win32 @@ -302,6 +305,38 @@ Global {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|Win32.Build.0 = Release|Win32 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.ActiveCfg = Release|x64 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.Build.0 = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tests/test_gui_vc14.sln b/tests/test_gui_vc14.sln index 31d2535373..ff74fbcc99 100644 --- a/tests/test_gui_vc14.sln +++ b/tests/test_gui_vc14.sln @@ -8,6 +8,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_gui", "test_gui.vcxpro {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} = {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} = {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} {7FB0902D-8579-5DCE-B883-DAF66A885005} = {7FB0902D-8579-5DCE-B883-DAF66A885005} + {A16D3832-0F42-57CE-8F48-50E06649ADE8} = {A16D3832-0F42-57CE-8F48-50E06649ADE8} {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} = {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} = {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} = {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} @@ -34,6 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "..\build\msw\wx_xrc. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webview", "..\build\msw\wx_webview.vcxproj", "{A8E8442A-078A-5FC5-B495-8D71BA77EE6E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aui", "..\build\msw\wx_aui.vcxproj", "{A16D3832-0F42-57CE-8F48-50E06649ADE8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Static|Win32 = Debug Static|Win32 @@ -302,6 +305,38 @@ Global {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|Win32.Build.0 = Release|Win32 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.ActiveCfg = Release|x64 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.Build.0 = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tests/test_vc7_test_gui.vcproj b/tests/test_vc7_test_gui.vcproj index d02aa25b43..f52b5ad5c6 100644 --- a/tests/test_vc7_test_gui.vcproj +++ b/tests/test_vc7_test_gui.vcproj @@ -49,7 +49,7 @@ + + diff --git a/tests/test_vc8_test_gui.vcproj b/tests/test_vc8_test_gui.vcproj index f82a0b7ed7..2b7d9b7722 100644 --- a/tests/test_vc8_test_gui.vcproj +++ b/tests/test_vc8_test_gui.vcproj @@ -86,7 +86,7 @@ + + diff --git a/tests/test_vc9_test_gui.vcproj b/tests/test_vc9_test_gui.vcproj index 9c5b2a55b9..f698792488 100644 --- a/tests/test_vc9_test_gui.vcproj +++ b/tests/test_vc9_test_gui.vcproj @@ -85,7 +85,7 @@ + + From a6dc3c78ab652fd3f43fb20f7d913db45fc5f354 Mon Sep 17 00:00:00 2001 From: chris2oph Date: Thu, 20 Dec 2018 15:49:51 +0000 Subject: [PATCH 139/553] Really add items to the listbox in wxQt wxListBox::Create() The initial choices were just ignored, do add them to the Qt listbox now. Closes https://github.com/wxWidgets/wxWidgets/pull/1094 --- src/qt/listbox.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index be40ae320f..acae97e7d8 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -111,7 +111,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, bool wxListBox::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - const wxArrayString& WXUNUSED(choices), + const wxArrayString& choices, long style, const wxValidator& validator, const wxString& name) @@ -119,6 +119,13 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, Init(); m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this ); + QStringList items; + + for (size_t i = 0; i < choices.size(); ++i) + items.push_back(wxQtConvertString(choices[i])); + + m_qtListWidget->addItems(items); + return wxListBoxBase::Create( parent, id, pos, size, style, validator, name ); } From 2c737bfbc04dec2da6d14e5007e9fc8558ab22a2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 23 Dec 2018 17:12:26 +0100 Subject: [PATCH 140/553] Revert change to m_order assignment in wxRearrangeList::Create() This partially reverts 7e1b64a2eb6ef5b0ad3dc5b77c8102ff86315a75 as it broke wxRearrangeList because assigning to m_order[n] used an out-of-range index. Another possible fix would be to replace reserve() call added in that commit with resize(), but there doesn't seem to be any advantage in assigning elements one by one, rather than all at once, as it had been done before, so just revert this change instead. See #17836. --- src/common/rearrangectrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/rearrangectrl.cpp b/src/common/rearrangectrl.cpp index 75170d35dc..ef917518f1 100644 --- a/src/common/rearrangectrl.cpp +++ b/src/common/rearrangectrl.cpp @@ -70,7 +70,6 @@ bool wxRearrangeList::Create(wxWindow *parent, } // do create the real control - m_order.reserve(count); if ( !wxCheckListBox::Create(parent, id, pos, size, itemsInOrder, style, validator, name) ) return false; @@ -84,9 +83,10 @@ bool wxRearrangeList::Create(wxWindow *parent, // which would also update m_order itself. wxCheckListBox::Check(n); } - m_order[n] = order[n]; } + m_order = order; + return true; } From 270ad54abe7048d290031d6262a6d8c151e73375 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 23 Dec 2018 17:24:13 +0100 Subject: [PATCH 141/553] Revert all recent changes to wxTranslations The latest changes to wxTranslations::AddCatalog() behaviour were not backwards-compatible and also had other problem, so revert them for now, even if this means that #18227 has to be reopened. This is a combination of the following commits: ---- Revert "Fix regression in wxTranslations::AddCatalog()" This reverts commit 14e905858d0c30b03914457f9fb5c49173366cd1. See #18297. ---- Revert "Fix crash in translations code when no translations are found" This reverts commit 80904d1bc786ad2f6f8ab523391edfc82375820d. See #18299. ---- Revert "Rename new wxTranslations method to GetAcceptableTranslations()" This reverts commit 20b02d6169fed3ae68caa6a12aa1003a205672f2. ---- Revert "Load catalogs for all preferred languages, if they exist" This reverts commit 2d784da2ee12cc5a6d89b011827cff6361a12c23. ---- Revert "Allow getting all usable translations languages" This reverts commit 5d08e404c76c1745e070d9c96055b90ffddd7177. ---- See #18227, #18300. Closes #18302. --- docs/changes.txt | 8 +++- include/wx/translation.h | 6 --- interface/wx/translation.h | 43 +++--------------- src/common/translation.cpp | 90 ++++++++++---------------------------- 4 files changed, 36 insertions(+), 111 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 7d3e0eeb60..16cb9613f5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -108,9 +108,13 @@ Changes in behaviour which may result in build errors 3.1.3: (released 2019-??-??) ---------------------------- -All: +INCOMPATIBLE CHANGES SINCE 3.1.2: + +- New wxTranslations::GetAcceptableTranslations() method was problematic and + was removed, fixing various regressions in wxTranslations::AddCatalog() that + were introduced by it. Thanks to Tomasz Słodkowicz and Dummy for reporting + this and providing fixes for it. -- Fix regression in wxTranslations::AddCatalog() in 3.1.2 (Tomasz Słodkowicz). All (GUI): diff --git a/include/wx/translation.h b/include/wx/translation.h index 9b931a088a..3d5d5b0b83 100644 --- a/include/wx/translation.h +++ b/include/wx/translation.h @@ -145,12 +145,6 @@ public: wxString GetBestTranslation(const wxString& domain, const wxString& msgIdLanguage = "en"); - // find best and all other suitable translation languages for given domain - wxArrayString GetAcceptableTranslations(const wxString& domain, - wxLanguage msgIdLanguage); - wxArrayString GetAcceptableTranslations(const wxString& domain, - const wxString& msgIdLanguage = "en"); - // add standard wxWidgets catalog ("wxstd") bool AddStdCatalog(); diff --git a/interface/wx/translation.h b/interface/wx/translation.h index 23ca5128c7..eed6355d0b 100644 --- a/interface/wx/translation.h +++ b/interface/wx/translation.h @@ -137,34 +137,6 @@ public: const wxString& msgIdLanguage = "en"); /** - Returns the languages of all translations that can be used for the @a - domain. - - This is a more general version of GetBestTranslation(), which returns - the whole list of preferred UI languages for which a translation for - the @a domain was found instead of just the first, i.e. the most - preferred, element of this list. - - @param domain - The catalog domain to look for. - - @param msgIdLanguage - Specifies the language of "msgid" strings in source code (i.e. - arguments to GetString(), wxGetTranslation() and the _() macro). - - @return An array of language codes if any suitable matches were found, - empty array otherwise. - - @since 3.1.2 - */ - wxArrayString GetAcceptableTranslations(const wxString& domain, - wxLanguage msgIdLanguage); - - /// @overload - wxArrayString GetAcceptableTranslations(const wxString& domain, - const wxString& msgIdLanguage = "en"); - - /** Add standard wxWidgets catalogs ("wxstd" and possible port-specific catalogs). @@ -175,10 +147,9 @@ public: bool AddStdCatalog(); /** - Add a catalog for the preferred UI language. In case of multiple - preferences, add catalog for each language, if available. + Add a catalog for use with the current locale. - By default, the catalog is searched for in standard places (see + By default, it is searched for in standard places (see wxFileTranslationsLoader), but you may also prepend additional directories to the search path with wxFileTranslationsLoader::AddCatalogLookupPathPrefix(). @@ -202,9 +173,8 @@ public: code are used instead. @return - @true if catalog in the most preferred language was successfully loaded, - @false otherwise (which might mean that the catalog is not found or that - it isn't in the correct format). + @true if catalog was successfully loaded, @false otherwise (which might + mean that the catalog is not found or that it isn't in the correct format). */ bool AddCatalog(const wxString& domain, wxLanguage msgIdLanguage = wxLANGUAGE_ENGLISH_US); @@ -230,9 +200,8 @@ public: in case they use 8-bit characters (e.g. German or French strings). @return - @true if catalog in the most preferred language was successfully loaded, - @false otherwise (which might mean that the catalog is not found or that - it isn't in the correct format). + @true if catalog was successfully loaded, @false otherwise (which might + mean that the catalog is not found or that it isn't in the correct format). */ bool AddCatalog(const wxString& domain, wxLanguage msgIdLanguage, diff --git a/src/common/translation.cpp b/src/common/translation.cpp index 08c4bfd7ad..bf92ed2942 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -127,7 +127,7 @@ wxString GetPreferredUILanguageFallback(const wxArrayString& WXUNUSED(available) #ifdef __WINDOWS__ -wxString GetPreferredUILanguage(const wxArrayString& available, wxArrayString& allPreferred) +wxString GetPreferredUILanguage(const wxArrayString& available) { typedef BOOL (WINAPI *GetUserPreferredUILanguages_t)(DWORD, PULONG, PWSTR, PULONG); static GetUserPreferredUILanguages_t s_pfnGetUserPreferredUILanguages = NULL; @@ -172,20 +172,18 @@ wxString GetPreferredUILanguage(const wxArrayString& available, wxArrayString& a wxString lang(*j); lang.Replace("-", "_"); if ( available.Index(lang, /*bCase=*/false) != wxNOT_FOUND ) - allPreferred.Add(lang); + return lang; size_t pos = lang.find('_'); if ( pos != wxString::npos ) { lang = lang.substr(0, pos); if ( available.Index(lang, /*bCase=*/false) != wxNOT_FOUND ) - allPreferred.Add(lang); + return lang; } } } } } - if ( !allPreferred.empty() ) - return allPreferred[0]; return GetPreferredUILanguageFallback(available); } @@ -209,7 +207,7 @@ void LogTraceArray(const char *prefix, CFArrayRef arr) #endif // wxUSE_LOG_TRACE -wxString GetPreferredUILanguage(const wxArrayString& available, wxArrayString &allPreferred) +wxString GetPreferredUILanguage(const wxArrayString& available) { wxStringToStringHashMap availableNormalized; wxCFRef availableArr( @@ -233,19 +231,17 @@ wxString GetPreferredUILanguage(const wxArrayString& available, wxArrayString &a LogTraceArray(" - system preferred languages", prefArr); unsigned prefArrLength = CFArrayGetCount(prefArr); - for ( size_t x = 0; x < prefArrLength; ++x ) + if ( prefArrLength > 0 ) { // Lookup the name in 'available' by index -- we need to get the // original value corresponding to the normalized one chosen. - wxString lang(wxCFStringRef::AsString((CFStringRef)CFArrayGetValueAtIndex(prefArr, x))); + wxString lang(wxCFStringRef::AsString((CFStringRef)CFArrayGetValueAtIndex(prefArr, 0))); wxStringToStringHashMap::const_iterator i = availableNormalized.find(lang); if ( i == availableNormalized.end() ) - allPreferred.push_back(lang); + return lang; else - allPreferred.push_back(i->second); + return i->second; } - if ( allPreferred.empty() == false ) - return allPreferred[0]; return GetPreferredUILanguageFallback(available); } @@ -259,7 +255,7 @@ wxString GetPreferredUILanguage(const wxArrayString& available, wxArrayString &a // The LANGUAGE variable may contain a colon separated list of language // codes in the order of preference. // http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html -wxString GetPreferredUILanguage(const wxArrayString& available, wxArrayString &allPreferred) +wxString GetPreferredUILanguage(const wxArrayString& available) { wxString languageFromEnv; wxArrayString preferred; @@ -287,17 +283,15 @@ wxString GetPreferredUILanguage(const wxArrayString& available, wxArrayString &a { wxString lang(*j); if ( available.Index(lang) != wxNOT_FOUND ) - allPreferred.Add(lang); + return lang; size_t pos = lang.find('_'); if ( pos != wxString::npos ) { lang = lang.substr(0, pos); if ( available.Index(lang) != wxNOT_FOUND ) - allPreferred.Add(lang); + return lang; } } - if ( allPreferred.empty() == false ) - return allPreferred[0]; return GetPreferredUILanguageFallback(available); } @@ -1555,9 +1549,9 @@ bool wxTranslations::AddCatalog(const wxString& domain, wxLanguage msgIdLanguage) { const wxString msgIdLang = wxLocale::GetLanguageCanonicalName(msgIdLanguage); - const wxArrayString domain_langs = GetAcceptableTranslations(domain, msgIdLanguage); + const wxString domain_lang = GetBestTranslation(domain, msgIdLang); - if ( domain_langs.empty() ) + if ( domain_lang.empty() ) { wxLogTrace(TRACE_I18N, wxS("no suitable translation for domain '%s' found"), @@ -1565,30 +1559,11 @@ bool wxTranslations::AddCatalog(const wxString& domain, return false; } - bool success = false; - for ( wxArrayString::const_iterator lang = domain_langs.begin(); - lang != domain_langs.end(); - ++lang ) - { - wxLogTrace(TRACE_I18N, - wxS("adding '%s' translation for domain '%s' (msgid language '%s')"), - *lang, domain, msgIdLang); + wxLogTrace(TRACE_I18N, + wxS("adding '%s' translation for domain '%s' (msgid language '%s')"), + domain_lang, domain, msgIdLang); - // We determine success by the success of loading/failing to load - // the most preferred (i.e. the first one) language's catalog: - if ( lang == domain_langs.begin() ) - success = LoadCatalog(domain, *lang, msgIdLang); - else - LoadCatalog(domain, *lang, msgIdLang); - - // No use loading languages that are less preferred than the - // msgid language, as by definition it contains all the strings - // in the msgid language. - if ( msgIdLang == *lang ) - break; - } - - return success; + return LoadCatalog(domain, domain_lang, msgIdLang); } @@ -1675,37 +1650,20 @@ wxString wxTranslations::GetBestTranslation(const wxString& domain, wxString wxTranslations::GetBestTranslation(const wxString& domain, const wxString& msgIdLanguage) { - const wxArrayString allGoodOnes = GetAcceptableTranslations(domain, msgIdLanguage); - wxString best(allGoodOnes.empty() ? wxString() : allGoodOnes[0]); - wxLogTrace(TRACE_I18N, " => using language '%s'", best); - return best; -} + // explicitly set language should always be respected + if ( !m_lang.empty() ) + return m_lang; -wxArrayString wxTranslations::GetAcceptableTranslations(const wxString& domain, - wxLanguage msgIdLanguage) -{ - const wxString lang = wxLocale::GetLanguageCanonicalName(msgIdLanguage); - return GetAcceptableTranslations(domain, lang); -} - -wxArrayString wxTranslations::GetAcceptableTranslations(const wxString& domain, - const wxString& msgIdLanguage) -{ wxArrayString available(GetAvailableTranslations(domain)); // it's OK to have duplicates, so just add msgid language available.push_back(msgIdLanguage); available.push_back(msgIdLanguage.BeforeFirst('_')); - wxLogTrace(TRACE_I18N, "choosing best languages for domain '%s'", domain); + wxLogTrace(TRACE_I18N, "choosing best language for domain '%s'", domain); LogTraceArray(" - available translations", available); - wxArrayString allPreferred; - GetPreferredUILanguage(available, allPreferred); - - // explicitly set language should always be preferred the most - if ( !m_lang.empty() ) - allPreferred.insert(allPreferred.begin(), m_lang); - - return allPreferred; + const wxString lang = GetPreferredUILanguage(available); + wxLogTrace(TRACE_I18N, " => using language '%s'", lang); + return lang; } From b891fe19743c1437d1b17565b901c2aa608c83c2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 23 Dec 2018 22:01:50 +0100 Subject: [PATCH 142/553] Remove misleading warning from the ipc sample DDE code translates wxIPC_PRIVATE to wxIPC_TEXT internally since a change done in 9d86099269660fb9eab4d146e625cb2a5fff9c14, but same commit also added a warning to the ipc sample stating that wxIPC_PRIVATE doesn't work, which isn't really the case. Remove the warning to avoid the confusion. See #7470. --- samples/ipc/server.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 54d2763898..25a4420cc1 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -273,12 +273,6 @@ void MyServer::Advise() const wxString s = now.FormatTime() + " " + now.FormatDate(); m_connection->Advise(m_connection->m_advise, s.mb_str(), wxNO_LEN); -#if wxUSE_DDE_FOR_IPC - wxLogMessage("DDE Advise type argument cannot be wxIPC_PRIVATE. " - "The client will receive it as wxIPC_TEXT, " - " and receive the correct no of bytes, " - "but not print a correct log entry."); -#endif char bytes[3] = { '1', '2', '3' }; m_connection->Advise(m_connection->m_advise, bytes, 3, wxIPC_PRIVATE); } From 79b71cf4ff7ae4121c92a50b6c1dc4da9d7d063d Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 23 Dec 2018 22:13:43 +0100 Subject: [PATCH 143/553] Scale bitmap to wxPropertyGrid's row height By design only bitmaps lower than row height are displayed within the cells. Because on every platform default row height can vary so bitmap has to be explicitly scaled to the row height to ensure that it will be initially displayed on every platform. Closes #18310. --- samples/propgrid/propgrid.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index d323873cf1..49ff46bbb0 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -1157,7 +1157,8 @@ void FormMain::PopulateWithStandardItems () // Set test information for cells in columns 3 and 4 // (reserve column 2 for displaying units) wxPropertyGridIterator it; - wxBitmap bmp = wxArtProvider::GetBitmap(wxART_FOLDER); + int bmpH = pg->GetGrid()->GetRowHeight() - 2; + wxBitmap bmp = wxArtProvider::GetBitmap(wxART_FOLDER, wxART_OTHER, wxSize(bmpH, bmpH)); for ( it = pg->GetGrid()->GetIterator(); !it.AtEnd(); From 1e69a898c2445714ad0f9276ff08e203a8213700 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 23 Dec 2018 22:21:38 +0100 Subject: [PATCH 144/553] Use quotes and not angle brackets around the includes of wxWidgets itself --- include/wx/propgrid/props.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 1ebfb91699..9649178710 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -796,8 +796,8 @@ wxValidator* PROPNAME::DoGetValidator () const \ #if wxUSE_EDITABLELISTBOX +#include "wx/bmpbuttn.h" #include "wx/editlbox.h" -#include #define wxAEDIALOG_STYLE \ (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE) From 3b6fcbab6d32c953e2a8e4fc97bfb72f79380f79 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 23 Dec 2018 23:05:12 +0100 Subject: [PATCH 145/553] Update wxPGArrayEditorDialog docs --- interface/wx/propgrid/props.h | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/wx/propgrid/props.h b/interface/wx/propgrid/props.h index 3526433954..ad4c7bc009 100644 --- a/interface/wx/propgrid/props.h +++ b/interface/wx/propgrid/props.h @@ -728,6 +728,7 @@ public: void EnableCustomNewAction(); /** Sets tooltip text for button allowing the user to enter new string. + @since 3.1.3 */ void SetNewButtonText(const wxString& text); From c657fd3d61828e0507c9dae5522f6c007e87628c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 24 Dec 2018 01:42:12 +0100 Subject: [PATCH 146/553] Fix passing Unicode strings via wxIPC when using DDE wxIPC API doesn't map well onto DDE, as we don't have wxIPCFormat parameter in StartAdvise() but do allow specifying the format when calling Advise() itself, whereas DDE requires specifying the format when establishing the advise loop and the data always must use this format later. Because of this, we have to pass the actual format with the data itself instead of relying on DDE formats support. This has the advantage of allowing wxIPC_UTF8TEXT to work, while previously it didn't and couldn't, as DDE only supports the standard (or custom, but registered) clipboard formats and it wasn't one of them. Of course, this also has a disadvantage of having to make another copy of the data, but this seems unavoidable. This change allow Advise() overload taking wxString to work, including for non-ASCII strings, as shown by the update to the IPC sample. It also makes wxDDEConnection::m_dataType unnecessary, as we must always use the format passed to DDE callback anyhow when handling XTYP_ADVREQ. Closes #17900. --- docs/changes.txt | 4 ++++ include/wx/msw/dde.h | 1 - samples/ipc/server.cpp | 6 +++++- src/msw/dde.cpp | 32 ++++++++++++++++++++++---------- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 16cb9613f5..404da6917a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -124,6 +124,10 @@ All (GUI): - Allow changing tooltip text for button allowing to enter a new string in wxPGArrayEditorDialog. +wxMSW: + +- Fix passing Unicode strings via wxIPC when using DDE. + 3.1.2: (released 2018-12-10) ---------------------------- diff --git a/include/wx/msw/dde.h b/include/wx/msw/dde.h index 91fdd06f96..a7cd04ccda 100644 --- a/include/wx/msw/dde.h +++ b/include/wx/msw/dde.h @@ -70,7 +70,6 @@ public: WXHCONV m_hConv; const void* m_sendingData; int m_dataSize; - wxIPCFormat m_dataType; wxDECLARE_NO_COPY_CLASS(wxDDEConnection); wxDECLARE_DYNAMIC_CLASS(wxDDEConnection); diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 25a4420cc1..8058eb983a 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -268,7 +268,11 @@ void MyServer::Advise() { const wxDateTime now = wxDateTime::Now(); - m_connection->Advise(m_connection->m_advise, now.Format()); + m_connection->Advise + ( + m_connection->m_advise, + wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82") + ); const wxString s = now.FormatTime() + " " + now.FormatDate(); m_connection->Advise(m_connection->m_advise, s.mb_str(), wxNO_LEN); diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index ccea317306..11199fad2f 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -748,12 +748,20 @@ bool wxDDEConnection::DoAdvise(const wxString& item, size_t size, wxIPCFormat format) { + // Unfortunately we currently always use the same CF_TEXT in StartAdvise() + // but allow calling Advise() with different formats. This doesn't map well + // to the DDE API, so the price to pay for it is that we need to send the + // actual format used as part of the data, even if this means making + // another copy of it. + wxCharBuffer buf; + buf.extend(size + 1); + *buf.data() = format; + memcpy(buf.data() + 1, data, size); + HSZ item_atom = DDEGetAtom(item); HSZ topic_atom = DDEGetAtom(m_topicName); - m_sendingData = data; // mrf: potential for scope problems here? - m_dataSize = size; - // wxIPC_PRIVATE does not succeed, so use text instead - m_dataType = format == wxIPC_PRIVATE ? wxIPC_TEXT : format; + m_sendingData = buf.data(); + m_dataSize = size + 1; bool ok = DdePostAdvise(DDEIdInst, topic_atom, item_atom) != 0; if ( !ok ) @@ -986,11 +994,12 @@ _DDECallback(UINT wType, connection->m_dataSize, 0, hsz2, - connection->m_dataType, + wFmt, 0 ); connection->m_sendingData = NULL; + connection->m_dataSize = 0; return (DDERETURN)data; } @@ -1008,18 +1017,21 @@ _DDECallback(UINT wType, DWORD len = DdeGetData(hData, NULL, 0, 0); - void *data = connection->GetBufferAtLeast(len); + BYTE* const data = static_cast(connection->GetBufferAtLeast(len)); wxASSERT_MSG(data != NULL, wxT("Buffer too small in _DDECallback (XTYP_ADVDATA)") ); - DdeGetData(hData, (LPBYTE)data, len, 0); + DdeGetData(hData, data, len, 0); DdeFreeDataHandle(hData); + + // Our code in DoAdvise() prepends the actual format of the + // data as the first byte, extract it back now. if ( connection->OnAdvise(connection->m_topicName, item_name, - data, - (int)len, - (wxIPCFormat) wFmt) ) + data + 1, + (int)len - 1, + (wxIPCFormat)*data) ) { return (DDERETURN)(DWORD)DDE_FACK; } From 0fbf87d11b315d66e6b21c7aba9621baa0da5bb4 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 29 Nov 2018 13:13:10 +0000 Subject: [PATCH 147/553] Split single/multi line behaviour in Qt wxTextCtrl Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit derived classes instead of using ifs in many wxTextCtrl methods, making the code more clear and maintainable. Also fix some wxTextCtrl-related unit test failures with wxQt and disable some other ones which still don't pass. Closes https://github.com/wxWidgets/wxWidgets/pull/1039 --- include/wx/qt/textctrl.h | 8 +- src/qt/textctrl.cpp | 604 ++++++++++++++++++++++--------- src/qt/textentry.cpp | 7 +- tests/controls/textctrltest.cpp | 14 +- tests/controls/textentrytest.cpp | 8 + 5 files changed, 468 insertions(+), 173 deletions(-) diff --git a/include/wx/qt/textctrl.h b/include/wx/qt/textctrl.h index fda210583c..68863a9a04 100644 --- a/include/wx/qt/textctrl.h +++ b/include/wx/qt/textctrl.h @@ -8,9 +8,8 @@ #ifndef _WX_QT_TEXTCTRL_H_ #define _WX_QT_TEXTCTRL_H_ -class QLineEdit; -class QTextEdit; class QScrollArea; +class wxQtEdit; class WXDLLIMPEXP_CORE wxTextCtrl : public wxTextCtrlBase { @@ -25,6 +24,8 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString &name = wxTextCtrlNameStr); + virtual ~wxTextCtrl(); + bool Create(wxWindow *parent, wxWindowID id, const wxString &value = wxEmptyString, @@ -71,8 +72,7 @@ protected: virtual QScrollArea *QtGetScrollBarsContainer() const; private: - QLineEdit *m_qtLineEdit; - QTextEdit *m_qtTextEdit; + wxQtEdit *m_qtEdit; wxDECLARE_DYNAMIC_CLASS( wxTextCtrl ); }; diff --git a/src/qt/textctrl.cpp b/src/qt/textctrl.cpp index 5ef1bd97ff..49bee5e175 100644 --- a/src/qt/textctrl.cpp +++ b/src/qt/textctrl.cpp @@ -17,16 +17,396 @@ #include #include +/* + * Abstract base class for wxQtSingleLineEdit and wxQtMultiLineEdit. + * This splits the polymorphic behaviour into two separate classes, avoiding + * unnecessary branches. + */ +class wxQtEdit +{ +public: + virtual ~wxQtEdit() {} + + virtual bool IsModified() const = 0; + virtual int GetNumberOfLines() const = 0; + virtual wxString DoGetValue() const = 0; + virtual long GetInsertionPoint() const = 0; + virtual QWidget *GetHandle() const = 0; + virtual int GetLineLength(long lineNo) const = 0; + virtual wxString GetLineText(long lineNo) const = 0; + virtual bool GetSelection(long *from, long *to) const = 0; + virtual long XYToPosition(long x, long y) const = 0; + virtual bool PositionToXY(long pos, long *x, long *y) const = 0; + virtual QScrollArea *ScrollBarsContainer() const = 0; + virtual void WriteText( const wxString &text ) = 0; + virtual void MarkDirty() = 0; + virtual void DiscardEdits() = 0; + virtual void blockSignals(bool block) = 0; + virtual void SetValue( const wxString &value ) = 0; + virtual void SetSelection( long from, long to ) = 0; + virtual void SetInsertionPoint(long pos) = 0; +}; + +namespace +{ + +struct wxQtLineInfo +{ + wxQtLineInfo(size_t start, size_t end) : + startPos(start), + endPos(end) + { + } + + size_t startPos, endPos; +}; + class wxQtLineEdit : public wxQtEventSignalHandler< QLineEdit, wxTextCtrl > { public: wxQtLineEdit( wxWindow *parent, wxTextCtrl *handler ); private: - void textChanged(const QString &text); + void textChanged(); void returnPressed(); }; +class wxQtTextEdit : public wxQtEventSignalHandler< QTextEdit, wxTextCtrl > +{ +public: + wxQtTextEdit( wxWindow *parent, wxTextCtrl *handler ); + +private: + void textChanged(); +}; + +class wxQtMultiLineEdit : public wxQtEdit +{ +public: + explicit wxQtMultiLineEdit(QTextEdit *edit) : m_edit(edit) + { + } + + virtual bool IsModified() const wxOVERRIDE + { + return m_edit->isWindowModified(); + } + + virtual wxString DoGetValue() const wxOVERRIDE + { + return wxQtConvertString( m_edit->toPlainText() ); + } + + virtual long GetInsertionPoint() const wxOVERRIDE + { + QTextCursor cursor = m_edit->textCursor(); + return cursor.anchor(); + } + + virtual QWidget *GetHandle() const wxOVERRIDE + { + return m_edit; + } + + virtual int GetNumberOfLines() const wxOVERRIDE + { + const wxString &value = DoGetValue(); + return std::count(value.begin(), value.end(), '\n') + 1; + } + + virtual int GetLineLength(long lineNo) const wxOVERRIDE + { + wxQtLineInfo start = GetLineInfo(lineNo, DoGetValue()); + if ( start.startPos == wxString::npos ) + return -1; + + return start.endPos - start.startPos; + } + + virtual wxString GetLineText(long lineNo) const wxOVERRIDE + { + const wxString &value = DoGetValue(); + + wxQtLineInfo start = GetLineInfo(lineNo, value); + if ( start.startPos == wxString::npos ) + return wxString(); + + return value.Mid(start.startPos, start.endPos - start.startPos); + } + + virtual long XYToPosition(long x, long y) const wxOVERRIDE + { + if ( x < 0 || y < 0 ) + return -1; + + wxQtLineInfo start = GetLineInfo(y, DoGetValue()); + if ( start.startPos == wxString::npos ) + return -1; + + if ( start.endPos - start.startPos < static_cast(x) ) + return -1; + + return start.startPos + x; + } + + virtual bool PositionToXY(long pos, long *x, long *y) const wxOVERRIDE + { + const wxString &value = DoGetValue(); + + if ( static_cast(pos) > value.length() ) + return false; + + int cnt = 0; + int xval = 0; + + for ( long xx = 0; xx < pos; xx++ ) + { + if ( value[xx] == '\n' ) + { + xval = 0; + cnt++; + } + else xval++; + } + *y = cnt; + *x = xval; + + return true; + } + virtual void WriteText( const wxString &text ) wxOVERRIDE + { + m_edit->insertPlainText(wxQtConvertString( text )); + // the cursor is moved to the end, ensure it is shown + m_edit->ensureCursorVisible(); + } + + virtual void MarkDirty() wxOVERRIDE + { + return m_edit->setWindowModified( true ); + } + + virtual void DiscardEdits() wxOVERRIDE + { + return m_edit->setWindowModified( false ); + } + + virtual void blockSignals(bool block) wxOVERRIDE + { + m_edit->blockSignals(block); + } + + virtual void SetValue( const wxString &value ) wxOVERRIDE + { + m_edit->setPlainText(wxQtConvertString( value )); + // the cursor is moved to the end, ensure it is shown + m_edit->ensureCursorVisible(); + } + + virtual void SetSelection( long from, long to ) wxOVERRIDE + { + QTextCursor cursor = m_edit->textCursor(); + cursor.setPosition(from); + + cursor.setPosition(to, QTextCursor::KeepAnchor); + m_edit->setTextCursor(cursor); + } + + virtual bool GetSelection( long *from, long *to ) const wxOVERRIDE + { + QTextCursor cursor = m_edit->textCursor(); + *from = cursor.selectionStart(); + *to = cursor.selectionEnd(); + return cursor.hasSelection(); + } + + virtual void SetInsertionPoint(long pos) wxOVERRIDE + { + QTextCursor::MoveOperation op; + + // check if pos indicates end of text: + if ( pos == -1 ) + { + pos = 0; + op = QTextCursor::End; + } + else + { + op = QTextCursor::Start; + } + + QTextCursor cursor = m_edit->textCursor(); + cursor.movePosition(op, QTextCursor::MoveAnchor, pos); + + if (op != QTextCursor::End ) + cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, pos); + m_edit->setTextCursor(cursor); + m_edit->ensureCursorVisible(); + } + + QScrollArea *ScrollBarsContainer() const wxOVERRIDE + { + return (QScrollArea *) m_edit; + } + +private: + wxQtLineInfo GetLineInfo(long lineNo, const wxString &value) const + { + size_t pos = 0; + long cnt = 0; + + while ( cnt < lineNo ) + { + size_t tpos = value.find('\n', pos); + if ( tpos == wxString::npos ) + return wxQtLineInfo(tpos, tpos); + + pos = tpos + 1; + cnt++; + } + + size_t end = value.find('\n', pos); + if ( end == wxString::npos ) + end = value.length(); + + return wxQtLineInfo(pos, end); + } + + QTextEdit* const m_edit; + + wxDECLARE_NO_COPY_CLASS(wxQtMultiLineEdit); +}; + +class wxQtSingleLineEdit : public wxQtEdit +{ +public: + explicit wxQtSingleLineEdit(QLineEdit *edit) : + m_edit(edit) + { + } + + virtual bool IsModified() const wxOVERRIDE + { + return m_edit->isModified(); + } + + virtual int GetNumberOfLines() const wxOVERRIDE + { + return 1; + } + + virtual wxString DoGetValue() const wxOVERRIDE + { + return wxQtConvertString( m_edit->text() ); + } + + virtual long GetInsertionPoint() const wxOVERRIDE + { + long selectionStart = m_edit->selectionStart(); + + if ( selectionStart >= 0 ) + return selectionStart; + + return m_edit->cursorPosition(); + } + + virtual QWidget *GetHandle() const wxOVERRIDE + { + return m_edit; + } + + virtual int GetLineLength(long WXUNUSED(lineNo)) const wxOVERRIDE + { + return DoGetValue().length(); + } + + virtual wxString GetLineText(long lineNo) const wxOVERRIDE + { + return lineNo == 0 ? DoGetValue() : wxString(); + } + + virtual void WriteText( const wxString &text ) wxOVERRIDE + { + m_edit->insert(wxQtConvertString( text )); + } + + virtual void MarkDirty() wxOVERRIDE + { + return m_edit->setModified( true ); + } + + virtual void DiscardEdits() wxOVERRIDE + { + return m_edit->setModified( false ); + } + + virtual void blockSignals(bool block) wxOVERRIDE + { + m_edit->blockSignals(block); + } + + virtual void SetValue( const wxString &value ) wxOVERRIDE + { + m_edit->setText(wxQtConvertString( value )); + } + + virtual void SetSelection( long from, long to ) wxOVERRIDE + { + m_edit->setSelection(from, to - from); + } + + virtual bool GetSelection( long *from, long *to ) const wxOVERRIDE + { + *from = m_edit->selectionStart(); + if ( *from < 0 ) + return false; + + *to = *from + m_edit->selectedText().length(); + return true; + } + + virtual void SetInsertionPoint(long pos) wxOVERRIDE + { + // check if pos indicates end of text: + if ( pos == -1 ) + m_edit->end(false); + else + m_edit->setCursorPosition(pos); + } + + virtual long XYToPosition(long x, long y) const wxOVERRIDE + { + if ( y == 0 && x >= 0 ) + { + if ( static_cast(x) <= DoGetValue().length() ) + return x; + } + + return -1; + } + + virtual bool PositionToXY(long pos, long *x, long *y) const wxOVERRIDE + { + const wxString &value = DoGetValue(); + + if ( static_cast(pos) > value.length() ) + return false; + + *y = 0; + *x = pos; + return true; + } + + virtual QScrollArea *ScrollBarsContainer() const wxOVERRIDE + { + return NULL; + } + +private: + QLineEdit *m_edit; + + wxDECLARE_NO_COPY_CLASS(wxQtSingleLineEdit); +}; + wxQtLineEdit::wxQtLineEdit( wxWindow *parent, wxTextCtrl *handler ) : wxQtEventSignalHandler< QLineEdit, wxTextCtrl >( parent, handler ) { @@ -36,14 +416,12 @@ wxQtLineEdit::wxQtLineEdit( wxWindow *parent, wxTextCtrl *handler ) this, &wxQtLineEdit::returnPressed); } -void wxQtLineEdit::textChanged(const QString &text) +void wxQtLineEdit::textChanged() { - wxTextCtrl *handler = GetHandler(); + wxTextEntryBase *handler = GetHandler(); if ( handler ) { - wxCommandEvent event( wxEVT_TEXT, handler->GetId() ); - event.SetString( wxQtConvertString( text ) ); - EmitEvent( event ); + handler->SendTextUpdatedEventIfAllowed(); } } @@ -61,16 +439,6 @@ void wxQtLineEdit::returnPressed() } } - -class wxQtTextEdit : public wxQtEventSignalHandler< QTextEdit, wxTextCtrl > -{ -public: - wxQtTextEdit( wxWindow *parent, wxTextCtrl *handler ); - -private: - void textChanged(); -}; - wxQtTextEdit::wxQtTextEdit( wxWindow *parent, wxTextCtrl *handler ) : wxQtEventSignalHandler< QTextEdit, wxTextCtrl >( parent, handler ) { @@ -80,17 +448,18 @@ wxQtTextEdit::wxQtTextEdit( wxWindow *parent, wxTextCtrl *handler ) void wxQtTextEdit::textChanged() { - wxTextCtrl *handler = GetHandler(); + wxTextEntryBase *handler = GetHandler(); if ( handler ) { - wxCommandEvent event( wxEVT_TEXT, handler->GetId() ); - event.SetString( handler->GetValue() ); - EmitEvent( event ); + handler->SendTextUpdatedEventIfAllowed(); } } +} // anonymous namespace -wxTextCtrl::wxTextCtrl() + +wxTextCtrl::wxTextCtrl() : + m_qtEdit(NULL) { } @@ -115,20 +484,19 @@ bool wxTextCtrl::Create(wxWindow *parent, const wxValidator& validator, const wxString &name) { - bool multiline = (style & wxTE_MULTILINE) != 0; - - if (!multiline) + if ( style & wxTE_MULTILINE ) { - m_qtLineEdit = new wxQtLineEdit( parent, this ); - m_qtTextEdit = NULL; - if ( style & wxTE_PASSWORD ) - m_qtLineEdit->setEchoMode( QLineEdit::Password ); + m_qtEdit = new wxQtMultiLineEdit(new wxQtTextEdit(parent, this)); } else { - m_qtTextEdit = new wxQtTextEdit( parent, this ); - m_qtLineEdit = NULL; + wxQtLineEdit *lineEdit = new wxQtLineEdit(parent, this); + if ( style & wxTE_PASSWORD ) + lineEdit->setEchoMode( QLineEdit::Password ); + + m_qtEdit = new wxQtSingleLineEdit(lineEdit); } + if ( QtCreateControl( parent, id, pos, size, style, validator, name ) ) { // set the initial text value without sending the event: @@ -141,48 +509,44 @@ bool wxTextCtrl::Create(wxWindow *parent, return false; } +wxTextCtrl::~wxTextCtrl() +{ + delete m_qtEdit; +} + wxSize wxTextCtrl::DoGetBestSize() const { return wxTextCtrlBase::DoGetBestSize(); - -} -int wxTextCtrl::GetLineLength(long WXUNUSED(lineNo)) const -{ - return 0; } -wxString wxTextCtrl::GetLineText(long WXUNUSED(lineNo)) const +int wxTextCtrl::GetLineLength(long lineNo) const { - return wxString(); + return m_qtEdit->GetLineLength(lineNo); +} + +wxString wxTextCtrl::GetLineText(long lineNo) const +{ + return m_qtEdit->GetLineText(lineNo); } int wxTextCtrl::GetNumberOfLines() const { - return 0; + return m_qtEdit->GetNumberOfLines(); } bool wxTextCtrl::IsModified() const { - if ( IsSingleLine() ) - return m_qtLineEdit->isModified(); - else - return m_qtTextEdit->isWindowModified(); + return m_qtEdit->IsModified(); } void wxTextCtrl::MarkDirty() { - if ( IsSingleLine() ) - return m_qtLineEdit->setModified( true ); - else - return m_qtTextEdit->setWindowModified( true ); + m_qtEdit->MarkDirty(); } void wxTextCtrl::DiscardEdits() { - if ( IsSingleLine() ) - return m_qtLineEdit->setModified( false ); - else - return m_qtTextEdit->setWindowModified( false ); + m_qtEdit->DiscardEdits(); } bool wxTextCtrl::SetStyle(long WXUNUSED(start), long WXUNUSED(end), const wxTextAttr& WXUNUSED(style)) @@ -200,14 +564,17 @@ bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& WXUNUSED(style)) return false; } -long wxTextCtrl::XYToPosition(long WXUNUSED(x), long WXUNUSED(y)) const +long wxTextCtrl::XYToPosition(long x, long y) const { - return 0; + return m_qtEdit->XYToPosition(x, y); } -bool wxTextCtrl::PositionToXY(long WXUNUSED(pos), long *WXUNUSED(x), long *WXUNUSED(y)) const +bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const { - return false; + if ( x == NULL || y == NULL || pos < 0 ) + return false; + + return m_qtEdit->PositionToXY(pos, x, y); } void wxTextCtrl::ShowPosition(long WXUNUSED(pos)) @@ -226,98 +593,35 @@ bool wxTextCtrl::DoSaveFile(const wxString& WXUNUSED(file), int WXUNUSED(fileTyp void wxTextCtrl::SetInsertionPoint(long pos) { - QTextCursor::MoveOperation op; - QTextCursor cursor; - - // check if pos indicates end of text: - if ( pos == -1 ) - { - pos = 0; - op = QTextCursor::End; - } - else - { - op = QTextCursor::Start; - } - if ( !IsMultiLine() ) - { - if (op == QTextCursor::End) - m_qtLineEdit->end(false); - else - m_qtLineEdit->setCursorPosition(pos); - } - else - { - cursor = m_qtTextEdit->textCursor(); - cursor.movePosition(op, QTextCursor::MoveAnchor, pos); - m_qtTextEdit->setTextCursor(cursor); - m_qtTextEdit->ensureCursorVisible(); - } + m_qtEdit->SetInsertionPoint(pos); } long wxTextCtrl::GetInsertionPoint() const { - QTextCursor cursor; - - if ( !IsMultiLine() ) - { - return m_qtLineEdit->cursorPosition(); - } - else - { - cursor = m_qtTextEdit->textCursor(); - return cursor.position(); - } + return m_qtEdit->GetInsertionPoint(); } wxString wxTextCtrl::DoGetValue() const { - if ( IsMultiLine() ) - return wxQtConvertString( m_qtTextEdit->toPlainText() ); - else - return wxQtConvertString( m_qtLineEdit->text() ); + return m_qtEdit->DoGetValue(); } void wxTextCtrl::SetSelection( long from, long to ) { // SelectAll uses -1 to -1, adjust for qt: - if (from == -1 && to == -1) - { - from = 0; + if ( to == -1 ) to = GetValue().length(); - } - if ( IsMultiLine() ) - { - QTextCursor cursor = m_qtTextEdit->textCursor(); - cursor.setPosition(from); - cursor.setPosition(to, QTextCursor::KeepAnchor); - m_qtTextEdit->setTextCursor(cursor); - } - else // single line - { - m_qtLineEdit->setSelection(from, to); - } + + if ( from == -1 ) + from = 0; + + m_qtEdit->SetSelection( from, to ); } void wxTextCtrl::GetSelection(long* from, long* to) const { - if ( IsMultiLine() ) - { - QTextCursor cursor = m_qtTextEdit->textCursor(); - *from = cursor.selectionStart(); - *to = cursor.selectionEnd(); - if ( cursor.hasSelection() ) - return; - } - else // single line - { - *from = m_qtLineEdit->selectionStart(); - if ( *from >= 0 ) - { - *to = *from + m_qtLineEdit->selectedText().length(); - return; - } - } + if ( m_qtEdit->GetSelection(from, to) ) + return; // No selection, call base for default behaviour: wxTextEntry::GetSelection(from, to); } @@ -325,16 +629,7 @@ void wxTextCtrl::GetSelection(long* from, long* to) const void wxTextCtrl::WriteText( const wxString &text ) { // Insert the text - if ( !IsMultiLine() ) - { - m_qtLineEdit->insert(wxQtConvertString( text )); - } - else - { - m_qtTextEdit->insertPlainText(wxQtConvertString( text )); - // the cursor is moved to the end, ensure it is shown - m_qtTextEdit->ensureCursorVisible(); - } + m_qtEdit->WriteText(text); } void wxTextCtrl::DoSetValue( const wxString &text, int flags ) @@ -342,46 +637,25 @@ void wxTextCtrl::DoSetValue( const wxString &text, int flags ) // do not fire qt signals for certain methods (i.e. ChangeText) if ( !(flags & SetValue_SendEvent) ) { - if ( !IsMultiLine() ) - m_qtLineEdit->blockSignals(true); - else - m_qtTextEdit->blockSignals(true); + m_qtEdit->blockSignals(true); } - // Replace the text int the control - if ( !IsMultiLine() ) - { - m_qtLineEdit->setText(wxQtConvertString( text )); - } - else - { - m_qtTextEdit->setPlainText(wxQtConvertString( text )); - // the cursor is moved to the end, ensure it is shown - m_qtTextEdit->ensureCursorVisible(); - } + m_qtEdit->SetValue( text ); // re-enable qt signals if ( !(flags & SetValue_SendEvent) ) { - if ( !IsMultiLine() ) - m_qtLineEdit->blockSignals(false); - else - m_qtTextEdit->blockSignals(false); + m_qtEdit->blockSignals(false); } + SetInsertionPoint(0); } QWidget *wxTextCtrl::GetHandle() const { - if (m_qtLineEdit!=NULL) - return (QWidget *) m_qtLineEdit; - else - return (QWidget *) m_qtTextEdit; + return (QWidget *) m_qtEdit->GetHandle(); } QScrollArea *wxTextCtrl::QtGetScrollBarsContainer() const { - if (m_qtTextEdit!=NULL) - return (QScrollArea *) m_qtTextEdit; - else - return NULL; + return m_qtEdit->ScrollBarsContainer(); } diff --git a/src/qt/textentry.cpp b/src/qt/textentry.cpp index 3ea01f520c..f1c088165a 100644 --- a/src/qt/textentry.cpp +++ b/src/qt/textentry.cpp @@ -18,8 +18,11 @@ void wxTextEntry::WriteText(const wxString& WXUNUSED(text)) { } -void wxTextEntry::Remove(long WXUNUSED(from), long WXUNUSED(to)) +void wxTextEntry::Remove(long from, long to) { + wxString string = GetValue(); + string.erase(from, to - from); + SetValue(string); } void wxTextEntry::Copy() @@ -63,7 +66,7 @@ long wxTextEntry::GetInsertionPoint() const long wxTextEntry::GetLastPosition() const { - return 0; + return GetValue().length(); } void wxTextEntry::SetSelection(long WXUNUSED(from), long WXUNUSED(to)) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 7d594ca77a..10b2795f37 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -332,6 +332,9 @@ void TextCtrlTestCase::Redirector() void TextCtrlTestCase::HitTestSingleLine() { +#ifdef __WXQT__ + WARN("Does not work under WxQt"); +#else m_text->ChangeValue("Hit me"); // We don't know the size of the text borders, so we can't really do any @@ -373,6 +376,7 @@ void TextCtrlTestCase::HitTestSingleLine() REQUIRE( m_text->HitTest(wxPoint(2*sizeChar.x, yMid), &pos) == wxTE_HT_ON_TEXT ); CHECK( pos > 3 ); } +#endif } #if 0 @@ -433,7 +437,7 @@ void TextCtrlTestCase::Url() void TextCtrlTestCase::Style() { -#ifndef __WXOSX__ +#if !defined(__WXOSX__) && !defined(__WXQT__) delete m_text; // We need wxTE_RICH under windows for style support CreateText(wxTE_MULTILINE|wxTE_RICH); @@ -485,11 +489,14 @@ void TextCtrlTestCase::Style() REQUIRE( m_text->GetStyle(17, style) ); CHECK( style.GetTextColour() == *wxRED ); CHECK( style.GetBackgroundColour() == *wxWHITE ); +#else + WARN("Does not work under WxQt or OSX"); #endif } void TextCtrlTestCase::FontStyle() { +#if !defined(__WXQT__) // We need wxTE_RICH under MSW and wxTE_MULTILINE under GTK for style // support so recreate the control with these styles. delete m_text; @@ -540,6 +547,9 @@ void TextCtrlTestCase::FontStyle() fontOut.SetEncoding(fontIn.GetEncoding()); #endif CPPUNIT_ASSERT_EQUAL( fontIn, fontOut ); +#else + WARN("Does not work under WxQt"); +#endif } void TextCtrlTestCase::Lines() @@ -566,7 +576,7 @@ void TextCtrlTestCase::Lines() // #12366, where GetNumberOfLines() always returns the number of logical, // not physical, lines. m_text->AppendText("\n" + wxString(50, '1') + ' ' + wxString(50, '2')); -#if defined(__WXGTK__) || defined(__WXOSX_COCOA__) || defined(__WXUNIVERSAL__) +#if defined(__WXGTK__) || defined(__WXOSX_COCOA__) || defined(__WXUNIVERSAL__) || defined(__WXQT__) CPPUNIT_ASSERT_EQUAL(6, m_text->GetNumberOfLines()); #else CPPUNIT_ASSERT(m_text->GetNumberOfLines() > 6); diff --git a/tests/controls/textentrytest.cpp b/tests/controls/textentrytest.cpp index 8bf279c2fc..9c1dbe7d95 100644 --- a/tests/controls/textentrytest.cpp +++ b/tests/controls/textentrytest.cpp @@ -45,17 +45,25 @@ void TextEntryTestCase::TextChangeEvents() wxTextEntry * const entry = GetTestEntry(); // notice that SetValue() generates an event even if the text didn't change +#ifndef __WXQT__ entry->SetValue(""); CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() ); updated.Clear(); +#else + WARN("Events are only sent when text changes in WxQt"); +#endif entry->SetValue("foo"); CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() ); updated.Clear(); +#ifndef __WXQT__ entry->SetValue("foo"); CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() ); updated.Clear(); +#else + WARN("Events are only sent when text changes in WxQt"); +#endif entry->SetValue(""); CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() ); From a207862210dcc0d7e5bd58d67747217493718879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Mon, 17 Dec 2018 01:18:17 +0200 Subject: [PATCH 148/553] SetValue() on 'single' radio button must not reset others Radio buttons with wxRB_SINGLE style are not set initially. When getting set, the code attempts to unset other radio buttons that do not have wxRB_GROUP | wxRB_SINGLE style. Closes https://github.com/wxWidgets/wxWidgets/pull/1099 --- src/msw/radiobut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index e4c1134024..00c3fa93b4 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -92,7 +92,7 @@ void wxRadioButton::SetValue(bool value) else // owner drawn buttons don't react to this message Refresh(); - if ( !value ) + if ( !value || HasFlag(wxRB_SINGLE) ) return; // if we set the value of one radio button we also must clear all the other From 293736986991bcb3c2df729a10985c3853bcd476 Mon Sep 17 00:00:00 2001 From: Jeff Bland Date: Mon, 24 Dec 2018 20:56:59 -0700 Subject: [PATCH 149/553] CMake: Fix monolithic build Monolithic build regressed with commit 815d288c4fedba044a9863c883d6dd9f53526668 "Set wx-config base, gui and built libraries". The code queries each possible target name and creates lists of the valid targets. In the monolithic build, none of the normal target names exist, so the list is empty. The empty list is then passed to STRIP, causing cmake to fail due to not having enough arguments. By quoting the STRIP params we can pass an empty argument and thus prevent the error of not-enough arguments. See https://github.com/wxWidgets/wxWidgets/pull/1100 --- build/cmake/config.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index d397f0dca2..c4e1b053e1 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -105,9 +105,9 @@ function(wx_write_config) endif() endif() endforeach() - string(STRIP ${BUILT_WX_LIBS} BUILT_WX_LIBS) - string(STRIP ${STD_BASE_LIBS} STD_BASE_LIBS) - string(STRIP ${STD_GUI_LIBS} STD_GUI_LIBS) + string(STRIP "${BUILT_WX_LIBS}" BUILT_WX_LIBS) + string(STRIP "${STD_BASE_LIBS}" STD_BASE_LIBS) + string(STRIP "${STD_GUI_LIBS}" STD_GUI_LIBS) set(WX_RELEASE ${wxMAJOR_VERSION}.${wxMINOR_VERSION}) set(WX_VERSION ${wxVERSION}) From 1042521706518d03fb631671d0a6c1eb5c166ef8 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 09:09:44 +0100 Subject: [PATCH 150/553] Refresh wxPropertGrid after resetting column sizes Grid needs to be redrawn with new splitters positions. Closes #18312. --- src/propgrid/propgrid.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 87b3eef99f..735a7f3d81 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2823,12 +2823,16 @@ void wxPropertyGrid::DoSetSplitterPosition( int newxpos, void wxPropertyGrid::ResetColumnSizes( bool enableAutoResizing ) { - wxPropertyGridPageState* state = m_pState; - if ( state ) - state->ResetColumnSizes(0); + if ( m_pState ) + { + m_pState->ResetColumnSizes(0); + if ( GetSelection() ) + CorrectEditorWidgetSizeX(); + Refresh(); - if ( enableAutoResizing && HasFlag(wxPG_SPLITTER_AUTO_CENTER) ) - m_pState->m_dontCenterSplitter = false; + if ( enableAutoResizing && HasFlag(wxPG_SPLITTER_AUTO_CENTER) ) + m_pState->m_dontCenterSplitter = false; + } } // ----------------------------------------------------------------------- From e9b45f19f9474adc26b212e9b7b936d3f118ba23 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 09:37:35 +0100 Subject: [PATCH 151/553] Fix index of dragged splitter sent with EVT_PG_COL_DRAGGING Re-centering the splitter with mouse double-click works only if we have two columns so only splitter 0 can be clicked. --- src/propgrid/propgrid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 735a7f3d81..cbe4849c49 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4873,7 +4873,7 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even m_propHover, NULL, wxPG_SEL_NOVALIDATE, - (unsigned int)m_draggedSplitter); + 0); // dragged splitter is always 0 here } } else if ( m_dragStatus == 0 ) From 6c36554ae1edf523743ad7171bc4538be11d7db3 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 09:52:36 +0100 Subject: [PATCH 152/553] Get rid of unnecessary variable in wxPropertyGrid --- src/propgrid/propgrid.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index cbe4849c49..53b193aedd 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4980,9 +4980,7 @@ bool wxPropertyGrid::HandleMouseDoubleClick( int WXUNUSED(x), if ( m_propHover ) { // Select property here as well - wxPGProperty* p = m_propHover; - - AddToSelectionFromInputEvent(p, m_colHover, &event); + AddToSelectionFromInputEvent(m_propHover, m_colHover, &event); // Send double-click event. SendEvent( wxEVT_PG_DOUBLE_CLICK, m_propHover ); From d85a03b5610ed1dec8cdf64b4f17a511668bf383 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 10:02:10 +0100 Subject: [PATCH 153/553] Don't make unnecessary calls to the member function Use already obtained reference to the list of selected properties instead of retrieving the list by calling GetSelectedProperties() function. --- src/propgrid/propgrid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 53b193aedd..a2e4ba2cab 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -841,7 +841,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop, { // Allow right-click for context menu without // disturbing the selection. - if ( GetSelectedProperties().size() <= 1 || + if ( selection.size() <= 1 || !alreadySelected ) return DoSelectAndEdit(prop, colIndex, selFlags); return true; @@ -870,7 +870,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop, { res = DoAddToSelection(prop, selFlags); } - else if ( GetSelectedProperties().size() > 1 ) + else if ( selection.size() > 1 ) { res = DoRemoveFromSelection(prop, selFlags); } From e74e345e04cb0de86a8b395a295532282004564a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 10:17:48 +0100 Subject: [PATCH 154/553] Use dedicated function to check if array of selected properties is empty --- src/propgrid/propgrid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index a2e4ba2cab..8565941760 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -854,7 +854,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop, } else if ( mouseEvent->ShiftDown() ) { - if ( selection.size() > 0 && !prop->IsCategory() ) + if ( !selection.empty() && !prop->IsCategory() ) addToExistingSelection = 2; else addToExistingSelection = 1; From 7f29ab97df73f08f09cc5f5339139fa7b0895f38 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 10:42:17 +0100 Subject: [PATCH 155/553] Optimize calculating column widths Use iterative algorithm instead of recursive one to adjust column widths. --- src/propgrid/propgridpagestate.cpp | 53 +++++++++++------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 6d11d450a1..b87ca0d90f 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1010,33 +1010,12 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) unsigned int i; unsigned int lastColumn = m_colWidths.size() - 1; - int width = m_width; int clientWidth = pg->GetClientSize().x; - // - // Column to reduce, if needed. Take last one that exceeds minimum width. - int reduceCol = -1; - wxLogTrace("propgrid", wxS("ColumnWidthCheck (virtualWidth: %i, clientWidth: %i)"), - width, clientWidth); + m_width, clientWidth); - // - // Check min sizes - for ( i=0; iGetMarginWidth(); for ( i=0; iHasVirtualWidth() ) { - int widthHigher = width - colsWidth; + int widthHigher = m_width - colsWidth; // Adapt colsWidth to width - if ( colsWidth < width ) + if ( colsWidth < m_width ) { // Increase column wxLogTrace("propgrid", wxS(" Adjust last column to %i"), m_colWidths[lastColumn] + widthHigher); - m_colWidths[lastColumn] = m_colWidths[lastColumn] + widthHigher; + m_colWidths[lastColumn] += widthHigher; } - else if ( colsWidth > width ) + else if ( colsWidth > m_width ) { - // Reduce column - if ( reduceCol != -1 ) + widthHigher = -widthHigher; + // Always reduce the last column that is larger than minimum size + // (looks nicer, even with auto-centering enabled). + for (int reduceCol = (int)lastColumn; reduceCol >= 0 && widthHigher > 0; reduceCol--) { - wxLogTrace("propgrid", - wxS(" Reduce column %i (by %i)"), - reduceCol, -widthHigher); + // Reduce column, if possible. + if ( m_colWidths[reduceCol] > GetColumnMinWidth(reduceCol) ) + { + int d = wxMin(m_colWidths[reduceCol] - GetColumnMinWidth(reduceCol), widthHigher); + wxLogTrace("propgrid", wxS(" Reduce column %i (by %i)"), reduceCol, d); - // Reduce widest column, and recheck - m_colWidths[reduceCol] = m_colWidths[reduceCol] + widthHigher; - CheckColumnWidths(); + m_colWidths[reduceCol] -= d; + colsWidth -= d; + widthHigher -= d; + } } + m_width = colsWidth; } } else From b3563b690c35e549ff607a957a31d85fc6c9cc55 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 10:47:24 +0100 Subject: [PATCH 156/553] Access last element of wxVector with dedicated method Use reference returned by back() method instead of referencing by the index of the last element. --- src/propgrid/propgridpagestate.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index b87ca0d90f..e423f615ce 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -981,7 +981,7 @@ wxSize wxPropertyGridPageState::DoFitColumns( bool WXUNUSED(allowGridResize) ) // Expand last one to fill the width int remaining = m_width - accWid; - m_colWidths[GetColumnCount()-1] += remaining; + m_colWidths.back() += remaining; m_dontCenterSplitter = true; @@ -1009,7 +1009,6 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) wxPropertyGrid* pg = GetGrid(); unsigned int i; - unsigned int lastColumn = m_colWidths.size() - 1; int clientWidth = pg->GetClientSize().x; wxLogTrace("propgrid", @@ -1036,15 +1035,15 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) // Increase column wxLogTrace("propgrid", wxS(" Adjust last column to %i"), - m_colWidths[lastColumn] + widthHigher); - m_colWidths[lastColumn] += widthHigher; + m_colWidths.back() + widthHigher); + m_colWidths.back() += widthHigher; } else if ( colsWidth > m_width ) { widthHigher = -widthHigher; // Always reduce the last column that is larger than minimum size // (looks nicer, even with auto-centering enabled). - for (int reduceCol = (int)lastColumn; reduceCol >= 0 && widthHigher > 0; reduceCol--) + for (int reduceCol = (int)m_colWidths.size() - 1; reduceCol >= 0 && widthHigher > 0; reduceCol--) { // Reduce column, if possible. if ( m_colWidths[reduceCol] > GetColumnMinWidth(reduceCol) ) @@ -1065,7 +1064,7 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) // Only check colsWidth against clientWidth if ( colsWidth < clientWidth ) { - m_colWidths[lastColumn] = m_colWidths[lastColumn] + (clientWidth-colsWidth); + m_colWidths.back() += (clientWidth-colsWidth); } m_width = colsWidth; From 5366a1dfbb7530791ee82ff703e85937fb765c57 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 10:53:27 +0100 Subject: [PATCH 157/553] Iterate over all items of wxVector with column widths with iterator --- src/propgrid/propgridpagestate.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index e423f615ce..577071d8fc 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1008,7 +1008,6 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) wxPropertyGrid* pg = GetGrid(); - unsigned int i; int clientWidth = pg->GetClientSize().x; wxLogTrace("propgrid", @@ -1017,8 +1016,8 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) int colsWidth = pg->GetMarginWidth(); - for ( i=0; i::const_iterator it = m_colWidths.begin(); it != m_colWidths.end(); ++it) + colsWidth += *it; wxLogTrace("propgrid", wxS(" HasVirtualWidth: %i colsWidth: %i"), @@ -1074,9 +1073,9 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) pg->RecalculateVirtualSize(); } - for ( i=0; i Date: Wed, 26 Dec 2018 11:03:39 +0100 Subject: [PATCH 158/553] Hide editor button while column splitter is being dragged Main editor and its button (secondary editor) should be both hidden while dragging the splitter because it's misleading when one part of the property editor disappears and another part remains visible. --- src/propgrid/propgrid.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 8565941760..bacf402ba1 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4910,11 +4910,10 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even m_draggedSplitter = splitterHit; m_dragOffset = splitterHitOffset; - #if wxPG_REFRESH_CONTROLS - // Fixes button disappearance bug if ( m_wndEditor2 ) - m_wndEditor2->Show ( false ); - #endif + { + m_wndEditor2->Hide(); + } m_startingSplitterX = x - splitterHitOffset; } @@ -5273,11 +5272,10 @@ bool wxPropertyGrid::HandleMouseUp( int x, unsigned int WXUNUSED(y), m_wndEditor->Show ( true ); } - #if wxPG_REFRESH_CONTROLS - // Fixes button disappearance bug if ( m_wndEditor2 ) - m_wndEditor2->Show ( true ); - #endif + { + m_wndEditor2->Show(true); + } // This clears the focus. m_editorFocused = false; From c112c20d5f5bf8dd2f656a549683b210dada83cc Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 11:15:44 +0100 Subject: [PATCH 159/553] Optimize calculating position of the right edge of the last cell Cell widths are invariant during the drawing so calculation can be done once, not on every loop. --- src/propgrid/propgrid.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index bacf402ba1..8b12d0cab4 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2182,6 +2182,11 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, int gridWidth = state->GetVirtualWidth(); + // Calculate position of the right edge of the last cell + int cellX = x + 1; + for (wxVector::const_iterator cit = colWidths.begin(); cit != colWidths.end(); ++cit) + cellX += *cit; + y = firstItemTopY; for ( unsigned int arrInd=1; nextP && y <= lastItemBottomY; @@ -2377,16 +2382,12 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, int firstCellX = cellRect.x; // Calculate cellRect.x for the last cell - unsigned int ci = 0; - int cellX = x + 1; - for ( ci = 0; ci < colCount; ci++ ) - cellX += colWidths[ci]; cellRect.x = cellX; // Draw cells from back to front so that we can easily tell if the // cell on the right was empty from text bool prevFilled = true; - ci = colCount; + unsigned int ci = colCount; do { ci--; From a57aacd5af797f1364c6bab2a393cef0a15555d5 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 11:23:11 +0100 Subject: [PATCH 160/553] Calculate splitter positions once Column widths are the same for all rows so there is no need to calculate splitters positions for each drawn row. --- src/propgrid/propgrid.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 8b12d0cab4..aadcd43b30 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2182,10 +2182,17 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, int gridWidth = state->GetVirtualWidth(); - // Calculate position of the right edge of the last cell - int cellX = x + 1; + // Calculate splitters positions + wxVector splitterPos; + splitterPos.reserve(colCount); + int sx = x; for (wxVector::const_iterator cit = colWidths.begin(); cit != colWidths.end(); ++cit) - cellX += *cit; + { + sx += *cit; + splitterPos.push_back(sx); + } + // Calculate position of the right edge of the last cell + int cellX = sx + 1; y = firstItemTopY; for ( unsigned int arrInd=1; @@ -2244,12 +2251,10 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, } // Splitters - int sx = x; - - for ( unsigned int si = 0; si < colCount; si++ ) + for (wxVector::const_iterator spit = splitterPos.begin(); spit != splitterPos.end(); ++spit) { - sx += colWidths[si]; - dc.DrawLine( sx, y, sx, y2 ); + int spx = *spit; + dc.DrawLine(spx, y, spx, y2); } // Horizontal Line, below From 311e5e84146b4c6f35b3e962d623a73f98a414fe Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 26 Dec 2018 11:38:51 +0100 Subject: [PATCH 161/553] Use conditional operator instead of conditional statement --- src/propgrid/propgrid.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index aadcd43b30..c5f0322cf1 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2124,11 +2124,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, wxBrush capbgbrush(m_colCapBack,wxBRUSHSTYLE_SOLID); wxPen linepen(m_colLine,1,wxPENSTYLE_SOLID); - wxColour selBackCol; - if ( isPgEnabled ) - selBackCol = m_colSelBack; - else - selBackCol = m_colMargin; + wxColour selBackCol = isPgEnabled ? m_colSelBack : m_colMargin; // pen that has same colour as text wxPen outlinepen(m_colPropFore,1,wxPENSTYLE_SOLID); From 09bf235a59b47b886c4ab6321daf1a2cf46be211 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 26 Dec 2018 23:20:52 +0100 Subject: [PATCH 162/553] Revert "Fix passing Unicode strings via wxIPC when using DDE" This reverts commit c657fd3d61828e0507c9dae5522f6c007e87628c because changing the format of DDE advise requests/replies is not a good idea: other applications (those using previous versions of wxWidgets or even not using wxWidgets at all) may rely on getting data in real CF_TEXT format rather than in one of text formats preceded by the extra byte containing the actual format and the previous commit would have silently broken this. Another fix for #17900 will be implemented instead. --- docs/changes.txt | 4 ---- include/wx/msw/dde.h | 1 + samples/ipc/server.cpp | 6 +----- src/msw/dde.cpp | 32 ++++++++++---------------------- 4 files changed, 12 insertions(+), 31 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 404da6917a..16cb9613f5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -124,10 +124,6 @@ All (GUI): - Allow changing tooltip text for button allowing to enter a new string in wxPGArrayEditorDialog. -wxMSW: - -- Fix passing Unicode strings via wxIPC when using DDE. - 3.1.2: (released 2018-12-10) ---------------------------- diff --git a/include/wx/msw/dde.h b/include/wx/msw/dde.h index a7cd04ccda..91fdd06f96 100644 --- a/include/wx/msw/dde.h +++ b/include/wx/msw/dde.h @@ -70,6 +70,7 @@ public: WXHCONV m_hConv; const void* m_sendingData; int m_dataSize; + wxIPCFormat m_dataType; wxDECLARE_NO_COPY_CLASS(wxDDEConnection); wxDECLARE_DYNAMIC_CLASS(wxDDEConnection); diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 8058eb983a..25a4420cc1 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -268,11 +268,7 @@ void MyServer::Advise() { const wxDateTime now = wxDateTime::Now(); - m_connection->Advise - ( - m_connection->m_advise, - wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82") - ); + m_connection->Advise(m_connection->m_advise, now.Format()); const wxString s = now.FormatTime() + " " + now.FormatDate(); m_connection->Advise(m_connection->m_advise, s.mb_str(), wxNO_LEN); diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index 11199fad2f..ccea317306 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -748,20 +748,12 @@ bool wxDDEConnection::DoAdvise(const wxString& item, size_t size, wxIPCFormat format) { - // Unfortunately we currently always use the same CF_TEXT in StartAdvise() - // but allow calling Advise() with different formats. This doesn't map well - // to the DDE API, so the price to pay for it is that we need to send the - // actual format used as part of the data, even if this means making - // another copy of it. - wxCharBuffer buf; - buf.extend(size + 1); - *buf.data() = format; - memcpy(buf.data() + 1, data, size); - HSZ item_atom = DDEGetAtom(item); HSZ topic_atom = DDEGetAtom(m_topicName); - m_sendingData = buf.data(); - m_dataSize = size + 1; + m_sendingData = data; // mrf: potential for scope problems here? + m_dataSize = size; + // wxIPC_PRIVATE does not succeed, so use text instead + m_dataType = format == wxIPC_PRIVATE ? wxIPC_TEXT : format; bool ok = DdePostAdvise(DDEIdInst, topic_atom, item_atom) != 0; if ( !ok ) @@ -994,12 +986,11 @@ _DDECallback(UINT wType, connection->m_dataSize, 0, hsz2, - wFmt, + connection->m_dataType, 0 ); connection->m_sendingData = NULL; - connection->m_dataSize = 0; return (DDERETURN)data; } @@ -1017,21 +1008,18 @@ _DDECallback(UINT wType, DWORD len = DdeGetData(hData, NULL, 0, 0); - BYTE* const data = static_cast(connection->GetBufferAtLeast(len)); + void *data = connection->GetBufferAtLeast(len); wxASSERT_MSG(data != NULL, wxT("Buffer too small in _DDECallback (XTYP_ADVDATA)") ); - DdeGetData(hData, data, len, 0); + DdeGetData(hData, (LPBYTE)data, len, 0); DdeFreeDataHandle(hData); - - // Our code in DoAdvise() prepends the actual format of the - // data as the first byte, extract it back now. if ( connection->OnAdvise(connection->m_topicName, item_name, - data + 1, - (int)len - 1, - (wxIPCFormat)*data) ) + data, + (int)len, + (wxIPCFormat) wFmt) ) { return (DDERETURN)(DWORD)DDE_FACK; } From 20cb47c1c4d2bce13eee87f51f919de94baaacf9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Dec 2018 00:21:49 +0100 Subject: [PATCH 163/553] Send Unicode data as UTF-8 text when using DDE-based IPC This is a more hackish but more compatible solution to the problem of data sent using wxIPC_UTF8TEXT format being simply lost when using DDE for IPC classes. We must use CF_TEXT for the DDE to pass our data, but we can try to decode it as UTF-8 in the client and assume it was sent in this format if it worked. This obviously suffers from false positives as any ASCII string will still be assumed to be UTF-8, but there shouldn't be any real harm coming from this. This change also makes sending data in wxIPC_UTF{16,32}TEXT formats work as well by converting it to UTF-8. Update the sample to call Advise() with both wxIPC_UTF{8,16}TEXT formats and remove the now unnecessary wxDDEConnection::m_dataType member. Closes #17900. --- docs/changes.txt | 4 ++ include/wx/msw/dde.h | 1 - samples/ipc/server.cpp | 9 ++++- src/msw/dde.cpp | 83 ++++++++++++++++++++++++++++++++++++++---- 4 files changed, 88 insertions(+), 9 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 16cb9613f5..404da6917a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -124,6 +124,10 @@ All (GUI): - Allow changing tooltip text for button allowing to enter a new string in wxPGArrayEditorDialog. +wxMSW: + +- Fix passing Unicode strings via wxIPC when using DDE. + 3.1.2: (released 2018-12-10) ---------------------------- diff --git a/include/wx/msw/dde.h b/include/wx/msw/dde.h index 91fdd06f96..a7cd04ccda 100644 --- a/include/wx/msw/dde.h +++ b/include/wx/msw/dde.h @@ -70,7 +70,6 @@ public: WXHCONV m_hConv; const void* m_sendingData; int m_dataSize; - wxIPCFormat m_dataType; wxDECLARE_NO_COPY_CLASS(wxDDEConnection); wxDECLARE_DYNAMIC_CLASS(wxDDEConnection); diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 25a4420cc1..cbaf7586e9 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -268,8 +268,15 @@ void MyServer::Advise() { const wxDateTime now = wxDateTime::Now(); - m_connection->Advise(m_connection->m_advise, now.Format()); + wxString str = wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82"); + m_connection->Advise(m_connection->m_advise, str + " (using UTF-8)"); + str += " (using wchar_t)"; + m_connection->Advise(m_connection->m_advise, + str.wc_str(), (str.length() + 1)*sizeof(wchar_t), + wxIPC_UNICODETEXT); + + // This one uses wxIPC_TEXT by default. const wxString s = now.FormatTime() + " " + now.FormatDate(); m_connection->Advise(m_connection->m_advise, s.mb_str(), wxNO_LEN); diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index ccea317306..245a1f3de2 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -742,6 +742,14 @@ bool wxDDEConnection::StopAdvise(const wxString& item) return ok; } +// Small helper function converting the data from the format used by the given +// conversion to UTF-8. +static +wxCharBuffer ConvertToUTF8(const wxMBConv& conv, const void* data, size_t size) +{ + return wxConvUTF8.cWC2MB(conv.cMB2WC((const char*)data, size, NULL)); +} + // Calls that SERVER can make bool wxDDEConnection::DoAdvise(const wxString& item, const void *data, @@ -750,10 +758,55 @@ bool wxDDEConnection::DoAdvise(const wxString& item, { HSZ item_atom = DDEGetAtom(item); HSZ topic_atom = DDEGetAtom(m_topicName); - m_sendingData = data; // mrf: potential for scope problems here? - m_dataSize = size; - // wxIPC_PRIVATE does not succeed, so use text instead - m_dataType = format == wxIPC_PRIVATE ? wxIPC_TEXT : format; + + // Define the buffer which, if it's used at all, needs to stay alive until + // after DdePostAdvise() call which uses it. + wxCharBuffer buf; + + // As we always use CF_TEXT for XTYP_ADVSTART, we have to use wxIPC_TEXT + // here, even if a different format was specified for this value. Of + // course, this can only be done for just a few of the formats, so check + // that we have one of them here. + switch ( format ) + { + case wxIPC_TEXT: + case wxIPC_OEMTEXT: + case wxIPC_UTF8TEXT: + case wxIPC_PRIVATE: + // Use the data directly. + m_sendingData = data; + m_dataSize = size; + break; + + case wxIPC_UTF16TEXT: + case wxIPC_UTF32TEXT: + // We need to convert the data to UTF-8 as UTF-16 or 32 would + // appear as mojibake in the client when received as CF_TEXT. + buf = format == wxIPC_UTF16TEXT + ? ConvertToUTF8(wxMBConvUTF16(), data, size) + : ConvertToUTF8(wxMBConvUTF32(), data, size); + + m_sendingData = buf.data(); + m_dataSize = buf.length(); + break; + + case wxIPC_INVALID: + case wxIPC_BITMAP: + case wxIPC_METAFILE: + case wxIPC_SYLK: + case wxIPC_DIF: + case wxIPC_TIFF: + case wxIPC_DIB: + case wxIPC_PALETTE: + case wxIPC_PENDATA: + case wxIPC_RIFF: + case wxIPC_WAVE: + case wxIPC_ENHMETAFILE: + case wxIPC_FILENAME: + case wxIPC_LOCALE: + wxFAIL_MSG( "Unsupported IPC format for Advise()" ); + return false; + }; bool ok = DdePostAdvise(DDEIdInst, topic_atom, item_atom) != 0; if ( !ok ) @@ -986,7 +1039,7 @@ _DDECallback(UINT wType, connection->m_dataSize, 0, hsz2, - connection->m_dataType, + wFmt, 0 ); @@ -1008,18 +1061,34 @@ _DDECallback(UINT wType, DWORD len = DdeGetData(hData, NULL, 0, 0); - void *data = connection->GetBufferAtLeast(len); + char* const data = (char *)connection->GetBufferAtLeast(len); wxASSERT_MSG(data != NULL, wxT("Buffer too small in _DDECallback (XTYP_ADVDATA)") ); DdeGetData(hData, (LPBYTE)data, len, 0); DdeFreeDataHandle(hData); + + // We always get data in CF_TEXT format, but it could + // actually be UTF-8, so try recovering the original format + // if possible. + if ( wFmt != CF_TEXT ) + { + wxLogDebug("Unexpected format %02x in XTYP_ADVDATA", wFmt); + return (DDERETURN)DDE_FNOTPROCESSED; + } + + wxIPCFormat format; + if ( wxConvUTF8.ToWChar(NULL, 0, data, len) != wxCONV_FAILED ) + format = wxIPC_UTF8TEXT; + else + format = wxIPC_TEXT; + if ( connection->OnAdvise(connection->m_topicName, item_name, data, (int)len, - (wxIPCFormat) wFmt) ) + format) ) { return (DDERETURN)(DWORD)DDE_FACK; } From 8dbe6ec69df69900217be7946b9bd597d813710d Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 09:04:37 +0100 Subject: [PATCH 164/553] Add to propgrid sample an option to change virtual width of the grid --- samples/propgrid/propgrid.cpp | 23 +++++++++++++++++++++++ samples/propgrid/propgrid.h | 1 + 2 files changed, 24 insertions(+) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 49ff46bbb0..134c43cd88 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -422,6 +422,7 @@ enum ID_SETPROPERTYVALUE, ID_TESTREPLACE, ID_SETCOLUMNS, + ID_SETVIRTWIDTH, ID_TESTXRC, ID_ENABLECOMMONVALUES, ID_SELECTSTYLE, @@ -522,6 +523,7 @@ wxBEGIN_EVENT_TABLE(FormMain, wxFrame) EVT_MENU( ID_CATCOLOURS, FormMain::OnCatColours ) EVT_MENU( ID_SETCOLUMNS, FormMain::OnSetColumns ) + EVT_MENU( ID_SETVIRTWIDTH, FormMain::OnSetVirtualWidth ) EVT_MENU( ID_TESTXRC, FormMain::OnTestXRC ) EVT_MENU( ID_ENABLECOMMONVALUES, FormMain::OnEnableCommonValues ) EVT_MENU( ID_SELECTSTYLE, FormMain::OnSelectStyle ) @@ -2120,6 +2122,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size menuTry->AppendCheckItem(ID_BOOL_CHECKBOX, "Render Boolean values as checkboxes", "Renders Boolean values as checkboxes"); menuTry->Append(ID_SETCOLUMNS, "Set Number of Columns" ); + menuTry->Append(ID_SETVIRTWIDTH, "Set Virtual Width"); menuTry->AppendSeparator(); menuTry->Append(ID_TESTXRC, "Display XRC sample" ); @@ -2943,6 +2946,26 @@ void FormMain::OnSetColumns( wxCommandEvent& WXUNUSED(event) ) // ----------------------------------------------------------------------- +void FormMain::OnSetVirtualWidth(wxCommandEvent& WXUNUSED(evt)) +{ + long oldWidth = m_pPropGridManager->GetState()->GetVirtualWidth(); + long newWidth = oldWidth; + { + wxNumberEntryDialog dlg(this, "Enter virtual width (-1-2000).", "Width:", + "Change Virtual Width", oldWidth, -1, 2000); + if ( dlg.ShowModal() == wxID_OK ) + { + newWidth = dlg.GetValue(); + } + } + if ( newWidth != oldWidth ) + { + m_pPropGridManager->GetGrid()->SetVirtualWidth((int)newWidth); + } +} + +// ----------------------------------------------------------------------- + void FormMain::OnSetPropertyValue( wxCommandEvent& WXUNUSED(event) ) { wxPropertyGrid* pg = m_pPropGridManager->GetGrid(); diff --git a/samples/propgrid/propgrid.h b/samples/propgrid/propgrid.h index 8ed65a21aa..7827ed3395 100644 --- a/samples/propgrid/propgrid.h +++ b/samples/propgrid/propgrid.h @@ -198,6 +198,7 @@ public: void OnCatColoursUpdateUI( wxUpdateUIEvent& event ); void OnCatColours( wxCommandEvent& event ); void OnSetColumns( wxCommandEvent& event ); + void OnSetVirtualWidth(wxCommandEvent& evt); void OnMisc( wxCommandEvent& event ); void OnPopulateClick( wxCommandEvent& event ); void OnSetSpinCtrlEditorClick( wxCommandEvent& event ); From cc32ebc9792f8392c53aca2c8b8ef57c25729b31 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 09:15:55 +0100 Subject: [PATCH 165/553] Adjust scroll bar and refresh the grid after changing virtual width --- src/propgrid/propgrid.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index c5f0322cf1..d7f211e3f1 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4691,6 +4691,8 @@ void wxPropertyGrid::SetVirtualWidth( int width ) SetInternalFlag(wxPG_FL_HAS_VIRTUAL_WIDTH); } m_pState->SetVirtualWidth( width ); + RecalculateVirtualSize(); + Refresh(); } void wxPropertyGrid::SetFocusOnCanvas() From 73b5d3420e0227ddca7b430d72a7a0bd1b950598 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 10:01:51 +0100 Subject: [PATCH 166/553] Fix determining shift of the drawn scrolled contents Position of the visible portion of the window should be taken as a drawing offset. See #18313. --- src/propgrid/propgrid.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index d7f211e3f1..c99c8e63c2 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2028,7 +2028,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc, #if WXWIN_COMPATIBILITY_3_0 int wxPropertyGrid::DoDrawItemsBase( wxDC& dc, const wxRect* itemsRect, - bool isBuffered ) const + bool WXUNUSED(isBuffered) ) const #else int wxPropertyGrid::DoDrawItems( wxDC& dc, const wxRect* itemsRect ) const @@ -2043,8 +2043,9 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, if ( !lastItem ) lastItem = GetLastItem( wxPG_ITERATE_VISIBLE ); - int vy; - GetViewStart(NULL, &vy); + int vx, vy; + GetViewStart(&vx, &vy); + vx *= wxPG_PIXELS_PER_UNIT; vy *= wxPG_PIXELS_PER_UNIT; if ( IsFrozen() || m_height < 1 || firstItem == NULL ) @@ -2090,22 +2091,10 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, long windowStyle = m_windowStyle; -#if WXWIN_COMPATIBILITY_3_0 - int xRelMod = 0; - - if ( isBuffered ) - { - xRelMod = itemsRect->x; - // itemsRect conversion - firstItemTopY -= vy; - lastItemBottomY -= vy; - } -#else - int xRelMod = itemsRect->x; + int xRelMod = vx; // itemsRect conversion firstItemTopY -= vy; lastItemBottomY -= vy; -#endif int x = m_marginWidth - xRelMod; From 48c71a5f04e1cd808092b5127f05a2139fa1a691 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 10:09:59 +0100 Subject: [PATCH 167/553] Fix calculating width of the first cell See #18313. --- src/propgrid/propgrid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index c99c8e63c2..67ac880631 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2368,7 +2368,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, cellRect.x += 1; } - int firstCellWidth = colWidths[0] - (greyDepthX - m_marginWidth); + int firstCellWidth = colWidths[0] - (greyDepth - m_marginWidth); int firstCellX = cellRect.x; // Calculate cellRect.x for the last cell From 2f918abf3acc3319aab88ce1de5090e901172353 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 10:25:02 +0100 Subject: [PATCH 168/553] Clear empty space beyond the right edge of the grid See #18313. --- src/propgrid/propgrid.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 67ac880631..55a33034f9 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2165,7 +2165,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, wxPGProperty* nextP = visPropArray[0]; - int gridWidth = state->GetVirtualWidth(); + int gridWidth = itemsRect->x + itemsRect->width; // Calculate splitters positions wxVector splitterPos; @@ -2501,6 +2501,11 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, y += rowHeight; } + // Clear empty space beyond the right edge of the grid + dc.SetPen(wxPen(m_colEmptySpace)); + dc.SetBrush(wxBrush(m_colEmptySpace)); + dc.DrawRectangle(cellX, firstItemTopY, gridWidth - cellX, lastItemBottomY - firstItemTopY); + return y - 1 + vy; } From 9ad19622fd31bbc8af4521de5a44c35dc3959955 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 10:50:58 +0100 Subject: [PATCH 169/553] Fix drawing horizontal lines between the rows of the grid See #18313. --- src/propgrid/propgrid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 55a33034f9..5e320bafcb 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2248,7 +2248,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, nextP && nextP->IsCategory() ) dc.SetPen(m_colCapBack); - dc.DrawLine( greyDepthX, y2-1, gridWidth-xRelMod, y2-1 ); + dc.DrawLine(greyDepthX, y2 - 1, cellX, y2 - 1); // // Need to override row colours? From de6469610ab86307f0d9804c83dc233f096434f1 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 10:57:47 +0100 Subject: [PATCH 170/553] Fix determining width of the entire row See #18313. --- src/propgrid/propgrid.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 5e320bafcb..3709ef2bc8 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2330,8 +2330,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, lh ); // Default cell rect fill the entire row - wxRect cellRect(greyDepthX, y, - gridWidth - greyDepth + 2, rowHeight-1 ); + wxRect cellRect(greyDepthX, y, cellX - greyDepthX, rowHeight-1); bool isCategory = p->IsCategory(); From 831a81fb9045bdcc8ab556c1e0d200b037d69a32 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 11:13:25 +0100 Subject: [PATCH 171/553] Fix positioning property editor Account scrolled horizontal position. See #18313. --- src/propgrid/propgrid.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 3709ef2bc8..0897101c90 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3737,6 +3737,7 @@ wxRect wxPropertyGrid::GetEditorWidgetRect( wxPGProperty* p, int column ) const int vx, vy; // Top left corner of client GetViewStart(&vx, &vy); + vx *= wxPG_PIXELS_PER_UNIT; vy *= wxPG_PIXELS_PER_UNIT; if ( column == 1 ) @@ -3759,7 +3760,7 @@ wxRect wxPropertyGrid::GetEditorWidgetRect( wxPGProperty* p, int column ) const return wxRect ( - splitterX+imageOffset+wxPG_XBEFOREWIDGET+wxPG_CONTROL_MARGIN+1, + splitterX+imageOffset+wxPG_XBEFOREWIDGET+wxPG_CONTROL_MARGIN+1-vx, itemy-vy, colEnd-splitterX-wxPG_XBEFOREWIDGET-wxPG_CONTROL_MARGIN-imageOffset-1, m_lineHeight-1 From 7d43ed0fb6e1874e2f0ff4355e0645d3b432ccae Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 11:34:26 +0100 Subject: [PATCH 172/553] Iterate over all items of wxVector with column proportions with iterator --- src/propgrid/propgridpagestate.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 577071d8fc..f894b6fd0c 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1143,20 +1143,19 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) void wxPropertyGridPageState::ResetColumnSizes( int setSplitterFlags ) { - unsigned int i; // Calculate sum of proportions int psum = 0; - for ( i=0; i::const_iterator it = m_columnProportions.begin(); it != m_columnProportions.end(); ++it) + psum += *it; int puwid = (m_pPropGrid->m_width*256) / psum; int cpos = 0; // Convert proportion to splitter positions - for ( i=0; i<(m_colWidths.size() - 1); i++ ) + for (size_t i=0; i<(m_colWidths.size() - 1); i++) { int cwid = (puwid*m_columnProportions[i]) / 256; cpos += cwid; - DoSetSplitterPosition(cpos, i, + DoSetSplitterPosition(cpos, (int)i, setSplitterFlags); } } From 9b7c281e6bf200b77505c3bbe566894fc8673a26 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 27 Dec 2018 11:49:43 +0100 Subject: [PATCH 173/553] Move repeating code to the dedicated template wxVector function --- include/wx/propgrid/propgriddefs.h | 18 ++++++++++++++++++ src/propgrid/propgridpagestate.cpp | 8 ++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/wx/propgrid/propgriddefs.h b/include/wx/propgrid/propgriddefs.h index 6eebf00177..91ee22a8c5 100644 --- a/include/wx/propgrid/propgriddefs.h +++ b/include/wx/propgrid/propgriddefs.h @@ -24,6 +24,10 @@ #include "wx/longlong.h" #include "wx/clntdata.h" +#if wxUSE_STD_CONTAINERS +#include +#endif // wxUSE_STD_CONTAINERS + // ----------------------------------------------------------------------- // @@ -760,6 +764,20 @@ inline void wxPGRemoveItemFromVector(wxVector& vector, const T& item) #endif // wxUSE_STL/!wxUSE_STL } +// Utility to calaculate sum of all elements of the vector. +template +inline T wxPGGetSumVectorItems(const wxVector& vector, T init) +{ +#if wxUSE_STD_CONTAINERS + return std::accumulate(vector.begin(), vector.end(), init); +#else + for (typename wxVector::const_iterator it = vector.begin(); it != vector.end(); ++it) + init += *it; + + return init; +#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS +} + // ----------------------------------------------------------------------- #endif // wxUSE_PROPGRID diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index f894b6fd0c..d53e1ac4de 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1015,9 +1015,7 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) m_width, clientWidth); - int colsWidth = pg->GetMarginWidth(); - for (wxVector::const_iterator it = m_colWidths.begin(); it != m_colWidths.end(); ++it) - colsWidth += *it; + int colsWidth = wxPGGetSumVectorItems(m_colWidths, pg->GetMarginWidth()); wxLogTrace("propgrid", wxS(" HasVirtualWidth: %i colsWidth: %i"), @@ -1144,9 +1142,7 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) void wxPropertyGridPageState::ResetColumnSizes( int setSplitterFlags ) { // Calculate sum of proportions - int psum = 0; - for (wxVector::const_iterator it = m_columnProportions.begin(); it != m_columnProportions.end(); ++it) - psum += *it; + int psum = wxPGGetSumVectorItems(m_columnProportions, 0); int puwid = (m_pPropGrid->m_width*256) / psum; int cpos = 0; From 95461c566d9c85db991c01275cd7f4fbb2e4ee33 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 09:18:06 +0100 Subject: [PATCH 174/553] Fix repositioning editors for horizontally scrolled grid Closes #18313. --- docs/changes.txt | 1 + include/wx/propgrid/propgrid.h | 8 +++++-- src/propgrid/editors.cpp | 27 +++++++++++++++++++++ src/propgrid/propgrid.cpp | 44 +++++++++++++++++++++++++++------- 4 files changed, 70 insertions(+), 10 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 16cb9613f5..09bfd27724 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -123,6 +123,7 @@ All (GUI): - Implement wxAuiNotebook::GetBestSize() (Sebastian Walderich). - Allow changing tooltip text for button allowing to enter a new string in wxPGArrayEditorDialog. +- Fix wxPropertyGrid issues with horizontal scrolling. 3.1.2: (released 2018-12-10) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 9239043908..f7b444c21d 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1687,10 +1687,10 @@ protected: // Which column's editor is selected (usually 1)? unsigned int m_selColumn; - +#if WXWIN_COMPATIBILITY_3_0 // x relative to splitter (needed for resize). int m_ctrlXAdjust; - +#endif // WXWIN_COMPATIBILITY_3_0 // lines between cells wxColour m_colLine; // property labels and values are written in this colour @@ -1803,7 +1803,11 @@ protected: wxRect GetEditorWidgetRect( wxPGProperty* p, int column ) const; +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED_MSG("Don't use this function. It works only if horizontal scrolling is not active") void CorrectEditorWidgetSizeX(); +#endif // WXWIN_COMPATIBILITY_3_0 + void CorrectEditorWidgetSizeX(int xPosChange, int widthChange); // Called in RecalculateVirtualSize() to reposition control // on virtual height changes. diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index fce63e54bd..03d3457529 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1786,6 +1786,7 @@ wxWindow* wxPropertyGrid::GetEditorControl() const // ----------------------------------------------------------------------- +#if WXWIN_COMPATIBILITY_3_0 void wxPropertyGrid::CorrectEditorWidgetSizeX() { int secWid = 0; @@ -1827,6 +1828,32 @@ void wxPropertyGrid::CorrectEditorWidgetSizeX() if ( m_wndEditor2 ) m_wndEditor2->Refresh(); } +#endif // WXWIN_COMPATIBILITY_3_0 + +void wxPropertyGrid::CorrectEditorWidgetSizeX(int xPosChange, int widthChange) +{ + if ( m_wndEditor2 ) + { + // if width change occurred, move secondary wnd by that amount + wxPoint p = m_wndEditor2->GetPosition(); + p.x += xPosChange + widthChange; + m_wndEditor2->SetPosition(p); + } + + if ( m_wndEditor ) + { + wxRect r = m_wndEditor->GetRect(); + r.x += xPosChange; + + if ( !(m_iFlags & wxPG_FL_FIXED_WIDTH_EDITOR) ) + r.width += widthChange; + + m_wndEditor->SetSize(r); + } + + if ( m_wndEditor2 ) + m_wndEditor2->Refresh(); +} // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 0897101c90..1675f2697d 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2796,17 +2796,23 @@ void wxPropertyGrid::DoSetSplitterPosition( int newxpos, if ( ( newxpos < wxPG_DRAG_MARGIN ) ) return; - wxPropertyGridPageState* state = m_pState; - if ( flags & wxPG_SPLITTER_FROM_EVENT ) - state->m_dontCenterSplitter = true; + m_pState->m_dontCenterSplitter = true; - state->DoSetSplitterPosition(newxpos, splitterIndex, flags); + // Save position and size of column 1 used for main editor widgets + int xPosEditorCol = m_pState->DoGetSplitterPosition(0); + int widthEditorCol = m_pState->GetColumnWidth(1); + + m_pState->DoSetSplitterPosition(newxpos, splitterIndex, flags); if ( flags & wxPG_SPLITTER_REFRESH ) { if ( GetSelection() ) - CorrectEditorWidgetSizeX(); + { + int xPosChange = m_pState->DoGetSplitterPosition(0) - xPosEditorCol; + int widthColChange = m_pState->GetColumnWidth(1) - widthEditorCol; + CorrectEditorWidgetSizeX(xPosChange, widthColChange); + } Refresh(); } @@ -2820,9 +2826,17 @@ void wxPropertyGrid::ResetColumnSizes( bool enableAutoResizing ) { if ( m_pState ) { + // Save position and size of column 1 used for main editor widgets + int xPosEditorCol = m_pState->DoGetSplitterPosition(0); + int widthEditorCol = m_pState->GetColumnWidth(1); + m_pState->ResetColumnSizes(0); if ( GetSelection() ) - CorrectEditorWidgetSizeX(); + { + int xPosChange = m_pState->DoGetSplitterPosition(0) - xPosEditorCol; + int widthColChange = m_pState->GetColumnWidth(1) - widthEditorCol; + CorrectEditorWidgetSizeX(xPosChange, widthColChange); + } Refresh(); if ( enableAutoResizing && HasFlag(wxPG_SPLITTER_AUTO_CENTER) ) @@ -4221,9 +4235,10 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) if ( p->HasFlag(wxPG_PROP_MODIFIED) && (m_windowStyle & wxPG_BOLD_MODIFIED) ) SetCurControlBoldFont(); - +#if WXWIN_COMPATIBILITY_3_0 // Store x relative to splitter (we'll need it). m_ctrlXAdjust = m_wndEditor->GetPosition().x - splitterX; +#endif // WXWIN_COMPATIBILITY_3_0 // Check if background clear is not necessary wxPoint pos = m_wndEditor->GetPosition(); @@ -4556,6 +4571,13 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos ) m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE; + // Save position and size of column 1 used for main editor widgets + int vx; + GetViewStart(&vx, NULL); + vx *= wxPG_PIXELS_PER_UNIT; + int xPosEditorCol = m_pState->DoGetSplitterPosition(0) - vx; + int widthEditorCol = m_pState->GetColumnWidth(1); + int x = m_pState->GetVirtualWidth(); int y = m_pState->m_virtualHeight; @@ -4607,7 +4629,13 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos ) m_pState->CheckColumnWidths(); if ( GetSelection() ) - CorrectEditorWidgetSizeX(); + { + GetViewStart(&vx, NULL); + vx *= wxPG_PIXELS_PER_UNIT; + int xPosChange = m_pState->DoGetSplitterPosition(0) - vx - xPosEditorCol; + int widthColChange = m_pState->GetColumnWidth(1) - widthEditorCol; + CorrectEditorWidgetSizeX(xPosChange, widthColChange); + } m_iFlags &= ~wxPG_FL_RECALCULATING_VIRTUAL_SIZE; } From 9d2fbef75145229c3ede4583725b20035fa4e9fa Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 09:32:47 +0100 Subject: [PATCH 175/553] Only render columns that are within update region --- src/propgrid/propgrid.cpp | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 1675f2697d..02846d77cf 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1861,19 +1861,14 @@ void wxPropertyGrid::OnPaint( wxPaintEvent& WXUNUSED(event) ) } // Find out where the window is scrolled to - int vy; // Top of the client - GetViewStart(NULL, &vy); + int vx, vy; + GetViewStart(&vx, &vy); + vx *= wxPG_PIXELS_PER_UNIT; vy *= wxPG_PIXELS_PER_UNIT; // Update everything inside the box wxRect r = GetUpdateRegion().GetBox(); - - r.y += vy; - - // FIXME: This is just a workaround for a bug that causes splitters not - // to paint when other windows are being dragged over the grid. - r.x = 0; - r.width = GetClientSize().x; + r.Offset(vx, vy); // Repaint this rectangle DrawItems(*dcPtr, r.y, r.y + r.height-1, &r); @@ -2133,8 +2128,6 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, const wxVector& colWidths = state->m_colWidths; const unsigned int colCount = state->GetColumnCount(); - // TODO: Only render columns that are within clipping region. - dc.SetFont(normalFont); wxPropertyGridConstIterator it( state, wxPG_ITERATE_VISIBLE, firstItem ); @@ -2165,8 +2158,6 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, wxPGProperty* nextP = visPropArray[0]; - int gridWidth = itemsRect->x + itemsRect->width; - // Calculate splitters positions wxVector splitterPos; splitterPos.reserve(colCount); @@ -2176,8 +2167,18 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, sx += *cit; splitterPos.push_back(sx); } + + int viewLeftEdge = itemsRect->x - vx; + int viewRightEdge = viewLeftEdge + itemsRect->width - 1; + // Determine columns range to be drawn + unsigned int firstCol = 0; + while ( firstCol < colCount-1 && splitterPos[firstCol] < viewLeftEdge ) + firstCol++; + unsigned int lastCol = firstCol; + while ( lastCol < colCount-1 && splitterPos[lastCol] < viewRightEdge ) + lastCol++; // Calculate position of the right edge of the last cell - int cellX = sx + 1; + int cellX = splitterPos[lastCol]+ 1; y = firstItemTopY; for ( unsigned int arrInd=1; @@ -2236,10 +2237,9 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, } // Splitters - for (wxVector::const_iterator spit = splitterPos.begin(); spit != splitterPos.end(); ++spit) + for (unsigned int i = firstCol; i <= lastCol; i++) { - int spx = *spit; - dc.DrawLine(spx, y, spx, y2); + dc.DrawLine(splitterPos[i], y, splitterPos[i], y2); } // Horizontal Line, below @@ -2376,7 +2376,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, // Draw cells from back to front so that we can easily tell if the // cell on the right was empty from text bool prevFilled = true; - unsigned int ci = colCount; + unsigned int ci = lastCol + 1; do { ci--; @@ -2490,9 +2490,9 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, prevFilled = true; } - dc.DestroyClippingRegion(); // Is this really necessary? + dc.DestroyClippingRegion(); } - while ( ci > 0 ); + while ( ci > firstCol ); if ( fontChanged ) dc.SetFont(normalFont); @@ -2503,7 +2503,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, // Clear empty space beyond the right edge of the grid dc.SetPen(wxPen(m_colEmptySpace)); dc.SetBrush(wxBrush(m_colEmptySpace)); - dc.DrawRectangle(cellX, firstItemTopY, gridWidth - cellX, lastItemBottomY - firstItemTopY); + dc.DrawRectangle(cellX, firstItemTopY, viewRightEdge - cellX + 1, lastItemBottomY - firstItemTopY); return y - 1 + vy; } From 18e03af068341bbb686eb9260245b98dc491805b Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 09:35:43 +0100 Subject: [PATCH 176/553] Use conditional operator instead of conditional statement --- src/propgrid/propgrid.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 02846d77cf..5536e43416 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2284,10 +2284,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, else if ( isPgEnabled ) { rowFgCol = m_colPropFore; - if ( p == firstSelected ) - rowBgCol = m_colMargin; - else - rowBgCol = selBackCol; + rowBgCol = p == firstSelected ? m_colMargin : selBackCol; } else { @@ -2440,10 +2437,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, { dc.SetBrush(m_colPropBack); dc.SetPen(m_colPropBack); - if ( p->IsEnabled() ) - dc.SetTextForeground(m_colPropFore); - else - dc.SetTextForeground(m_colDisPropFore); + dc.SetTextForeground(p->IsEnabled() ? m_colPropFore : m_colDisPropFore); } } else From 76ff4ab2b6e251f4fc9a0b0d186c66f7ddfc08d0 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 09:41:24 +0100 Subject: [PATCH 177/553] Use dedicated method to move rectangle --- src/propgrid/propgrid.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 5536e43416..d14243b09f 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2564,8 +2564,7 @@ void wxPropertyGrid::DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 ) GetViewStart(&vx, &vy); vx *= wxPG_PIXELS_PER_UNIT; vy *= wxPG_PIXELS_PER_UNIT; - r.x -= vx; - r.y -= vy; + r.Offset(-vx, -vy); RefreshRect(r); Update(); } From 99c53ca4bbe25e6e65bd0594debcf5c3b642d54e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 09:49:58 +0100 Subject: [PATCH 178/553] Don't retrieve unused x-coordinate of the view --- src/propgrid/propgrid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index d14243b09f..6a362c202d 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2855,8 +2855,8 @@ void wxPropertyGrid::CenterSplitter( bool enableAutoResizing ) // it itself will be returned wxPGProperty* wxPropertyGrid::GetNearestPaintVisible( wxPGProperty* p ) const { - int vx,vy1;// Top left corner of client - GetViewStart(&vx,&vy1); + int vy1;// Top left corner of client + GetViewStart(NULL,&vy1); vy1 *= wxPG_PIXELS_PER_UNIT; int vy2 = vy1 + m_height; From 4eef8d965809177120af2560a03aa7696cd639a0 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 10:01:00 +0100 Subject: [PATCH 179/553] Use row height value stored already in another variable No reason to calculate it twice. --- src/propgrid/propgrid.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 6a362c202d..01519395c4 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2188,7 +2188,6 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, wxPGProperty* p = nextP; nextP = visPropArray[arrInd]; - int rowHeight = m_fontHeight+(m_spacingy*2)+1; int textMarginHere = x; int renderFlags = 0; @@ -2327,7 +2326,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, lh ); // Default cell rect fill the entire row - wxRect cellRect(greyDepthX, y, cellX - greyDepthX, rowHeight-1); + wxRect cellRect(greyDepthX, y, cellX - greyDepthX, lh-1); bool isCategory = p->IsCategory(); @@ -2491,7 +2490,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, if ( fontChanged ) dc.SetFont(normalFont); - y += rowHeight; + y += lh; } // Clear empty space beyond the right edge of the grid From b569a429a231389060860e85cc35bb1cfa7351bd Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 11:09:40 +0100 Subject: [PATCH 180/553] Remove unnecessary position check Horizontally scrolled item can have a negative x-position. --- src/propgrid/property.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 9716d3676d..700eef79ac 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1380,8 +1380,6 @@ void wxPGProperty::OnCustomPaint( wxDC& dc, wxCHECK_RET( bmp && bmp->IsOk(), wxS("invalid bitmap") ); - wxCHECK_RET( rect.x >= 0, wxS("unexpected measure call") ); - dc.DrawBitmap(*bmp,rect.x,rect.y); } From e13382f400f3e989ca149e043aec8a4dc9fc3f13 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 13:28:42 +0100 Subject: [PATCH 181/553] Remove unnecessary check whether x-coordinate >= 0 Several lines before there is a block terminating the function if rect.x < 0 (measure item call) so there is no need to check after this block whether rect.x >= 0. --- src/propgrid/editors.cpp | 246 +++++++++++++++++++-------------------- 1 file changed, 117 insertions(+), 129 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 03d3457529..160004b02f 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -824,143 +824,131 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, wxDC& dc = *pDc; dc.SetBrush(*wxWHITE_BRUSH); - if ( rect.x >= 0 ) + // + // DrawItem call + wxPGCellRenderer* renderer = NULL; + const wxPGChoiceEntry* cell = NULL; + + wxPoint pt(rect.x + wxPG_CONTROL_MARGIN - wxPG_CHOICEXADJUST - 1, + rect.y + 1); + + int renderFlags = wxPGCellRenderer::DontUseCellColours; + bool useCustomPaintProcedure; + + // If custom image had some size, we will start from the assumption + // that custom paint procedure is required + if ( cis.x > 0 ) + useCustomPaintProcedure = true; + else + useCustomPaintProcedure = false; + + if ( flags & wxODCB_PAINTING_SELECTED ) + renderFlags |= wxPGCellRenderer::Selected; + + if ( flags & wxODCB_PAINTING_CONTROL ) { - // - // DrawItem call - wxPGCellRenderer* renderer = NULL; - const wxPGChoiceEntry* cell = NULL; + renderFlags |= wxPGCellRenderer::Control; - wxPoint pt(rect.x + wxPG_CONTROL_MARGIN - wxPG_CHOICEXADJUST - 1, - rect.y + 1); - - int renderFlags = wxPGCellRenderer::DontUseCellColours; - bool useCustomPaintProcedure; - - // If custom image had some size, we will start from the assumption - // that custom paint procedure is required - if ( cis.x > 0 ) - useCustomPaintProcedure = true; - else + // If wxPG_PROP_CUSTOMIMAGE was set, then that means any custom + // image will not appear on the control row (it may be too + // large to fit, for instance). Also do not draw custom image + // if no choice was selected. + if ( !p->HasFlag(wxPG_PROP_CUSTOMIMAGE) || item < 0 ) useCustomPaintProcedure = false; - - if ( flags & wxODCB_PAINTING_SELECTED ) - renderFlags |= wxPGCellRenderer::Selected; - - if ( flags & wxODCB_PAINTING_CONTROL ) - { - renderFlags |= wxPGCellRenderer::Control; - - // If wxPG_PROP_CUSTOMIMAGE was set, then that means any custom - // image will not appear on the control row (it may be too - // large to fit, for instance). Also do not draw custom image - // if no choice was selected. - if ( !p->HasFlag(wxPG_PROP_CUSTOMIMAGE) || item < 0 ) - useCustomPaintProcedure = false; - } - else - { - renderFlags |= wxPGCellRenderer::ChoicePopup; - - // For consistency, always use normal font when drawing drop down - // items - dc.SetFont(GetFont()); - } - - // If not drawing a selected popup item, then give property's - // value image a chance. - if ( p->GetValueImage() && item != pCb->GetSelection() ) - useCustomPaintProcedure = false; - // If current choice had a bitmap set by the application, then - // use it instead of any custom paint procedure - // (only if not drawn in the control field). - else if ( itemBitmap && !(flags & wxODCB_PAINTING_CONTROL) ) - useCustomPaintProcedure = false; - - if ( useCustomPaintProcedure ) - { - pt.x += wxCC_CUSTOM_IMAGE_MARGIN1; - wxRect r(pt, cis); - - if ( flags & wxODCB_PAINTING_CONTROL ) - { - //r.width = cis.x; - r.height = wxPG_STD_CUST_IMAGE_HEIGHT(m_lineHeight); - } - - paintdata.m_drawnWidth = r.width; - - dc.SetPen(m_colPropFore); - if ( comValIndex >= 0 ) - { - const wxPGCommonValue* cv = GetCommonValue(comValIndex); - renderer = cv->GetRenderer(); - r.width = rect.width; - renderer->Render( dc, r, this, p, m_selColumn, comValIndex, renderFlags ); - return; - } - else if ( item >= 0 ) - { - p->OnCustomPaint( dc, r, paintdata ); - } - else - { - dc.DrawRectangle( r ); - } - - pt.x += paintdata.m_drawnWidth + wxCC_CUSTOM_IMAGE_MARGIN2 - 1; - } - else - { - // TODO: This aligns text so that it seems to be horizontally - // on the same line as property values. Not really - // sure if it is needed, but seems to not cause any harm. - pt.x -= 1; - - if ( item < 0 && (flags & wxODCB_PAINTING_CONTROL) ) - item = pCb->GetSelection(); - - if ( choices.IsOk() && item >= 0 && comValIndex < 0 ) - { - // This aligns bitmap horizontally so that it is - // on the same position as bitmap drawn for static content - // (without editor). - wxRect r(rect); - r.x -= 1; - - cell = &choices.Item(item); - renderer = wxPGGlobalVars->m_defaultRenderer; - int imageOffset = renderer->PreDrawCell(dc, r, *cell, - renderFlags ); - if ( imageOffset ) - imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 + - wxCC_CUSTOM_IMAGE_MARGIN2; - pt.x += imageOffset; - } - } - - // - // Draw text - // - - pt.y += (rect.height-m_fontHeight)/2 - 1; - - pt.x += 1; - - dc.DrawText( text, pt.x + wxPG_XBEFORETEXT, pt.y ); - - if ( renderer ) - renderer->PostDrawCell(dc, this, *cell, renderFlags); } else { - // - // MeasureItem call + renderFlags |= wxPGCellRenderer::ChoicePopup; - p->OnCustomPaint( dc, rect, paintdata ); - rect.height = paintdata.m_drawnHeight + 2; - rect.width = cis.x + wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2 + 9; + // For consistency, always use normal font when drawing drop down + // items + dc.SetFont(GetFont()); } + + // If not drawing a selected popup item, then give property's + // value image a chance. + if ( p->GetValueImage() && item != pCb->GetSelection() ) + useCustomPaintProcedure = false; + // If current choice had a bitmap set by the application, then + // use it instead of any custom paint procedure + // (only if not drawn in the control field). + else if ( itemBitmap && !(flags & wxODCB_PAINTING_CONTROL) ) + useCustomPaintProcedure = false; + + if ( useCustomPaintProcedure ) + { + pt.x += wxCC_CUSTOM_IMAGE_MARGIN1; + wxRect r(pt, cis); + + if ( flags & wxODCB_PAINTING_CONTROL ) + { + //r.width = cis.x; + r.height = wxPG_STD_CUST_IMAGE_HEIGHT(m_lineHeight); + } + + paintdata.m_drawnWidth = r.width; + + dc.SetPen(m_colPropFore); + if ( comValIndex >= 0 ) + { + const wxPGCommonValue* cv = GetCommonValue(comValIndex); + renderer = cv->GetRenderer(); + r.width = rect.width; + renderer->Render( dc, r, this, p, m_selColumn, comValIndex, renderFlags ); + return; + } + else if ( item >= 0 ) + { + p->OnCustomPaint( dc, r, paintdata ); + } + else + { + dc.DrawRectangle( r ); + } + + pt.x += paintdata.m_drawnWidth + wxCC_CUSTOM_IMAGE_MARGIN2 - 1; + } + else + { + // TODO: This aligns text so that it seems to be horizontally + // on the same line as property values. Not really + // sure if it is needed, but seems to not cause any harm. + pt.x -= 1; + + if ( item < 0 && (flags & wxODCB_PAINTING_CONTROL) ) + item = pCb->GetSelection(); + + if ( choices.IsOk() && item >= 0 && comValIndex < 0 ) + { + // This aligns bitmap horizontally so that it is + // on the same position as bitmap drawn for static content + // (without editor). + wxRect r(rect); + r.x -= 1; + + cell = &choices.Item(item); + renderer = wxPGGlobalVars->m_defaultRenderer; + int imageOffset = renderer->PreDrawCell(dc, r, *cell, + renderFlags ); + if ( imageOffset ) + imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 + + wxCC_CUSTOM_IMAGE_MARGIN2; + pt.x += imageOffset; + } + } + + // + // Draw text + // + + pt.y += (rect.height-m_fontHeight)/2 - 1; + + pt.x += 1; + + dc.DrawText( text, pt.x + wxPG_XBEFORETEXT, pt.y ); + + if ( renderer ) + renderer->PostDrawCell(dc, this, *cell, renderFlags); } static From a6570433b6acb8de2e102816091fcf7848cb0ed0 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 13:58:38 +0100 Subject: [PATCH 182/553] Change wxPGProperty::OnCustomPaint measure item call signature Because horizontally scrolled wxPGProperty can have x-coordinate < 0 so there is a need to change measure item call signature from rect.x < 0 condition to something more specific to avoid misinterpretation of the calls. --- interface/wx/propgrid/property.h | 11 ++++++----- src/propgrid/editors.cpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index e60002a638..48e0e21dbe 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -1147,16 +1147,17 @@ public: NOTE: Following applies when OnMeasureImage() returns a "flexible" height ( using wxPG_FLEXIBLE_SIZE(W,H) macro), which implies variable height items: - If rect.x is < 0, then this is a measure item call, which means that - dc is invalid and only thing that should be done is to set paintdata.m_drawnHeight - to the height of the image of item at index paintdata.m_choiceItem. This call - may be done even as often as once every drop-down popup show. + If (rect.x+rect.width) is < 0, then this is a measure item call, which + means that dc is invalid and only thing that should be done is to set + paintdata.m_drawnHeight to the height of the image of item at index + paintdata.m_choiceItem. This call may be done even as often as once every + drop-down popup show. @param dc wxDC to paint on. @param rect Box reserved for custom graphics. Includes surrounding rectangle, if any. - If x is < 0, then this is a measure item call (see above). + If x+width is < 0, then this is a measure item call (see above). @param paintdata wxPGPaintData structure with much useful data about painted item. @code diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 160004b02f..b4dc593346 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -797,7 +797,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, cis = GetImageSize(p, item); } - if ( rect.x < 0 ) + if ( rect.x + rect.width < 0 ) { // Default measure behaviour (no flexible, custom paint image only) if ( rect.width < 0 ) From 9a8ef599d27080ffc4308f3d34cf05c4cfb9f5f9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 29 Dec 2018 03:48:15 +0100 Subject: [PATCH 183/553] Remove apparently never used wxMSWDCImpl::m_canvas This member field doesn't seem referenced anywhere (even not to initialize it), so it can't possibly be useful for anything and can be just removed. --- include/wx/msw/dc.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index 7e16a138b2..83bd3b9e40 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -294,9 +294,6 @@ protected: // MSW-specific member variables // ----------------------------- - // the window associated with this DC (may be NULL) - wxWindow *m_canvas; - wxBitmap m_selectedBitmap; // TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it From c9b240e89371cd90b8d20ccc7710128083236826 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Dec 2018 15:40:00 +0100 Subject: [PATCH 184/553] Try to better explain what wxFIXED_MINSIZE does Don't mention the non-existent GetAdjustedBestSize() function and do explain what setting wxFIXED_MINSIZE achieves and how it can be done without it. Closes #18315. --- interface/wx/sizer.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/interface/wx/sizer.h b/interface/wx/sizer.h index 1cc562ac76..e096c08c9d 100644 --- a/interface/wx/sizer.h +++ b/interface/wx/sizer.h @@ -83,12 +83,14 @@ The item will be expanded as much as possible while also maintaining its aspect ratio.} @itemdef{wxFIXED_MINSIZE, - Normally wxSizers will use GetAdjustedBestSize() to determine what - the minimal size of window items should be, and will use that size - to calculate the layout. This allows layouts to adjust when an - item changes and its best size becomes different. If you would - rather have a window item stay the size it started with then use - @c wxFIXED_MINSIZE.} + Normally sizers use the "best", i.e. most appropriate, size of the + window to determine what the minimal size of window items should be. + This allows layouts to adjust correctly when the item contents, + and hence its best size, changes. If this behaviour is unwanted, + @c wxFIXED_MINSIZE can be used to fix minimal size of the window + to its initial value and not change it any more in the future. + Note that the same thing can be accomplished by calling + wxWindow::SetMinSize() explicitly as well.} @itemdef{wxRESERVE_SPACE_EVEN_IF_HIDDEN, Normally wxSizers don't allocate space for hidden windows or other items. This flag overrides this behaviour so that sufficient space From 6f0c5f65b68ac036d98d5b1c6d406e9cf127d6da Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Dec 2018 16:02:09 +0100 Subject: [PATCH 185/553] Add "aui" project to MSVS 2017 unit tests solution file too This should have been done in e9cbbede005deacfbc5cb861d3679a9879ac2333 which updated the solution files for all the other MSVS versions, but somehow forgot this one. See https://github.com/wxWidgets/wxWidgets/pull/1085 --- tests/test_gui_vc15.sln | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/test_gui_vc15.sln b/tests/test_gui_vc15.sln index f8a5874577..b294ecc14c 100644 --- a/tests/test_gui_vc15.sln +++ b/tests/test_gui_vc15.sln @@ -8,6 +8,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_gui", "test_gui.vcxpro {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} = {3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6} {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} = {A8E8442A-078A-5FC5-B495-8D71BA77EE6E} {7FB0902D-8579-5DCE-B883-DAF66A885005} = {7FB0902D-8579-5DCE-B883-DAF66A885005} + {A16D3832-0F42-57CE-8F48-50E06649ADE8} = {A16D3832-0F42-57CE-8F48-50E06649ADE8} {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} = {09F2F96A-1CC6-5E43-AF1D-956EC2A4888D} {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} = {3FCC50C2-81E9-5DB2-B8D8-2129427568B1} {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} = {6744DAD8-9C70-574A-BFF2-9F8DDDB24A75} @@ -34,6 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "..\build\msw\wx_xrc. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webview", "..\build\msw\wx_webview.vcxproj", "{A8E8442A-078A-5FC5-B495-8D71BA77EE6E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aui", "..\build\msw\wx_aui.vcxproj", "{A16D3832-0F42-57CE-8F48-50E06649ADE8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Static|Win32 = Debug Static|Win32 @@ -302,8 +305,43 @@ Global {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|Win32.Build.0 = Release|Win32 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.ActiveCfg = Release|x64 {A8E8442A-078A-5FC5-B495-8D71BA77EE6E}.Release|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Static|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug Unicode|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.ActiveCfg = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|Win32.Build.0 = Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.ActiveCfg = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Debug|x64.Build.0 = Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.ActiveCfg = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|Win32.Build.0 = DLL Debug|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.ActiveCfg = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Debug|x64.Build.0 = DLL Debug|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.ActiveCfg = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|Win32.Build.0 = DLL Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.ActiveCfg = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.DLL Release|x64.Build.0 = DLL Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Static|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release Unicode|x64.Build.0 = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.ActiveCfg = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|Win32.Build.0 = Release|Win32 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.ActiveCfg = Release|x64 + {A16D3832-0F42-57CE-8F48-50E06649ADE8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {69C787B9-5194-4D53-A6B2-8496DB9414FA} + EndGlobalSection EndGlobal From 974c75272c321f9f1d85bcf58e876f28daa63c10 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 31 Dec 2018 15:35:36 +0100 Subject: [PATCH 186/553] Don't invalidate best size unnecessarily in wxControl::SetFont() There is no reason to do it if the font didn't change at all. --- src/common/ctrlcmn.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 3b0627b903..cb1c0fcf41 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -118,8 +118,12 @@ void wxControlBase::InitCommandEvent(wxCommandEvent& event) const bool wxControlBase::SetFont(const wxFont& font) { + if ( !wxWindow::SetFont(font) ) + return false; + InvalidateBestSize(); - return wxWindow::SetFont(font); + + return true; } // wxControl-specific processing after processing the update event From 942362063d19830544d5bd94a94a633bd929bb21 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 31 Dec 2018 10:45:44 -0800 Subject: [PATCH 187/553] Avoid blocking paint events from long-running mouse event handlers If a mouse event handler calls Refresh(), increase the likelyhood that a paint event can be issued before the next mouse event occurs, by requesting more mouse events from the the end of the handler rather than the start. See #18314 --- src/gtk/window.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 32340aaa62..8e15376cff 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1815,19 +1815,6 @@ gtk_window_motion_notify_callback( GtkWidget * WXUNUSED(widget), wxCOMMON_CALLBACK_PROLOGUE(gdk_event, win); - if (gdk_event->is_hint) - { - int x = 0; - int y = 0; -#ifdef __WXGTK3__ - gdk_window_get_device_position(gdk_event->window, gdk_event->device, &x, &y, NULL); -#else - gdk_window_get_pointer(gdk_event->window, &x, &y, NULL); -#endif - gdk_event->x = x; - gdk_event->y = y; - } - g_lastMouseEvent = (GdkEvent*) gdk_event; wxMouseEvent event( wxEVT_MOTION ); @@ -1875,6 +1862,20 @@ gtk_window_motion_notify_callback( GtkWidget * WXUNUSED(widget), g_lastMouseEvent = NULL; + // Request additional motion events. Done at the end to increase the + // chances that lower priority events requested by the handler above, such + // as painting, can be processed before the next motion event occurs. + // Otherwise a long-running handler can cause paint events to be entirely + // blocked while the mouse is moving. + if (gdk_event->is_hint) + { +#ifdef __WXGTK3__ + gdk_event_request_motions(gdk_event); +#else + gdk_window_get_pointer(gdk_event->window, NULL, NULL, NULL); +#endif + } + return ret; } From 0e0bf078884ea0683516ce8954c710daf0cdb96b Mon Sep 17 00:00:00 2001 From: PB Date: Tue, 1 Jan 2019 10:25:17 +0100 Subject: [PATCH 188/553] Fix broken URL in wxICON_QUESTION documentation The content on MSDN has moved, so the URL needs to be updated. Closes https://github.com/wxWidgets/wxWidgets/pull/1107 --- interface/wx/msgdlg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/msgdlg.h b/interface/wx/msgdlg.h index 5eba416fee..7297ba65a1 100644 --- a/interface/wx/msgdlg.h +++ b/interface/wx/msgdlg.h @@ -62,7 +62,7 @@ const char wxMessageBoxCaptionStr[] = "Message"; with @c wxYES_NO so it's usually unnecessary to specify it explicitly. This style is not supported for message dialogs under wxMSW when a task dialog is used to implement them (i.e. when running under Windows Vista - or later) because Microsoft + or later) because Microsoft guidelines indicate that no icon should be used for routine confirmations. If it is specified, no icon will be displayed. @style{wxICON_INFORMATION} From 2a9462a260cd44d1ad748bb4ca9c4cba7f3a68d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Wed, 2 Jan 2019 03:09:00 +0200 Subject: [PATCH 189/553] Honor text alignment for spin controls in wxQt Add support for wxALIGN_CENTRE_HORIZONTAL and wxALIGN_RIGHT flags. Closes https://github.com/wxWidgets/wxWidgets/pull/1108 --- src/qt/spinctrl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index e7cdeddff7..60df847a50 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -40,6 +40,11 @@ bool wxSpinCtrlQt< T, Widget >::Create( wxWindow *parent, wxWindowID id, if ( style & wxSP_WRAP ) m_qtSpinBox->setWrapping(true); + if ( style & wxALIGN_CENTRE_HORIZONTAL ) + m_qtSpinBox->setAlignment(Qt::AlignHCenter); + else if ( style & wxALIGN_RIGHT ) + m_qtSpinBox->setAlignment(Qt::AlignRight); + m_qtSpinBox->setAccelerated(true); // to match gtk behavior SetRange( min, max ); From 155a19a1a2105626d53b471803d6581f9ba7df30 Mon Sep 17 00:00:00 2001 From: chris2oph Date: Wed, 19 Dec 2018 14:16:20 +0000 Subject: [PATCH 190/553] Improve checks for dates range in wxQt wxCalendarCtrl Account for the minimum and maximum dates supported by QDatePicker, both in the code and in the test suite, which shouldn't rely on not having any range restrictions in wxQt. Closes https://github.com/wxWidgets/wxWidgets/pull/1088 --- src/qt/calctrl.cpp | 23 ++++++++++++++++++----- tests/controls/datepickerctrltest.cpp | 5 +++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/qt/calctrl.cpp b/src/qt/calctrl.cpp index cc051c09dc..b79fc84745 100644 --- a/src/qt/calctrl.cpp +++ b/src/qt/calctrl.cpp @@ -136,6 +136,10 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& date) if ( !m_qtCalendar ) return false; + if ( wxQtConvertDate( date ) > m_qtCalendar->maximumDate() || + wxQtConvertDate( date ) < m_qtCalendar->minimumDate() ) + return false; + m_qtCalendar->blockSignals(true); m_qtCalendar->setSelectedDate(wxQtConvertDate(date)); m_qtCalendar->blockSignals(false); @@ -171,12 +175,21 @@ bool wxCalendarCtrl::GetDateRange(wxDateTime *lowerdate, if ( !m_qtCalendar ) return false; - if (lowerdate) - *lowerdate = wxQtConvertDate(m_qtCalendar->minimumDate()); - if (upperdate) - *upperdate = wxQtConvertDate(m_qtCalendar->maximumDate()); + bool status = false; - return true; + if ( lowerdate ) + { + *lowerdate = wxQtConvertDate(m_qtCalendar->minimumDate()); + status = true; + } + + if ( upperdate ) + { + *upperdate = wxQtConvertDate(m_qtCalendar->maximumDate()); + status = true; + } + + return status; } // Copied from wxMSW diff --git a/tests/controls/datepickerctrltest.cpp b/tests/controls/datepickerctrltest.cpp index 403e18ac01..2c1bc0a760 100644 --- a/tests/controls/datepickerctrltest.cpp +++ b/tests/controls/datepickerctrltest.cpp @@ -85,8 +85,13 @@ void DatePickerCtrlTestCase::Range() // minimum as it doesn't support dates before 1601-01-01, hence don't rely // on GetRange() returning false. wxDateTime dtRangeStart, dtRangeEnd; + + // Default end date for QT is 31/12/7999 which is considered valid, + // therefore we should omit this assertion for QT +#ifndef __WXQT__ m_datepicker->GetRange(&dtRangeStart, &dtRangeEnd); CPPUNIT_ASSERT( !dtRangeEnd.IsValid() ); +#endif // After we set it we should be able to get it back. const wxDateTime From a29ea16ccd6f605d674c45853738d0eed75fe7a0 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 3 Jan 2019 13:26:50 +0100 Subject: [PATCH 191/553] separate non-native key handling from IsUserPane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NSOpenGLView is needed under 10.14 as a native view, but it doesn’t have its own native key handling, therefore use the same code we have for non-native custom views. --- include/wx/osx/cocoa/private.h | 1 + include/wx/osx/core/private.h | 6 ++++++ src/osx/cocoa/glcanvas.mm | 13 ++++++++++--- src/osx/cocoa/window.mm | 29 +++++++++++++++++++++++------ src/osx/window_osx.cpp | 12 +++++++++++- 5 files changed, 51 insertions(+), 10 deletions(-) diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index 18267fda31..bd4f07ff81 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -50,6 +50,7 @@ class WXDLLIMPEXP_FWD_CORE wxDialog; class WXDLLIMPEXP_CORE wxWidgetCocoaImpl : public wxWidgetImpl { public : + wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane, bool wantsUserKey ) ; wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ; wxWidgetCocoaImpl() ; ~wxWidgetCocoaImpl(); diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index af0657ce8f..ba3a9e70dd 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -216,6 +216,7 @@ protected : class WXDLLIMPEXP_CORE wxWidgetImpl : public wxObject { public : + wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane, bool wantsUserKey ); wxWidgetImpl( wxWindowMac* peer , bool isRootControl = false, bool isUserPane = false ); wxWidgetImpl(); virtual ~wxWidgetImpl(); @@ -224,8 +225,12 @@ public : bool IsRootControl() const { return m_isRootControl; } + // is a completely control that has all events handled in wx code, no built-ins bool IsUserPane() const { return m_isUserPane; } + // we are doing keyboard handling in wx code, other events might be handled natively + virtual bool HasUserKeyHandling() const { return m_wantsUserKey; } + wxWindowMac* GetWXPeer() const { return m_wxPeer; } bool IsOk() const { return GetWXWidget() != NULL; } @@ -572,6 +577,7 @@ public : protected : bool m_isRootControl; bool m_isUserPane; + bool m_wantsUserKey; wxWindowMac* m_wxPeer; bool m_needsFocusRect; bool m_needsFrame; diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index de9ff18901..74bb5a9386 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -140,6 +140,15 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, return YES; } +// for special keys + +- (void)doCommandBySelector:(SEL)aSelector +{ + wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); + if (impl) + impl->doCommandBySelector(aSelector, self, _cmd); +} + @end bool wxGLCanvas::DoCreate(wxWindow *parent, @@ -149,7 +158,6 @@ bool wxGLCanvas::DoCreate(wxWindow *parent, long style, const wxString& name) { - DontCreatePeer(); if ( !wxWindow::Create(parent, id, pos, size, style, name) ) @@ -159,13 +167,12 @@ bool wxGLCanvas::DoCreate(wxWindow *parent, NSRect r = wxOSXGetFrameForControl( this, pos , size ) ; wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r]; - wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v ); + wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v, false, false, true /* wants key events */ ); SetPeer(c); MacPostControlCreate(pos, size) ; return true; } - wxGLCanvas::~wxGLCanvas() { if ( m_glFormat ) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 45cfdd7c37..eba0c50235 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -897,7 +897,7 @@ static void SetDrawingEnabledIfFrozenRecursive(wxWidgetCocoaImpl *impl, bool ena - (BOOL) canBecomeKeyView { wxWidgetCocoaImpl* viewimpl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); - if ( viewimpl && viewimpl->IsUserPane() && viewimpl->GetWXPeer() ) + if ( viewimpl && viewimpl->HasUserKeyHandling() && viewimpl->GetWXPeer() ) return viewimpl->GetWXPeer()->AcceptsFocus(); return NO; } @@ -2101,7 +2101,7 @@ void wxCocoaGesturesImpl::TouchesEnded(NSEvent* event) void wxWidgetCocoaImpl::insertText(NSString* text, WXWidget slf, void *_cmd) { bool result = false; - if ( IsUserPane() && !m_hasEditor && [text length] > 0) + if ( HasUserKeyHandling() && !m_hasEditor && [text length] > 0) { if ( m_lastKeyDownEvent!=NULL && [text isEqualToString:[m_lastKeyDownEvent characters]]) { @@ -2190,7 +2190,7 @@ bool wxWidgetCocoaImpl::performKeyEquivalent(WX_NSEvent event, WXWidget slf, voi bool wxWidgetCocoaImpl::acceptsFirstResponder(WXWidget slf, void *_cmd) { - if ( IsUserPane() ) + if ( HasUserKeyHandling() ) return m_wxPeer->AcceptsFocus(); else { @@ -2512,8 +2512,8 @@ void wxOSXCocoaClassAddWXMethods(Class c, wxOSXSkipOverrides skipFlags) wxIMPLEMENT_DYNAMIC_CLASS(wxWidgetCocoaImpl , wxWidgetImpl); -wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane ) : - wxWidgetImpl( peer, isRootControl, isUserPane ) +wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane, bool wantsKey ) : + wxWidgetImpl( peer, isRootControl, isUserPane, wantsKey ) { Init(); m_osxView = w; @@ -2528,6 +2528,23 @@ wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRoo [m_osxView release]; } +wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane ) : +wxWidgetImpl( peer, isRootControl, isUserPane ) +{ + Init(); + m_osxView = w; + + // check if the user wants to create the control initially hidden + if ( !peer->IsShown() ) + SetVisibility(false); + + // gc aware handling + if ( m_osxView ) + CFRetain(m_osxView); + [m_osxView release]; +} + + wxWidgetCocoaImpl::wxWidgetCocoaImpl() { Init(); @@ -3658,7 +3675,7 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event) return true; } - if ( IsUserPane() && [event type] == NSKeyDown) + if ( HasUserKeyHandling() && [event type] == NSKeyDown) { // Don't fire wxEVT_KEY_DOWN here in order to allow IME to intercept // some key events. If the event is not handled by IME, either diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index be965a4890..f6b8dde4b0 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -2223,7 +2223,7 @@ void wxWindowMac::MacRepositionScrollBars() bool wxWindowMac::AcceptsFocus() const { - if ( GetPeer() == NULL || GetPeer()->IsUserPane() ) + if ( GetPeer() == NULL || GetPeer()->HasUserKeyHandling() ) return wxWindowBase::AcceptsFocus(); else return GetPeer()->CanFocus(); @@ -2742,10 +2742,20 @@ void wxWidgetImpl::RemoveAssociation(WXWidget control) wxIMPLEMENT_ABSTRACT_CLASS(wxWidgetImpl, wxObject); wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane ) +{ + Init(); + m_isRootControl = isRootControl; + m_wantsUserKey = m_isUserPane = isUserPane; + m_wxPeer = peer; + m_shouldSendEvents = true; +} + +wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane, bool wantsUserKey ) { Init(); m_isRootControl = isRootControl; m_isUserPane = isUserPane; + m_wantsUserKey = wantsUserKey; m_wxPeer = peer; m_shouldSendEvents = true; } From 5581e5079f42627e3fe7fdf787bda22c7f63ff16 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 3 Jan 2019 16:28:19 +0100 Subject: [PATCH 192/553] separate non-native mouse handling from IsUserPane NSOpenGLView is needed under 10.14 as native view, in order to reuse wx touch and mouse handling we trigger this separately from IsUserPane being true --- include/wx/osx/core/private.h | 4 ++++ src/osx/cocoa/window.mm | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index ba3a9e70dd..4b681bcb7a 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -231,6 +231,10 @@ public : // we are doing keyboard handling in wx code, other events might be handled natively virtual bool HasUserKeyHandling() const { return m_wantsUserKey; } + // we are doing mouse handling in wx code, other events might be handled natively + // right now this is always in sync with HasUserKeyHandling + virtual bool HasUserMouseHandling() const { return m_wantsUserKey; } + wxWindowMac* GetWXPeer() const { return m_wxPeer; } bool IsOk() const { return GetWXWidget() != NULL; } diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index eba0c50235..5df461d395 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -1454,7 +1454,7 @@ void wxWidgetCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd) { // for plain NSView mouse events would propagate to parents otherwise // scrollwheel events have to be propagated if not handled in all cases - if (!IsUserPane() || [event type] == NSScrollWheel ) + if (!HasUserMouseHandling() || [event type] == NSScrollWheel ) { wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; superimpl(slf, (SEL)_cmd, event); @@ -3542,7 +3542,7 @@ bool wxWidgetCocoaImpl::EnableTouchEvents(int eventsMask) #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10 if ( wxPlatformInfo::Get().CheckOSVersion(10, 10) ) { - if ( IsUserPane() ) + if ( HasUserMouseHandling() ) { if ( eventsMask == wxTOUCH_NONE ) { From 142234d009dff11802953847c1ba0a2ca6c3ed16 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 3 Jan 2019 17:04:13 +0100 Subject: [PATCH 193/553] macOS fix otherwise CreateNewDocument is called twice --- samples/docview/docview.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/docview/docview.cpp b/samples/docview/docview.cpp index 3785a06235..74409d313d 100644 --- a/samples/docview/docview.cpp +++ b/samples/docview/docview.cpp @@ -287,7 +287,10 @@ bool MyApp::OnInit() if ( m_filesFromCmdLine.empty() ) { + // on macOS the dialog will be shown by MacNewFile +#ifndef __WXMAC__ docManager->CreateNewDocument(); +#endif } else // we have files to open on command line { From 66a9e55f3b1e94ba69e75508e8a7c6bdb0ea7151 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 3 Jan 2019 17:49:20 +0100 Subject: [PATCH 194/553] macOS 10.14 adaption for launch-opening files The previous way to stop the event loop for wx-like OnInit processing was too early for 10.14, opening files during launch was not possible, see #18305 --- src/osx/cocoa/utils.mm | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index d41809fd1a..0efbf083ab 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -68,6 +68,7 @@ void wxBell() - (void)applicationDidFinishLaunching:(NSNotification *)notification { + [NSApp stop:nil]; wxTheApp->OSXOnDidFinishLaunching(); } @@ -325,7 +326,6 @@ void wxBell() // here we subclass NSApplication, for the purpose of being able to override sendEvent. @interface wxNSApplication : NSApplication { - BOOL firstPass; } - (id)init; @@ -340,7 +340,7 @@ void wxBell() { if ( self = [super init] ) { - firstPass = YES; + // further init } return self; } @@ -370,14 +370,7 @@ void wxBell() if ([anEvent type] == NSKeyUp && ([anEvent modifierFlags] & NSCommandKeyMask)) [[self keyWindow] sendEvent:anEvent]; else - [super sendEvent:anEvent]; - - if ( firstPass ) - { - [NSApp stop:nil]; - firstPass = NO; - return; - } + [super sendEvent:anEvent]; } @end @@ -416,12 +409,6 @@ bool wxApp::DoInitGui() appcontroller = OSXCreateAppController(); [[NSApplication sharedApplication] setDelegate:(id )appcontroller]; [NSColor setIgnoresAlpha:NO]; - - // calling finishLaunching so early before running the loop seems to trigger some 'MenuManager compatibility' which leads - // to the duplication of menus under 10.5 and a warning under 10.6 -#if 0 - [NSApp finishLaunching]; -#endif } gNSLayoutManager = [[NSLayoutManager alloc] init]; From e5e6ee7e776c8d0d4e739974152d7af2c147c7ee Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 3 Jan 2019 20:02:24 +0100 Subject: [PATCH 195/553] macOS wxWidgetImpl constructor with flags replacing bools with int flag --- include/wx/osx/cocoa/private.h | 3 +-- include/wx/osx/core/private.h | 16 ++++++++++++---- include/wx/osx/iphone/private.h | 2 +- src/osx/cocoa/glcanvas.mm | 2 +- src/osx/cocoa/window.mm | 26 +++++--------------------- src/osx/iphone/nonownedwnd.mm | 2 +- src/osx/iphone/window.mm | 6 +++--- src/osx/window_osx.cpp | 12 ++++++++---- 8 files changed, 32 insertions(+), 37 deletions(-) diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index bd4f07ff81..a28dd242d6 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -50,8 +50,7 @@ class WXDLLIMPEXP_FWD_CORE wxDialog; class WXDLLIMPEXP_CORE wxWidgetCocoaImpl : public wxWidgetImpl { public : - wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane, bool wantsUserKey ) ; - wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ; + wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, int flags = 0 ) ; wxWidgetCocoaImpl() ; ~wxWidgetCocoaImpl(); diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index 4b681bcb7a..9ada10b975 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -216,8 +216,16 @@ protected : class WXDLLIMPEXP_CORE wxWidgetImpl : public wxObject { public : + enum WidgetFlags + { + Widget_IsRoot = 0x0001, + Widget_IsUserPane = 0x0002, + Widget_UserKeyEvents = 0x0004, + Widget_UserMouseEvents = 0x0008, + }; + wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane, bool wantsUserKey ); - wxWidgetImpl( wxWindowMac* peer , bool isRootControl = false, bool isUserPane = false ); + wxWidgetImpl( wxWindowMac* peer , int flags = 0 ); wxWidgetImpl(); virtual ~wxWidgetImpl(); @@ -225,15 +233,14 @@ public : bool IsRootControl() const { return m_isRootControl; } - // is a completely control that has all events handled in wx code, no built-ins + // is a custom control that has all events handled in wx code, no built-ins bool IsUserPane() const { return m_isUserPane; } // we are doing keyboard handling in wx code, other events might be handled natively virtual bool HasUserKeyHandling() const { return m_wantsUserKey; } // we are doing mouse handling in wx code, other events might be handled natively - // right now this is always in sync with HasUserKeyHandling - virtual bool HasUserMouseHandling() const { return m_wantsUserKey; } + virtual bool HasUserMouseHandling() const { return m_wantsUserMouse; } wxWindowMac* GetWXPeer() const { return m_wxPeer; } @@ -582,6 +589,7 @@ protected : bool m_isRootControl; bool m_isUserPane; bool m_wantsUserKey; + bool m_wantsUserMouse; wxWindowMac* m_wxPeer; bool m_needsFocusRect; bool m_needsFrame; diff --git a/include/wx/osx/iphone/private.h b/include/wx/osx/iphone/private.h index 484e7525ee..557bb68308 100644 --- a/include/wx/osx/iphone/private.h +++ b/include/wx/osx/iphone/private.h @@ -37,7 +37,7 @@ wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxSt class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl { public : - wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ; + wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags = 0 ) ; wxWidgetIPhoneImpl() ; ~wxWidgetIPhoneImpl(); diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index 74bb5a9386..59c572e73b 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -167,7 +167,7 @@ bool wxGLCanvas::DoCreate(wxWindow *parent, NSRect r = wxOSXGetFrameForControl( this, pos , size ) ; wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r]; - wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v, false, false, true /* wants key events */ ); + wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v, wxWidgetImpl::Widget_UserKeyEvents | wxWidgetImpl::Widget_UserMouseEvents ); SetPeer(c); MacPostControlCreate(pos, size) ; return true; diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 5df461d395..4b356e720b 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -2512,24 +2512,8 @@ void wxOSXCocoaClassAddWXMethods(Class c, wxOSXSkipOverrides skipFlags) wxIMPLEMENT_DYNAMIC_CLASS(wxWidgetCocoaImpl , wxWidgetImpl); -wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane, bool wantsKey ) : - wxWidgetImpl( peer, isRootControl, isUserPane, wantsKey ) -{ - Init(); - m_osxView = w; - - // check if the user wants to create the control initially hidden - if ( !peer->IsShown() ) - SetVisibility(false); - - // gc aware handling - if ( m_osxView ) - CFRetain(m_osxView); - [m_osxView release]; -} - -wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane ) : -wxWidgetImpl( peer, isRootControl, isUserPane ) +wxWidgetCocoaImpl::wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, int flags ) : +wxWidgetImpl( peer, flags ) { Init(); m_osxView = w; @@ -3834,7 +3818,7 @@ wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WX NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSView* v = [[wxNSView alloc] initWithFrame:r]; - wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v, false, true ); + wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v, Widget_IsUserPane ); return c; } @@ -3846,7 +3830,7 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) if ( now->IsNativeWindowWrapper() ) { NSView* cv = [tlw contentView]; - c = new wxWidgetCocoaImpl( now, cv, true ); + c = new wxWidgetCocoaImpl( now, cv, Widget_IsRoot ); if ( cv != nil ) { // increase ref count, because the impl destructor will decrement it again @@ -3858,7 +3842,7 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) else { wxNSView* v = [[wxNSView alloc] initWithFrame:[[tlw contentView] frame]]; - c = new wxWidgetCocoaImpl( now, v, true ); + c = new wxWidgetCocoaImpl( now, v, Widget_IsRoot ); c->InstallEventHandler(); [tlw setContentView:v]; } diff --git a/src/osx/iphone/nonownedwnd.mm b/src/osx/iphone/nonownedwnd.mm index 2da94aba87..2b15df7144 100644 --- a/src/osx/iphone/nonownedwnd.mm +++ b/src/osx/iphone/nonownedwnd.mm @@ -354,7 +354,7 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) [contentview setController:controller]; [contentview setHidden:YES]; - wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl( now, contentview, true ); + wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl( now, contentview, Widget_IsRoot ); impl->InstallEventHandler(); if ([toplevelwindow respondsToSelector:@selector(setRootViewController:)]) diff --git a/src/osx/iphone/window.mm b/src/osx/iphone/window.mm index d29beb7035..607c92f839 100644 --- a/src/osx/iphone/window.mm +++ b/src/osx/iphone/window.mm @@ -334,8 +334,8 @@ void wxOSXIPhoneClassAddWXMethods(Class c) wxIMPLEMENT_DYNAMIC_CLASS(wxWidgetIPhoneImpl , wxWidgetImpl); -wxWidgetIPhoneImpl::wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl, bool isUserPane ) : - wxWidgetImpl( peer, isRootControl, isUserPane ), m_osxView(w) +wxWidgetIPhoneImpl::wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, int flags ) : + wxWidgetImpl( peer, flags ), m_osxView(w) { } @@ -821,7 +821,7 @@ wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WX sv.clipsToBounds = YES; sv.contentMode = UIViewContentModeRedraw; sv.clearsContextBeforeDrawing = NO; - wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v, false, true ); + wxWidgetIPhoneImpl* c = new wxWidgetIPhoneImpl( wxpeer, v, Widget_IsUserPane ); return c; } diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index f6b8dde4b0..5006e35d91 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -2741,11 +2741,13 @@ void wxWidgetImpl::RemoveAssociation(WXWidget control) wxIMPLEMENT_ABSTRACT_CLASS(wxWidgetImpl, wxObject); -wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane ) +wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , int flags ) { - Init(); - m_isRootControl = isRootControl; - m_wantsUserKey = m_isUserPane = isUserPane; + Init(); + m_isRootControl = flags & Widget_IsRoot; + m_isUserPane = flags & Widget_IsUserPane; + m_wantsUserKey = m_isUserPane || (flags & Widget_UserKeyEvents); + m_wantsUserMouse = m_isUserPane || (flags & Widget_UserMouseEvents); m_wxPeer = peer; m_shouldSendEvents = true; } @@ -2773,6 +2775,8 @@ wxWidgetImpl::~wxWidgetImpl() void wxWidgetImpl::Init() { m_isRootControl = false; + m_wantsUserKey = false; + m_wantsUserMouse = false; m_wxPeer = NULL; m_needsFocusRect = false; m_needsFrame = true; From 61c413928abb331d0192d7eed43acd23b08c7138 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 3 Jan 2019 20:04:50 +0100 Subject: [PATCH 196/553] iOS fixes --- include/wx/defs.h | 2 +- src/osx/iphone/utils.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 27b175f910..2af9664744 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2718,6 +2718,7 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSArray); DECLARE_WXCOCOA_OBJC_CLASS(NSData); DECLARE_WXCOCOA_OBJC_CLASS(NSMutableArray); DECLARE_WXCOCOA_OBJC_CLASS(NSString); +DECLARE_WXCOCOA_OBJC_CLASS(NSObject); #if wxOSX_USE_COCOA @@ -2739,7 +2740,6 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSMenu); DECLARE_WXCOCOA_OBJC_CLASS(NSMenuExtra); DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem); DECLARE_WXCOCOA_OBJC_CLASS(NSNotification); -DECLARE_WXCOCOA_OBJC_CLASS(NSObject); DECLARE_WXCOCOA_OBJC_CLASS(NSPanel); DECLARE_WXCOCOA_OBJC_CLASS(NSResponder); DECLARE_WXCOCOA_OBJC_CLASS(NSScrollView); diff --git a/src/osx/iphone/utils.mm b/src/osx/iphone/utils.mm index af0239e939..3863f68d97 100644 --- a/src/osx/iphone/utils.mm +++ b/src/osx/iphone/utils.mm @@ -257,7 +257,7 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const CGContextTranslateCTM( context, -subrect->x, -subrect->y ) ; UIGraphicsPushContext(context); - [ (NSView*) m_window->GetHandle() drawRect:CGRectMake(left, top, width, height ) ]; + [ (UIView*) m_window->GetHandle() drawRect:CGRectMake(left, top, width, height ) ]; UIGraphicsPopContext(); CGContextRestoreGState(context); From e287344b7829c6fad2e002f597813498392895bf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 3 Jan 2019 23:04:15 +0100 Subject: [PATCH 197/553] Create wxFSFile with correct MIME type in wxInternetFSHandler Using the entire contents of "Content-Type" header as the MIME type is wrong, the header may have optional parameters in it as well. --- src/common/fs_inet.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp index 6f3ff4fc56..23f23fd010 100644 --- a/src/common/fs_inet.cpp +++ b/src/common/fs_inet.cpp @@ -117,9 +117,15 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), } delete s; + // Content-Type header, as defined by the RFC 2045, has the form of + // "type/subtype" optionally followed by (multiple) "; parameter" + // and we need just the MIME type here. + wxString mimetype = content.BeforeFirst(';'); + mimetype.Trim(); + return new wxFSFile(new wxTemporaryFileInputStream(tmpfile), right, - content, + mimetype, GetAnchor(location) #if wxUSE_DATETIME , wxDateTime::Now() From 9f270c05ff3f1484de998c8d9ef408b6dbf82c4c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 3 Jan 2019 23:15:54 +0100 Subject: [PATCH 198/553] Micro optimization in wxInternetFSHandler::OpenFile() Avoid copying the content type string unnecessarily and avoid even calling GetContentType() in the first place in case of an error. --- src/common/fs_inet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp index 23f23fd010..b32aa26950 100644 --- a/src/common/fs_inet.cpp +++ b/src/common/fs_inet.cpp @@ -105,7 +105,6 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), if (url.GetError() == wxURL_NOERR) { wxInputStream *s = url.GetInputStream(); - wxString content = url.GetProtocol().GetContentType(); if (s) { wxString tmpfile = @@ -120,6 +119,7 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), // Content-Type header, as defined by the RFC 2045, has the form of // "type/subtype" optionally followed by (multiple) "; parameter" // and we need just the MIME type here. + const wxString& content = url.GetProtocol().GetContentType(); wxString mimetype = content.BeforeFirst(';'); mimetype.Trim(); From 2cf0fcb4fd1e09f89f46d4a7ea256b1a80014df8 Mon Sep 17 00:00:00 2001 From: dghart Date: Thu, 3 Jan 2019 16:59:31 +0000 Subject: [PATCH 199/553] Allow setting wxTimePickerCtrlGeneric from numpad keys too Previously the generic wxTimePickerCtrl ignored numerical numpad keypresses. --- src/generic/timectrlg.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/generic/timectrlg.cpp b/src/generic/timectrlg.cpp index efa0af028d..bdad97617e 100644 --- a/src/generic/timectrlg.cpp +++ b/src/generic/timectrlg.cpp @@ -211,6 +211,21 @@ private: AppendDigitToCurrentField(key - '0'); } break; + case WXK_NUMPAD0: + case WXK_NUMPAD1: + case WXK_NUMPAD2: + case WXK_NUMPAD3: + case WXK_NUMPAD4: + case WXK_NUMPAD5: + case WXK_NUMPAD6: + case WXK_NUMPAD7: + case WXK_NUMPAD8: + case WXK_NUMPAD9: + if ( m_currentField != Field_AMPM ) + { + AppendDigitToCurrentField(key - WXK_NUMPAD0); + } + break; case 'A': case 'P': From 5885b2f142b2e8be75b42ee1f1d8722930a0cd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Wed, 26 Dec 2018 22:12:01 +0200 Subject: [PATCH 200/553] Test that selecting 'single' radio button does not reset others Add a unit test for the expected behaviour. Closes https://github.com/wxWidgets/wxWidgets/pull/1102 --- tests/controls/radiobuttontest.cpp | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/controls/radiobuttontest.cpp b/tests/controls/radiobuttontest.cpp index 0d687a7918..649775b294 100644 --- a/tests/controls/radiobuttontest.cpp +++ b/tests/controls/radiobuttontest.cpp @@ -35,11 +35,13 @@ private: WXUISIM_TEST( Click ); CPPUNIT_TEST( Value ); CPPUNIT_TEST( Group ); + CPPUNIT_TEST( Single ); CPPUNIT_TEST_SUITE_END(); void Click(); void Value(); void Group(); + void Single(); wxRadioButton* m_radio; @@ -150,4 +152,36 @@ void RadioButtonTestCase::Group() wxDELETE(g2radio1); } +void RadioButtonTestCase::Single() +{ + //Create a group of 2 buttons, having second button selected + wxScopedPtr gradio0(new wxRadioButton(wxTheApp->GetTopWindow(), + wxID_ANY, "wxRadioButton", + wxDefaultPosition, + wxDefaultSize, wxRB_GROUP)); + + wxScopedPtr gradio1(new wxRadioButton(wxTheApp->GetTopWindow(), + wxID_ANY, "wxRadioButton")); + + gradio1->SetValue(true); + + //Create a "single" button (by default it will not be selected) + wxScopedPtr sradio(new wxRadioButton(wxTheApp->GetTopWindow(), + wxID_ANY, "wxRadioButton", + wxDefaultPosition, + wxDefaultSize, wxRB_SINGLE)); + + //Create a non-grouped button and select it + wxScopedPtr ngradio(new wxRadioButton(wxTheApp->GetTopWindow(), + wxID_ANY, "wxRadioButton")); + + ngradio->SetValue(true); + + //Select the "single" button + sradio->SetValue(true); + + CHECK(gradio1->GetValue()); + CHECK(ngradio->GetValue()); +} + #endif //wxUSE_RADIOBTN From 22c18a107efdbff65b9dcc67f2f33fa5f2c67662 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Dec 2018 23:39:10 +0100 Subject: [PATCH 201/553] Invalidate wxDisplay cache under MSW when the displays change The cache added in 990c8bfd733577885baad419025fc0580557ba8c was not invalidated properly, meaning that wrong information was returned when displays were [dis]connected after the application startup. Fix this at least for MSW by invalidating the cache on receiving WM_DISPLAYCHANGE (which means that sometimes we will do it unnecessarily, as the change in resolution of an existing display doesn't require cache invalidation, but this shouldn't be a big problem in practice as the speed with which the user can change the display resolution is not very high). Closes https://github.com/wxWidgets/wxWidgets/pull/1090 --- include/wx/display.h | 5 +++++ include/wx/private/display.h | 8 +++++++- src/common/dpycmn.cpp | 9 ++++++++- src/msw/window.cpp | 5 ++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/include/wx/display.h b/include/wx/display.h index 1c3a67298a..f05c0c8451 100644 --- a/include/wx/display.h +++ b/include/wx/display.h @@ -115,6 +115,11 @@ public: void ResetMode() { (void)ChangeMode(); } #endif // wxUSE_DISPLAY + // If the implementation caches any information about the displays, calling + // this function clears it -- this should be done e.g. after a display + // [dis]connection. + static void InvalidateCache(); + private: // returns the factory used to implement our static methods and create new // displays diff --git a/include/wx/private/display.h b/include/wx/private/display.h index 9a97a75f9c..15668eaaf8 100644 --- a/include/wx/private/display.h +++ b/include/wx/private/display.h @@ -22,7 +22,7 @@ class wxDisplayFactory { public: wxDisplayFactory() { } - virtual ~wxDisplayFactory(); + virtual ~wxDisplayFactory() { ClearImpls(); } // Create the display if necessary using CreateDisplay(), otherwise just // get it from cache. @@ -48,6 +48,9 @@ public: // the window pointer must not be NULL (i.e. caller should check it) virtual int GetFromWindow(const wxWindow *window); + // Trigger recreation of wxDisplayImpl when they're needed the next time. + void InvalidateCache() { ClearImpls(); } + protected: // create a new display object // @@ -55,6 +58,9 @@ protected: virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0; private: + // Delete all the elements of m_impls vector and clear it. + void ClearImpls(); + // On-demand populated vector of wxDisplayImpl objects. wxVector m_impls; diff --git a/src/common/dpycmn.cpp b/src/common/dpycmn.cpp index 6171335b1a..85262ae042 100644 --- a/src/common/dpycmn.cpp +++ b/src/common/dpycmn.cpp @@ -113,6 +113,11 @@ wxDisplay::wxDisplay(const wxWindow* window) return Factory().GetFromWindow(window); } +/* static */ void wxDisplay::InvalidateCache() +{ + Factory().InvalidateCache(); +} + // ---------------------------------------------------------------------------- // functions forwarded to wxDisplayImpl // ---------------------------------------------------------------------------- @@ -229,13 +234,15 @@ wxSize wxDisplayImpl::GetPPI() const // wxDisplayFactory implementation // ============================================================================ -wxDisplayFactory::~wxDisplayFactory() +void wxDisplayFactory::ClearImpls() { for ( size_t n = 0; n < m_impls.size(); ++n ) { // It can be null, that's ok. delete m_impls[n]; } + + m_impls.clear(); } int wxDisplayFactory::GetFromWindow(const wxWindow *window) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 609f6e8c19..652910c9af 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -58,8 +58,9 @@ #include "wx/ownerdrw.h" #endif -#include "wx/hashmap.h" +#include "wx/display.h" #include "wx/evtloop.h" +#include "wx/hashmap.h" #include "wx/popupwin.h" #include "wx/power.h" #include "wx/scopeguard.h" @@ -4692,6 +4693,8 @@ bool wxWindowMSW::HandleSysColorChange() bool wxWindowMSW::HandleDisplayChange() { + wxDisplay::InvalidateCache(); + wxDisplayChangedEvent event; event.SetEventObject(this); From 659ab78c6d106b6966a5f3f7d202690ad4065a32 Mon Sep 17 00:00:00 2001 From: Pavel Kalugin Date: Thu, 6 Sep 2018 05:49:58 +0300 Subject: [PATCH 202/553] Add support for editing dates (without time) to wxGrid Add wxGridCellDateRenderer and wxGridCellDateRenderer which can be used for the grid cells containing only dates, without times. Also add wxGrid::SetColFormatDate() convenience function. Refactor wxGridCellDateTimeRenderer slightly to reuse its code. Closes https://github.com/wxWidgets/wxWidgets/pull/1101 --- docs/changes.txt | 1 + docs/doxygen/overviews/grid.h | 2 + include/wx/generic/grid.h | 5 + include/wx/generic/gridctrl.h | 39 ++++++-- include/wx/generic/grideditors.h | 35 +++++++ interface/wx/grid.h | 114 +++++++++++++++++++--- samples/grid/griddemo.cpp | 10 ++ src/generic/grid.cpp | 19 ++++ src/generic/gridctrl.cpp | 79 ++++++++++------ src/generic/grideditors.cpp | 158 +++++++++++++++++++++++++++++++ 10 files changed, 416 insertions(+), 46 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 0faf30d057..956ba8986c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -121,6 +121,7 @@ All (GUI): - Fix wxInfoBar close button size in high DPI (Stefan Ziegler). - Make disabling the window before creating it actually work. - Implement wxAuiNotebook::GetBestSize() (Sebastian Walderich). +- Add support for editing dates (without time) to wxGrid (Pavel Kalugin). - Allow changing tooltip text for button allowing to enter a new string in wxPGArrayEditorDialog. - Fix wxPropertyGrid issues with horizontal scrolling. diff --git a/docs/doxygen/overviews/grid.h b/docs/doxygen/overviews/grid.h index b69ee031b7..bf3a5c504e 100644 --- a/docs/doxygen/overviews/grid.h +++ b/docs/doxygen/overviews/grid.h @@ -84,6 +84,7 @@ Here is a list of classes related to wxGrid: number. @li wxGridCellBoolRenderer: Renderer showing the cell as checked or unchecked box. +@li wxGridCellDateRenderer: Renderer showing the cell as date. @li wxGridCellEditor: Base class for objects used to edit the cell value. @li wxGridCellStringEditor: Editor for cells containing text strings. @li wxGridCellNumberEditor: Editor for cells containing integer numbers. @@ -91,6 +92,7 @@ Here is a list of classes related to wxGrid: @li wxGridCellBoolEditor: Editor for boolean-valued cells. @li wxGridCellChoiceEditor: Editor allowing to choose one of the predefined strings (and possibly enter new one). +@li wxGridCellDateEditor: Editor for cells containing dates without time component. @li wxGridEvent: The event sent by most of wxGrid actions. @li wxGridSizeEvent: The special event sent when a grid column or row is resized. diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 84e283154d..2e1fcb89a6 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -48,6 +48,7 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxGridNameStr[]; #define wxGRID_VALUE_NUMBER wxT("long") #define wxGRID_VALUE_FLOAT wxT("double") #define wxGRID_VALUE_CHOICE wxT("choice") +#define wxGRID_VALUE_DATE wxT("date") #define wxGRID_VALUE_TEXT wxGRID_VALUE_STRING #define wxGRID_VALUE_LONG wxGRID_VALUE_NUMBER @@ -99,6 +100,9 @@ class WXDLLIMPEXP_FWD_CORE wxTextCtrl; #if wxUSE_SPINCTRL class WXDLLIMPEXP_FWD_CORE wxSpinCtrl; #endif +#if wxUSE_DATEPICKCTRL +class WXDLLIMPEXP_FWD_CORE wxDatePickerCtrl; +#endif class wxGridFixedIndicesSet; @@ -1354,6 +1358,7 @@ public: void SetColFormatBool(int col); void SetColFormatNumber(int col); void SetColFormatFloat(int col, int width = -1, int precision = -1); + void SetColFormatDate(int col, const wxString& format = wxString()); void SetColFormatCustom(int col, const wxString& typeName); // ------ row and col formatting diff --git a/include/wx/generic/gridctrl.h b/include/wx/generic/gridctrl.h index 044f565382..28249fae88 100644 --- a/include/wx/generic/gridctrl.h +++ b/include/wx/generic/gridctrl.h @@ -153,12 +153,17 @@ private: #include "wx/datetime.h" -// the default renderer for the cells containing times and dates -class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer +// renderer for the cells containing dates only, without time component +class WXDLLIMPEXP_ADV wxGridCellDateRenderer : public wxGridCellStringRenderer { public: - wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat, - const wxString& informat = wxDefaultDateTimeFormat); + explicit wxGridCellDateRenderer(const wxString& outformat = wxString()); + + wxGridCellDateRenderer(const wxGridCellDateRenderer& other) + : m_oformat(other.m_oformat), + m_tz(other.m_tz) + { + } // draw the string right aligned virtual void Draw(wxGrid& grid, @@ -180,11 +185,33 @@ public: protected: wxString GetString(const wxGrid& grid, int row, int col); + virtual bool Parse(const wxString& text, wxDateTime& result); + + wxString m_oformat; + wxDateTime::TimeZone m_tz; +}; + +// the default renderer for the cells containing times and dates +class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellDateRenderer +{ +public: + wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat, + const wxString& informat = wxDefaultDateTimeFormat); + + wxGridCellDateTimeRenderer(const wxGridCellDateTimeRenderer& other) + : wxGridCellDateRenderer(other), + m_iformat(other.m_iformat), + m_dateDef(other.m_dateDef) + { + } + + virtual wxGridCellRenderer *Clone() const wxOVERRIDE; + +protected: + virtual bool Parse(const wxString& text, wxDateTime& result) wxOVERRIDE; wxString m_iformat; - wxString m_oformat; wxDateTime m_dateDef; - wxDateTime::TimeZone m_tz; }; #endif // wxUSE_DATETIME diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index c1b8206caa..db5dd425db 100644 --- a/include/wx/generic/grideditors.h +++ b/include/wx/generic/grideditors.h @@ -373,6 +373,41 @@ public: wxDECLARE_NO_COPY_CLASS(wxGridCellAutoWrapStringEditor); }; +#if wxUSE_DATEPICKCTRL + +class WXDLLIMPEXP_ADV wxGridCellDateEditor : public wxGridCellEditor +{ +public: + wxGridCellDateEditor() { } + + virtual void Create(wxWindow* parent, + wxWindowID id, + wxEvtHandler* evtHandler) wxOVERRIDE; + + virtual void SetSize(const wxRect& rect) wxOVERRIDE; + + virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE; + virtual bool EndEdit(int row, int col, const wxGrid* grid, + const wxString& oldval, wxString *newval) wxOVERRIDE; + virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE; + + virtual void Reset() wxOVERRIDE; + + virtual wxGridCellEditor *Clone() const wxOVERRIDE; + + virtual wxString GetValue() const wxOVERRIDE; + +protected: + wxDatePickerCtrl* DatePicker() const; + +private: + wxDateTime m_value; + + wxDECLARE_NO_COPY_CLASS(wxGridCellDateEditor); +}; + +#endif // wxUSE_DATEPICKCTRL + #endif // wxUSE_GRID #endif // _WX_GENERIC_GRID_EDITORS_H_ diff --git a/interface/wx/grid.h b/interface/wx/grid.h index 0c3eef3d24..7bfe1e9426 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -142,6 +142,50 @@ public: wxGridCellBoolRenderer(); }; +/** + @class wxGridCellDateRenderer + + This class may be used to show a date, without time, in a cell. + + See @ref wxGridCellDateTimeRenderer for a date/time version. + wxDateTime::Format() is used internally to render the date + representation. wxDateTime::ParseDate() is used to parse the string + data entered in the cell. + + @library{wxcore} + @category{grid} + + @see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer, + wxGridCellBoolRenderer, wxGridCellEnumRenderer, + wxGridCellFloatRenderer, wxGridCellNumberRenderer, + wxGridCellStringRenderer, wxGridCellDateTimeRenderer + + @since 3.1.3 +*/ +class wxGridCellDateRenderer : public wxGridCellStringRenderer +{ +public: + /** + Date renderer constructor. + + @param outformat + strftime()-like format string used to render the output date. + By default (or if provided format string is empty) localized + date representation ("%x") is used. + */ + wxGridCellDateRenderer(const wxString& outformat = wxString()); + + + /** + Sets the strftime()-like format string which will be used to render + the date. + + @param params + strftime()-like format string used to render the date. + */ + virtual void SetParameters(const wxString& params); +}; + /** @class wxGridCellDateTimeRenderer @@ -155,9 +199,9 @@ public: @see wxGridCellRenderer, wxGridCellAutoWrapStringRenderer, wxGridCellBoolRenderer, wxGridCellEnumRenderer, wxGridCellFloatRenderer, wxGridCellNumberRenderer, - wxGridCellStringRenderer + wxGridCellStringRenderer, wxGridCellDateRenderer */ -class wxGridCellDateTimeRenderer : public wxGridCellStringRenderer +class wxGridCellDateTimeRenderer : public wxGridCellDateRenderer { public: /** @@ -384,7 +428,7 @@ public: @see wxGridCellAutoWrapStringEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellEnumEditor, wxGridCellFloatEditor, wxGridCellNumberEditor, - wxGridCellTextEditor + wxGridCellTextEditor, wxGridCellDateEditor */ class wxGridCellEditor : public wxClientDataContainer, public wxRefCounter { @@ -532,7 +576,8 @@ protected: @see wxGridCellEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellEnumEditor, wxGridCellFloatEditor, - wxGridCellNumberEditor, wxGridCellTextEditor + wxGridCellNumberEditor, wxGridCellTextEditor, + wxGridCellDateEditor */ class wxGridCellAutoWrapStringEditor : public wxGridCellTextEditor { @@ -551,7 +596,7 @@ public: @see wxGridCellEditor, wxGridCellAutoWrapStringEditor, wxGridCellChoiceEditor, wxGridCellEnumEditor, wxGridCellFloatEditor, wxGridCellNumberEditor, - wxGridCellTextEditor + wxGridCellTextEditor, wxGridCellDateEditor */ class wxGridCellBoolEditor : public wxGridCellEditor { @@ -590,7 +635,7 @@ public: @see wxGridCellEditor, wxGridCellAutoWrapStringEditor, wxGridCellBoolEditor, wxGridCellEnumEditor, wxGridCellFloatEditor, wxGridCellNumberEditor, - wxGridCellTextEditor + wxGridCellTextEditor, wxGridCellDateEditor */ class wxGridCellChoiceEditor : public wxGridCellEditor { @@ -641,7 +686,7 @@ public: @see wxGridCellEditor, wxGridCellAutoWrapStringEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellTextEditor, wxGridCellFloatEditor, - wxGridCellNumberEditor + wxGridCellNumberEditor, wxGridCellDateEditor */ class wxGridCellEnumEditor : public wxGridCellChoiceEditor { @@ -666,7 +711,7 @@ public: @see wxGridCellEditor, wxGridCellAutoWrapStringEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellEnumEditor, wxGridCellFloatEditor, - wxGridCellNumberEditor + wxGridCellNumberEditor, wxGridCellDateEditor */ class wxGridCellTextEditor : public wxGridCellEditor { @@ -705,7 +750,7 @@ public: @see wxGridCellEditor, wxGridCellAutoWrapStringEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellEnumEditor, wxGridCellNumberEditor, - wxGridCellTextEditor + wxGridCellTextEditor, wxGridCellDateEditor */ class wxGridCellFloatEditor : public wxGridCellTextEditor { @@ -743,7 +788,7 @@ public: @see wxGridCellEditor, wxGridCellAutoWrapStringEditor, wxGridCellBoolEditor, wxGridCellChoiceEditor, wxGridCellEnumEditor, wxGridCellFloatEditor, - wxGridCellTextEditor + wxGridCellTextEditor, wxGridCellDateEditor */ class wxGridCellNumberEditor : public wxGridCellTextEditor { @@ -775,6 +820,32 @@ protected: wxString GetString() const; }; +/** + @class wxGridCellDateEditor + + Grid cell editor for dates. + + Uses @ref wxDatePickerCtrl as actual edit control. + + @library{wxcore} + @category{grid} + + @see wxGridCellEditor, wxGridCellAutoWrapStringEditor, + wxGridCellBoolEditor, wxGridCellChoiceEditor, + wxGridCellEnumEditor, wxGridCellFloatEditor, + wxGridCellTextEditor + + @since 3.1.3 +*/ +class wxGridCellDateEditor : public wxGridCellEditor +{ +public: + /** + Date editor constructor. + */ + wxGridCellDateEditor(); +}; + /** @@ -2080,6 +2151,8 @@ enum wxGridRenderStyle - wxGridCellFloatRenderer - wxGridCellNumberRenderer - wxGridCellStringRenderer + - wxGridCellDateRenderer + - wxGridCellDateTimeRenderer The look of a cell can be further defined using wxGridCellAttr. An object of this type may be returned by wxGridTableBase::GetAttr(). @@ -2092,6 +2165,7 @@ enum wxGridRenderStyle - wxGridCellFloatEditor - wxGridCellNumberEditor - wxGridCellTextEditor + - wxGridCellDateEditor Please see wxGridEvent, wxGridSizeEvent, wxGridRangeSelectEvent, and wxGridEditorCreatedEvent for the documentation of all event types you can @@ -2961,9 +3035,10 @@ public: Name of the new type. May be any string, but if the type name is the same as the name of an already registered type, including one of the standard ones (which are @c wxGRID_VALUE_STRING, @c - wxGRID_VALUE_BOOL, @c wxGRID_VALUE_NUMBER, @c wxGRID_VALUE_FLOAT - and @c wxGRID_VALUE_CHOICE), then the new registration information - replaces the previously used renderer and editor. + wxGRID_VALUE_BOOL, @c wxGRID_VALUE_NUMBER, @c wxGRID_VALUE_FLOAT, + @c wxGRID_VALUE_CHOICE and @c wxGRID_VALUE_DATE), then the new + registration information replaces the previously used renderer and + editor. @param renderer The renderer to use for the cells of this type. Its ownership is taken by the grid, i.e. it will call DecRef() on this pointer when @@ -3090,6 +3165,19 @@ public: */ void SetColFormatNumber(int col); + /** + Sets the specified column to display date values. + + The @a format argument is used with wxGridCellDateRenderer and allows + to specify the strftime-like format string to use for displaying the + dates in this column. + + @see SetColFormatCustom() + + @since 3.1.3 + */ + void SetColFormatDate(int col, const wxString& format = wxString()); + /** Sets the default editor for grid cells. diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 38da7193b9..aaef518711 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -555,6 +555,16 @@ GridFrame::GridFrame() grid->SetCellAlignment(3, 9, wxALIGN_CENTRE, wxALIGN_TOP); grid->SetCellValue(3, 10, "<- This numeric cell should be centred"); + grid->SetColFormatDate(13); // Localized by default. + grid->SetColFormatDate(14, "%Y-%m-%d"); // ISO 8601 date format. + + grid->SetCellValue(7, 0, "Today"); + grid->SetCellRenderer(7, 0, new wxGridCellDateRenderer); + grid->SetCellEditor(7, 0, new wxGridCellDateEditor); + grid->SetCellValue(8, 0, "Tomorrow"); + grid->SetCellRenderer(8, 0, new wxGridCellDateRenderer("%Y-%m-%d")); + grid->SetCellEditor(8, 0, new wxGridCellDateEditor); + const wxString choices[] = { "Please select a choice", diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index f6993de388..a193972da3 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -7865,6 +7865,16 @@ void wxGrid::SetColFormatFloat(int col, int width, int precision) SetColFormatCustom(col, typeName); } +void wxGrid::SetColFormatDate(int col, const wxString& format) +{ + wxString typeName = wxGRID_VALUE_DATE; + if ( !format.empty() ) + { + typeName << ':' << format; + } + SetColFormatCustom(col, typeName); +} + void wxGrid::SetColFormatCustom(int col, const wxString& typeName) { wxGridCellAttr *attr = m_table->GetAttr(-1, col, wxGridCellAttr::Col ); @@ -9364,6 +9374,15 @@ int wxGridTypeRegistry::FindDataType(const wxString& typeName) } else #endif // wxUSE_COMBOBOX +#if wxUSE_DATEPICKCTRL + if ( typeName == wxGRID_VALUE_DATE ) + { + RegisterDataType(wxGRID_VALUE_DATE, + new wxGridCellDateRenderer, + new wxGridCellDateEditor); + } + else +#endif // wxUSE_DATEPICKCTRL { return wxNOT_FOUND; } diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index ecd8ac5d13..147fc7a926 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -77,28 +77,27 @@ void wxGridCellRenderer::Draw(wxGrid& grid, #if wxUSE_DATETIME -// Enables a grid cell to display a formatted date and or time +// Enables a grid cell to display a formatted date -wxGridCellDateTimeRenderer::wxGridCellDateTimeRenderer(const wxString& outformat, const wxString& informat) +wxGridCellDateRenderer::wxGridCellDateRenderer(const wxString& outformat) { - m_iformat = informat; - m_oformat = outformat; + if ( outformat.empty() ) + { + m_oformat = "%x"; // Localized date representation. + } + else + { + m_oformat = outformat; + } m_tz = wxDateTime::Local; - m_dateDef = wxDefaultDateTime; } -wxGridCellRenderer *wxGridCellDateTimeRenderer::Clone() const +wxGridCellRenderer *wxGridCellDateRenderer::Clone() const { - wxGridCellDateTimeRenderer *renderer = new wxGridCellDateTimeRenderer; - renderer->m_iformat = m_iformat; - renderer->m_oformat = m_oformat; - renderer->m_dateDef = m_dateDef; - renderer->m_tz = m_tz; - - return renderer; + return new wxGridCellDateRenderer(*this); } -wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int col) +wxString wxGridCellDateRenderer::GetString(const wxGrid& grid, int row, int col) { wxGridTableBase *table = grid.GetTable(); @@ -121,8 +120,7 @@ wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int if (!hasDatetime ) { text = table->GetValue(row, col); - const char * const end = val.ParseFormat(text, m_iformat, m_dateDef); - hasDatetime = end && !*end; + hasDatetime = Parse(text, val); } if ( hasDatetime ) @@ -132,12 +130,18 @@ wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int return text; } -void wxGridCellDateTimeRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rectCell, - int row, int col, - bool isSelected) +bool wxGridCellDateRenderer::Parse(const wxString& text, wxDateTime& result) +{ + wxString::const_iterator end; + return result.ParseDate(text, &end) && end == text.end(); +} + +void wxGridCellDateRenderer::Draw(wxGrid& grid, + wxGridCellAttr& attr, + wxDC& dc, + const wxRect& rectCell, + int row, int col, + bool isSelected) { wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); @@ -154,20 +158,41 @@ void wxGridCellDateTimeRenderer::Draw(wxGrid& grid, grid.DrawTextRectangle(dc, GetString(grid, row, col), rect, hAlign, vAlign); } -wxSize wxGridCellDateTimeRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) +wxSize wxGridCellDateRenderer::GetBestSize(wxGrid& grid, + wxGridCellAttr& attr, + wxDC& dc, + int row, int col) { return DoGetBestSize(attr, dc, GetString(grid, row, col)); } -void wxGridCellDateTimeRenderer::SetParameters(const wxString& params) +void wxGridCellDateRenderer::SetParameters(const wxString& params) { if (!params.empty()) m_oformat=params; } + +// Enables a grid cell to display a formatted date and or time + +wxGridCellDateTimeRenderer::wxGridCellDateTimeRenderer(const wxString& outformat, const wxString& informat) + : wxGridCellDateRenderer(outformat) +{ + m_iformat = informat; + m_dateDef = wxDefaultDateTime; +} + +wxGridCellRenderer *wxGridCellDateTimeRenderer::Clone() const +{ + return new wxGridCellDateTimeRenderer(*this); +} + +bool wxGridCellDateTimeRenderer::Parse(const wxString& text, wxDateTime& result) +{ + const char * const end = result.ParseFormat(text, m_iformat, m_dateDef); + return end && !*end; +} + #endif // wxUSE_DATETIME // ---------------------------------------------------------------------------- diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index 0fd043ad10..f8a3eb7871 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -38,6 +38,7 @@ #include "wx/tokenzr.h" #include "wx/renderer.h" #include "wx/headerctrl.h" +#include "wx/datectrl.h" #include "wx/generic/gridsel.h" #include "wx/generic/grideditors.h" @@ -1710,5 +1711,162 @@ wxGridCellAutoWrapStringEditor::Create(wxWindow* parent, wxTE_MULTILINE | wxTE_RICH); } +#if wxUSE_DATEPICKCTRL + +// ---------------------------------------------------------------------------- +// wxGridCellDateEditor +// ---------------------------------------------------------------------------- + +#if defined ( __WXGTK__ ) +// Desired behavior is to close the editor control on ESC without updating the +// table, and to close with update on ENTER. On wxMSW wxWANTS_CHARS is enough +// for that, but on wxGTK a bit of special processing is required to forward +// some of the key events from wxDatePickerCtrl to the generic cell editor +// event handler. +struct wxGridCellDateEditorKeyHandler +{ + explicit wxGridCellDateEditorKeyHandler(wxGridCellEditorEvtHandler* handler) + : m_handler(handler) + {} + + void operator()(wxKeyEvent& event) const + { + switch ( event.GetKeyCode() ) + { + case WXK_ESCAPE: + m_handler->OnKeyDown(event); + break; + + case WXK_RETURN: + case WXK_NUMPAD_ENTER: + wxPostEvent(m_handler, wxCommandEvent(wxEVT_GRID_HIDE_EDITOR)); + event.Skip(); + break; + + default: + event.Skip(); + break; + } + } + + wxGridCellEditorEvtHandler* m_handler; +}; +#endif // __WXGTK__ + +void wxGridCellDateEditor::Create(wxWindow* parent, wxWindowID id, + wxEvtHandler* evtHandler) +{ + m_control = new wxDatePickerCtrl(parent, id, + wxDefaultDateTime, + wxDefaultPosition, + wxDefaultSize, + wxDP_DEFAULT | + wxDP_SHOWCENTURY | + wxWANTS_CHARS); + + wxGridCellEditor::Create(parent, id, evtHandler); + +#if defined ( __WXGTK__ ) + // Install a handler for ESC and ENTER keys. + wxGridCellEditorEvtHandler* handler = + wxDynamicCast(evtHandler, wxGridCellEditorEvtHandler); + if ( handler ) + { + handler->Bind(wxEVT_CHAR, wxGridCellDateEditorKeyHandler(handler)); + } +#endif // __WXGTK__ +} + +void wxGridCellDateEditor::SetSize(const wxRect& r) +{ + wxASSERT_MSG(m_control, "The wxGridCellDateEditor must be created first!"); + + const wxSize bestSize = DatePicker()->GetBestSize(); + + wxRect rect(r.GetPosition(), bestSize); + + // Allow edit picker to become a bit wider, if necessary, but no more than + // twice as wide as the best width, otherwise they just look ugly. + if ( r.GetWidth() > bestSize.GetWidth() ) + { + rect.SetWidth(wxMin(r.GetWidth(), 2*bestSize.GetWidth())); + } + + wxGridCellEditor::SetSize(rect); +} + +void wxGridCellDateEditor::BeginEdit(int row, int col, wxGrid* grid) +{ + wxASSERT_MSG(m_control, "The wxGridCellDateEditor must be created first!"); + + const wxString dateStr = grid->GetTable()->GetValue(row, col); + if ( !m_value.ParseDate(dateStr) ) + { + // Invalidate m_value, so that it always compares different + // to any value returned from DatePicker()->GetValue(). + m_value = wxDefaultDateTime; + } + else + { + DatePicker()->SetValue(m_value); + } + + DatePicker()->SetFocus(); +} + +bool wxGridCellDateEditor::EndEdit(int WXUNUSED(row), int WXUNUSED(col), + const wxGrid* WXUNUSED(grid), + const wxString& WXUNUSED(oldval), + wxString *newval) +{ + wxASSERT_MSG(m_control, "The wxGridCellDateEditor must be created first!"); + + const wxDateTime date = DatePicker()->GetValue(); + + if ( m_value == date ) + { + return false; + } + + m_value = date; + + if ( newval ) + { + *newval = m_value.FormatISODate(); + } + + return true; +} + +void wxGridCellDateEditor::ApplyEdit(int row, int col, wxGrid* grid) +{ + grid->GetTable()->SetValue(row, col, m_value.FormatISODate()); +} + +void wxGridCellDateEditor::Reset() +{ + wxASSERT_MSG(m_control, "The wxGridCellDateEditor must be created first!"); + + m_value = DatePicker()->GetValue(); +} + +wxGridCellEditor *wxGridCellDateEditor::Clone() const +{ + return new wxGridCellDateEditor(); +} + +wxString wxGridCellDateEditor::GetValue() const +{ + wxASSERT_MSG(m_control, "The wxGridCellDateEditor must be created first!"); + + return DatePicker()->GetValue().FormatISODate(); +} + +wxDatePickerCtrl* wxGridCellDateEditor::DatePicker() const +{ + return static_cast(m_control); +} + +#endif // wxUSE_DATEPICKCTRL #endif // wxUSE_GRID From 066c422c81961dbd64b99d4fe0820c2570277b6c Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 4 Jan 2019 19:24:11 +0100 Subject: [PATCH 203/553] Take into account scrolling while obtaining absolute mouse pointer position See #18313. --- src/propgrid/propgrid.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 01519395c4..58edff27e2 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5471,9 +5471,12 @@ bool wxPropertyGrid::OnMouseChildCommon( wxMouseEvent &event, int* px, int *py ) int splitterX = GetSplitterPosition(); wxRect r = topCtrlWnd->GetRect(); + int ux, uy; + CalcUnscrolledPosition(r.x + x, r.y + y, &ux, &uy); + if ( !m_dragStatus && - x > (splitterX-r.x+wxPG_SPLITTERX_DETECTMARGIN2) && - y >= 0 && y < r.height \ + ux > (splitterX + wxPG_SPLITTERX_DETECTMARGIN2) && + y >= 0 && y < r.height ) { if ( m_curcursor != wxCURSOR_ARROW ) CustomSetCursor ( wxCURSOR_ARROW ); @@ -5481,8 +5484,14 @@ bool wxPropertyGrid::OnMouseChildCommon( wxMouseEvent &event, int* px, int *py ) } else { - CalcUnscrolledPosition( event.m_x + r.x, event.m_y + r.y, \ - px, py ); + if ( px ) + { + *px = ux; + } + if ( py ) + { + *py = uy; + } return true; } return false; From 42b1cca8f2ff0c902fff8db9efc8b3487b654598 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 4 Jan 2019 19:50:44 +0100 Subject: [PATCH 204/553] Fix repositioning editors for horizontally scrolled grid New method of calculating of the new position/size of the editor (introduced in 95461c566d) doesn't work well in all cases so we have to go back to the (modified) old method. To get the correct position of the editor cell from the absolute position of the splitter 0 we have to shift it by the origin of the scrolled view area. See #18313. --- include/wx/propgrid/propgrid.h | 6 ------ src/propgrid/editors.cpp | 30 ++--------------------------- src/propgrid/propgrid.cpp | 35 ++++++---------------------------- 3 files changed, 8 insertions(+), 63 deletions(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index f7b444c21d..114a02f19b 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1687,10 +1687,8 @@ protected: // Which column's editor is selected (usually 1)? unsigned int m_selColumn; -#if WXWIN_COMPATIBILITY_3_0 // x relative to splitter (needed for resize). int m_ctrlXAdjust; -#endif // WXWIN_COMPATIBILITY_3_0 // lines between cells wxColour m_colLine; // property labels and values are written in this colour @@ -1803,11 +1801,7 @@ protected: wxRect GetEditorWidgetRect( wxPGProperty* p, int column ) const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED_MSG("Don't use this function. It works only if horizontal scrolling is not active") void CorrectEditorWidgetSizeX(); -#endif // WXWIN_COMPATIBILITY_3_0 - void CorrectEditorWidgetSizeX(int xPosChange, int widthChange); // Called in RecalculateVirtualSize() to reposition control // on virtual height changes. diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index b4dc593346..c2c3349096 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1774,13 +1774,13 @@ wxWindow* wxPropertyGrid::GetEditorControl() const // ----------------------------------------------------------------------- -#if WXWIN_COMPATIBILITY_3_0 void wxPropertyGrid::CorrectEditorWidgetSizeX() { int secWid = 0; // Use fixed selColumn 1 for main editor widgets - int newSplitterx = m_pState->DoGetSplitterPosition(0); + int newSplitterx; + CalcScrolledPosition(m_pState->DoGetSplitterPosition(0), 0, &newSplitterx, NULL); int newWidth = newSplitterx + m_pState->GetColumnWidth(1); if ( m_wndEditor2 ) @@ -1816,32 +1816,6 @@ void wxPropertyGrid::CorrectEditorWidgetSizeX() if ( m_wndEditor2 ) m_wndEditor2->Refresh(); } -#endif // WXWIN_COMPATIBILITY_3_0 - -void wxPropertyGrid::CorrectEditorWidgetSizeX(int xPosChange, int widthChange) -{ - if ( m_wndEditor2 ) - { - // if width change occurred, move secondary wnd by that amount - wxPoint p = m_wndEditor2->GetPosition(); - p.x += xPosChange + widthChange; - m_wndEditor2->SetPosition(p); - } - - if ( m_wndEditor ) - { - wxRect r = m_wndEditor->GetRect(); - r.x += xPosChange; - - if ( !(m_iFlags & wxPG_FL_FIXED_WIDTH_EDITOR) ) - r.width += widthChange; - - m_wndEditor->SetSize(r); - } - - if ( m_wndEditor2 ) - m_wndEditor2->Refresh(); -} // ----------------------------------------------------------------------- diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 58edff27e2..760f7ffaa3 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2791,19 +2791,13 @@ void wxPropertyGrid::DoSetSplitterPosition( int newxpos, if ( flags & wxPG_SPLITTER_FROM_EVENT ) m_pState->m_dontCenterSplitter = true; - // Save position and size of column 1 used for main editor widgets - int xPosEditorCol = m_pState->DoGetSplitterPosition(0); - int widthEditorCol = m_pState->GetColumnWidth(1); - m_pState->DoSetSplitterPosition(newxpos, splitterIndex, flags); if ( flags & wxPG_SPLITTER_REFRESH ) { if ( GetSelection() ) { - int xPosChange = m_pState->DoGetSplitterPosition(0) - xPosEditorCol; - int widthColChange = m_pState->GetColumnWidth(1) - widthEditorCol; - CorrectEditorWidgetSizeX(xPosChange, widthColChange); + CorrectEditorWidgetSizeX(); } Refresh(); @@ -2818,16 +2812,10 @@ void wxPropertyGrid::ResetColumnSizes( bool enableAutoResizing ) { if ( m_pState ) { - // Save position and size of column 1 used for main editor widgets - int xPosEditorCol = m_pState->DoGetSplitterPosition(0); - int widthEditorCol = m_pState->GetColumnWidth(1); - m_pState->ResetColumnSizes(0); if ( GetSelection() ) { - int xPosChange = m_pState->DoGetSplitterPosition(0) - xPosEditorCol; - int widthColChange = m_pState->GetColumnWidth(1) - widthEditorCol; - CorrectEditorWidgetSizeX(xPosChange, widthColChange); + CorrectEditorWidgetSizeX(); } Refresh(); @@ -4142,7 +4130,9 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) { int propY = p->GetY2(m_lineHeight); - int splitterX = GetSplitterPosition(); + int splitterX; + CalcScrolledPosition(GetSplitterPosition(), 0, &splitterX, NULL); + m_editorFocused = false; m_iFlags |= wxPG_FL_PRIMARY_FILLS_ENTIRE; @@ -4227,10 +4217,8 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags ) if ( p->HasFlag(wxPG_PROP_MODIFIED) && (m_windowStyle & wxPG_BOLD_MODIFIED) ) SetCurControlBoldFont(); -#if WXWIN_COMPATIBILITY_3_0 // Store x relative to splitter (we'll need it). m_ctrlXAdjust = m_wndEditor->GetPosition().x - splitterX; -#endif // WXWIN_COMPATIBILITY_3_0 // Check if background clear is not necessary wxPoint pos = m_wndEditor->GetPosition(); @@ -4563,13 +4551,6 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos ) m_iFlags |= wxPG_FL_RECALCULATING_VIRTUAL_SIZE; - // Save position and size of column 1 used for main editor widgets - int vx; - GetViewStart(&vx, NULL); - vx *= wxPG_PIXELS_PER_UNIT; - int xPosEditorCol = m_pState->DoGetSplitterPosition(0) - vx; - int widthEditorCol = m_pState->GetColumnWidth(1); - int x = m_pState->GetVirtualWidth(); int y = m_pState->m_virtualHeight; @@ -4622,11 +4603,7 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos ) if ( GetSelection() ) { - GetViewStart(&vx, NULL); - vx *= wxPG_PIXELS_PER_UNIT; - int xPosChange = m_pState->DoGetSplitterPosition(0) - vx - xPosEditorCol; - int widthColChange = m_pState->GetColumnWidth(1) - widthEditorCol; - CorrectEditorWidgetSizeX(xPosChange, widthColChange); + CorrectEditorWidgetSizeX(); } m_iFlags &= ~wxPG_FL_RECALCULATING_VIRTUAL_SIZE; From b235987a69b93c4b567be441e3611e7a25ed69d1 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 4 Jan 2019 21:26:47 +0100 Subject: [PATCH 205/553] Use dedicated functions to covert between physical and logical coordinates of the scrolled wxPropertyGrid --- src/propgrid/propgrid.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 760f7ffaa3..e630dead3d 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3810,12 +3810,8 @@ wxSize wxPropertyGrid::GetImageSize( wxPGProperty* p, int item ) const // takes scrolling into account void wxPropertyGrid::ImprovedClientToScreen( int* px, int* py ) { - int vx, vy; - GetViewStart(&vx,&vy); - vy*=wxPG_PIXELS_PER_UNIT; - vx*=wxPG_PIXELS_PER_UNIT; - *px -= vx; - *py -= vy; + wxASSERT(px && py); + CalcScrolledPosition(*px, *py, px, py); ClientToScreen( px, py ); } @@ -3823,14 +3819,7 @@ void wxPropertyGrid::ImprovedClientToScreen( int* px, int* py ) wxPropertyGridHitTestResult wxPropertyGrid::HitTest( const wxPoint& pt ) const { - wxPoint pt2; - GetViewStart(&pt2.x,&pt2.y); - pt2.x *= wxPG_PIXELS_PER_UNIT; - pt2.y *= wxPG_PIXELS_PER_UNIT; - pt2.x += pt.x; - pt2.y += pt.y; - - return m_pState->HitTest(pt2); + return m_pState->HitTest(CalcUnscrolledPosition(pt)); } // ----------------------------------------------------------------------- From 3cfec773c9f9a25ea12542236836b3161f41d1dc Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 4 Jan 2019 21:37:26 +0100 Subject: [PATCH 206/553] Replace wxArrayPtrVoid with wxVector --- include/wx/odcombo.h | 2 +- src/generic/odcombo.cpp | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/wx/odcombo.h b/include/wx/odcombo.h index 7fe4cddd8a..11755fe356 100644 --- a/include/wx/odcombo.h +++ b/include/wx/odcombo.h @@ -178,7 +178,7 @@ protected: void StopPartialCompletion(); wxArrayString m_strings; - wxArrayPtrVoid m_clientDatas; + wxVector m_clientDatas; wxFont m_useFont; diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index 12fb482dec..404ed62ed0 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -240,7 +240,7 @@ void wxVListBoxComboPopup::SendComboBoxEvent( int selection ) evt.SetInt(selection); // Set client data, if any - if ( selection >= 0 && (int)m_clientDatas.GetCount() > selection ) + if ( selection >= 0 && (int)m_clientDatas.size() > selection ) { void* clientData = m_clientDatas[selection]; if ( m_clientDataItemsType == wxClientData_Object ) @@ -523,7 +523,7 @@ void wxVListBoxComboPopup::Insert( const wxString& item, int pos ) m_strings.Insert(item,pos); if ( (int)m_clientDatas.size() >= pos ) - m_clientDatas.Insert(NULL, pos); + m_clientDatas.insert(m_clientDatas.begin()+pos, NULL); m_widths.insert(m_widths.begin()+pos, -1); m_widthsDirty = true; @@ -578,11 +578,11 @@ void wxVListBoxComboPopup::ClearClientDatas() { if ( m_clientDataItemsType == wxClientData_Object ) { - for ( size_t i=0; i::iterator it = m_clientDatas.begin(); it != m_clientDatas.end(); ++it ) + delete (wxClientData*) *it; } - m_clientDatas.Empty(); + m_clientDatas.clear(); m_clientDataItemsType = wxClientData_None; } @@ -600,21 +600,18 @@ void wxVListBoxComboPopup::SetItemClientData( unsigned int n, void* wxVListBoxComboPopup::GetItemClientData(unsigned int n) const { - if ( m_clientDatas.GetCount() > n ) - return m_clientDatas[n]; - - return NULL; + return n < m_clientDatas.size() ? m_clientDatas[n] : NULL; } void wxVListBoxComboPopup::Delete( unsigned int item ) { // Remove client data, if set - if ( m_clientDatas.GetCount() ) + if ( !m_clientDatas.empty() ) { if ( m_clientDataItemsType == wxClientData_Object ) delete (wxClientData*) m_clientDatas[item]; - m_clientDatas.RemoveAt(item); + m_clientDatas.erase(m_clientDatas.begin()+item); } m_strings.RemoveAt(item); From dcee3ce899e75e54ff3605e0f81530f874bcf699 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 4 Jan 2019 23:36:44 +0100 Subject: [PATCH 207/553] Suppress some harmless clang warnings in the test suite Use wxCLANG_WARNING_SUPPRESS() to avoid multiple warnings in CATCH headers as well as in some of our own tests. --- tests/arrays/arrays.cpp | 6 ++++++ tests/strings/vararg.cpp | 2 ++ tests/test.cpp | 2 ++ tests/uris/url.cpp | 2 ++ tests/weakref/weakref.cpp | 2 ++ 5 files changed, 14 insertions(+) diff --git a/tests/arrays/arrays.cpp b/tests/arrays/arrays.cpp index 24c887da8e..89f307cf43 100644 --- a/tests/arrays/arrays.cpp +++ b/tests/arrays/arrays.cpp @@ -364,12 +364,18 @@ void ArraysTestCase::wxStringArrayTest() a6.Add("Foo"); a6.Insert(a6[0], 1, 100); + // The whole point of this code is to test self-assignment, so suppress + // clang warning about it. + wxCLANG_WARNING_SUPPRESS(self-assign-overloaded) + wxArrayString a7; a7 = a7; CPPUNIT_ASSERT_EQUAL( 0, a7.size() ); a7.Add("Bar"); a7 = a7; CPPUNIT_ASSERT_EQUAL( 1, a7.size() ); + + wxCLANG_WARNING_RESTORE(self-assign-overloaded) } void ArraysTestCase::SortedArray() diff --git a/tests/strings/vararg.cpp b/tests/strings/vararg.cpp index b84b01ba3e..14eaa88333 100644 --- a/tests/strings/vararg.cpp +++ b/tests/strings/vararg.cpp @@ -135,7 +135,9 @@ void VarArgTestCase::CharPrintf() #ifdef _MSC_VER #pragma warning(disable:4309) // truncation of constant value #endif + wxCLANG_WARNING_SUPPRESS(constant-conversion) c = 240; + wxCLANG_WARNING_RESTORE(constant-conversion) #ifdef _MSC_VER #pragma warning(default:4309) #endif diff --git a/tests/test.cpp b/tests/test.cpp index fdb0ebf6e4..c291c878e8 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -21,6 +21,7 @@ // Suppress some warnings in catch_impl.hpp. wxCLANG_WARNING_SUPPRESS(missing-braces) wxCLANG_WARNING_SUPPRESS(logical-op-parentheses) +wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override) // This file needs to get the CATCH definitions in addition to the usual // assertion macros declarations from catch.hpp included by testprec.h. @@ -30,6 +31,7 @@ wxCLANG_WARNING_SUPPRESS(logical-op-parentheses) wxCLANG_WARNING_RESTORE(missing-braces) wxCLANG_WARNING_RESTORE(logical-op-parentheses) +wxCLANG_WARNING_RESTORE(inconsistent-missing-override) // This probably could be done by predefining CLARA_CONFIG_MAIN, but at the // point where we are, just define this global variable manually. diff --git a/tests/uris/url.cpp b/tests/uris/url.cpp index dec56558bb..8fbb208927 100644 --- a/tests/uris/url.cpp +++ b/tests/uris/url.cpp @@ -123,7 +123,9 @@ void URLTestCase::CopyAndAssignment() CPPUNIT_ASSERT(url1 == url2); // assignment to self + wxCLANG_WARNING_SUPPRESS(self-assign-overloaded) url2 = url2; + wxCLANG_WARNING_RESTORE(self-assign-overloaded) // check for destructor (with base pointer!) puri = new wxURL(); diff --git a/tests/weakref/weakref.cpp b/tests/weakref/weakref.cpp index ce3f9de72d..5681a27163 100644 --- a/tests/weakref/weakref.cpp +++ b/tests/weakref/weakref.cpp @@ -133,7 +133,9 @@ void WeakRefTestCase::DeclareTest() wxWeakRef p; // Copying should be also OK + wxCLANG_WARNING_SUPPRESS(self-assign-overloaded) p = p; + wxCLANG_WARNING_RESTORE(self-assign-overloaded) // Assigning a raw pointer should cause compile error #ifdef TEST_INVALID_INCOMPLETE_WEAKREF From fee0decbb018e253cfa43fb316c9f64ed5370036 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 4 Jan 2019 23:48:36 +0100 Subject: [PATCH 208/553] Apply g++ 4.7 workaround in hash set macros to this compiler only This workaround was already disabled for MSVC, as it resulted in a warning there, but it also gives a similar warning with clang and it seems better to restrict this workaround to gcc only rather than excluding another compiler. --- include/wx/hashset.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/wx/hashset.h b/include/wx/hashset.h index 38a65ab5f4..82e0d252f5 100644 --- a/include/wx/hashset.h +++ b/include/wx/hashset.h @@ -75,13 +75,13 @@ public: \ // the names of the hasher and comparator classes are interpreted as naming // the base class which is inaccessible. // The workaround is to prefix the class names with 'struct'; however, don't -// do this on MSVC because it causes a warning there if the class was -// declared as a 'class' rather than a 'struct' (and MSVC's std::unordered_set -// implementation does not suffer from the access problem). -#ifdef _MSC_VER -#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) STRUCTNAME -#else +// do this unconditionally, as with other compilers (both MSVC and clang) +// doing it causes a warning if the class was declared as a 'class' rather than +// a 'struct'. +#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 7) #define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) struct STRUCTNAME +#else +#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) STRUCTNAME #endif #define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \ From 1d72f6af7e9c20fefdde3b04b4af060236986e42 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 5 Jan 2019 00:01:09 +0100 Subject: [PATCH 209/553] Fix wxMSW build in non-Unicode mode Convert WCHAR to TCHAR explicitly in this case. Closes #18320. --- src/msw/artmsw.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/msw/artmsw.cpp b/src/msw/artmsw.cpp index 1d836fd56e..93171b3b0c 100644 --- a/src/msw/artmsw.cpp +++ b/src/msw/artmsw.cpp @@ -137,6 +137,21 @@ MSWGetBitmapFromIconLocation(const TCHAR* path, int index, const wxSize& size) return wxBitmap(icon); } +#if !wxUSE_UNICODE + +// SHSTOCKICONINFO always uses WCHAR, even in ANSI build, so we need to convert +// it to TCHAR, which is just CHAR in this case, used by the other functions. +// Provide an overload doing it as this keeps the code in the main function +// clean and this entire block (inside !wxUSE_UNICODE check) can be just +// removed when support for ANSI build is finally dropped. +wxBitmap +MSWGetBitmapFromIconLocation(const WCHAR* path, int index, const wxSize& size) +{ + return MSWGetBitmapFromIconLocation(wxString(path).mb_str(), index, size); +} + +#endif // !wxUSE_UNICODE + wxBitmap MSWGetBitmapForPath(const wxString& path, const wxSize& size, DWORD uFlags = 0) { From 28342d7882ef0ccd1dc447463b45f7571ddbcf66 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 4 Jan 2019 23:31:12 +0100 Subject: [PATCH 210/553] Fix building with wxUSE_STD_CONTAINERS=1 in C++17 mode Don't use std::bind2nd() which doesn't exist in C++17 any longer. Replace it with a lambda when using C++11 which is simpler and more clear and also replace the use of functors in std::sort() calls with lambdas. Closes #18319. --- src/common/arrstr.cpp | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/common/arrstr.cpp b/src/common/arrstr.cpp index 721a63f50b..e78f8259b5 100644 --- a/src/common/arrstr.cpp +++ b/src/common/arrstr.cpp @@ -59,6 +59,24 @@ wxArrayString::wxArrayString(size_t sz, const wxString* a) #include "wx/arrstr.h" +#if __cplusplus >= 201103L + +int wxArrayString::Index(const wxString& str, bool bCase, bool WXUNUSED(bFromEnd)) const +{ + int n = 0; + for ( const auto& s: *this ) + { + if ( s.IsSameAs(str, bCase) ) + return n; + + ++n; + } + + return wxNOT_FOUND; +} + +#else // C++98 version + #include "wx/beforestd.h" #include #include "wx/afterstd.h" @@ -130,9 +148,20 @@ wxStringCompareLess wxStringCompare(F f) return wxStringCompareLess(f); } +#endif // C++11/C++98 + void wxArrayString::Sort(CompareFunction function) { - std::sort(begin(), end(), wxStringCompare(function)); + std::sort(begin(), end(), +#if __cplusplus >= 201103L + [function](const wxString& s1, const wxString& s2) + { + return function(s1, s2) < 0; + } +#else // C++98 version + wxStringCompare(function) +#endif // C++11/C++98 + ); } void wxArrayString::Sort(bool reverseOrder) @@ -155,7 +184,16 @@ int wxSortedArrayString::Index(const wxString& str, "search parameters ignored for sorted array" ); wxSortedArrayString::const_iterator - it = std::lower_bound(begin(), end(), str, wxStringCompare(wxStringCmp())); + it = std::lower_bound(begin(), end(), str, +#if __cplusplus >= 201103L + [](const wxString& s1, const wxString& s2) + { + return s1 < s2; + } +#else // C++98 version + wxStringCompare(wxStringCmp()) +#endif // C++11/C++98 + ); if ( it == end() || str.Cmp(*it) != 0 ) return wxNOT_FOUND; From 36f6f8ad49038089413dd5e3b3bee151ab78112c Mon Sep 17 00:00:00 2001 From: ali kettab Date: Tue, 1 Jan 2019 00:55:14 +0100 Subject: [PATCH 211/553] wxTextValidator improvements Improve char inclusion/exclusion support; update the sample to show more features of this class and add a unit test for it. Closes https://github.com/wxWidgets/wxWidgets/pull/1093 --- docs/changes.txt | 4 + include/wx/valtext.h | 80 +++++++- interface/wx/valtext.h | 188 +++++++++++++---- samples/propgrid/sampleprops.cpp | 12 +- samples/validate/validate.cpp | 333 ++++++++++++++++++++++++++++--- samples/validate/validate.h | 78 +++++++- src/common/valtext.cpp | 258 ++++++++++++++---------- src/generic/datectlg.cpp | 8 +- src/propgrid/props.cpp | 68 +++---- tests/Makefile.in | 4 + tests/makefile.bcc | 4 + tests/makefile.gcc | 4 + tests/makefile.vc | 4 + tests/test.bkl | 1 + tests/test_vc7_test_gui.vcproj | 3 + tests/test_vc8_test_gui.vcproj | 4 + tests/test_vc9_test_gui.vcproj | 4 + tests/validators/valtext.cpp | 190 ++++++++++++++++++ 18 files changed, 1000 insertions(+), 247 deletions(-) create mode 100644 tests/validators/valtext.cpp diff --git a/docs/changes.txt b/docs/changes.txt index 956ba8986c..44657da85c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -104,6 +104,10 @@ Changes in behaviour which may result in build errors e.g. if the error is due to spelling an option name wrongly, fixing or removing its name. +- wxTextValidator::Get{In,Ex}cludes() now return a const reference to + wxArrayString. Please update your code to use the appropriate setter + Set[Char]{In,Ex}cludes(), instead of mutating the internal data directly. + 3.1.3: (released 2019-??-??) ---------------------------- diff --git a/include/wx/valtext.h b/include/wx/valtext.h index 7dbdec176f..61c339a22b 100644 --- a/include/wx/valtext.h +++ b/include/wx/valtext.h @@ -31,9 +31,20 @@ enum wxTextValidatorStyle wxFILTER_INCLUDE_LIST = 0x40, wxFILTER_INCLUDE_CHAR_LIST = 0x80, wxFILTER_EXCLUDE_LIST = 0x100, - wxFILTER_EXCLUDE_CHAR_LIST = 0x200 + wxFILTER_EXCLUDE_CHAR_LIST = 0x200, + wxFILTER_XDIGITS = 0x400, + wxFILTER_SPACE = 0x800, + + // filter char class (for internal use only) + wxFILTER_CC = wxFILTER_SPACE|wxFILTER_ASCII|wxFILTER_NUMERIC| + wxFILTER_ALPHANUMERIC|wxFILTER_ALPHA| + wxFILTER_DIGITS|wxFILTER_XDIGITS }; +// ---------------------------------------------------------------------------- +// wxTextValidator +// ---------------------------------------------------------------------------- + class WXDLLIMPEXP_CORE wxTextValidator: public wxValidator { public: @@ -68,31 +79,78 @@ public: wxTextEntry *GetTextEntry(); + // strings & chars inclusions: + // --------------------------- + void SetCharIncludes(const wxString& chars); - void SetIncludes(const wxArrayString& includes) { m_includes = includes; } - inline wxArrayString& GetIncludes() { return m_includes; } + void AddCharIncludes(const wxString& chars); + + void SetIncludes(const wxArrayString& includes); + void AddInclude(const wxString& include); + + const wxArrayString& GetIncludes() const { return m_includes; } + wxString GetCharIncludes() const { return m_charIncludes; } + + // strings & chars exclusions: + // --------------------------- void SetCharExcludes(const wxString& chars); - void SetExcludes(const wxArrayString& excludes) { m_excludes = excludes; } - inline wxArrayString& GetExcludes() { return m_excludes; } + void AddCharExcludes(const wxString& chars); + + void SetExcludes(const wxArrayString& excludes); + void AddExclude(const wxString& exclude); + + const wxArrayString& GetExcludes() const { return m_excludes; } + wxString GetCharExcludes() const { return m_charExcludes; } bool HasFlag(wxTextValidatorStyle style) const { return (m_validatorStyle & style) != 0; } + // implementation only + // -------------------- + + // returns the error message if the contents of 'str' are invalid + virtual wxString IsValid(const wxString& str) const; + protected: - // returns true if all characters of the given string are present in m_includes + bool IsCharIncluded(const wxUniChar& c) const + { + return m_charIncludes.find(c) != wxString::npos; + } + + bool IsCharExcluded(const wxUniChar& c) const + { + return m_charExcludes.find(c) != wxString::npos; + } + + bool IsIncluded(const wxString& str) const + { + if ( HasFlag(wxFILTER_INCLUDE_LIST) ) + return m_includes.Index(str) != wxNOT_FOUND; + + // m_includes should be ignored (i.e. return true) + // if the style is not set. + return true; + } + + bool IsExcluded(const wxString& str) const + { + return m_excludes.Index(str) != wxNOT_FOUND; + } + + // returns false if the character is invalid + bool IsValidChar(const wxUniChar& c) const; + + // These two functions (undocumented now) are kept for compatibility reasons. bool ContainsOnlyIncludedCharacters(const wxString& val) const; - - // returns true if at least one character of the given string is present in m_excludes bool ContainsExcludedCharacters(const wxString& val) const; - // returns the error message if the contents of 'val' are invalid - virtual wxString IsValid(const wxString& val) const; - protected: long m_validatorStyle; wxString* m_stringValue; + wxString m_charIncludes; + wxString m_charExcludes; wxArrayString m_includes; wxArrayString m_excludes; diff --git a/interface/wx/valtext.h b/interface/wx/valtext.h index 0102328ad4..de93979acc 100644 --- a/interface/wx/valtext.h +++ b/interface/wx/valtext.h @@ -9,8 +9,11 @@ /** Styles used by wxTextValidator. - Note that when you specify more styles in wxTextValidator the validation checks - are performed in the order in which the styles of this enumeration are defined. + Notice that wxFILTER_EXCLUDE[_CHAR]_LIST pair can be used to document the + purpose of the validator only and are not enforced in the implementation of + the wxTextValidator. Therefore, calling the corresponding member functions: + wxTextValidator::{SetExcludes,SetCharExcludes}(), is enough to create the + desired validator. */ enum wxTextValidatorStyle { @@ -33,9 +36,11 @@ enum wxTextValidatorStyle /// Non-alphanumeric characters are filtered out. /// Uses the wxWidgets wrapper for the standard CRT function @c isalnum /// (which is locale-dependent) on all characters of the string. + /// Equivalent to wxFILTER_ALPHA combined with wxFILTER_DIGITS or + /// wxFILTER_XDIGITS, or with both of them. wxFILTER_ALPHANUMERIC, - /// Non-numeric characters are filtered out. + /// Non-digit characters are filtered out. /// Uses the wxWidgets wrapper for the standard CRT function @c isdigit /// (which is locale-dependent) on all characters of the string. wxFILTER_DIGITS, @@ -50,19 +55,36 @@ enum wxTextValidatorStyle /// the list, complaining if not. See wxTextValidator::SetIncludes(). wxFILTER_INCLUDE_LIST, - /// Use an include list. The validator checks if each input character is - /// in the list (one character per list element), complaining if not. - /// See wxTextValidator::SetCharIncludes(). + /// Use an include char list. + /// Characters in the include char list will be allowed to be in the + /// user input. See wxTextValidator::SetCharIncludes(). + /// If this style is set with one or more of the following styles: + /// wxFILTER_ASCII, wxFILTER_ALPHA, wxFILTER_ALPHANUMERIC, wxFILTER_DIGITS, + /// wxFILTER_XDIGITS, wxFILTER_NUMERIC it just extends the character class + /// denoted by the aforementioned styles with those specified in the include + /// char list. If set alone, then the charactes allowed to be in the user input + /// are restricted to those, and only those, present in the include char list. wxFILTER_INCLUDE_CHAR_LIST, /// Use an exclude list. The validator checks if the user input is on /// the list, complaining if it is. See wxTextValidator::SetExcludes(). wxFILTER_EXCLUDE_LIST, - /// Use an exclude list. The validator checks if each input character is - /// in the list (one character per list element), complaining if it is. - /// See wxTextValidator::SetCharExcludes(). - wxFILTER_EXCLUDE_CHAR_LIST + /// Use an exclude char list. + /// Characters in the exclude char list won't be allowed to be in the + /// user input. See wxTextValidator::SetCharExcludes(). + wxFILTER_EXCLUDE_CHAR_LIST, + + /// Non-hexadecimal characters are filtered out. + /// Uses the wxWidgets wrapper for the standard CRT function @c isxdigit + /// (which is locale-dependent) on all characters of the string. + wxFILTER_XDIGITS, + + /// A convenience flag for use with the other flags. + /// The space character is more often used with alphanumeric characters + /// which makes setting a flag more easier than calling SetCharIncludes(" ") + /// for that matter. + wxFILTER_SPACE }; /** @@ -83,7 +105,7 @@ class wxTextValidator : public wxValidator { public: /** - Default constructor. + Copy constructor. */ wxTextValidator(const wxTextValidator& validator); @@ -106,14 +128,28 @@ public: virtual wxObject* Clone() const; /** - Returns a reference to the exclude list (the list of invalid values). + Returns a copy of the exclude char list (the list of invalid characters). + + @since 3.1.3 */ - wxArrayString& GetExcludes(); + wxString GetCharExcludes() const; /** - Returns a reference to the include list (the list of valid values). + Returns a copy of the include char list (the list of additional valid characters). + + @since 3.1.3 */ - wxArrayString& GetIncludes(); + wxString GetCharIncludes() const; + + /** + Returns a const reference to the exclude list (the list of invalid values). + */ + const wxArrayString& GetExcludes() const; + + /** + Returns a const reference to the include list (the list of valid values). + */ + const wxArrayString& GetIncludes() const; /** Returns the validator style. @@ -135,41 +171,81 @@ public: /** Sets the exclude list (invalid values for the user input). + + @note Beware that exclusion takes priority over inclusion. */ void SetExcludes(const wxArrayString& stringList); /** - Breaks the given @a chars strings in single characters and sets the - internal wxArrayString used to store the "excluded" characters - (see SetExcludes()). + Sets the exclude char list (invalid characters for the user input). - This function is mostly useful when @c wxFILTER_EXCLUDE_CHAR_LIST was used. + @note Beware that exclusion takes priority over inclusion. + @note This function may cancel the effect of @c wxFILTER_SPACE if the passed + in string @a chars contains the @b space character. */ void SetCharExcludes(const wxString& chars); /** Sets the include list (valid values for the user input). + + @see IsIncluded() */ void SetIncludes(const wxArrayString& stringList); /** - Breaks the given @a chars strings in single characters and sets the - internal wxArrayString used to store the "included" characters - (see SetIncludes()). + Sets the include char list (additional valid values for the user input). - This function is mostly useful when @c wxFILTER_INCLUDE_CHAR_LIST was used. + @note Any explicitly excluded characters will still be excluded even if + they're part of @a chars. */ void SetCharIncludes(const wxString& chars); + /** + Adds @a exclude to the list of excluded values. + + @note Beware that exclusion takes priority over inclusion. + + @since 3.1.3 + */ + void AddExclude(const wxString& exclude); + + /** + Adds @a include to the list of included values. + + @note Any explicitly excluded characters will still be excluded. + + @since 3.1.3 + */ + void AddInclude(const wxString& include); + + /** + Adds @a chars to the list of excluded characters. + + @note Beware that exclusion takes priority over inclusion. + + @since 3.1.3 + */ + void AddCharExcludes(const wxString& chars); + + /** + Adds @a chars to the list of included characters. + + @note Any explicitly excluded characters will still be excluded even if + they're part of @a chars. + + @since 3.1.3 + */ + void AddCharIncludes(const wxString& chars); + + /** Sets the validator style which must be a combination of one or more of the ::wxTextValidatorStyle values. - Note that not all possible combinations make sense! - Also note that the order in which the checks are performed is important, - in case you specify more than a single style. - wxTextValidator will perform the checks in the same definition order - used in the ::wxTextValidatorStyle enumeration. + Note that not all possible combinations make sense! Also, some + combinations have shorter and more idiomatic alternative, e.g. + @c wxFILTER_ALPHANUMERIC can be used instead of + @c wxFILTER_ALPHA|wxFILTER_DIGITS. */ void SetStyle(long style); @@ -189,24 +265,52 @@ public: */ virtual bool Validate(wxWindow* parent); -protected: - - /** - Returns @true if all the characters of the given @a val string - are present in the include list (set by SetIncludes() or SetCharIncludes()). - */ - bool ContainsOnlyIncludedCharacters(const wxString& val) const; - - /** - Returns true if at least one character of the given @a val string - is present in the exclude list (set by SetExcludes() or SetCharExcludes()). - */ - bool ContainsExcludedCharacters(const wxString& val) const; - /** Returns the error message if the contents of @a val are invalid or the empty string if @a val is valid. */ virtual wxString IsValid(const wxString& val) const; + +protected: + + /** + Returns @true if the char @a c is allowed to be in the user input string. + Additional characters, set by SetCharIncludes() or AddCharIncludes() are + also considered. + + @since 3.1.3 + */ + bool IsCharIncluded(const wxUniChar& c) const; + + /** + Returns @true if the char @a c is not allowed to be in the user input string. + (characters set by SetCharExcludes() or AddCharExcludes()). + + @since 3.1.3 + */ + bool IsCharExcluded(const wxUniChar& c) const; + + /** + Returns @true if the string @a str is one of the includes strings set by + SetIncludes() or AddInclude(). + + Notice that unless wxFILTER_INCLUDE_LIST is specified (in which case the + validator will complain if the user input is not on the list), the list + will be ignored and won't participate in the validation process. + + @since 3.1.3 + */ + bool IsIncluded(const wxString& str) const; + + /** + Returns @true if the string @a str is one of the excludes strings set by + SetExcludes() or AddExclude(). + + @since 3.1.3 + */ + bool IsExcluded(const wxString& str) const; + + /// Returns false if the character @a c is invalid. + bool IsValidChar(const wxUniChar& c) const; }; diff --git a/samples/propgrid/sampleprops.cpp b/samples/propgrid/sampleprops.cpp index 92ea1316ed..c32ec6e7c3 100644 --- a/samples/propgrid/sampleprops.cpp +++ b/samples/propgrid/sampleprops.cpp @@ -650,16 +650,12 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const #if wxUSE_VALIDATORS WX_PG_DOGETVALIDATOR_ENTRY() - wxTextValidator* validator = new wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST); + wxTextValidator* validator = + new wxNumericPropertyValidator(wxNumericPropertyValidator::Float); - // Accept characters for numeric elements - wxNumericPropertyValidator numValidator(wxNumericPropertyValidator::Float); - wxArrayString incChars(numValidator.GetIncludes()); // Accept also a delimiter and space character - incChars.Add(m_delimiter); - incChars.Add(" "); - - validator->SetIncludes(incChars); + validator->AddCharIncludes(m_delimiter); + validator->AddCharIncludes(" "); WX_PG_DOGETVALIDATOR_EXIT(validator) #else diff --git a/samples/validate/validate.cpp b/samples/validate/validate.cpp index 3f8706ee07..55bf6a0169 100644 --- a/samples/validate/validate.cpp +++ b/samples/validate/validate.cpp @@ -40,8 +40,6 @@ // Global data // ---------------------------------------------------------------------------- -MyData g_data; - wxString g_listbox_choices[] = {"one", "two", "three"}; @@ -51,6 +49,8 @@ wxString g_combobox_choices[] = wxString g_radiobox_choices[] = {"green", "yellow", "red"}; +MyData g_data; + // ---------------------------------------------------------------------------- // MyData // ---------------------------------------------------------------------------- @@ -63,6 +63,7 @@ MyData::MyData() m_string = "Spaces are invalid here"; m_string2 = "Valid text"; m_listbox_choices.Add(0); + m_combobox_choice = g_combobox_choices[0]; m_intValue = 0; m_smallIntValue = 3; m_doubleValue = 12354.31; @@ -247,28 +248,19 @@ MyDialog::MyDialog( wxWindow *parent, const wxString& title, wxFlexGridSizer *flexgridsizer = new wxFlexGridSizer(3, 2, 5, 5); - // Create and add controls to sizers. Note that a member variable - // of g_data is bound to each control upon construction. There is - // currently no easy way to substitute a different validator or a - // different transfer variable after a control has been constructed. - + // Create and add controls to sizers. // Pointers to some of these controls are saved in member variables // so that we can use them elsewhere, like this one. - m_text = new wxTextCtrl(this, VALIDATE_TEXT, wxEmptyString, - wxDefaultPosition, wxDefaultSize, 0, - wxTextValidator(wxFILTER_ALPHA, &g_data.m_string)); - m_text->SetToolTip("uses wxTextValidator with wxFILTER_ALPHA"); + m_text = new wxTextCtrl(this, VALIDATE_TEXT); + m_text->SetToolTip("wxTextValidator not set"); + m_text->SetHint("Enter some text here, please..."); flexgridsizer->Add(m_text, 1, wxGROW); - - // Now set a wxTextValidator with an explicit list of characters NOT allowed: - wxTextValidator textVal(wxFILTER_EMPTY|wxFILTER_EXCLUDE_CHAR_LIST, &g_data.m_string2); - textVal.SetCharExcludes("bcwyz"); - wxTextCtrl* txt2 = - new wxTextCtrl(this, VALIDATE_TEXT2, wxEmptyString, - wxDefaultPosition, wxDefaultSize, 0, textVal); - txt2->SetToolTip("uses wxTextValidator with wxFILTER_EMPTY|wxFILTER_EXCLUDE_CHAR_LIST to exclude 'bcwyz'"); - flexgridsizer->Add(txt2, 1, wxGROW); + // Make it possible to change the wxTextValidator for m_text at runtime. + wxButton* const button = + new wxButton(this, wxID_ANY, "Set new wxTextValidator..."); + button->Bind(wxEVT_BUTTON, &MyDialog::OnChangeValidator, this); + flexgridsizer->Add(button, wxSizerFlags().Center()); flexgridsizer->Add(new wxListBox((wxWindow*)this, VALIDATE_LIST, wxDefaultPosition, wxDefaultSize, @@ -391,17 +383,298 @@ MyDialog::MyDialog( wxWindow *parent, const wxString& title, // make the dialog a bit bigger than its minimal size: SetSize(GetBestSize()*1.5); -} -bool MyDialog::TransferDataToWindow() -{ - bool r = wxDialog::TransferDataToWindow(); - - // These function calls have to be made here, after the - // dialog has been created. + // Now sets the focus to m_text m_text->SetFocus(); - m_combobox->SetSelection(0); - - return r; } +void MyDialog::OnChangeValidator(wxCommandEvent& WXUNUSED(event)) +{ + TextValidatorDialog dialog(this, m_text); + + if ( dialog.ShowModal() == wxID_OK ) + { + dialog.ApplyValidator(); + } +} + +// ---------------------------------------------------------------------------- +// TextValidatorDialog +// ---------------------------------------------------------------------------- + +TextValidatorDialog::TextValidatorDialog(wxWindow *parent, wxTextCtrl* txtCtrl) + : wxDialog(parent, wxID_ANY, "wxTextValidator Dialog"), + m_txtCtrl(txtCtrl), + m_noValidation(true), + m_validatorStyle(wxFILTER_NONE) +{ + if ( m_txtCtrl ) + { + wxTextValidator* txtValidator = + wxDynamicCast(m_txtCtrl->GetValidator(), wxTextValidator); + + if ( txtValidator ) + { + m_validatorStyle = txtValidator->GetStyle(); + + if ( m_validatorStyle != wxFILTER_NONE ) + m_noValidation = false; + + m_charIncludes = txtValidator->GetCharIncludes(); + m_charExcludes = txtValidator->GetCharExcludes(); + m_includes = txtValidator->GetIncludes(); + m_excludes = txtValidator->GetExcludes(); + } + } + + wxFlexGridSizer *fgSizer = new wxFlexGridSizer(2, FromDIP(wxSize(5, 5))); + const wxSizerFlags center = wxSizerFlags().CenterVertical(); + + const StyleValidator styleVal(&m_validatorStyle); + + wxCheckBox* filterNone = new wxCheckBox(this, Id_None, "wxFILTER_NONE"); + filterNone->SetValue(m_noValidation); + fgSizer->Add(filterNone); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "No filtering takes place.")); + + fgSizer->Add(new wxCheckBox(this, Id_Empty, "wxFILTER_EMPTY")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Empty strings are filtered out.")); + + fgSizer->Add(new wxCheckBox(this, Id_Ascii, "wxFILTER_ASCII")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Non-ASCII characters are filtered out.")); + + fgSizer->Add(new wxCheckBox(this, Id_Alpha, "wxFILTER_ALPHA")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Non-alpha characters are filtered out.")); + + fgSizer->Add(new wxCheckBox(this, Id_Alphanumeric, "wxFILTER_ALPHANUMERIC")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Non-alphanumeric characters are filtered out.")); + + fgSizer->Add(new wxCheckBox(this, Id_Digits, "wxFILTER_DIGITS")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Non-digit characters are filtered out.")); + + fgSizer->Add(new wxCheckBox(this, Id_Numeric, "wxFILTER_NUMERIC")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Non-numeric characters are filtered out.")); + + fgSizer->Add(new wxCheckBox(this, Id_IncludeList, "wxFILTER_INCLUDE_LIST"), center) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxTextCtrl(this, Id_IncludeListTxt), wxSizerFlags().Expand()) + ->GetWindow()->Bind(wxEVT_KILL_FOCUS, &TextValidatorDialog::OnKillFocus, this); + + fgSizer->Add(new wxCheckBox(this, Id_IncludeCharList, "wxFILTER_INCLUDE_CHAR_LIST"), center) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxTextCtrl(this, Id_IncludeCharListTxt, wxString(), wxDefaultPosition, + wxDefaultSize, 0, wxGenericValidator(&m_charIncludes)), + wxSizerFlags().Expand()) + ->GetWindow()->Bind(wxEVT_KILL_FOCUS, &TextValidatorDialog::OnKillFocus, this); + + fgSizer->Add(new wxCheckBox(this, Id_ExcludeList, "wxFILTER_EXCLUDE_LIST"), center) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxTextCtrl(this, Id_ExcludeListTxt), wxSizerFlags().Expand()) + ->GetWindow()->Bind(wxEVT_KILL_FOCUS, &TextValidatorDialog::OnKillFocus, this); + + fgSizer->Add(new wxCheckBox(this, Id_ExcludeCharList, "wxFILTER_EXCLUDE_CHAR_LIST"), center) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxTextCtrl(this, Id_ExcludeCharListTxt, wxString(), wxDefaultPosition, + wxDefaultSize, 0, wxGenericValidator(&m_charExcludes)), + wxSizerFlags().Expand()) + ->GetWindow()->Bind(wxEVT_KILL_FOCUS, &TextValidatorDialog::OnKillFocus, this); + + fgSizer->Add(new wxCheckBox(this, Id_Xdigits, "wxFILTER_XDIGITS")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Non-xdigit characters are filtered out.")); + + fgSizer->Add(new wxCheckBox(this, Id_Space, "wxFILTER_SPACE")) + ->GetWindow()->SetValidator(styleVal); + fgSizer->Add(new wxStaticText(this, wxID_ANY, "Allow spaces.")); + + // Set the main sizer. + wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); + + mainsizer->Add(fgSizer, wxSizerFlags(1).Border(wxALL, 10).Expand()); + + mainsizer->Add(CreateButtonSizer(wxOK | wxCANCEL), + wxSizerFlags().Expand().DoubleBorder()); + + SetSizer(mainsizer); + mainsizer->SetSizeHints(this); + + // Bind event handlers. + Bind(wxEVT_CHECKBOX, &TextValidatorDialog::OnChecked, this); + Bind(wxEVT_UPDATE_UI, &TextValidatorDialog::OnUpdateUI, + this, Id_Ascii, Id_ExcludeCharListTxt); +} + +void TextValidatorDialog::OnUpdateUI(wxUpdateUIEvent& event) +{ + event.Enable(!m_noValidation); + + if ( m_noValidation ) + event.Check(false); +} + +void TextValidatorDialog::OnChecked(wxCommandEvent& event) +{ + if ( event.GetId() == Id_None ) + { + m_noValidation = event.IsChecked(); + + if ( m_noValidation ) + { + long style = wxFILTER_NONE; + + // we should keep this flag on if it has been set. + if ( HasFlag(wxFILTER_EMPTY) ) + style = wxFILTER_EMPTY; + + m_validatorStyle = style; + + m_charIncludes.clear(); + m_charExcludes.clear(); + m_includes.clear(); + m_excludes.clear(); + } + } +} + +void TextValidatorDialog::OnKillFocus(wxFocusEvent &event) +{ + wxTextCtrl* txtCtrl = wxDynamicCast(event.GetEventObject(), wxTextCtrl); + + if ( txtCtrl && txtCtrl->IsModified() ) + { + const int id = event.GetId(); + + if ( id == Id_IncludeCharListTxt ) + { + m_charIncludes = txtCtrl->GetValue(); + } + else if ( id == Id_ExcludeCharListTxt ) + { + m_charExcludes = txtCtrl->GetValue(); + } + else if ( id == Id_IncludeListTxt ) + { + m_includes = wxSplit(txtCtrl->GetValue(), ' '); + } + else if ( id == Id_ExcludeListTxt ) + { + m_excludes = wxSplit(txtCtrl->GetValue(), ' '); + } + } + + event.Skip(); +} + +void TextValidatorDialog::ApplyValidator() +{ + if ( !m_txtCtrl ) + return; + + wxString tooltip = "uses wxTextValidator with "; + + if ( m_noValidation ) + { + tooltip += "wxFILTER_NONE|"; + } + else + { + if ( HasFlag(wxFILTER_ASCII) ) + tooltip += "wxFILTER_ASCII|"; + if ( HasFlag(wxFILTER_ALPHA) ) + tooltip += "wxFILTER_ALPHA|"; + if ( HasFlag(wxFILTER_ALPHANUMERIC) ) + tooltip += "wxFILTER_ALPHANUMERIC|"; + if ( HasFlag(wxFILTER_DIGITS) ) + tooltip += "wxFILTER_DIGITS|"; + if ( HasFlag(wxFILTER_NUMERIC) ) + tooltip += "wxFILTER_NUMERIC|"; + if ( HasFlag(wxFILTER_XDIGITS) ) + tooltip += "wxFILTER_XDIGITS|"; + if ( HasFlag(wxFILTER_SPACE) ) + tooltip += "wxFILTER_SPACE|"; + if ( HasFlag(wxFILTER_INCLUDE_LIST) ) + tooltip += "wxFILTER_INCLUDE_LIST|"; + if ( HasFlag(wxFILTER_INCLUDE_CHAR_LIST) ) + tooltip += "wxFILTER_INCLUDE_CHAR_LIST|"; + if ( HasFlag(wxFILTER_EXCLUDE_LIST) ) + tooltip += "wxFILTER_EXCLUDE_LIST|"; + if ( HasFlag(wxFILTER_EXCLUDE_CHAR_LIST) ) + tooltip += "wxFILTER_EXCLUDE_CHAR_LIST|"; + } + + if ( HasFlag(wxFILTER_EMPTY) ) + { + tooltip += "wxFILTER_EMPTY|"; + } + + tooltip.RemoveLast(); // remove the trailing '|' char. + + if ( !m_charIncludes.empty() ) + { + tooltip += "\nAllowed chars: "; + tooltip += m_charIncludes; + } + + if ( !m_charExcludes.empty() ) + { + tooltip += "\nDisallowed chars: "; + tooltip += m_charExcludes; + } + + m_txtCtrl->SetToolTip(tooltip); + + // Prepare and set the wxTextValidator + wxTextValidator txtVal(m_validatorStyle, &g_data.m_string); + txtVal.SetCharIncludes(m_charIncludes); + txtVal.SetCharExcludes(m_charExcludes); + txtVal.SetIncludes(m_includes); + txtVal.SetExcludes(m_excludes); + + m_txtCtrl->SetValidator(txtVal); + m_txtCtrl->SetFocus(); +} + +bool TextValidatorDialog::StyleValidator::TransferToWindow() +{ + wxASSERT( wxDynamicCast(m_validatorWindow, wxCheckBox) ); + + if ( m_style ) + { + wxCheckBox* cb = (wxCheckBox*)GetWindow(); + if ( !cb ) + return false; + + const long style = 1 << (cb->GetId()-wxID_HIGHEST-1); + + cb->SetValue((*m_style & style) != 0); + } + + return true; +} + +bool TextValidatorDialog::StyleValidator::TransferFromWindow() +{ + wxASSERT( wxDynamicCast(m_validatorWindow, wxCheckBox) ); + + if ( m_style ) + { + wxCheckBox* cb = (wxCheckBox*)GetWindow(); + if ( !cb ) + return false; + + const long style = 1 << (cb->GetId()-wxID_HIGHEST-1); + + if ( cb->IsChecked() ) + *m_style |= style; + else + *m_style &= ~style; + } + + return true; +} diff --git a/samples/validate/validate.h b/samples/validate/validate.h index 226f703ba3..b482568b63 100644 --- a/samples/validate/validate.h +++ b/samples/validate/validate.h @@ -48,7 +48,8 @@ public: const wxSize& size = wxDefaultSize, const long style = wxDEFAULT_DIALOG_STYLE); - bool TransferDataToWindow() wxOVERRIDE; + void OnChangeValidator(wxCommandEvent& event); + wxTextCtrl *m_text; wxComboBox *m_combobox; @@ -56,6 +57,81 @@ public: wxTextCtrl *m_numericTextDouble; }; +// ---------------------------------------------------------------------------- +// TextValidatorDialog +// ---------------------------------------------------------------------------- +class TextValidatorDialog : public wxDialog +{ +public: + TextValidatorDialog(wxWindow *parent, wxTextCtrl* txtCtrl); + + void OnUpdateUI(wxUpdateUIEvent& event); + void OnChecked(wxCommandEvent& event); + void OnKillFocus( wxFocusEvent &event ); + + void ApplyValidator(); + +private: + // Special validator for our checkboxes + class StyleValidator : public wxValidator + { + public: + StyleValidator(long* style) { m_style = style; } + + virtual bool Validate(wxWindow *WXUNUSED(parent)) wxOVERRIDE { return true; } + virtual wxObject* Clone() const wxOVERRIDE { return new StyleValidator(*this); } + + // Called to transfer data to the window + virtual bool TransferToWindow() wxOVERRIDE; + + // Called to transfer data from the window + virtual bool TransferFromWindow() wxOVERRIDE; + + private: + long* m_style; + }; + +private: + bool HasFlag(wxTextValidatorStyle style) const + { + return (m_validatorStyle & style) != 0; + } + + enum + { + // CheckBoxes Ids (should be in sync with wxTextValidatorStyle) + Id_None = wxID_HIGHEST, + Id_Empty, + Id_Ascii, + Id_Alpha, + Id_Alphanumeric, + Id_Digits, + Id_Numeric, + Id_IncludeList, + Id_IncludeCharList, + Id_ExcludeList, + Id_ExcludeCharList, + Id_Xdigits, + Id_Space, + + // TextCtrls Ids + Id_IncludeListTxt, + Id_IncludeCharListTxt, + Id_ExcludeListTxt, + Id_ExcludeCharListTxt, + }; + + wxTextCtrl* const m_txtCtrl; + + bool m_noValidation; + long m_validatorStyle; + + wxString m_charIncludes; + wxString m_charExcludes; + wxArrayString m_includes; + wxArrayString m_excludes; +}; + class MyData { public: diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 04f85840e2..7da7621209 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -23,6 +23,7 @@ #include #include "wx/textctrl.h" #include "wx/combobox.h" + #include "wx/log.h" #include "wx/utils.h" #include "wx/msgdlg.h" #include "wx/intl.h" @@ -76,25 +77,6 @@ wxTextValidator::wxTextValidator(const wxTextValidator& val) void wxTextValidator::SetStyle(long style) { m_validatorStyle = style; - -#if wxDEBUG_LEVEL - int check; - check = (int)HasFlag(wxFILTER_ALPHA) + (int)HasFlag(wxFILTER_ALPHANUMERIC) + - (int)HasFlag(wxFILTER_DIGITS) + (int)HasFlag(wxFILTER_NUMERIC); - wxASSERT_MSG(check <= 1, - "It makes sense to use only one of the wxFILTER_ALPHA/wxFILTER_ALPHANUMERIC/" - "wxFILTER_SIMPLE_NUMBER/wxFILTER_NUMERIC styles"); - - wxASSERT_MSG(((int)HasFlag(wxFILTER_INCLUDE_LIST) + (int)HasFlag(wxFILTER_INCLUDE_CHAR_LIST) <= 1) && - ((int)HasFlag(wxFILTER_EXCLUDE_LIST) + (int)HasFlag(wxFILTER_EXCLUDE_CHAR_LIST) <= 1), - "Using both wxFILTER_[IN|EX]CLUDE_LIST _and_ wxFILTER_[IN|EX]CLUDE_CHAR_LIST " - "doesn't work since wxTextValidator internally uses the same array for both"); - - check = (int)HasFlag(wxFILTER_INCLUDE_LIST) + (int)HasFlag(wxFILTER_INCLUDE_CHAR_LIST) + - (int)HasFlag(wxFILTER_EXCLUDE_LIST) + (int)HasFlag(wxFILTER_EXCLUDE_CHAR_LIST); - wxASSERT_MSG(check <= 1, - "Using both an include/exclude list may lead to unexpected results"); -#endif // wxDEBUG_LEVEL } bool wxTextValidator::Copy(const wxTextValidator& val) @@ -102,10 +84,12 @@ bool wxTextValidator::Copy(const wxTextValidator& val) wxValidator::Copy(val); m_validatorStyle = val.m_validatorStyle; - m_stringValue = val.m_stringValue; + m_stringValue = val.m_stringValue; - m_includes = val.m_includes; - m_excludes = val.m_excludes; + m_charIncludes = val.m_charIncludes; + m_charExcludes = val.m_charExcludes; + m_includes = val.m_includes; + m_excludes = val.m_excludes; return true; } @@ -153,25 +137,7 @@ bool wxTextValidator::Validate(wxWindow *parent) if ( !text ) return false; - wxString val(text->GetValue()); - - wxString errormsg; - - // We can only do some kinds of validation once the input is complete, so - // check for them here: - if ( HasFlag(wxFILTER_EMPTY) && val.empty() ) - errormsg = _("Required information entry is empty."); - else if ( HasFlag(wxFILTER_INCLUDE_LIST) && m_includes.Index(val) == wxNOT_FOUND ) - errormsg = wxString::Format(_("'%s' is not one of the valid strings"), val); - else if ( HasFlag(wxFILTER_EXCLUDE_LIST) && m_excludes.Index(val) != wxNOT_FOUND ) - errormsg = wxString::Format(_("'%s' is one of the invalid strings"), val); - else if ( !(errormsg = IsValid(val)).empty() ) - { - // NB: this format string should always contain exactly one '%s' - wxString buf; - buf.Printf(errormsg, val.c_str()); - errormsg = buf; - } + const wxString& errormsg = IsValid(text->GetValue()); if ( !errormsg.empty() ) { @@ -215,89 +181,98 @@ bool wxTextValidator::TransferFromWindow() return true; } -// IRIX mipsPro refuses to compile wxStringCheck() if func is inline so -// let's work around this by using this non-template function instead of -// wxStringCheck(). And while this might be fractionally less efficient because -// the function call won't be inlined like this, we don't care enough about -// this to add extra #ifs for non-IRIX case. -namespace +wxString wxTextValidator::IsValid(const wxString& str) const { + if ( HasFlag(wxFILTER_EMPTY) && str.empty() ) + return _("Required information entry is empty."); + else if ( IsExcluded(str) ) + return wxString::Format(_("'%s' is one of the invalid strings"), str); + else if ( !IsIncluded(str) ) + return wxString::Format(_("'%s' is not one of the valid strings"), str); -bool CheckString(bool (*func)(const wxUniChar&), const wxString& str) -{ - for ( wxString::const_iterator i = str.begin(); i != str.end(); ++i ) + // check the whole string for invalid chars. + for ( wxString::const_iterator i = str.begin(), end = str.end(); + i != end; ++i ) { - if ( !func(*i) ) - return false; + if ( !IsValidChar(*i) ) + { + return wxString::Format( + _("'%s' contains invalid character(s)"), str); + } } - return true; + return wxString(); } -} // anonymous namespace - -wxString wxTextValidator::IsValid(const wxString& val) const -{ - // wxFILTER_EMPTY is checked for in wxTextValidator::Validate - - if ( HasFlag(wxFILTER_ASCII) && !val.IsAscii() ) - return _("'%s' should only contain ASCII characters."); - if ( HasFlag(wxFILTER_ALPHA) && !CheckString(wxIsalpha, val) ) - return _("'%s' should only contain alphabetic characters."); - if ( HasFlag(wxFILTER_ALPHANUMERIC) && !CheckString(wxIsalnum, val) ) - return _("'%s' should only contain alphabetic or numeric characters."); - if ( HasFlag(wxFILTER_DIGITS) && !CheckString(wxIsdigit, val) ) - return _("'%s' should only contain digits."); - if ( HasFlag(wxFILTER_NUMERIC) && !wxIsNumeric(val) ) - return _("'%s' should be numeric."); - if ( HasFlag(wxFILTER_INCLUDE_CHAR_LIST) && !ContainsOnlyIncludedCharacters(val) ) - return _("'%s' doesn't consist only of valid characters"); - if ( HasFlag(wxFILTER_EXCLUDE_CHAR_LIST) && ContainsExcludedCharacters(val) ) - return _("'%s' contains illegal characters"); - - return wxEmptyString; -} - -bool wxTextValidator::ContainsOnlyIncludedCharacters(const wxString& val) const -{ - for ( wxString::const_iterator i = val.begin(); i != val.end(); ++i ) - if (m_includes.Index((wxString) *i) == wxNOT_FOUND) - // one character of 'val' is NOT present in m_includes... - return false; - - // all characters of 'val' are present in m_includes - return true; -} - -bool wxTextValidator::ContainsExcludedCharacters(const wxString& val) const -{ - for ( wxString::const_iterator i = val.begin(); i != val.end(); ++i ) - if (m_excludes.Index((wxString) *i) != wxNOT_FOUND) - // one character of 'val' is present in m_excludes... - return true; - - // all characters of 'val' are NOT present in m_excludes - return false; -} void wxTextValidator::SetCharIncludes(const wxString& chars) { - wxArrayString arr; + m_charIncludes.clear(); - for ( wxString::const_iterator i = chars.begin(); i != chars.end(); ++i ) - arr.Add(*i); + AddCharIncludes(chars); +} - SetIncludes(arr); +void wxTextValidator::AddCharIncludes(const wxString& chars) +{ + m_charIncludes += chars; } void wxTextValidator::SetCharExcludes(const wxString& chars) { - wxArrayString arr; + m_charExcludes.clear(); - for ( wxString::const_iterator i = chars.begin(); i != chars.end(); ++i ) - arr.Add(*i); + AddCharExcludes(chars); +} - SetExcludes(arr); +void wxTextValidator::AddCharExcludes(const wxString& chars) +{ + m_charExcludes += chars; +} + +void wxTextValidator::SetIncludes(const wxArrayString& includes) +{ + // preserve compatibily with versions prior 3.1.3 which used m_includes + // to store the list of char includes. + if ( HasFlag(wxFILTER_INCLUDE_CHAR_LIST) ) + { + for ( wxArrayString::const_iterator i = includes.begin(), + end = includes.end(); i != end; ++i ) + { + AddCharIncludes(*i); + } + + return; + } + + m_includes = includes; +} + +void wxTextValidator::AddInclude(const wxString& include) +{ + m_includes.push_back(include); +} + +void wxTextValidator::SetExcludes(const wxArrayString& excludes) +{ + // preserve compatibily with versions prior 3.1.3 which used m_excludes + // to store the list of char excludes. + if ( HasFlag(wxFILTER_EXCLUDE_CHAR_LIST) ) + { + for ( wxArrayString::const_iterator i = excludes.begin(), + end = excludes.end(); i != end; ++i ) + { + AddCharExcludes(*i); + } + + return; + } + + m_excludes = excludes; +} + +void wxTextValidator::AddExclude(const wxString& exclude) +{ + m_excludes.push_back(exclude); } void wxTextValidator::OnChar(wxKeyEvent& event) @@ -313,7 +288,7 @@ void wxTextValidator::OnChar(wxKeyEvent& event) int keyCode = event.GetUnicodeKey(); #else // !wxUSE_UNICODE int keyCode = event.GetKeyCode(); - if (keyCode > WXK_START) + if ( keyCode > WXK_START ) return; #endif // wxUSE_UNICODE/!wxUSE_UNICODE @@ -321,8 +296,8 @@ void wxTextValidator::OnChar(wxKeyEvent& event) if (keyCode < WXK_SPACE || keyCode == WXK_DELETE) return; - wxString str((wxUniChar)keyCode, 1); - if (IsValid(str).empty()) + // Filter out invalid characters + if ( IsValidChar(static_cast(keyCode)) ) return; if ( !wxValidator::IsSilent() ) @@ -332,6 +307,71 @@ void wxTextValidator::OnChar(wxKeyEvent& event) event.Skip(false); } +bool wxTextValidator::IsValidChar(const wxUniChar& c) const +{ + if ( !m_validatorStyle ) // no filtering if HasFlag(wxFILTER_NONE) + return true; + + if ( IsCharExcluded(c) ) // disallow any char in the m_charExcludes. + return false; + + if ( IsCharIncluded(c) ) // allow any char in the m_charIncludes. + return true; + + if ( !HasFlag(wxFILTER_CC) ) + { + // Validity is entirely determined by the exclude/include char lists + // and this character is in neither, so consider that it is valid if + // and only if we accept anything. + return !HasFlag(wxFILTER_INCLUDE_CHAR_LIST); + } + + if ( HasFlag(wxFILTER_SPACE) && wxIsspace(c) ) + return true; + if ( HasFlag(wxFILTER_ASCII) && c.IsAscii() ) + return true; + if ( HasFlag(wxFILTER_NUMERIC) && wxIsNumeric(c) ) + return true; + if ( HasFlag(wxFILTER_ALPHANUMERIC) && wxIsalnum(c) ) + return true; + if ( HasFlag(wxFILTER_ALPHA) && wxIsalpha(c) ) + return true; + if ( HasFlag(wxFILTER_DIGITS) && wxIsdigit(c) ) + return true; + if ( HasFlag(wxFILTER_XDIGITS) && wxIsxdigit(c) ) + return true; + + // If we are here, this means that the char c does not belong to any of the + // character classes checked above (e.g. emoji chars) so just return false. + + return false; +} + +// kept for compatibility reasons. +bool wxTextValidator::ContainsOnlyIncludedCharacters(const wxString& str) const +{ + for ( wxString::const_iterator i = str.begin(), end = str.end(); + i != end; ++i ) + { + if ( !IsCharIncluded(*i) ) + return false; + } + + return true; +} + +// kept for compatibility reasons. +bool wxTextValidator::ContainsExcludedCharacters(const wxString& str) const +{ + for ( wxString::const_iterator i = str.begin(), end = str.end(); + i != end; ++i ) + { + if ( IsCharExcluded(*i) ) + return true; + } + + return false; +} #endif // wxUSE_VALIDATORS && (wxUSE_TEXTCTRL || wxUSE_COMBOBOX) diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index 7a405e2c9b..df0ac9c572 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -262,9 +262,7 @@ private: if ( m_combo ) { - wxArrayString allowedChars; - for ( wxChar c = wxT('0'); c <= wxT('9'); c++ ) - allowedChars.Add(wxString(c, 1)); + wxString allowedChars = wxS("0123456789"); const wxChar *p2 = m_format.c_str(); while ( *p2 ) @@ -272,12 +270,12 @@ private: if ( *p2 == '%') p2 += 2; else - allowedChars.Add(wxString(*p2++, 1)); + allowedChars << (*p2++); // append char } #if wxUSE_VALIDATORS wxTextValidator tv(wxFILTER_INCLUDE_CHAR_LIST); - tv.SetIncludes(allowedChars); + tv.SetCharIncludes(allowedChars); m_combo->SetValidator(tv); #endif diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 2587f841b5..ba3889d90e 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -160,47 +160,41 @@ wxNumericPropertyValidator:: wxNumericPropertyValidator( NumericType numericType, int base ) : wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST) { - wxArrayString arr; - arr.Add(wxS("0")); - arr.Add(wxS("1")); - arr.Add(wxS("2")); - arr.Add(wxS("3")); - arr.Add(wxS("4")); - arr.Add(wxS("5")); - arr.Add(wxS("6")); - arr.Add(wxS("7")); + long style = GetStyle(); - if ( base >= 10 ) + // always allow plus and minus signs + wxString allowedChars("+-"); + + switch ( base ) { - arr.Add(wxS("8")); - arr.Add(wxS("9")); - if ( base >= 16 ) - { - arr.Add(wxS("a")); arr.Add(wxS("A")); - arr.Add(wxS("b")); arr.Add(wxS("B")); - arr.Add(wxS("c")); arr.Add(wxS("C")); - arr.Add(wxS("d")); arr.Add(wxS("D")); - arr.Add(wxS("e")); arr.Add(wxS("E")); - arr.Add(wxS("f")); arr.Add(wxS("F")); - } + case 2: + allowedChars += wxS("01"); + break; + case 8: + allowedChars += wxS("01234567"); + break; + case 10: + style |= wxFILTER_DIGITS; + break; + case 16: + style |= wxFILTER_XDIGITS; + break; + + default: + wxLogWarning( _("Unknown base %d. Base 10 will be used."), base ); + style |= wxFILTER_DIGITS; } - if ( numericType == Signed ) + if ( numericType == Float ) { - arr.Add(wxS("+")); - arr.Add(wxS("-")); - } - else if ( numericType == Float ) - { - arr.Add(wxS("+")); - arr.Add(wxS("-")); - arr.Add(wxS("e")); arr.Add(wxS("E")); + allowedChars += wxS("eE"); // Use locale-specific decimal point - arr.Add(wxString::Format(wxS("%g"), 1.1)[1]); + allowedChars += wxString::Format(wxS("%g"), 1.1)[1]; } - SetIncludes(arr); + SetStyle(style); + SetCharIncludes(allowedChars); } bool wxNumericPropertyValidator::Validate(wxWindow* parent) @@ -2021,15 +2015,7 @@ wxValidator* wxFileProperty::GetClassValidator() static wxString v; wxTextValidator* validator = new wxTextValidator(wxFILTER_EXCLUDE_CHAR_LIST,&v); - wxArrayString exChars; - exChars.Add(wxS("?")); - exChars.Add(wxS("*")); - exChars.Add(wxS("|")); - exChars.Add(wxS("<")); - exChars.Add(wxS(">")); - exChars.Add(wxS("\"")); - - validator->SetExcludes(exChars); + validator->SetCharExcludes(wxString("?*|<>\"")); WX_PG_DOGETVALIDATOR_EXIT(validator) #else diff --git a/tests/Makefile.in b/tests/Makefile.in index 9fdee154fb..14e4f749e9 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -260,6 +260,7 @@ TEST_GUI_OBJECTS = \ test_gui_wrapsizer.o \ test_gui_toplevel.o \ test_gui_valnum.o \ + test_gui_valtext.o \ test_gui_clientsize.o \ test_gui_setsize.o \ test_gui_xrctest.o @@ -1052,6 +1053,9 @@ test_gui_toplevel.o: $(srcdir)/toplevel/toplevel.cpp $(TEST_GUI_ODEP) test_gui_valnum.o: $(srcdir)/validators/valnum.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/validators/valnum.cpp +test_gui_valtext.o: $(srcdir)/validators/valtext.cpp $(TEST_GUI_ODEP) + $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/validators/valtext.cpp + test_gui_clientsize.o: $(srcdir)/window/clientsize.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/window/clientsize.cpp diff --git a/tests/makefile.bcc b/tests/makefile.bcc index 97c1cdd1fb..51c88f2ddd 100644 --- a/tests/makefile.bcc +++ b/tests/makefile.bcc @@ -247,6 +247,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_wrapsizer.obj \ $(OBJS)\test_gui_toplevel.obj \ $(OBJS)\test_gui_valnum.obj \ + $(OBJS)\test_gui_valtext.obj \ $(OBJS)\test_gui_clientsize.obj \ $(OBJS)\test_gui_setsize.obj \ $(OBJS)\test_gui_xrctest.obj @@ -1107,6 +1108,9 @@ $(OBJS)\test_gui_toplevel.obj: .\toplevel\toplevel.cpp $(OBJS)\test_gui_valnum.obj: .\validators\valnum.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\validators\valnum.cpp +$(OBJS)\test_gui_valtext.obj: .\validators\valtext.cpp + $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\validators\valtext.cpp + $(OBJS)\test_gui_clientsize.obj: .\window\clientsize.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\window\clientsize.cpp diff --git a/tests/makefile.gcc b/tests/makefile.gcc index 1e70e93aaa..c7894bdeb1 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -242,6 +242,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_wrapsizer.o \ $(OBJS)\test_gui_toplevel.o \ $(OBJS)\test_gui_valnum.o \ + $(OBJS)\test_gui_valtext.o \ $(OBJS)\test_gui_clientsize.o \ $(OBJS)\test_gui_setsize.o \ $(OBJS)\test_gui_xrctest.o @@ -1084,6 +1085,9 @@ $(OBJS)\test_gui_toplevel.o: ./toplevel/toplevel.cpp $(OBJS)\test_gui_valnum.o: ./validators/valnum.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_gui_valtext.o: ./validators/valtext.cpp + $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_gui_clientsize.o: ./window/clientsize.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index 204a77a4f8..5e104bd30e 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -253,6 +253,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_wrapsizer.obj \ $(OBJS)\test_gui_toplevel.obj \ $(OBJS)\test_gui_valnum.obj \ + $(OBJS)\test_gui_valtext.obj \ $(OBJS)\test_gui_clientsize.obj \ $(OBJS)\test_gui_setsize.obj \ $(OBJS)\test_gui_xrctest.obj @@ -1298,6 +1299,9 @@ $(OBJS)\test_gui_toplevel.obj: .\toplevel\toplevel.cpp $(OBJS)\test_gui_valnum.obj: .\validators\valnum.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\validators\valnum.cpp +$(OBJS)\test_gui_valtext.obj: .\validators\valtext.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\validators\valtext.cpp + $(OBJS)\test_gui_clientsize.obj: .\window\clientsize.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\window\clientsize.cpp diff --git a/tests/test.bkl b/tests/test.bkl index 10d70213c2..8acc4145ff 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -272,6 +272,7 @@ sizers/wrapsizer.cpp toplevel/toplevel.cpp validators/valnum.cpp + validators/valtext.cpp window/clientsize.cpp window/setsize.cpp xml/xrctest.cpp diff --git a/tests/test_vc7_test_gui.vcproj b/tests/test_vc7_test_gui.vcproj index f52b5ad5c6..7f908ef8e5 100644 --- a/tests/test_vc7_test_gui.vcproj +++ b/tests/test_vc7_test_gui.vcproj @@ -595,6 +595,9 @@ + + diff --git a/tests/test_vc8_test_gui.vcproj b/tests/test_vc8_test_gui.vcproj index 2b7d9b7722..86ddb5dea7 100644 --- a/tests/test_vc8_test_gui.vcproj +++ b/tests/test_vc8_test_gui.vcproj @@ -1262,6 +1262,10 @@ RelativePath=".\validators\valnum.cpp" > + + diff --git a/tests/test_vc9_test_gui.vcproj b/tests/test_vc9_test_gui.vcproj index f698792488..25d5167c03 100644 --- a/tests/test_vc9_test_gui.vcproj +++ b/tests/test_vc9_test_gui.vcproj @@ -1234,6 +1234,10 @@ RelativePath=".\validators\valnum.cpp" > + + diff --git a/tests/validators/valtext.cpp b/tests/validators/valtext.cpp new file mode 100644 index 0000000000..9c2dbb334f --- /dev/null +++ b/tests/validators/valtext.cpp @@ -0,0 +1,190 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: tests/validators/valtext.cpp +// Purpose: wxTextValidator unit test +// Author: Ali Kettab +// Created: 2019-01-01 +/////////////////////////////////////////////////////////////////////////////// + +#include "testprec.h" + +#if wxUSE_VALIDATORS && wxUSE_UIACTIONSIMULATOR + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/textctrl.h" + #include "wx/valtext.h" +#endif // WX_PRECOMP + +#include "wx/uiaction.h" + +class TextValidatorTestCase +{ +public: + TextValidatorTestCase() + : m_text(new wxTextCtrl(wxTheApp->GetTopWindow(), wxID_ANY)) + { + } + + ~TextValidatorTestCase() + { + delete m_text; + } + +protected: + wxTextCtrl* const m_text; +}; + +#define TEXT_VALIDATOR_TEST_CASE(name, tags) \ + TEST_CASE_METHOD(TextValidatorTestCase, name, tags) + +TEXT_VALIDATOR_TEST_CASE("wxTextValidator::IsValid", "[wxTextValidator][filters]") +{ + wxString value = ""; + wxTextValidator val(wxFILTER_NONE, &value); + + SECTION("wxFILTER_NONE - no filtering should take place") + { + CHECK( val.IsValid("wx-90.?! @_~E+{").empty() ); + } + + SECTION("wxFILTER_EMPTY - empty strings are filtered out") + { + val.SetStyle(wxFILTER_EMPTY); + + CHECK( !val.IsValid("").empty() ); + CHECK( val.IsValid(" ").empty() ); // space is valid + } + + SECTION("wxFILTER_ASCII - non-ASCII characters are filtered out") + { + val.SetStyle(wxFILTER_ASCII); + + CHECK( val.IsValid("wx-90.?! @_~E+{").empty() ); + } + + SECTION("wxFILTER_ALPHA - non-alpha characters are filtered out") + { + val.SetStyle(wxFILTER_ALPHA); + + CHECK( val.IsValid("wx").empty() ); + CHECK( !val.IsValid("wx_").empty() ); // _ is not alpha + } + + SECTION("wxFILTER_ALPHANUMERIC - non-alphanumeric characters are filtered out") + { + val.SetStyle(wxFILTER_ALPHANUMERIC); + + CHECK( val.IsValid("wx01").empty() ); + CHECK( !val.IsValid("wx 01").empty() ); // 'space' is not alphanumeric + } + + SECTION("wxFILTER_DIGITS - non-digit characters are filtered out") + { + val.SetStyle(wxFILTER_DIGITS); + + CHECK( val.IsValid("97").empty() ); + CHECK( !val.IsValid("9.7").empty() ); // . is not digit + } + + SECTION("wxFILTER_XDIGITS - non-xdigit characters are filtered out") + { + val.SetStyle(wxFILTER_XDIGITS); + + CHECK( val.IsValid("90AEF").empty() ); + CHECK( !val.IsValid("90GEF").empty() ); // G is not xdigit + } + + SECTION("wxFILTER_NUMERIC - non-numeric characters are filtered out") + { + val.SetStyle(wxFILTER_NUMERIC); + + CHECK( val.IsValid("+90.e-2").empty() ); + CHECK( !val.IsValid("-8.5#0").empty() ); // # is not numeric + } + + SECTION("wxFILTER_INCLUDE_LIST - use include list") + { + val.SetStyle(wxFILTER_INCLUDE_LIST); + + wxArrayString includes; + includes.push_back("wxMSW"); + includes.push_back("wxGTK"); + includes.push_back("wxOSX"); + val.SetIncludes(includes); + + CHECK( val.IsValid("wxGTK").empty() ); + CHECK( !val.IsValid("wxQT").empty() ); // wxQT is not included + + SECTION("wxFILTER_EXCLUDE_LIST - use exclude with include list") + { + wxArrayString excludes; + excludes.push_back("wxGTK"); + excludes.push_back("wxGTK1"); + val.SetExcludes(excludes); + + CHECK( val.IsValid("wxOSX").empty() ); + CHECK( !val.IsValid("wxGTK").empty() ); // wxGTK now excluded + } + } + + SECTION("wxFILTER_EXCLUDE_LIST - use exclude list") + { + val.SetStyle(wxFILTER_EXCLUDE_LIST); + + wxArrayString excludes; + excludes.push_back("wxMSW"); + excludes.push_back("wxGTK"); + excludes.push_back("wxOSX"); + val.SetExcludes(excludes); + + CHECK( val.IsValid("wxQT & wxUNIV").empty() ); + CHECK( !val.IsValid("wxMSW").empty() ); // wxMSW is excluded + + SECTION("wxFILTER_INCLUDE_LIST - use include with exclude list") + { + wxArrayString includes; + includes.push_back("wxGTK"); + val.SetIncludes(includes); // exclusion takes priority over inclusion. + + CHECK( val.IsValid("wxUNIV").empty() ); + CHECK( !val.IsValid("wxMSW").empty() ); // wxMSW still excluded + } + } + + SECTION("wxFILTER_INCLUDE_CHAR_LIST - use include char list") + { + val.SetStyle(wxFILTER_INCLUDE_CHAR_LIST); + val.SetCharIncludes("tuvwxyz.012+-"); + + CHECK( val.IsValid("0.2t+z-1").empty() ); + CHECK( !val.IsValid("x*y").empty() ); // * is not included + + val.AddCharIncludes("*"); + + CHECK( val.IsValid("x*y").empty() ); // * now included + CHECK( !val.IsValid("x%y").empty() ); // % is not included + + val.AddCharExcludes("*"); // exclusion takes priority over inclusion. + + CHECK( !val.IsValid("x*y").empty() ); // * now excluded + } + + SECTION("wxFILTER_EXCLUDE_CHAR_LIST - use exclude char list") + { + val.SetStyle(wxFILTER_EXCLUDE_CHAR_LIST); + val.SetCharExcludes("tuvwxyz.012+-"); + + CHECK( val.IsValid("A*B=?").empty() ); + CHECK( !val.IsValid("0.6/t").empty() ); // t is excluded + + val.AddCharIncludes("t"); // exclusion takes priority over inclusion. + + CHECK( !val.IsValid("0.6/t").empty() ); // t still excluded + } +} + +#endif // wxUSE_VALIDATORS && wxUSE_UIACTIONSIMULATOR From cfe4a10995dd07dee04970fa4581e69cb71ac383 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Jan 2019 04:26:34 +0100 Subject: [PATCH 212/553] Add manually created MSVS 201x solutions files for wxrc As with the tests, we don't have any way to generate these files for now, but we should allow wxWidgets users to build wxrc for themselves without using nmake, when using modern MSVS versions, so create the required files manually -- this is not ideal, but better than nothing. --- .gitignore | 2 +- utils/wxrc/wxrc.vcxproj | 160 ++++++++++++++++++++++++++++++++ utils/wxrc/wxrc.vcxproj.filters | 14 +++ utils/wxrc/wxrc_vc10.sln | 29 ++++++ utils/wxrc/wxrc_vc11.sln | 29 ++++++ utils/wxrc/wxrc_vc12.sln | 31 +++++++ utils/wxrc/wxrc_vc14.sln | 31 +++++++ utils/wxrc/wxrc_vc15.sln | 31 +++++++ 8 files changed, 326 insertions(+), 1 deletion(-) create mode 100644 utils/wxrc/wxrc.vcxproj create mode 100644 utils/wxrc/wxrc.vcxproj.filters create mode 100644 utils/wxrc/wxrc_vc10.sln create mode 100644 utils/wxrc/wxrc_vc11.sln create mode 100644 utils/wxrc/wxrc_vc12.sln create mode 100644 utils/wxrc/wxrc_vc14.sln create mode 100644 utils/wxrc/wxrc_vc15.sln diff --git a/.gitignore b/.gitignore index 35ed7d87f9..22753a30f2 100644 --- a/.gitignore +++ b/.gitignore @@ -474,4 +474,4 @@ /utils/hhp2cached/*Carbon?Release* # /utils/wxrc/ -/utils/wxrc/*.sln +/utils/wxrc/wxrc_vc[789].sln diff --git a/utils/wxrc/wxrc.vcxproj b/utils/wxrc/wxrc.vcxproj new file mode 100644 index 0000000000..83bf506413 --- /dev/null +++ b/utils/wxrc/wxrc.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8} + Win32Proj + wxrc + 10.0.17134.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + true + $(wxIntRootDir) + $(wxIntRootDir) + + + true + $(wxIntRootDir) + $(wxIntRootDir) + + + false + $(wxIntRootDir) + $(wxIntRootDir) + + + false + $(wxIntRootDir) + $(wxIntRootDir) + + + + Level4 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level4 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level4 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level4 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/utils/wxrc/wxrc.vcxproj.filters b/utils/wxrc/wxrc.vcxproj.filters new file mode 100644 index 0000000000..83be04486c --- /dev/null +++ b/utils/wxrc/wxrc.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + diff --git a/utils/wxrc/wxrc_vc10.sln b/utils/wxrc/wxrc_vc10.sln new file mode 100644 index 0000000000..92d491bb8b --- /dev/null +++ b/utils/wxrc/wxrc_vc10.sln @@ -0,0 +1,29 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxrc", "wxrc.vcxproj", "{AF3B845A-1816-49F3-AB4B-A1B418DF33A8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.ActiveCfg = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.Build.0 = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.ActiveCfg = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.Build.0 = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.ActiveCfg = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.Build.0 = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.ActiveCfg = Release|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {76B59F06-8DB6-4844-BEF7-C3403271EE5D} + EndGlobalSection +EndGlobal diff --git a/utils/wxrc/wxrc_vc11.sln b/utils/wxrc/wxrc_vc11.sln new file mode 100644 index 0000000000..d20477314d --- /dev/null +++ b/utils/wxrc/wxrc_vc11.sln @@ -0,0 +1,29 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxrc", "wxrc.vcxproj", "{AF3B845A-1816-49F3-AB4B-A1B418DF33A8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.ActiveCfg = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.Build.0 = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.ActiveCfg = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.Build.0 = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.ActiveCfg = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.Build.0 = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.ActiveCfg = Release|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {76B59F06-8DB6-4844-BEF7-C3403271EE5D} + EndGlobalSection +EndGlobal diff --git a/utils/wxrc/wxrc_vc12.sln b/utils/wxrc/wxrc_vc12.sln new file mode 100644 index 0000000000..b2b2072c47 --- /dev/null +++ b/utils/wxrc/wxrc_vc12.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxrc", "wxrc.vcxproj", "{AF3B845A-1816-49F3-AB4B-A1B418DF33A8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.ActiveCfg = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.Build.0 = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.ActiveCfg = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.Build.0 = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.ActiveCfg = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.Build.0 = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.ActiveCfg = Release|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {76B59F06-8DB6-4844-BEF7-C3403271EE5D} + EndGlobalSection +EndGlobal diff --git a/utils/wxrc/wxrc_vc14.sln b/utils/wxrc/wxrc_vc14.sln new file mode 100644 index 0000000000..5ad28ad40d --- /dev/null +++ b/utils/wxrc/wxrc_vc14.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxrc", "wxrc.vcxproj", "{AF3B845A-1816-49F3-AB4B-A1B418DF33A8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.ActiveCfg = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.Build.0 = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.ActiveCfg = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.Build.0 = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.ActiveCfg = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.Build.0 = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.ActiveCfg = Release|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {76B59F06-8DB6-4844-BEF7-C3403271EE5D} + EndGlobalSection +EndGlobal diff --git a/utils/wxrc/wxrc_vc15.sln b/utils/wxrc/wxrc_vc15.sln new file mode 100644 index 0000000000..a15a450568 --- /dev/null +++ b/utils/wxrc/wxrc_vc15.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2026 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxrc", "wxrc.vcxproj", "{AF3B845A-1816-49F3-AB4B-A1B418DF33A8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.ActiveCfg = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x64.Build.0 = Debug|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.ActiveCfg = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Debug|x86.Build.0 = Debug|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.ActiveCfg = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x64.Build.0 = Release|x64 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.ActiveCfg = Release|Win32 + {AF3B845A-1816-49F3-AB4B-A1B418DF33A8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {76B59F06-8DB6-4844-BEF7-C3403271EE5D} + EndGlobalSection +EndGlobal From 9ab3acee18d906981cdeb2436a5ddb71ae5ea647 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Jan 2019 04:29:45 +0100 Subject: [PATCH 213/553] Don't allow using "-" for unsigned entries in propgrid The changes of 36f6f8ad49038089413dd5e3b3bee151ab78112c allowed using "-" (and also "+") characters even for the unsigned properties, which hadn't been the case before and doesn't seem desirable, so undo this part of the changes. See #1093. --- src/propgrid/props.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index ba3889d90e..d67d9012c7 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -162,8 +162,7 @@ wxNumericPropertyValidator:: { long style = GetStyle(); - // always allow plus and minus signs - wxString allowedChars("+-"); + wxString allowedChars; switch ( base ) { @@ -185,7 +184,11 @@ wxNumericPropertyValidator:: style |= wxFILTER_DIGITS; } - if ( numericType == Float ) + if ( numericType == Signed ) + { + allowedChars += wxS("-+"); + } + else if ( numericType == Float ) { allowedChars += wxS("eE"); From 00030b56cbd617ea2b3c6fffd5cd66a70e0113a4 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 7 Jan 2019 09:18:50 +0000 Subject: [PATCH 214/553] Fix implementation details being used as base class for RTTI in wxQT --- src/qt/app.cpp | 2 +- src/qt/brush.cpp | 2 +- src/qt/dcclient.cpp | 4 ++-- src/qt/dcscreen.cpp | 2 +- src/qt/msgdlg.cpp | 2 +- src/qt/palette.cpp | 2 +- src/qt/pen.cpp | 2 +- src/qt/region.cpp | 2 +- src/qt/tglbtn.cpp | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/qt/app.cpp b/src/qt/app.cpp index 93f0ccd3d8..57bd0dd049 100644 --- a/src/qt/app.cpp +++ b/src/qt/app.cpp @@ -15,7 +15,7 @@ #include #include -wxIMPLEMENT_DYNAMIC_CLASS(wxApp, wxAppBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler); wxApp::wxApp() { diff --git a/src/qt/brush.cpp b/src/qt/brush.cpp index 6798e438f1..fc09e71965 100644 --- a/src/qt/brush.cpp +++ b/src/qt/brush.cpp @@ -15,7 +15,7 @@ #include -wxIMPLEMENT_DYNAMIC_CLASS(wxBrush,wxBrushBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject); static Qt::BrushStyle ConvertBrushStyle(wxBrushStyle style) { diff --git a/src/qt/dcclient.cpp b/src/qt/dcclient.cpp index 9c453e7226..d062f0455a 100644 --- a/src/qt/dcclient.cpp +++ b/src/qt/dcclient.cpp @@ -61,7 +61,7 @@ wxWindowDCImpl::~wxWindowDCImpl() //############################################################################## -wxIMPLEMENT_CLASS(wxClientDCImpl,wxQtDCImpl); +wxIMPLEMENT_CLASS(wxClientDCImpl,wxWindowDCImpl); wxClientDCImpl::wxClientDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) @@ -121,7 +121,7 @@ wxClientDCImpl::~wxClientDCImpl() //############################################################################## -wxIMPLEMENT_CLASS(wxPaintDCImpl,wxQtDCImpl); +wxIMPLEMENT_CLASS(wxPaintDCImpl,wxClientDCImpl); wxPaintDCImpl::wxPaintDCImpl( wxDC *owner ) : wxWindowDCImpl( owner ) diff --git a/src/qt/dcscreen.cpp b/src/qt/dcscreen.cpp index 12b02f6715..1f08768ec0 100644 --- a/src/qt/dcscreen.cpp +++ b/src/qt/dcscreen.cpp @@ -16,7 +16,7 @@ #include #include -wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl); +wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxQtDCImpl); wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner ) : wxWindowDCImpl( owner ) diff --git a/src/qt/msgdlg.cpp b/src/qt/msgdlg.cpp index fd0a446f95..5fe264a242 100644 --- a/src/qt/msgdlg.cpp +++ b/src/qt/msgdlg.cpp @@ -111,7 +111,7 @@ wxMessageDialog::wxMessageDialog( wxWindow *parent, const wxString& message, PostCreation(); } -wxIMPLEMENT_CLASS(wxMessageDialog,wxMessageDialogBase); +wxIMPLEMENT_CLASS(wxMessageDialog,wxDialog); int wxMessageDialog::ShowModal() { diff --git a/src/qt/palette.cpp b/src/qt/palette.cpp index 9fadc79543..8c87a3a9c1 100644 --- a/src/qt/palette.cpp +++ b/src/qt/palette.cpp @@ -10,7 +10,7 @@ #include "wx/palette.h" -wxIMPLEMENT_DYNAMIC_CLASS(wxPalette,wxPaletteBase) +wxIMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject) wxPalette::wxPalette() { diff --git a/src/qt/pen.cpp b/src/qt/pen.cpp index e7310aaa9b..862443cd14 100644 --- a/src/qt/pen.cpp +++ b/src/qt/pen.cpp @@ -13,7 +13,7 @@ #include "wx/qt/private/utils.h" #include -wxIMPLEMENT_DYNAMIC_CLASS(wxPen,wxPenBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject); static Qt::PenStyle ConvertPenStyle(wxPenStyle style) { diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 0fa4a3db60..a0c3ea8698 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -53,7 +53,7 @@ class wxRegionRefData: public wxGDIRefData #define M_REGIONDATA ((wxRegionRefData *)m_refData)->m_qtRegion -wxIMPLEMENT_DYNAMIC_CLASS(wxRegion,wxRegionBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxRegion,wxGDIObject); wxRegion::wxRegion() { diff --git a/src/qt/tglbtn.cpp b/src/qt/tglbtn.cpp index 77ee85b15e..5797157286 100644 --- a/src/qt/tglbtn.cpp +++ b/src/qt/tglbtn.cpp @@ -54,7 +54,7 @@ void wxQtToggleButton::clicked( bool checked ) wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ); -wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButtonBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButton); wxBitmapToggleButton::wxBitmapToggleButton() { @@ -103,7 +103,7 @@ QWidget *wxBitmapToggleButton::GetHandle() const //############################################################################## -wxIMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxToggleButtonBase); +wxIMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl); wxToggleButton::wxToggleButton() { From 95b3486dc03c18a6b700499defa7a3c8f5bfd8eb Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 7 Jan 2019 10:38:16 +0000 Subject: [PATCH 215/553] Fix crash in wxAuiNotebook::DoGetBestSize --- src/aui/auibook.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 9c516a4690..ef362a056b 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3574,6 +3574,10 @@ wxSize wxAuiNotebook::DoGetBestSize() const // Store the current pane with its largest window dimensions layouts.push_back(wxAuiLayoutObject(bestPageSize, pInfo)); } + + if ( layouts.empty() ) + return wxSize(0, 0); + wxVectorSort(layouts); /* From 45fc60b5495ea4130511814ec08daa6a34c75131 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 7 Jan 2019 11:51:05 +0000 Subject: [PATCH 216/553] wxBitmapToggleButton's reported base class is wxControl --- src/qt/tglbtn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/tglbtn.cpp b/src/qt/tglbtn.cpp index 5797157286..8434179b9e 100644 --- a/src/qt/tglbtn.cpp +++ b/src/qt/tglbtn.cpp @@ -54,7 +54,7 @@ void wxQtToggleButton::clicked( bool checked ) wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ); -wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxToggleButton); +wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapToggleButton, wxControl); wxBitmapToggleButton::wxBitmapToggleButton() { From 8c64209df1789cb6da1702a6e4bbb6d8dda55075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20G=C3=B6pfert?= Date: Mon, 7 Jan 2019 11:56:08 +0100 Subject: [PATCH 217/553] ensure m_rowHeightCache is not NULL before accessing it --- src/generic/datavgen.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index ed8a60b549..aadd365495 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -710,7 +710,9 @@ public: bool Cleared(); void Resort() { - m_rowHeightCache->Clear(); + if ( m_rowHeightCache ) + m_rowHeightCache->Clear(); + if (!IsVirtualList()) { m_root->Resort(this); @@ -2752,7 +2754,7 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData } else { - if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + if ( m_rowHeightCache ) { // specific position (row) is unclear, so clear whole height cache m_rowHeightCache->Clear(); @@ -2899,7 +2901,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, return true; } - if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + if ( m_rowHeightCache ) m_rowHeightCache->Remove(GetRowByItem(parent) + itemPosInNode); // Delete the item from wxDataViewTreeNode representation: @@ -2966,7 +2968,7 @@ bool wxDataViewMainWindow::DoItemChanged(const wxDataViewItem & item, int view_c { if ( !IsVirtualList() ) { - if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + if ( m_rowHeightCache ) m_rowHeightCache->Remove(GetRowByItem(item)); // Move this node to its new correct place after it was updated. @@ -3018,7 +3020,9 @@ bool wxDataViewMainWindow::Cleared() DestroyTree(); m_selection.Clear(); m_currentRow = (unsigned)-1; - m_rowHeightCache->Clear(); + + if ( m_rowHeightCache ) + m_rowHeightCache->Clear(); if (GetModel()) { @@ -3348,7 +3352,7 @@ wxRect wxDataViewMainWindow::GetLinesRect( unsigned int rowFrom, unsigned int ro int wxDataViewMainWindow::GetLineStart( unsigned int row ) const { // check for the easy case first - if (!GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + if ( !m_rowHeightCache || !GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) ) return row * m_lineHeight; int start = 0; @@ -3378,7 +3382,7 @@ int wxDataViewMainWindow::GetLineStart( unsigned int row ) const int wxDataViewMainWindow::GetLineAt( unsigned int y ) const { // check for the easy case first - if ( !GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) ) + if ( !m_rowHeightCache || !GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) ) return y / m_lineHeight; unsigned int row = 0; @@ -3430,7 +3434,7 @@ int wxDataViewMainWindow::GetLineAt( unsigned int y ) const int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const { // check for the easy case first - if (!GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + if ( !m_rowHeightCache || !GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) ) return m_lineHeight; int height = 0; @@ -3613,7 +3617,7 @@ void wxDataViewMainWindow::Expand( unsigned int row ) if (!node->HasChildren()) return; - if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + if ( m_rowHeightCache ) { // Expand makes new rows visible thus we invalidates all following // rows in the height cache @@ -3669,7 +3673,7 @@ void wxDataViewMainWindow::Collapse(unsigned int row) if (!node->HasChildren()) return; - if (GetOwner()->HasFlag(wxDV_VARIABLE_LINE_HEIGHT)) + if ( m_rowHeightCache ) { // Collapse hides rows thus we invalidates all following // rows in the height cache From 14ca16ffaf7b5b02bea97ea4858ff21341c7ebc2 Mon Sep 17 00:00:00 2001 From: jensgoe Date: Fri, 21 Dec 2018 17:56:01 +0100 Subject: [PATCH 218/553] example for DataView with wxDV_VARIABLE_LINE_HEIGHT flag --- samples/dataview/dataview.cpp | 93 ++++++++++++++++++++++++++++++++++- samples/dataview/mymodels.cpp | 13 +++++ samples/dataview/mymodels.h | 11 +++++ 3 files changed, 116 insertions(+), 1 deletion(-) diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 51273a6106..b1e1f7c54b 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -165,11 +165,12 @@ private: // the controls stored in the various tabs of the main notebook: - wxDataViewCtrl* m_ctrl[4]; + wxDataViewCtrl* m_ctrl[5]; // the models associated with the first two DVC: wxObjectDataPtr m_music_model; + wxObjectDataPtr m_long_music_model; wxObjectDataPtr m_list_model; // other data: @@ -287,6 +288,53 @@ private: }; +// ---------------------------------------------------------------------------- +// MultiLineCustomRenderer +// ---------------------------------------------------------------------------- + +class MultiLineCustomRenderer : public wxDataViewCustomRenderer +{ +public: + // a simple renderer that wraps each word on a new line + explicit MultiLineCustomRenderer() + : wxDataViewCustomRenderer("string", wxDATAVIEW_CELL_INERT, 0) + { } + + virtual bool Render(wxRect rect, wxDC *dc, int state) wxOVERRIDE + { + RenderText(m_value, 0, rect, dc, state); + return true; + } + + virtual wxSize GetSize() const wxOVERRIDE + { + wxSize txtSize = GetTextExtent(m_value); + int lines = m_value.Freq('\n') + 1; + txtSize.SetHeight(txtSize.GetHeight() * lines); + return txtSize; + } + + virtual bool SetValue(const wxVariant &value) wxOVERRIDE + { + m_value = value.GetString(); + m_value.Replace(" ", "\n"); + return true; + } + + virtual bool GetValue(wxVariant &WXUNUSED(value)) const wxOVERRIDE { return true; } + +#if wxUSE_ACCESSIBILITY + virtual wxString GetAccessibleDescription() const wxOVERRIDE + { + return m_value; + } +#endif // wxUSE_ACCESSIBILITY + +private: + wxString m_value; +}; + + // ============================================================================ // implementation // ============================================================================ @@ -459,6 +507,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int m_ctrl[1] = NULL; m_ctrl[2] = NULL; m_ctrl[3] = NULL; + m_ctrl[4] = NULL; m_eventFromProgram = false; @@ -606,6 +655,16 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int fourthPanelSz->Add(button_sizer4); fourthPanel->SetSizerAndFit(fourthPanelSz); + // fifth page of the notebook + // --------------------------- + + wxPanel *fifthPanel = new wxPanel(m_notebook, wxID_ANY); + + BuildDataViewCtrl(fifthPanel, 4); // sets m_ctrl[4] + + wxSizer *fifthPanelSz = new wxBoxSizer(wxVERTICAL); + fifthPanelSz->Add(m_ctrl[4], 1, wxGROW | wxALL, 5); + fifthPanel->SetSizerAndFit(fifthPanelSz); // complete GUI @@ -615,6 +674,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int m_notebook->AddPage(secondPanel, "MyListModel"); m_notebook->AddPage(thirdPanel, "wxDataViewListCtrl"); m_notebook->AddPage(fourthPanel, "wxDataViewTreeCtrl"); + m_notebook->AddPage(fifthPanel, "wxDataViewTreeCtrl Variable line height"); wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); @@ -837,6 +897,35 @@ void MyFrame::BuildDataViewCtrl(wxPanel* parent, unsigned int nPanel, unsigned l tc->Expand(cont); } break; + + case 4: + { + wxASSERT(!m_ctrl[4] && !m_long_music_model); + m_ctrl[4] = + new wxDataViewCtrl( parent, wxID_ANY, wxDefaultPosition, + wxDefaultSize, style | wxDV_VARIABLE_LINE_HEIGHT ); + + m_long_music_model = new MyLongMusicTreeModel; + m_ctrl[4]->AssociateModel(m_long_music_model.get()); + + // column 0 of the view control: + MultiLineCustomRenderer *tr = + new MultiLineCustomRenderer(); + wxDataViewColumn *column0 = + new wxDataViewColumn("title", tr, 0, 200, wxALIGN_LEFT, + wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_RESIZABLE); + m_ctrl[4]->AppendColumn(column0); + + // column 1 of the view control: + tr = new MultiLineCustomRenderer(); + wxDataViewColumn *column1 = + new wxDataViewColumn("artist", tr, 1, 150, wxALIGN_LEFT, + wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE | + wxDATAVIEW_COL_RESIZABLE); + column1->SetMinWidth(150); // this column can't be resized to be smaller + m_ctrl[4]->AppendColumn(column1); + } + break; } } @@ -1013,6 +1102,8 @@ void MyFrame::OnStyleChange( wxCommandEvent& WXUNUSED(event) ) m_music_model.reset(NULL); else if (nPanel == 1) m_list_model.reset(NULL); + else if (nPanel == 4) + m_long_music_model.reset(NULL); // rebuild the DVC for the selected panel: BuildDataViewCtrl((wxPanel*)m_notebook->GetPage(nPanel), nPanel, style); diff --git a/samples/dataview/mymodels.cpp b/samples/dataview/mymodels.cpp index fcffc59d69..e00ba68099 100644 --- a/samples/dataview/mymodels.cpp +++ b/samples/dataview/mymodels.cpp @@ -312,6 +312,19 @@ unsigned int MyMusicTreeModel::GetChildren( const wxDataViewItem &parent, } +// ---------------------------------------------------------------------------- +// MyLongMusicTreeModel +// ---------------------------------------------------------------------------- + +MyLongMusicTreeModel::MyLongMusicTreeModel() : MyMusicTreeModel() +{ + for (int i = 0; i < 50; i++) + { + AddToClassical("The Four Seasons", "Antonio Vivaldi", 1721); + AddToClassical("La costanza trionfante degl'amori e de gl'odii", "Antonio Vivaldi", 1716); + } +} + // ---------------------------------------------------------------------------- // MyListModel diff --git a/samples/dataview/mymodels.h b/samples/dataview/mymodels.h index 59d3c984a7..db089197a9 100644 --- a/samples/dataview/mymodels.h +++ b/samples/dataview/mymodels.h @@ -188,6 +188,17 @@ private: }; +// ---------------------------------------------------------------------------- +// MyLongMusicTreeModel +// ---------------------------------------------------------------------------- + +class MyLongMusicTreeModel : public MyMusicTreeModel +{ +public: + MyLongMusicTreeModel(); +}; + + // ---------------------------------------------------------------------------- // MyListModel // ---------------------------------------------------------------------------- From a8d89b9cedab655ff3a884aac3b5aa9cf1406a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20G=C3=B6pfert?= Date: Mon, 7 Jan 2019 11:52:04 +0100 Subject: [PATCH 219/553] fixed memory leak --- include/wx/generic/private/rowheightcache.h | 1 + src/generic/rowheightcache.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/wx/generic/private/rowheightcache.h b/include/wx/generic/private/rowheightcache.h index 768edd4687..9136a3863c 100644 --- a/include/wx/generic/private/rowheightcache.h +++ b/include/wx/generic/private/rowheightcache.h @@ -131,6 +131,7 @@ WX_DECLARE_HASH_MAP(unsigned int, RowRanges*, wxIntegerHash, wxIntegerEqual, class WXDLLIMPEXP_CORE HeightCache { public: + ~HeightCache(); bool GetLineStart(unsigned int row, int& start); bool GetLineHeight(unsigned int row, int& height); bool GetLineAt(int y, unsigned int& row); diff --git a/src/generic/rowheightcache.cpp b/src/generic/rowheightcache.cpp index 21529bccb6..3eb0e68a24 100644 --- a/src/generic/rowheightcache.cpp +++ b/src/generic/rowheightcache.cpp @@ -325,3 +325,8 @@ void HeightCache::Clear() } m_heightToRowRange.clear(); } + +HeightCache::~HeightCache() +{ + Clear(); +} From fbbdcc058a14e7944af8f3ffe6d180112994ae2c Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 7 Jan 2019 14:45:28 +0000 Subject: [PATCH 220/553] Fix client size for wxFrame under wxQt Avoid implicitly creating the menu bar by calling menuBar() and use menuWidget() instead which just returns NULL if there is no menu bar, allowing to calculate correct client size for frames without menus. Closes https://github.com/wxWidgets/wxWidgets/pull/1120 --- src/qt/frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index 41322c3733..f4636dc902 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -179,7 +179,7 @@ void wxFrame::DoGetClientSize(int *width, int *height) const } - if ( QMenuBar *qmb = GetQMainWindow()->menuBar() ) + if ( QWidget *qmb = GetQMainWindow()->menuWidget() ) { *height -= qmb->geometry().height(); } From e90c6e83dd422c5da4eecae7e1ef48283e881243 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 8 Jan 2019 22:59:46 +0100 Subject: [PATCH 221/553] Remove stray closing brace from Connect() documentation --- interface/wx/event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/event.h b/interface/wx/event.h index 061ba76201..105c95d4a3 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -758,7 +758,7 @@ public: @beginWxPerlOnly In wxPerl this function takes 4 arguments: @a id, @a lastid, @a type, @a method; if @a method is undef, the handler is - disconnected.} + disconnected. @endWxPerlOnly @see Bind<>() From 61b2136beec23e7543342374dea9a34a2a5af011 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 10 Jan 2019 03:44:39 +0100 Subject: [PATCH 222/553] Prettify instructions for adding a new wxUSE_XXX constant Improve translation of the file from plain text to (GitHub-flavoured) Markdown. --- docs/contributing/how-to-add-new-wxUSE_XXX.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/contributing/how-to-add-new-wxUSE_XXX.md b/docs/contributing/how-to-add-new-wxUSE_XXX.md index 19807eafd4..735df8b56a 100644 --- a/docs/contributing/how-to-add-new-wxUSE_XXX.md +++ b/docs/contributing/how-to-add-new-wxUSE_XXX.md @@ -1,15 +1,15 @@ How to add a new `wxUSE_XXX` preprocessor constant ================================================ -0. Purpose ----------- +Purpose +------- Detailed description of what needs to be done when you want to add a new `wxUSE_XXX` compilation flag. The text below assumes you need new `wxUSE_FOO`. -1. Overview ------------ +Overview +-------- wxWidgets uses `wxUSE_XXX` macros for conditionally compiling in (or not) optional components. In general, whenever a new non critical (i.e. not @@ -22,12 +22,12 @@ because then `wxUSE_FOO` would be not defined at all if the user directly includes wx/foo.h, include "wx/defs.h" before testing for `wxUSE_FOO`. -2. Files to update ------------------- +Files to update +--------------- The following files need to be modified when adding a new `wxUSE_FOO`: -a) include/wx/setup_inc.h +- `include/wx/setup_inc.h` This file contains all common `wxUSE_XXXs`, and is used to update wxMSW, wxMac setup.h and Unix setup.h.in using build/update-setup-h. Please try to add @@ -39,13 +39,13 @@ a) include/wx/setup_inc.h After changing this file, run the update-setup-h script (this is probably better done on a Unix machine although it should work under Cygwin too). -a') include/wx/msw/setup_inc.h for MSW-specific options +- `include/wx/msw/setup_inc.h` for MSW-specific options This file contains MSW-specific options, so if the new option is only used under MSW, add it here instead of include/wx/setup_inc.h. The rest of the instructions is the same as above. -b) include/wx/chkconf.h +- `include/wx/chkconf.h` Add the check for `wxUSE_FOO` definedness in the corresponding (base or GUI) section. Please keep the alphabetic order. @@ -53,35 +53,35 @@ b) include/wx/chkconf.h If there are any dependencies, i.e. `wxUSE_FOO` requires `wxUSE_BAR` and `wxUSE_BAZ`, check for thme here too. -b') include/wx/msw/chkconf.h for MSW-specific options +- `include/wx/msw/chkconf.h` for MSW-specific options These options won't be defined for the other ports, so shouldn't be added to - the common include/wx/chkconf.h but to this file instead. + the common `include/wx/chkconf.h` but to this file instead. -c) configure.in +- `configure.in` Here you need to add `DEFAULT_wxUSE_FOO` define. It should be added in the - block beginning after WX_ARG_CACHE_INIT line and should default to "no" for - "if DEBUG_CONFIGURE = 1" branch (this is used for absolutely minimal builds) - and the same as default value in setup_inc.h in the "else" branch. + block beginning after `WX_ARG_CACHE_INIT` line and should default to "no" for + `if DEBUG_CONFIGURE = 1` branch (this is used for absolutely minimal builds) + and the same as default value in `setup_inc.h` in the "else" branch. - You also need to add a WX_ARG_ENABLE (or, if new functionality can be - reasonably described as support for a 3rd party library, WX_ARG_WITH) - line togetherw with all the existing WX_ARG_ENABLEs. + You also need to add a `WX_ARG_ENABLE` (or, if new functionality can be + reasonably described as support for a 3rd party library, `WX_ARG_WITH`) + line together with all the existing `WX_ARG_ENABLE`s. If you have a sample/foo which should be only built when `wxUSE_FOO==1`, - then only add it to the SAMPLES_SUBDIRS if `wxUSE_FOO=yes` in configure. + then only add it to the `SAMPLES_SUBDIRS` if `wxUSE_FOO=yes` in configure. -d) build/cmake/options.cmake +- `build/cmake/options.cmake` To include the option in CMake, add a new line in the appropriate - section of options.cmake. + section of `options.cmake`. - wx_option(wxUSE_FOO "enable FOO") + wx_option(wxUSE_FOO "enable FOO") As an optional third parameter you may specify `OFF` when the option should be disabled by default. -e) docs/doxygen/mainpages/const_wxusedef.h +- `docs/doxygen/mainpages/const_wxusedef.h` Add a brief description of the new constant. From 34ecc6efc4e0653cbbf3a9d3590b2fe2b8732637 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 7 Jan 2019 11:26:17 +0000 Subject: [PATCH 223/553] Generate wxWindowCreateEvent when creating windows in wxQt Send the expected event at the very end of window creation process. Closes https://github.com/wxWidgets/wxWidgets/pull/1119 --- src/qt/control.cpp | 7 +++++-- src/qt/dialog.cpp | 7 +++++-- src/qt/frame.cpp | 6 ++++-- src/qt/window.cpp | 3 +++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/qt/control.cpp b/src/qt/control.cpp index eacb2409a1..057619ab7a 100644 --- a/src/qt/control.cpp +++ b/src/qt/control.cpp @@ -58,9 +58,12 @@ bool wxControl::QtCreateControl( wxWindow *parent, wxWindowID id, // Let Qt handle the background: SetBackgroundStyle(wxBG_STYLE_SYSTEM); - PostCreation(false); - return CreateControl( parent, id, pos, size, style, validator, name ); + if (!CreateControl( parent, id, pos, size, style, validator, name )) + return false; + + PostCreation(false); + return true; } wxSize wxControl::DoGetBestSize() const diff --git a/src/qt/dialog.cpp b/src/qt/dialog.cpp index 6c99788e2e..9bb788c27b 100644 --- a/src/qt/dialog.cpp +++ b/src/qt/dialog.cpp @@ -59,10 +59,13 @@ bool wxDialog::Create( wxWindow *parent, wxWindowID id, style |= wxTAB_TRAVERSAL; m_qtWindow = new wxQtDialog( parent, this ); - + + if ( !wxTopLevelWindow::Create( parent, id, title, pos, size, style, name ) ) + return false; + PostCreation(); - return wxTopLevelWindow::Create( parent, id, title, pos, size, style, name ); + return true; } int wxDialog::ShowModal() diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index f4636dc902..42143793cf 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -70,9 +70,11 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString& title, GetQMainWindow()->setCentralWidget( new wxQtCentralWidget( parent, this ) ); - PostCreation(); + if ( !wxFrameBase::Create( parent, id, title, pos, size, style, name ) ) + return false; - return wxFrameBase::Create( parent, id, title, pos, size, style, name ); + PostCreation(); + return true; } void wxFrame::SetMenuBar( wxMenuBar *menuBar ) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index f112f3a545..5aa1241f7f 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -287,6 +287,9 @@ void wxWindowQt::PostCreation(bool generic) SetForegroundColour(wxColour(GetHandle()->palette().foreground().color())); GetHandle()->setFont( wxWindowBase::GetFont().GetHandle() ); + + wxWindowCreateEvent event(this); + HandleWindowEvent(event); } void wxWindowQt::AddChild( wxWindowBase *child ) From aa422c6be2ee8b1a4a3384022ae216523b79f667 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Tue, 8 Jan 2019 11:48:45 +0000 Subject: [PATCH 224/553] Make scrollbar private to wxWindow under wxQt Use QScrollbar directly instead of wxScrollbar for the window scrollbars to ensure that wxWindow::GetChildren() doesn't return these scrollbars. Closes https://github.com/wxWidgets/wxWidgets/pull/1124 --- include/wx/qt/window.h | 14 ++-- src/qt/window.cpp | 159 +++++++++++++++++++++++------------------ 2 files changed, 97 insertions(+), 76 deletions(-) diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index 3a07aed4c4..90065c928e 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -15,9 +15,8 @@ class QShortcut; template < class T > class QList; class QWidget; -class QScrollWindow; -class QAbstractScrollArea; class QScrollArea; +class QScrollBar; class QPicture; class QPainter; @@ -215,12 +214,11 @@ private: void Init(); QScrollArea *m_qtContainer; - wxScrollBar *m_horzScrollBar; - wxScrollBar *m_vertScrollBar; - void QtOnScrollBarEvent( wxScrollEvent& event ); - - wxScrollBar *QtGetScrollBar( int orientation ) const; - wxScrollBar *QtSetScrollBar( int orientation, wxScrollBar *scrollBar=NULL ); + QScrollBar *m_horzScrollBar; + QScrollBar *m_vertScrollBar; + + QScrollBar *QtGetScrollBar( int orientation ) const; + QScrollBar *QtSetScrollBar( int orientation, QScrollBar *scrollBar=NULL ); bool QtSetBackgroundStyle(); diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 5aa1241f7f..1fb5f111f5 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -68,6 +69,69 @@ wxQtScrollArea::wxQtScrollArea( wxWindowQt *parent, wxWindowQt *handler ) { } +class wxQtInternalScrollBar : public wxQtEventSignalHandler< QScrollBar, wxWindowQt > +{ +public: + wxQtInternalScrollBar(wxWindowQt *parent, wxWindowQt *handler ); + void actionTriggered( int action ); + void sliderReleased(); + void valueChanged( int position ); +}; + +wxQtInternalScrollBar::wxQtInternalScrollBar( wxWindowQt *parent, wxWindowQt *handler ) + : wxQtEventSignalHandler< QScrollBar, wxWindowQt >( parent, handler ) +{ + connect( this, &QScrollBar::actionTriggered, this, &wxQtInternalScrollBar::actionTriggered ); + connect( this, &QScrollBar::sliderReleased, this, &wxQtInternalScrollBar::sliderReleased ); +} + + +void wxQtInternalScrollBar::actionTriggered( int action ) +{ + wxEventType eventType = wxEVT_NULL; + switch( action ) + { + case QAbstractSlider::SliderSingleStepAdd: + eventType = wxEVT_SCROLLWIN_LINEDOWN; + break; + case QAbstractSlider::SliderSingleStepSub: + eventType = wxEVT_SCROLLWIN_LINEUP; + break; + case QAbstractSlider::SliderPageStepAdd: + eventType = wxEVT_SCROLLWIN_PAGEDOWN; + break; + case QAbstractSlider::SliderPageStepSub: + eventType = wxEVT_SCROLLWIN_PAGEUP; + break; + case QAbstractSlider::SliderToMinimum: + eventType = wxEVT_SCROLLWIN_TOP; + break; + case QAbstractSlider::SliderToMaximum: + eventType = wxEVT_SCROLLWIN_BOTTOM; + break; + case QAbstractSlider::SliderMove: + eventType = wxEVT_SCROLLWIN_THUMBTRACK; + break; + default: + return; + } + + if ( GetHandler() ) + { + wxScrollWinEvent e( eventType, sliderPosition(), wxQtConvertOrientation( orientation() ) ); + EmitEvent( e ); + } +} + +void wxQtInternalScrollBar::sliderReleased() +{ + if ( GetHandler() ) + { + wxScrollWinEvent e( wxEVT_SCROLLWIN_THUMBRELEASE, sliderPosition(), wxQtConvertOrientation( orientation() ) ); + EmitEvent( e ); + } +} + #if wxUSE_ACCEL || defined( Q_MOC_RUN ) class wxQtShortcutHandler : public QObject, public wxQtSignalHandler< wxWindowQt > { @@ -490,11 +554,9 @@ void wxWindowQt::DoGetTextExtent(const wxString& string, int *x, int *y, int *de /* Returns a scrollbar for the given orientation, or NULL if the scrollbar * has not been previously created and create is false */ -wxScrollBar *wxWindowQt::QtGetScrollBar( int orientation ) const +QScrollBar *wxWindowQt::QtGetScrollBar( int orientation ) const { - wxCHECK_MSG( CanScroll( orientation ), NULL, "Window can't scroll in that orientation" ); - - wxScrollBar *scrollBar = NULL; + QScrollBar *scrollBar = NULL; if ( orientation == wxHORIZONTAL ) scrollBar = m_horzScrollBar; @@ -506,7 +568,7 @@ wxScrollBar *wxWindowQt::QtGetScrollBar( int orientation ) const /* Returns a new scrollbar for the given orientation, or set the scrollbar * passed as parameter */ -wxScrollBar *wxWindowQt::QtSetScrollBar( int orientation, wxScrollBar *scrollBar ) +QScrollBar *wxWindowQt::QtSetScrollBar( int orientation, QScrollBar *scrollBar ) { QScrollArea *scrollArea = QtGetScrollBarsContainer(); wxCHECK_MSG( scrollArea, NULL, "Window without scrolling area" ); @@ -514,30 +576,19 @@ wxScrollBar *wxWindowQt::QtSetScrollBar( int orientation, wxScrollBar *scrollBar // Create a new scrollbar if needed if ( !scrollBar ) { - scrollBar = new wxScrollBar( const_cast< wxWindowQt* >( this ), wxID_ANY, - wxDefaultPosition, wxDefaultSize, - orientation == wxHORIZONTAL ? wxSB_HORIZONTAL : wxSB_VERTICAL); - - // Connect scrollbar events to this window - scrollBar->Bind( wxEVT_SCROLL_LINEUP, &wxWindowQt::QtOnScrollBarEvent, this ); - scrollBar->Bind( wxEVT_SCROLL_LINEDOWN, &wxWindowQt::QtOnScrollBarEvent, this ); - scrollBar->Bind( wxEVT_SCROLL_PAGEUP, &wxWindowQt::QtOnScrollBarEvent, this ); - scrollBar->Bind( wxEVT_SCROLL_PAGEDOWN, &wxWindowQt::QtOnScrollBarEvent, this ); - scrollBar->Bind( wxEVT_SCROLL_TOP, &wxWindowQt::QtOnScrollBarEvent, this ); - scrollBar->Bind( wxEVT_SCROLL_BOTTOM, &wxWindowQt::QtOnScrollBarEvent, this ); - scrollBar->Bind( wxEVT_SCROLL_THUMBTRACK, &wxWindowQt::QtOnScrollBarEvent, this ); - scrollBar->Bind( wxEVT_SCROLL_THUMBRELEASE, &wxWindowQt::QtOnScrollBarEvent, this ); + scrollBar = new wxQtInternalScrollBar(this, this); + scrollBar->setOrientation( orientation == wxHORIZONTAL ? Qt::Horizontal : Qt::Vertical ); } // Let Qt handle layout if ( orientation == wxHORIZONTAL ) { - scrollArea->setHorizontalScrollBar( scrollBar->GetQScrollBar() ); + scrollArea->setHorizontalScrollBar( scrollBar ); m_horzScrollBar = scrollBar; } else { - scrollArea->setVerticalScrollBar( scrollBar->GetQScrollBar() ); + scrollArea->setVerticalScrollBar( scrollBar ); m_vertScrollBar = scrollBar; } return scrollBar; @@ -546,10 +597,8 @@ wxScrollBar *wxWindowQt::QtSetScrollBar( int orientation, wxScrollBar *scrollBar void wxWindowQt::SetScrollbar( int orientation, int pos, int thumbvisible, int range, bool refresh ) { - wxCHECK_RET( CanScroll( orientation ), "Window can't scroll in that orientation" ); - //If not exist, create the scrollbar - wxScrollBar *scrollBar = QtGetScrollBar( orientation ); + QScrollBar *scrollBar = QtGetScrollBar( orientation ); if ( scrollBar == NULL ) scrollBar = QtSetScrollBar( orientation ); @@ -557,79 +606,53 @@ void wxWindowQt::SetScrollbar( int orientation, int pos, int thumbvisible, int r // scrollBar == NULL and it is not a problem if ( scrollBar ) { - scrollBar->SetScrollbar( pos, thumbvisible, range, thumbvisible, refresh ); - if ( HasFlag( wxALWAYS_SHOW_SB ) && ( range == 0 ) ) + scrollBar->setRange( 0, range - thumbvisible ); + scrollBar->setPageStep( thumbvisible ); + scrollBar->blockSignals( true ); + scrollBar->setValue(pos); + scrollBar->blockSignals( false ); + scrollBar->show(); + + if ( HasFlag(wxALWAYS_SHOW_SB) && (range == 0) ) { // Disable instead of hide - scrollBar->GetHandle()->show(); - scrollBar->GetHandle()->setEnabled( false ); + scrollBar->setEnabled( false ); } else - scrollBar->GetHandle()->setEnabled( true ); + scrollBar->setEnabled( true ); } + } void wxWindowQt::SetScrollPos( int orientation, int pos, bool WXUNUSED( refresh )) { - wxScrollBar *scrollBar = QtGetScrollBar( orientation ); + QScrollBar *scrollBar = QtGetScrollBar( orientation ); if ( scrollBar ) - scrollBar->SetThumbPosition( pos ); + scrollBar->setValue( pos ); } int wxWindowQt::GetScrollPos( int orientation ) const { - wxScrollBar *scrollBar = QtGetScrollBar( orientation ); + QScrollBar *scrollBar = QtGetScrollBar( orientation ); wxCHECK_MSG( scrollBar, 0, "Invalid scrollbar" ); - return scrollBar->GetThumbPosition(); + return scrollBar->value(); } int wxWindowQt::GetScrollThumb( int orientation ) const { - wxScrollBar *scrollBar = QtGetScrollBar( orientation ); + QScrollBar *scrollBar = QtGetScrollBar( orientation ); wxCHECK_MSG( scrollBar, 0, "Invalid scrollbar" ); - return scrollBar->GetThumbSize(); + return scrollBar->pageStep(); } int wxWindowQt::GetScrollRange( int orientation ) const { - wxScrollBar *scrollBar = QtGetScrollBar( orientation ); + QScrollBar *scrollBar = QtGetScrollBar( orientation ); wxCHECK_MSG( scrollBar, 0, "Invalid scrollbar" ); - return scrollBar->GetRange(); -} - -// Handle event from scrollbars -void wxWindowQt::QtOnScrollBarEvent( wxScrollEvent& event ) -{ - wxEventType windowEventType = 0; - - // Map the scroll bar event to the corresponding scroll window event: - - wxEventType scrollBarEventType = event.GetEventType(); - if ( scrollBarEventType == wxEVT_SCROLL_TOP ) - windowEventType = wxEVT_SCROLLWIN_TOP; - else if ( scrollBarEventType == wxEVT_SCROLL_BOTTOM ) - windowEventType = wxEVT_SCROLLWIN_BOTTOM; - else if ( scrollBarEventType == wxEVT_SCROLL_PAGEUP ) - windowEventType = wxEVT_SCROLLWIN_PAGEUP; - else if ( scrollBarEventType == wxEVT_SCROLL_PAGEDOWN ) - windowEventType = wxEVT_SCROLLWIN_PAGEDOWN; - else if ( scrollBarEventType == wxEVT_SCROLL_LINEUP ) - windowEventType = wxEVT_SCROLLWIN_LINEUP; - else if ( scrollBarEventType == wxEVT_SCROLL_LINEDOWN ) - windowEventType = wxEVT_SCROLLWIN_LINEDOWN; - else if ( scrollBarEventType == wxEVT_SCROLL_THUMBTRACK ) - windowEventType = wxEVT_SCROLLWIN_THUMBTRACK; - else if ( scrollBarEventType == wxEVT_SCROLL_THUMBRELEASE ) - windowEventType = wxEVT_SCROLLWIN_THUMBRELEASE; - - if ( windowEventType != 0 ) - { - wxScrollWinEvent e( windowEventType, event.GetPosition(), event.GetOrientation() ); - ProcessWindowEvent( e ); - } + return scrollBar->maximum(); } // scroll window to the specified position From dfdbba7ebc00775fef90414bb542522e99a5384c Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 9 Jan 2019 09:45:02 +0000 Subject: [PATCH 225/553] Fix wxQT crash if wxRadioBox is created without wxRA_SPECIFY_XXX Fall back to wxRA_SPECIFY_COLS if neither it nor wxRA_SPECIFY_ROWS is given instead of not initializing m_qtBoxLayout at all in this case and subsequently crashing due to it. Closes https://github.com/wxWidgets/wxWidgets/pull/1125 --- src/qt/radiobox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index be0dada8eb..2ea62910b3 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -146,6 +146,9 @@ bool wxRadioBox::Create(wxWindow *parent, m_qtGroupBox->setTitle( wxQtConvertString( title ) ); m_qtButtonGroup = new wxQtButtonGroup( m_qtGroupBox, this ); + if ( !(style & (wxRA_SPECIFY_ROWS | wxRA_SPECIFY_COLS)) ) + style |= wxRA_SPECIFY_COLS; + // wxRA_SPECIFY_COLS means that we arrange buttons in // left to right order and GetMajorDim() is the number of columns while // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and From 2969cefb3a0874697f9f384d48adcbf480f86baa Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 9 Jan 2019 10:05:51 +0000 Subject: [PATCH 226/553] Fix crash when calling wxRadioBox::Show() before Create() in wxQt This notable happened when the radio box was loaded from XRC. Closes https://github.com/wxWidgets/wxWidgets/pull/1126 --- src/qt/radiobox.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 2ea62910b3..4e58afed50 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -248,6 +248,12 @@ bool wxRadioBox::Show(unsigned int n, bool show) bool wxRadioBox::Show( bool show ) { + if ( !wxControl::Show(show) ) + return false; + + if ( !m_qtGroupBox ) + return false; + if( m_qtGroupBox->isVisible() == show ) { for( unsigned int i = 0; i < GetCount(); ++i ) From 3f2db1b027c4e8afd655103e19fe0686be75c16a Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 9 Jan 2019 13:17:15 +0000 Subject: [PATCH 227/553] Fix item index in wxRadioBox events in wxQt Use 0-based index for the radio box items, as in the other ports, instead of auto-generated values. Closes https://github.com/wxWidgets/wxWidgets/pull/1127 --- src/qt/radiobox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 4e58afed50..b2093e3596 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -116,10 +116,12 @@ static void AddChoices( QButtonGroup *qtButtonGroup, QBoxLayout *qtBoxLayout, in Button *btn; bool isFirst = true; + int id = 0; + while ( count-- > 0 ) { btn = new Button( wxQtConvertString( *choices++ )); - qtButtonGroup->addButton( btn ); + qtButtonGroup->addButton( btn, id++ ); qtBoxLayout->addWidget( btn ); if ( isFirst ) From 7a45b7948a17bf4a258a44f6066e9ca1f91bbf31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Wed, 9 Jan 2019 19:27:01 +0100 Subject: [PATCH 228/553] Move the hack for Cmd+C in wxOSX to a better place "&Cancel" is an unfortunate label for wxID_CANCEL buttons on Macs, because it makes Cmd+C a shortcut for the button, which in turn makes any attempt to copy text from a text control instead abruptly close the dialog. There were partial hacks around it in some places made by 22bcdf0, but it didn't even cover all uses within wx code itself, let alone user code. Move the hack into wxButton to catch all uses of this and remove the accelerator as the lesser evil. --- src/common/dlgcmn.cpp | 7 +------ src/generic/wizard.cpp | 7 +------ src/osx/cocoa/button.mm | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index a7a6803bb3..9f8ffb9936 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -273,12 +273,7 @@ wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags ) if (flags & wxCANCEL) { - // Avoid Cmd+C closing dialog on Mac. - wxString cancelLabel(_("&Cancel")); -#ifdef __WXMAC__ - cancelLabel.Replace("&",wxEmptyString); -#endif - wxButton *cancel = new wxButton(this, wxID_CANCEL, cancelLabel); + wxButton *cancel = new wxButton(this, wxID_CANCEL); sizer->AddButton(cancel); } diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 3960216686..cefb6c9f58 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -433,12 +433,7 @@ void wxWizard::AddButtonRow(wxBoxSizer *mainColumn) m_finishLabel = _("&Finish"); m_btnNext = new wxButton(this, wxID_FORWARD, m_nextLabel); - // Avoid Cmd+C closing dialog on Mac. - wxString cancelLabel(_("&Cancel")); -#ifdef __WXMAC__ - cancelLabel.Replace("&",wxEmptyString); -#endif - wxButton *btnCancel=new wxButton(this, wxID_CANCEL, cancelLabel, wxDefaultPosition, wxDefaultSize, buttonStyle); + wxButton *btnCancel=new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, buttonStyle); #ifndef __WXMAC__ if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) btnHelp=new wxButton(this, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, buttonStyle); diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index a63c37c7c1..efcc3cb52c 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -187,9 +187,18 @@ void wxButtonCocoaImpl::SetAcceleratorFromLabel(const wxString& label) { wxString accelstring(label[accelPos + 1]); // Skip '&' itself accelstring.MakeLower(); - wxCFStringRef cfText(accelstring); - [GetNSButton() setKeyEquivalent:cfText.AsNSString()]; - [GetNSButton() setKeyEquivalentModifierMask:NSCommandKeyMask]; + // Avoid Cmd+C closing dialog on Mac. + if (accelstring == "c" && GetWXPeer()->GetId() == wxID_CANCEL) + { + [GetNSButton() setKeyEquivalent:@""]; + } + else + { + wxString cancelLabel(_("&Cancel")); + wxCFStringRef cfText(accelstring); + [GetNSButton() setKeyEquivalent:cfText.AsNSString()]; + [GetNSButton() setKeyEquivalentModifierMask:NSCommandKeyMask]; + } } else { From 488cbb7848abf4c874938fe5021f1f9d4d192d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Wed, 9 Jan 2019 15:38:28 +0100 Subject: [PATCH 229/553] Fix flicker when reducing wxDVC width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After 841c14c37c878dff35a552626c77c7d7a44ff558, reducing width of a generic wxDataViewCtrl caused flickering (horizontal scrollbar appearing and disappearing immediately) when the columns were resized by user code to fix exactly. Fixed by calling AdjustScrollbars() after determining column sizes. It doesn’t make sense to call it before, because UpdateColumnSizes() may change required width. See #18295. --- src/generic/datavgen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 2ea515ae00..8f3ebf7cd8 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -5183,13 +5183,13 @@ void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) Layout(); - AdjustScrollbars(); - // Update the last column size to take all the available space. Note that // this must be done after calling Layout() to update m_clientArea size. if ( m_clientArea && GetColumnCount() ) m_clientArea->UpdateColumnSizes(); + AdjustScrollbars(); + // We must redraw the headers if their height changed. Normally this // shouldn't happen as the control shouldn't let itself be resized beneath // its minimal height but avoid the display artefacts that appear if it From 79d8c6ff0c7ef282378a00d88c8033e127d5fc7f Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 10 Jan 2019 16:53:51 +0000 Subject: [PATCH 230/553] Fix uninitialised field --- src/qt/brush.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/brush.cpp b/src/qt/brush.cpp index fc09e71965..2b6f654b01 100644 --- a/src/qt/brush.cpp +++ b/src/qt/brush.cpp @@ -62,7 +62,8 @@ static Qt::BrushStyle ConvertBrushStyle(wxBrushStyle style) class wxBrushRefData: public wxGDIRefData { public: - wxBrushRefData() + wxBrushRefData() : + m_style(wxBRUSHSTYLE_INVALID) { } From 337879f22220a84fe527ae73d07c3435c5fdb10c Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 10 Jan 2019 16:54:11 +0000 Subject: [PATCH 231/553] Fix Copy leaving field unitialised --- src/richtext/richtextbuffer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 7cfbe3effc..901cb33331 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -5691,6 +5691,7 @@ bool wxRichTextParagraph::InsertText(long pos, const wxString& text) void wxRichTextParagraph::Copy(const wxRichTextParagraph& obj) { wxRichTextCompositeObject::Copy(obj); + m_impactedByFloatingObjects = obj.m_impactedByFloatingObjects; } /// Clear the cached lines From 5d3366abb9b1535b7a57fa9457488135ecf893cb Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 11 Jan 2019 08:17:49 +0000 Subject: [PATCH 232/553] Fixed another unitialised field in wxBrush for wxQT --- src/qt/brush.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/brush.cpp b/src/qt/brush.cpp index 2b6f654b01..4223fbf199 100644 --- a/src/qt/brush.cpp +++ b/src/qt/brush.cpp @@ -68,9 +68,9 @@ class wxBrushRefData: public wxGDIRefData } wxBrushRefData( const wxBrushRefData& data ) - : wxGDIRefData() { m_qtBrush = data.m_qtBrush; + m_style = data.m_style; } bool operator == (const wxBrushRefData& data) const From fc65bd92a6a737617f4368ff101176af38836098 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 10 Jan 2019 16:57:36 +0000 Subject: [PATCH 233/553] Fix leaks/crashes related to window scrollbars in wxQt Closes https://github.com/wxWidgets/wxWidgets/pull/1135 --- src/qt/window.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 1fb5f111f5..1732de3863 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -73,6 +73,11 @@ class wxQtInternalScrollBar : public wxQtEventSignalHandler< QScrollBar, wxWindo { public: wxQtInternalScrollBar(wxWindowQt *parent, wxWindowQt *handler ); + ~wxQtInternalScrollBar() + { + disconnect( this, &QScrollBar::actionTriggered, this, &wxQtInternalScrollBar::actionTriggered ); + disconnect( this, &QScrollBar::sliderReleased, this, &wxQtInternalScrollBar::sliderReleased ); + } void actionTriggered( int action ); void sliderReleased(); void valueChanged( int position ); @@ -263,6 +268,16 @@ wxWindowQt::~wxWindowQt() m_qtWindow->blockSignals(true); // Reset the pointer to avoid handling pending event and signals QtStoreWindowPointer( GetHandle(), NULL ); + if ( m_horzScrollBar ) + { + QtStoreWindowPointer( m_horzScrollBar, NULL ); + m_horzScrollBar->deleteLater(); + } + if ( m_vertScrollBar ) + { + QtStoreWindowPointer( m_vertScrollBar, NULL ); + m_vertScrollBar->deleteLater(); + } // Delete QWidget when control return to event loop (safer) m_qtWindow->deleteLater(); m_qtWindow = NULL; From 8555f4abb0cdbe9f217ddf7ccafb2f4df4c5081a Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Fri, 28 Dec 2018 19:26:39 +0100 Subject: [PATCH 234/553] CMake: Fix wx-config library list with monolithic build Closes https://github.com/wxWidgets/wxWidgets/pull/1132 --- build/cmake/config.cmake | 6 +++++- build/cmake/functions.cmake | 6 ++++++ build/cmake/lib/CMakeLists.txt | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index c4e1b053e1..27e9f2a450 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -93,7 +93,8 @@ function(wx_write_config) set(STD_BASE_LIBS_ALL xml net base) set(STD_GUI_LIBS_ALL xrc html qa adv core) foreach(lib IN ITEMS xrc webview stc richtext ribbon propgrid aui gl media html qa adv core xml net base) - if(TARGET ${lib}) + list(FIND wxLIB_TARGETS ${lib} hasLib) + if (hasLib GREATER -1) wx_string_append(BUILT_WX_LIBS "${lib} ") list(FIND STD_BASE_LIBS_ALL ${lib} index) if (index GREATER -1) @@ -130,6 +131,9 @@ function(wx_write_config) wx_get_dependencies(EXTRALIBS_MEDIA media) wx_get_dependencies(OPENGL_LIBS gl) set(DMALLOC_LIBS) + if(wxBUILD_MONOLITHIC) + wx_get_dependencies(WXCONFIG_LIBS mono) + endif() set(CC ${CMAKE_C_COMPILER}) set(CXX ${CMAKE_CXX_COMPILER}) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 6e0e528c0d..d5dafa2b65 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -286,6 +286,9 @@ function(wx_set_target_properties target_name is_base) wx_set_common_target_properties(${target_name}) endfunction() +# List of libraries added via wx_add_library() to use for wx-config +set(wxLIB_TARGETS) + # Add a wxWidgets library # wx_add_library( [IS_BASE] ...) # first parameter is the name of the library @@ -295,6 +298,9 @@ macro(wx_add_library name) cmake_parse_arguments(wxADD_LIBRARY "IS_BASE" "" "" ${ARGN}) set(src_files ${wxADD_LIBRARY_UNPARSED_ARGUMENTS}) + list(APPEND wxLIB_TARGETS ${name}) + set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE) + if(wxBUILD_MONOLITHIC AND NOT ${name} STREQUAL "mono") # collect all source files for mono library set(wxMONO_SRC_FILES ${wxMONO_SRC_FILES} ${src_files} PARENT_SCOPE) diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index 4974d48fea..1a625e54ae 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -97,3 +97,6 @@ if(wxBUILD_MONOLITHIC) endforeach() wx_finalize_lib(mono) endif() + +# Propagate variable(s) to parent scope +set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE) From d411c3159cc3052ba521748a0c926d3c6dc38309 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 11 Jan 2019 11:37:24 +0000 Subject: [PATCH 235/553] Replace template that is only ever instantiated with one type --- src/qt/radiobox.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index b2093e3596..55ceb2403d 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -110,17 +110,14 @@ bool wxRadioBox::Create(wxWindow *parent, } -template < typename Button > static void AddChoices( QButtonGroup *qtButtonGroup, QBoxLayout *qtBoxLayout, int count, const wxString choices[] ) { - Button *btn; bool isFirst = true; - int id = 0; while ( count-- > 0 ) { - btn = new Button( wxQtConvertString( *choices++ )); + QRadioButton *btn = new QRadioButton( wxQtConvertString( *choices++ )); qtButtonGroup->addButton( btn, id++ ); qtBoxLayout->addWidget( btn ); @@ -160,7 +157,7 @@ bool wxRadioBox::Create(wxWindow *parent, else if ( style & wxRA_SPECIFY_ROWS ) m_qtBoxLayout = new QVBoxLayout; - AddChoices< QRadioButton >( m_qtButtonGroup, m_qtBoxLayout, n, choices ); + AddChoices( m_qtButtonGroup, m_qtBoxLayout, n, choices ); m_qtBoxLayout->addStretch(1); m_qtGroupBox->setLayout(m_qtBoxLayout); From 12d4ed3e8c16bc5337c6a487f313f9014dabbd47 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 11 Jan 2019 11:55:42 +0000 Subject: [PATCH 236/553] Collapse 2 loop dependent variables into a single variable --- src/qt/radiobox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 55ceb2403d..7958639d67 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -113,12 +113,11 @@ bool wxRadioBox::Create(wxWindow *parent, static void AddChoices( QButtonGroup *qtButtonGroup, QBoxLayout *qtBoxLayout, int count, const wxString choices[] ) { bool isFirst = true; - int id = 0; - while ( count-- > 0 ) + for (int i = 0; i < count; ++i ) { - QRadioButton *btn = new QRadioButton( wxQtConvertString( *choices++ )); - qtButtonGroup->addButton( btn, id++ ); + QRadioButton *btn = new QRadioButton( wxQtConvertString( choices[i] )); + qtButtonGroup->addButton( btn, i ); qtBoxLayout->addWidget( btn ); if ( isFirst ) From 4f32cfc5fbae5b218f0ab461c953e5680dbdd7ed Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 11 Jan 2019 14:39:54 +0000 Subject: [PATCH 237/553] Add support for grid layout in wxRadioBox under wxQT --- include/wx/qt/radiobox.h | 4 +-- src/qt/radiobox.cpp | 57 ++++++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/include/wx/qt/radiobox.h b/include/wx/qt/radiobox.h index 679298b83b..a3149e25e6 100644 --- a/include/wx/qt/radiobox.h +++ b/include/wx/qt/radiobox.h @@ -10,7 +10,7 @@ class QGroupBox; class QButtonGroup; -class QBoxLayout; +class QGridLayout; class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, public wxRadioBoxBase { @@ -89,7 +89,7 @@ private: QButtonGroup *m_qtButtonGroup; // Autofit layout for buttons (either vert. or horiz.): - QBoxLayout *m_qtBoxLayout; + QGridLayout *m_qtGridLayout; wxDECLARE_DYNAMIC_CLASS(wxRadioBox); }; diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 7958639d67..2282f199b3 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -59,7 +59,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl); wxRadioBox::wxRadioBox() : m_qtGroupBox(NULL), m_qtButtonGroup(NULL), - m_qtBoxLayout(NULL) + m_qtGridLayout(NULL) { } @@ -110,19 +110,46 @@ bool wxRadioBox::Create(wxWindow *parent, } -static void AddChoices( QButtonGroup *qtButtonGroup, QBoxLayout *qtBoxLayout, int count, const wxString choices[] ) +static void AddChoices( QButtonGroup *qtButtonGroup, QGridLayout *qtGridLayout, int count, const wxString choices[], int style, int majorDim ) { + if ( count <= 0 ) + return; + + // wxRA_SPECIFY_COLS means that we arrange buttons in + // left to right order and GetMajorDim() is the number of columns while + // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and + // GetMajorDim() is the number of rows. + + const bool columnMajor = style & wxRA_SPECIFY_COLS; + const int numMajor = majorDim > 0 ? majorDim : count; + bool isFirst = true; - for (int i = 0; i < count; ++i ) + for ( int i = 0; i < count; ++i ) { - QRadioButton *btn = new QRadioButton( wxQtConvertString( choices[i] )); + QRadioButton *btn = new QRadioButton(wxQtConvertString (choices[i]) ); qtButtonGroup->addButton( btn, i ); - qtBoxLayout->addWidget( btn ); - if ( isFirst ) + int row; + int col; + + if (columnMajor) { - btn->setChecked(true); + col = i % numMajor; + row = i / numMajor; + + } + else + { + col = i / numMajor; + row = i % numMajor; + } + + qtGridLayout->addWidget( btn, row, col ); + + if (isFirst) + { + btn->setChecked( true ); isFirst = false; } } @@ -135,7 +162,7 @@ bool wxRadioBox::Create(wxWindow *parent, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], - int WXUNUSED(majorDim), + int majorDim, long style, const wxValidator& val, const wxString& name) @@ -147,18 +174,10 @@ bool wxRadioBox::Create(wxWindow *parent, if ( !(style & (wxRA_SPECIFY_ROWS | wxRA_SPECIFY_COLS)) ) style |= wxRA_SPECIFY_COLS; - // wxRA_SPECIFY_COLS means that we arrange buttons in - // left to right order and GetMajorDim() is the number of columns while - // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and - // GetMajorDim() is the number of rows. - if ( style & wxRA_SPECIFY_COLS ) - m_qtBoxLayout = new QHBoxLayout; - else if ( style & wxRA_SPECIFY_ROWS ) - m_qtBoxLayout = new QVBoxLayout; + m_qtGridLayout = new QGridLayout; - AddChoices( m_qtButtonGroup, m_qtBoxLayout, n, choices ); - m_qtBoxLayout->addStretch(1); - m_qtGroupBox->setLayout(m_qtBoxLayout); + AddChoices( m_qtButtonGroup, m_qtGridLayout, n, choices, style, majorDim ); + m_qtGroupBox->setLayout(m_qtGridLayout); return QtCreateControl( parent, id, pos, size, style, val, name ); } From a823236ac16fefc88d4770b4769b42d0b9d60fa7 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 11 Jan 2019 15:02:41 +0000 Subject: [PATCH 238/553] Improve layout of wxRadioBox under wxQT --- src/qt/radiobox.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 2282f199b3..17cc6a0b0a 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -177,7 +177,12 @@ bool wxRadioBox::Create(wxWindow *parent, m_qtGridLayout = new QGridLayout; AddChoices( m_qtButtonGroup, m_qtGridLayout, n, choices, style, majorDim ); - m_qtGroupBox->setLayout(m_qtGridLayout); + + QVBoxLayout *qtBoxLayout = new QVBoxLayout; + qtBoxLayout->addLayout(m_qtGridLayout); + qtBoxLayout->addStretch(); + + m_qtGroupBox->setLayout(qtBoxLayout); return QtCreateControl( parent, id, pos, size, style, val, name ); } From eb40eb4b848139e28257ea559d95f6f5ba911ab0 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 7 Jan 2019 20:14:35 +0100 Subject: [PATCH 239/553] Fix horizontal scrolling of wxPropertyGrid header wxPropertyGridHeader associated with wxPropertyGrid has to be notified about every horizontal scroll of the grid. New position is sent with dedicated wxEVT_PG_HSCROLL event being handled by wxPropertyGridManager which in turn scrolls the header accordingly. See #18313. --- include/wx/propgrid/manager.h | 1 + include/wx/propgrid/propgrid.h | 8 +++++- src/propgrid/manager.cpp | 20 ++++++++++++-- src/propgrid/propgrid.cpp | 48 ++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 3 deletions(-) diff --git a/include/wx/propgrid/manager.h b/include/wx/propgrid/manager.h index bbd0bb94d8..b707ce9ffd 100644 --- a/include/wx/propgrid/manager.h +++ b/include/wx/propgrid/manager.h @@ -544,6 +544,7 @@ protected: void OnResize( wxSizeEvent& event ); void OnPropertyGridSelect( wxPropertyGridEvent& event ); void OnPGColDrag( wxPropertyGridEvent& event ); + void OnPGScrollH(wxPropertyGridEvent& evt); wxPropertyGrid* m_pPropGrid; diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 114a02f19b..4cbda4c90d 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1456,7 +1456,10 @@ public: virtual bool SetFont( const wxFont& font ) wxOVERRIDE; virtual void SetExtraStyle( long exStyle ) wxOVERRIDE; virtual bool Reparent( wxWindowBase *newParent ) wxOVERRIDE; - + virtual void ScrollWindow(int dx, int dy, const wxRect* rect) wxOVERRIDE; + virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, + int noUnitsX, int noUnitsY, + int xPos, int yPos, bool noRefresh) wxOVERRIDE; protected: virtual void DoThaw() wxOVERRIDE; @@ -1928,6 +1931,8 @@ protected: unsigned int selFlags = wxPG_SEL_NOVALIDATE, unsigned int column = 1 ); + void SendEvent(wxEventType eventType, int intVal); + // This function only moves focus to the wxPropertyGrid if it already // was on one of its child controls. void SetFocusOnCanvas(); @@ -2025,6 +2030,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_COL_DRAGGING, wxPropertyGridEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_COL_END_DRAG, wxPropertyGridEvent ); +wxDECLARE_EVENT(wxEVT_PG_HSCROLL, wxPropertyGridEvent); #else enum { diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 9437e48c89..51556e6eb2 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -321,7 +321,7 @@ private: else if ( i == colCount-1 ) { // Compensate for the internal border and scrollbar - int margin = pg->GetMarginWidth() + borderWidth + sbWidth; + int margin = borderWidth; colWidth += margin; colMinWidth += margin; @@ -378,8 +378,12 @@ private: } else if ( evtType == wxEVT_HEADER_BEGIN_RESIZE ) { + // Don't allow resizing the rightmost column + // (like it's not allowed for the rightmost wxPropertyGrid splitter) + if ( col == (int)m_page->GetColumnCount() - 1 ) + hcEvent->Veto(); // Never allow column resize if layout is static - if ( m_manager->HasFlag(wxPG_STATIC_SPLITTER) ) + else if ( m_manager->HasFlag(wxPG_STATIC_SPLITTER) ) hcEvent->Veto(); // Allow application to veto dragging else if ( pg->SendEvent(wxEVT_PG_COL_BEGIN_DRAG, @@ -1936,6 +1940,7 @@ void wxPropertyGridManager::ReconnectEventHandlers(wxWindowID oldId, wxWindowID oldId); Unbind(wxEVT_PG_COL_DRAGGING, &wxPropertyGridManager::OnPGColDrag, this, oldId); + Unbind(wxEVT_PG_HSCROLL, &wxPropertyGridManager::OnPGScrollH, this, oldId); } if (newId != wxID_NONE) @@ -1944,6 +1949,7 @@ void wxPropertyGridManager::ReconnectEventHandlers(wxWindowID oldId, wxWindowID newId); Bind(wxEVT_PG_COL_DRAGGING, &wxPropertyGridManager::OnPGColDrag, this, newId); + Bind(wxEVT_PG_HSCROLL, &wxPropertyGridManager::OnPGScrollH, this, newId); } } @@ -1970,6 +1976,16 @@ wxPropertyGridManager::OnPGColDrag( wxPropertyGridEvent& WXUNUSED(event) ) #endif } +void wxPropertyGridManager::OnPGScrollH(wxPropertyGridEvent& evt) +{ +#if wxUSE_HEADERCTRL + if ( m_pHeaderCtrl ) + { + m_pHeaderCtrl->ScrollWindow(evt.GetInt(), 0); + } +#endif // wxUSE_HEADERCTRL +} + // ----------------------------------------------------------------------- void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) ) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index e630dead3d..4dfbddc3c7 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1275,6 +1275,38 @@ bool wxPropertyGrid::Reparent( wxWindowBase *newParent ) return res; } +// ----------------------------------------------------------------------- + +void wxPropertyGrid::ScrollWindow(int dx, int dy, const wxRect* rect) +{ + wxControl::ScrollWindow(dx, dy, rect); + if ( dx != 0 ) + { + // Notify wxPropertyGridManager about the grid being scrolled horizontally + // to scroll the column header, if present. + SendEvent(wxEVT_PG_HSCROLL, dx); + } +} +// ----------------------------------------------------------------------- + +void wxPropertyGrid::SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, + int noUnitsX, int noUnitsY, + int xPos, int yPos, bool noRefresh) +{ + int oldX; + CalcUnscrolledPosition(0, 0, &oldX, NULL); + wxScrollHelper::SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, + noUnitsX, noUnitsY, xPos, yPos, noRefresh); + int newX; + CalcUnscrolledPosition(0, 0, &newX, NULL); + if ( newX != oldX ) + { + // Notify wxPropertyGridManager about the grid being scrolled horizontally + // to scroll the column header, if present. + SendEvent(wxEVT_PG_HSCROLL, oldX - newX); + } +} + // ----------------------------------------------------------------------- // wxPropertyGrid Font and Colour Methods // ----------------------------------------------------------------------- @@ -4752,6 +4784,21 @@ bool wxPropertyGrid::SendEvent( int eventType, wxPGProperty* p, return evt.WasVetoed(); } +void wxPropertyGrid::SendEvent(wxEventType eventType, int intVal) +{ + wxPropertyGridEvent evt(eventType, m_eventObject->GetId()); + evt.SetPropertyGrid(this); + evt.SetEventObject(m_eventObject); + evt.SetProperty(NULL); + evt.SetColumn(0); + evt.SetInt(intVal); + + wxPropertyGridEvent* prevProcessedEvent = m_processedEvent; + m_processedEvent = &evt; + m_eventObject->HandleWindowEvent(evt); + m_processedEvent = prevProcessedEvent; +} + // ----------------------------------------------------------------------- // Return false if should be skipped @@ -6276,6 +6323,7 @@ wxDEFINE_EVENT( wxEVT_PG_LABEL_EDIT_ENDING, wxPropertyGridEvent ); wxDEFINE_EVENT( wxEVT_PG_COL_BEGIN_DRAG, wxPropertyGridEvent ); wxDEFINE_EVENT( wxEVT_PG_COL_DRAGGING, wxPropertyGridEvent ); wxDEFINE_EVENT( wxEVT_PG_COL_END_DRAG, wxPropertyGridEvent ); +wxDEFINE_EVENT( wxEVT_PG_HSCROLL, wxPropertyGridEvent); // ----------------------------------------------------------------------- From 8f8955b2b9ae58dfeb465d16915381e276923234 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 7 Jan 2019 21:54:15 +0100 Subject: [PATCH 240/553] Use wxVector instead of wxArrayPGObject --- include/wx/propgrid/propgrid.h | 2 +- include/wx/propgrid/propgriddefs.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 4cbda4c90d..7a4587a63f 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1580,7 +1580,7 @@ protected: #if !WXWIN_COMPATIBILITY_3_0 // List of editors and their event handlers to be deleted in idle event handler. - wxArrayPGObject m_deletedEditorObjects; + wxVector m_deletedEditorObjects; #endif // List of key codes that will not be handed over to editor controls. diff --git a/include/wx/propgrid/propgriddefs.h b/include/wx/propgrid/propgriddefs.h index 91ee22a8c5..1a18eccbac 100644 --- a/include/wx/propgrid/propgriddefs.h +++ b/include/wx/propgrid/propgriddefs.h @@ -312,9 +312,11 @@ WX_DECLARE_HASH_SET_WITH_DECL(int, wxPGHashSetInt, class WXDLLIMPEXP_PROPGRID); +#if WXWIN_COMPATIBILITY_3_0 WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxObject*, wxArrayPGObject, wxBaseArrayPtrVoid, class WXDLLIMPEXP_PROPGRID); +#endif // WXWIN_COMPATIBILITY_3_0 // ----------------------------------------------------------------------- From 48bc92a72d0f15df6b55a37e20c53b310a61e40b Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 7 Jan 2019 23:21:52 +0100 Subject: [PATCH 241/553] Use wxVector instead of wxArrayPtrVoid --- src/propgrid/propgridiface.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 307753986e..04b7760101 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -915,22 +915,19 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const // // Save state on page basis - unsigned int pageIndex = 0; - wxArrayPtrVoid pageStates; - - for (;;) + wxVector pageStates; + for (int pageIndex = 0; ; pageIndex++) { wxPropertyGridPageState* page = GetPageState(pageIndex); if ( !page ) break; - pageStates.Add(page); - - pageIndex++; + pageStates.push_back(page); } - for ( pageIndex=0; pageIndex < pageStates.size(); pageIndex++ ) + for (wxVector::const_iterator it_ps = pageStates.begin(); + it_ps != pageStates.end(); ++it_ps) { - wxPropertyGridPageState* pageState = (wxPropertyGridPageState*) pageStates[pageIndex]; + wxPropertyGridPageState* pageState = *it_ps; if ( includedStates & SelectionState ) { From d47413697b0224b037dfbe1ce7230c7c89391d90 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 7 Jan 2019 23:35:56 +0100 Subject: [PATCH 242/553] Use wxVector instead of wxArrayPtrVoid --- include/wx/propgrid/editors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/propgrid/editors.h b/include/wx/propgrid/editors.h index 6b60d06d73..c9c8dddd31 100644 --- a/include/wx/propgrid/editors.h +++ b/include/wx/propgrid/editors.h @@ -458,7 +458,7 @@ public: wxPGMultiButton( wxPropertyGrid* pg, const wxSize& sz ); virtual ~wxPGMultiButton() {} - wxWindow* GetButton( unsigned int i ) { return (wxWindow*) m_buttons[i]; } + wxWindow* GetButton( unsigned int i ) { return m_buttons[i]; } const wxWindow* GetButton( unsigned int i ) const { return (const wxWindow*) m_buttons[i]; } @@ -486,7 +486,7 @@ protected: int GenId( int id ) const; - wxArrayPtrVoid m_buttons; + wxVector m_buttons; wxSize m_fullEditorSize; int m_buttonsWidth; }; From 1f739e5f8242f0d96ad28864ab8e414efcf12891 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 8 Jan 2019 21:37:10 +0100 Subject: [PATCH 243/553] Get rid of unused member variable --- include/wx/propgrid/manager.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/wx/propgrid/manager.h b/include/wx/propgrid/manager.h index b707ce9ffd..3cf7766983 100644 --- a/include/wx/propgrid/manager.h +++ b/include/wx/propgrid/manager.h @@ -562,8 +562,6 @@ protected: wxPropertyGridPage* m_emptyPage; - wxArrayString m_columnLabels; - long m_iFlags; // Selected page index. From a95293d5f9a08851aef5ddd6fd866f0e519f93d5 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 8 Jan 2019 22:24:06 +0100 Subject: [PATCH 244/553] Iterate over all items of wxVector with header columns with iterator --- src/propgrid/manager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 51556e6eb2..4465d08bd4 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -242,8 +242,11 @@ public: virtual ~wxPGHeaderCtrl() { - for (size_t i = 0; i < m_columns.size(); i++ ) - delete m_columns[i]; + for (wxVector::const_iterator it = m_columns.begin(); + it != m_columns.end(); ++it) + { + delete *it; + } } void OnPageChanged(const wxPropertyGridPage* page) From daf33b9b41274f84951e1378a7bd643e7a658f27 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 8 Jan 2019 22:31:05 +0100 Subject: [PATCH 245/553] Use Boolean variable to store Boolean values --- include/wx/propgrid/manager.h | 2 +- src/propgrid/manager.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/propgrid/manager.h b/include/wx/propgrid/manager.h index 3cf7766983..c83d421191 100644 --- a/include/wx/propgrid/manager.h +++ b/include/wx/propgrid/manager.h @@ -589,7 +589,7 @@ protected: unsigned char m_dragStatus; - unsigned char m_onSplitter; + bool m_onSplitter; bool m_showHeader; diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 4465d08bd4..a5b4dda812 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -520,7 +520,7 @@ void wxPropertyGridManager::Init1() m_extraHeight = 0; m_dragStatus = 0; - m_onSplitter = 0; + m_onSplitter = false; m_iFlags = 0; } @@ -2033,7 +2033,7 @@ void wxPropertyGridManager::OnMouseEntry( wxMouseEvent& WXUNUSED(event) ) // Correct cursor. This is required at least for wxGTK, for which // setting button's cursor to *wxSTANDARD_CURSOR does not work. SetCursor( wxNullCursor ); - m_onSplitter = 0; + m_onSplitter = false; } // ----------------------------------------------------------------------- @@ -2079,7 +2079,7 @@ void wxPropertyGridManager::OnMouseMove( wxMouseEvent &event ) if ( y >= m_splitterY && y < (m_splitterY+m_splitterHeight+2) ) { SetCursor ( m_cursorSizeNS ); - m_onSplitter = 1; + m_onSplitter = true; } else { @@ -2087,7 +2087,7 @@ void wxPropertyGridManager::OnMouseMove( wxMouseEvent &event ) { SetCursor ( wxNullCursor ); } - m_onSplitter = 0; + m_onSplitter = false; } } } From a0053914138ef54b2011d240285155e62d568dc3 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 9 Jan 2019 16:47:00 +0100 Subject: [PATCH 246/553] Use wxEventType instead of int This parameter identifies the type of the event so it should be of type wxEventType. --- include/wx/propgrid/propgrid.h | 2 +- src/propgrid/propgrid.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 7a4587a63f..a7f5f9dd64 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1926,7 +1926,7 @@ protected: // Send event from the property grid. // Omit the wxPG_SEL_NOVALIDATE flag to allow vetoing the event - bool SendEvent( int eventType, wxPGProperty* p, + bool SendEvent( wxEventType eventType, wxPGProperty* p, wxVariant* pValue = NULL, unsigned int selFlags = wxPG_SEL_NOVALIDATE, unsigned int column = 1 ); diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 4dfbddc3c7..5faa8b9d40 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4746,7 +4746,7 @@ void wxPropertyGrid::SetFocusOnCanvas() // selFlags uses same values DoSelectProperty's flags // Returns true if event was vetoed. -bool wxPropertyGrid::SendEvent( int eventType, wxPGProperty* p, +bool wxPropertyGrid::SendEvent( wxEventType eventType, wxPGProperty* p, wxVariant* pValue, unsigned int selFlags, unsigned int column ) From 848d7d67eec280bb6b95e119a8cf3d48d0fe6db0 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 11 Jan 2019 20:08:20 +0100 Subject: [PATCH 247/553] Resolve ambiguity of calling overloaded wxPropertyGrid::SendEvent() The right overloaded SendEvent() function is pointed out by explicitly casting second argument of the call to (wxPGProperty*) type. --- src/propgrid/manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index a5b4dda812..23569a9534 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -1797,7 +1797,7 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event ) if ( DoSelectPage(index) ) { // Event dispatching must be last. - m_pPropGrid->SendEvent( wxEVT_PG_PAGE_CHANGED, NULL ); + m_pPropGrid->SendEvent( wxEVT_PG_PAGE_CHANGED, (wxPGProperty*)NULL ); } else { From 50c90f9174fd2d695e4cb1fdc95283e9c0f465f0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Jan 2019 15:35:44 +0100 Subject: [PATCH 248/553] Use wxScopedPtr<> in URL unit test Don't leak the stream if an error happens in the rest of the test. --- tests/uris/url.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/uris/url.cpp b/tests/uris/url.cpp index 8fbb208927..0520a8be99 100644 --- a/tests/uris/url.cpp +++ b/tests/uris/url.cpp @@ -22,6 +22,7 @@ #include "wx/url.h" #include "wx/mstream.h" +#include "wx/scopedptr.h" // ---------------------------------------------------------------------------- // test class @@ -73,7 +74,7 @@ void URLTestCase::GetInputStream() wxURL url("http://www.wxwidgets.org/assets/img/header-logo.png"); CPPUNIT_ASSERT_EQUAL(wxURL_NOERR, url.GetError()); - wxInputStream *in_stream = url.GetInputStream(); + wxScopedPtr in_stream(url.GetInputStream()); CPPUNIT_ASSERT(in_stream); CPPUNIT_ASSERT(in_stream->IsOk()); @@ -81,9 +82,6 @@ void URLTestCase::GetInputStream() CPPUNIT_ASSERT(in_stream->Read(ostream).GetLastError() == wxSTREAM_EOF); CPPUNIT_ASSERT_EQUAL(17334, ostream.GetSize()); - - // we have to delete the object created by GetInputStream() - delete in_stream; } void URLTestCase::CopyAndAssignment() From 3c468260ff9ef97733a353f2ed9acaebcf90d429 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Jan 2019 15:39:09 +0100 Subject: [PATCH 249/553] Retry in URL test when running in a CI environment There are episodic failures in this test when running under AppVeyor, check if retrying to connect can work around them. --- tests/uris/url.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/uris/url.cpp b/tests/uris/url.cpp index 0520a8be99..afda05f6d7 100644 --- a/tests/uris/url.cpp +++ b/tests/uris/url.cpp @@ -23,6 +23,7 @@ #include "wx/url.h" #include "wx/mstream.h" #include "wx/scopedptr.h" +#include "wx/utils.h" // ---------------------------------------------------------------------------- // test class @@ -75,6 +76,15 @@ void URLTestCase::GetInputStream() CPPUNIT_ASSERT_EQUAL(wxURL_NOERR, url.GetError()); wxScopedPtr in_stream(url.GetInputStream()); + if ( !in_stream && IsAutomaticTest() ) + { + // Sometimes the connection fails during CI runs, try to connect once + // again if this happens in the hope it was just a transient error. + wxSleep(3); + WARN("Connection to www.wxwidgets.org failed, retrying..."); + in_stream.reset(url.GetInputStream()); + } + CPPUNIT_ASSERT(in_stream); CPPUNIT_ASSERT(in_stream->IsOk()); From 4a18bc897d29cfa000ab642c8ed8f036f3461d8d Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 14 Jan 2019 08:06:34 +0000 Subject: [PATCH 250/553] Improve layout of radioboxes in horizontal sizers with expand flag under wxQT --- src/qt/radiobox.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index 17cc6a0b0a..b73a881a78 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -178,11 +178,15 @@ bool wxRadioBox::Create(wxWindow *parent, AddChoices( m_qtButtonGroup, m_qtGridLayout, n, choices, style, majorDim ); - QVBoxLayout *qtBoxLayout = new QVBoxLayout; - qtBoxLayout->addLayout(m_qtGridLayout); - qtBoxLayout->addStretch(); + QVBoxLayout *vertLayout = new QVBoxLayout; + vertLayout->addLayout(m_qtGridLayout); + vertLayout->addStretch(); - m_qtGroupBox->setLayout(qtBoxLayout); + QHBoxLayout *horzLayout = new QHBoxLayout; + horzLayout->addLayout(vertLayout); + horzLayout->addStretch(); + + m_qtGroupBox->setLayout(horzLayout); return QtCreateControl( parent, id, pos, size, style, val, name ); } From c8b977314e1c60f303717888224af80e47dae59f Mon Sep 17 00:00:00 2001 From: Chilau He Date: Fri, 11 Jan 2019 06:48:22 +0800 Subject: [PATCH 251/553] Change default wxWebViewIE offline behavior Allow opening web pages using this backend on systems without any network connection too. See https://github.com/wxWidgets/wxWidgets/pull/1133 --- src/msw/webview_ie.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 2f98e83e0d..b39a78d864 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -110,6 +110,10 @@ bool wxWebViewIE::Create(wxWindow* parent, EnableControlFeature(21 /* FEATURE_DISABLE_NAVIGATION_SOUNDS */); + // Make behaviour consistent with the other backends when loading localhost + // pages without any physical network connection. + SetOfflineMode(false); + LoadURL(url); return true; } From 3aa6aec6207696f5f179d526d7b8ed4e9b2a8c56 Mon Sep 17 00:00:00 2001 From: Chilau He Date: Fri, 11 Jan 2019 06:48:22 +0800 Subject: [PATCH 252/553] Add wxWebViewIE::MSWSetEmulationLevel() This extends and replaces MSWSetModernEmulationLevel() by allowing a more fine-grained choice of the emulation level used by wxWebViewIE. Closes https://github.com/wxWidgets/wxWidgets/pull/1133 --- include/wx/msw/webview_ie.h | 41 +++++++++++++++++-- interface/wx/webview.h | 80 +++++++++++++++++++++++++++++++------ src/msw/webview_ie.cpp | 15 +++---- 3 files changed, 111 insertions(+), 25 deletions(-) diff --git a/include/wx/msw/webview_ie.h b/include/wx/msw/webview_ie.h index 3a4f042c16..d12864be5c 100644 --- a/include/wx/msw/webview_ie.h +++ b/include/wx/msw/webview_ie.h @@ -36,6 +36,31 @@ class DocHostUIHandler; class wxFindPointers; class wxIInternetProtocol; +// Note that the highest emulation level may be used even when the +// corresponding browser version is not installed. +// +// Using FORCE options is not recommended, DEFAULT can be used to reset level +// to the system default. +// +// The value of the constants were taken from +// +// https://msdn.microsoft.com/library/ee330730.aspx#browser_emulation +// +// and must not be changed. +enum wxWebViewIE_EmulationLevel +{ + wxWEBVIEWIE_EMU_DEFAULT = 0, + wxWEBVIEWIE_EMU_IE7 = 7000, + wxWEBVIEWIE_EMU_IE8 = 8000, + wxWEBVIEWIE_EMU_IE8_FORCE = 8888, + wxWEBVIEWIE_EMU_IE9 = 9000, + wxWEBVIEWIE_EMU_IE9_FORCE = 9999, + wxWEBVIEWIE_EMU_IE10 = 10000, + wxWEBVIEWIE_EMU_IE10_FORCE = 10001, + wxWEBVIEWIE_EMU_IE11 = 11000, + wxWEBVIEWIE_EMU_IE11_FORCE = 11001 +}; + class WXDLLIMPEXP_WEBVIEW wxWebViewIE : public wxWebView { public: @@ -144,9 +169,19 @@ public: void onActiveXEvent(wxActiveXEvent& evt); void onEraseBg(wxEraseEvent&) {} - // Establish sufficiently modern emulation level for the browser control to - // allow RunScript() to return any kind of values. - static bool MSWSetModernEmulationLevel(bool modernLevel = true); + // Switch to specific emulation level for the browser control to + // ensure RunScript() and web pages work as designed and also change the + // value of User-Agent header sent to web server. + static bool + MSWSetEmulationLevel(wxWebViewIE_EmulationLevel level = wxWEBVIEWIE_EMU_IE11); + + // This function is provided only for compatibility reasons, use + // MSWSetEmulationLevel() in the new code instead. + static bool MSWSetModernEmulationLevel(bool modernLevel = true) + { + return MSWSetEmulationLevel(modernLevel ? wxWEBVIEWIE_EMU_IE8 + : wxWEBVIEWIE_EMU_DEFAULT); + } wxDECLARE_EVENT_TABLE(); diff --git a/interface/wx/webview.h b/interface/wx/webview.h index 103661f0e9..c543123028 100644 --- a/interface/wx/webview.h +++ b/interface/wx/webview.h @@ -107,6 +107,46 @@ enum wxWebViewNavigationActionFlags wxWEBVIEW_NAV_ACTION_OTHER }; +/** + Internet Explorer emulation modes for wxWebViewIE. + + Elements of this enum can be used with wxWebView::MSWSetEmulationLevel(). + + Note that using the @c _FORCE variants is not recommended. + + @since 3.1.3 +*/ +enum wxWebViewIE_EmulationLevel +{ + /** + Clear FEATURE_BROWSER_EMULATION registry setting to default, + corresponding application specific registry key will be deleted + */ + wxWEBVIEWIE_EMU_DEFAULT = 0, + + /** Prefer IE7 Standards mode, default value for the control. */ + wxWEBVIEWIE_EMU_IE7 = 7000, + + /** Prefer IE8 mode, default value for Internet Explorer 8. */ + wxWEBVIEWIE_EMU_IE8 = 8000, + /** Force IE8 Standards mode, ignore !DOCTYPE directives. */ + wxWEBVIEWIE_EMU_IE8_FORCE = 8888, + + /** Prefer IE9 mode, default value for Internet Explorer 9. */ + wxWEBVIEWIE_EMU_IE9 = 9000, + /** Force IE9 Standards mode, ignore !DOCTYPE directives. */ + wxWEBVIEWIE_EMU_IE9_FORCE = 9999, + + /** Prefer IE10 mode, default value for Internet Explorer 10. */ + wxWEBVIEWIE_EMU_IE10 = 10000, + /** Force IE10 Standards mode, ignore !DOCTYPE directives. */ + wxWEBVIEWIE_EMU_IE10_FORCE = 10001, + + /** Prefer IE11 edge mode, default value for Internet Explorer 11. */ + wxWEBVIEWIE_EMU_IE11 = 11000, + /** Force IE11 edge mode, ignore !DOCTYPE directives. */ + wxWEBVIEWIE_EMU_IE11_FORCE = 11001 +}; /** @class wxWebViewHistoryItem @@ -233,7 +273,7 @@ public: is only available for the MSW port. By default recent versions of the WebBrowser control, which this backend uses, emulate Internet Explorer 7. This can be - changed with a registry setting, see + changed with a registry setting by wxWebView::MSWSetEmulationLevel() see this article for more information. This backend has full support for custom schemes and virtual file systems. @@ -475,32 +515,48 @@ public: virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0; /** - Sets emulation level to more modern level. + Sets emulation level. - This function is useful to enable some minimally modern emulation level - of the system browser control used for wxWebView implementation under - MSW, rather than using the currently default, IE7-compatible, - emulation level. Currently the modern emulation level is only IE8, but - this could change in the future and shouldn't be relied on. + This function is useful to change the emulation level of + the system browser control used for wxWebView implementation under + MSW, rather than using the currently default, IE7-compatible, level. Please notice that this function works by modifying the per-user part of MSW registry, which has several implications: first, it is sufficient to call it only once (per user) as the changes done by it are persistent and, second, if you do not want them to be persistent, - you need to call it with @false argument explicitly. + you need to call it with @c wxWEBVIEWIE_EMU_DEFAULT argument explicitly. In particular, this function should be called to allow RunScript() to work for JavaScript code returning arbitrary objects, which is not supported at the default emulation level. + If set to a level higher than installed version, the highest available + level will be used instead. @c wxWEBVIEWIE_EMU_IE11 is recommended for + best performance and experience. + This function is MSW-specific and doesn't exist under other platforms. See https://msdn.microsoft.com/en-us/library/ee330730#browser_emulation for more information about browser control emulation levels. - @param modernLevel @true to set level to a level modern enough to allow - all wxWebView features to work (currently IE8), @false to reset the - emulation level to its default, compatible value. + @param level the target emulation level + @return @true on success, @false on failure (a warning message is also + logged in the latter case). + + @since 3.1.3 + */ + bool MSWSetEmulationLevel(wxWebViewIE_EmulationLevel level = wxWEBVIEWIE_EMU_IE11); + + /** + @deprecated + This function is kept mostly for backwards compatibility. + + Please explicitly specify emulation level with MSWSetEmulationLevel(). + + @param modernLevel @true to set level to IE8, synonym for @c wxWEBVIEWIE_EMU_IE8. + @false to reset the emulation level to its default, + synonym for @c wxWEBVIEWIE_EMU_DEFAULT. @return @true on success, @false on failure (a warning message is also logged in the latter case). @@ -556,7 +612,7 @@ public: object-to-JSON conversion as a fallback for this case, however it is not as full-featured, well-tested or performing as the implementation of this functionality in the browser control itself, so it is - recommended to use MSWSetModernEmulationLevel() to change emulation + recommended to use MSWSetEmulationLevel() to change emulation level to a more modern one in which JSON conversion is done by the control itself. diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index b39a78d864..c5a4e7f34d 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -545,15 +545,13 @@ bool wxWebViewIE::IsOfflineMode() void wxWebViewIE::SetOfflineMode(bool offline) { - // FIXME: the wxWidgets docs do not really document what the return - // parameter of PutProperty is #if wxDEBUG_LEVEL - const bool success = + const HRESULT success = #endif m_ie.PutProperty("Offline", (offline ? VARIANT_TRUE : VARIANT_FALSE)); - wxASSERT(success); + wxASSERT(SUCCEEDED(success)); } bool wxWebViewIE::IsBusy() const @@ -859,7 +857,7 @@ wxString wxWebViewIE::GetPageText() const } } -bool wxWebViewIE::MSWSetModernEmulationLevel(bool modernLevel) +bool wxWebViewIE::MSWSetEmulationLevel(wxWebViewIE_EmulationLevel level) { // Registry key where emulation level for programs are set static const wxChar* IE_EMULATION_KEY = @@ -874,12 +872,9 @@ bool wxWebViewIE::MSWSetModernEmulationLevel(bool modernLevel) } const wxString programName = wxGetFullModuleName().AfterLast('\\'); - if ( modernLevel ) + if ( level != wxWEBVIEWIE_EMU_DEFAULT ) { - // IE8 (8000) is sufficiently modern for our needs, see - // https://msdn.microsoft.com/library/ee330730.aspx#browser_emulation - // for other values that could be used here. - if ( !key.SetValue(programName, 8000) ) + if ( !key.SetValue(programName, level) ) { wxLogWarning(_("Failed to set web view to modern emulation level")); return false; From ebb50551c4484aaaf2946f1f38ddbbe826170dc6 Mon Sep 17 00:00:00 2001 From: chris2oph Date: Wed, 9 Jan 2019 11:17:23 +0000 Subject: [PATCH 253/553] Fix typo in a comment in Qt font code See https://github.com/wxWidgets/wxWidgets/pull/1113 --- src/qt/font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/font.cpp b/src/qt/font.cpp index c01903ec42..9a05705706 100644 --- a/src/qt/font.cpp +++ b/src/qt/font.cpp @@ -498,7 +498,7 @@ void wxNativeFontInfo::SetStrikethrough(bool strikethrough) bool wxNativeFontInfo::SetFaceName(const wxString& facename) { m_qtFont.setFamily(wxQtConvertString(facename)); - // qt uses a "font matching algoritm" so the font will be allways valid + // Qt uses a "font matching algorithm" so the font will be always valid return true; } From dd306cac774eb252f05c60f485b8b7dce484df3f Mon Sep 17 00:00:00 2001 From: chris2oph Date: Wed, 9 Jan 2019 11:17:23 +0000 Subject: [PATCH 254/553] Various wxFont fixes in wxQt Implement point/pixel size accessors correctly. Implement support for strike-through fonts. Also implement DoSetNativeFontInfo() for wxQt. Make wxFont unit test pass by accounting for Qt-specific aspects. Closes https://github.com/wxWidgets/wxWidgets/pull/1113 --- include/wx/qt/font.h | 6 +++++ src/common/fontcmn.cpp | 3 +-- src/qt/font.cpp | 49 ++++++++++++++++++++++++++++++++++++++++- tests/font/fonttest.cpp | 13 ++++++++++- 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/include/wx/qt/font.h b/include/wx/qt/font.h index dd06d24356..44354e8f52 100644 --- a/include/wx/qt/font.h +++ b/include/wx/qt/font.h @@ -50,21 +50,26 @@ public: wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // accessors: get the font characteristics + virtual int GetPointSize() const wxOVERRIDE; virtual float GetFractionalPointSize() const wxOVERRIDE; + virtual wxSize GetPixelSize() const wxOVERRIDE; virtual wxFontStyle GetStyle() const; virtual int GetNumericWeight() const wxOVERRIDE; virtual bool GetUnderlined() const; virtual wxString GetFaceName() const; virtual wxFontEncoding GetEncoding() const; virtual const wxNativeFontInfo *GetNativeFontInfo() const; + virtual bool GetStrikethrough() const wxOVERRIDE; // change the font characteristics virtual void SetFractionalPointSize(float pointSize) wxOVERRIDE; + virtual void SetPixelSize(const wxSize& pixelSize) wxOVERRIDE; virtual void SetFamily( wxFontFamily family ); virtual void SetStyle( wxFontStyle style ); virtual void SetNumericWeight(int weight) wxOVERRIDE; virtual bool SetFaceName(const wxString& facename); virtual void SetUnderlined( bool underlined ); + virtual void SetStrikethrough(bool strikethrough) wxOVERRIDE; virtual void SetEncoding(wxFontEncoding encoding); wxDECLARE_COMMON_FONT_METHODS(); @@ -75,6 +80,7 @@ protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; virtual wxFontFamily DoGetFamily() const; + virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info) wxOVERRIDE; wxDECLARE_DYNAMIC_CLASS(wxFont); diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index 54c0698ef4..7767791433 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -439,8 +439,7 @@ bool wxFontBase::operator==(const wxFont& font) const // in wxGTK1 GetPixelSize() calls GetInternalFont() which uses // operator==() resulting in infinite recursion so we can't use it // in that port - // in wxQT, GetPixelSize is too slow to be used here -#if (!defined(__WXGTK__) || defined(__WXGTK20__)) && !defined(__WXQT__) +#if (!defined(__WXGTK__) || defined(__WXGTK20__)) GetPixelSize() == font.GetPixelSize() && #endif GetFamily() == font.GetFamily() && diff --git a/src/qt/font.cpp b/src/qt/font.cpp index 9a05705706..6600d8a90c 100644 --- a/src/qt/font.cpp +++ b/src/qt/font.cpp @@ -135,7 +135,7 @@ public: if ( info.IsUsingSizeInPixels() ) m_nativeFontInfo.SetPixelSize(info.GetPixelSize()); else - m_nativeFontInfo.SetFractionalPointSize(info.GetFractionalPointSize()); + m_nativeFontInfo.SetSizeOrDefault(info.GetFractionalPointSize()); m_nativeFontInfo.SetStyle(info.GetStyle()); m_nativeFontInfo.SetWeight(info.GetWeight()); @@ -236,11 +236,21 @@ bool wxFont::Create(wxSize size, wxFontFamily family, wxFontStyle style, return true; } +int wxFont::GetPointSize() const +{ + return M_FONTDATA.wxNativeFontInfo::GetPointSize(); +} + float wxFont::GetFractionalPointSize() const { return M_FONTDATA.GetFractionalPointSize(); } +wxSize wxFont::GetPixelSize() const +{ + return M_FONTDATA.GetPixelSize(); +} + wxFontStyle wxFont::GetStyle() const { return M_FONTDATA.GetStyle(); @@ -271,6 +281,12 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const return &M_FONTDATA; } +bool wxFont::GetStrikethrough() const +{ + return M_FONTDATA.GetStrikethrough(); +} + + void wxFont::SetFractionalPointSize(float pointSize) { AllocExclusive(); @@ -278,6 +294,13 @@ void wxFont::SetFractionalPointSize(float pointSize) M_FONTDATA.SetFractionalPointSize(pointSize); } +void wxFont::SetPixelSize(const wxSize& pixelSize) +{ + AllocExclusive(); + + M_FONTDATA.SetPixelSize(pixelSize); +} + bool wxFont::SetFaceName(const wxString& facename) { AllocExclusive(); @@ -313,6 +336,13 @@ void wxFont::SetUnderlined( bool underlined ) M_FONTDATA.SetUnderlined(underlined); } +void wxFont::SetStrikethrough(bool strikethrough) +{ + AllocExclusive(); + + M_FONTDATA.SetStrikethrough(strikethrough); +} + void wxFont::SetEncoding(wxFontEncoding encoding) { AllocExclusive(); @@ -320,6 +350,18 @@ void wxFont::SetEncoding(wxFontEncoding encoding) M_FONTDATA.SetEncoding(encoding); } +void wxFont::DoSetNativeFontInfo(const wxNativeFontInfo& info) +{ + SetFractionalPointSize(info.GetPointSize()); + SetFamily(info.GetFamily()); + SetStyle(info.GetStyle()); + SetNumericWeight(info.GetWeight()); + SetUnderlined(info.GetUnderlined()); + SetStrikethrough(info.GetStrikethrough()); + SetFaceName(info.GetFaceName()); + SetEncoding(info.GetEncoding()); +} + wxGDIRefData *wxFont::CreateGDIRefData() const { return new wxFontRefData; @@ -353,6 +395,11 @@ float wxNativeFontInfo::GetFractionalPointSize() const return m_qtFont.pointSizeF(); } +wxSize wxNativeFontInfo::GetPixelSize() const +{ + return wxSize(0, m_qtFont.pixelSize()); +} + wxFontStyle wxNativeFontInfo::GetStyle() const { switch (m_qtFont.style()) diff --git a/tests/font/fonttest.cpp b/tests/font/fonttest.cpp index a79b64fa51..b6cd5b60aa 100644 --- a/tests/font/fonttest.cpp +++ b/tests/font/fonttest.cpp @@ -197,7 +197,16 @@ TEST_CASE("wxFont::Weight", "[font][weight]") { wxFont font; font.SetNumericWeight(123); + + // WX to QT font weight conversions do not map directly which is why we + // check if the numeric weight is within a range rather than checking for + // an exact match. +#ifdef __WXQT__ + CHECK( ( font.GetNumericWeight() > 113 && font.GetNumericWeight() < 133 ) ); +#else CHECK( font.GetNumericWeight() == 123 ); +#endif + CHECK( font.GetWeight() == wxFONTWEIGHT_THIN ); font.SetNumericWeight(wxFONTWEIGHT_SEMIBOLD); @@ -244,8 +253,10 @@ TEST_CASE("wxFont::GetSet", "[font][getters]") // test Get/SetFaceName() +#ifndef __WXQT__ CHECK( !test.SetFaceName("a dummy face name") ); CHECK( !test.IsOk() ); +#endif // if the call to SetFaceName() below fails on your system/port, // consider adding another branch to this #if @@ -370,7 +381,7 @@ TEST_CASE("wxFont::NativeFontInfo", "[font][fontinfo]") // never returns an error at all so this assertion fails there -- and as it // doesn't seem to be possible to do anything about it maybe we should // change wxMSW and other ports to also accept any strings? -#if !defined(__WXGTK__) && !defined(__WXX11__) +#if !defined(__WXGTK__) && !defined(__WXX11__) && !defined(__WXQT__) CHECK( !font.SetNativeFontInfo("bloordyblop") ); #endif From b10c6ab3a83c9dc7a45d4a322c7b206df418fa65 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 14 Jan 2019 17:45:25 -0800 Subject: [PATCH 255/553] Fix background color from wxControl::GetDefaultAttributes() with GTK+3 The default background is not explicitly set on each widget, but is determined by a parent, usually the TLW. Fixes wxDC default background color for controls. See #18325 --- src/gtk/control.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 772e2f8c8a..85e1e37af7 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -267,6 +267,18 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget, attr.font = wxFont(info); gdk_rgba_free(fc); gdk_rgba_free(bc); + + // Go up the parent chain for a background color + while (attr.colBg.Alpha() == 0 && (widget = gtk_widget_get_parent(widget))) + { + sc = gtk_widget_get_style_context(widget); + gtk_style_context_save(sc); + gtk_style_context_set_state(sc, stateFlag); + gtk_style_context_get(sc, stateFlag, "background-color", &bc, NULL); + gtk_style_context_restore(sc); + attr.colBg = wxColour(*bc); + gdk_rgba_free(bc); + } #else GtkStyle* style; From a985c84966eda9adb88940fac0a12f2e656b5d61 Mon Sep 17 00:00:00 2001 From: "konstantin.matveyev" Date: Sun, 13 Jan 2019 00:03:43 +0300 Subject: [PATCH 256/553] Fix crash in wxGauge with wxGA_PROGRESS under macOS Hide, instead of destroying, the progress indicator in reset() to prevent crashes if SetValue() is called later. Closes https://github.com/wxWidgets/wxWidgets/pull/1137 --- src/osx/cocoa/appprogress.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/appprogress.mm b/src/osx/cocoa/appprogress.mm index 80e86cb765..892bb89ef5 100644 --- a/src/osx/cocoa/appprogress.mm +++ b/src/osx/cocoa/appprogress.mm @@ -65,7 +65,9 @@ - (void)reset { - [m_dockTile setContentView:nil]; + [m_progIndicator setHidden:YES]; + + [m_dockTile display]; } @end From f09b3de914286e163e6ffa494389e4f295ad65fa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 20 Dec 2018 02:00:05 +0100 Subject: [PATCH 257/553] Restore drawing item focus rectangle in generic wxDataViewCtrl The current, but not selected, item was not visually marked in any way since the changes of 4ac0250f9030b30140976198094413a7c55c3f4a which replaced the calls to wxRendererNative::DrawFocusRect() with the calls to DrawItemSelectionRect() which is not called when the item is not selected. Restore DrawFocusRect() call in this case and also pass wxCONTROL_FOCUSED to DrawItemSelectionRect() even though this doesn't seem to change much in practice. Closes https://github.com/wxWidgets/wxWidgets/pull/1089 Closes #18304. --- src/generic/datavgen.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 38ab4f7a60..21b4bc02de 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2455,6 +2455,24 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) colRect.x += colRect.width; } } + else // Not using column focus. + { + flags |= wxCONTROL_CURRENT | wxCONTROL_FOCUSED; + + // We still need to show the current item if it's not + // selected. + if ( !selected ) + { + wxRendererNative::Get().DrawFocusRect + ( + this, + dc, + rowRect, + flags + ); + } + //else: The current item is selected, will be drawn below. + } } // draw selection and whole-item focus: @@ -2465,7 +2483,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) this, dc, rowRect, - flags | wxCONTROL_CURRENT + flags ); } } From 78072514e95dc3178c25878caa6ddedd92a6a307 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2019 01:46:34 +0100 Subject: [PATCH 258/553] Simplify setting nState in WM_NCPAINT handler No real changes, this is just a trivial simplification removing some unnecessary and unused commented out code. --- src/msw/window.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 652910c9af..bdeb6400f2 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3788,14 +3788,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, } // Draw the border - int nState; - if ( !IsEnabled() ) - nState = ETS_DISABLED; - // should we check this? - //else if ( ::GetWindowLong(GetHwnd(), GWL_STYLE) & ES_READONLY) - // nState = ETS_READONLY; - else - nState = ETS_NORMAL; + const int nState = IsEnabled() ? ETS_NORMAL : ETS_DISABLED; ::DrawThemeBackground(hTheme, GetHdcOf(*impl), EP_EDITTEXT, nState, &rcBorder, NULL); } } From d47dbe9faa54acebd8f0072d32eb55d7ad7482f5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2019 01:50:44 +0100 Subject: [PATCH 259/553] Take into account enabled state when drawing themed borders Pass ETS_DISABLED instead of ETS_NORMAL when the window is disabled. --- src/msw/window.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index bdeb6400f2..522a544b88 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3738,7 +3738,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, hTheme, GetHdcOf(*impl), EP_EDITTEXT, - ETS_NORMAL, + IsEnabled() ? ETS_NORMAL : ETS_DISABLED, rect, &rcClient) == S_OK ) { @@ -3774,21 +3774,22 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, wxCopyRectToRECT(GetSize(), rcBorder); RECT rcClient; + + const int nState = IsEnabled() ? ETS_NORMAL : ETS_DISABLED; ::GetThemeBackgroundContentRect( - hTheme, GetHdcOf(*impl), EP_EDITTEXT, ETS_NORMAL, &rcBorder, &rcClient); + hTheme, GetHdcOf(*impl), EP_EDITTEXT, nState, &rcBorder, &rcClient); InflateRect(&rcClient, -1, -1); ::ExcludeClipRect(GetHdcOf(*impl), rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); // Make sure the background is in a proper state - if (::IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL)) + if (::IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, nState)) { ::DrawThemeParentBackground(GetHwnd(), GetHdcOf(*impl), &rcBorder); } // Draw the border - const int nState = IsEnabled() ? ETS_NORMAL : ETS_DISABLED; ::DrawThemeBackground(hTheme, GetHdcOf(*impl), EP_EDITTEXT, nState, &rcBorder, NULL); } } From 712e3652ffbfaa42ac27adc0a6846dc2abff5fca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2019 01:52:37 +0100 Subject: [PATCH 260/553] Deal with themes not implementing GetThemeBackgroundContentRect() Some custom themes apparently don't implement this function at all and just return failure error code from it, but our code either assumed that it never failed (when handling WM_NCPAINT) or didn't handle its failure correctly (when handle WM_NCCALCSIZE the client rect wasn't returned at all to the system in this case). Fix this by just falling back to the initial rectangle in case of failure. --- src/msw/window.cpp | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 522a544b88..5da2ec427e 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3740,18 +3740,23 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, EP_EDITTEXT, IsEnabled() ? ETS_NORMAL : ETS_DISABLED, rect, - &rcClient) == S_OK ) + &rcClient) != S_OK ) { - InflateRect(&rcClient, -1, -1); - if (wParam) - csparam->rgrc[0] = rcClient; - else - *((RECT*)lParam) = rcClient; - - // WVR_REDRAW triggers a bug whereby child windows are moved up and left, - // so don't use. - // rc.result = WVR_REDRAW; + // If GetThemeBackgroundContentRect() failed, as can + // happen with at least some custom themes, just use + // the original client rectangle. + rcClient = *rect; } + + InflateRect(&rcClient, -1, -1); + if (wParam) + csparam->rgrc[0] = rcClient; + else + *((RECT*)lParam) = rcClient; + + // WVR_REDRAW triggers a bug whereby child windows are moved up and left, + // so don't use. + // rc.result = WVR_REDRAW; } } break; @@ -3776,8 +3781,23 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, RECT rcClient; const int nState = IsEnabled() ? ETS_NORMAL : ETS_DISABLED; - ::GetThemeBackgroundContentRect( - hTheme, GetHdcOf(*impl), EP_EDITTEXT, nState, &rcBorder, &rcClient); + + if ( ::GetThemeBackgroundContentRect + ( + hTheme, + GetHdcOf(*impl), + EP_EDITTEXT, + nState, + &rcBorder, + &rcClient + ) != S_OK ) + { + // As above in WM_NCCALCSIZE, fall back on something + // reasonable for themes which don't implement this + // function. + rcClient = rcBorder; + } + InflateRect(&rcClient, -1, -1); ::ExcludeClipRect(GetHdcOf(*impl), rcClient.left, rcClient.top, From 7226a8f4dfd772c08dc8139eb4afa21da96707f5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2019 14:51:08 +0100 Subject: [PATCH 261/553] Use 10.9 SDK by default in configure under macOS On modern macOS systems, libstdc++ headers are not installed by default any more and using 10.7 SDK requires them, so running configure fails out of the box. Avoid this by defaulting to the earliest SDK version which works even under 10.14. --- configure | 5 ++--- configure.in | 6 +++--- docs/changes.txt | 3 +++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/configure b/configure index f7dd626d22..14a8931a16 100755 --- a/configure +++ b/configure @@ -20147,8 +20147,7 @@ if test "$wxUSE_MAC" = 1; then if test "x$wxUSE_MACOSX_SDK" = "xno"; then wxUSE_MACOSX_SDK= elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then - # TODO: Search for most recent SDK and use it. - wxUSE_MACOSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk" + wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" fi @@ -20198,7 +20197,7 @@ $as_echo "$as_me: WARNING: Could not determine deployment target from SDKSetting wxUSE_MACOSX_VERSION_MIN= fi elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then - wxUSE_MACOSX_VERSION_MIN=10.7 + wxUSE_MACOSX_VERSION_MIN=10.9 fi if test "x$MACOSX_SDK_OPTS" != "x"; then diff --git a/configure.in b/configure.in index 4b427d1804..0cb8ed4d74 100644 --- a/configure.in +++ b/configure.in @@ -1222,8 +1222,8 @@ dnl NOTE: We clobber wxUSE_MACOSX_SDK with the SDK path if test "x$wxUSE_MACOSX_SDK" = "xno"; then wxUSE_MACOSX_SDK= elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then - # TODO: Search for most recent SDK and use it. - wxUSE_MACOSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk" + dnl Try to use the default SDK. + wxUSE_MACOSX_SDK="`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" fi @@ -1275,7 +1275,7 @@ dnl We need to quote the next line where we don't need macros and do need [] in wxUSE_MACOSX_VERSION_MIN= fi elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then - wxUSE_MACOSX_VERSION_MIN=10.7 + wxUSE_MACOSX_VERSION_MIN=10.9 fi if test "x$MACOSX_SDK_OPTS" != "x"; then diff --git a/docs/changes.txt b/docs/changes.txt index ff9a427e8e..9cb54f6b15 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -108,6 +108,9 @@ Changes in behaviour which may result in build errors wxArrayString. Please update your code to use the appropriate setter Set[Char]{In,Ex}cludes(), instead of mutating the internal data directly. +- Under macOS, configure builds use 10.9 SDK by default now. 10.7 SDK is still + supported, but must be explicitly selected. + 3.1.3: (released 2019-??-??) ---------------------------- From 761564021c8c454b839d15dfc93fbebe20d3a164 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2019 15:09:18 +0100 Subject: [PATCH 262/553] Also change minimum macOS version to 10.9 for CMake Update CMAKE_OSX_DEPLOYMENT_TARGET default value to match configure builds, see the previous commit. --- CMakeLists.txt | 2 +- docs/changes.txt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a067b00356..84befc43da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ endif() if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET) # If no deployment target has been set default to the minimum supported # OS X version (this has to be set before the first project() call) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "OS X Deployment Target") + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9 CACHE STRING "OS X Deployment Target") endif() project(wxWidgets) diff --git a/docs/changes.txt b/docs/changes.txt index 9cb54f6b15..4a41c873e9 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -108,8 +108,9 @@ Changes in behaviour which may result in build errors wxArrayString. Please update your code to use the appropriate setter Set[Char]{In,Ex}cludes(), instead of mutating the internal data directly. -- Under macOS, configure builds use 10.9 SDK by default now. 10.7 SDK is still - supported, but must be explicitly selected. +- Under macOS, 10.9 SDK is used by default now. 10.7 SDK is still supported, + but must be explicitly selected (and libstdc++ must be installed in order + to use it). 3.1.3: (released 2019-??-??) From 8571cfed2f27f9b6483549e7012e08a97b2edf5a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2019 22:11:15 +0100 Subject: [PATCH 263/553] Remove unnecessary RECT initialization in WM_NCCALCSIZE handler No real changes, just make RECT (lack of) initialization before calling GetThemeBackgroundContentRect() consistent between WM_NCCALCSIZE and WM_NCPAINT handlers. See https://github.com/wxWidgets/wxWidgets/pull/1141 --- src/msw/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 5da2ec427e..8ef8e639e3 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3729,7 +3729,12 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, } wxUxThemeHandle hTheme((const wxWindow *)this, L"EDIT"); - RECT rcClient = { 0, 0, 0, 0 }; + + // There is no need to initialize rcClient: either it will + // be done by GetThemeBackgroundContentRect() or we'll do + // it below if it fails. + RECT rcClient; + wxClientDC dc((wxWindow *)this); wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl(); From 1d117b75f74e849ac4e94fe699d1e547014edc33 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 16 Jan 2019 09:23:12 +0000 Subject: [PATCH 264/553] Add wxGraphicsContext implementation for wxQt Add graphics renderer using Qt classes and use it by default in wxQt port under MSW. Closes https://github.com/wxWidgets/wxWidgets/pull/1139 --- Makefile.in | 24 +- build/bakefiles/files.bkl | 1 + build/cmake/files.cmake | 1 + build/files | 1 + src/generic/graphicc.cpp | 8 +- src/qt/graphics.cpp | 1371 +++++++++++++++++++++++++++++++++++++ 6 files changed, 1398 insertions(+), 8 deletions(-) create mode 100644 src/qt/graphics.cpp diff --git a/Makefile.in b/Makefile.in index b72e564934..91d6281b53 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5747,7 +5747,8 @@ COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS = \ monodll_uuid.o \ monodll_safearray.o \ monodll_msw_sound.o \ - monodll_automtn.o + monodll_automtn.o \ + monodll_qt_graphics.o @COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_fontmgrcmn.o \ @@ -7725,7 +7726,8 @@ COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_1 = \ monolib_uuid.o \ monolib_safearray.o \ monolib_msw_sound.o \ - monolib_automtn.o + monolib_automtn.o \ + monolib_qt_graphics.o @COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS_1 = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_1) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_fontmgrcmn.o \ @@ -9850,7 +9852,8 @@ COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_2 = \ coredll_uuid.o \ coredll_safearray.o \ coredll_msw_sound.o \ - coredll_automtn.o + coredll_automtn.o \ + coredll_qt_graphics.o @COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS_2 = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_2) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_fontmgrcmn.o \ @@ -11570,7 +11573,8 @@ COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_3 = \ corelib_uuid.o \ corelib_safearray.o \ corelib_msw_sound.o \ - corelib_automtn.o + corelib_automtn.o \ + corelib_qt_graphics.o @COND_PLATFORM_WIN32_1@__QT_PLATFORM_SRC_OBJECTS_3 = $(COND_PLATFORM_WIN32_1___QT_PLATFORM_SRC_OBJECTS_3) COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_fontmgrcmn.o \ @@ -16826,6 +16830,9 @@ monodll_qt_utils.o: $(srcdir)/src/qt/utils.cpp $(MONODLL_ODEP) monodll_qt_window.o: $(srcdir)/src/qt/window.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/qt/window.cpp +monodll_qt_graphics.o: $(srcdir)/src/qt/graphics.cpp $(MONODLL_ODEP) + $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/qt/graphics.cpp + monodll_univ_anybutton.o: $(srcdir)/src/univ/anybutton.cpp $(MONODLL_ODEP) $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/univ/anybutton.cpp @@ -22082,6 +22089,9 @@ monolib_qt_utils.o: $(srcdir)/src/qt/utils.cpp $(MONOLIB_ODEP) monolib_qt_window.o: $(srcdir)/src/qt/window.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/qt/window.cpp +monolib_qt_graphics.o: $(srcdir)/src/qt/graphics.cpp $(MONOLIB_ODEP) + $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/qt/graphics.cpp + monolib_univ_anybutton.o: $(srcdir)/src/univ/anybutton.cpp $(MONOLIB_ODEP) $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/univ/anybutton.cpp @@ -27998,6 +28008,9 @@ coredll_qt_utils.o: $(srcdir)/src/qt/utils.cpp $(COREDLL_ODEP) coredll_qt_window.o: $(srcdir)/src/qt/window.cpp $(COREDLL_ODEP) $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/qt/window.cpp +coredll_qt_graphics.o: $(srcdir)/src/qt/graphics.cpp $(COREDLL_ODEP) + $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/qt/graphics.cpp + coredll_univ_anybutton.o: $(srcdir)/src/univ/anybutton.cpp $(COREDLL_ODEP) $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/univ/anybutton.cpp @@ -32249,6 +32262,9 @@ corelib_qt_utils.o: $(srcdir)/src/qt/utils.cpp $(CORELIB_ODEP) corelib_qt_window.o: $(srcdir)/src/qt/window.cpp $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/qt/window.cpp +corelib_qt_graphics.o: $(srcdir)/src/qt/graphics.cpp $(CORELIB_ODEP) + $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/qt/graphics.cpp + corelib_univ_anybutton.o: $(srcdir)/src/univ/anybutton.cpp $(CORELIB_ODEP) $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/univ/anybutton.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 6001ccbd34..b7cc9e1699 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -252,6 +252,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/msw/ole/safearray.cpp src/msw/sound.cpp src/msw/ole/automtn.cpp + src/qt/graphics.cpp diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake index c126d0f237..75cc4a916f 100644 --- a/build/cmake/files.cmake +++ b/build/cmake/files.cmake @@ -175,6 +175,7 @@ set(QT_WIN32_SRC src/msw/dialup.cpp src/msw/dib.cpp src/msw/joystick.cpp + src/qt/graphics.cpp ) set(QT_WIN32_HDR diff --git a/build/files b/build/files index 13a542b9c9..8df05a9460 100644 --- a/build/files +++ b/build/files @@ -199,6 +199,7 @@ QT_WIN32_SRC= src/msw/dib.cpp src/msw/joystick.cpp src/msw/sound.cpp + src/qt/graphics.cpp QT_WIN32_HDR= wx/msw/ole/automtn.h diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index a8876075ef..f855e1e37e 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -3330,13 +3330,13 @@ wxGraphicsRenderer* wxGraphicsRenderer::GetCairoRenderer() #endif // wxUSE_CAIRO/!wxUSE_CAIRO -// MSW and OS X have their own native default renderers, but the other ports -// use Cairo by default -#if !(defined(__WXMSW__) || defined(__WXOSX__)) +// MSW and OS X and Qt on Windows have their own native default renderers, but the other ports +// use Cairo by default. +#if !(defined(__WXMSW__) || defined(__WXOSX__) || (defined(__WXQT__) && defined(__WIN32__))) wxGraphicsRenderer* wxGraphicsRenderer::GetDefaultRenderer() { return GetCairoRenderer(); } -#endif // !(__WXMSW__ || __WXOSX__) +#endif // !(__WXMSW__ || __WXOSX__ || (defined(__WXQT__) && defined(__WIN32__))) #endif // wxUSE_GRAPHICS_CONTEXT diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp new file mode 100644 index 0000000000..97feabff96 --- /dev/null +++ b/src/qt/graphics.cpp @@ -0,0 +1,1371 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/qt/graphics.cpp +// Purpose: Graphics context methods for the Qt platform +// Author: Jay Nabonne +// Created: 2018-12-13 +// Copyright: (c) Jay Nabonne +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#if defined(__BORLANDC__) + #pragma hdrstop +#endif + +#if wxUSE_GRAPHICS_CONTEXT + +#include +#include +#include + +#ifndef WX_PRECOMP + #include "wx/bitmap.h" + #include "wx/icon.h" + #include "wx/dcclient.h" + #include "wx/dcmemory.h" + #include "wx/dcprint.h" + #include "wx/window.h" +#endif + +#include "wx/graphics.h" +#include "wx/tokenzr.h" + +#include "wx/private/graphics.h" + +class WXDLLIMPEXP_CORE wxQtBrushData : public wxGraphicsObjectRefData +{ +public: + wxQtBrushData(wxGraphicsRenderer* renderer) + : wxGraphicsObjectRefData(renderer) + { + } + + wxQtBrushData(wxGraphicsRenderer* renderer, const wxBrush& wxbrush) + : wxGraphicsObjectRefData(renderer), + m_brush(wxbrush.GetHandle()) + { + } + + void CreateLinearGradientBrush(wxDouble x1, wxDouble y1, + wxDouble x2, wxDouble y2, + const wxGraphicsGradientStops& stops) + { + QLinearGradient gradient(x1, y1, x2, y2); + SetStops(gradient, stops); + m_brush = QBrush(gradient); + } + + void CreateRadialGradientBrush(wxDouble xo, wxDouble yo, + wxDouble xc, wxDouble yc, + wxDouble radius, + const wxGraphicsGradientStops& stops) + { + QRadialGradient gradient(QPointF(xc, yc), radius, QPointF(xo, yo)); + SetStops(gradient, stops); + m_brush = QBrush(gradient); + } + + const QBrush& getBrush() const + { + return m_brush; + } + +private: + static void + SetStops(QGradient& gradient, const wxGraphicsGradientStops& stops) + { + QGradientStops qstops; + for ( size_t i = 0; i < stops.GetCount(); ++i ) + { + const wxGraphicsGradientStop stop = stops.Item(i); + qstops.append(QGradientStop(stop.GetPosition(), + stop.GetColour().GetQColor())); + } + + gradient.setStops(qstops); + } + + QBrush m_brush; + + wxDECLARE_NO_COPY_CLASS(wxQtBrushData); +}; + +class WXDLLIMPEXP_CORE wxQtPenData : public wxGraphicsObjectRefData +{ +public: + wxQtPenData(wxGraphicsRenderer* renderer, const wxGraphicsPenInfo& info) + : wxGraphicsObjectRefData(renderer), + m_pen(CreatePenFromInfo(info)) + { + } + + const QPen& GetPen() const + { + return m_pen; + } + +private: + static QPen CreatePenFromInfo(const wxGraphicsPenInfo& info) + { + wxPen wxpen(info.GetColour(), info.GetWidth(), info.GetStyle()); + wxpen.SetDashes(info.GetDashCount(), info.GetDash()); + wxpen.SetJoin(info.GetJoin()); + wxpen.SetCap(info.GetCap()); + switch ( info.GetStyle() ) + { + case wxPENSTYLE_STIPPLE: + case wxPENSTYLE_STIPPLE_MASK: + case wxPENSTYLE_STIPPLE_MASK_OPAQUE: + { + wxpen.SetStipple(info.GetStipple()); + break; + } + default: + break; + } + + return wxpen.GetHandle(); + } + QPen m_pen; + + wxDECLARE_NO_COPY_CLASS(wxQtPenData); +}; + +class WXDLLIMPEXP_CORE wxQtBitmapData : public wxGraphicsBitmapData +{ +public: + wxQtBitmapData(wxGraphicsRenderer* renderer, QPixmap* pixmap) + : wxGraphicsBitmapData(renderer), + m_pixmap(pixmap) + { + } + + wxQtBitmapData(wxGraphicsRenderer* renderer, const wxBitmap& bmp) + : wxGraphicsBitmapData(renderer), + m_pixmap(bmp.GetHandle()) + { + } + + QPixmap* GetPixmap() const + { + return m_pixmap; + } + + virtual void* GetNativeBitmap() const wxOVERRIDE + { + return m_pixmap; + } + + static const QPixmap* GetPixmapFromBitmap(const wxGraphicsBitmap& bitmap) + { + const wxQtBitmapData* const + data = static_cast(bitmap.GetBitmapData()); + return data->GetPixmap(); + } + + +#if wxUSE_IMAGE + wxImage DoConvertToImage() const + { + wxBitmap bitmap(*m_pixmap); + return bitmap.ConvertToImage(); + } +#endif // wxUSE_IMAGE + +private: + QPixmap* m_pixmap; + + wxDECLARE_NO_COPY_CLASS(wxQtBitmapData); +}; + + +class WXDLLIMPEXP_CORE wxQtMatrixData : public wxGraphicsMatrixData +{ +public: + explicit wxQtMatrixData(wxGraphicsRenderer* renderer) + : wxGraphicsMatrixData(renderer), + m_transform(new QTransform) + { + } + + wxQtMatrixData(wxGraphicsRenderer* renderer, const QTransform& transform) + : wxGraphicsMatrixData(renderer), + m_transform(new QTransform(transform)) + { + } + + virtual ~wxQtMatrixData() + { + delete m_transform; + } + + virtual wxGraphicsObjectRefData* Clone() const wxOVERRIDE + { + wxQtMatrixData* newMatrix = new wxQtMatrixData(m_renderer); + *newMatrix->m_transform = *m_transform; + return newMatrix; + } + + // concatenates the matrix + virtual void Concat(const wxGraphicsMatrixData *t) wxOVERRIDE + { + const wxQtMatrixData* rhs = static_cast(t); + *m_transform = *rhs->m_transform* (*m_transform); + } + + // sets the matrix to the respective values + virtual void Set(wxDouble a = 1.0, wxDouble b = 0.0, + wxDouble c = 0.0, wxDouble d = 1.0, + wxDouble tx = 0.0, wxDouble ty = 0.0) wxOVERRIDE + { + m_transform->setMatrix(a, b, 0.0, + c, d, 0.0, + tx, ty, 1.0); + } + + // gets the component values of the matrix + virtual void Get(wxDouble* a, wxDouble* b, + wxDouble* c, wxDouble* d, + wxDouble* tx, wxDouble* ty) const wxOVERRIDE + { + if ( a ) + *a = m_transform->m11(); + if ( b ) + *b = m_transform->m12(); + if ( c ) + *c = m_transform->m21(); + if ( d ) + *d = m_transform->m22(); + if ( tx ) + *tx = m_transform->m31(); + if ( ty ) + *ty = m_transform->m32(); + } + + // makes this the inverse matrix + virtual void Invert() wxOVERRIDE + { + bool invertible = false; + const QTransform invTransform = m_transform->inverted(&invertible); + if ( invertible ) + { + *m_transform = invTransform; + } + } + + // returns true if the elements of the transformation matrix are equal ? + virtual bool IsEqual(const wxGraphicsMatrixData* t) const wxOVERRIDE + { + const wxQtMatrixData* rhs = static_cast(t); + return *m_transform == *rhs->m_transform; + } + + // return true if this is the identity matrix + virtual bool IsIdentity() const wxOVERRIDE + { + return m_transform->isIdentity(); + } + + // + // transformation + // + + // add the translation to this matrix + virtual void Translate(wxDouble dx, wxDouble dy) wxOVERRIDE + { + m_transform->translate(dx, dy); + } + + // add the scale to this matrix + virtual void Scale(wxDouble xScale, wxDouble yScale) wxOVERRIDE + { + m_transform->scale(xScale, yScale); + } + + // add the rotation to this matrix (radians) + virtual void Rotate(wxDouble angle) wxOVERRIDE + { + m_transform->rotateRadians(angle); + } + + // + // apply the transforms + // + + // applies that matrix to the point + virtual void TransformPoint(wxDouble *x, wxDouble *y) const wxOVERRIDE + { + qreal transformed_x, transformed_y; + m_transform->map(static_cast(*x), static_cast(*y), + &transformed_x, &transformed_y); + *x = transformed_x; + *y = transformed_y; + } + + // applies the matrix except for translations + virtual void TransformDistance(wxDouble *dx, wxDouble *dy) const wxOVERRIDE + { + const QTransform untransTransform( + m_transform->m11(), + m_transform->m12(), + m_transform->m13(), + m_transform->m21(), + m_transform->m22(), + m_transform->m23(), + 0.0, + 0.0, + 1.0); + + qreal transformed_x, transformed_y; + untransTransform.map(static_cast(*dx), static_cast(*dy), + &transformed_x, &transformed_y); + + *dx = transformed_x; + *dy = transformed_y; + } + + // returns the native representation + virtual void* GetNativeMatrix() const wxOVERRIDE + { + return static_cast(m_transform); + } + + const QTransform& GetQTransform() const + { + return *m_transform; + } +private: + QTransform* m_transform; + + wxDECLARE_NO_COPY_CLASS(wxQtMatrixData); +}; + +class wxQtFontData : public wxGraphicsObjectRefData +{ +public: + wxQtFontData(wxGraphicsRenderer* renderer, + const wxFont& font, + const wxColour& col) + : wxGraphicsObjectRefData(renderer), + m_font(font.GetHandle()), + m_color(col.GetQColor()) + { + } + + wxQtFontData( + wxGraphicsRenderer* renderer, + double sizeInPixels, + const wxString& facename, + int flags, + const wxColour& col) + : wxGraphicsObjectRefData(renderer), + m_color(col.GetQColor()) + { + m_font.setFamily(QString(facename)); + m_font.setPixelSize(static_cast(sizeInPixels)); + if ( flags & wxFONTFLAG_LIGHT ) + m_font.setWeight(QFont::Light); + if ( flags & wxFONTFLAG_BOLD ) + m_font.setWeight(QFont::Bold); + if ( flags & (wxFONTFLAG_ITALIC | wxFONTFLAG_SLANT) ) + m_font.setItalic(true); + if ( flags & wxFONTFLAG_ANTIALIASED ) + m_font.setStyleStrategy(QFont::PreferAntialias); + if ( flags & wxFONTFLAG_NOT_ANTIALIASED ) + m_font.setStyleStrategy(QFont::NoAntialias); + if ( flags & wxFONTFLAG_UNDERLINED ) + m_font.setUnderline(true); + if ( flags & wxFONTFLAG_STRIKETHROUGH ) + m_font.setStrikeOut(true); + } + + const QFont& GetFont() const + { + return m_font; + } + + const QColor& GetColor() const + { + return m_color; + } + +private: + QFont m_font; + QColor m_color; + + wxDECLARE_NO_COPY_CLASS(wxQtFontData); +}; + +//----------------------------------------------------------------------------- +// wxQtGraphicsPathData +//----------------------------------------------------------------------------- + +class WXDLLIMPEXP_CORE wxQtGraphicsPathData : public wxGraphicsPathData +{ +public: + wxQtGraphicsPathData(wxGraphicsRenderer* renderer) + : wxGraphicsPathData(renderer), + m_path(new QPainterPath()), + m_current_subpath_start(-1) + { + } + + ~wxQtGraphicsPathData() + { + delete m_path; + } + + virtual wxGraphicsObjectRefData *Clone() const wxOVERRIDE + { + return new wxQtGraphicsPathData(*this); + } + + // + // These are the path primitives from which everything else can be + // constructed. + // + + // begins a new subpath at (x,y) + virtual void MoveToPoint(wxDouble x, wxDouble y) wxOVERRIDE + { + m_path->moveTo(x, y); + m_current_subpath_start = m_path->elementCount() - 1; + } + + // adds a straight line from the current point to (x,y) + // if there is no current path, it is equivalent to a moveTo. + virtual void AddLineToPoint(wxDouble x, wxDouble y) wxOVERRIDE + { + if ( !HasCurrentSubpath() ) + MoveToPoint(x, y); + else + m_path->lineTo(x, y); + } + + // adds a cubic Bezier curve from the current point, using two control + // points and an end point + virtual void + AddCurveToPoint(wxDouble cx1, wxDouble cy1, + wxDouble cx2, wxDouble cy2, + wxDouble x, wxDouble y) wxOVERRIDE + { + if ( !HasCurrentSubpath() ) + MoveToPoint(cx1, cy1); + m_path->cubicTo(QPointF(cx1, cy1), QPointF(cx2, cy2), QPointF(x, y)); + } + + // adds an arc of a circle centering at (x,y) with radius (r) from + // startAngle to endAngle + virtual void + AddArc(wxDouble x, wxDouble y, wxDouble r, + wxDouble startAngle, wxDouble endAngle, + bool clockwise) wxOVERRIDE + { + const bool fixupFirst = !HasCurrentSubpath(); + if ( fixupFirst ) + MoveToPoint(x, y); + + qreal arcLength; + if ( clockwise ) + { + if ( endAngle < startAngle ) + endAngle += 2* M_PI; + arcLength = -wxRadToDeg(endAngle - startAngle); + } + else + { + if ( endAngle > startAngle ) + endAngle -= 2* M_PI; + arcLength = -wxRadToDeg(endAngle - startAngle); + } + m_path->arcTo(x-r, y-r, r*2, r*2, -wxRadToDeg(startAngle), arcLength); + if ( fixupFirst ) + { + QPainterPath::Element + element = m_path->elementAt(m_current_subpath_start+1); + m_path->setElementPositionAt(m_current_subpath_start, + element.x, element.y); + } + } + + // gets the last point of the current path, (0,0) if not yet set + virtual void GetCurrentPoint(wxDouble* x, wxDouble* y) const wxOVERRIDE + { + QPointF position = m_path->currentPosition(); + *x = position.x(); + *y = position.y(); + } + + // adds another path + virtual void AddPath(const wxGraphicsPathData* path) wxOVERRIDE + { + const wxQtGraphicsPathData* + pathAdded = static_cast(path); + m_path->addPath(*pathAdded->m_path); + } + + // closes the current sub-path + virtual void CloseSubpath() wxOVERRIDE + { + // Current position must be end of last path after close, not (0,0) as + // Qt sets. + if ( !HasCurrentSubpath() ) + return; + + const QPainterPath::Element + firstElement = m_path->elementAt(m_current_subpath_start); + + m_path->closeSubpath(); + MoveToPoint(firstElement.x, firstElement.y); + } + + // + // These are convenience functions which - if not available natively will + // be assembled using the primitives from above + // + + // appends a circle as a new closed subpath + virtual void AddCircle(wxDouble x, wxDouble y, wxDouble r) wxOVERRIDE + { + m_path->addEllipse(x - r, y - r, r*2, r*2); + } + + // appends an ellipse as a new closed subpath fitting the passed rectangle + virtual void + AddEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE + { + m_path->addEllipse(x, y, w, h); + } + + // returns the native path + virtual void* GetNativePath() const wxOVERRIDE + { + return static_cast(m_path); + } + + // give the native path returned by GetNativePath() back (there might be + // some deallocations necessary) + virtual void UnGetNativePath(void *) const wxOVERRIDE + { + } + + // transforms each point of this path by the matrix + virtual void Transform(const wxGraphicsMatrixData* matrix) wxOVERRIDE + { + const wxQtMatrixData* + qmatrix = static_cast(matrix); + *m_path = qmatrix->GetQTransform().map(*m_path); + } + + // gets the bounding box enclosing all points (possibly including control + // points) + virtual void + GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const wxOVERRIDE + { + QRectF boundingRect = m_path->controlPointRect(); + + if ( !boundingRect.isValid() ) + boundingRect = QRectF(); + + if ( x ) *x = boundingRect.left(); + if ( y ) *y = boundingRect.top(); + if ( w ) *w = boundingRect.width(); + if ( h ) *h = boundingRect.height(); + } + + virtual bool + Contains(wxDouble x, wxDouble y, + wxPolygonFillMode /*fillStyle = wxWINDING_RULE*/) const wxOVERRIDE + { + return m_path->contains(QPointF(x, y)); + } + +private: + // for Clone + wxQtGraphicsPathData(const wxQtGraphicsPathData& rhs) + : wxGraphicsPathData(rhs.GetRenderer()), + m_path(new QPainterPath(*rhs.m_path)), + m_current_subpath_start(rhs.m_current_subpath_start) + { + } + + bool HasCurrentSubpath() const + { + return m_current_subpath_start != -1; + } + + QPainterPath* m_path; + int m_current_subpath_start; + + wxQtGraphicsPathData& operator=(const wxQtGraphicsPathData&); +}; + +class WXDLLIMPEXP_CORE wxQtGraphicsContext : public wxGraphicsContext +{ + void InitFromDC(const wxDC& dc) + { + m_qtPainter = static_cast(dc.GetHandle()); + m_ownsPainter = false; + + const wxSize sz = dc.GetSize(); + m_width = sz.x; + m_height = sz.y; + } + +protected: + wxQtGraphicsContext(wxGraphicsRenderer* renderer) + : wxGraphicsContext(renderer), + m_qtPainter(NULL), + m_ownsPainter(false) + { + } + +public: + wxQtGraphicsContext(wxGraphicsRenderer* renderer, QPaintDevice* device) + : wxGraphicsContext(renderer) + { + m_qtPainter = new QPainter(device); + m_ownsPainter = true; + + m_width = device->width(); + m_height = device->height(); + } + + wxQtGraphicsContext(wxGraphicsRenderer* renderer, const wxWindowDC& dc) + : wxGraphicsContext(renderer) + { + InitFromDC(dc); + } + + wxQtGraphicsContext(wxGraphicsRenderer* renderer, const wxMemoryDC& dc) + : wxGraphicsContext(renderer) + { + InitFromDC(dc); + } + +#if wxUSE_PRINTING_ARCHITECTURE + wxQtGraphicsContext(wxGraphicsRenderer* renderer, const wxPrinterDC& dc) + : wxGraphicsContext(renderer) + { + InitFromDC(dc); + } + +#endif + + wxQtGraphicsContext(wxGraphicsRenderer* renderer, wxWindow *window) + : wxGraphicsContext(renderer) + { + m_qtPainter = static_cast(window->QtGetPainter()); + m_ownsPainter = false; + + const wxSize sz = window->GetClientSize(); + m_width = sz.x; + m_height = sz.y; + } + + virtual ~wxQtGraphicsContext() + { + if ( m_ownsPainter ) + delete m_qtPainter; + } + + virtual bool ShouldOffset() const wxOVERRIDE + { + return false; + } + + virtual void Clip(const wxRegion& region) wxOVERRIDE + { + m_qtPainter->setClipRegion(region.GetHandle()); + } + + // clips drawings to the rect + virtual void Clip(wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE + { + m_qtPainter->setClipRect(x, y, w, h); + } + + // resets the clipping to original extent + virtual void ResetClip() wxOVERRIDE + { + m_qtPainter->setClipping(false); + } + + // returns bounding box of the clipping region + virtual void + GetClipBox(wxDouble* x, wxDouble* y, wxDouble* w, wxDouble* h) wxOVERRIDE + { + const QRectF box = m_qtPainter->clipBoundingRect(); + if ( x ) + *x = box.left(); + if ( y ) + *y = box.top(); + if ( w ) + *w = box.width(); + if ( h ) + *h = box.height(); + } + + virtual void* GetNativeContext() wxOVERRIDE + { + return static_cast(m_qtPainter); + } + + virtual bool SetAntialiasMode(wxAntialiasMode antialias) wxOVERRIDE + { + bool enableAA = false; + switch ( antialias ) + { + case wxANTIALIAS_DEFAULT: + enableAA = true; + break; + + case wxANTIALIAS_NONE: + enableAA = false; + break; + } + + m_qtPainter->setRenderHints(QPainter::Antialiasing | + QPainter::TextAntialiasing, + enableAA); + + m_antialias = antialias; + return true; + } + + virtual bool + SetInterpolationQuality(wxInterpolationQuality interpolation) wxOVERRIDE + { + m_qtPainter->setRenderHint(QPainter::SmoothPixmapTransform, + interpolation == wxINTERPOLATION_BEST); + m_interpolation = interpolation; + return true; + } + + virtual bool SetCompositionMode(wxCompositionMode composition) wxOVERRIDE + { + QPainter::CompositionMode q_composition_mode; + switch ( composition ) + { + case wxCOMPOSITION_CLEAR: + q_composition_mode = QPainter::CompositionMode_Clear; + break; + case wxCOMPOSITION_SOURCE: + q_composition_mode = QPainter::CompositionMode_Source; + break; + case wxCOMPOSITION_OVER: + q_composition_mode = QPainter::CompositionMode_SourceOver; + break; + case wxCOMPOSITION_IN: + q_composition_mode = QPainter::CompositionMode_SourceIn; + break; + case wxCOMPOSITION_OUT: + q_composition_mode = QPainter::CompositionMode_SourceOut; + break; + case wxCOMPOSITION_ATOP: + q_composition_mode = QPainter::CompositionMode_SourceAtop; + break; + case wxCOMPOSITION_DEST: + q_composition_mode = QPainter::CompositionMode_Destination; + break; + case wxCOMPOSITION_DEST_OVER: + q_composition_mode = QPainter::CompositionMode_DestinationOver; + break; + case wxCOMPOSITION_DEST_IN: + q_composition_mode = QPainter::CompositionMode_DestinationIn; + break; + case wxCOMPOSITION_DEST_OUT: + q_composition_mode = QPainter::CompositionMode_DestinationOut; + break; + case wxCOMPOSITION_DEST_ATOP: + q_composition_mode = QPainter::CompositionMode_DestinationAtop; + break; + case wxCOMPOSITION_XOR: + q_composition_mode = QPainter::CompositionMode_Xor; + break; + case wxCOMPOSITION_ADD: + q_composition_mode = QPainter::CompositionMode_Plus; + break; + default: + return false; + } + m_qtPainter->setCompositionMode(q_composition_mode); + m_composition = composition; + return true; + } + + virtual void BeginLayer(wxDouble /*opacity*/) wxOVERRIDE + { + wxFAIL_MSG("BeginLayer not implemented"); + } + + virtual void EndLayer() wxOVERRIDE + { + wxFAIL_MSG("EndLayer not implemented"); + } + + virtual void StrokePath(const wxGraphicsPath& p) wxOVERRIDE + { + if ( m_pen.IsNull() ) + { + return; + } + + const QPainterPath* + pathData = static_cast(p.GetNativePath()); + const QPen& + pen = static_cast(m_pen.GetRefData())->GetPen(); + m_qtPainter->strokePath(*pathData, pen); + } + + virtual void + FillPath(const wxGraphicsPath& p, + wxPolygonFillMode /*fillStyle = wxWINDING_RULE*/) wxOVERRIDE + { + if ( m_brush.IsNull() ) + { + return; + } + + const QPainterPath* + pathData = static_cast(p.GetNativePath()); + const QBrush& + brush = static_cast(m_brush.GetRefData())->getBrush(); + m_qtPainter->fillPath(*pathData, brush); + } + + virtual void + ClearRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE + { + m_qtPainter->fillRect(x, y, w, h, QBrush(QColor(0, 0, 0, 0))); + } + + virtual void Translate(wxDouble dx, wxDouble dy) wxOVERRIDE + { + m_qtPainter->translate(dx, dy); + } + + virtual void Scale(wxDouble xScale, wxDouble yScale) wxOVERRIDE + { + m_qtPainter->scale(xScale, yScale); + } + + virtual void Rotate(wxDouble angle) wxOVERRIDE + { + // wx angle is in radians. Qt angle is in degrees. + m_qtPainter->rotate(wxRadToDeg(angle)); + } + + // concatenates this transform with the current transform of this context + virtual void ConcatTransform(const wxGraphicsMatrix& matrix) wxOVERRIDE + { + wxGraphicsMatrix currentMatrix = GetTransform(); + currentMatrix.Concat(matrix); + SetTransform(currentMatrix); + } + + // sets the transform of this context + virtual void SetTransform(const wxGraphicsMatrix& matrix) wxOVERRIDE + { + const wxQtMatrixData* + qmatrix = static_cast(matrix.GetRefData()); + m_qtPainter->setTransform(qmatrix->GetQTransform()); + } + + // gets the matrix of this context + virtual wxGraphicsMatrix GetTransform() const wxOVERRIDE + { + const QTransform& transform = m_qtPainter->transform(); + wxGraphicsMatrix m; + m.SetRefData(new wxQtMatrixData(GetRenderer(), transform)); + return m; + } + + virtual void + DrawBitmap(const wxGraphicsBitmap& bmp, + wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE + { + const QPixmap* pixmap = wxQtBitmapData::GetPixmapFromBitmap(bmp); + m_qtPainter->drawPixmap(x, y, w, h, *pixmap); + } + + virtual void + DrawBitmap(const wxBitmap& bmp, + wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE + { + DoDrawBitmap(bmp, x, y, w, h, true); + } + + virtual void + DrawIcon(const wxIcon& icon, + wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE + { + DoDrawBitmap(icon, x, y, w, h, true); + } + + virtual void PushState() wxOVERRIDE + { + m_qtPainter->save(); + } + + virtual void PopState() wxOVERRIDE + { + m_qtPainter->restore(); + } + + virtual void Flush() wxOVERRIDE + { + } + + virtual void GetTextExtent(const wxString& str, + wxDouble *width, + wxDouble *height, + wxDouble *descent, + wxDouble *externalLeading) const wxOVERRIDE + { + wxCHECK_RET( !m_font.IsNull(), + "wxQtContext::GetTextExtent - no valid font set" ); + + const wxQtFontData* + fontData = static_cast(m_font.GetRefData()); + m_qtPainter->setFont(fontData->GetFont()); + + const QFontMetrics metrics = m_qtPainter->fontMetrics(); + const QRect boundingRect = metrics.boundingRect(QString(str)); + + if ( width ) + *width = boundingRect.width(); + if ( height ) + *height = boundingRect.height(); + if ( descent ) + *descent = metrics.descent(); + if ( externalLeading ) + *externalLeading = metrics.leading() - (metrics.ascent() + metrics.descent()); + } + + virtual void + GetPartialTextExtents(const wxString& text, + wxArrayDouble& widths) const wxOVERRIDE + { + wxCHECK_RET( !m_font.IsNull(), + "wxQtContext::GetPartialTextExtents - no valid font set" ); + + const wxQtFontData* + fontData = static_cast(m_font.GetRefData()); + m_qtPainter->setFont(fontData->GetFont()); + + const QFontMetrics metrics = m_qtPainter->fontMetrics(); + + const size_t textLength = text.length(); + + widths.clear(); + widths.insert(widths.end(), textLength, 0); + + for ( size_t i = 0; i < textLength; ++i ) + { + const wxString subString = text.substr(0, i+1); + const QRect + boundingRect = metrics.boundingRect(QString(subString)); + widths[i] = boundingRect.width(); + } + } + +protected: + virtual void + DoDrawText(const wxString& str, wxDouble x, wxDouble y) wxOVERRIDE + { + wxCHECK_RET( !m_font.IsNull(), + "wxQtContext::DrawText - no valid font set" ); + + const wxQtFontData* + fontData = static_cast(m_font.GetRefData()); + + m_qtPainter->setFont(fontData->GetFont()); + m_qtPainter->setPen(QPen(fontData->GetColor())); + + QFontMetrics metrics = m_qtPainter->fontMetrics(); + + wxStringTokenizer tokenizer(str, "\n"); + while ( tokenizer.HasMoreTokens() ) + { + const wxString line = tokenizer.GetNextToken(); + m_qtPainter->drawText(x, y + metrics.ascent(), QString(line)); + y += metrics.lineSpacing(); + } + } + + void + DoDrawBitmap(const wxBitmap& bmp, + wxDouble x, wxDouble y, + wxDouble w, wxDouble h, bool useMask) const + { + QPixmap pix = *bmp.GetHandle(); + + if (useMask && bmp.GetMask() && bmp.GetMask()->GetHandle()) + pix.setMask(*bmp.GetMask()->GetHandle()); + + m_qtPainter->drawPixmap(x, y, w, h, pix); + } + + QPainter* m_qtPainter; + bool m_ownsPainter; + +private: + wxDECLARE_NO_COPY_CLASS(wxQtGraphicsContext); +}; + +class wxQtMeasuringContext : public wxQtGraphicsContext +{ +public: + wxQtMeasuringContext(wxGraphicsRenderer* renderer) + : wxQtGraphicsContext(renderer, QApplication::desktop()) + { + } + +private: + QPainter painter; +}; + +class wxQtImageContext : public wxQtGraphicsContext +{ +public: + wxQtImageContext(wxGraphicsRenderer* renderer, wxImage& image) : + wxQtGraphicsContext(renderer), + m_image(image) + { + const wxBitmap wxbitmap(image); + m_pixmap = *wxbitmap.GetHandle(); + m_qtPainter = new QPainter(&m_pixmap); + m_ownsPainter = false; + } + + ~wxQtImageContext() + { + wxQtBitmapData bitmap(GetRenderer(), &m_pixmap); + m_image = bitmap.DoConvertToImage(); + delete m_qtPainter; + } + +private: + QPixmap m_pixmap; + wxImage& m_image; +}; + +//----------------------------------------------------------------------------- +// wxQtGraphicsRenderer declaration +//----------------------------------------------------------------------------- + +class WXDLLIMPEXP_CORE wxQtGraphicsRenderer : public wxGraphicsRenderer +{ +public: + wxQtGraphicsRenderer() {} + + virtual ~wxQtGraphicsRenderer() {} + + // Context + + virtual wxGraphicsContext* CreateContext(const wxWindowDC& dc) wxOVERRIDE; + virtual wxGraphicsContext* CreateContext(const wxMemoryDC& dc) wxOVERRIDE; +#if wxUSE_PRINTING_ARCHITECTURE + virtual wxGraphicsContext* CreateContext(const wxPrinterDC& dc) wxOVERRIDE; +#endif + + virtual wxGraphicsContext* CreateContextFromNativeContext(void* context) wxOVERRIDE; + + virtual wxGraphicsContext* CreateContextFromNativeWindow(void* window) wxOVERRIDE; + +#if wxUSE_IMAGE + virtual wxGraphicsContext* CreateContextFromImage(wxImage& image) wxOVERRIDE; +#endif // wxUSE_IMAGE + + virtual wxGraphicsContext* CreateContext(wxWindow* window) wxOVERRIDE; + + virtual wxGraphicsContext* CreateMeasuringContext() wxOVERRIDE; + + // Path + + virtual wxGraphicsPath CreatePath() wxOVERRIDE; + + // Matrix + + virtual wxGraphicsMatrix CreateMatrix(wxDouble a = 1.0, wxDouble b = 0.0, + wxDouble c = 0.0, wxDouble d = 1.0, + wxDouble tx = 0.0, wxDouble ty = 0.0) wxOVERRIDE; + + virtual wxGraphicsPen CreatePen(const wxGraphicsPenInfo& info) wxOVERRIDE; + + virtual wxGraphicsBrush CreateBrush(const wxBrush& brush) wxOVERRIDE; + + virtual wxGraphicsBrush + CreateLinearGradientBrush(wxDouble x1, wxDouble y1, + wxDouble x2, wxDouble y2, + const wxGraphicsGradientStops& stops) wxOVERRIDE; + + virtual wxGraphicsBrush + CreateRadialGradientBrush(wxDouble xo, wxDouble yo, + wxDouble xc, wxDouble yc, + wxDouble radius, + const wxGraphicsGradientStops& stops) wxOVERRIDE; + + // sets the font + virtual wxGraphicsFont CreateFont(const wxFont& font, + const wxColour& col = *wxBLACK) wxOVERRIDE; + virtual wxGraphicsFont CreateFont(double sizeInPixels, + const wxString& facename, + int flags = wxFONTFLAG_DEFAULT, + const wxColour& col = *wxBLACK) wxOVERRIDE; + + // create a native bitmap representation + virtual wxGraphicsBitmap CreateBitmap(const wxBitmap& bitmap) wxOVERRIDE; +#if wxUSE_IMAGE + virtual wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image) wxOVERRIDE; + virtual wxImage CreateImageFromBitmap(const wxGraphicsBitmap& bmp) wxOVERRIDE; +#endif // wxUSE_IMAGE + + // create a graphics bitmap from a native bitmap + virtual wxGraphicsBitmap CreateBitmapFromNativeBitmap(void* bitmap) wxOVERRIDE; + + // create a subimage from a native image representation + virtual wxGraphicsBitmap CreateSubBitmap(const wxGraphicsBitmap& bitmap, + wxDouble x, wxDouble y, + wxDouble w, wxDouble h) wxOVERRIDE; + + virtual wxString GetName() const wxOVERRIDE; + virtual void GetVersion(int *major, + int *minor, + int *micro) const wxOVERRIDE; + + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxQtGraphicsRenderer); +}; + +//----------------------------------------------------------------------------- +// wxQtGraphicsRenderer implementation +//----------------------------------------------------------------------------- + +wxIMPLEMENT_DYNAMIC_CLASS(wxQtGraphicsRenderer, wxGraphicsRenderer); + +wxGraphicsContext* wxQtGraphicsRenderer::CreateContext(const wxWindowDC& dc) +{ + return new wxQtGraphicsContext(this, dc); +} + +wxGraphicsContext* wxQtGraphicsRenderer::CreateContext(const wxMemoryDC& dc) +{ + return new wxQtGraphicsContext(this, dc); +} + +#if wxUSE_PRINTING_ARCHITECTURE +wxGraphicsContext* wxQtGraphicsRenderer::CreateContext(const wxPrinterDC& dc) +{ + return new wxQtGraphicsContext(this, dc); +} +#endif + +wxGraphicsContext* +wxQtGraphicsRenderer::CreateContextFromNativeContext(void* context) +{ + return new wxQtGraphicsContext(this, static_cast(context)); +} + +wxGraphicsContext* +wxQtGraphicsRenderer::CreateContextFromNativeWindow(void* window) +{ + return new wxQtGraphicsContext(this, static_cast(window)); +} + +#if wxUSE_IMAGE +wxGraphicsContext* wxQtGraphicsRenderer::CreateContextFromImage(wxImage& image) +{ + return new wxQtImageContext(this, image); +} +#endif // wxUSE_IMAGE + +wxGraphicsContext* wxQtGraphicsRenderer::CreateMeasuringContext() +{ + return new wxQtMeasuringContext(this); +} + +wxGraphicsContext* wxQtGraphicsRenderer::CreateContext(wxWindow* window) +{ + return new wxQtGraphicsContext(this, window); +} + +// Path + +wxGraphicsPath wxQtGraphicsRenderer::CreatePath() +{ + wxGraphicsPath path; + path.SetRefData(new wxQtGraphicsPathData(this)); + return path; +} + +// Matrix + +wxGraphicsMatrix wxQtGraphicsRenderer::CreateMatrix(wxDouble a, wxDouble b, + wxDouble c, wxDouble d, + wxDouble tx, wxDouble ty) + +{ + wxGraphicsMatrix m; + wxQtMatrixData* data = new wxQtMatrixData(this); + data->Set(a, b, c, d, tx, ty); + m.SetRefData(data); + return m; +} + +wxGraphicsPen wxQtGraphicsRenderer::CreatePen(const wxGraphicsPenInfo& info) +{ + wxGraphicsPen p; + if ( info.GetStyle() != wxPENSTYLE_TRANSPARENT ) + { + p.SetRefData(new wxQtPenData(this, info)); + } + return p; +} + +wxGraphicsBrush wxQtGraphicsRenderer::CreateBrush(const wxBrush& brush) +{ + wxGraphicsBrush p; + if ( brush.IsOk() && brush.GetStyle() != wxBRUSHSTYLE_TRANSPARENT ) + { + p.SetRefData(new wxQtBrushData(this, brush)); + } + return p; +} + +wxGraphicsBrush wxQtGraphicsRenderer::CreateLinearGradientBrush( + wxDouble x1, wxDouble y1, + wxDouble x2, wxDouble y2, + const wxGraphicsGradientStops& stops) +{ + wxGraphicsBrush p; + wxQtBrushData* d = new wxQtBrushData(this); + d->CreateLinearGradientBrush(x1, y1, x2, y2, stops); + p.SetRefData(d); + return p; +} + +wxGraphicsBrush wxQtGraphicsRenderer::CreateRadialGradientBrush( + wxDouble xo, wxDouble yo, + wxDouble xc, wxDouble yc, wxDouble r, + const wxGraphicsGradientStops& stops) +{ + wxGraphicsBrush p; + wxQtBrushData* d = new wxQtBrushData(this); + d->CreateRadialGradientBrush(xo, yo, xc, yc, r, stops); + p.SetRefData(d); + return p; +} + +wxGraphicsFont +wxQtGraphicsRenderer::CreateFont(const wxFont& font, const wxColour& col) +{ + wxGraphicsFont p; + if ( font.IsOk() ) + { + p.SetRefData(new wxQtFontData(this, font, col)); + } + return p; +} + +wxGraphicsFont wxQtGraphicsRenderer::CreateFont( + double sizeInPixels, + const wxString& facename, + int flags, + const wxColour& col) +{ + wxGraphicsFont font; + font.SetRefData(new wxQtFontData(this, sizeInPixels, facename, flags, col)); + return font; +} + +wxGraphicsBitmap wxQtGraphicsRenderer::CreateBitmap(const wxBitmap& bmp) +{ + wxGraphicsBitmap p; + if ( bmp.IsOk() ) + { + p.SetRefData(new wxQtBitmapData(this, bmp)); + } + return p; +} + +#if wxUSE_IMAGE + +wxGraphicsBitmap +wxQtGraphicsRenderer::CreateBitmapFromImage(const wxImage& image) +{ + wxGraphicsBitmap bmp; + if ( image.IsOk() ) + { + bmp.SetRefData(new wxQtBitmapData(this, image)); + } + return bmp; +} + +wxImage wxQtGraphicsRenderer::CreateImageFromBitmap(const wxGraphicsBitmap& bmp) +{ + const wxQtBitmapData* const + data = static_cast(bmp.GetBitmapData()); + return data->DoConvertToImage(); +} +#endif // wxUSE_IMAGE + +wxGraphicsBitmap +wxQtGraphicsRenderer::CreateBitmapFromNativeBitmap(void* bitmap) +{ + wxGraphicsBitmap p; + if ( bitmap != NULL ) + { + p.SetRefData(new wxQtBitmapData(this, (QPixmap*)bitmap)); + } + return p; +} + +wxGraphicsBitmap +wxQtGraphicsRenderer::CreateSubBitmap(const wxGraphicsBitmap& bitmap, + wxDouble x, wxDouble y, + wxDouble w, wxDouble h) +{ + wxCHECK_MSG(!bitmap.IsNull(), wxNullGraphicsBitmap, wxS("Invalid bitmap")); + + const QPixmap* sourcePixmap = wxQtBitmapData::GetPixmapFromBitmap(bitmap); + wxCHECK_MSG(sourcePixmap, wxNullGraphicsBitmap, wxS("Invalid bitmap")); + + const int srcWidth = sourcePixmap->width(); + const int srcHeight = sourcePixmap->height(); + const int dstWidth = wxRound(w); + const int dstHeight = wxRound(h); + + wxCHECK_MSG(x >= 0.0 && y >= 0.0 && dstWidth > 0 && dstHeight > 0 && + x + dstWidth <= srcWidth && y + dstHeight <= srcHeight, + wxNullGraphicsBitmap, wxS("Invalid bitmap region")); + + QPixmap* subPixmap = new QPixmap(sourcePixmap->copy(x, y, w, h)); + + wxGraphicsBitmap bmpRes; + bmpRes.SetRefData(new wxQtBitmapData(this, subPixmap)); + return bmpRes; +} + +wxString wxQtGraphicsRenderer::GetName() const +{ + return "qt"; +} + +void wxQtGraphicsRenderer::GetVersion(int *major, int *minor, int *micro) const +{ + if ( major ) *major = QT_VERSION_MAJOR; + if ( minor ) *minor = QT_VERSION_MINOR; + if ( micro ) *micro = QT_VERSION_PATCH; +} + +static wxQtGraphicsRenderer gs_qtGraphicsRenderer; + +wxGraphicsRenderer* wxGraphicsRenderer::GetDefaultRenderer() +{ + return &gs_qtGraphicsRenderer; +} + +#endif // wxUSE_GRAPHICS_CONTEXT From defae61c13ce01d0e119cdbcf9075cbd9a0ce0ce Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 17 Jan 2019 21:51:55 +0100 Subject: [PATCH 265/553] Extend wxHeaderCtrl demonstration in widgets sample Added ability to show wxHeaderCtrl with various styles. --- samples/widgets/headerctrl.cpp | 87 ++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 4 deletions(-) diff --git a/samples/widgets/headerctrl.cpp b/samples/widgets/headerctrl.cpp index 17c28de6e3..efa883f7ff 100644 --- a/samples/widgets/headerctrl.cpp +++ b/samples/widgets/headerctrl.cpp @@ -28,7 +28,9 @@ // for all others, include the necessary headers #ifndef WX_PRECOMP #include "wx/button.h" + #include "wx/checkbox.h" #include "wx/sizer.h" + #include "wx/statbox.h" #include "wx/stattext.h" #endif @@ -59,9 +61,23 @@ public: virtual void CreateContent() wxOVERRIDE; protected: + // event handlers + void OnStyleCheckBox(wxCommandEvent& evt); + void OnResetButton(wxCommandEvent& evt); + void OnUpdateUIResetButton(wxUpdateUIEvent& evt); + + // reset the header styles + void Reset(); + // compose style flags based on selected styles + long GetStyleFlags() const; + // the control itself and the sizer it is in wxHeaderCtrlSimple *m_header; wxSizer *m_sizerHeader; + // the check boxes for styles + wxCheckBox *m_chkAllowReorder; + wxCheckBox *m_chkAllowHide; + wxCheckBox *m_chkBitmapOnRight; private: DECLARE_WIDGETS_PAGE(HeaderCtrlWidgetsPage) @@ -82,22 +98,44 @@ IMPLEMENT_WIDGETS_PAGE(HeaderCtrlWidgetsPage, void HeaderCtrlWidgetsPage::CreateContent() { + // left pane + wxStaticBox* box = new wxStaticBox(this, wxID_ANY, "&Set style"); + wxSizer* sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); + + m_chkAllowReorder = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow &reorder"); + m_chkAllowHide = CreateCheckBoxAndAddToSizer(sizerLeft, "Alow &hide"); + m_chkBitmapOnRight = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap on right"); + + sizerLeft->Add(5, 5, wxSizerFlags().Expand().Border(wxALL, 5)); // spacer + + wxButton* btnReset = new wxButton(this, wxID_ANY, "&Reset"); + sizerLeft->Add(btnReset, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); + + // right pane m_sizerHeader = new wxStaticBoxSizer(wxVERTICAL, this, "Header"); + Reset(); RecreateWidget(); - wxSizer* const sizerTop = new wxBoxSizer(wxHORIZONTAL); + // the 2 panes compose the window + wxSizer* sizerTop = new wxBoxSizer(wxHORIZONTAL); + sizerTop->Add(sizerLeft, wxSizerFlags().Expand().DoubleBorder()); sizerTop->Add(m_sizerHeader, wxSizerFlags(1).Expand().DoubleBorder()); SetSizer(sizerTop); + + // Bind event handlers + m_chkAllowReorder->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckBox, this); + m_chkAllowHide->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckBox, this); + m_chkBitmapOnRight->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckBox, this); + btnReset->Bind(wxEVT_BUTTON, &HeaderCtrlWidgetsPage::OnResetButton, this); + btnReset->Bind(wxEVT_UPDATE_UI, &HeaderCtrlWidgetsPage::OnUpdateUIResetButton, this); } void HeaderCtrlWidgetsPage::RecreateWidget() { m_sizerHeader->Clear(true /* delete windows */); - int flags = GetAttrs().m_defaultFlags; - - flags |= wxHD_DEFAULT_STYLE; + long flags = GetAttrs().m_defaultFlags | GetStyleFlags(); m_header = new wxHeaderCtrlSimple(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, @@ -111,4 +149,45 @@ void HeaderCtrlWidgetsPage::RecreateWidget() m_sizerHeader->Layout(); } +void HeaderCtrlWidgetsPage::Reset() +{ + m_chkAllowReorder->SetValue((wxHD_DEFAULT_STYLE & wxHD_ALLOW_REORDER) != 0); + m_chkAllowHide->SetValue((wxHD_DEFAULT_STYLE & wxHD_ALLOW_HIDE) != 0); + m_chkBitmapOnRight->SetValue((wxHD_DEFAULT_STYLE & wxHD_BITMAP_ON_RIGHT) != 0); +} + +long HeaderCtrlWidgetsPage::GetStyleFlags() const +{ + long flags = 0; + + if ( m_chkAllowReorder->IsChecked() ) + flags |= wxHD_ALLOW_REORDER; + if ( m_chkAllowHide->IsChecked() ) + flags |= wxHD_ALLOW_HIDE; + if ( m_chkBitmapOnRight->IsChecked() ) + flags |= wxHD_BITMAP_ON_RIGHT; + + return flags; +} + +// ---------------------------------------------------------------------------- +// event handlers +// ---------------------------------------------------------------------------- + +void HeaderCtrlWidgetsPage::OnStyleCheckBox(wxCommandEvent& WXUNUSED(evt)) +{ + RecreateWidget(); +} + +void HeaderCtrlWidgetsPage::OnResetButton(wxCommandEvent& WXUNUSED(evt)) +{ + Reset(); + RecreateWidget(); +} + +void HeaderCtrlWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& evt) +{ + evt.Enable(GetStyleFlags() != wxHD_DEFAULT_STYLE); +} + #endif // wxUSE_HEADERCTRL From 715b25aaf372aa57885b9cf502cf860b4c35b60a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 17 Jan 2019 22:16:01 +0100 Subject: [PATCH 266/553] Allow columns reordering only if wxHD_ALLOW_REORDER style is set Dragging the column should be allowed only if wxHD_ALLOW_REORDER style is set. Closes #18329. --- src/generic/headerctrlg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/headerctrlg.cpp b/src/generic/headerctrlg.cpp index d3fa849ad4..7af227fdbd 100644 --- a/src/generic/headerctrlg.cpp +++ b/src/generic/headerctrlg.cpp @@ -686,7 +686,7 @@ void wxHeaderCtrl::OnMouse(wxMouseEvent& mevent) wxASSERT_MSG( !IsResizing(), "reentering column resize mode?" ); StartOrContinueResizing(col, xPhysical); } - else // on column itself + else if ( HasFlag(wxHD_ALLOW_REORDER) ) // on column itself { // start dragging the column wxASSERT_MSG( !IsReordering(), "reentering column move mode?" ); From 4fce66a4831242ca49c3dcf15566cf470c2ccb4c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 18 Jan 2019 05:26:22 +0100 Subject: [PATCH 267/553] Don't document wxShowEvent as being for MSW and GTK only It is also generated by at least wxMac and wxQt. --- interface/wx/event.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/interface/wx/event.h b/interface/wx/event.h index 105c95d4a3..7871e910d5 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -4445,8 +4445,6 @@ public: Notice that the event is not triggered when the application is iconized (minimized) or restored under wxMSW. - @onlyfor{wxmsw,wxgtk} - @beginEventTable{wxShowEvent} @event{EVT_SHOW(func)} Process a @c wxEVT_SHOW event. From ccfec32eb9e8fe985f8d324467d505c9037690e8 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Fri, 18 Jan 2019 11:00:55 +0000 Subject: [PATCH 268/553] In wxFrame::SetToolBar, only one style will now be applied to the QToolbar --- src/qt/frame.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index 42143793cf..986d5c3b09 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -120,10 +120,10 @@ void wxFrame::SetToolBar(wxToolBar *toolbar) int area = 0; if ( toolbar != NULL ) { - if (toolbar->HasFlag(wxTB_LEFT)) area |= Qt::LeftToolBarArea; - if (toolbar->HasFlag(wxTB_RIGHT)) area |= Qt::RightToolBarArea; - if (toolbar->HasFlag(wxTB_TOP)) area |= Qt::TopToolBarArea; - if (toolbar->HasFlag(wxTB_BOTTOM)) area |= Qt::BottomToolBarArea; + if (toolbar->HasFlag(wxTB_LEFT)) { area |= Qt::LeftToolBarArea; } + else if (toolbar->HasFlag(wxTB_RIGHT)) { area |= Qt::RightToolBarArea; } + else if (toolbar->HasFlag(wxTB_TOP)) { area |= Qt::TopToolBarArea; } + else if (toolbar->HasFlag(wxTB_BOTTOM)){ area |= Qt::BottomToolBarArea;} GetQMainWindow()->addToolBar((Qt::ToolBarArea)area, toolbar->GetQToolBar()); } From 7b5cd77299817d49da5e6d863777d79668fba03b Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Fri, 18 Jan 2019 11:09:18 +0000 Subject: [PATCH 269/553] Removing unnecessary forward declaration from toolbar.h --- include/wx/qt/toolbar.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/wx/qt/toolbar.h b/include/wx/qt/toolbar.h index 6e9822b7c1..c3978ce42c 100644 --- a/include/wx/qt/toolbar.h +++ b/include/wx/qt/toolbar.h @@ -5,13 +5,12 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -class QToolBar; #ifndef _WX_QT_TOOLBAR_H_ #define _WX_QT_TOOLBAR_H_ class QActionGroup; -class wxQtToolBar; +class QToolBar; class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase { From d9dd8b1f1a0b23b5caaff86fd2aea3c78046083f Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Fri, 18 Jan 2019 11:30:43 +0000 Subject: [PATCH 270/553] Grouped related headers together --- src/qt/toolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/toolbar.cpp b/src/qt/toolbar.cpp index dc307e086b..47bc23e968 100644 --- a/src/qt/toolbar.cpp +++ b/src/qt/toolbar.cpp @@ -16,6 +16,7 @@ #include #include +#include #ifndef WX_PRECOMP #include "wx/menu.h" @@ -25,7 +26,6 @@ #include "wx/qt/private/winevent.h" #include "wx/qt/private/converter.h" -#include class wxQtToolButton; class wxToolBarTool : public wxToolBarToolBase From 3cde8607ab384863d06bc7b12decb5f919b33cdc Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Fri, 18 Jan 2019 13:17:47 +0000 Subject: [PATCH 271/553] Adding wxOVERRIDE specifiers to menuitem methods --- include/wx/qt/menuitem.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/wx/qt/menuitem.h b/include/wx/qt/menuitem.h index 769f4a9e8e..31a9bf6ee5 100644 --- a/include/wx/qt/menuitem.h +++ b/include/wx/qt/menuitem.h @@ -26,14 +26,14 @@ public: wxItemKind kind = wxITEM_NORMAL, wxMenu *subMenu = NULL); - virtual void SetItemLabel(const wxString& str); - virtual void SetCheckable(bool checkable); + virtual void SetItemLabel(const wxString& str) wxOVERRIDE; + virtual void SetCheckable(bool checkable) wxOVERRIDE; - virtual void Enable(bool enable = true); - virtual bool IsEnabled() const; + virtual void Enable(bool enable = true) wxOVERRIDE; + virtual bool IsEnabled() const wxOVERRIDE; - virtual void Check(bool check = true); - virtual bool IsChecked() const; + virtual void Check(bool check = true) wxOVERRIDE; + virtual bool IsChecked() const wxOVERRIDE; virtual void SetBitmap(const wxBitmap& bitmap); virtual const wxBitmap& GetBitmap() const { return m_bitmap; }; From 139070b745750d1d0fa69a22c2a20e835e9aa51c Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Fri, 18 Jan 2019 13:19:08 +0000 Subject: [PATCH 272/553] Removing unnecessary forward declaration --- include/wx/qt/menuitem.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/wx/qt/menuitem.h b/include/wx/qt/menuitem.h index 31a9bf6ee5..c91a16a4e1 100644 --- a/include/wx/qt/menuitem.h +++ b/include/wx/qt/menuitem.h @@ -13,7 +13,6 @@ class QAction; -class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_CORE wxMenuItem : public wxMenuItemBase From 5044283b875c2e757362ce060334c939e212408f Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Fri, 18 Jan 2019 13:25:27 +0000 Subject: [PATCH 273/553] Adding wxOVERRIDE specifiers to wxMenu and wxMenuBar methods --- include/wx/qt/menu.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/wx/qt/menu.h b/include/wx/qt/menu.h index f6d52bb3e2..cd747f2461 100644 --- a/include/wx/qt/menu.h +++ b/include/wx/qt/menu.h @@ -20,9 +20,9 @@ public: virtual QMenu *GetHandle() const; protected: - virtual wxMenuItem *DoAppend(wxMenuItem *item); - virtual wxMenuItem *DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem *DoRemove(wxMenuItem *item); + virtual wxMenuItem *DoAppend(wxMenuItem *item) wxOVERRIDE; + virtual wxMenuItem *DoInsert(size_t pos, wxMenuItem *item) wxOVERRIDE; + virtual wxMenuItem *DoRemove(wxMenuItem *item) wxOVERRIDE; private: QMenu *m_qtMenu; @@ -39,21 +39,21 @@ public: wxMenuBar(long style); wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0); - virtual bool Append(wxMenu *menu, const wxString& title); - virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); - virtual wxMenu *Remove(size_t pos); + virtual bool Append(wxMenu *menu, const wxString& title) wxOVERRIDE; + virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title) wxOVERRIDE; + virtual wxMenu *Remove(size_t pos) wxOVERRIDE; - virtual void EnableTop(size_t pos, bool enable); + virtual void EnableTop(size_t pos, bool enable) wxOVERRIDE; virtual bool IsEnabledTop(size_t pos) const wxOVERRIDE; - virtual void SetMenuLabel(size_t pos, const wxString& label); - virtual wxString GetMenuLabel(size_t pos) const; + virtual void SetMenuLabel(size_t pos, const wxString& label) wxOVERRIDE; + virtual wxString GetMenuLabel(size_t pos) const wxOVERRIDE; QMenuBar *GetQMenuBar() const { return m_qtMenuBar; } - virtual QWidget *GetHandle() const; + virtual QWidget *GetHandle() const wxOVERRIDE; - virtual void Attach(wxFrame *frame); - virtual void Detach(); + virtual void Attach(wxFrame *frame) wxOVERRIDE; + virtual void Detach() wxOVERRIDE; private: QMenuBar *m_qtMenuBar; From 7a6200631a79cc0333000c1499ce6cef9cbe6de8 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 19 Jan 2019 22:06:17 +0100 Subject: [PATCH 274/553] Extend wxHeaderCtrl demonstration in widgets sample Added ability to show header columns with various style flags. --- samples/widgets/headerctrl.cpp | 157 ++++++++++++++++++++++++++++----- 1 file changed, 133 insertions(+), 24 deletions(-) diff --git a/samples/widgets/headerctrl.cpp b/samples/widgets/headerctrl.cpp index efa883f7ff..9c8b360130 100644 --- a/samples/widgets/headerctrl.cpp +++ b/samples/widgets/headerctrl.cpp @@ -27,8 +27,10 @@ // for all others, include the necessary headers #ifndef WX_PRECOMP + #include "wx/artprov.h" #include "wx/button.h" #include "wx/checkbox.h" + #include "wx/radiobox.h" #include "wx/sizer.h" #include "wx/statbox.h" #include "wx/stattext.h" @@ -62,22 +64,38 @@ public: protected: // event handlers - void OnStyleCheckBox(wxCommandEvent& evt); + void OnStyleCheckOrRadioBox(wxCommandEvent& evt); void OnResetButton(wxCommandEvent& evt); void OnUpdateUIResetButton(wxUpdateUIEvent& evt); - // reset the header styles - void Reset(); - // compose style flags based on selected styles - long GetStyleFlags() const; + // reset the header style + void ResetHeaderStyle(); + // compose header style flags based on selections + long GetHeaderStyleFlags() const; + // reset column style + void ResetColumnStyle(int col); + // compose columnm style flags based on selections + int GetColumnStyleFlags(int col) const; + // get columnm alignment flags based on selection + wxAlignment GetColumnAlignmentFlag(int col) const; // the control itself and the sizer it is in wxHeaderCtrlSimple *m_header; wxSizer *m_sizerHeader; - // the check boxes for styles + // the check boxes for header styles wxCheckBox *m_chkAllowReorder; wxCheckBox *m_chkAllowHide; wxCheckBox *m_chkBitmapOnRight; + // The check boxes for column styles + struct + { + wxCheckBox *chkAllowResize; + wxCheckBox *chkAllowReorder; + wxCheckBox *chkAllowSort; + wxCheckBox *chkAllowHide; + wxCheckBox *chkWithBitmap; + wxRadioBox *rbAlignments; + } m_colSettings[2]; private: DECLARE_WIDGETS_PAGE(HeaderCtrlWidgetsPage) @@ -96,24 +114,48 @@ private: IMPLEMENT_WIDGETS_PAGE(HeaderCtrlWidgetsPage, "Header", HEADER_CTRL_FAMILY); +static const wxString gs_colAlignments[] = { "none", "left", "centre", "right" }; +static const wxAlignment gs_colAlignFlags[] = { wxALIGN_NOT, wxALIGN_LEFT, wxALIGN_CENTRE, wxALIGN_RIGHT }; +#define COL_WITH_BITMAP_DEFAULT false +#define COL_ALIGNMENT_FLAG_DEFAULT wxALIGN_NOT +#define COL_ALIGNMENT_INDEX_DEFAULT 0 + void HeaderCtrlWidgetsPage::CreateContent() { // left pane - wxStaticBox* box = new wxStaticBox(this, wxID_ANY, "&Set style"); - wxSizer* sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); + wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); - m_chkAllowReorder = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow &reorder"); - m_chkAllowHide = CreateCheckBoxAndAddToSizer(sizerLeft, "Alow &hide"); - m_chkBitmapOnRight = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap on right"); + // header style + wxSizer *sizerHeader = new wxStaticBoxSizer(wxVERTICAL, this, "&Header style"); + m_chkAllowReorder = CreateCheckBoxAndAddToSizer(sizerHeader, "Allow &reorder"); + m_chkAllowHide = CreateCheckBoxAndAddToSizer(sizerHeader, "Alow &hide"); + m_chkBitmapOnRight = CreateCheckBoxAndAddToSizer(sizerHeader, "&Bitmap on right"); + ResetHeaderStyle(); + sizerLeft->Add(sizerHeader, wxSizerFlags().Expand()); + + // column flags + for ( int i = 0; i < WXSIZEOF(m_colSettings); i++ ) + { + wxSizer* sizerCol = new wxStaticBoxSizer(wxVERTICAL, this, wxString::Format("Column %i style", i+1)); + m_colSettings[i].chkAllowResize = CreateCheckBoxAndAddToSizer(sizerCol, "Allow resize"); + m_colSettings[i].chkAllowReorder = CreateCheckBoxAndAddToSizer(sizerCol, "Allow reorder"); + m_colSettings[i].chkAllowSort = CreateCheckBoxAndAddToSizer(sizerCol, "Allow sort"); + m_colSettings[i].chkAllowHide = CreateCheckBoxAndAddToSizer(sizerCol, "Hidden"); + m_colSettings[i].chkWithBitmap = CreateCheckBoxAndAddToSizer(sizerCol, "With bitmap"); + m_colSettings[i].rbAlignments = new wxRadioBox(this, wxID_ANY, "Alignment", + wxDefaultPosition, wxDefaultSize, WXSIZEOF(gs_colAlignments), gs_colAlignments, + 2, wxRA_SPECIFY_COLS); + sizerCol->Add(m_colSettings[i].rbAlignments, wxSizerFlags().Expand().Border(wxALL, 5)); + ResetColumnStyle(i); + sizerLeft->Add(sizerCol, wxSizerFlags().Expand().Border(wxTOP, 15)); + } sizerLeft->Add(5, 5, wxSizerFlags().Expand().Border(wxALL, 5)); // spacer - wxButton* btnReset = new wxButton(this, wxID_ANY, "&Reset"); sizerLeft->Add(btnReset, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // right pane m_sizerHeader = new wxStaticBoxSizer(wxVERTICAL, this, "Header"); - Reset(); RecreateWidget(); // the 2 panes compose the window @@ -124,9 +166,18 @@ void HeaderCtrlWidgetsPage::CreateContent() SetSizer(sizerTop); // Bind event handlers - m_chkAllowReorder->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckBox, this); - m_chkAllowHide->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckBox, this); - m_chkBitmapOnRight->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckBox, this); + m_chkAllowReorder->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + m_chkAllowHide->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + m_chkBitmapOnRight->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + for ( int i = 0; i < WXSIZEOF(m_colSettings); i++ ) + { + m_colSettings[i].chkAllowResize->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + m_colSettings[i].chkAllowReorder->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + m_colSettings[i].chkAllowSort->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + m_colSettings[i].chkAllowHide->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + m_colSettings[i].chkWithBitmap->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + m_colSettings[i].rbAlignments->Bind(wxEVT_RADIOBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); + } btnReset->Bind(wxEVT_BUTTON, &HeaderCtrlWidgetsPage::OnResetButton, this); btnReset->Bind(wxEVT_UPDATE_UI, &HeaderCtrlWidgetsPage::OnUpdateUIResetButton, this); } @@ -135,13 +186,24 @@ void HeaderCtrlWidgetsPage::RecreateWidget() { m_sizerHeader->Clear(true /* delete windows */); - long flags = GetAttrs().m_defaultFlags | GetStyleFlags(); + long flags = GetAttrs().m_defaultFlags | GetHeaderStyleFlags(); m_header = new wxHeaderCtrlSimple(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, flags); - m_header->AppendColumn(wxHeaderColumnSimple("First", 100)); - m_header->AppendColumn(wxHeaderColumnSimple("Second", 200)); + wxASSERT(WXSIZEOF(m_colSettings) == 2); + wxHeaderColumnSimple col1("First", 100, GetColumnAlignmentFlag(0), GetColumnStyleFlags(0)); + if ( m_colSettings[0].chkWithBitmap->IsChecked() ) + { + col1.SetBitmap(wxArtProvider::GetIcon(wxART_ERROR, wxART_BUTTON)); + } + m_header->AppendColumn(col1); + wxHeaderColumnSimple col2("Second", 200, GetColumnAlignmentFlag(1), GetColumnStyleFlags(1)); + if ( m_colSettings[1].chkWithBitmap->IsChecked() ) + { + col2.SetBitmap(wxArtProvider::GetIcon(wxART_QUESTION, wxART_BUTTON)); + } + m_header->AppendColumn(col2); m_sizerHeader->AddStretchSpacer(); m_sizerHeader->Add(m_header, wxSizerFlags().Expand()); @@ -149,14 +211,14 @@ void HeaderCtrlWidgetsPage::RecreateWidget() m_sizerHeader->Layout(); } -void HeaderCtrlWidgetsPage::Reset() +void HeaderCtrlWidgetsPage::ResetHeaderStyle() { m_chkAllowReorder->SetValue((wxHD_DEFAULT_STYLE & wxHD_ALLOW_REORDER) != 0); m_chkAllowHide->SetValue((wxHD_DEFAULT_STYLE & wxHD_ALLOW_HIDE) != 0); m_chkBitmapOnRight->SetValue((wxHD_DEFAULT_STYLE & wxHD_BITMAP_ON_RIGHT) != 0); } -long HeaderCtrlWidgetsPage::GetStyleFlags() const +long HeaderCtrlWidgetsPage::GetHeaderStyleFlags() const { long flags = 0; @@ -170,24 +232,71 @@ long HeaderCtrlWidgetsPage::GetStyleFlags() const return flags; } +void HeaderCtrlWidgetsPage::ResetColumnStyle(int col) +{ + wxASSERT(col < WXSIZEOF(m_colSettings)); + m_colSettings[col].chkAllowResize->SetValue((wxCOL_DEFAULT_FLAGS & wxCOL_RESIZABLE) != 0); + m_colSettings[col].chkAllowReorder->SetValue((wxCOL_DEFAULT_FLAGS & wxCOL_REORDERABLE) != 0); + m_colSettings[col].chkAllowSort->SetValue((wxCOL_DEFAULT_FLAGS & wxCOL_SORTABLE) != 0); + m_colSettings[col].chkAllowHide->SetValue((wxCOL_DEFAULT_FLAGS & wxCOL_HIDDEN) != 0); + m_colSettings[col].chkWithBitmap->SetValue(COL_WITH_BITMAP_DEFAULT); + m_colSettings[col].rbAlignments->SetSelection(COL_ALIGNMENT_INDEX_DEFAULT); +} + +int HeaderCtrlWidgetsPage::GetColumnStyleFlags(int col) const +{ + wxASSERT(col < WXSIZEOF(m_colSettings)); + int flags = 0; + + if ( m_colSettings[col].chkAllowResize->IsChecked() ) + flags |= wxCOL_RESIZABLE; + if ( m_colSettings[col].chkAllowReorder->IsChecked() ) + flags |= wxCOL_REORDERABLE; + if ( m_colSettings[col].chkAllowSort->IsChecked() ) + flags |= wxCOL_SORTABLE; + if ( m_colSettings[col].chkAllowHide->IsChecked() ) + flags |= wxCOL_HIDDEN; + + return flags; +} + +wxAlignment HeaderCtrlWidgetsPage::GetColumnAlignmentFlag(int col) const +{ + wxASSERT(col < WXSIZEOF(m_colSettings)); + wxASSERT(WXSIZEOF(gs_colAlignments) == WXSIZEOF(gs_colAlignFlags)); + int sel = m_colSettings[col].rbAlignments->GetSelection(); + return sel == wxNOT_FOUND ? COL_ALIGNMENT_FLAG_DEFAULT : gs_colAlignFlags[sel]; +} + // ---------------------------------------------------------------------------- // event handlers // ---------------------------------------------------------------------------- -void HeaderCtrlWidgetsPage::OnStyleCheckBox(wxCommandEvent& WXUNUSED(evt)) +void HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox(wxCommandEvent& WXUNUSED(evt)) { RecreateWidget(); } void HeaderCtrlWidgetsPage::OnResetButton(wxCommandEvent& WXUNUSED(evt)) { - Reset(); + ResetHeaderStyle(); + for ( int i = 0; i < WXSIZEOF(m_colSettings); i++ ) + { + ResetColumnStyle(i); + } RecreateWidget(); } void HeaderCtrlWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& evt) { - evt.Enable(GetStyleFlags() != wxHD_DEFAULT_STYLE); + bool enable = GetHeaderStyleFlags() != wxHD_DEFAULT_STYLE; + for ( int i = 0; !enable && i < WXSIZEOF(m_colSettings); i++ ) + { + enable = enable || GetColumnStyleFlags(i) != wxCOL_DEFAULT_FLAGS + || m_colSettings[i].chkWithBitmap->IsChecked() != COL_WITH_BITMAP_DEFAULT + || m_colSettings[i].rbAlignments->GetSelection() != COL_ALIGNMENT_INDEX_DEFAULT; + } + evt.Enable(enable); } #endif // wxUSE_HEADERCTRL From 4fabf5238f5c5c7fd15fadf7cda0ee13e38cc5dd Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 19 Jan 2019 22:51:44 +0100 Subject: [PATCH 275/553] Fix harmless signed/unsigned comparison warning in widgets sample Cast WXSIZEOF to int before comparing it with int variables. --- samples/widgets/headerctrl.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/widgets/headerctrl.cpp b/samples/widgets/headerctrl.cpp index 9c8b360130..aab578601b 100644 --- a/samples/widgets/headerctrl.cpp +++ b/samples/widgets/headerctrl.cpp @@ -134,7 +134,7 @@ void HeaderCtrlWidgetsPage::CreateContent() sizerLeft->Add(sizerHeader, wxSizerFlags().Expand()); // column flags - for ( int i = 0; i < WXSIZEOF(m_colSettings); i++ ) + for ( int i = 0; i < (int)WXSIZEOF(m_colSettings); i++ ) { wxSizer* sizerCol = new wxStaticBoxSizer(wxVERTICAL, this, wxString::Format("Column %i style", i+1)); m_colSettings[i].chkAllowResize = CreateCheckBoxAndAddToSizer(sizerCol, "Allow resize"); @@ -169,7 +169,7 @@ void HeaderCtrlWidgetsPage::CreateContent() m_chkAllowReorder->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); m_chkAllowHide->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); m_chkBitmapOnRight->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); - for ( int i = 0; i < WXSIZEOF(m_colSettings); i++ ) + for ( int i = 0; i < (int)WXSIZEOF(m_colSettings); i++ ) { m_colSettings[i].chkAllowResize->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); m_colSettings[i].chkAllowReorder->Bind(wxEVT_CHECKBOX, &HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox, this); @@ -234,7 +234,7 @@ long HeaderCtrlWidgetsPage::GetHeaderStyleFlags() const void HeaderCtrlWidgetsPage::ResetColumnStyle(int col) { - wxASSERT(col < WXSIZEOF(m_colSettings)); + wxASSERT(col < (int)WXSIZEOF(m_colSettings)); m_colSettings[col].chkAllowResize->SetValue((wxCOL_DEFAULT_FLAGS & wxCOL_RESIZABLE) != 0); m_colSettings[col].chkAllowReorder->SetValue((wxCOL_DEFAULT_FLAGS & wxCOL_REORDERABLE) != 0); m_colSettings[col].chkAllowSort->SetValue((wxCOL_DEFAULT_FLAGS & wxCOL_SORTABLE) != 0); @@ -245,7 +245,7 @@ void HeaderCtrlWidgetsPage::ResetColumnStyle(int col) int HeaderCtrlWidgetsPage::GetColumnStyleFlags(int col) const { - wxASSERT(col < WXSIZEOF(m_colSettings)); + wxASSERT(col < (int)WXSIZEOF(m_colSettings)); int flags = 0; if ( m_colSettings[col].chkAllowResize->IsChecked() ) @@ -262,7 +262,7 @@ int HeaderCtrlWidgetsPage::GetColumnStyleFlags(int col) const wxAlignment HeaderCtrlWidgetsPage::GetColumnAlignmentFlag(int col) const { - wxASSERT(col < WXSIZEOF(m_colSettings)); + wxASSERT(col < (int)WXSIZEOF(m_colSettings)); wxASSERT(WXSIZEOF(gs_colAlignments) == WXSIZEOF(gs_colAlignFlags)); int sel = m_colSettings[col].rbAlignments->GetSelection(); return sel == wxNOT_FOUND ? COL_ALIGNMENT_FLAG_DEFAULT : gs_colAlignFlags[sel]; @@ -280,7 +280,7 @@ void HeaderCtrlWidgetsPage::OnStyleCheckOrRadioBox(wxCommandEvent& WXUNUSED(evt) void HeaderCtrlWidgetsPage::OnResetButton(wxCommandEvent& WXUNUSED(evt)) { ResetHeaderStyle(); - for ( int i = 0; i < WXSIZEOF(m_colSettings); i++ ) + for ( int i = 0; i < (int)WXSIZEOF(m_colSettings); i++ ) { ResetColumnStyle(i); } @@ -290,7 +290,7 @@ void HeaderCtrlWidgetsPage::OnResetButton(wxCommandEvent& WXUNUSED(evt)) void HeaderCtrlWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& evt) { bool enable = GetHeaderStyleFlags() != wxHD_DEFAULT_STYLE; - for ( int i = 0; !enable && i < WXSIZEOF(m_colSettings); i++ ) + for ( int i = 0; !enable && i < (int)WXSIZEOF(m_colSettings); i++ ) { enable = enable || GetColumnStyleFlags(i) != wxCOL_DEFAULT_FLAGS || m_colSettings[i].chkWithBitmap->IsChecked() != COL_WITH_BITMAP_DEFAULT From 2a452c0b601095efc6cee69de5cf19df9a5964e3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Jan 2019 23:02:09 +0100 Subject: [PATCH 276/553] Fix widgets sample build when using precompiled headers wx/artprov.h is not included from wx/wx.h, so it needs to be always included from this header and not only when !WX_PRECOMP. --- samples/widgets/headerctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/widgets/headerctrl.cpp b/samples/widgets/headerctrl.cpp index aab578601b..8b66b3dc36 100644 --- a/samples/widgets/headerctrl.cpp +++ b/samples/widgets/headerctrl.cpp @@ -27,7 +27,6 @@ // for all others, include the necessary headers #ifndef WX_PRECOMP - #include "wx/artprov.h" #include "wx/button.h" #include "wx/checkbox.h" #include "wx/radiobox.h" @@ -38,6 +37,8 @@ #include "wx/headerctrl.h" +#include "wx/artprov.h" + #include "widgets.h" #include "icons/header.xpm" From 57c12db2d91e4c62e550f6d8ea23d4a56c383790 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 18 Jan 2019 11:43:33 +0000 Subject: [PATCH 277/553] Fix GetColumnCount() not working for wxRadioBox in wxQt Add missing SetMajorDim() call to wxRadioBox::Create(). Closes https://github.com/wxWidgets/wxWidgets/pull/1144 --- src/qt/radiobox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index b73a881a78..351251fb78 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -188,6 +188,7 @@ bool wxRadioBox::Create(wxWindow *parent, m_qtGroupBox->setLayout(horzLayout); + SetMajorDim(majorDim == 0 ? n : majorDim, style); return QtCreateControl( parent, id, pos, size, style, val, name ); } From 557b8526d166f7785d71939bde03f346f467d430 Mon Sep 17 00:00:00 2001 From: "Konstantin S. Matveyev" Date: Sat, 19 Jan 2019 18:06:08 +0300 Subject: [PATCH 278/553] Fix several problems with wxAppProgressIndicator in wxOSX Don't release NSProgressIndicator too soon, we need to be able to keep it to use it later, so move "release" from wxAppProgressDockIcon ctor to its dtor. OTOH, remove an extraneous "retain" to fix memory leak of wxAppProgressDockIcon. Finally, show the indicator, if it had been hidden, when Pulse() is called for consistency with SetProgress(). Closes https://github.com/wxWidgets/wxWidgets/pull/1150 --- src/osx/cocoa/appprogress.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/osx/cocoa/appprogress.mm b/src/osx/cocoa/appprogress.mm index 892bb89ef5..350190e136 100644 --- a/src/osx/cocoa/appprogress.mm +++ b/src/osx/cocoa/appprogress.mm @@ -42,15 +42,21 @@ [m_progIndicator setBezeled:YES]; [m_progIndicator setMinValue:0]; [m_progIndicator setMaxValue:1]; - [m_progIndicator release]; [self setProgress:0.0]; } return self; } +- (void)dealloc +{ + [m_progIndicator release]; + [super dealloc]; +} + - (void)setProgress: (double)value { [m_progIndicator setHidden:NO]; + [m_progIndicator setIndeterminate:NO]; [m_progIndicator setDoubleValue:value]; [m_dockTile display]; @@ -58,6 +64,7 @@ - (void)setIndeterminate: (bool)indeterminate { + [m_progIndicator setHidden:NO]; [m_progIndicator setIndeterminate:indeterminate]; [m_dockTile display]; @@ -75,7 +82,7 @@ wxAppProgressIndicator::wxAppProgressIndicator(wxWindow* WXUNUSED(parent), int maxValue ): m_maxValue(maxValue) { - wxAppProgressDockIcon* dockIcon = [[[wxAppProgressDockIcon alloc] init] retain]; + wxAppProgressDockIcon* dockIcon = [[wxAppProgressDockIcon alloc] init]; m_dockIcon = dockIcon; } From 30f9d60eeccc24199485cfd5caefdc9beb21baa9 Mon Sep 17 00:00:00 2001 From: jtbattle Date: Sat, 19 Jan 2019 01:59:47 -0600 Subject: [PATCH 279/553] Fix ability to replay wxSound sample on OSX The sound handle was returned to the OS after the first play completed (or the loop first stopped), making it impossible to replay that sound again. Now the handle is returned upon destruction of the wxSound object. Closes https://github.com/wxWidgets/wxWidgets/pull/1149 --- src/osx/core/sound.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osx/core/sound.cpp b/src/osx/core/sound.cpp index 1c5ec6e2dc..e81a4d7826 100644 --- a/src/osx/core/sound.cpp +++ b/src/osx/core/sound.cpp @@ -58,6 +58,7 @@ wxOSXAudioToolboxSoundData::wxOSXAudioToolboxSoundData(SystemSoundID soundID) : wxOSXAudioToolboxSoundData::~wxOSXAudioToolboxSoundData() { DoStop(); + AudioServicesDisposeSystemSoundID (m_soundID); } void @@ -95,8 +96,6 @@ void wxOSXAudioToolboxSoundData::DoStop() { m_playing = false; AudioServicesRemoveSystemSoundCompletion(m_soundID); - AudioServicesDisposeSystemSoundID (m_soundID); - wxSound::SoundStopped(this); } } From f20180e74313bbb9f18bea594125221bba13aba2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jan 2019 02:57:45 +0100 Subject: [PATCH 280/553] Avoid -Wswitch gcc warning in wxQt wxNativeFontInfo::SetStyle() Explicitly handle wxFONTSTYLE_MAX, even if it's just to assert that it's unexpected here. --- src/qt/font.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/qt/font.cpp b/src/qt/font.cpp index 6600d8a90c..f9e5b1fd9b 100644 --- a/src/qt/font.cpp +++ b/src/qt/font.cpp @@ -513,18 +513,28 @@ void wxNativeFontInfo::SetPixelSize(const wxSize& size) void wxNativeFontInfo::SetStyle(wxFontStyle style) { - switch(style) + QFont::Style qtStyle; + + switch ( style ) { case wxFONTSTYLE_ITALIC: - m_qtFont.setStyle(QFont::StyleItalic); + qtStyle = QFont::StyleItalic; break; + case wxFONTSTYLE_NORMAL: - m_qtFont.setStyle(QFont::StyleNormal); + qtStyle = QFont::StyleNormal; break; + case wxFONTSTYLE_SLANT: - m_qtFont.setStyle(QFont::StyleOblique); + qtStyle = QFont::StyleOblique; break; + + case wxFONTSTYLE_MAX: + wxFAIL_MSG("unknown font style"); + return; } + + m_qtFont.setStyle(qtStyle); } void wxNativeFontInfo::SetNumericWeight(int weight) From 5bb683bcfef5a1ba8ff1c70f390b60d7f06df877 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jan 2019 02:59:46 +0100 Subject: [PATCH 281/553] Fix harmless -Wunused-parameter warnings in wxQt code Note that other such warnings remain where they indicate important missing functionality (notably in wxCairoContext ctor from wxPrinterDC). --- src/qt/nonownedwnd.cpp | 2 +- src/qt/window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/nonownedwnd.cpp b/src/qt/nonownedwnd.cpp index dfb48fbb6f..972c224a2f 100644 --- a/src/qt/nonownedwnd.cpp +++ b/src/qt/nonownedwnd.cpp @@ -60,7 +60,7 @@ bool wxNonOwnedWindow::DoSetRegionShape(const wxRegion& region) } #if wxUSE_GRAPHICS_CONTEXT -bool wxNonOwnedWindow::DoSetPathShape(const wxGraphicsPath& path) +bool wxNonOwnedWindow::DoSetPathShape(const wxGraphicsPath& WXUNUSED(path)) { wxMISSING_IMPLEMENTATION( __FUNCTION__ ); return true; diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 1732de3863..7b99923708 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -610,7 +610,7 @@ QScrollBar *wxWindowQt::QtSetScrollBar( int orientation, QScrollBar *scrollBar ) } -void wxWindowQt::SetScrollbar( int orientation, int pos, int thumbvisible, int range, bool refresh ) +void wxWindowQt::SetScrollbar( int orientation, int pos, int thumbvisible, int range, bool WXUNUSED(refresh) ) { //If not exist, create the scrollbar QScrollBar *scrollBar = QtGetScrollBar( orientation ); From 5b36917548c3c8dab5c1f1dfd94f1aa5f1f4a218 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jan 2019 03:01:51 +0100 Subject: [PATCH 282/553] Fix harmless -Wsign-compare gcc warnings in wxQt wxStatusBar code QList::count() returns int, so cast it to size_t explicitly before comparing with wxArray::GetCount() which returns size_t. --- src/qt/statusbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/statusbar.cpp b/src/qt/statusbar.cpp index 8224c80928..28ae203ec6 100644 --- a/src/qt/statusbar.cpp +++ b/src/qt/statusbar.cpp @@ -65,7 +65,7 @@ bool wxStatusBar::GetFieldRect(int i, wxRect& rect) const wxCHECK_MSG( (i >= 0) && ((size_t)i < m_panes.GetCount()), false, "invalid statusbar field index" ); - if ( m_qtPanes->count() != m_panes.GetCount() ) + if ( static_cast(m_qtPanes->count()) != m_panes.GetCount() ) const_cast(this)->UpdateFields(); rect = wxQtConvertRect((*m_qtPanes)[i]->geometry()); @@ -89,7 +89,7 @@ int wxStatusBar::GetBorderY() const void wxStatusBar::DoUpdateStatusText(int number) { - if ( m_qtPanes->count() != m_panes.GetCount() ) + if ( static_cast(m_qtPanes->count()) != m_panes.GetCount() ) UpdateFields(); (*m_qtPanes)[number]->setText( wxQtConvertString( m_panes[number].GetText() ) ); From 61b391da9039fdcee5f5bba0031674a1dca72ab0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jan 2019 03:13:04 +0100 Subject: [PATCH 283/553] Make wxFrame ctors inline in wxQt No real changes, just make trivial (and going to remain trivial) functions inline. --- include/wx/qt/frame.h | 7 +++++-- src/qt/frame.cpp | 10 ---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/include/wx/qt/frame.h b/include/wx/qt/frame.h index 35a7f39aaa..a0172b62c7 100644 --- a/include/wx/qt/frame.h +++ b/include/wx/qt/frame.h @@ -19,14 +19,17 @@ class QScrollArea; class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase { public: - wxFrame(); + wxFrame() { } wxFrame(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); + const wxString& name = wxFrameNameStr) + { + Create( parent, id, title, pos, size, style, name ); + } virtual ~wxFrame(); bool Create(wxWindow *parent, diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index 986d5c3b09..ea29f93145 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -44,16 +44,6 @@ class wxQtCentralWidget : public wxQtEventSignalHandler< QScrollArea, wxFrame > }; -wxFrame::wxFrame() -{ -} - -wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, long style, const wxString& name ) -{ - Create( parent, id, title, pos, size, style, name ); -} - wxFrame::~wxFrame() { // central widget should be deleted by qt when the main window is destroyed From 3fb84dfc0cac56d184a894e9ec819d91e4319605 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jan 2019 03:19:32 +0100 Subject: [PATCH 284/553] Make wxToolBar::GetQToolBar() non-virtual and mark it as private This method has no reason to be virtual. Also move it to the end of the class public section and document that it's not part of the public API. See https://github.com/wxWidgets/wxWidgets/pull/1140 --- include/wx/qt/toolbar.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/wx/qt/toolbar.h b/include/wx/qt/toolbar.h index c3978ce42c..6b3c38e42a 100644 --- a/include/wx/qt/toolbar.h +++ b/include/wx/qt/toolbar.h @@ -39,7 +39,6 @@ public: const wxString& name = wxToolBarNameStr); virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE; - virtual QToolBar *GetQToolBar() const { return m_qtToolBar; } virtual void SetWindowStyleFlag( long style ) wxOVERRIDE; @@ -62,6 +61,9 @@ public: const wxString& label) wxOVERRIDE; QWidget *GetHandle() const wxOVERRIDE; + // Private, only used by wxFrame. + QToolBar *GetQToolBar() const { return m_qtToolBar; } + protected: QActionGroup* GetActionGroup(size_t pos); virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE; From 704f03e70e9f1a503d020dc10c8a108a756b5472 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jan 2019 03:16:38 +0100 Subject: [PATCH 285/553] Don't use destroyed wxToolBar in wxFrame::SetToolBar() in wxQt Store QToolBar pointer in wxFrame itself to avoid having to query the already half-destroyed wxToolBar object when SetToolBar() is called from its base class dtor. This fixes crash when toggling the toolbar in the toolbar sample. Closes https://github.com/wxWidgets/wxWidgets/pull/1140 --- include/wx/qt/frame.h | 13 ++++++++++++- src/qt/frame.cpp | 10 ++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/include/wx/qt/frame.h b/include/wx/qt/frame.h index a0172b62c7..4a603be45c 100644 --- a/include/wx/qt/frame.h +++ b/include/wx/qt/frame.h @@ -19,7 +19,7 @@ class QScrollArea; class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase { public: - wxFrame() { } + wxFrame() { Init(); } wxFrame(wxWindow *parent, wxWindowID id, const wxString& title, @@ -28,6 +28,8 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { + Init(); + Create( parent, id, title, pos, size, style, name ); } virtual ~wxFrame(); @@ -56,6 +58,15 @@ protected: virtual void DoGetClientSize(int *width, int *height) const; private: + // Common part of all ctors. + void Init() + { + m_qtToolBar = NULL; + } + + + // Currently active native toolbar. + class QToolBar* m_qtToolBar; wxDECLARE_DYNAMIC_CLASS( wxFrame ); }; diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index ea29f93145..ec88780779 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -115,11 +115,17 @@ void wxFrame::SetToolBar(wxToolBar *toolbar) else if (toolbar->HasFlag(wxTB_TOP)) { area |= Qt::TopToolBarArea; } else if (toolbar->HasFlag(wxTB_BOTTOM)){ area |= Qt::BottomToolBarArea;} - GetQMainWindow()->addToolBar((Qt::ToolBarArea)area, toolbar->GetQToolBar()); + // We keep the current toolbar handle in our own member variable + // because we can't get it from half-destroyed wxToolBar when it calls + // this function from wxToolBarBase dtor. + m_qtToolBar = toolbar->GetQToolBar(); + + GetQMainWindow()->addToolBar((Qt::ToolBarArea)area, m_qtToolBar); } else if ( m_frameToolBar != NULL ) { - GetQMainWindow()->removeToolBar(m_frameToolBar->GetQToolBar()); + GetQMainWindow()->removeToolBar(m_qtToolBar); + m_qtToolBar = NULL; } wxFrameBase::SetToolBar( toolbar ); } From 3000091cd226bcc54ef79274f56d5e162e7a1369 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 11:13:49 +0100 Subject: [PATCH 286/553] Allow columns reordering only if its wxCOL_REORDERABLE flag is set Dragging the column should be allowed only if wxHD_ALLOW_REORDER header style and wxCOL_REORDERABLE column flag are both set. Closes #18332. --- src/generic/headerctrlg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/headerctrlg.cpp b/src/generic/headerctrlg.cpp index 7af227fdbd..4529a849c3 100644 --- a/src/generic/headerctrlg.cpp +++ b/src/generic/headerctrlg.cpp @@ -686,8 +686,11 @@ void wxHeaderCtrl::OnMouse(wxMouseEvent& mevent) wxASSERT_MSG( !IsResizing(), "reentering column resize mode?" ); StartOrContinueResizing(col, xPhysical); } - else if ( HasFlag(wxHD_ALLOW_REORDER) ) // on column itself + // on column itself - both header and column must have the appropriate + // flags to allow dragging the column + else if ( HasFlag(wxHD_ALLOW_REORDER) && GetColumn(col).IsReorderable() ) { + // start dragging the column wxASSERT_MSG( !IsReordering(), "reentering column move mode?" ); From 9ff94422269f01ba9fc2752bb549ee148325c3e4 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 13:07:48 +0100 Subject: [PATCH 287/553] Update column width in wxHeaderCtrlSimple while resizing the column In EVT_HEADER_RESIZING event handler there is necessary to update actual column width and redraw the control to show the column with new width. Closes #18331. --- include/wx/headerctrl.h | 3 +++ src/common/headerctrlcmn.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/wx/headerctrl.h b/include/wx/headerctrl.h index f491fcbc7a..f2270bf78e 100644 --- a/include/wx/headerctrl.h +++ b/include/wx/headerctrl.h @@ -345,6 +345,8 @@ protected: return -1; } + void OnHeaderResizing(wxHeaderCtrlEvent& evt); + private: // functions implementing our public API void DoInsert(const wxHeaderColumnSimple& col, unsigned int idx); @@ -371,6 +373,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxHeaderCtrlSimple); + wxDECLARE_EVENT_TABLE(); }; // ---------------------------------------------------------------------------- diff --git a/src/common/headerctrlcmn.cpp b/src/common/headerctrlcmn.cpp index 54bb90119e..2f5eeff7a7 100644 --- a/src/common/headerctrlcmn.cpp +++ b/src/common/headerctrlcmn.cpp @@ -386,6 +386,10 @@ bool wxHeaderCtrlBase::ShowCustomizeDialog() // wxHeaderCtrlSimple implementation // ============================================================================ +wxBEGIN_EVENT_TABLE(wxHeaderCtrlSimple, wxHeaderCtrl) + EVT_HEADER_RESIZING(wxID_ANY, wxHeaderCtrlSimple::OnHeaderResizing) +wxEND_EVENT_TABLE() + void wxHeaderCtrlSimple::Init() { m_sortKey = wxNO_COLUMN; @@ -466,6 +470,12 @@ wxHeaderCtrlSimple::UpdateColumnWidthToFit(unsigned int idx, int widthTitle) return true; } +void wxHeaderCtrlSimple::OnHeaderResizing(wxHeaderCtrlEvent& evt) +{ + m_cols[evt.GetColumn()].SetWidth(evt.GetWidth()); + Refresh(); +} + // ============================================================================ // wxHeaderCtrlEvent implementation // ============================================================================ From 5261605a613a266740cedf557e49063764631419 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 13:18:35 +0100 Subject: [PATCH 288/553] Use wxSizerFlags-based API in widgets sample Make the code more clear by using wxSizerFlags. --- samples/widgets/headerctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/widgets/headerctrl.cpp b/samples/widgets/headerctrl.cpp index 8b66b3dc36..db8126ca91 100644 --- a/samples/widgets/headerctrl.cpp +++ b/samples/widgets/headerctrl.cpp @@ -153,7 +153,7 @@ void HeaderCtrlWidgetsPage::CreateContent() sizerLeft->Add(5, 5, wxSizerFlags().Expand().Border(wxALL, 5)); // spacer wxButton* btnReset = new wxButton(this, wxID_ANY, "&Reset"); - sizerLeft->Add(btnReset, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); + sizerLeft->Add(btnReset, wxSizerFlags().CenterHorizontal().Border(wxALL, 15)); // right pane m_sizerHeader = new wxStaticBoxSizer(wxVERTICAL, this, "Header"); From 4c9684f8d11261acd7a39c3a87edb1e13bcb8a5e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 18:21:29 +0100 Subject: [PATCH 289/553] Improve calculating wxSimpleCheckBox rectangle The code to calculate rectangle occupied by the check box is moved to the shared function GetBoxRect(). Check box rectangle is stored in the data member and this cached position and size are used in the drawing operations and hit tests. --- src/propgrid/editors.cpp | 65 +++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index c2c3349096..f4a954495a 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1424,13 +1424,9 @@ enum const int wxSCB_SETVALUE_CYCLE = 2; -static void DrawSimpleCheckBox( wxWindow* win, wxDC& dc, const wxRect& rect, - int box_h, int state ) +static void DrawSimpleCheckBox(wxWindow* win, wxDC& dc, const wxRect& rect, int state) { #if wxPG_USE_RENDERER_NATIVE - // Box rectangle - wxRect r(rect.x+wxPG_XBEFORETEXT, rect.y+((rect.height-box_h)/2), - box_h, box_h); int cbFlags = 0; if ( state & wxSCB_STATE_UNSPECIFIED ) @@ -1454,13 +1450,10 @@ static void DrawSimpleCheckBox( wxWindow* win, wxDC& dc, const wxRect& rect, #endif } - wxRendererNative::Get().DrawCheckBox(win, dc, r, cbFlags); + wxRendererNative::Get().DrawCheckBox(win, dc, rect, cbFlags); #else wxUnusedVar(win); - // Box rectangle - wxRect r(rect.x+wxPG_XBEFORETEXT, rect.y+((rect.height-box_h)/2), - box_h, box_h); wxColour useCol = dc.GetTextForeground(); if ( state & wxSCB_STATE_UNSPECIFIED ) @@ -1468,6 +1461,7 @@ static void DrawSimpleCheckBox( wxWindow* win, wxDC& dc, const wxRect& rect, useCol = wxColour(220, 220, 220); } + wxRect r(rect); // Draw check mark first because it is likely to overdraw the // surrounding rectangle. if ( state & wxSCB_STATE_CHECKED ) @@ -1529,15 +1523,29 @@ public: SetFont( parent->GetFont() ); m_state = 0; - m_boxHeight = 12; - + SetBoxHeight(12); SetBackgroundStyle( wxBG_STYLE_PAINT ); } virtual ~wxSimpleCheckBox(); + + void SetBoxHeight(int height) + { + m_boxHeight = height; + // Box rectangle + wxRect rect(GetClientSize()); + rect.y += 1; + rect.width += 1; + m_boxRect = GetBoxRect(rect, m_boxHeight); + } + + static wxRect GetBoxRect(const wxRect& r, int box_h) + { + return wxRect(r.x + wxPG_XBEFORETEXT, r.y + ((r.height - box_h) / 2), box_h, box_h); + } + int m_state; - int m_boxHeight; private: void OnPaint( wxPaintEvent& event ); @@ -1546,11 +1554,15 @@ private: void OnResize( wxSizeEvent& event ) { + SetBoxHeight(m_boxHeight); // Recalculate box rectangle Refresh(); event.Skip(); } void OnLeftClickActivate( wxCommandEvent& evt ); + int m_boxHeight; + wxRect m_boxRect; + wxDECLARE_EVENT_TABLE(); }; @@ -1571,17 +1583,13 @@ wxSimpleCheckBox::~wxSimpleCheckBox() void wxSimpleCheckBox::OnPaint( wxPaintEvent& WXUNUSED(event) ) { - wxRect rect(GetClientSize()); wxAutoBufferedPaintDC dc(this); - dc.Clear(); - - rect.y += 1; - rect.width += 1; wxColour bgcol = GetBackgroundColour(); + dc.SetBackground(wxBrush(bgcol)); + dc.Clear(); dc.SetBrush( bgcol ); dc.SetPen( bgcol ); - dc.DrawRectangle( rect ); dc.SetTextForeground(GetForegroundColour()); @@ -1590,13 +1598,12 @@ void wxSimpleCheckBox::OnPaint( wxPaintEvent& WXUNUSED(event) ) GetFont().GetWeight() == wxFONTWEIGHT_BOLD ) state |= wxSCB_STATE_BOLD; - DrawSimpleCheckBox(this, dc, rect, m_boxHeight, state); + DrawSimpleCheckBox(this, dc, m_boxRect, state); } void wxSimpleCheckBox::OnLeftClick( wxMouseEvent& event ) { - if ( (event.m_x > (wxPG_XBEFORETEXT-2)) && - (event.m_x <= (wxPG_XBEFORETEXT-2+m_boxHeight)) ) + if ( m_boxRect.Contains(event.GetPosition()) ) { SetValue(wxSCB_SETVALUE_CYCLE); } @@ -1631,11 +1638,11 @@ void wxSimpleCheckBox::SetValue( int value ) void wxSimpleCheckBox::OnLeftClickActivate( wxCommandEvent& evt ) { - // Construct mouse pseudo-event for initial mouse click - wxMouseEvent mouseEvt(wxEVT_LEFT_DOWN); - mouseEvt.m_x = evt.GetInt(); - mouseEvt.m_y = evt.GetExtraLong(); - OnLeftClick(mouseEvt); + wxPoint pt(evt.GetInt(), evt.GetExtraLong()); + if ( m_boxRect.Contains(pt) ) + { + SetValue(wxSCB_SETVALUE_CYCLE); + } } wxPGWindowList wxPGCheckBoxEditor::CreateControls( wxPropertyGrid* propGrid, @@ -1694,7 +1701,9 @@ void wxPGCheckBoxEditor::DrawValue( wxDC& dc, const wxRect& rect, state |= wxSCB_STATE_UNSPECIFIED; } - DrawSimpleCheckBox(property->GetGrid(), dc, rect, dc.GetCharHeight(), state); + // Box rectangle + wxRect r = wxSimpleCheckBox::GetBoxRect(rect, dc.GetCharHeight()); + DrawSimpleCheckBox(property->GetGrid(), dc, r, state); } void wxPGCheckBoxEditor::UpdateControl( wxPGProperty* property, @@ -1709,7 +1718,7 @@ void wxPGCheckBoxEditor::UpdateControl( wxPGProperty* property, cb->m_state = wxSCB_STATE_UNSPECIFIED; wxPropertyGrid* propGrid = property->GetGrid(); - cb->m_boxHeight = propGrid->GetFontHeight(); + cb->SetBoxHeight(propGrid->GetFontHeight()); cb->Refresh(); } From 547db34ce4494b37ee6aca8ec915b6d2e3052896 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 18:25:45 +0100 Subject: [PATCH 290/553] Don't allow reordering wxPropertyGrid header columns wxPropertyGrid is designed to work with fixed order of columns. --- src/propgrid/manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 23569a9534..d32c6f42d8 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -1641,7 +1641,7 @@ void wxPropertyGridManager::RecreateControls() if ( !m_pHeaderCtrl ) { wxPGHeaderCtrl* hc = new wxPGHeaderCtrl(this); - hc->Create(this, wxID_ANY); + hc->Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); m_pHeaderCtrl = hc; } else From 4b0d74e04d2a002f913d2610d8aa161e05aecc62 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 18:32:48 +0100 Subject: [PATCH 291/553] Create wxPGHeaderCtrl in one step Code simplification - 2-step creation is useless here. --- src/propgrid/manager.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index d32c6f42d8..fa5b37792a 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -229,8 +229,9 @@ void wxPropertyGridPage::DoSetSplitterPosition( int pos, class wxPGHeaderCtrl : public wxHeaderCtrl { public: - wxPGHeaderCtrl(wxPropertyGridManager* manager) : - wxHeaderCtrl() + wxPGHeaderCtrl(wxPropertyGridManager* manager, wxWindowID id, const wxPoint& pos, + const wxSize& size, long style) : + wxHeaderCtrl(manager, id, pos, size, style) { m_manager = manager; EnsureColumnCount(2); @@ -1637,12 +1638,9 @@ void wxPropertyGridManager::RecreateControls() #if wxUSE_HEADERCTRL if ( m_showHeader ) { - if ( !m_pHeaderCtrl ) { - wxPGHeaderCtrl* hc = new wxPGHeaderCtrl(this); - hc->Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); - m_pHeaderCtrl = hc; + m_pHeaderCtrl = new wxPGHeaderCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); } else { From e4198c149be40062f2889317e417ec04f2d310f5 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 20 Jan 2019 18:41:04 +0100 Subject: [PATCH 292/553] Allow entering plus/minus characters for floating point numbers --- src/propgrid/props.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index d67d9012c7..ab901c567e 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -190,7 +190,7 @@ wxNumericPropertyValidator:: } else if ( numericType == Float ) { - allowedChars += wxS("eE"); + allowedChars += wxS("-+eE"); // Use locale-specific decimal point allowedChars += wxString::Format(wxS("%g"), 1.1)[1]; From f10939862a5d012de7c06d79a04a5ecf97f28376 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Mon, 21 Jan 2019 16:09:45 +0900 Subject: [PATCH 293/553] Fix a typo in WebView::RunScript's comment innderHTML -> innerHTML --- interface/wx/webview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/wx/webview.h b/interface/wx/webview.h index c543123028..ffa2166878 100644 --- a/interface/wx/webview.h +++ b/interface/wx/webview.h @@ -583,7 +583,7 @@ public: wxString result; if ( webview->RunScript ( - "document.getElementById('some_id').innderHTML", + "document.getElementById('some_id').innerHTML", &result ) ) { From 3510319048173043969e209846050446199acdcb Mon Sep 17 00:00:00 2001 From: NikitaFeodonit Date: Mon, 21 Jan 2019 13:45:46 +0300 Subject: [PATCH 294/553] CMake: add processing the C flags for wxBUILD_USE_STATIC_RUNTIME --- build/cmake/init.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index cbbdb81dbf..4f85330814 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -11,13 +11,22 @@ if(DEFINED wxBUILD_USE_STATIC_RUNTIME AND wxBUILD_USE_STATIC_RUNTIME) # Set MSVC runtime flags for all configurations foreach(cfg "" ${CMAKE_CONFIGURATION_TYPES}) - set(flag_var CMAKE_CXX_FLAGS) + set(c_flag_var CMAKE_C_FLAGS) + set(cxx_flag_var CMAKE_CXX_FLAGS) if(cfg) string(TOUPPER ${cfg} cfg_upper) - wx_string_append(flag_var "_${cfg_upper}") + wx_string_append(c_flag_var "_${cfg_upper}") + wx_string_append(cxx_flag_var "_${cfg_upper}") endif() - if(${flag_var} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + if(${c_flag_var} MATCHES "/MD") + string(REPLACE "/MD" "/MT" ${c_flag_var} "${${c_flag_var}}") + set(${c_flag_var} ${${c_flag_var}} CACHE STRING + "Flags used by the C compiler during ${cfg_upper} builds." FORCE) + endif() + if(${cxx_flag_var} MATCHES "/MD") + string(REPLACE "/MD" "/MT" ${cxx_flag_var} "${${cxx_flag_var}}") + set(${cxx_flag_var} ${${cxx_flag_var}} CACHE STRING + "Flags used by the CXX compiler during ${cfg_upper} builds." FORCE) endif() endforeach() endif() From 1bc43c8d7a58103123e2c38631b3deebed916519 Mon Sep 17 00:00:00 2001 From: NikitaFeodonit Date: Mon, 21 Jan 2019 13:46:24 +0300 Subject: [PATCH 295/553] CMake: in wx_get_dependencies, for existing targets, use its LOCATION instead of the target name --- build/cmake/config.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 27e9f2a450..39a4257d9d 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -32,7 +32,12 @@ macro(wx_get_dependencies var lib) if(TARGET ${lib}) get_target_property(deps ${lib} LINK_LIBRARIES) foreach(dep IN LISTS deps) - get_filename_component(name ${dep} NAME) + if(TARGET ${dep}) + get_target_property(dep_path ${dep} LOCATION) + else() + set(dep_path ${dep}) + endif() + get_filename_component(name ${dep_path} NAME) wx_string_append(${var} "${name} ") endforeach() string(STRIP ${${var}} ${var}) From ad9175d79b4026578ce746d9ddc5353901ba986d Mon Sep 17 00:00:00 2001 From: NikitaFeodonit Date: Mon, 21 Jan 2019 13:47:15 +0300 Subject: [PATCH 296/553] CMake: wx-config can not be used to connect the libraries with the debug suffix, remove 'd' suffix for the UNIX build in wx_set_target_properties --- build/cmake/functions.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index d5dafa2b65..709a59760f 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -178,7 +178,9 @@ function(wx_set_target_properties target_name is_base) set_target_properties(${target_name} PROPERTIES OUTPUT_NAME wx_${lib_toolkit}${lib_unicode}${lib_suffix}-${lib_version} - OUTPUT_NAME_DEBUG wx_${lib_toolkit}${lib_unicode}d${lib_suffix}-${lib_version} + # NOTE: wx-config can not be used to connect the libraries with the debug suffix. + #OUTPUT_NAME_DEBUG wx_${lib_toolkit}${lib_unicode}d${lib_suffix}-${lib_version} + OUTPUT_NAME_DEBUG wx_${lib_toolkit}${lib_unicode}${lib_suffix}-${lib_version} ) endif() if(CYGWIN) From 58df1ee13f734e6f494b031da737510053bbc58f Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 21 Jan 2019 11:00:25 +0000 Subject: [PATCH 297/553] Added wxOVERRIDE specifiers to qt wxListBox methods --- include/wx/qt/listbox.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/qt/listbox.h b/include/wx/qt/listbox.h index e0086cda58..0ffff6e51c 100644 --- a/include/wx/qt/listbox.h +++ b/include/wx/qt/listbox.h @@ -49,8 +49,8 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); - virtual bool IsSelected(int n) const; - virtual int GetSelections(wxArrayInt& aSelections) const; + virtual bool IsSelected(int n) const wxOVERRIDE; + virtual int GetSelections(wxArrayInt& aSelections) const wxOVERRIDE; virtual unsigned int GetCount() const; virtual wxString GetString(unsigned int n) const; @@ -63,9 +63,9 @@ public: void QtSendEvent(wxEventType evtType, const QModelIndex &index, bool selected); protected: - virtual void DoSetFirstItem(int n); + virtual void DoSetFirstItem(int n) wxOVERRIDE; - virtual void DoSetSelection(int n, bool select); + virtual void DoSetSelection(int n, bool select) wxOVERRIDE; virtual int DoInsertItems(const wxArrayStringsAdapter & items, unsigned int pos, From edc315a62f78e6744f7ce62b5afc4f79e58f7d7f Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 12:49:06 +0000 Subject: [PATCH 298/553] Add wxOVERRIDE to overriden wxDialog methods for wxQT --- include/wx/qt/dialog.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/qt/dialog.h b/include/wx/qt/dialog.h index 5ae3b04a33..afd9a8b080 100644 --- a/include/wx/qt/dialog.h +++ b/include/wx/qt/dialog.h @@ -31,9 +31,9 @@ public: long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr ); - virtual int ShowModal(); - virtual void EndModal(int retCode); - virtual bool IsModal() const; + virtual int ShowModal() wxOVERRIDE; + virtual void EndModal(int retCode) wxOVERRIDE; + virtual bool IsModal() const wxOVERRIDE; QDialog *GetDialogHandle() const; From 26cba3bcf94b80f08cc5c64dc0c63fde6f1d05e0 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 12:50:36 +0000 Subject: [PATCH 299/553] Add missing WX_HOOK_MODAL_DIALOG to wxDialog::ShowModal for wxQT --- src/qt/dialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/dialog.cpp b/src/qt/dialog.cpp index 9bb788c27b..a4c53444bc 100644 --- a/src/qt/dialog.cpp +++ b/src/qt/dialog.cpp @@ -8,6 +8,7 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/modalhook.h" #include "wx/dialog.h" #include "wx/qt/private/utils.h" #include "wx/qt/private/winevent.h" @@ -70,6 +71,7 @@ bool wxDialog::Create( wxWindow *parent, wxWindowID id, int wxDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); wxCHECK_MSG( GetHandle() != NULL, -1, "Invalid dialog" ); bool ret = GetDialogHandle()->exec(); From 467bb0ec6698302ade12b9ee8832076849bf298b Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 13:53:14 +0000 Subject: [PATCH 300/553] Add WX_HOOK_MODAL_DIALOG for wxMessageDialog under wxQT --- src/qt/msgdlg.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/msgdlg.cpp b/src/qt/msgdlg.cpp index 5fe264a242..75bb23f0ae 100644 --- a/src/qt/msgdlg.cpp +++ b/src/qt/msgdlg.cpp @@ -8,6 +8,7 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/modalhook.h" #include "wx/msgdlg.h" #include "wx/qt/private/utils.h" #include "wx/qt/private/winevent.h" @@ -115,6 +116,7 @@ wxIMPLEMENT_CLASS(wxMessageDialog,wxDialog); int wxMessageDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); wxCHECK_MSG( m_qtWindow, -1, "Invalid dialog" ); // Exec may return a wx identifier if a close event is generated From 9cfecad878360523a0be4a0efcb64b2b07cf54ca Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 13:53:59 +0000 Subject: [PATCH 301/553] Generate wxDialogInit event for wxDialog under wxQT --- include/wx/qt/dialog.h | 1 + src/qt/dialog.cpp | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/wx/qt/dialog.h b/include/wx/qt/dialog.h index afd9a8b080..8bd995d906 100644 --- a/include/wx/qt/dialog.h +++ b/include/wx/qt/dialog.h @@ -34,6 +34,7 @@ public: virtual int ShowModal() wxOVERRIDE; virtual void EndModal(int retCode) wxOVERRIDE; virtual bool IsModal() const wxOVERRIDE; + virtual bool Show(bool show) wxOVERRIDE; QDialog *GetDialogHandle() const; diff --git a/src/qt/dialog.cpp b/src/qt/dialog.cpp index a4c53444bc..f19fd41f63 100644 --- a/src/qt/dialog.cpp +++ b/src/qt/dialog.cpp @@ -74,7 +74,12 @@ int wxDialog::ShowModal() WX_HOOK_MODAL_DIALOG(); wxCHECK_MSG( GetHandle() != NULL, -1, "Invalid dialog" ); - bool ret = GetDialogHandle()->exec(); + QDialog *qDialog = GetDialogHandle(); + qDialog->setModal(true); + + Show(true); + + bool ret = qDialog->exec(); if ( GetReturnCode() == 0 ) return ret ? wxID_OK : wxID_CANCEL; return GetReturnCode(); @@ -95,6 +100,25 @@ bool wxDialog::IsModal() const return GetDialogHandle()->isModal(); } +bool wxDialog::Show(bool show) +{ + if ( show == IsShown() ) + return false; + + if ( !show && IsModal() ) + EndModal(wxID_CANCEL); + + if ( show && CanDoLayoutAdaptation() ) + DoLayoutAdaptation(); + + const bool ret = wxDialogBase::Show(show); + + if (show) + InitDialog(); + + return ret; +} + QDialog *wxDialog::GetDialogHandle() const { return static_cast(m_qtWindow); From eb6b660d2701254944af997da69801e867a306f3 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 21 Jan 2019 14:04:47 +0000 Subject: [PATCH 302/553] Added setStyle method to wxListBox to allow for the proper setting of sorting and selection style of the QListWidget --- include/wx/qt/listbox.h | 1 + src/qt/listbox.cpp | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/include/wx/qt/listbox.h b/include/wx/qt/listbox.h index 0ffff6e51c..4b9c9c5ac1 100644 --- a/include/wx/qt/listbox.h +++ b/include/wx/qt/listbox.h @@ -90,6 +90,7 @@ protected: private: virtual void Init(); //common construction + void setStyle(long style); void UnSelectAll(); wxDECLARE_DYNAMIC_CLASS(wxListBox); diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index ffd6f84aa8..98595d3d7b 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -90,10 +90,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, QListWidgetItem* item; m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this ); - if ( style == wxLB_SORT ) - { - m_qtListWidget->setSortingEnabled(true); - } + setStyle(style); while ( n-- > 0 ) { @@ -120,6 +117,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, Init(); m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this ); + setStyle(style); + QStringList items; for (size_t i = 0; i < choices.size(); ++i) @@ -130,6 +129,27 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, return wxListBoxBase::Create( parent, id, pos, size, style, validator, name ); } +void wxListBox::setStyle(long style) +{ + if ( style & wxLB_SORT ) + { + m_qtListWidget->setSortingEnabled(true); + } + + if ( style & wxLB_SINGLE ) + { + m_qtListWidget->setSelectionMode(QAbstractItemView::SingleSelection); + } + else if ( style & wxLB_MULTIPLE ) + { + m_qtListWidget->setSelectionMode(QAbstractItemView::MultiSelection); + } + else if ( style & wxLB_EXTENDED ) + { + wxMISSING_IMPLEMENTATION( wxSTRINGIZE( wxLB_EXTENDED )); + } +} + void wxListBox::Init() { #if wxUSE_CHECKLISTBOX From 537564ae1944bfb8ae3ce605b3234f0dadeb09d5 Mon Sep 17 00:00:00 2001 From: NikitaFeodonit Date: Mon, 21 Jan 2019 18:19:39 +0300 Subject: [PATCH 303/553] CMake: use the target property OUTPUT_NAME instead of LOCATION in wx_get_dependencies --- build/cmake/config.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 39a4257d9d..90277f3955 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -33,12 +33,12 @@ macro(wx_get_dependencies var lib) get_target_property(deps ${lib} LINK_LIBRARIES) foreach(dep IN LISTS deps) if(TARGET ${dep}) - get_target_property(dep_path ${dep} LOCATION) + get_target_property(dep_name ${dep} OUTPUT_NAME) + set(dep_name "-l${dep_name}") else() - set(dep_path ${dep}) + get_filename_component(dep_name ${dep} NAME) endif() - get_filename_component(name ${dep_path} NAME) - wx_string_append(${var} "${name} ") + wx_string_append(${var} "${dep_name} ") endforeach() string(STRIP ${${var}} ${var}) endif() From ffcda97d04fdcdacac57b05938e52df59e69c076 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 21 Jan 2019 15:48:12 +0000 Subject: [PATCH 304/553] wxListBox GetSelection and DoSetSelection now use the proper QListWidget interface for specifying which index is selected. --- src/qt/listbox.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index 98595d3d7b..bdac7368a8 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -202,7 +202,20 @@ void wxListBox::SetString(unsigned int n, const wxString& s) int wxListBox::GetSelection() const { - return m_qtListWidget->currentIndex().row(); + if ( m_qtListWidget->selectedItems().empty() ) + { + return wxNOT_FOUND; + } + + for ( unsigned int i = 0; i < GetCount(); ++i) + { + if( m_qtListWidget->item(i) == m_qtListWidget->selectedItems().first() ) + { + return i; + } + } + + return wxNOT_FOUND; } void wxListBox::DoSetFirstItem(int WXUNUSED(n)) @@ -217,7 +230,7 @@ void wxListBox::DoSetSelection(int n, bool select) return; } - return m_qtListWidget->setCurrentRow(n, select ? QItemSelectionModel::Select : QItemSelectionModel::Deselect ); + m_qtListWidget->setItemSelected( m_qtListWidget->item(n), select); } int wxListBox::DoInsertItems(const wxArrayStringsAdapter & items, From ab3c460a9350207bb5d6b0ad353452b5163f4900 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 21 Jan 2019 16:00:03 +0000 Subject: [PATCH 305/553] Updated the GetSelections method to use QListWidget method to retrieve selected items rather than iterating through the list. Also updated the UnSelectAll method to be more efficient --- src/qt/listbox.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index bdac7368a8..6aa053b2fb 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -167,10 +167,9 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const { aSelections.clear(); - for ( unsigned int i = 0; i < GetCount(); ++i) + Q_FOREACH(QListWidgetItem* l, m_qtListWidget->selectedItems()) { - if ( IsSelected(i) ) - aSelections.push_back(i); + aSelections.push_back( m_qtListWidget->row(l) ); } return aSelections.size(); @@ -299,9 +298,8 @@ QScrollArea *wxListBox::QtGetScrollBarsContainer() const void wxListBox::UnSelectAll() { - for ( unsigned int i = 0; i < GetCount(); ++i ) + Q_FOREACH(QListWidgetItem* l, m_qtListWidget->selectedItems()) { - if ( IsSelected(i) ) - DoSetSelection(i, false); + m_qtListWidget->setItemSelected( l, false ); } } From d8d7f673b264795a4a7a9dee85745c5871079939 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 21 Jan 2019 16:02:03 +0000 Subject: [PATCH 306/553] Added comment explaining style mutual exclusive flags --- src/qt/listbox.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index 6aa053b2fb..de3a45cc2f 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -136,6 +136,7 @@ void wxListBox::setStyle(long style) m_qtListWidget->setSortingEnabled(true); } + // The following styles are mutually exclusive if ( style & wxLB_SINGLE ) { m_qtListWidget->setSelectionMode(QAbstractItemView::SingleSelection); From a2356fbe4a655490db4724283929f7d9a4637483 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Mon, 21 Jan 2019 16:16:17 +0000 Subject: [PATCH 307/553] Made the wxListBox::GetSelection method more efficient --- src/qt/listbox.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index de3a45cc2f..51a1457c49 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -207,15 +207,10 @@ int wxListBox::GetSelection() const return wxNOT_FOUND; } - for ( unsigned int i = 0; i < GetCount(); ++i) - { - if( m_qtListWidget->item(i) == m_qtListWidget->selectedItems().first() ) - { - return i; - } - } - return wxNOT_FOUND; + QListWidgetItem* item = m_qtListWidget->selectedItems().first(); + + return m_qtListWidget->row(item); } void wxListBox::DoSetFirstItem(int WXUNUSED(n)) From 63432e5ef5d387047e18f301577475d1df4ef503 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Mon, 21 Jan 2019 11:45:40 +0100 Subject: [PATCH 308/553] Fix wxShowEvent not being received for maximized frames on MSW Send wxEVT_SHOW explicitly when showing a maximized TLW under MSW as the system doesn't send WM_SHOW in this case (as documented in the MSDN and also confirmed by testing). Closes https://github.com/wxWidgets/wxWidgets/pull/1153 --- src/msw/toplevel.cpp | 10 ++++++++++ tests/toplevel/toplevel.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index b883d9d8f9..d7c4cfc79f 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -605,6 +605,16 @@ bool wxTopLevelWindowMSW::Show(bool show) DoShowWindow(nShowCmd); + if ( show && nShowCmd == SW_MAXIMIZE ) + { + // We don't receive WM_SHOWWINDOW when shown in the maximized state, + // cf. https://docs.microsoft.com/en-us/windows/desktop/winmsg/wm-showwindow + // and so we have to issue the event ourselves in this case. + wxShowEvent event(GetId(), true); + event.SetEventObject(this); + AddPendingEvent(event); + } + return true; } diff --git a/tests/toplevel/toplevel.cpp b/tests/toplevel/toplevel.cpp index 5e62a1b05c..6cd816eaf4 100644 --- a/tests/toplevel/toplevel.cpp +++ b/tests/toplevel/toplevel.cpp @@ -24,6 +24,8 @@ #include "wx/toplevel.h" #endif // WX_PRECOMP +#include "testableframe.h" + static void TopLevelWindowShowTest(wxTopLevelWindow* tlw) { CHECK(!tlw->IsShown()); @@ -75,3 +77,30 @@ TEST_CASE("wxTopLevel::Show", "[tlw][show]") frame->Destroy(); } } + +// Check that we receive the expected event when showing the TLW. +TEST_CASE("wxTopLevel::ShowEvent", "[tlw][show][event]") +{ + wxFrame* const frame = new wxFrame(NULL, wxID_ANY, "Maximized frame"); + + EventCounter countShow(frame, wxEVT_SHOW); + + frame->Maximize(); + frame->Show(); + + // Wait for the event to be received for the maximum of 2 seconds. + int showCount = 0; + for ( int i = 0; i < 40; i++ ) + { + wxYield(); + + showCount = countShow.GetCount(); + + if ( showCount ) + break; + + wxMilliSleep(50); + } + + CHECK( showCount == 1 ); +} From a5174c7483560eed60fe000c74a984c561568ac6 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 13:49:02 +0000 Subject: [PATCH 309/553] Don't use desktop in wxQtMeasuringContext This doesn't work, so create a new QPainter instead. --- src/qt/graphics.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp index 97feabff96..4d2c351071 100644 --- a/src/qt/graphics.cpp +++ b/src/qt/graphics.cpp @@ -654,6 +654,13 @@ public: #endif + wxQtGraphicsContext(wxGraphicsRenderer* renderer, QPainter* painter, bool ownsPainter = true) + : wxGraphicsContext(renderer), + m_qtPainter(painter), + m_ownsPainter(ownsPainter) + { + } + wxQtGraphicsContext(wxGraphicsRenderer* renderer, wxWindow *window) : wxGraphicsContext(renderer) { @@ -1020,12 +1027,9 @@ class wxQtMeasuringContext : public wxQtGraphicsContext { public: wxQtMeasuringContext(wxGraphicsRenderer* renderer) - : wxQtGraphicsContext(renderer, QApplication::desktop()) + : wxQtGraphicsContext(renderer, new QPainter()) { } - -private: - QPainter painter; }; class wxQtImageContext : public wxQtGraphicsContext From b991dc9d5a9c357ffdadafc993d92762b6902a63 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 13:49:02 +0000 Subject: [PATCH 310/553] Fix using inactive painter when getting text extent Ensure that the painter is active before using it. --- src/qt/graphics.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp index 4d2c351071..5b2d32122e 100644 --- a/src/qt/graphics.cpp +++ b/src/qt/graphics.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #ifndef WX_PRECOMP #include "wx/bitmap.h" @@ -34,6 +35,38 @@ #include "wx/private/graphics.h" +namespace +{ + +// Ensure that the given painter is active by calling begin() if it isn't. If +// it already is, don't do anything. +class EnsurePainterIsActive +{ +public: + explicit EnsurePainterIsActive(QPainter* painter) + : m_painter(painter), + m_wasActive(painter->isActive()) + { + if ( !m_wasActive ) + m_painter->begin(&m_picture); + } + + ~EnsurePainterIsActive() + { + if ( !m_wasActive ) + m_painter->end(); + } + +private: + QPainter* m_painter; + QPicture m_picture; + bool m_wasActive; + + wxDECLARE_NO_COPY_CLASS(EnsurePainterIsActive); +}; + +} // anonymous namespace + class WXDLLIMPEXP_CORE wxQtBrushData : public wxGraphicsObjectRefData { public: @@ -935,6 +968,8 @@ public: wxCHECK_RET( !m_font.IsNull(), "wxQtContext::GetTextExtent - no valid font set" ); + EnsurePainterIsActive active(m_qtPainter); + const wxQtFontData* fontData = static_cast(m_font.GetRefData()); m_qtPainter->setFont(fontData->GetFont()); @@ -959,6 +994,8 @@ public: wxCHECK_RET( !m_font.IsNull(), "wxQtContext::GetPartialTextExtents - no valid font set" ); + EnsurePainterIsActive active(m_qtPainter); + const wxQtFontData* fontData = static_cast(m_font.GetRefData()); m_qtPainter->setFont(fontData->GetFont()); From 6d91374dffe0a9fda941231cefbd77e297aa6c97 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 19:37:24 +0100 Subject: [PATCH 311/553] Simplify QPainter ownership in wxQtGraphicsContext No real changes, just refactor the code to use more explicit AttachPainter() when giving ownership of a new QPainter object to wxQtGraphicsContext. This method also allows to simplify wxQtImageContext as it doesn't need to handle ownership on its own and can just leave it to the base class. And m_ownsPainter can now be made private. --- src/qt/graphics.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp index 5b2d32122e..7e0aaccac0 100644 --- a/src/qt/graphics.cpp +++ b/src/qt/graphics.cpp @@ -648,6 +648,14 @@ class WXDLLIMPEXP_CORE wxQtGraphicsContext : public wxGraphicsContext } protected: + // Use the specified painter and take ownership of it, i.e. it will be + // destroyed in this class dtor. + void AttachPainter(QPainter* painter) + { + m_qtPainter = painter; + m_ownsPainter = true; + } + wxQtGraphicsContext(wxGraphicsRenderer* renderer) : wxGraphicsContext(renderer), m_qtPainter(NULL), @@ -687,13 +695,6 @@ public: #endif - wxQtGraphicsContext(wxGraphicsRenderer* renderer, QPainter* painter, bool ownsPainter = true) - : wxGraphicsContext(renderer), - m_qtPainter(painter), - m_ownsPainter(ownsPainter) - { - } - wxQtGraphicsContext(wxGraphicsRenderer* renderer, wxWindow *window) : wxGraphicsContext(renderer) { @@ -1054,9 +1055,10 @@ protected: } QPainter* m_qtPainter; - bool m_ownsPainter; private: + bool m_ownsPainter; + wxDECLARE_NO_COPY_CLASS(wxQtGraphicsContext); }; @@ -1064,8 +1066,9 @@ class wxQtMeasuringContext : public wxQtGraphicsContext { public: wxQtMeasuringContext(wxGraphicsRenderer* renderer) - : wxQtGraphicsContext(renderer, new QPainter()) + : wxQtGraphicsContext(renderer) { + AttachPainter(new QPainter()); } }; @@ -1078,15 +1081,13 @@ public: { const wxBitmap wxbitmap(image); m_pixmap = *wxbitmap.GetHandle(); - m_qtPainter = new QPainter(&m_pixmap); - m_ownsPainter = false; + AttachPainter(new QPainter(&m_pixmap)); } ~wxQtImageContext() { wxQtBitmapData bitmap(GetRenderer(), &m_pixmap); m_image = bitmap.DoConvertToImage(); - delete m_qtPainter; } private: From 8434adb00ec1ef9fd8594842194536b10ec9f307 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 19:40:22 +0100 Subject: [PATCH 312/553] Use AttachPainter() instead of setting m_ownsPainter directly No real changes, just another tiny simplification. --- src/qt/graphics.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp index 7e0aaccac0..f4df9b0af7 100644 --- a/src/qt/graphics.cpp +++ b/src/qt/graphics.cpp @@ -667,8 +667,7 @@ public: wxQtGraphicsContext(wxGraphicsRenderer* renderer, QPaintDevice* device) : wxGraphicsContext(renderer) { - m_qtPainter = new QPainter(device); - m_ownsPainter = true; + AttachPainter(new QPainter(device)); m_width = device->width(); m_height = device->height(); From 21e989751fd6e3e5c8ff5b61a76d6e87c059f76f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 19:42:56 +0100 Subject: [PATCH 313/553] Get rid of m_ownsPainter flag in wxQtGraphicsContext Use wxScopedPtr to ensure that the pointer is destroyed automatically instead of doing it manually. --- src/qt/graphics.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp index f4df9b0af7..be97b85cfe 100644 --- a/src/qt/graphics.cpp +++ b/src/qt/graphics.cpp @@ -31,6 +31,7 @@ #endif #include "wx/graphics.h" +#include "wx/scopedptr.h" #include "wx/tokenzr.h" #include "wx/private/graphics.h" @@ -640,7 +641,6 @@ class WXDLLIMPEXP_CORE wxQtGraphicsContext : public wxGraphicsContext void InitFromDC(const wxDC& dc) { m_qtPainter = static_cast(dc.GetHandle()); - m_ownsPainter = false; const wxSize sz = dc.GetSize(); m_width = sz.x; @@ -653,13 +653,14 @@ protected: void AttachPainter(QPainter* painter) { m_qtPainter = painter; - m_ownsPainter = true; + + // Ensure that it will be destroyed when this object is. + m_ownedPainter.reset(m_qtPainter); } wxQtGraphicsContext(wxGraphicsRenderer* renderer) : wxGraphicsContext(renderer), - m_qtPainter(NULL), - m_ownsPainter(false) + m_qtPainter(NULL) { } @@ -698,19 +699,12 @@ public: : wxGraphicsContext(renderer) { m_qtPainter = static_cast(window->QtGetPainter()); - m_ownsPainter = false; const wxSize sz = window->GetClientSize(); m_width = sz.x; m_height = sz.y; } - virtual ~wxQtGraphicsContext() - { - if ( m_ownsPainter ) - delete m_qtPainter; - } - virtual bool ShouldOffset() const wxOVERRIDE { return false; @@ -1056,7 +1050,8 @@ protected: QPainter* m_qtPainter; private: - bool m_ownsPainter; + // This pointer may be empty if we don't own m_qtPainter. + wxScopedPtr m_ownedPainter; wxDECLARE_NO_COPY_CLASS(wxQtGraphicsContext); }; From 000f8ef422a5c45dcc868ebfb4e86e9eb7dab38d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 20:01:08 +0100 Subject: [PATCH 314/553] Put private wxQtChoice class inside an anonymous namespace No real changes, just avoid polluting global scope unnecessarily. --- src/qt/choice.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 1bd6511202..8c49d5e933 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -12,6 +12,9 @@ #include "wx/qt/private/winevent.h" #include +namespace +{ + class wxQtChoice : public wxQtEventSignalHandler< QComboBox, wxChoice > { public: @@ -36,6 +39,8 @@ void wxQtChoice::activated(int WXUNUSED(index)) handler->SendSelectionChangedEvent(wxEVT_CHOICE); } +} // anonymous namespace + wxChoice::wxChoice() : m_qtComboBox(NULL) From b27971c501e1f711d843010cd76d1d32d828659a Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 16 Jan 2019 11:03:52 +0000 Subject: [PATCH 315/553] Use case-insensitive comparison in Qt wxComboBox and wxChoice Define LexicalSortProxyModel to use the same sort order in wxQt as in the other ports. --- include/wx/qt/choice.h | 2 ++ src/qt/choice.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/qt/combobox.cpp | 5 +++++ 3 files changed, 45 insertions(+) diff --git a/include/wx/qt/choice.h b/include/wx/qt/choice.h index 06602b9b68..5b4e51129a 100644 --- a/include/wx/qt/choice.h +++ b/include/wx/qt/choice.h @@ -71,6 +71,8 @@ protected: virtual void DoClear(); virtual void DoDeleteOneItem(unsigned int pos); + virtual void InitialiseSort(QComboBox *combo); + QComboBox *m_qtComboBox; private: diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 8c49d5e933..cc1587825e 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -10,11 +10,39 @@ #include "wx/choice.h" #include "wx/qt/private/winevent.h" + #include +#include namespace { +class LexicalSortProxyModel : public QSortFilterProxyModel +{ +public: + bool lessThan( const QModelIndex &left, const QModelIndex &right ) const wxOVERRIDE + { + const QVariant leftData = sourceModel()->data( left ); + const QVariant rightData = sourceModel()->data( right ); + + if ( leftData.type() != QVariant::String ) + return false; + + int insensitiveResult = QString::compare( + leftData.value(), + rightData.value(), + Qt::CaseInsensitive ); + + if ( insensitiveResult == 0 ) + { + return QString::compare( leftData.value(), + rightData.value() ) < 0; + } + + return insensitiveResult < 0; + } +}; + class wxQtChoice : public wxQtEventSignalHandler< QComboBox, wxChoice > { public: @@ -47,6 +75,14 @@ wxChoice::wxChoice() : { } +void wxChoice::InitialiseSort(QComboBox *combo) +{ + QSortFilterProxyModel *proxyModel = new LexicalSortProxyModel(); + proxyModel->setSourceModel(combo->model()); + combo->model()->setParent(proxyModel); + combo->setModel(proxyModel); +} + wxChoice::wxChoice( wxWindow *parent, wxWindowID id, const wxPoint& pos, @@ -95,6 +131,8 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, { m_qtComboBox = new wxQtChoice( parent, this ); + InitialiseSort(m_qtComboBox); + while ( n-- > 0 ) m_qtComboBox->addItem( wxQtConvertString( *choices++ )); diff --git a/src/qt/combobox.cpp b/src/qt/combobox.cpp index 4ca376f23d..36efe13300 100644 --- a/src/qt/combobox.cpp +++ b/src/qt/combobox.cpp @@ -128,6 +128,8 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& name ) { m_qtComboBox = new wxQtComboBox( parent, this ); + InitialiseSort(m_qtComboBox); + while ( n-- > 0 ) m_qtComboBox->addItem( wxQtConvertString( *choices++ )); m_qtComboBox->setEditText( wxQtConvertString( value )); @@ -140,7 +142,10 @@ void wxComboBox::SetValue(const wxString& value) if ( HasFlag(wxCB_READONLY) ) SetStringSelection(value); else + { wxTextEntry::SetValue(value); + m_qtComboBox->setEditText( wxQtConvertString(value) ); + } } wxString wxComboBox::DoGetValue() const From cfdf80d5866aac9fce9f5df56aa9c943598fe25a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 19:57:33 +0100 Subject: [PATCH 316/553] Rename wxChoice::InitialiseSort() to QtInitSort() Use the prefix to indicate that this function is unique to this port. Also don't make unnecessarily make it virtual. --- include/wx/qt/choice.h | 2 +- src/qt/choice.cpp | 4 ++-- src/qt/combobox.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/qt/choice.h b/include/wx/qt/choice.h index 5b4e51129a..208005ec06 100644 --- a/include/wx/qt/choice.h +++ b/include/wx/qt/choice.h @@ -71,7 +71,7 @@ protected: virtual void DoClear(); virtual void DoDeleteOneItem(unsigned int pos); - virtual void InitialiseSort(QComboBox *combo); + void QtInitSort(QComboBox *combo); QComboBox *m_qtComboBox; diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index cc1587825e..4bc672b71e 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -75,7 +75,7 @@ wxChoice::wxChoice() : { } -void wxChoice::InitialiseSort(QComboBox *combo) +void wxChoice::QtInitSort( QComboBox *combo ) { QSortFilterProxyModel *proxyModel = new LexicalSortProxyModel(); proxyModel->setSourceModel(combo->model()); @@ -131,7 +131,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, { m_qtComboBox = new wxQtChoice( parent, this ); - InitialiseSort(m_qtComboBox); + QtInitSort( m_qtComboBox ); while ( n-- > 0 ) m_qtComboBox->addItem( wxQtConvertString( *choices++ )); diff --git a/src/qt/combobox.cpp b/src/qt/combobox.cpp index 36efe13300..3ca015a019 100644 --- a/src/qt/combobox.cpp +++ b/src/qt/combobox.cpp @@ -128,7 +128,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& name ) { m_qtComboBox = new wxQtComboBox( parent, this ); - InitialiseSort(m_qtComboBox); + QtInitSort( m_qtComboBox ); while ( n-- > 0 ) m_qtComboBox->addItem( wxQtConvertString( *choices++ )); From f2538a0bc423886f6d838cb112af038366fe915e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 17 Jan 2019 12:00:01 +0000 Subject: [PATCH 317/553] Reset selection in after deleting selected item from wxChoice --- src/qt/choice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 4bc672b71e..20c9dac7fb 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -240,6 +240,12 @@ void wxChoice::DoClear() void wxChoice::DoDeleteOneItem(unsigned int pos) { + const int selection = GetSelection(); + + if ( selection >= 0 && static_cast(selection) == pos ) + { + SetSelection( wxNOT_FOUND ); + } m_qtComboBox->removeItem(pos); } From b0defd5876e13e92308fc4375b32d128b18ca2cd Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 17 Jan 2019 12:00:01 +0000 Subject: [PATCH 318/553] Don't select the newly added item in wxChoice --- src/qt/choice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 20c9dac7fb..491398b718 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -212,11 +212,17 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, int wxChoice::DoInsertOneItem(const wxString& item, unsigned int pos) { + // Maintain unselected state + const bool unselected = m_qtComboBox->currentIndex() == -1; + m_qtComboBox->insertItem(pos, wxQtConvertString(item)); if ( IsSorted() ) m_qtComboBox->model()->sort(0); + if ( unselected ) + m_qtComboBox->setCurrentIndex(-1); + return pos; } From 1a7f9124b66989abaaa726e369c5b7ad3418e831 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 17 Jan 2019 12:00:01 +0000 Subject: [PATCH 319/553] Update insertion point in wxTextEntry::Remove() Move the insertion point to the end of the string if its position has become invalid after removing part of the text. --- src/qt/textentry.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/textentry.cpp b/src/qt/textentry.cpp index f1c088165a..6a5cbc71dd 100644 --- a/src/qt/textentry.cpp +++ b/src/qt/textentry.cpp @@ -20,9 +20,11 @@ void wxTextEntry::WriteText(const wxString& WXUNUSED(text)) void wxTextEntry::Remove(long from, long to) { + const long insertionPoint = GetInsertionPoint(); wxString string = GetValue(); string.erase(from, to - from); SetValue(string); + SetInsertionPoint( std::min(insertionPoint, static_cast(string.length())) ); } void wxTextEntry::Copy() From 3618356cf133296a1bab5438e1a5bfdd71e6e5d2 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 17 Jan 2019 12:00:01 +0000 Subject: [PATCH 320/553] Fix wxComboBox implementation of wxTextEntry interface Implement missing methods and send, or suppress, the expected events. --- include/wx/qt/combobox.h | 9 ++- src/qt/combobox.cpp | 121 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 123 insertions(+), 7 deletions(-) diff --git a/include/wx/qt/combobox.h b/include/wx/qt/combobox.h index 490e2cb117..bc0222d5cb 100644 --- a/include/wx/qt/combobox.h +++ b/include/wx/qt/combobox.h @@ -52,7 +52,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); - virtual void SetSelection(int n) wxOVERRIDE { wxChoice::SetSelection(n); } + virtual void SetSelection(int n) wxOVERRIDE; virtual void SetSelection(long from, long to) wxOVERRIDE; virtual int GetSelection() const wxOVERRIDE { return wxChoice::GetSelection(); } @@ -70,6 +70,12 @@ public: bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); } virtual void SetValue(const wxString& value) wxOVERRIDE; + virtual void ChangeValue(const wxString& value) wxOVERRIDE; + virtual void AppendText(const wxString &value) wxOVERRIDE; + virtual void Replace(long from, long to, const wxString &value) wxOVERRIDE; + virtual void WriteText(const wxString &value) wxOVERRIDE; + virtual void SetInsertionPoint(long insertion) wxOVERRIDE; + virtual long GetInsertionPoint() const wxOVERRIDE; virtual void Popup(); virtual void Dismiss(); @@ -80,6 +86,7 @@ protected: virtual wxString DoGetValue() const wxOVERRIDE; private: + void SetActualValue(const wxString& value); // From wxTextEntry: virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; } diff --git a/src/qt/combobox.cpp b/src/qt/combobox.cpp index 3ca015a019..36685b1954 100644 --- a/src/qt/combobox.cpp +++ b/src/qt/combobox.cpp @@ -23,13 +23,37 @@ public: virtual void showPopup() wxOVERRIDE; virtual void hidePopup() wxOVERRIDE; + class IgnoreTextChange + { + public: + // Note that wxComboBox inherits its QComboBox pointer from wxChoice, + // where it can't be stored as wxQtComboBox, but its dynamic type is + // nevertheless always wxQtComboBox, so the cast below is safe. + explicit IgnoreTextChange(QComboBox *combo) + : m_combo(static_cast(combo)) + { + m_combo->m_textChangeIgnored = true; + } + + ~IgnoreTextChange() + { + m_combo->m_textChangeIgnored = false; + } + + private: + wxQtComboBox* m_combo; + }; + private: void activated(int index); void editTextChanged(const QString &text); + + bool m_textChangeIgnored; }; wxQtComboBox::wxQtComboBox( wxWindow *parent, wxComboBox *handler ) - : wxQtEventSignalHandler< QComboBox, wxComboBox >( parent, handler ) + : wxQtEventSignalHandler< QComboBox, wxComboBox >( parent, handler ), + m_textChangeIgnored( false ) { setEditable( true ); connect(this, static_cast(&QComboBox::activated), @@ -61,6 +85,9 @@ void wxQtComboBox::activated(int WXUNUSED(index)) void wxQtComboBox::editTextChanged(const QString &text) { + if ( m_textChangeIgnored ) + return; + wxComboBox *handler = GetHandler(); if ( handler ) { @@ -70,6 +97,11 @@ void wxQtComboBox::editTextChanged(const QString &text) } } +void wxComboBox::SetSelection( int n ) +{ + wxQtComboBox::IgnoreTextChange ignore( m_qtComboBox ); + wxChoice::SetSelection( n ); +} wxComboBox::wxComboBox() { @@ -137,10 +169,12 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, return QtCreateControl( parent, id, pos, size, style, validator, name ); } -void wxComboBox::SetValue(const wxString& value) +void wxComboBox::SetActualValue(const wxString &value) { if ( HasFlag(wxCB_READONLY) ) - SetStringSelection(value); + { + SetStringSelection( value ); + } else { wxTextEntry::SetValue(value); @@ -148,6 +182,56 @@ void wxComboBox::SetValue(const wxString& value) } } +void wxComboBox::SetValue(const wxString& value) +{ + SetActualValue( value ); + SetInsertionPoint( 0 ); +} + +void wxComboBox::ChangeValue(const wxString &value) +{ + wxQtComboBox::IgnoreTextChange ignore( m_qtComboBox ); + SetValue( value ); +} + +void wxComboBox::AppendText(const wxString &value) +{ + SetActualValue( GetValue() + value ); +} + +void wxComboBox::Replace(long from, long to, const wxString &value) +{ + const wxString original( GetValue() ); + + if ( to < 0 ) + { + to = original.length(); + } + + if ( from == 0 ) + { + SetActualValue( value + original.substr(to, original.length()) ); + } + + wxString front = original.substr( 0, from ) + value; + + long iPoint = front.length(); + if ( front.length() <= original.length() ) + { + SetActualValue( front + original.substr(to, original.length()) ); + } + else + { + SetActualValue( front ); + } + SetInsertionPoint( iPoint ); +} + +void wxComboBox::WriteText(const wxString &value) +{ + m_qtComboBox->lineEdit()->insert( wxQtConvertString( value ) ); +} + wxString wxComboBox::DoGetValue() const { return wxQtConvertString( m_qtComboBox->currentText() ); @@ -171,15 +255,40 @@ void wxComboBox::Clear() void wxComboBox::SetSelection( long from, long to ) { - // SelectAll uses -1 to -1, adjust for qt: - if (from == -1 && to == -1) + if ( from == -1 ) { from = 0; + } + if ( to == -1 ) + { to = GetValue().length(); } + + SetInsertionPoint( from ); // use the inner text entry widget (note that can be null if not editable) if ( m_qtComboBox->lineEdit() != NULL ) - m_qtComboBox->lineEdit()->setSelection(from, to); + { + m_qtComboBox->lineEdit()->setSelection( from, to - from ); + } +} + +void wxComboBox::SetInsertionPoint( long pos ) +{ + // check if pos indicates end of text: + if ( pos == -1 ) + m_qtComboBox->lineEdit()->end( false ); + else + m_qtComboBox->lineEdit()->setCursorPosition( pos ); +} + +long wxComboBox::GetInsertionPoint() const +{ + long selectionStart = m_qtComboBox->lineEdit()->selectionStart(); + + if ( selectionStart >= 0 ) + return selectionStart; + + return m_qtComboBox->lineEdit()->cursorPosition(); } void wxComboBox::GetSelection(long* from, long* to) const From 4c05b3650a7de5eede0ff6063ce38df2bd37baa7 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 18 Jan 2019 10:31:56 +0000 Subject: [PATCH 321/553] Add a test for WriteText and fix implementation in wxQt --- tests/controls/textentrytest.cpp | 22 ++++++++++++++++++++++ tests/controls/textentrytest.h | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/controls/textentrytest.cpp b/tests/controls/textentrytest.cpp index 9c1dbe7d95..b053e80489 100644 --- a/tests/controls/textentrytest.cpp +++ b/tests/controls/textentrytest.cpp @@ -201,6 +201,28 @@ void TextEntryTestCase::Replace() CPPUNIT_ASSERT_EQUAL(2, entry->GetInsertionPoint()); } +void TextEntryTestCase::WriteText() +{ + wxTextEntry * const entry = GetTestEntry(); + + entry->SetValue("foo"); + entry->SetInsertionPoint(3); + entry->WriteText("bar"); + CPPUNIT_ASSERT_EQUAL( "foobar", entry->GetValue() ); + + entry->SetValue("foo"); + entry->SetInsertionPoint(0); + entry->WriteText("bar"); + CPPUNIT_ASSERT_EQUAL( "barfoo", entry->GetValue() ); + + entry->SetValue("abxxxhi"); + entry->SetSelection(2, 5); + entry->WriteText("cdefg"); + CPPUNIT_ASSERT_EQUAL( "abcdefghi", entry->GetValue() ); + CPPUNIT_ASSERT_EQUAL( 7, entry->GetInsertionPoint() ); + CPPUNIT_ASSERT_EQUAL( false, entry->HasSelection() ); +} + #if wxUSE_UIACTIONSIMULATOR class TextEventHandler diff --git a/tests/controls/textentrytest.h b/tests/controls/textentrytest.h index 648d601872..fc784c9d6f 100644 --- a/tests/controls/textentrytest.h +++ b/tests/controls/textentrytest.h @@ -44,7 +44,8 @@ protected: WXUISIM_TEST( Editable ); \ CPPUNIT_TEST( Hint ); \ CPPUNIT_TEST( CopyPaste ); \ - CPPUNIT_TEST( UndoRedo ) + CPPUNIT_TEST( UndoRedo ); \ + CPPUNIT_TEST( WriteText ) void SetValue(); void TextChangeEvents(); @@ -55,6 +56,7 @@ protected: void Hint(); void CopyPaste(); void UndoRedo(); + void WriteText(); private: // Selection() test helper: verify that selection is as described by the From ce5301e4e604150c8b49c1ffd40be3ee4a7b8416 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 322/553] Fix off by 1 errors in wxQt wxDC::SetClippingRegion() --- src/qt/dc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 073a10d755..2d91673124 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -434,9 +434,9 @@ void wxQtDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxRect clipRect = m_clippingRegion->GetBox(); m_clipX1 = clipRect.GetLeft(); - m_clipX2 = clipRect.GetRight(); + m_clipX2 = clipRect.GetRight() + 1; m_clipY1 = clipRect.GetTop(); - m_clipY2 = clipRect.GetBottom(); + m_clipY2 = clipRect.GetBottom() + 1; m_clipping = true; } } @@ -472,9 +472,9 @@ void wxQtDCImpl::DoSetDeviceClippingRegion(const wxRegion& region) wxRect clipRect = m_clippingRegion->GetBox(); m_clipX1 = clipRect.GetLeft(); - m_clipX2 = clipRect.GetRight(); + m_clipX2 = clipRect.GetRight() + 1; m_clipY1 = clipRect.GetTop(); - m_clipY2 = clipRect.GetBottom(); + m_clipY2 = clipRect.GetBottom() + 1; m_clipping = true; } } From a130a59111353c5277abcb37605845ae7d5b143e Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 323/553] Handle clipping regions with negative width or height in wxQt --- src/qt/dc.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 2d91673124..35dec4b0ac 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -416,6 +416,17 @@ void wxQtDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, } else { + if ( width < 0 ) + { + width = -width; + x -= width - 1; + } + if ( height < 0 ) + { + height = -height; + y -= height - 1; + } + if (m_qtPainter->isActive()) { // Set QPainter clipping (intersection if not the first one) From 5b8b30d2436f0488ca3ebaaf6d8feae23a778b5f Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 324/553] Don't use pointer for wxDC::m_clippingRegion in wxQt An object can be used directly instead. --- include/wx/qt/dc.h | 2 +- src/qt/dc.cpp | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/wx/qt/dc.h b/include/wx/qt/dc.h index 43bd13e070..d1c632f714 100644 --- a/include/wx/qt/dc.h +++ b/include/wx/qt/dc.h @@ -116,7 +116,7 @@ protected: QPainter *m_qtPainter; QPixmap *m_qtPixmap; - wxRegion *m_clippingRegion; + wxRegion m_clippingRegion; private: enum wxQtRasterColourOp { diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 35dec4b0ac..7ba806795f 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -48,7 +48,6 @@ wxIMPLEMENT_CLASS(wxQtDCImpl,wxDCImpl); wxQtDCImpl::wxQtDCImpl( wxDC *owner ) : wxDCImpl( owner ) { - m_clippingRegion = new wxRegion; m_qtPixmap = NULL; m_rasterColourOp = wxQtNONE; m_qtPenColor = new QColor; @@ -67,7 +66,6 @@ wxQtDCImpl::~wxQtDCImpl() delete m_qtPainter; } - delete m_clippingRegion; delete m_qtPenColor; delete m_qtBrushColor; } @@ -87,7 +85,7 @@ void wxQtDCImpl::QtPreparePainter( ) if (m_clipping) { - wxRegionIterator ri(*m_clippingRegion); + wxRegionIterator ri(m_clippingRegion); bool append = false; while (ri.HaveRects()) { @@ -438,11 +436,11 @@ void wxQtDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, /* Note: Qt states that QPainter::clipRegion() may be slow, so we * keep the region manually, which should be faster */ if ( m_clipping ) - m_clippingRegion->Union( wxRect( x, y, width, height ) ); + m_clippingRegion.Union( wxRect( x, y, width, height ) ); else - m_clippingRegion->Intersect( wxRect( x, y, width, height ) ); + m_clippingRegion.Intersect( wxRect( x, y, width, height ) ); - wxRect clipRect = m_clippingRegion->GetBox(); + wxRect clipRect = m_clippingRegion.GetBox(); m_clipX1 = clipRect.GetLeft(); m_clipX2 = clipRect.GetRight() + 1; @@ -476,11 +474,11 @@ void wxQtDCImpl::DoSetDeviceClippingRegion(const wxRegion& region) /* Note: Qt states that QPainter::clipRegion() may be slow, so we * keep the region manually, which should be faster */ if ( m_clipping ) - m_clippingRegion->Union( region ); + m_clippingRegion.Union( region ); else - m_clippingRegion->Intersect( region ); + m_clippingRegion.Intersect( region ); - wxRect clipRect = m_clippingRegion->GetBox(); + wxRect clipRect = m_clippingRegion.GetBox(); m_clipX1 = clipRect.GetLeft(); m_clipX2 = clipRect.GetRight() + 1; @@ -493,7 +491,7 @@ void wxQtDCImpl::DoSetDeviceClippingRegion(const wxRegion& region) void wxQtDCImpl::DestroyClippingRegion() { wxDCImpl::DestroyClippingRegion(); - m_clippingRegion->Clear(); + m_clippingRegion.Clear(); if (m_qtPainter->isActive()) m_qtPainter->setClipping( false ); From 5929c5831eb8959114839ec6b4ddeeb4b00e17c8 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 325/553] Fix handling of empty clipping region in wxQt --- src/qt/dc.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 7ba806795f..dfde8af7d1 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -435,10 +435,14 @@ void wxQtDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, // Set internal state for getters /* Note: Qt states that QPainter::clipRegion() may be slow, so we * keep the region manually, which should be faster */ - if ( m_clipping ) - m_clippingRegion.Union( wxRect( x, y, width, height ) ); - else - m_clippingRegion.Intersect( wxRect( x, y, width, height ) ); + if ( !m_clipping || m_clippingRegion.IsEmpty() ) + { + int dcwidth, dcheight; + DoGetSize(&dcwidth, &dcheight); + + m_clippingRegion = wxRegion(0, 0, dcwidth, dcheight); + } + m_clippingRegion.Intersect( wxRect(x, y, width, height) ); wxRect clipRect = m_clippingRegion.GetBox(); From 0cd2f7b68791a51c9f67b71d8aade2d1d4fa841e Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 326/553] Remove unnecessary checks for null pointer before deleting it No real changes. --- src/qt/region.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qt/region.cpp b/src/qt/region.cpp index a0c3ea8698..7dfb58aa41 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -279,14 +279,12 @@ wxRegionIterator::wxRegionIterator(const wxRegionIterator& ri) wxRegionIterator::~wxRegionIterator() { - if ( m_qtRects != NULL ) - delete m_qtRects; + delete m_qtRects; } wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& ri) { - if ( m_qtRects != NULL ) - delete m_qtRects; + delete m_qtRects; m_qtRects = new QVector< QRect >( *ri.m_qtRects ); m_pos = ri.m_pos; @@ -300,8 +298,7 @@ void wxRegionIterator::Reset() void wxRegionIterator::Reset(const wxRegion& region) { - if ( m_qtRects != NULL ) - delete m_qtRects; + delete m_qtRects; m_qtRects = new QVector< QRect >( region.GetHandle().rects() ); m_pos = 0; From 637b861eb1bcd9c4151c7d008b7e67e92183d913 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 327/553] Don't allocate wxRegionRefData at all for empty region Empty regions don't really need any data. --- src/qt/region.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 7dfb58aa41..0dd73003b6 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -57,7 +57,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxRegion,wxGDIObject); wxRegion::wxRegion() { - m_refData = new wxRegionRefData(); + m_refData = NULL; } wxRegion::wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h) @@ -133,14 +133,20 @@ wxRegion::wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance) bool wxRegion::IsEmpty() const { - wxCHECK_MSG( IsOk(), true, "Invalid region" ); + if ( IsNull() ) + return true; + + wxCHECK_MSG(IsOk(), true, "Invalid region" ); return M_REGIONDATA.isEmpty(); } void wxRegion::Clear() { - wxCHECK_RET( IsOk(), "Invalid region" ); + if ( IsNull() ) + return; + + wxCHECK_RET(IsOk(), "Invalid region" ); AllocExclusive(); M_REGIONDATA = QRegion(); @@ -171,6 +177,15 @@ bool wxRegion::DoIsEqual(const wxRegion& region) const bool wxRegion::DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const { + if ( m_refData == NULL ) + { + x = + y = + w = + h = 0; + return false; + } + wxCHECK_MSG( IsOk(), false, "Invalid region" ); QRect bounding = M_REGIONDATA.boundingRect(); From c28a8c9e7e3eb0b350d211eac84ae7760a8dbb34 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 23:28:18 +0100 Subject: [PATCH 328/553] Implement wxRegion operations in terms of DoCombine() --- include/wx/qt/region.h | 2 + src/qt/region.cpp | 94 ++++++++++++++++++++++++++++++++---------- 2 files changed, 75 insertions(+), 21 deletions(-) diff --git a/include/wx/qt/region.h b/include/wx/qt/region.h index 7bb2a56d68..d49ad45964 100644 --- a/include/wx/qt/region.h +++ b/include/wx/qt/region.h @@ -48,6 +48,8 @@ protected: virtual bool DoSubtract(const wxRegion& region); virtual bool DoXor(const wxRegion& region); + virtual bool DoCombine(const wxRegion& rgn, wxRegionOp op); + private: wxDECLARE_DYNAMIC_CLASS(wxRegion); }; diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 0dd73003b6..ec501ecdc3 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -154,6 +154,7 @@ void wxRegion::Clear() void wxRegion::QtSetRegion(QRegion region) { + AllocExclusive(); M_REGIONDATA = region; } @@ -219,47 +220,98 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y) return true; } -bool wxRegion::DoUnionWithRect(const wxRect& rect) +// combine another region with this one +bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op) { - wxCHECK_MSG( IsOk(), false, "Invalid region" ); + // we can't use the API functions if we don't have a valid region + if ( !m_refData ) + { + // combining with an empty/invalid region works differently depending + // on the operation + switch ( op ) + { + case wxRGN_COPY: + case wxRGN_OR: + case wxRGN_XOR: + *this = region; + break; - M_REGIONDATA = M_REGIONDATA.united( wxQtConvertRect( rect ) ); + default: + wxFAIL_MSG(wxT("unknown region operation")); + wxFALLTHROUGH; + + case wxRGN_AND: + case wxRGN_DIFF: + // leave empty/invalid + return false; + } + } + else // we have a valid region + { + AllocExclusive(); + + switch ( op ) + { + case wxRGN_AND: + M_REGIONDATA = M_REGIONDATA.intersected(region.GetHandle()); + break; + + case wxRGN_OR: + M_REGIONDATA = M_REGIONDATA.united(region.GetHandle()); + break; + + case wxRGN_XOR: + M_REGIONDATA = M_REGIONDATA.xored(region.GetHandle()); + break; + + case wxRGN_DIFF: + M_REGIONDATA = M_REGIONDATA.subtracted(region.GetHandle()); + break; + + default: + wxFAIL_MSG(wxT("unknown region operation")); + wxFALLTHROUGH; + + case wxRGN_COPY: + M_REGIONDATA = QRegion(region.GetHandle()); + break; + } + } return true; } bool wxRegion::DoUnionWithRegion(const wxRegion& region) { - wxCHECK_MSG( IsOk(), false, "Invalid region" ); - wxCHECK_MSG( region.IsOk(), false, "Invalid parameter region" ); - - M_REGIONDATA = M_REGIONDATA.united( region.GetHandle() ); - return true; + return DoCombine(region, wxRGN_OR); } bool wxRegion::DoIntersect(const wxRegion& region) { - wxCHECK_MSG( IsOk(), false, "Invalid region" ); - wxCHECK_MSG( region.IsOk(), false, "Invalid parameter region" ); - - M_REGIONDATA = M_REGIONDATA.intersected( region.GetHandle() ); - return true; + return DoCombine(region, wxRGN_AND); } bool wxRegion::DoSubtract(const wxRegion& region) { - wxCHECK_MSG( IsOk(), false, "Invalid region" ); - wxCHECK_MSG( region.IsOk(), false, "Invalid parameter region" ); - - M_REGIONDATA = M_REGIONDATA.subtracted( region.GetHandle() ); - return true; + return DoCombine(region, wxRGN_DIFF); } bool wxRegion::DoXor(const wxRegion& region) { + return DoCombine(region, wxRGN_XOR); +} + +bool wxRegion::DoUnionWithRect(const wxRect& rect) +{ + if ( m_refData == NULL ) + { + m_refData = new wxRegionRefData(wxQtConvertRect(rect)); + return true; + } + wxCHECK_MSG( IsOk(), false, "Invalid region" ); - wxCHECK_MSG( region.IsOk(), false, "Invalid parameter region" ); - - M_REGIONDATA = M_REGIONDATA.xored( region.GetHandle() ); + + AllocExclusive(); + M_REGIONDATA = M_REGIONDATA.united( wxQtConvertRect( rect ) ); return true; } From dddca2f5161614ee8247ea87e9d55f042465c9af Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 329/553] Unindent wxRegionRefData class body Only whitespace changes. --- src/qt/region.cpp | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/qt/region.cpp b/src/qt/region.cpp index ec501ecdc3..47db60542f 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -20,35 +20,35 @@ class wxRegionRefData: public wxGDIRefData { - public: - wxRegionRefData() - { - } +public: + wxRegionRefData() + { + } - wxRegionRefData( QRect r ) : m_qtRegion( r ) - { - } + wxRegionRefData( QRect r ) : m_qtRegion( r ) + { + } - wxRegionRefData( QBitmap b ) : m_qtRegion ( b ) - { - } + wxRegionRefData( QBitmap b ) : m_qtRegion ( b ) + { + } - wxRegionRefData( QPolygon p, Qt::FillRule fr ) : m_qtRegion( p, fr ) - { - } + wxRegionRefData( QPolygon p, Qt::FillRule fr ) : m_qtRegion( p, fr ) + { + } - wxRegionRefData( const wxRegionRefData& data ) + wxRegionRefData( const wxRegionRefData& data ) : wxGDIRefData() - { - m_qtRegion = data.m_qtRegion; - } - - bool operator == (const wxRegionRefData& data) const - { - return m_qtRegion == data.m_qtRegion; - } - - QRegion m_qtRegion; + { + m_qtRegion = data.m_qtRegion; + } + + bool operator == (const wxRegionRefData& data) const + { + return m_qtRegion == data.m_qtRegion; + } + + QRegion m_qtRegion; }; #define M_REGIONDATA ((wxRegionRefData *)m_refData)->m_qtRegion From 8412a40b903ebc62325501bb7508b3fefe747fd8 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 21 Jan 2019 12:35:55 +0000 Subject: [PATCH 330/553] Make some local variables const No real changes. --- src/qt/region.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 47db60542f..8a71b4ab3c 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -113,16 +113,16 @@ wxRegion::wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance) memset(raw.get(), 0, bmp.GetWidth()*bmp.GetHeight()); QImage img(bmp.GetHandle()->toImage()); - int r = transp.Red(), g = transp.Green(), b = transp.Blue(); + const int r = transp.Red(), g = transp.Green(), b = transp.Blue(); for(int y=0; y tolerance || abs(c.green() - g) > tolerance || abs(c.blue() - b) > tolerance) { - int ind = y*img.width()+x; + const int ind = y*img.width()+x; raw[ind>>3] |= 1<<(ind&7); } } @@ -189,7 +189,7 @@ bool wxRegion::DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const wxCHECK_MSG( IsOk(), false, "Invalid region" ); - QRect bounding = M_REGIONDATA.boundingRect(); + const QRect bounding = M_REGIONDATA.boundingRect(); x = bounding.x(); y = bounding.y(); w = bounding.width(); From 99b0efcdf27ce6e957fff1253655ed6963785be6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 23:31:39 +0100 Subject: [PATCH 331/553] Reformat a couple of for loops Only whitespace changes. --- src/qt/region.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/region.cpp b/src/qt/region.cpp index 8a71b4ab3c..44672de82b 100644 --- a/src/qt/region.cpp +++ b/src/qt/region.cpp @@ -114,9 +114,9 @@ wxRegion::wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance) QImage img(bmp.GetHandle()->toImage()); const int r = transp.Red(), g = transp.Green(), b = transp.Blue(); - for(int y=0; y tolerance || From c8f427181e548be8e3f1dee939c2152700c23f33 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 21 Jan 2019 23:43:03 +0100 Subject: [PATCH 332/553] Reuse code between wxListBox::Create() overloads Add DoCreate() helper to actually create and initialize QListWidget. --- include/wx/qt/listbox.h | 4 +++- src/qt/listbox.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/wx/qt/listbox.h b/include/wx/qt/listbox.h index 4b9c9c5ac1..19126336a3 100644 --- a/include/wx/qt/listbox.h +++ b/include/wx/qt/listbox.h @@ -90,7 +90,9 @@ protected: private: virtual void Init(); //common construction - void setStyle(long style); + // Common part of both Create() overloads. + void DoCreate(wxWindow* parent, long style); + void UnSelectAll(); wxDECLARE_DYNAMIC_CLASS(wxListBox); diff --git a/src/qt/listbox.cpp b/src/qt/listbox.cpp index 51a1457c49..504b98d689 100644 --- a/src/qt/listbox.cpp +++ b/src/qt/listbox.cpp @@ -86,11 +86,9 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - Init(); - QListWidgetItem* item; - m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this ); + DoCreate(parent, style); - setStyle(style); + QListWidgetItem* item; while ( n-- > 0 ) { @@ -114,10 +112,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - Init(); - m_qtWindow = m_qtListWidget = new wxQtListWidget( parent, this ); - - setStyle(style); + DoCreate(parent, style); QStringList items; @@ -129,8 +124,13 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, return wxListBoxBase::Create( parent, id, pos, size, style, validator, name ); } -void wxListBox::setStyle(long style) +void wxListBox::DoCreate(wxWindow* parent, long style) { + Init(); + + m_qtWindow = + m_qtListWidget = new wxQtListWidget( parent, this ); + if ( style & wxLB_SORT ) { m_qtListWidget->setSortingEnabled(true); From dd62c82d304588bbbf0fe75a955aa38915049f76 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 14:42:07 +0000 Subject: [PATCH 333/553] Remove event filter on destruction --- src/qt/evtloop.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index 2cb13ba0f6..ce99d051d0 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -82,6 +82,7 @@ wxQtEventLoopBase::wxQtEventLoopBase() wxQtEventLoopBase::~wxQtEventLoopBase() { + qApp->removeEventFilter(m_qtIdleTimer); delete m_qtIdleTimer; } From 278f4fa1d66640e6c3b61b46add30c68235646fd Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 14:48:37 +0000 Subject: [PATCH 334/553] Add wxOVERRIDE to overriden methods --- include/wx/qt/evtloop.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/wx/qt/evtloop.h b/include/wx/qt/evtloop.h index 25ea24a8dc..d8d73576da 100644 --- a/include/wx/qt/evtloop.h +++ b/include/wx/qt/evtloop.h @@ -16,13 +16,13 @@ public: wxQtEventLoopBase(); ~wxQtEventLoopBase(); - virtual int DoRun(); - virtual void ScheduleExit(int rc = 0); - virtual bool Pending() const; - virtual bool Dispatch(); - virtual int DispatchTimeout(unsigned long timeout); - virtual void WakeUp(); - virtual void DoYieldFor(long eventsToProcess); + virtual int DoRun() wxOVERRIDE; + virtual void ScheduleExit(int rc = 0) wxOVERRIDE; + virtual bool Pending() const wxOVERRIDE; + virtual bool Dispatch() wxOVERRIDE; + virtual int DispatchTimeout(unsigned long timeout) wxOVERRIDE; + virtual void WakeUp() wxOVERRIDE; + virtual void DoYieldFor(long eventsToProcess) wxOVERRIDE; #if wxUSE_EVENTLOOP_SOURCE virtual wxEventLoopSource *AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags); From 7fa7fd1bebb681e3edb76e3042b52d303eae372c Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 14:53:43 +0000 Subject: [PATCH 335/553] Don't generate idle events when the event loop is not running --- include/wx/qt/evtloop.h | 2 ++ src/qt/evtloop.cpp | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/wx/qt/evtloop.h b/include/wx/qt/evtloop.h index d8d73576da..bb725e63d8 100644 --- a/include/wx/qt/evtloop.h +++ b/include/wx/qt/evtloop.h @@ -24,6 +24,8 @@ public: virtual void WakeUp() wxOVERRIDE; virtual void DoYieldFor(long eventsToProcess) wxOVERRIDE; + void ScheduleIdleCheck(); + #if wxUSE_EVENTLOOP_SOURCE virtual wxEventLoopSource *AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags); #endif // wxUSE_EVENTLOOP_SOURCE diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index ce99d051d0..3a6bd2e6b7 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -40,14 +40,13 @@ wxQtIdleTimer::wxQtIdleTimer( wxQtEventLoopBase *eventLoop ) connect( this, &QTimer::timeout, this, &wxQtIdleTimer::idle ); setSingleShot( true ); - start( 0 ); } bool wxQtIdleTimer::eventFilter( QObject *WXUNUSED( watched ), QEvent *WXUNUSED( event ) ) { // Called for each Qt event, start with timeout 0 (run as soon as idle) if ( !isActive() ) - start( 0 ); + m_eventLoop->ScheduleIdleCheck(); return false; // Continue handling the event } @@ -60,7 +59,7 @@ void wxQtIdleTimer::idle() // Send idle event if ( m_eventLoop->ProcessIdle() ) - start( 0 ); + m_eventLoop->ScheduleIdleCheck(); } wxQtEventLoopBase::wxQtEventLoopBase() @@ -147,6 +146,12 @@ void wxQtEventLoopBase::DoYieldFor(long eventsToProcess) wxEventLoopBase::DoYieldFor(eventsToProcess); } +void wxQtEventLoopBase::ScheduleIdleCheck() +{ + if ( IsInsideRun() ) + m_qtIdleTimer->start(0); +} + #if wxUSE_EVENTLOOP_SOURCE template From 8a73f652851178cb99ecc9d9bcdf6b226f9f7033 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 21 Jan 2019 16:11:28 +0000 Subject: [PATCH 336/553] Use QEventLoop to implement wxEventLoop for wxQT --- include/wx/qt/evtloop.h | 2 ++ src/qt/evtloop.cpp | 32 ++++++++++++-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/include/wx/qt/evtloop.h b/include/wx/qt/evtloop.h index bb725e63d8..dbdbd6a5a0 100644 --- a/include/wx/qt/evtloop.h +++ b/include/wx/qt/evtloop.h @@ -9,6 +9,7 @@ #define _WX_QT_EVTLOOP_H_ class QTimer; +class QEventLoop; class WXDLLIMPEXP_CORE wxQtEventLoopBase : public wxEventLoopBase { @@ -32,6 +33,7 @@ public: protected: private: + QEventLoop *m_qtEventLoop; QTimer *m_qtIdleTimer; wxDECLARE_NO_COPY_CLASS(wxQtEventLoopBase); diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index 3a6bd2e6b7..132d6533c2 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -56,7 +57,7 @@ void wxQtIdleTimer::idle() // Process pending events if ( wxTheApp ) wxTheApp->ProcessPendingEvents(); - + // Send idle event if ( m_eventLoop->ProcessIdle() ) m_eventLoop->ScheduleIdleCheck(); @@ -77,11 +78,15 @@ wxQtEventLoopBase::wxQtEventLoopBase() // Pass all events to the idle timer, so it can be restarted each time // an event is received qApp->installEventFilter( m_qtIdleTimer ); + + + m_qtEventLoop = new QEventLoop; } wxQtEventLoopBase::~wxQtEventLoopBase() { qApp->removeEventFilter(m_qtIdleTimer); + delete m_qtEventLoop; delete m_qtIdleTimer; } @@ -89,44 +94,31 @@ void wxQtEventLoopBase::ScheduleExit(int rc) { wxCHECK_RET( IsInsideRun(), wxT("can't call ScheduleExit() if not started") ); m_shouldExit = true; - QCoreApplication::exit( rc ); + m_qtEventLoop->exit(rc); } int wxQtEventLoopBase::DoRun() { - int ret; - - // This is placed inside of a loop to take into account nested event loops - while ( !m_shouldExit ) - { - // This will print Qt warnins if app already started: - // "QCoreApplication::exec: The event loop is already running" - // TODO: check the loopLevel (nested) like in wxGTK - ret = QCoreApplication::exec(); - // process pending events (if exec was started previously) - // TODO: use a real new QEventLoop() ? - QCoreApplication::processEvents(); - } + const int ret = m_qtEventLoop->exec(); OnExit(); return ret; } bool wxQtEventLoopBase::Pending() const { - return QCoreApplication::hasPendingEvents(); + QAbstractEventDispatcher *instance = QAbstractEventDispatcher::instance(); + return instance->hasPendingEvents(); } bool wxQtEventLoopBase::Dispatch() { - QCoreApplication::processEvents(); - + m_qtEventLoop->processEvents(); return true; } int wxQtEventLoopBase::DispatchTimeout(unsigned long timeout) { - QCoreApplication::processEvents( QEventLoop::AllEvents, timeout ); - + m_qtEventLoop->processEvents(QEventLoop::AllEvents, timeout); return true; } From 31c2bd7aa3c00876474834423c02fcb26956ed67 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Tue, 22 Jan 2019 11:06:30 +0000 Subject: [PATCH 337/553] Add default parameter to wxDialog::Show() in wxQt Closes https://github.com/wxWidgets/wxWidgets/pull/1164 --- include/wx/qt/dialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/qt/dialog.h b/include/wx/qt/dialog.h index 8bd995d906..288e1b3ed2 100644 --- a/include/wx/qt/dialog.h +++ b/include/wx/qt/dialog.h @@ -34,7 +34,7 @@ public: virtual int ShowModal() wxOVERRIDE; virtual void EndModal(int retCode) wxOVERRIDE; virtual bool IsModal() const wxOVERRIDE; - virtual bool Show(bool show) wxOVERRIDE; + virtual bool Show(bool show = true) wxOVERRIDE; QDialog *GetDialogHandle() const; From c2270f8a833276df72590bc26369509c513f9129 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Tue, 22 Jan 2019 08:27:27 +0000 Subject: [PATCH 338/553] Don't generate events in wxChoice::SetSelection() under wxQt This makes it consistent with the other ports and makes the corresponding unit test pass. Closes https://github.com/wxWidgets/wxWidgets/pull/1163 --- src/qt/choice.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/choice.cpp b/src/qt/choice.cpp index 491398b718..da605c67ba 100644 --- a/src/qt/choice.cpp +++ b/src/qt/choice.cpp @@ -170,7 +170,9 @@ void wxChoice::SetString(unsigned int n, const wxString& s) void wxChoice::SetSelection(int n) { + m_qtComboBox->blockSignals(true); m_qtComboBox->setCurrentIndex(n); + m_qtComboBox->blockSignals(false); } int wxChoice::GetSelection() const From 5d40d57218e585fa61e286e80371d37cac95d4cc Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 22 Jan 2019 23:43:51 +0100 Subject: [PATCH 339/553] Don't process last HDN_ITEMCHANGING notification Just skipping last HDN_ITEMCHANGING arriving after HDN_ENDTRACK (to prevent emitting EVT_HEADER_RESIZING) when current column width is less than minimal value allowed is not enough because this notification will be handled by the native control in a standard way causing column width to resize below the limit. When current width is below the limit this last HDN_ITEMCHANGING notification has to be explicitly "vetoed" to prevent default handling from happening. Close #18335. --- src/msw/headerctrl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index 966f6b04e5..db539f43ed 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -747,7 +747,7 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // HDN_ITEMCHANGED // In both cases last HDN_ITEMCHANGING notification is sent // after HDN_ENDTRACK so we have to skip it. - if ( nmhdr->pitem && (nmhdr->pitem->mask & HDI_WIDTH) && m_isColBeingResized ) + if ( nmhdr->pitem && (nmhdr->pitem->mask & HDI_WIDTH) ) { // prevent the column from being shrunk beneath its min width width = nmhdr->pitem->cxy; @@ -757,13 +757,19 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // happening veto = true; } - else // width is acceptable + // width is acceptable and notification arrived before HDN_ENDTRACK + else if ( m_isColBeingResized ) { // generate the resizing event from here as we don't seem // to be getting HDN_TRACK events at all, at least with // comctl32.dll v6 evtType = wxEVT_HEADER_RESIZING; } + // else + // Nnotification arriving after HDN_ENDTRACK is handled normally + // by the control but EVT_HEADER_RESIZING event cannot be generated + // because EVT_HEADER_END_RESIZE finalizing the resizing has been + // already emitted. } break; From b8f71efc04c10ca3fffda676aaa4c8556cd4a484 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 23 Jan 2019 11:55:56 +0000 Subject: [PATCH 340/553] Implement filtering in wxEventLoop::DoYieldFor under wxQT --- src/qt/evtloop.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index 132d6533c2..d15ec1ed10 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -131,10 +131,17 @@ void wxQtEventLoopBase::WakeUp() void wxQtEventLoopBase::DoYieldFor(long eventsToProcess) { - while (wxTheApp && wxTheApp->Pending()) - // TODO: implement event filtering using the eventsToProcess mask - wxTheApp->Dispatch(); + QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents; + + if ( !(eventsToProcess & wxEVT_CATEGORY_USER_INPUT) ) + flags |= QEventLoop::ExcludeUserInputEvents; + + if ( !(eventsToProcess & wxEVT_CATEGORY_SOCKET) ) + flags |= QEventLoop::ExcludeSocketNotifiers; + + m_qtEventLoop->processEvents(flags); + wxEventLoopBase::DoYieldFor(eventsToProcess); } From 0c28952ff63bd106b56e9f005171ea46aff46011 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 23 Jan 2019 12:04:42 +0000 Subject: [PATCH 341/553] Make ScheduleIdleCheck take into account whether the loop is exiting --- src/qt/evtloop.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index d15ec1ed10..4b7339e012 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -141,13 +141,13 @@ void wxQtEventLoopBase::DoYieldFor(long eventsToProcess) flags |= QEventLoop::ExcludeSocketNotifiers; m_qtEventLoop->processEvents(flags); - + wxEventLoopBase::DoYieldFor(eventsToProcess); } void wxQtEventLoopBase::ScheduleIdleCheck() { - if ( IsInsideRun() ) + if ( IsInsideRun() && !m_shouldExit ) m_qtIdleTimer->start(0); } From 6aecaa88452ee132b388088b301c1bc2f2feb06f Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 23 Jan 2019 13:55:20 +0000 Subject: [PATCH 342/553] Share a single idle timer for all event loops in wxQT --- src/qt/evtloop.cpp | 79 ++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index 4b7339e012..71ae83707a 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -21,33 +21,48 @@ #include -class wxQtIdleTimer : public QTimer +class wxQtIdleTimer : public QTimer, public wxRefCounter { public: - wxQtIdleTimer( wxQtEventLoopBase *eventLoop ); + wxQtIdleTimer(); + ~wxQtIdleTimer(); virtual bool eventFilter( QObject * watched, QEvent * event ); private: void idle(); - -private: - wxQtEventLoopBase *m_eventLoop; + void ScheduleIdleCheck(); }; -wxQtIdleTimer::wxQtIdleTimer( wxQtEventLoopBase *eventLoop ) +wxQtIdleTimer::wxQtIdleTimer() { - m_eventLoop = eventLoop; + // We need a QCoreApplication for event loops, create it here if it doesn't + // already exist as we can't modify wxAppConsole + if ( !QCoreApplication::instance() ) + { + new QApplication(wxAppConsole::GetInstance()->argc, wxAppConsole::GetInstance()->argv); + } - connect( this, &QTimer::timeout, this, &wxQtIdleTimer::idle ); - setSingleShot( true ); + + // Pass all events to the idle timer, so it can be restarted each time + // an event is received + qApp->installEventFilter(this); + + connect(this, &QTimer::timeout, this, &wxQtIdleTimer::idle); + setSingleShot(true); +} + + +wxQtIdleTimer::~wxQtIdleTimer() +{ + qApp->removeEventFilter(this); } bool wxQtIdleTimer::eventFilter( QObject *WXUNUSED( watched ), QEvent *WXUNUSED( event ) ) { // Called for each Qt event, start with timeout 0 (run as soon as idle) if ( !isActive() ) - m_eventLoop->ScheduleIdleCheck(); + ScheduleIdleCheck(); return false; // Continue handling the event } @@ -59,35 +74,45 @@ void wxQtIdleTimer::idle() wxTheApp->ProcessPendingEvents(); // Send idle event - if ( m_eventLoop->ProcessIdle() ) - m_eventLoop->ScheduleIdleCheck(); + if (wxTheApp->ProcessIdle()) + ScheduleIdleCheck(); +} + + +namespace +{ + wxQtIdleTimer *gs_idleTimer = NULL; +} + +void wxQtIdleTimer::ScheduleIdleCheck() +{ + wxQtEventLoopBase *eventLoop = static_cast(wxEventLoop::GetActive()); + if ( eventLoop ) + eventLoop->ScheduleIdleCheck(); } wxQtEventLoopBase::wxQtEventLoopBase() { - // We need a QCoreApplication for event loops, create it here if it doesn't - // already exist as we can't modify wxAppConsole - if ( !QCoreApplication::instance() ) - { - new QApplication( wxAppConsole::GetInstance()->argc, wxAppConsole::GetInstance()->argv ); - } - // Create an idle timer to run each time there are no events (timeout = 0) - m_qtIdleTimer = new wxQtIdleTimer( this ); - - // Pass all events to the idle timer, so it can be restarted each time - // an event is received - qApp->installEventFilter( m_qtIdleTimer ); - + if ( !gs_idleTimer ) + { + gs_idleTimer = new wxQtIdleTimer(); + } + else + { + gs_idleTimer->IncRef(); + } + m_qtIdleTimer = gs_idleTimer; m_qtEventLoop = new QEventLoop; } wxQtEventLoopBase::~wxQtEventLoopBase() { - qApp->removeEventFilter(m_qtIdleTimer); + if ( gs_idleTimer->GetRefCount() <= 1 ) + gs_idleTimer = NULL; + delete m_qtEventLoop; - delete m_qtIdleTimer; } void wxQtEventLoopBase::ScheduleExit(int rc) From 7cfb5b91a55e5700a048b5e060084eb8ff3b3797 Mon Sep 17 00:00:00 2001 From: phowstan <46815312+phowstan@users.noreply.github.com> Date: Wed, 23 Jan 2019 10:43:57 +0000 Subject: [PATCH 343/553] Implement wxStaticBox::Set/GetLabel() in wxQt Closes https://github.com/wxWidgets/wxWidgets/pull/1167 --- include/wx/qt/statbox.h | 3 +++ src/qt/statbox.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/wx/qt/statbox.h b/include/wx/qt/statbox.h index 186146b242..e116c57787 100644 --- a/include/wx/qt/statbox.h +++ b/include/wx/qt/statbox.h @@ -33,6 +33,9 @@ public: virtual QWidget *GetHandle() const; + virtual void SetLabel(const wxString& label) wxOVERRIDE; + virtual wxString GetLabel() const wxOVERRIDE; + protected: private: diff --git a/src/qt/statbox.cpp b/src/qt/statbox.cpp index cfa585caa0..9efdecb32a 100644 --- a/src/qt/statbox.cpp +++ b/src/qt/statbox.cpp @@ -56,6 +56,16 @@ QWidget *wxStaticBox::GetHandle() const return m_qtGroupBox; } +void wxStaticBox::SetLabel(const wxString& label) +{ + m_qtGroupBox->setTitle(wxQtConvertString(label)); +} + +wxString wxStaticBox::GetLabel() const +{ + return wxQtConvertString(m_qtGroupBox->title()); +} + void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const { wxStaticBoxBase::GetBordersForSizer(borderTop, borderOther); From adee46d155a581076879345cdca75871c8b7906f Mon Sep 17 00:00:00 2001 From: Matthew Griffin <45285214+matthew-griffin@users.noreply.github.com> Date: Wed, 23 Jan 2019 11:04:31 +0000 Subject: [PATCH 344/553] Send event when wxSpinCtrlDouble value changes in wxQt Closes https://github.com/wxWidgets/wxWidgets/pull/1168 --- src/qt/spinctrl.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index a782d30906..5ea0ff9787 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -162,9 +162,25 @@ class wxQtDoubleSpinBox : public wxQtSpinBoxBase< QDoubleSpinBox > public: wxQtDoubleSpinBox( wxWindow *parent, wxControl *handler ) : wxQtSpinBoxBase< QDoubleSpinBox >( parent, handler ) - { } + { + connect(this, static_cast(&QDoubleSpinBox::valueChanged), + this, &wxQtDoubleSpinBox::valueChanged); + } +private: + void valueChanged(double value); }; +void wxQtDoubleSpinBox::valueChanged(double value) +{ + wxControl *handler = GetHandler(); + if ( handler ) + { + wxSpinDoubleEvent event( wxEVT_SPINCTRLDOUBLE, handler->GetId() ); + event.SetValue(value); + EmitEvent( event ); + } +} + //############################################################################## From 6b3a0cc460c56ab04d87945cf2b5e4d02cb62406 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 Jan 2019 16:45:21 +0100 Subject: [PATCH 345/553] Make wxQtSpinBoxBase-derived valueChanged() methods inline It seems better to have them in the class itself, near the connect() call binding them. This also resolves an inconsistency between wxQtSpinBox::valueChanged(), which was defined elsewhere in the source file, and the same method of wxQtDoubleSpinBox, which was defined directly after the class declaration. See https://github.com/wxWidgets/wxWidgets/pull/1168 --- src/qt/spinctrl.cpp | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index 5ea0ff9787..12ade77421 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -154,7 +154,16 @@ public: this, &wxQtSpinBox::valueChanged); } private: - void valueChanged(int value); + void valueChanged(int value) + { + wxControl *handler = GetHandler(); + if ( handler ) + { + wxSpinEvent event( wxEVT_SPINCTRL, handler->GetId() ); + event.SetInt( value ); + EmitEvent( event ); + } + } }; class wxQtDoubleSpinBox : public wxQtSpinBoxBase< QDoubleSpinBox > @@ -167,19 +176,17 @@ public: this, &wxQtDoubleSpinBox::valueChanged); } private: - void valueChanged(double value); -}; - -void wxQtDoubleSpinBox::valueChanged(double value) -{ - wxControl *handler = GetHandler(); - if ( handler ) + void valueChanged(double value) { - wxSpinDoubleEvent event( wxEVT_SPINCTRLDOUBLE, handler->GetId() ); - event.SetValue(value); - EmitEvent( event ); + wxControl *handler = GetHandler(); + if ( handler ) + { + wxSpinDoubleEvent event( wxEVT_SPINCTRLDOUBLE, handler->GetId() ); + event.SetValue(value); + EmitEvent( event ); + } } -} +}; //############################################################################## @@ -236,17 +243,6 @@ void wxSpinCtrl::SetValue( const wxString &value ) qtSpinBox->setValue( qtSpinBox->valueFromText( wxQtConvertString( value ))); } -void wxQtSpinBox::valueChanged(int value) -{ - wxControl *handler = GetHandler(); - if ( handler ) - { - wxSpinEvent event( wxEVT_SPINCTRL, handler->GetId() ); - event.SetInt( value ); - EmitEvent( event ); - } -} - //############################################################################## template class wxSpinCtrlQt< double, QDoubleSpinBox >; From 9c16a3748e83472351bdf25dd7b579e843fca248 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 Jan 2019 16:47:05 +0100 Subject: [PATCH 346/553] Declare variable only needed inside an "if" inside it No real changes, just make the code slightly more concise. --- src/qt/spinctrl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qt/spinctrl.cpp b/src/qt/spinctrl.cpp index 12ade77421..0bcf9db56e 100644 --- a/src/qt/spinctrl.cpp +++ b/src/qt/spinctrl.cpp @@ -156,8 +156,7 @@ public: private: void valueChanged(int value) { - wxControl *handler = GetHandler(); - if ( handler ) + if ( wxControl *handler = GetHandler() ) { wxSpinEvent event( wxEVT_SPINCTRL, handler->GetId() ); event.SetInt( value ); @@ -178,8 +177,7 @@ public: private: void valueChanged(double value) { - wxControl *handler = GetHandler(); - if ( handler ) + if ( wxControl *handler = GetHandler() ) { wxSpinDoubleEvent event( wxEVT_SPINCTRLDOUBLE, handler->GetId() ); event.SetValue(value); From 537b2c3bb0170853877b3f1fb350347df2b57332 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 23 Jan 2019 13:08:30 +0000 Subject: [PATCH 347/553] Reinstate wxTextCtrl unit test previously disabled for wxQt This test was fixed by earlier changes to wxQt font styles and passes now. Closes https://github.com/wxWidgets/wxWidgets/pull/1169 --- tests/controls/textctrltest.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 10b2795f37..6972b6b1c6 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -496,7 +496,6 @@ void TextCtrlTestCase::Style() void TextCtrlTestCase::FontStyle() { -#if !defined(__WXQT__) // We need wxTE_RICH under MSW and wxTE_MULTILINE under GTK for style // support so recreate the control with these styles. delete m_text; @@ -547,9 +546,6 @@ void TextCtrlTestCase::FontStyle() fontOut.SetEncoding(fontIn.GetEncoding()); #endif CPPUNIT_ASSERT_EQUAL( fontIn, fontOut ); -#else - WARN("Does not work under WxQt"); -#endif } void TextCtrlTestCase::Lines() From b0660cc87c46f28a6aa542541ad73d5846fced5f Mon Sep 17 00:00:00 2001 From: Dummy Date: Wed, 23 Jan 2019 20:08:57 +0100 Subject: [PATCH 348/553] Pass argument of proper type to wxPropertyGridInterface::SetPropertyBackgroundColour The last argument passed to this function should be an int flag not a Boolean value. Boolean value 'true' passed here is converted to int 1 so wxPG_RECURSE flag is never set and the background colour is never changed for sub-properties. Closes #18333. --- samples/propgrid/propgrid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 134c43cd88..db343f3a21 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -2575,8 +2575,8 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event ) if ( col.IsOk() ) { - bool recursively = (event.GetId()==ID_SETBGCOLOURRECUR) ? true : false; - pg->SetPropertyBackgroundColour(prop, col, recursively); + int flags = (event.GetId()==ID_SETBGCOLOURRECUR) ? wxPG_RECURSE : 0; + pg->SetPropertyBackgroundColour(prop, col, flags); } } From 9cd566789df0ea3c4f8b89652cddb1d0de433686 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Thu, 24 Jan 2019 08:08:12 +0000 Subject: [PATCH 349/553] Added file missing from previous commit --- include/wx/qt/evtloop.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/wx/qt/evtloop.h b/include/wx/qt/evtloop.h index dbdbd6a5a0..5419916281 100644 --- a/include/wx/qt/evtloop.h +++ b/include/wx/qt/evtloop.h @@ -8,7 +8,7 @@ #ifndef _WX_QT_EVTLOOP_H_ #define _WX_QT_EVTLOOP_H_ -class QTimer; +class wxQtIdleTimer; class QEventLoop; class WXDLLIMPEXP_CORE wxQtEventLoopBase : public wxEventLoopBase @@ -30,12 +30,11 @@ public: #if wxUSE_EVENTLOOP_SOURCE virtual wxEventLoopSource *AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags); #endif // wxUSE_EVENTLOOP_SOURCE -protected: private: QEventLoop *m_qtEventLoop; - QTimer *m_qtIdleTimer; - + wxObjectDataPtr m_qtIdleTimer; + wxDECLARE_NO_COPY_CLASS(wxQtEventLoopBase); }; From 42c602bddf249e4f4ffa38d52156616980c666da Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 24 Jan 2019 00:07:45 +0100 Subject: [PATCH 350/553] CMake: test installation with Travis CI With wx-config working, test installing and building the minimal sample with Travis CI. Closes https://github.com/wxWidgets/wxWidgets/pull/1172 --- build/tools/travis-ci.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build/tools/travis-ci.sh b/build/tools/travis-ci.sh index 2eb544ff69..244b2796c8 100755 --- a/build/tools/travis-ci.sh +++ b/build/tools/travis-ci.sh @@ -32,6 +32,10 @@ case $wxTOOLSET in ctest -V -C Debug -R "test_base" --output-on-failure --interactive-debug-mode 0 . echo 'travis_fold:end:testing' fi + echo 'Installing...' && echo -en 'travis_fold:start:script.install\\r' + sudo env "PATH=$PATH" cmake --build . --target install + echo -en 'travis_fold:end:script.install\\r' + popd ;; *) echo 'Configuring...' && echo -en 'travis_fold:start:script.configure\\r' @@ -52,9 +56,10 @@ case $wxTOOLSET in echo 'Installing...' && echo -en 'travis_fold:start:script.install\\r' sudo make install echo -en 'travis_fold:end:script.install\\r' - echo 'Testing installation...' && echo -en 'travis_fold:start:script.testinstall\\r' - make -C samples/minimal -f makefile.unx clean - make -C samples/minimal -f makefile.unx $wxMAKEFILE_FLAGS - echo -en 'travis_fold:end:script.testinstall\\r' ;; esac + +echo 'Testing installation...' && echo -en 'travis_fold:start:script.testinstall\\r' +make -C samples/minimal -f makefile.unx clean +make -C samples/minimal -f makefile.unx $wxMAKEFILE_FLAGS +echo -en 'travis_fold:end:script.testinstall\\r' From 83f23cec89a2b0e1c00bd45d0e81f559d1f12221 Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 24 Jan 2019 14:31:17 +0000 Subject: [PATCH 351/553] Added virtual and override specifiers to derived method in ListCtrl --- include/wx/qt/listctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/qt/listctrl.h b/include/wx/qt/listctrl.h index 17637de752..4cee40bb52 100644 --- a/include/wx/qt/listctrl.h +++ b/include/wx/qt/listctrl.h @@ -292,7 +292,7 @@ protected: void Init(); // Implement base class pure virtual methods. - long DoInsertColumn(long col, const wxListItem& info); + virtual long DoInsertColumn(long col, const wxListItem& info) wxOVERRIDE; QTreeWidgetItem *QtGetItem(int id) const; From ca0025145443be705133d6c9fbb55943ae74acbb Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 24 Jan 2019 14:35:47 +0000 Subject: [PATCH 352/553] Fix in wxListCtrl::FindItem. Every item is now iterated through, rather than only the first --- src/qt/listctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 556021c003..58be4de5ed 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -762,7 +762,7 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial) !partial ? Qt::MatchExactly : Qt::MatchContains ); for (int i=0; iindexOfTopLevelItem(qitems.at(0)); + ret = m_qtTreeWidget->indexOfTopLevelItem(qitems.at(i)); if ( ret >= start ) return ret; } From f9280c8529326d3e90fe158bb4f28bba950812cc Mon Sep 17 00:00:00 2001 From: Liam Treacy Date: Thu, 24 Jan 2019 14:38:38 +0000 Subject: [PATCH 353/553] Now use the column index to retrieve the correct text in GetItemText --- src/qt/listctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/listctrl.cpp b/src/qt/listctrl.cpp index 58be4de5ed..65acc4f937 100644 --- a/src/qt/listctrl.cpp +++ b/src/qt/listctrl.cpp @@ -413,11 +413,11 @@ bool wxListCtrl::SetItemColumnImage(long item, long column, int image) return SetItem(info); } -wxString wxListCtrl::GetItemText(long item, int WXUNUSED(col)) const +wxString wxListCtrl::GetItemText(long item, int col) const { QTreeWidgetItem *qitem = QtGetItem(item); if ( qitem ) - return wxQtConvertString( qitem->text(0) ); + return wxQtConvertString( qitem->text(col) ); else return wxString(); } From 515031cf6bb946b50c72e0318a5421c4e006fe3c Mon Sep 17 00:00:00 2001 From: ali kettab Date: Thu, 24 Jan 2019 21:41:54 +0100 Subject: [PATCH 354/553] Set event object for wxKeyEvents generated in wxQt Not setting the event object broke the code expecting it to be set, notably in our own validators code. Closes https://github.com/wxWidgets/wxWidgets/pull/1176 --- src/qt/window.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 7b99923708..9830fced5f 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -1225,6 +1225,7 @@ bool wxWindowQt::QtHandleKeyEvent ( QWidget *WXUNUSED( handler ), QKeyEvent *eve // Build the event wxKeyEvent e( event->type() == QEvent::KeyPress ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ); + e.SetEventObject(this); // TODO: m_x, m_y e.m_keyCode = wxQtConvertKeyCode( event->key(), event->modifiers() ); @@ -1267,6 +1268,7 @@ bool wxWindowQt::QtHandleKeyEvent ( QWidget *WXUNUSED( handler ), QKeyEvent *eve #endif // wxUSE_ACCEL e.SetEventType( wxEVT_CHAR ); + e.SetEventObject(this); // Translated key code (including control + letter -> 1-26) int translated = 0; From 7c831d25ee23591c9693a31c14391a91c6e16d01 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 24 Jan 2019 22:51:06 +0100 Subject: [PATCH 355/553] Group headers together in wxTextCtrl unit test No real changes. --- tests/controls/textctrltest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index 6972b6b1c6..cf41caef52 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -24,11 +24,11 @@ #endif // WX_PRECOMP #include "wx/scopeguard.h" +#include "wx/uiaction.h" #include "textentrytest.h" #include "testableframe.h" #include "asserthelper.h" -#include "wx/uiaction.h" static const int TEXT_HEIGHT = 200; From f4ea128007bfba6365158a2e6eaca9c81f627c5a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 24 Jan 2019 22:51:43 +0100 Subject: [PATCH 356/553] Include wx/stopwatch.h explicitly from wxTextCtrl unit test Don't rely on it being implicitly included from another header when we use wxStopWatch in this file (with wxGTK only). --- tests/controls/textctrltest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index cf41caef52..75fb647c48 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -26,6 +26,10 @@ #include "wx/scopeguard.h" #include "wx/uiaction.h" +#ifdef __WXGTK__ + #include "wx/stopwatch.h" +#endif + #include "textentrytest.h" #include "testableframe.h" #include "asserthelper.h" From 5811d541dab5362fd74d5e91f05b6a39305bbd61 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 24 Jan 2019 14:04:10 +0100 Subject: [PATCH 357/553] Refactor code waiting for events in the test suite We already had WX_ASSERT_EVENT_OCCURS_IN macro and a recent commit also added code doing almost the same thing manually in wxTopLevelWindow unit test, which was one version too many. Replace both of them with the new EventCounter::WaitEvent(). No real changes, this is just a refactoring. --- tests/controls/webtest.cpp | 2 +- tests/controls/windowtest.cpp | 2 +- tests/testableframe.cpp | 23 +++++++++++++++++++++++ tests/testableframe.h | 7 +++++++ tests/testprec.h | 22 ---------------------- tests/toplevel/toplevel.cpp | 16 +--------------- 6 files changed, 33 insertions(+), 39 deletions(-) diff --git a/tests/controls/webtest.cpp b/tests/controls/webtest.cpp index 93ed8344a6..5c58ab1624 100644 --- a/tests/controls/webtest.cpp +++ b/tests/controls/webtest.cpp @@ -72,7 +72,7 @@ private: }; //Convenience macro -#define ENSURE_LOADED WX_ASSERT_EVENT_OCCURS_IN((*m_loaded), 1, 1000) +#define ENSURE_LOADED CHECK( m_loaded->WaitEvent() ) // register in the unnamed registry so that these tests are run by default CPPUNIT_TEST_SUITE_REGISTRATION( WebTestCase ); diff --git a/tests/controls/windowtest.cpp b/tests/controls/windowtest.cpp index bf34e19fde..02541ef08f 100644 --- a/tests/controls/windowtest.cpp +++ b/tests/controls/windowtest.cpp @@ -152,7 +152,7 @@ void WindowTestCase::FocusEvent() m_window->SetFocus(); - WX_ASSERT_EVENT_OCCURS_IN(setfocus, 1, 500); + CPPUNIT_ASSERT(setfocus.WaitEvent(500)); CPPUNIT_ASSERT(m_window->HasFocus()); wxButton* button = new wxButton(wxTheApp->GetTopWindow(), wxID_ANY); diff --git a/tests/testableframe.cpp b/tests/testableframe.cpp index dc535a1f43..7ff54696f3 100644 --- a/tests/testableframe.cpp +++ b/tests/testableframe.cpp @@ -63,3 +63,26 @@ EventCounter::~EventCounter() m_frame = NULL; m_win = NULL; } + +bool EventCounter::WaitEvent(int timeInMs) +{ + static const int SINGLE_WAIT_DURATION = 50; + + for ( int i = 0; i < timeInMs / SINGLE_WAIT_DURATION; ++i ) + { + wxYield(); + + const int count = GetCount(); + if ( count ) + { + CHECK( count == 1 ); + + Clear(); + return true; + } + + wxMilliSleep(SINGLE_WAIT_DURATION); + } + + return false; +} diff --git a/tests/testableframe.h b/tests/testableframe.h index a0465d8296..515e908800 100644 --- a/tests/testableframe.h +++ b/tests/testableframe.h @@ -35,6 +35,13 @@ public: int GetCount() { return m_frame->GetEventCount(m_type); } void Clear() { m_frame->ClearEventCount(m_type); } + // Sometimes we need to yield a few times before getting the event we + // expect, so provide a function waiting for the expected event for up to + // the given number of milliseconds (supposed to be divisible by 50). + // + // Return true if we did receive the event or false otherwise. + bool WaitEvent(int timeInMs = 1000); + private: wxEventType m_type; wxTestableFrame* m_frame; diff --git a/tests/testprec.h b/tests/testprec.h index d0bdb41aae..9d6a6bb34a 100644 --- a/tests/testprec.h +++ b/tests/testprec.h @@ -2,7 +2,6 @@ #define WX_TESTPREC_INCLUDED 1 #include "wx/wxprec.h" -#include "wx/stopwatch.h" #include "wx/evtloop.h" // This needs to be included before catch.hpp to be taken into account. @@ -108,27 +107,6 @@ public: #define WX_ASSERT_FAILS_WITH_ASSERT(cond) #endif -#define WX_ASSERT_EVENT_OCCURS_IN(eventcounter, count, ms) \ -{\ - wxStopWatch sw; \ - wxEventLoopBase* loop = wxEventLoopBase::GetActive(); \ - while(eventcounter.GetCount() < count) \ - { \ - if(sw.Time() < ms) \ - loop->Dispatch(); \ - else \ - { \ - CPPUNIT_FAIL(wxString::Format("timeout reached with %d " \ - "events received, %d expected", \ - eventcounter.GetCount(), count).ToStdString()); \ - break; \ - } \ - } \ - eventcounter.Clear(); \ -} - -#define WX_ASSERT_EVENT_OCCURS(eventcounter,count) WX_ASSERT_EVENT_OCCURS_IN(eventcounter, count, 100) - // these functions can be used to hook into wxApp event processing and are // currently used by the events propagation test class WXDLLIMPEXP_FWD_BASE wxEvent; diff --git a/tests/toplevel/toplevel.cpp b/tests/toplevel/toplevel.cpp index 6cd816eaf4..3e94f12c8d 100644 --- a/tests/toplevel/toplevel.cpp +++ b/tests/toplevel/toplevel.cpp @@ -88,19 +88,5 @@ TEST_CASE("wxTopLevel::ShowEvent", "[tlw][show][event]") frame->Maximize(); frame->Show(); - // Wait for the event to be received for the maximum of 2 seconds. - int showCount = 0; - for ( int i = 0; i < 40; i++ ) - { - wxYield(); - - showCount = countShow.GetCount(); - - if ( showCount ) - break; - - wxMilliSleep(50); - } - - CHECK( showCount == 1 ); + CHECK( countShow.WaitEvent() ); } From 3c369af2e6d3e0c5a0777c59cd2693d11c4a4c3b Mon Sep 17 00:00:00 2001 From: ali kettab Date: Fri, 25 Jan 2019 01:27:57 +0100 Subject: [PATCH 358/553] Translate QFocusEvent to wxFocusEvent correctly Set the ID, object and the associated window. Closes https://github.com/wxWidgets/wxWidgets/pull/1177 --- src/qt/window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 9830fced5f..050cb37a8d 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -1480,7 +1480,9 @@ bool wxWindowQt::QtHandleContextMenuEvent ( QWidget *WXUNUSED( handler ), QConte bool wxWindowQt::QtHandleFocusEvent ( QWidget *WXUNUSED( handler ), QFocusEvent *event ) { - wxFocusEvent e( event->gotFocus() ? wxEVT_SET_FOCUS : wxEVT_KILL_FOCUS ); + wxFocusEvent e( event->gotFocus() ? wxEVT_SET_FOCUS : wxEVT_KILL_FOCUS, GetId() ); + e.SetEventObject(this); + e.SetWindow(event->gotFocus() ? this : FindFocus()); bool handled = ProcessWindowEvent( e ); From 84fc5c17140b4fcb893350a1c20328932bca5bbc Mon Sep 17 00:00:00 2001 From: ali kettab Date: Thu, 24 Jan 2019 15:54:32 +0100 Subject: [PATCH 359/553] Fix changing tooltip via wxToolTip::SetTip() in wxQt Update the actual tool tip used by Qt and not just the internal variable when SetTip() is called. Also implement wxToolTip::SetWindow(). Closes https://github.com/wxWidgets/wxWidgets/pull/1175 --- include/wx/qt/tooltip.h | 3 ++- include/wx/qt/window.h | 5 +++++ src/qt/tooltip.cpp | 9 +++++++-- src/qt/window.cpp | 14 +++++++++++--- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/include/wx/qt/tooltip.h b/include/wx/qt/tooltip.h index 1f52f5b3b9..12b3d35ea0 100644 --- a/include/wx/qt/tooltip.h +++ b/include/wx/qt/tooltip.h @@ -10,7 +10,8 @@ #include "wx/object.h" -class wxWindow; +class WXDLLIMPEXP_FWD_CORE wxWindow; + class WXDLLIMPEXP_CORE wxToolTip : public wxObject { public: diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index 90065c928e..a2f1542a27 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -173,6 +173,11 @@ public: virtual QScrollArea *QtGetScrollBarsContainer() const; +#if wxUSE_TOOLTIPS + // applies tooltip to the widget. + virtual void QtApplyToolTip(const wxString& text); +#endif // wxUSE_TOOLTIPS + protected: virtual void DoGetTextExtent(const wxString& string, int *x, int *y, diff --git a/src/qt/tooltip.cpp b/src/qt/tooltip.cpp index f78b44f978..38a37a6a61 100644 --- a/src/qt/tooltip.cpp +++ b/src/qt/tooltip.cpp @@ -43,12 +43,16 @@ wxToolTip::wxToolTip(const wxString &tip) { - SetTip( tip ); + m_window = NULL; + SetTip(tip); } void wxToolTip::SetTip(const wxString& tip) { m_text = tip; + + if ( m_window ) + m_window->QtApplyToolTip(m_text); } const wxString &wxToolTip::GetTip() const @@ -59,6 +63,7 @@ const wxString &wxToolTip::GetTip() const void wxToolTip::SetWindow(wxWindow *win) { + wxCHECK_RET(win != NULL, "window should not be NULL"); m_window = win; - wxMISSING_FUNCTION(); + m_window->QtApplyToolTip(m_text); } diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 050cb37a8d..88e1b4b1e0 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -951,14 +951,22 @@ void wxWindowQt::DoMoveWindow(int x, int y, int width, int height) #if wxUSE_TOOLTIPS +void wxWindowQt::QtApplyToolTip(const wxString& text) +{ + GetHandle()->setToolTip(wxQtConvertString(text)); +} + void wxWindowQt::DoSetToolTip( wxToolTip *tip ) { + if ( m_tooltip == tip ) + return; + wxWindowBase::DoSetToolTip( tip ); - if ( tip != NULL ) - GetHandle()->setToolTip( wxQtConvertString( tip->GetTip() )); + if ( m_tooltip ) + m_tooltip->SetWindow(this); else - GetHandle()->setToolTip( QString() ); + QtApplyToolTip(wxString()); } #endif // wxUSE_TOOLTIPS From e40323d3120c9297590641e82fa4616e272962a3 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 25 Jan 2019 16:44:23 +0000 Subject: [PATCH 360/553] Simplify shared timer reference counting in wxEventLoop for wxQT --- src/qt/evtloop.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/qt/evtloop.cpp b/src/qt/evtloop.cpp index 71ae83707a..1341ca115c 100644 --- a/src/qt/evtloop.cpp +++ b/src/qt/evtloop.cpp @@ -81,7 +81,7 @@ void wxQtIdleTimer::idle() namespace { - wxQtIdleTimer *gs_idleTimer = NULL; + wxObjectDataPtr gs_idleTimer; } void wxQtIdleTimer::ScheduleIdleCheck() @@ -95,13 +95,7 @@ wxQtEventLoopBase::wxQtEventLoopBase() { // Create an idle timer to run each time there are no events (timeout = 0) if ( !gs_idleTimer ) - { - gs_idleTimer = new wxQtIdleTimer(); - } - else - { - gs_idleTimer->IncRef(); - } + gs_idleTimer.reset(new wxQtIdleTimer()); m_qtIdleTimer = gs_idleTimer; m_qtEventLoop = new QEventLoop; @@ -109,8 +103,9 @@ wxQtEventLoopBase::wxQtEventLoopBase() wxQtEventLoopBase::~wxQtEventLoopBase() { - if ( gs_idleTimer->GetRefCount() <= 1 ) - gs_idleTimer = NULL; + //Clear the shared timer if this is the only external reference to it + if ( gs_idleTimer->GetRefCount() <= 2 ) + gs_idleTimer.reset(NULL); delete m_qtEventLoop; } From c68e5d0617e84a07d52c6558e0da41501c0f6481 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Fri, 25 Jan 2019 21:14:20 -0500 Subject: [PATCH 361/553] Fix some spelling/grammar errors in documentation Mostly replace ungrammatical "allows to do" with correct "allows doing". Closes https://github.com/wxWidgets/wxWidgets/pull/1183 --- interface/wx/bmpbuttn.h | 2 +- interface/wx/busyinfo.h | 2 +- interface/wx/button.h | 2 +- interface/wx/calctrl.h | 2 +- interface/wx/clipbrd.h | 2 +- interface/wx/clrpicker.h | 2 +- interface/wx/cmdline.h | 4 ++-- interface/wx/collpane.h | 2 +- interface/wx/dataview.h | 2 +- interface/wx/datetime.h | 4 ++-- interface/wx/dc.h | 6 +++--- interface/wx/debugrpt.h | 6 +++--- interface/wx/defs.h | 2 +- interface/wx/dialog.h | 2 +- interface/wx/dialup.h | 2 +- interface/wx/dir.h | 2 +- interface/wx/event.h | 10 +++++----- interface/wx/eventfilter.h | 12 ++++++------ interface/wx/fileconf.h | 2 +- interface/wx/filename.h | 4 ++-- interface/wx/filepicker.h | 2 +- interface/wx/font.h | 6 +++--- interface/wx/fswatcher.h | 2 +- interface/wx/gdicmn.h | 2 +- interface/wx/graphics.h | 2 +- interface/wx/grid.h | 10 +++++----- interface/wx/headercol.h | 2 +- interface/wx/help.h | 2 +- interface/wx/html/htmlcell.h | 2 +- interface/wx/htmllbox.h | 2 +- interface/wx/icon.h | 2 +- interface/wx/listctrl.h | 4 ++-- interface/wx/longlong.h | 2 +- interface/wx/mdi.h | 2 +- interface/wx/modalhook.h | 2 +- interface/wx/msgout.h | 2 +- interface/wx/mstream.h | 4 ++-- interface/wx/nativewin.h | 2 +- interface/wx/notifmsg.h | 2 +- interface/wx/pen.h | 2 +- interface/wx/persist.h | 2 +- interface/wx/platinfo.h | 2 +- interface/wx/process.h | 4 ++-- interface/wx/progdlg.h | 4 ++-- interface/wx/propgrid/propgrid.h | 2 +- interface/wx/rearrangectrl.h | 4 ++-- interface/wx/richtooltip.h | 2 +- interface/wx/simplebook.h | 4 ++-- interface/wx/snglinst.h | 2 +- interface/wx/stc/stc.h | 6 +++--- interface/wx/stockitem.h | 2 +- interface/wx/strconv.h | 2 +- interface/wx/string.h | 2 +- interface/wx/sysopt.h | 6 +++--- interface/wx/textcompleter.h | 2 +- interface/wx/textctrl.h | 4 ++-- interface/wx/textentry.h | 4 ++-- interface/wx/textfile.h | 4 ++-- interface/wx/toolbar.h | 2 +- interface/wx/toplevel.h | 4 ++-- interface/wx/translation.h | 4 ++-- interface/wx/treelist.h | 2 +- interface/wx/utils.h | 6 +++--- interface/wx/valnum.h | 2 +- interface/wx/wfstream.h | 2 +- interface/wx/window.h | 2 +- interface/wx/xml/xml.h | 2 +- 67 files changed, 106 insertions(+), 106 deletions(-) diff --git a/interface/wx/bmpbuttn.h b/interface/wx/bmpbuttn.h index 9c04bc2993..522b7f3408 100644 --- a/interface/wx/bmpbuttn.h +++ b/interface/wx/bmpbuttn.h @@ -12,7 +12,7 @@ Notice that since wxWidgets 2.9.1 bitmap display is supported by the base wxButton class itself and the only tiny advantage of using this class is - that it allows to specify the bitmap in its constructor, unlike wxButton. + that it allows specifying the bitmap in its constructor, unlike wxButton. Please see the base class documentation for more information about images support in wxButton. diff --git a/interface/wx/busyinfo.h b/interface/wx/busyinfo.h index 94ee4f74df..f0ecefe509 100644 --- a/interface/wx/busyinfo.h +++ b/interface/wx/busyinfo.h @@ -88,7 +88,7 @@ public: /** General constructor. - This constructor allows to specify all supported attributes by calling + This constructor allows specifying all supported attributes by calling the appropriate methods on wxBusyInfoFlags object passed to it as parameter. All of them are optional but usually at least the message should be specified. diff --git a/interface/wx/button.h b/interface/wx/button.h index 15e77f48bb..6c2f9ac100 100644 --- a/interface/wx/button.h +++ b/interface/wx/button.h @@ -180,7 +180,7 @@ public: /** Returns the default size for the buttons. It is advised to make all the dialog - buttons of the same size and this function allows to retrieve the (platform and + buttons of the same size and this function allows retrieving the (platform and current font dependent size) which should be the best suited for this. */ static wxSize GetDefaultSize(); diff --git a/interface/wx/calctrl.h b/interface/wx/calctrl.h index 7c4c579884..2142dc5922 100644 --- a/interface/wx/calctrl.h +++ b/interface/wx/calctrl.h @@ -244,7 +244,7 @@ enum wxCalendarHitTestResult An item without custom attributes is drawn with the default colours and font and without border, but setting custom attributes with SetAttr() - allows to modify its appearance. Just create a custom attribute object and + allows modifying its appearance. Just create a custom attribute object and set it for the day you want to be displayed specially (note that the control will take ownership of the pointer, i.e. it will delete it itself). A day may be marked as being a holiday, even if it is not recognized as diff --git a/interface/wx/clipbrd.h b/interface/wx/clipbrd.h index 14593e27cc..21bd70b19a 100644 --- a/interface/wx/clipbrd.h +++ b/interface/wx/clipbrd.h @@ -165,7 +165,7 @@ public: until this function is called again with @false. On the other platforms, there is no PRIMARY selection and so all - clipboard operations will fail. This allows to implement the standard + clipboard operations will fail. This allows implementing the standard X11 handling of the clipboard which consists in copying data to the CLIPBOARD selection only when the user explicitly requests it (i.e. by selecting the "Copy" menu command) but putting the currently selected diff --git a/interface/wx/clrpicker.h b/interface/wx/clrpicker.h index 176934c834..90422e32e4 100644 --- a/interface/wx/clrpicker.h +++ b/interface/wx/clrpicker.h @@ -35,7 +35,7 @@ wxEventType wxEVT_COLOURPICKER_CHANGED; Shows the colour in HTML form (AABBCC) as colour button label (instead of no label at all). @style{wxCLRP_SHOW_ALPHA} - Allows to select opacity in the colour-chooser (effective under + Allows selecting opacity in the colour-chooser (effective under wxGTK and wxOSX). @endStyleTable diff --git a/interface/wx/cmdline.h b/interface/wx/cmdline.h index 0a35e1630f..25ef77ccfe 100644 --- a/interface/wx/cmdline.h +++ b/interface/wx/cmdline.h @@ -596,8 +596,8 @@ public: /** Enable or disable support for the long options. - As long options are not (yet) POSIX-compliant, this option allows to - disable them. + As long options are not (yet) POSIX-compliant, this option allows + disabling them. @see @ref cmdlineparser_customization and AreLongOptionsEnabled() */ diff --git a/interface/wx/collpane.h b/interface/wx/collpane.h index 714df38795..594a20748b 100644 --- a/interface/wx/collpane.h +++ b/interface/wx/collpane.h @@ -87,7 +87,7 @@ wxEventType wxEVT_COLLAPSIBLEPANE_CHANGED; The default style. It includes wxTAB_TRAVERSAL and wxBORDER_NONE. @style{wxCP_NO_TLW_RESIZE} By default wxCollapsiblePane resizes the top level window containing it - when its own size changes. This allows to easily implement dialogs + when its own size changes. This allows easily implementing dialogs containing an optionally shown part, for example, and so is the default behaviour but can be inconvenient in some specific cases -- use this flag to disable this automatic parent resizing then. diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index b0ca7f6f0e..0c82d35a45 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -1634,7 +1634,7 @@ public: /** Set custom colours and/or font to use for the header. - This method allows to customize the display of the control header (it + This method allows customizing the display of the control header (it does nothing if @c wxDV_NO_HEADER style is used). Currently it is only implemented in the generic version and just diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index 0851e59b2e..48b941b7b2 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -164,7 +164,7 @@ public: }; /** - Date calculations often depend on the country and wxDateTime allows to set + Date calculations often depend on the country and wxDateTime allows setting the country whose conventions should be used using SetCountry(). It takes one of the following values as parameter. */ @@ -795,7 +795,7 @@ public: /** Returns the difference between this object and @a dt as a wxDateSpan. - This method allows to find the number of entire years, months, weeks and + This method allows finding the number of entire years, months, weeks and days between @a dt and this date. @since 2.9.5 diff --git a/interface/wx/dc.h b/interface/wx/dc.h index 9e363dc90a..7d7f289e28 100644 --- a/interface/wx/dc.h +++ b/interface/wx/dc.h @@ -146,7 +146,7 @@ struct wxFontMetrics stated. Logical units are arbitrary units mapped to device units using the current mapping mode (see wxDC::SetMapMode). - This mechanism allows to reuse the same code which prints on e.g. a window + This mechanism allows reusing the same code which prints on e.g. a window on the screen to print on e.g. a paper. @@ -853,7 +853,7 @@ public: /** Returns the various font characteristics. - This method allows to retrieve some of the font characteristics not + This method allows retrieving some of the font characteristics not returned by GetTextExtent(), notably internal leading and average character width. @@ -1213,7 +1213,7 @@ public: /** Copy from a source DC to this DC possibly changing the scale. - Unlike Blit(), this method allows to specify different source and + Unlike Blit(), this method allows specifying different source and destination region sizes, meaning that it can stretch or shrink it while copying. The same can be achieved by changing the scale of the source or target DC but calling this method is simpler and can also be diff --git a/interface/wx/debugrpt.h b/interface/wx/debugrpt.h index c56dcba092..c6849f9e1e 100644 --- a/interface/wx/debugrpt.h +++ b/interface/wx/debugrpt.h @@ -74,7 +74,7 @@ public: way (e.g. automatically uploaded to a remote server) but if the user is asked to manually upload or send the report, it may be more convenient to generate it in e.g. the users home directory and this function - allows to do this. + allows doing this. Notice that it should be called before wxDebugReport::Process() or it has no effect. @@ -90,8 +90,8 @@ public: /** Set the base name of the generated debug report file. - This function is similar to SetCompressedFileDirectory() but allows to - change the base name of the file. Notice that the file extension will + This function is similar to SetCompressedFileDirectory() but allows + changing the base name of the file. Notice that the file extension will always be @c .zip. By default, a unique name constructed from wxApp::GetAppName(), the diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 68727fd827..1e1e47431d 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -292,7 +292,7 @@ enum wxBorder /* wxCommandEvents and the objects of the derived classes are forwarded to the */ /* parent window and so on recursively by default. Using this flag for the */ -/* given window allows to block this propagation at this window, i.e. prevent */ +/* given window allows blocking this propagation at this window, i.e. preventing */ /* the events from being propagated further upwards. The dialogs have this */ /* flag on by default. */ #define wxWS_EX_BLOCK_EVENTS 0x00000002 diff --git a/interface/wx/dialog.h b/interface/wx/dialog.h index 6dfe57cf7a..90fb4ca17c 100644 --- a/interface/wx/dialog.h +++ b/interface/wx/dialog.h @@ -590,7 +590,7 @@ public: EndModal(). Notice that it is possible to call ShowModal() for a dialog which had - been previously shown with Show(), this allows to make an existing + been previously shown with Show(), this allows making an existing modeless dialog modal. However ShowModal() can't be called twice without intervening EndModal() calls. diff --git a/interface/wx/dialup.h b/interface/wx/dialup.h index 5ad0ce5325..a97c74490e 100644 --- a/interface/wx/dialup.h +++ b/interface/wx/dialup.h @@ -162,7 +162,7 @@ public: /** Sometimes the built-in logic for determining the online status may fail, so, in general, the user should be allowed to override it. This - function allows to forcefully set the online status - whatever our + function allows forcefully setting the online status - whatever our internal algorithm may think about it. @see IsOnline() diff --git a/interface/wx/dir.h b/interface/wx/dir.h index e5dbd92109..976f9a1a87 100644 --- a/interface/wx/dir.h +++ b/interface/wx/dir.h @@ -137,7 +137,7 @@ enum wxDirFlags @class wxDir wxDir is a portable equivalent of Unix open/read/closedir functions which - allow enumerating of the files in a directory. wxDir allows to enumerate + allow enumerating of the files in a directory. wxDir allows enumerating files as well as directories. wxDir also provides a flexible way to enumerate files recursively using diff --git a/interface/wx/event.h b/interface/wx/event.h index 7871e910d5..c198be2e6a 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -279,7 +279,7 @@ protected: /** @class wxEventBlocker - This class is a special event handler which allows to discard + This class is a special event handler which allows discarding any event (or a set of event types) directed to a specific window. Example: @@ -713,7 +713,7 @@ public: usage, it has no advantages compared to Bind(). This is an alternative to the use of static event tables. It is more - flexible as it allows to connect events generated by some object to an + flexible as it allows connecting events generated by some object to an event handler defined in a different object of a different class (which is impossible to do directly with the event tables -- the events can be only handled in another object if they are propagated upwards to it). @@ -2477,8 +2477,8 @@ public: @c wxEVT_TEXT_CUT and @c wxEVT_TEXT_PASTE. If any of these events is processed (without being skipped) by an event - handler, the corresponding operation doesn't take place which allows to - prevent the text from being copied from or pasted to a control. It is also + handler, the corresponding operation doesn't take place which allows + preventing the text from being copied from or pasted to a control. It is also possible to examine the clipboard contents in the PASTE event handler and transform it in some way before inserting in a control -- for example, changing its case or removing invalid characters. @@ -3023,7 +3023,7 @@ public: bool GetActive() const; /** - Allows to check if the window was activated by clicking it with the + Allows checking if the window was activated by clicking it with the mouse or in some other way. This method is currently only implemented in wxMSW and returns @c diff --git a/interface/wx/eventfilter.h b/interface/wx/eventfilter.h index 6488d2175b..af17c53cf6 100644 --- a/interface/wx/eventfilter.h +++ b/interface/wx/eventfilter.h @@ -13,8 +13,8 @@ This is a very simple class which just provides FilterEvent() virtual method to be called by wxEvtHandler before starting process of any event. - Thus, inheriting from this class and overriding FilterEvent() allows to - capture and possibly handle or ignore all the events happening in the + Thus, inheriting from this class and overriding FilterEvent() allows + capturing and possibly handling or ignoring all the events happening in the program. Of course, having event filters adds additional overhead to every event processing and so should not be used lightly and your FilterEvent() code should try to return as quickly as possible, especially for the events @@ -22,7 +22,7 @@ An example of using this class: @code - // This class allows to determine the last time the user has worked with + // This class allows determining the last time the user has worked with // this application: class LastActivityTimeDetector : public wxEventFilter { @@ -72,8 +72,8 @@ filter during its creation so you may also override FilterEvent() method in your wxApp-derived class and, in fact, this is often the most convenient way to do it. However creating a new class deriving directly from - wxEventFilter allows to isolate the event filtering code in its own - separate class and also to have several independent filters, if necessary. + wxEventFilter allows isolating the event filtering code in its own + separate class and also having several independent filters, if necessary. @category{events} @@ -118,7 +118,7 @@ public: /** Override this method to implement event pre-processing. - This method allows to filter all the events processed by the program, + This method allows filtering all the events processed by the program, so you should try to return quickly from it to avoid slowing down the program to a crawl. diff --git a/interface/wx/fileconf.h b/interface/wx/fileconf.h index 21d85e420b..eff88ef6d2 100644 --- a/interface/wx/fileconf.h +++ b/interface/wx/fileconf.h @@ -96,7 +96,7 @@ public: virtual bool Save(wxOutputStream& os, const wxMBConv& conv = wxConvAuto()); /** - Allows to set the mode to be used for the config file creation. For example, to + Allows setting the mode to be used for the config file creation. For example, to create a config file which is not readable by other users (useful if it stores some sensitive information, such as passwords), you could use @c SetUmask(0077). diff --git a/interface/wx/filename.h b/interface/wx/filename.h index 5a79e83df8..330a172b66 100644 --- a/interface/wx/filename.h +++ b/interface/wx/filename.h @@ -193,7 +193,7 @@ wxULongLong wxInvalidSize; invalid state and wxFileName::IsOk() returns false for it. File names can be case-sensitive or not, the function wxFileName::IsCaseSensitive() - allows to determine this. The rules for determining whether the file name is + allows determining this. The rules for determining whether the file name is absolute or relative also depend on the file name format and the only portable way to answer this question is to use wxFileName::IsAbsolute() or wxFileName::IsRelative() method. @@ -517,7 +517,7 @@ public: By default, all operations in this class work on the target of a symbolic link (symlink) if the path of the file is actually a symlink. - Using this method allows to turn off this "symlink following" behaviour + Using this method allows turning off this "symlink following" behaviour and apply the operations to this path itself, even if it is a symlink. The following methods are currently affected by this option: diff --git a/interface/wx/filepicker.h b/interface/wx/filepicker.h index f4aed07345..0856634770 100644 --- a/interface/wx/filepicker.h +++ b/interface/wx/filepicker.h @@ -204,7 +204,7 @@ public: automatically synchronized with button's value. Use functions defined in wxPickerBase to modify the text control. @style{wxDIRP_DIR_MUST_EXIST} - Creates a picker which allows to select only existing directories in + Creates a picker which allows selecting only existing directories in the popup wxDirDialog. Notice that, as with @c wxFLP_FILE_MUST_EXIST, it is still possible to enter a non-existent directory even when this file is specified if @c wxDIRP_USE_TEXTCTRL style is also used. diff --git a/interface/wx/font.h b/interface/wx/font.h index df3b25b65a..20b261b23b 100644 --- a/interface/wx/font.h +++ b/interface/wx/font.h @@ -11,7 +11,7 @@ the generic properties of the font without hardcoding in the sources a specific face name. - wxFontFamily thus allows to group the font face names of fonts with similar + wxFontFamily thus allows grouping the font face names of fonts with similar properties. Most wxWidgets ports use lists of fonts for each font family inspired by the data taken from http://www.codestyle.org/css/font-family. */ @@ -291,7 +291,7 @@ enum wxFontEncoding @class wxFontInfo This class is a helper used for wxFont creation using named parameter - idiom: it allows to specify various wxFont attributes using the chained + idiom: it allows specifying various wxFont attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to wxFont constructors. @@ -1169,7 +1169,7 @@ public: /** Sets the font size using a predefined symbolic size name. - This function allows to change font size to be (very) large or small + This function allows changing font size to be (very) large or small compared to the standard font size. @see SetSymbolicSizeRelativeTo(). diff --git a/interface/wx/fswatcher.h b/interface/wx/fswatcher.h index 5675a7a666..c911c1c23c 100644 --- a/interface/wx/fswatcher.h +++ b/interface/wx/fswatcher.h @@ -10,7 +10,7 @@ /** @class wxFileSystemWatcher - The wxFileSystemWatcher class allows to receive notifications of file + The wxFileSystemWatcher class allows receiving notifications of file system changes. @note Implementation limitations: this class is currently implemented for diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index a31a702ffe..200c06ff89 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -1220,7 +1220,7 @@ void wxSetCursor(const wxCursor& cursor); /** Returns the dimensions of the work area on the display. - This is the same as wxGetClientDisplayRect() but allows to retrieve the + This is the same as wxGetClientDisplayRect() but allows retrieving the individual components instead of the entire rectangle. Any of the output pointers can be @NULL if the corresponding value is not diff --git a/interface/wx/graphics.h b/interface/wx/graphics.h index 5154ec19ba..27facf596b 100644 --- a/interface/wx/graphics.h +++ b/interface/wx/graphics.h @@ -1565,7 +1565,7 @@ public: @class wxGraphicsPenInfo This class is a helper used for wxGraphicsPen creation using named parameter - idiom: it allows to specify various wxGraphicsPen attributes using the chained + idiom: it allows specifying various wxGraphicsPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to wxGraphicsPen constructors. diff --git a/interface/wx/grid.h b/interface/wx/grid.h index 7bfe1e9426..27690c953a 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -901,7 +901,7 @@ public: /** This class is reference counted: it is created with ref count of 1, so - calling DecRef() once will delete it. Calling IncRef() allows to lock + calling DecRef() once will delete it. Calling IncRef() allows locking it until the matching DecRef() is called. */ void DecRef(); @@ -1005,7 +1005,7 @@ public: /** This class is reference counted: it is created with ref count of 1, so - calling DecRef() once will delete it. Calling IncRef() allows to lock + calling DecRef() once will delete it. Calling IncRef() allows locking it until the matching DecRef() is called. */ void IncRef(); @@ -2935,7 +2935,7 @@ public: The base class version returns the editor which was associated with the specified @a typeName when it was registered RegisterDataType() but this function may be overridden to return something different. This - allows to override an editor used for one of the standard types. + allows overriding an editor used for one of the standard types. The caller must call DecRef() on the returned pointer. */ @@ -3667,7 +3667,7 @@ public: /** Disable interactive resizing of the specified column. - This method allows to disable resizing of an individual column in a + This method allows one to disable resizing of an individual column in a grid where the columns are otherwise resizable (which is the case by default). @@ -4625,7 +4625,7 @@ public: Sets the extra margins used around the grid area. A grid may occupy more space than needed for its data display and - this function allows to set how big this extra space is + this function allows setting how big this extra space is */ void SetMargins(int extraWidth, int extraHeight); diff --git a/interface/wx/headercol.h b/interface/wx/headercol.h index 60e0a4a3cc..bb73100a5c 100644 --- a/interface/wx/headercol.h +++ b/interface/wx/headercol.h @@ -248,7 +248,7 @@ public: /** Set the column flags. - This method allows to set all flags at once, see also generic + This method allows setting all flags at once, see also generic ChangeFlag(), SetFlag(), ClearFlag() and ToggleFlag() methods below as well as specific SetResizeable(), SetSortable(), SetReorderable() and SetHidden() ones. diff --git a/interface/wx/help.h b/interface/wx/help.h index dfa6f489ed..58294c23cd 100644 --- a/interface/wx/help.h +++ b/interface/wx/help.h @@ -156,7 +156,7 @@ public: /** If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one match is found, the file is displayed at this section. - The optional parameter allows to search the index (wxHELP_SEARCH_INDEX) + The optional parameter allows searching the index (wxHELP_SEARCH_INDEX) but this currently is only supported by the wxHtmlHelpController. - @e WinHelp, MS HTML Help: diff --git a/interface/wx/html/htmlcell.h b/interface/wx/html/htmlcell.h index 2f64f36556..ec5d7ae5f8 100644 --- a/interface/wx/html/htmlcell.h +++ b/interface/wx/html/htmlcell.h @@ -476,7 +476,7 @@ public: /** Detach a child cell. - Detaching a cell removes it from this container and allows to reattach + Detaching a cell removes it from this container and allows reattaching it to another one by using InsertCell(). Alternatively, this method can be used to selectively remove some elements of the HTML document tree by deleting the cell after calling it. diff --git a/interface/wx/htmllbox.h b/interface/wx/htmllbox.h index 234467fe7d..5a051bc1be 100644 --- a/interface/wx/htmllbox.h +++ b/interface/wx/htmllbox.h @@ -97,7 +97,7 @@ protected: background of the selected cells in the same way as GetSelectedTextColour(). It should be rarely, if ever, used because wxVListBox::SetSelectionBackground - allows to change the selection background for all cells at once and doing + allows changing the selection background for all cells at once and doing anything more fancy is probably going to look strangely. @see GetSelectedTextColour() diff --git a/interface/wx/icon.h b/interface/wx/icon.h index 8f1986c46c..770120707e 100644 --- a/interface/wx/icon.h +++ b/interface/wx/icon.h @@ -181,7 +181,7 @@ public: /** Attach a Windows icon handle. - This wxMSW-specific method allows to assign a native Windows @c HICON + This wxMSW-specific method allows assigning a native Windows @c HICON (which must be castes to @c WXHICON opaque handle type) to wxIcon. Notice that this means that the @c HICON will be destroyed by wxIcon when it is destroyed. diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 49bfdb85ef..47dc767f11 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -127,7 +127,7 @@ enum A special case of report view quite different from the other modes of the list control is a virtual control in which the items data (including text, images and attributes) is managed by the main program and is requested by the control - itself only when needed which allows to have controls with millions of items + itself only when needed which allows having controls with millions of items without consuming much memory. To use virtual list control you must use wxListCtrl::SetItemCount first and override at least wxListCtrl::OnGetItemText (and optionally wxListCtrl::OnGetItemImage or wxListCtrl::OnGetItemColumnImage and @@ -453,7 +453,7 @@ public: /** Finish editing the label. - This method allows to programmatically end editing a list control item + This method allows one to programmatically end editing a list control item in place. Usually it will only be called when editing is in progress, i.e. if GetEditControl() returns non-NULL. In particular, do not call it from EVT_LIST_BEGIN_LABEL_EDIT handler as the edit control is not diff --git a/interface/wx/longlong.h b/interface/wx/longlong.h index 5903a32f0f..4c630388da 100644 --- a/interface/wx/longlong.h +++ b/interface/wx/longlong.h @@ -69,7 +69,7 @@ public: //@} /** - This allows to convert a double value to wxLongLong type. + This allows converting a double value to wxLongLong type. Such conversion is not always possible in which case the result will be silently truncated in a platform-dependent way. diff --git a/interface/wx/mdi.h b/interface/wx/mdi.h index b093fc6387..b5708c0742 100644 --- a/interface/wx/mdi.h +++ b/interface/wx/mdi.h @@ -306,7 +306,7 @@ public: SetWindowMenu() is called again). To remove the window completely, you can use the wxFRAME_NO_WINDOW_MENU - window style but this function also allows to do it by passing @NULL + window style but this function also allows doing it by passing @NULL pointer as @a menu. The menu may include the items with the following standard identifiers diff --git a/interface/wx/modalhook.h b/interface/wx/modalhook.h index 16df4bc18b..5eb07ff694 100644 --- a/interface/wx/modalhook.h +++ b/interface/wx/modalhook.h @@ -7,7 +7,7 @@ ///////////////////////////////////////////////////////////////////////////// /** - Allows to intercept all modal dialog calls. + Allows intercepting all modal dialog calls. This class can be used to hook into normal modal dialog handling for some special needs. One of the most common use cases is for testing: as diff --git a/interface/wx/msgout.h b/interface/wx/msgout.h index e83942f050..e7b6631403 100644 --- a/interface/wx/msgout.h +++ b/interface/wx/msgout.h @@ -10,7 +10,7 @@ Simple class allowing to write strings to various output channels. wxMessageOutput is a low-level class and doesn't provide any of the - conveniences of wxLog. It simply allows to write a message to some output + conveniences of wxLog. It simply allows writing a message to some output channel: usually file or standard error but possibly also a message box. While use of wxLog and related functions is preferable in many cases sometimes this simple interface may be more convenient. diff --git a/interface/wx/mstream.h b/interface/wx/mstream.h index be70e4faf9..c0dfa13fba 100644 --- a/interface/wx/mstream.h +++ b/interface/wx/mstream.h @@ -8,7 +8,7 @@ /** @class wxMemoryOutputStream - This class allows to use all methods taking a wxOutputStream reference to write + This class allows using all methods taking a wxOutputStream reference to write to in-memory data. Example: @@ -72,7 +72,7 @@ public: /** @class wxMemoryInputStream - This class allows to use all methods taking a wxInputStream reference to read + This class allows using all methods taking a wxInputStream reference to read in-memory data. Example: diff --git a/interface/wx/nativewin.h b/interface/wx/nativewin.h index c3555ef885..e96e4611ea 100644 --- a/interface/wx/nativewin.h +++ b/interface/wx/nativewin.h @@ -10,7 +10,7 @@ /** @class wxNativeWindow - Allows to embed a native widget in an application using wxWidgets. + Allows embedding a native widget in an application using wxWidgets. This class can be used as a bridge between wxWidgets and native GUI toolkit, i.e. standard Windows controls under MSW, GTK+ widgets or Cocoa diff --git a/interface/wx/notifmsg.h b/interface/wx/notifmsg.h index 7608a84cc9..4a35382ae5 100644 --- a/interface/wx/notifmsg.h +++ b/interface/wx/notifmsg.h @@ -8,7 +8,7 @@ /** @class wxNotificationMessage - This class allows to show the user a message non intrusively. + This class allows showing the user a message non intrusively. Currently it is implemented natively for Windows, OS X, GTK and uses generic toast notifications under the other platforms. It's not recommended diff --git a/interface/wx/pen.h b/interface/wx/pen.h index 13f7e65ce6..d6df1c3f4d 100644 --- a/interface/wx/pen.h +++ b/interface/wx/pen.h @@ -105,7 +105,7 @@ enum wxPenCap @class wxPenInfo This class is a helper used for wxPen creation using named parameter - idiom: it allows to specify various wxPen attributes using the chained + idiom: it allows specifying various wxPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to wxPen constructors. diff --git a/interface/wx/persist.h b/interface/wx/persist.h index f9c75920fe..417867821d 100644 --- a/interface/wx/persist.h +++ b/interface/wx/persist.h @@ -62,7 +62,7 @@ public: Globally disable restoring the persistence object properties. By default, restoring properties in Restore() is enabled but this - function allows to disable it. This is mostly useful for testing. + function allows disabling it. This is mostly useful for testing. @see DisableSaving() */ diff --git a/interface/wx/platinfo.h b/interface/wx/platinfo.h index 601b145524..f279c15592 100644 --- a/interface/wx/platinfo.h +++ b/interface/wx/platinfo.h @@ -11,7 +11,7 @@ whose version can be detected at run-time. The values of the constants are chosen so that they can be combined as flags; - this allows to check for operating system families like e.g. @c wxOS_MAC and @c wxOS_UNIX. + this allows checking for operating system families like e.g. @c wxOS_MAC and @c wxOS_UNIX. Note that you can obtain more detailed information about the current OS version in use by checking the major, minor, and micro version numbers diff --git a/interface/wx/process.h b/interface/wx/process.h index 5484338f63..f5dc6d018f 100644 --- a/interface/wx/process.h +++ b/interface/wx/process.h @@ -67,7 +67,7 @@ public: /** Creates an object without any associated parent (and hence no id neither) - but allows to specify the @a flags which can have the value of + but allows specifying the @a flags which can have the value of @c wxPROCESS_DEFAULT or @c wxPROCESS_REDIRECT. Specifying the former value has no particular effect while using the latter @@ -174,7 +174,7 @@ public: Returns @true if there is data to be read on the child process standard output stream. - This allows to write simple (and extremely inefficient) polling-based code + This allows writing simple (and extremely inefficient) polling-based code waiting for a better mechanism in future wxWidgets versions. See the @ref page_samples_exec "exec sample" for an example of using this function. diff --git a/interface/wx/progdlg.h b/interface/wx/progdlg.h index 28ce778ed6..616b8530e1 100644 --- a/interface/wx/progdlg.h +++ b/interface/wx/progdlg.h @@ -180,8 +180,8 @@ public: Normally a Cancel button press is indicated by Update() returning @false but sometimes it may be more convenient to check if the dialog - was cancelled from elsewhere in the code and this function allows to - do it. + was cancelled from elsewhere in the code and this function allows + doing it. It always returns @false if the Cancel button is not shown at all. diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 2e7bf51563..7f28cab079 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -229,7 +229,7 @@ wxPG_EX_NO_TOOLBAR_DIVIDER = 0x04000000, */ wxPG_EX_TOOLBAR_SEPARATOR = 0x08000000, -/** Allows to take focus on the entire area (on canvas) +/** Allows taking focus on the entire area (on canvas) even if wxPropertyGrid is not a standalone control. @hideinitializer */ diff --git a/interface/wx/rearrangectrl.h b/interface/wx/rearrangectrl.h index fa4d40eb5e..d26113f095 100644 --- a/interface/wx/rearrangectrl.h +++ b/interface/wx/rearrangectrl.h @@ -13,8 +13,8 @@ A listbox-like control allowing the user to rearrange the items and to enable or disable them. - This class allows to change the order of the items shown in it as well as - to check or uncheck them individually. The data structure used to allow + This class allows changing the order of the items shown in it as well as + checking or unchecking them individually. The data structure used to allow this is the order array which contains the items indices indexed by their position with an added twist that the unchecked items are represented by the bitwise complement of the corresponding index (for any architecture diff --git a/interface/wx/richtooltip.h b/interface/wx/richtooltip.h index a4e48648ff..cd3c3148c2 100644 --- a/interface/wx/richtooltip.h +++ b/interface/wx/richtooltip.h @@ -51,7 +51,7 @@ enum wxTipKind wxTipKind_Auto }; /** - Allows to show a tool tip with more customizations than wxToolTip. + Allows showing a tool tip with more customizations than wxToolTip. Using this class is very simple, to give a standard warning for a password text control if the password was entered correctly you could simply do: diff --git a/interface/wx/simplebook.h b/interface/wx/simplebook.h index ba2302fb3d..7db8c04adb 100644 --- a/interface/wx/simplebook.h +++ b/interface/wx/simplebook.h @@ -73,7 +73,7 @@ public: /** Set the effects to use for showing and hiding the pages. - This method allows to specify the effects passed to + This method allows specifying the effects passed to wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() respectively when the pages need to be shown or hidden. @@ -102,7 +102,7 @@ public: /** Set the effect timeout to use for showing and hiding the pages. - This method allows to configure the timeout arguments passed to + This method allows configuring the timeout arguments passed to wxWindow::ShowWithEffect() and wxWindow::HideWithEffect() if a non-default effect is used. diff --git a/interface/wx/snglinst.h b/interface/wx/snglinst.h index 2801cec57f..999b6bcb1d 100644 --- a/interface/wx/snglinst.h +++ b/interface/wx/snglinst.h @@ -8,7 +8,7 @@ /** @class wxSingleInstanceChecker - wxSingleInstanceChecker class allows to check that only a single instance of a + wxSingleInstanceChecker class allows checking that only a single instance of a program is running. To do it, you should create an object of this class. As long as this object diff --git a/interface/wx/stc/stc.h b/interface/wx/stc/stc.h index 49ef8ff5ad..528667382d 100644 --- a/interface/wx/stc/stc.h +++ b/interface/wx/stc/stc.h @@ -6829,7 +6829,7 @@ public: void SetWrapVisualFlags(int wrapVisualFlags); /** - Retrive the display mode of visual flags for wrapped lines. + Retrieve the display mode of visual flags for wrapped lines. The return value will be a bit list containing one or more of the @link wxStyledTextCtrl::wxSTC_WRAPVISUALFLAG_NONE wxSTC_WRAPVISUALFLAG_* @endlink constants. @@ -6845,7 +6845,7 @@ public: void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation); /** - Retrive the location of visual flags for wrapped lines. + Retrieve the location of visual flags for wrapped lines. The return value will be a bit list containing one or more of the @link wxStyledTextCtrl::wxSTC_WRAPVISUALFLAGLOC_DEFAULT wxSTC_WRAPVISUALFLAGLOC_* @endlink constants. @@ -6858,7 +6858,7 @@ public: void SetWrapStartIndent(int indent); /** - Retrive the start indent for wrapped lines. + Retrieve the start indent for wrapped lines. */ int GetWrapStartIndent() const; diff --git a/interface/wx/stockitem.h b/interface/wx/stockitem.h index 0826edf555..7a30787dae 100644 --- a/interface/wx/stockitem.h +++ b/interface/wx/stockitem.h @@ -39,7 +39,7 @@ enum wxStockLabelQueryFlag Return the label without any ellipsis at the end. By default, stock items text is returned with ellipsis, if appropriate, - this flag allows to avoid having it. So using the same example as + this flag allows one to avoid having it. So using the same example as above, the returned string would be "Print" or "&Print" if wxSTOCK_WITH_MNEMONIC were also used. diff --git a/interface/wx/strconv.h b/interface/wx/strconv.h index 111a07ce54..00dfb359e6 100644 --- a/interface/wx/strconv.h +++ b/interface/wx/strconv.h @@ -86,7 +86,7 @@ public: This is the most general function for converting a multibyte string to a wide string, cMB2WC() may be often more convenient, however this - function is the most efficient one as it allows to avoid any + function is the most efficient one as it allows avoiding any unnecessary copying. The main case is when @a dst is not @NULL and @a srcLen is not diff --git a/interface/wx/string.h b/interface/wx/string.h index d2f449c405..65d828c8f5 100644 --- a/interface/wx/string.h +++ b/interface/wx/string.h @@ -2038,7 +2038,7 @@ public: //@{ /** - Allows to extend a function with the signature: + Allows extending a function with the signature: @code bool SomeFunc(const wxUniChar& c) @endcode which operates on a single character, to an entire wxString. diff --git a/interface/wx/sysopt.h b/interface/wx/sysopt.h index 47ac09624d..2453fe6eea 100644 --- a/interface/wx/sysopt.h +++ b/interface/wx/sysopt.h @@ -34,7 +34,7 @@ If set to non-zero value, abort the program if an assertion fails. The default behaviour in case of assertion failure depends on the build mode and can be changed by overriding wxApp::OnAssertFailure() but setting - this option allows to change it without modifying the program code and + this option allows changing it without modifying the program code and also applies to asserts which may happen before the wxApp object creation or after its destruction. @endFlagTable @@ -81,8 +81,8 @@ @flag{gtk.tlw.can-set-transparent} wxTopLevelWindow::CanSetTransparent() method normally tries to detect automatically whether transparency for top level windows is currently - supported, however this may sometimes fail and this option allows to - override the automatic detection. Setting it to 1 makes the transparency + supported, however this may sometimes fail and this option allows + overriding the automatic detection. Setting it to 1 makes the transparency be always available (setting it can still fail, of course) and setting it to 0 makes it always unavailable. @flag{gtk.desktop} diff --git a/interface/wx/textcompleter.h b/interface/wx/textcompleter.h index 543833ef9c..8657b11f5d 100644 --- a/interface/wx/textcompleter.h +++ b/interface/wx/textcompleter.h @@ -21,7 +21,7 @@ one after the user finished entering the first one and so on. When inheriting from this class you need to implement its two pure virtual - methods. This allows to return the results incrementally and may or not be + methods. This allows returning the results incrementally and may or not be convenient depending on where do they come from. If you prefer to return all the completions at once, you should inherit from wxTextCompleterSimple instead. diff --git a/interface/wx/textctrl.h b/interface/wx/textctrl.h index 1bb50d9e90..a0b6b7464f 100644 --- a/interface/wx/textctrl.h +++ b/interface/wx/textctrl.h @@ -960,7 +960,7 @@ public: @style{wxTE_READONLY} The text will not be user-editable. @style{wxTE_RICH} - Use rich text control under MSW, this allows to have more than 64KB + Use rich text control under MSW, this allows having more than 64KB of text in the control. This style is ignored under other platforms. @style{wxTE_RICH2} Use rich text control version 2.0 or higher under MSW, this style is @@ -1469,7 +1469,7 @@ public: /** Converts given text position to client coordinates in pixels. - This function allows to find where is the character at the given + This function allows finding where is the character at the given position displayed in the text control. @onlyfor{wxmsw,wxgtk}. Additionally, wxGTK only implements this method diff --git a/interface/wx/textentry.h b/interface/wx/textentry.h index f580f86f1e..7af88079be 100644 --- a/interface/wx/textentry.h +++ b/interface/wx/textentry.h @@ -68,7 +68,7 @@ public: This method should be used instead of AutoComplete() overload taking the array of possible completions if the total number of strings is too - big as it allows to return the completions dynamically, depending on + big as it allows returning the completions dynamically, depending on the text already entered by user and so is more efficient. The specified @a completer object will be used to retrieve the list of @@ -399,7 +399,7 @@ public: This function sets the maximum number of characters the user can enter into the control. - In other words, it allows to limit the text value length to @a len not + In other words, it allows limiting the text value length to @a len not counting the terminating @c NUL character. If @a len is 0, the previously set max length limit, if any, is discarded diff --git a/interface/wx/textfile.h b/interface/wx/textfile.h index 52a6506fa6..fc344b3547 100644 --- a/interface/wx/textfile.h +++ b/interface/wx/textfile.h @@ -22,7 +22,7 @@ enum wxTextFileType /** @class wxTextFile - The wxTextFile is a simple class which allows to work with text files on line by + The wxTextFile is a simple class which allows working with text files on line by line basis. It also understands the differences in line termination characters under different platforms and will not do anything bad to files with "non native" line termination sequences - in fact, it can be also used to modify the @@ -169,7 +169,7 @@ public: /** Gets the last line of the file. - Together with GetPrevLine() it allows to enumerate the lines + Together with GetPrevLine() it allows enumerating the lines in the file from the end to the beginning like this: @code diff --git a/interface/wx/toolbar.h b/interface/wx/toolbar.h index e6b43df03b..03d7ba16c4 100644 --- a/interface/wx/toolbar.h +++ b/interface/wx/toolbar.h @@ -809,7 +809,7 @@ public: /** Removes the given tool from the toolbar but doesn't delete it. This - allows to insert/add this tool back to this (or another) toolbar later. + allows inserting/adding this tool back to this (or another) toolbar later. @note It is unnecessary to call Realize() for the change to take place, it will happen immediately. diff --git a/interface/wx/toplevel.h b/interface/wx/toplevel.h index 44731c8790..6935d638ce 100644 --- a/interface/wx/toplevel.h +++ b/interface/wx/toplevel.h @@ -467,8 +467,8 @@ public: void SetIcon(const wxIcon& icon); /** - Sets several icons of different sizes for this window: this allows to - use different icons for different situations (e.g. task switching bar, + Sets several icons of different sizes for this window: this allows + using different icons for different situations (e.g. task switching bar, taskbar, window title bar) instead of scaling, with possibly bad looking results, the only icon set by SetIcon(). diff --git a/interface/wx/translation.h b/interface/wx/translation.h index eed6355d0b..bc92a3a378 100644 --- a/interface/wx/translation.h +++ b/interface/wx/translation.h @@ -7,7 +7,7 @@ /** - This class allows to get translations for strings. + This class allows getting translations for strings. In wxWidgets this class manages message catalogs which contain the translations of the strings used to the current language. Unlike wxLocale, @@ -539,7 +539,7 @@ public: If @a context is not empty (notice that this argument is only available starting from wxWidgets 3.1.1), item translation is looked up in the - specified context. This allows to have different translations for the same + specified context. This allows having different translations for the same string appearing in different contexts, e.g. it may be necessary to translate the same English "Open" verb differently depending on the object it applies to. To do this, you need to use @c msgctxt in the source message diff --git a/interface/wx/treelist.h b/interface/wx/treelist.h index 7be469dc9f..45c8d12c19 100644 --- a/interface/wx/treelist.h +++ b/interface/wx/treelist.h @@ -24,7 +24,7 @@ enum Don't show the column headers. By default this control shows the column headers, using this class - allows to avoid this and show only the data. + allows avoiding this and showing only the data. @since 2.9.5 */ diff --git a/interface/wx/utils.h b/interface/wx/utils.h index c981365e37..4557fc4f27 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -868,8 +868,8 @@ wxString wxGetOsDescription(); /** Gets the version and the operating system ID for currently running OS. The returned wxOperatingSystemId value can be used for a basic categorization - of the OS family; the major, minor, and micro version numbers allows to - detect a specific system. + of the OS family; the major, minor, and micro version numbers allows + detecting a specific system. If on Unix-like systems the version can't be detected all three version numbers will have a value of -1. @@ -1026,7 +1026,7 @@ enum Always show the child process console under MSW. The child console is hidden by default if the child IO is redirected, - this flag allows to change this and show it nevertheless. + this flag allows changing this and showing it nevertheless. This flag is ignored under the other platforms. */ diff --git a/interface/wx/valnum.h b/interface/wx/valnum.h index 8bb6d6346d..0fb243b4f5 100644 --- a/interface/wx/valnum.h +++ b/interface/wx/valnum.h @@ -364,7 +364,7 @@ public: /** Creates a wxFloatingPointValidator object with automatic type deduction. - Similarly to wxMakeIntegerValidator(), this function allows to avoid + Similarly to wxMakeIntegerValidator(), this function allows avoiding explicitly specifying the validator type. @since 2.9.2 diff --git a/interface/wx/wfstream.h b/interface/wx/wfstream.h index 27c1a3f406..4473f568c8 100644 --- a/interface/wx/wfstream.h +++ b/interface/wx/wfstream.h @@ -276,7 +276,7 @@ public: /** @class wxFFileStream - This stream allows to both read from and write to a file using buffered + This stream allows both reading from and writing to a file using buffered STDIO functions. @library{wxbase} diff --git a/interface/wx/window.h b/interface/wx/window.h index 64b3c1d58d..2ba856ea40 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -257,7 +257,7 @@ enum wxWindowVariant @style{wxWS_EX_BLOCK_EVENTS} wxCommandEvents and the objects of the derived classes are forwarded to the parent window and so on recursively by default. - Using this flag for the given window allows to block this + Using this flag for the given window allows blocking this propagation at this window, i.e. prevent the events from being propagated further upwards. Dialogs have this flag on by default for the reasons explained in the @ref overview_events. diff --git a/interface/wx/xml/xml.h b/interface/wx/xml/xml.h index 30eb28763b..08cd68335f 100644 --- a/interface/wx/xml/xml.h +++ b/interface/wx/xml/xml.h @@ -886,7 +886,7 @@ public: void SetEncoding(const wxString& enc); /** - Sets the enconding of the file which will be used to save the document. + Sets the encoding of the file which will be used to save the document. */ void SetFileEncoding(const wxString& encoding); From 2716347f175a71d7908befa620ea3e5818290841 Mon Sep 17 00:00:00 2001 From: dghart Date: Sat, 26 Jan 2019 20:55:20 +0000 Subject: [PATCH 362/553] Correct the order of parameters in the wxDateTime::SetToWeekDay examples e.g. "For example, SetToWeekDay(wxDateTime::Wed, 2)" not "For example, SetToWeekDay(2, wxDateTime::Wed)" --- interface/wx/datetime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index 48b941b7b2..da7ef4a59a 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -1161,9 +1161,9 @@ public: @a n may be either positive (counting from the beginning of the month) or negative (counting from the end of it). - For example, SetToWeekDay(2, wxDateTime::Wed) will set the date to the + For example, SetToWeekDay(wxDateTime::Wed, 2) will set the date to the second Wednesday in the current month and - SetToWeekDay(-1, wxDateTime::Sun) will set the date to the last Sunday + SetToWeekDay(wxDateTime::Sun, -1) will set the date to the last Sunday in the current month. @return @true if the date was modified successfully, @false otherwise From 8e4b492cf4f675562aee31a59242d7a8516feba0 Mon Sep 17 00:00:00 2001 From: dghart Date: Sat, 26 Jan 2019 21:12:07 +0000 Subject: [PATCH 363/553] Clarify what happens if the wxDateTime::SetToWeekDay month and/or year parameters are left as the default Inv_Month/Inv_Year This causes the month and/or year being set to their wxDateTime::Now values, even if the original values in the wxDateTime object were valid. --- interface/wx/datetime.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index da7ef4a59a..53595c78be 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -1166,6 +1166,10 @@ public: SetToWeekDay(wxDateTime::Sun, -1) will set the date to the last Sunday in the current month. + Note that leaving the month or year parameters as their default values + will result in the current month or year being substituted, overwriting + any previous values in the wxDateTime object. + @return @true if the date was modified successfully, @false otherwise meaning that the specified date doesn't exist. */ From b1594725c9ffa883e3dce5bf64b90da0c48a3348 Mon Sep 17 00:00:00 2001 From: chris2oph Date: Fri, 25 Jan 2019 11:26:34 +0000 Subject: [PATCH 364/553] Use QWidget::update() rather than repaint() in wxClientDC Qt documentation advises to avoid calling repaint() except when an immediate update is required, i.e. it corresponds to wxWindow::Update(). Use update() instead to avoid many Qt warnings that appeared when resizing the caret sample window, for example. Closes https://github.com/wxWidgets/wxWidgets/pull/1178 --- src/qt/dcclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/dcclient.cpp b/src/qt/dcclient.cpp index d062f0455a..0137f4d6e1 100644 --- a/src/qt/dcclient.cpp +++ b/src/qt/dcclient.cpp @@ -106,7 +106,7 @@ wxClientDCImpl::~wxClientDCImpl() if ( !pict->isNull() && !widget->paintingActive() && !rect.isEmpty() ) { // only force the update of the rect affected by the DC - widget->repaint( rect ); + widget->update( rect ); } else { From 0265139c112e1696a54d63d5c1a1f692898909c1 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Fri, 25 Jan 2019 16:33:58 +0000 Subject: [PATCH 365/553] Track Qt tab widget selection when adding pages to wxNotebook Ensure the selected state tracks the Qt selection: without this, if no explicit selection is made after adding the pages, wxNotebook::GetSelection() returns wxNOT_FOUND even though the first page is selected. Closes https://github.com/wxWidgets/wxWidgets/pull/1182 --- src/qt/notebook.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 4f00fa31f1..27d4ce7387 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -154,6 +154,7 @@ bool wxNotebook::InsertPage(size_t n, wxWindow *page, const wxString& text, // reenable firing qt signals as internal wx initialization was completed m_qtTabWidget->blockSignals(false); + m_selection = m_qtTabWidget->currentIndex(); if (bSelect && GetPageCount() > 1) { From 4fc38bc2c70ebff7d62d98ad962ce0bd02e67f4f Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 27 Jan 2019 14:41:00 +0100 Subject: [PATCH 366/553] Improve minimum width of wxRadioBox Take the minimum width of the wxStaticBox into account, instead of only the width of the label. --- src/msw/radiobox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 43a69bbc3e..c0b93032a7 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -586,10 +586,9 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const reinterpret_cast(const_cast(this))).y / 2; // and also wide enough for its label - int widthLabel; - GetTextExtent(GetLabelText(), &widthLabel, NULL); - if ( widthLabel > width ) - width = widthLabel; + int widthBox = wxStaticBox::DoGetBestSize().x; + if ( widthBox > width ) + width = widthBox; return wxSize(width, height); } From a377f0e5f06301d52ad9aa56b26d1b2d37881f08 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 27 Jan 2019 14:48:48 +0100 Subject: [PATCH 367/553] Get rid of wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM styles This was only used in wxUniv, wxRA_SPECIFY_[COLS/ROWS] can be used instead. Do not remove them from the definitions, to not break user code. Closes #18100. --- include/wx/defs.h | 3 +-- interface/wx/defs.h | 3 +-- samples/widgets/radiobox.cpp | 51 +----------------------------------- src/univ/radiobox.cpp | 28 +++----------------- 4 files changed, 7 insertions(+), 78 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 2af9664744..1871ae13e4 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1568,9 +1568,8 @@ enum wxBorder /* * wxRadioBox style flags + * These styles are not used in any port. */ -/* should we number the items from left to right or from top to bottom in a 2d */ -/* radiobox? */ #define wxRA_LEFTTORIGHT 0x0001 #define wxRA_TOPTOBOTTOM 0x0002 diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 1e1e47431d..2359cdcaab 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -379,9 +379,8 @@ enum wxBorder /* * wxRadioBox style flags + * These styles are not used in any port. */ -/* should we number the items from left to right or from top to bottom in a 2d */ -/* radiobox? */ #define wxRA_LEFTTORIGHT 0x0001 #define wxRA_TOPTOBOTTOM 0x0002 diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 2d109a51fe..048b79ea5a 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -60,14 +60,6 @@ enum RadioPage_Radio }; -// layout direction radiobox selections -enum -{ - RadioDir_Default, - RadioDir_LtoR, - RadioDir_TtoB -}; - // default values for the number of radiobox items static const unsigned int DEFAULT_NUM_ENTRIES = 12; static const unsigned int DEFAULT_MAJOR_DIM = 3; @@ -123,7 +115,6 @@ protected: wxCheckBox *m_chkSpecifyRows; wxCheckBox *m_chkEnableItem; wxCheckBox *m_chkShowItem; - wxRadioBox *m_radioDir; // the gauge itself and the sizer it is in wxRadioBox *m_radio; @@ -197,8 +188,7 @@ RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book, m_textLabelBtns = m_textLabel = (wxTextCtrl *)NULL; - m_radio = - m_radioDir = (wxRadioBox *)NULL; + m_radio = (wxRadioBox *)NULL; m_sizerRadio = (wxSizer *)NULL; } @@ -217,24 +207,6 @@ void RadioWidgetsPage::CreateContent() "Major specifies &rows count" ); - static const wxString layoutDir[] = - { - "default", - "left to right", - "top to bottom" - }; - - m_radioDir = new wxRadioBox(this, wxID_ANY, "Numbering:", - wxDefaultPosition, wxDefaultSize, - WXSIZEOF(layoutDir), layoutDir, - 1, wxRA_SPECIFY_COLS); - sizerLeft->Add(m_radioDir, 0, wxGROW | wxALL, 5); - - // if it's not defined, we can't change the radiobox direction -#ifndef wxRA_LEFTTORIGHT - m_radioDir->Disable(); -#endif // wxRA_LEFTTORIGHT - wxSizer *sizerRow; sizerRow = CreateSizerWithTextAndLabel("&Major dimension:", wxID_ANY, @@ -320,7 +292,6 @@ void RadioWidgetsPage::Reset() m_chkSpecifyRows->SetValue(false); m_chkEnableItem->SetValue(true); m_chkShowItem->SetValue(true); - m_radioDir->SetSelection(RadioDir_Default); } void RadioWidgetsPage::CreateRadio() @@ -371,26 +342,6 @@ void RadioWidgetsPage::CreateRadio() flags |= GetAttrs().m_defaultFlags; -#ifdef wxRA_LEFTTORIGHT - switch ( m_radioDir->GetSelection() ) - { - default: - wxFAIL_MSG( "unexpected wxRadioBox layout direction" ); - wxFALLTHROUGH; - - case RadioDir_Default: - break; - - case RadioDir_LtoR: - flags |= wxRA_LEFTTORIGHT; - break; - - case RadioDir_TtoB: - flags |= wxRA_TOPTOBOTTOM; - break; - } -#endif // wxRA_LEFTTORIGHT - m_radio = new wxRadioBox(this, RadioPage_Radio, m_textLabel->GetValue(), wxDefaultPosition, wxDefaultSize, diff --git a/src/univ/radiobox.cpp b/src/univ/radiobox.cpp index dd3049631b..50883e472f 100644 --- a/src/univ/radiobox.cpp +++ b/src/univ/radiobox.cpp @@ -140,28 +140,8 @@ bool wxRadioBox::Create(wxWindow *parent, const wxValidator& wxVALIDATOR_PARAM(val), const wxString& name) { - // for compatibility with the other ports which don't handle (yet?) - // wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM flags, we add them ourselves if - // not specified - if ( !(style & (wxRA_LEFTTORIGHT | wxRA_TOPTOBOTTOM)) ) - { - // horizontal radiobox use left to right layout - if ( style & wxRA_SPECIFY_COLS ) - { - style |= wxRA_LEFTTORIGHT; - } - else if ( style & wxRA_SPECIFY_ROWS ) - { - style |= wxRA_TOPTOBOTTOM; - } - else - { - wxFAIL_MSG( wxT("you must specify wxRA_XXX style!") ); - - // use default - style = wxRA_SPECIFY_COLS | wxRA_LEFTTORIGHT; - } - } + if ( !(style & (wxRA_SPECIFY_ROWS | wxRA_SPECIFY_COLS)) ) + style |= wxRA_SPECIFY_COLS; if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) ) return false; @@ -447,7 +427,7 @@ void wxRadioBox::DoMoveWindow(int x0, int y0, int width, int height) { m_buttons[n]->SetSize(x, y, sizeBtn.x, sizeBtn.y); - if ( GetWindowStyle() & wxRA_TOPTOBOTTOM ) + if ( GetWindowStyle() & wxRA_SPECIFY_ROWS ) { // from top to bottom if ( (n + 1) % GetRowCount() ) @@ -462,7 +442,7 @@ void wxRadioBox::DoMoveWindow(int x0, int y0, int width, int height) y = y0; } } - else // wxRA_LEFTTORIGHT: mirror the code above + else // wxRA_SPECIFY_COLS: mirror the code above { // from left to right if ( (n + 1) % GetColumnCount() ) From 0d5ed276a4c811884a2246ac3df694d5707d3064 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 27 Jan 2019 15:00:29 +0100 Subject: [PATCH 368/553] Update radio page in widgets sample Make the reset button work by binding to OnUpdateUIReset. Use wxSizerFlags based API. Remove minimum size of right panel so the minimum size of wxRadioBox can be verified. Use wxArrayString instead of manually creating and deleting an array of wxString pointers. Reapply disabling and hiding the test button, and check if test button is available. Layout the entire page instead of only the sizer, see #18100. --- samples/widgets/radiobox.cpp | 59 ++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 048b79ea5a..62ab26a598 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -146,6 +146,7 @@ wxBEGIN_EVENT_TABLE(RadioWidgetsPage, WidgetsPage) EVT_BUTTON(RadioPage_Selection, RadioWidgetsPage::OnButtonSelection) EVT_BUTTON(RadioPage_Label, RadioWidgetsPage::OnButtonSetLabel) + EVT_UPDATE_UI(RadioPage_Reset, RadioWidgetsPage::OnUpdateUIReset) EVT_UPDATE_UI(RadioPage_Update, RadioWidgetsPage::OnUpdateUIUpdate) EVT_UPDATE_UI(RadioPage_Selection, RadioWidgetsPage::OnUpdateUISelection) @@ -211,21 +212,21 @@ void RadioWidgetsPage::CreateContent() sizerRow = CreateSizerWithTextAndLabel("&Major dimension:", wxID_ANY, &m_textMajorDim); - sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); + sizerLeft->Add(sizerRow, wxSizerFlags().Expand().Border()); sizerRow = CreateSizerWithTextAndLabel("&Number of buttons:", wxID_ANY, &m_textNumBtns); - sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); + sizerLeft->Add(sizerRow, wxSizerFlags().Expand().Border()); wxButton *btn; btn = new wxButton(this, RadioPage_Update, "&Update"); - sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 5); + sizerLeft->Add(btn, wxSizerFlags().CentreHorizontal().Border()); - sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer + sizerLeft->AddSpacer(5); btn = new wxButton(this, RadioPage_Reset, "&Reset"); - sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); + sizerLeft->Add(btn, wxSizerFlags().CentreHorizontal().Border(wxALL, 15)); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change parameters"); @@ -234,25 +235,25 @@ void RadioWidgetsPage::CreateContent() sizerRow = CreateSizerWithTextAndLabel("Current selection:", wxID_ANY, &m_textCurSel); - sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); + sizerMiddle->Add(sizerRow, wxSizerFlags().Expand().Border()); sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection, "&Change selection:", wxID_ANY, &m_textSel); - sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); + sizerMiddle->Add(sizerRow, wxSizerFlags().Expand().Border()); sizerRow = CreateSizerWithTextAndButton(RadioPage_Label, "&Label for box:", wxID_ANY, &m_textLabel); - sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); + sizerMiddle->Add(sizerRow, wxSizerFlags().Expand().Border()); sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn, "&Label for buttons:", wxID_ANY, &m_textLabelBtns); - sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); + sizerMiddle->Add(sizerRow, wxSizerFlags().Expand().Border()); m_chkEnableItem = CreateCheckBoxAndAddToSizer(sizerMiddle, "Disable &2nd item", @@ -263,16 +264,18 @@ void RadioWidgetsPage::CreateContent() // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - sizerRight->SetMinSize(150, 0); m_sizerRadio = sizerRight; // save it to modify it later Reset(); CreateRadio(); // the 3 panes panes compose the window - sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); - sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10); - sizerTop->Add(sizerRight, 0, wxGROW | (wxALL & ~wxRIGHT), 10); + sizerTop->Add(sizerLeft, + wxSizerFlags(0).Expand().Border((wxALL & ~wxLEFT), 10)); + sizerTop->Add(sizerMiddle, + wxSizerFlags(1).Expand().Border(wxALL, 10)); + sizerTop->Add(sizerRight, + wxSizerFlags(0).Expand().Border((wxALL & ~wxRIGHT), 10)); // final initializations SetSizer(sizerTop); @@ -328,13 +331,13 @@ void RadioWidgetsPage::CreateRadio() majorDim = DEFAULT_MAJOR_DIM; } - wxString *items = new wxString[count]; + wxArrayString items; wxString labelBtn = m_textLabelBtns->GetValue(); for ( size_t n = 0; n < count; n++ ) { - items[n] = wxString::Format("%s %lu", - labelBtn, (unsigned long)n + 1); + items.push_back(wxString::Format("%s %lu", + labelBtn, (unsigned long)n + 1)); } int flags = m_chkSpecifyRows->GetValue() ? wxRA_SPECIFY_ROWS @@ -345,22 +348,26 @@ void RadioWidgetsPage::CreateRadio() m_radio = new wxRadioBox(this, RadioPage_Radio, m_textLabel->GetValue(), wxDefaultPosition, wxDefaultSize, - count, items, + items, majorDim, flags); - delete [] items; - if ( sel >= 0 && (size_t)sel < count ) { m_radio->SetSelection(sel); } - m_sizerRadio->Add(m_radio, 1, wxGROW); - m_sizerRadio->Layout(); + if ( count > TEST_BUTTON ) + { + m_radio->Enable(TEST_BUTTON, m_chkEnableItem->IsChecked()); + m_radio->Show(TEST_BUTTON, m_chkShowItem->IsChecked()); + } - m_chkEnableItem->SetValue(true); - m_chkEnableItem->SetValue(true); + m_sizerRadio->Add(m_radio, wxSizerFlags(1).Expand()); + Layout(); + + m_chkEnableItem->Enable(count > TEST_BUTTON); + m_chkShowItem->Enable(count > TEST_BUTTON); } // ---------------------------------------------------------------------------- @@ -467,12 +474,18 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event) void RadioWidgetsPage::OnUpdateUIEnableItem(wxUpdateUIEvent& event) { + if ( m_radio->GetCount() <= TEST_BUTTON ) + return; + event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? "Disable &2nd item" : "Enable &2nd item"); } void RadioWidgetsPage::OnUpdateUIShowItem(wxUpdateUIEvent& event) { + if ( m_radio->GetCount() <= TEST_BUTTON ) + return; + event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? "Hide 2nd &item" : "Show 2nd &item"); } From a6fbfacc62a483a448c489a4534a80800b38e40d Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 27 Jan 2019 15:10:32 +0100 Subject: [PATCH 369/553] Improve wxButton and wxToggleButton with bitmap in widgets sample Use a valid font when creating the bitmap. Create the bitmap with a DPI independent size. Use different images for different button states, as described by the checkbox options. Add a checkbox to disable the bitmap. Recreate the button when changing label, so the bitmap is updated. Implement the 'fit exactly' option on ToggleButton page. --- samples/widgets/button.cpp | 33 ++++++++++++++-------- samples/widgets/toggle.cpp | 56 ++++++++++++++++++++++++++++---------- 2 files changed, 64 insertions(+), 25 deletions(-) diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index 98d9473a39..2fa95866a7 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -115,7 +115,7 @@ protected: void AddButtonToSizer(); // helper function: create a bitmap for wxBitmapButton - wxBitmap CreateBitmap(const wxString& label); + wxBitmap CreateBitmap(const wxString& label, const wxArtID& type); // the controls @@ -133,7 +133,8 @@ protected: *m_chkUseMarkup, #endif // wxUSE_MARKUP *m_chkDefault, - *m_chkUseBitmapClass; + *m_chkUseBitmapClass, + *m_chkDisable; // more checkboxes for wxBitmapButton only wxCheckBox *m_chkUsePressed, @@ -216,6 +217,7 @@ ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book, #endif // wxUSE_MARKUP m_chkDefault = m_chkUseBitmapClass = + m_chkDisable = m_chkUsePressed = m_chkUseFocused = m_chkUseCurrent = @@ -256,6 +258,8 @@ void ButtonWidgetsPage::CreateContent() "Use wxBitmapButton"); m_chkUseBitmapClass->SetValue(true); + m_chkDisable = CreateCheckBoxAndAddToSizer(sizerLeft, "Disable"); + sizerLeft->AddSpacer(5); wxSizer *sizerUseLabels = @@ -368,6 +372,7 @@ void ButtonWidgetsPage::Reset() m_chkUseMarkup->SetValue(false); #endif // wxUSE_MARKUP m_chkUseBitmapClass->SetValue(true); + m_chkDisable->SetValue(false); m_chkUsePressed->SetValue(true); m_chkUseFocused->SetValue(true); @@ -456,22 +461,22 @@ void ButtonWidgetsPage::CreateButton() if ( m_chkUseBitmapClass->GetValue() ) { bbtn = new wxBitmapButton(this, ButtonPage_Button, - CreateBitmap("normal"), + CreateBitmap("normal", wxART_INFORMATION), wxDefaultPosition, wxDefaultSize, flags); } else { bbtn = new wxButton(this, ButtonPage_Button); - bbtn->SetBitmapLabel(CreateBitmap("normal")); + bbtn->SetBitmapLabel(CreateBitmap("normal", wxART_INFORMATION)); } if ( m_chkUsePressed->GetValue() ) - bbtn->SetBitmapPressed(CreateBitmap("pushed")); + bbtn->SetBitmapPressed(CreateBitmap("pushed", wxART_HELP)); if ( m_chkUseFocused->GetValue() ) - bbtn->SetBitmapFocus(CreateBitmap("focused")); + bbtn->SetBitmapFocus(CreateBitmap("focused", wxART_ERROR)); if ( m_chkUseCurrent->GetValue() ) - bbtn->SetBitmapCurrent(CreateBitmap("hover")); + bbtn->SetBitmapCurrent(CreateBitmap("hover", wxART_WARNING)); if ( m_chkUseDisabled->GetValue() ) - bbtn->SetBitmapDisabled(CreateBitmap("disabled")); + bbtn->SetBitmapDisabled(CreateBitmap("disabled", wxART_MISSING_IMAGE)); m_button = bbtn; #if wxUSE_COMMANDLINKBUTTON m_cmdLnkButton = NULL; @@ -543,6 +548,8 @@ void ButtonWidgetsPage::CreateButton() if ( m_chkDefault->GetValue() ) m_button->SetDefault(); + m_button->Enable(!m_chkDisable->IsChecked()); + AddButtonToSizer(); m_sizerButton->Layout(); @@ -597,6 +604,9 @@ void ButtonWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) m_button->SetLabel(labelText); } + if ( m_chkBitmapOnly->IsChecked() ) + CreateButton(); + m_sizerButton->Layout(); } @@ -618,17 +628,18 @@ void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event)) // bitmap button stuff // ---------------------------------------------------------------------------- -wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label) +wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label, const wxArtID& type) { - wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this + wxBitmap bmp(FromDIP(wxSize(180, 70))); // shouldn't hardcode but it's simpler like this wxMemoryDC dc; dc.SelectObject(bmp); + dc.SetFont(GetFont()); dc.SetBackground(*wxCYAN_BRUSH); dc.Clear(); dc.SetTextForeground(*wxBLACK); dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n" "(" + label + " state)", - wxArtProvider::GetBitmap(wxART_INFORMATION), + wxArtProvider::GetBitmap(type), wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20), wxALIGN_CENTRE); diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index d435642951..ecfeaeb0c9 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -108,8 +108,11 @@ protected: // (re)create the toggle void CreateToggle(); + // add m_button to m_sizerButton using current value of m_chkFit + void AddButtonToSizer(); + // helper function: create a bitmap for wxBitmapToggleButton - wxBitmap CreateBitmap(const wxString& label); + wxBitmap CreateBitmap(const wxString& label, const wxArtID& type); // the controls // ------------ @@ -122,7 +125,8 @@ protected: wxCheckBox *m_chkBitmapOnly, *m_chkTextAndBitmap, *m_chkFit, - *m_chkUseBitmapClass; + *m_chkUseBitmapClass, + *m_chkDisable; // more checkboxes for wxBitmapToggleButton only wxCheckBox *m_chkUsePressed, @@ -192,6 +196,7 @@ ToggleWidgetsPage::ToggleWidgetsPage(WidgetsBookCtrl *book, m_chkTextAndBitmap = m_chkFit = m_chkUseBitmapClass = + m_chkDisable = m_chkUsePressed = m_chkUseFocused = m_chkUseCurrent = @@ -231,6 +236,8 @@ void ToggleWidgetsPage::CreateContent() "Use wxBitmapToggleButton"); m_chkUseBitmapClass->SetValue(true); + m_chkDisable = CreateCheckBoxAndAddToSizer(sizerLeft, "Disable"); + sizerLeft->AddSpacer(5); wxSizer *sizerUseLabels = @@ -327,6 +334,7 @@ void ToggleWidgetsPage::Reset() m_chkUseMarkup->SetValue(false); #endif // wxUSE_MARKUP m_chkUseBitmapClass->SetValue(true); + m_chkDisable->SetValue(false); m_chkUsePressed->SetValue(true); m_chkUseFocused->SetValue(true); @@ -419,22 +427,22 @@ void ToggleWidgetsPage::CreateToggle() if ( m_chkUseBitmapClass->GetValue() ) { btgl = new wxBitmapToggleButton(this, TogglePage_Picker, - CreateBitmap("normal")); + CreateBitmap("normal", wxART_INFORMATION)); } else { btgl = new wxToggleButton(this, TogglePage_Picker, ""); - btgl->SetBitmapLabel(CreateBitmap("normal")); + btgl->SetBitmapLabel(CreateBitmap("normal", wxART_INFORMATION)); } #ifdef wxHAS_ANY_BUTTON if ( m_chkUsePressed->GetValue() ) - btgl->SetBitmapPressed(CreateBitmap("pushed")); + btgl->SetBitmapPressed(CreateBitmap("pushed", wxART_HELP)); if ( m_chkUseFocused->GetValue() ) - btgl->SetBitmapFocus(CreateBitmap("focused")); + btgl->SetBitmapFocus(CreateBitmap("focused", wxART_ERROR)); if ( m_chkUseCurrent->GetValue() ) - btgl->SetBitmapCurrent(CreateBitmap("hover")); + btgl->SetBitmapCurrent(CreateBitmap("hover", wxART_WARNING)); if ( m_chkUseDisabled->GetValue() ) - btgl->SetBitmapDisabled(CreateBitmap("disabled")); + btgl->SetBitmapDisabled(CreateBitmap("disabled", wxART_MISSING_IMAGE)); #endif // wxHAS_ANY_BUTTON m_toggle = btgl; } @@ -473,6 +481,7 @@ void ToggleWidgetsPage::CreateToggle() #endif // wxHAS_ANY_BUTTON m_chkUseBitmapClass->Enable(showsBitmap); + m_chkTextAndBitmap->Enable(!m_chkBitmapOnly->IsChecked()); m_chkUsePressed->Enable(showsBitmap); m_chkUseFocused->Enable(showsBitmap); @@ -480,12 +489,27 @@ void ToggleWidgetsPage::CreateToggle() m_chkUseDisabled->Enable(showsBitmap); #endif // wxHAS_BITMAPTOGGLEBUTTON - m_sizerToggle->Add(0, 0, 1, wxCENTRE); - m_sizerToggle->Add(m_toggle, 1, wxCENTRE); - m_sizerToggle->Add(0, 0, 1, wxCENTRE); + m_toggle->Enable(!m_chkDisable->IsChecked()); + + AddButtonToSizer(); + m_sizerToggle->Layout(); } +void ToggleWidgetsPage::AddButtonToSizer() +{ + if ( m_chkFit->GetValue() ) + { + m_sizerToggle->AddStretchSpacer(1); + m_sizerToggle->Add(m_toggle, wxSizerFlags(0).Centre().Border()); + m_sizerToggle->AddStretchSpacer(1); + } + else // take up the entire space + { + m_sizerToggle->Add(m_toggle, wxSizerFlags(1).Expand().Border()); + } +} + // ---------------------------------------------------------------------------- // event handlers // ---------------------------------------------------------------------------- @@ -512,6 +536,9 @@ void ToggleWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) else #endif // wxUSE_MARKUP m_toggle->SetLabel(labelText); + + if ( m_chkBitmapOnly->IsChecked() ) + CreateToggle(); } #ifdef wxHAS_BITMAPTOGGLEBUTTON @@ -519,17 +546,18 @@ void ToggleWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) // bitmap toggle button stuff // ---------------------------------------------------------------------------- -wxBitmap ToggleWidgetsPage::CreateBitmap(const wxString& label) +wxBitmap ToggleWidgetsPage::CreateBitmap(const wxString& label, const wxArtID& type) { - wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this + wxBitmap bmp(FromDIP(wxSize(180, 70))); // shouldn't hardcode but it's simpler like this wxMemoryDC dc; dc.SelectObject(bmp); + dc.SetFont(GetFont()); dc.SetBackground(*wxCYAN_BRUSH); dc.Clear(); dc.SetTextForeground(*wxBLACK); dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n" "(" + label + " state)", - wxArtProvider::GetBitmap(wxART_INFORMATION), + wxArtProvider::GetBitmap(type), wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20), wxALIGN_CENTRE); From ee752e24396d7540b8363ce80fad02c045b665c6 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 27 Jan 2019 15:23:02 +0100 Subject: [PATCH 370/553] Use more wxSizerFlags in widgets sample --- samples/widgets/button.cpp | 23 +++++++++++++---------- samples/widgets/toggle.cpp | 21 ++++++++++++--------- samples/widgets/widgets.cpp | 20 ++++++++++---------- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index 2fa95866a7..e5881ed46d 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -284,7 +284,7 @@ void ButtonWidgetsPage::CreateContent() m_radioImagePos = new wxRadioBox(this, wxID_ANY, "Image &position", wxDefaultPosition, wxDefaultSize, WXSIZEOF(dirs), dirs); - sizerLeft->Add(m_radioImagePos, 0, wxGROW | wxALL, 5); + sizerLeft->Add(m_radioImagePos, wxSizerFlags().Expand().Border()); sizerLeft->AddSpacer(15); // should be in sync with enums Button[HV]Align! @@ -309,13 +309,13 @@ void ButtonWidgetsPage::CreateContent() wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign); - sizerLeft->Add(m_radioHAlign, 0, wxGROW | wxALL, 5); - sizerLeft->Add(m_radioVAlign, 0, wxGROW | wxALL, 5); + sizerLeft->Add(m_radioHAlign, wxSizerFlags().Expand().Border()); + sizerLeft->Add(m_radioVAlign, wxSizerFlags().Expand().Border()); - sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer + sizerLeft->AddSpacer(5); wxButton *btn = new wxButton(this, ButtonPage_Reset, "&Reset"); - sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); + sizerLeft->Add(btn, wxSizerFlags().CentreHorizontal().Border(wxALL, 15)); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); @@ -326,7 +326,7 @@ void ButtonWidgetsPage::CreateContent() wxID_ANY, &m_textLabel); m_textLabel->SetValue("&Press me!"); - sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); + sizerMiddle->Add(sizerRow, wxSizerFlags().Expand().Border()); #if wxUSE_COMMANDLINKBUTTON m_sizerNote = CreateSizerWithTextAndButton(ButtonPage_ChangeNote, @@ -335,7 +335,7 @@ void ButtonWidgetsPage::CreateContent() &m_textNote); m_textNote->SetValue("Writes down button clicks in the log."); - sizerMiddle->Add(m_sizerNote, 0, wxALL | wxGROW, 5); + sizerMiddle->Add(m_sizerNote, wxSizerFlags().Expand().Border()); #endif // right pane @@ -343,9 +343,12 @@ void ButtonWidgetsPage::CreateContent() m_sizerButton->SetMinSize(150, 0); // the 3 panes panes compose the window - sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); - sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10); - sizerTop->Add(m_sizerButton, 1, wxGROW | (wxALL & ~wxRIGHT), 10); + sizerTop->Add(sizerLeft, + wxSizerFlags(0).Expand().Border((wxALL & ~wxLEFT), 10)); + sizerTop->Add(sizerMiddle, + wxSizerFlags(1).Expand().Border(wxALL, 10)); + sizerTop->Add(m_sizerButton, + wxSizerFlags(1).Expand().Border((wxALL & ~wxRIGHT), 10)); // do create the main control Reset(); diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index ecfeaeb0c9..2f61d261b3 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -262,7 +262,7 @@ void ToggleWidgetsPage::CreateContent() m_radioImagePos = new wxRadioBox(this, wxID_ANY, "Image &position", wxDefaultPosition, wxDefaultSize, WXSIZEOF(dirs), dirs); - sizerLeft->Add(m_radioImagePos, 0, wxGROW | wxALL, 5); + sizerLeft->Add(m_radioImagePos, wxSizerFlags().Expand().Border()); sizerLeft->AddSpacer(15); // should be in sync with enums Toggle[HV]Align! @@ -287,14 +287,14 @@ void ToggleWidgetsPage::CreateContent() wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign); - sizerLeft->Add(m_radioHAlign, 0, wxGROW | wxALL, 5); - sizerLeft->Add(m_radioVAlign, 0, wxGROW | wxALL, 5); + sizerLeft->Add(m_radioHAlign, wxSizerFlags().Expand().Border()); + sizerLeft->Add(m_radioVAlign, wxSizerFlags().Expand().Border()); #endif // wxHAS_BITMAPTOGGLEBUTTON - sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer + sizerLeft->AddSpacer(5); wxButton *btn = new wxButton(this, TogglePage_Reset, "&Reset"); - sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); + sizerLeft->Add(btn, wxSizerFlags().CentreHorizontal().Border(wxALL, 15)); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); @@ -306,16 +306,19 @@ void ToggleWidgetsPage::CreateContent() &m_textLabel); m_textLabel->SetValue("&Toggle me!"); - sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); + sizerMiddle->Add(sizerRow, wxSizerFlags().Expand().Border()); // right pane m_sizerToggle = new wxBoxSizer(wxHORIZONTAL); m_sizerToggle->SetMinSize(150, 0); // the 3 panes panes compose the window - sizerTop->Add(sizerLeft, 0, (wxALL & ~wxLEFT), 10); - sizerTop->Add(sizerMiddle, 1, wxGROW | wxALL, 10); - sizerTop->Add(m_sizerToggle, 1, wxGROW | (wxALL & ~wxRIGHT), 10); + sizerTop->Add(sizerLeft, + wxSizerFlags(0).Expand().Border((wxALL & ~wxLEFT), 10)); + sizerTop->Add(sizerMiddle, + wxSizerFlags(1).Expand().Border(wxALL, 10)); + sizerTop->Add(m_sizerToggle, + wxSizerFlags(1).Expand().Border((wxALL & ~wxRIGHT), 10)); // do create the main control Reset(); diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 381011490d..c2e44da45f 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -492,7 +492,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxVERTICAL); m_lboxLog = new wxListBox(m_panel, wxID_ANY); - sizerDown->Add(m_lboxLog, 1, wxGROW | wxALL, 5); + sizerDown->Add(m_lboxLog, wxSizerFlags(1).Expand().Border()); sizerDown->SetMinSize(100, 150); #else wxSizer *sizerDown = new wxBoxSizer(wxVERTICAL); @@ -503,16 +503,16 @@ WidgetsFrame::WidgetsFrame(const wxString& title) #if USE_LOG btn = new wxButton(m_panel, Widgets_ClearLog, "Clear &log"); sizerBtns->Add(btn); - sizerBtns->Add(10, 0); // spacer + sizerBtns->AddSpacer(10); #endif // USE_LOG btn = new wxButton(m_panel, Widgets_Quit, "E&xit"); sizerBtns->Add(btn); - sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5); + sizerDown->Add(sizerBtns, wxSizerFlags().Border().Right()); // put everything together - sizerTop->Add(m_book, 1, wxGROW | (wxALL & ~(wxTOP | wxBOTTOM)), 10); - sizerTop->Add(0, 5, 0, wxGROW); // spacer in between - sizerTop->Add(sizerDown, 0, wxGROW | (wxALL & ~wxTOP), 10); + sizerTop->Add(m_book, wxSizerFlags(1).Expand().DoubleBorder(wxALL & ~(wxTOP | wxBOTTOM))); + sizerTop->AddSpacer(5); + sizerTop->Add(sizerDown, wxSizerFlags(0).Expand().DoubleBorder(wxALL & ~wxTOP)); m_panel->SetSizer(sizerTop); @@ -1347,8 +1347,8 @@ wxSizer *WidgetsPage::CreateSizerWithText(wxControl *control, wxTextCtrl *text = new wxTextCtrl(this, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); - sizerRow->Add(control, 0, wxRIGHT | wxALIGN_CENTRE_VERTICAL, 5); - sizerRow->Add(text, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5); + sizerRow->Add(control, wxSizerFlags(0).Border(wxRIGHT).CentreVertical()); + sizerRow->Add(text, wxSizerFlags(1).Border(wxLEFT).CentreVertical()); if ( ppText ) *ppText = text; @@ -1379,8 +1379,8 @@ wxCheckBox *WidgetsPage::CreateCheckBoxAndAddToSizer(wxSizer *sizer, wxWindowID id) { wxCheckBox *checkbox = new wxCheckBox(this, id, label); - sizer->Add(checkbox, 0, wxLEFT | wxRIGHT, 5); - sizer->Add(0, 2, 0, wxGROW); // spacer + sizer->Add(checkbox, wxSizerFlags().HorzBorder()); + sizer->AddSpacer(2); return checkbox; } From eaee93101195de0dc231c4e792dc2ee2f5c95542 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Sat, 26 Jan 2019 20:49:16 -0500 Subject: [PATCH 371/553] Fix sending of EVT_KEY_DOWN on wxGTK for non-ASCII characters Instead of returning early if the keycode is invalid, try setting the unicode character first, and if neither are valid, return. Fixes #18054 --- src/gtk/window.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 8e15376cff..64de6656eb 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1071,14 +1071,10 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, wxLogTrace(TRACE_KEYS, wxT("\t-> wxKeyCode %ld"), key_code); - // sending unknown key events doesn't really make sense - if ( !key_code ) - return false; - event.m_keyCode = key_code; #if wxUSE_UNICODE - event.m_uniChar = gdk_keyval_to_unicode(key_code); + event.m_uniChar = gdk_keyval_to_unicode(key_code ? key_code : gdk_event->keyval); if ( !event.m_uniChar && event.m_keyCode <= WXK_DELETE ) { // Set Unicode key code to the ASCII equivalent for compatibility. E.g. @@ -1088,6 +1084,10 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, } #endif // wxUSE_UNICODE + // sending unknown key events doesn't really make sense + if ( !key_code && !event.m_uniChar ) + return false; + // now fill all the other fields wxFillOtherKeyEventFields(event, win, gdk_event); From 8deb2cf0bbdc5e03609a24e382523df39db45844 Mon Sep 17 00:00:00 2001 From: Tomay Date: Thu, 10 Jan 2019 05:07:39 +0100 Subject: [PATCH 372/553] Add wxUSE_WINSOCK2 wxMSW option to include winsock2.h Including and is incompatible and if the application wants to use the latter, it may be convenient to define wxUSE_WINSOCK2 when building wxWidgets instead of having to work around winsock.h implicit inclusion from include/wx/msw/wrapwin.h. Closes https://github.com/wxWidgets/wxWidgets/pull/1122 --- build/cmake/options.cmake | 1 + build/cmake/setup.h.in | 2 ++ docs/doxygen/mainpages/const_wxusedef.h | 3 +++ include/wx/android/setup.h | 7 +++++++ include/wx/gtk/setup0.h | 7 +++++++ include/wx/msw/chkconf.h | 18 ++++++++++++++++++ include/wx/msw/setup0.h | 7 +++++++ include/wx/msw/setup_inc.h | 7 +++++++ include/wx/msw/wrapwin.h | 7 ++++--- include/wx/univ/setup0.h | 7 +++++++ setup.h.in | 2 ++ 11 files changed, 65 insertions(+), 3 deletions(-) diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 3a2a13d42a..b7703811ac 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -174,6 +174,7 @@ if(WIN32) endif() wx_option(wxUSE_DBGHELP "use dbghelp.dll API" ${wxUSE_DBGHELP_DEFAULT}) wx_option(wxUSE_INICONF "use wxIniConfig") + wx_option(wxUSE_WINSOCK2 "include rather than " OFF) wx_option(wxUSE_REGKEY "use wxRegKey class") endif() diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 8b3788591c..af4d7326d7 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -714,6 +714,8 @@ #cmakedefine01 wxUSE_INICONF +#cmakedefine01 wxUSE_WINSOCK2 + #cmakedefine01 wxUSE_DATEPICKCTRL_GENERIC diff --git a/docs/doxygen/mainpages/const_wxusedef.h b/docs/doxygen/mainpages/const_wxusedef.h index 9d52ed1821..12f1f9334d 100644 --- a/docs/doxygen/mainpages/const_wxusedef.h +++ b/docs/doxygen/mainpages/const_wxusedef.h @@ -348,6 +348,9 @@ compilers. See also wxUSE_NO_MANIFEST.} @itemdef{wxUSE_WIN_METAFILES_ALWAYS, Use wxMetaFile even when wxUSE_ENH_METAFILE=1.} @itemdef{wxUSE_WINRT, Enable WinRT support.} @itemdef{wxUSE_WXDIB, Use wxDIB class.} +@itemdef{wxUSE_WINSOCK2, Include @c instead of @c . +Turned on automatically if ::wxUSE_IPV6 is on (this option is new since +wxWidgets 3.1.3).} @endDefList diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index ccc99e7ad0..029987479f 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -1661,6 +1661,13 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 +// Set to 1 if you need to include over +// +// Default is 0. +// +// Recommended setting: 0 +#define wxUSE_WINSOCK2 0 + // ---------------------------------------------------------------------------- // Generic versions of native controls // ---------------------------------------------------------------------------- diff --git a/include/wx/gtk/setup0.h b/include/wx/gtk/setup0.h index 22ee07b8d0..c581562c6b 100644 --- a/include/wx/gtk/setup0.h +++ b/include/wx/gtk/setup0.h @@ -1713,6 +1713,13 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 +// Set to 1 if you need to include over +// +// Default is 0. +// +// Recommended setting: 0, set to 1 automatically if wxUSE_IPV6 is 1. +#define wxUSE_WINSOCK2 0 + // ---------------------------------------------------------------------------- // Generic versions of native controls // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index 4ef7be5d7f..6f9c161d37 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -118,6 +118,14 @@ # endif #endif /* wxUSE_UXTHEME */ +#ifndef wxUSE_WINSOCK2 +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_WINSOCK2 must be defined." +# else +# define wxUSE_WINSOCK2 0 +# endif +#endif /* wxUSE_WINSOCK2 */ + /* * Unfortunately we can't use compiler TLS support if the library can be used * inside a dynamically loaded DLL under Windows XP, as this can result in hard @@ -455,4 +463,14 @@ # define wxUSE_POSTSCRIPT 1 #endif +/* + IPv6 support requires winsock2.h, but the default of wxUSE_WINSOCK2 is 0. + Don't require changing it explicitly and just turn it on automatically if + wxUSE_IPV6 is on. + */ +#if wxUSE_IPV6 && !wxUSE_WINSOCK2 + #undef wxUSE_WINSOCK2 + #define wxUSE_WINSOCK2 1 +#endif + #endif /* _WX_MSW_CHKCONF_H_ */ diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index dcbb2d7fde..7b502ecbef 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -1713,6 +1713,13 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 +// Set to 1 if you need to include over +// +// Default is 0. +// +// Recommended setting: 0, set to 1 automatically if wxUSE_IPV6 is 1. +#define wxUSE_WINSOCK2 0 + // ---------------------------------------------------------------------------- // Generic versions of native controls // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/setup_inc.h b/include/wx/msw/setup_inc.h index ff5fc00102..6a1ea9dbec 100644 --- a/include/wx/msw/setup_inc.h +++ b/include/wx/msw/setup_inc.h @@ -156,6 +156,13 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 +// Set to 1 if you need to include over +// +// Default is 0. +// +// Recommended setting: 0, set to 1 automatically if wxUSE_IPV6 is 1. +#define wxUSE_WINSOCK2 0 + // ---------------------------------------------------------------------------- // Generic versions of native controls // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/wrapwin.h b/include/wx/msw/wrapwin.h index e4ef98a6b6..dbb3173af2 100644 --- a/include/wx/msw/wrapwin.h +++ b/include/wx/msw/wrapwin.h @@ -28,9 +28,10 @@ #endif // NOMINMAX -// For IPv6 support, we must include winsock2.h before winsock.h, and -// windows.h include winsock.h so do it before including it -#if wxUSE_IPV6 +// When the application wants to use (this is required for IPv6 +// support, for example), we must include it before winsock.h, and as windows.h +// includes winsock.h, we have to do it before including it. +#if wxUSE_WINSOCK2 #include #endif diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 11c7277097..0ebca727fd 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -1661,6 +1661,13 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 +// Set to 1 if you need to include over +// +// Default is 0. +// +// Recommended setting: 0 +#define wxUSE_WINSOCK2 0 + // ---------------------------------------------------------------------------- // Generic versions of native controls // ---------------------------------------------------------------------------- diff --git a/setup.h.in b/setup.h.in index 9f703405c1..b33699b9c9 100644 --- a/setup.h.in +++ b/setup.h.in @@ -714,6 +714,8 @@ #define wxUSE_INICONF 0 +#define wxUSE_WINSOCK2 0 + #define wxUSE_DATEPICKCTRL_GENERIC 0 From 07f64c3b75c79b79b46a7e8ac8db585a618c57da Mon Sep 17 00:00:00 2001 From: New Pagodi Date: Wed, 9 Jan 2019 12:09:30 -0600 Subject: [PATCH 373/553] Add wxPU_CONTAINS_CONTROLS style for wxPopupWindow This restores the default behavior of a popup window in MSW to the behavior it had before 56c419116838045f23f046112960d4e42f98f80d. The new flag added by this commit can be used to give the popup window the behavior from after that commit, i.e. choose the implementation using a WS_POPUP window rather than the default one using a WS_CHILD of the desktop. The old behavior kept the popup from taking focus from its parent window but left some controls not working. The new behavior has the popup take focus and lets all controls work. Closes https://github.com/wxWidgets/wxWidgets/pull/1123 --- include/wx/msw/popupwin.h | 4 +++ include/wx/popupwin.h | 16 +++++++++ interface/wx/popupwin.h | 13 +++++++ src/msw/popupwin.cpp | 75 ++++++++++++++++++++++++++++++++++----- 4 files changed, 100 insertions(+), 8 deletions(-) diff --git a/include/wx/msw/popupwin.h b/include/wx/msw/popupwin.h index d41dda58e5..bba24abfae 100644 --- a/include/wx/msw/popupwin.h +++ b/include/wx/msw/popupwin.h @@ -25,11 +25,15 @@ public: bool Create(wxWindow *parent, int flags = wxBORDER_NONE); + virtual void SetFocus() wxOVERRIDE; virtual bool Show(bool show = true) wxOVERRIDE; // return the style to be used for the popup windows virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const wxOVERRIDE; + // get the HWND to be used as parent of this window with CreateWindow() + virtual WXHWND MSWGetParent() const wxOVERRIDE; + // Implementation only from now on. diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h index 3d20bf4a7b..e8c0dd9242 100644 --- a/include/wx/popupwin.h +++ b/include/wx/popupwin.h @@ -15,6 +15,15 @@ #if wxUSE_POPUPWIN +// ---------------------------------------------------------------------------- +// wxPopupWindow specific flags +// ---------------------------------------------------------------------------- + +// This flag can be used in MSW if some controls are not working with the +// default popup style. +#define wxPU_CONTAINS_CONTROLS 0x0001 + + #include "wx/nonownedwnd.h" // ---------------------------------------------------------------------------- @@ -124,6 +133,13 @@ public: wxPopupTransientWindow() { } wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE) { Create(parent, style); } + bool Create(wxWindow *parent, int style = wxBORDER_NONE) + { + return wxPopupTransientWindowBase::Create + ( + parent, style | wxPU_CONTAINS_CONTROLS + ); + } // Implement base class pure virtuals. virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE; diff --git a/interface/wx/popupwin.h b/interface/wx/popupwin.h index 01af6cfa63..b1a00a71f6 100644 --- a/interface/wx/popupwin.h +++ b/interface/wx/popupwin.h @@ -11,6 +11,19 @@ A special kind of top level window used for popup menus, combobox popups and such. + @beginStyleTable + @style{wxPU_CONTAINS_CONTROLS} + By default in wxMSW, a popup window will not take focus from its parent + window. However many standard controls, including common ones such as + wxTextCtrl, need focus to function correctly and will not work when + placed on a default popup. This flag can be used to make the popup take + focus and let all controls work but at the price of not allowing the + parent window to keep focus while the popup is shown, which can also be + sometimes desirable. This style is currently only implemented in MSW + and simply does nothing under the other platforms (it's new since + wxWidgets 3.1.3). + @endStyleTable + @library{wxcore} @category{managedwnd} diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index 3784c52a98..525fd29469 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -64,13 +64,24 @@ WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const // we only honour the border flags, the others don't make sense for us WXDWORD style = wxWindow::MSWGetStyle(flags & wxBORDER_MASK, exstyle); - // We need to be a popup (i.e. not a child) window in order to not be - // confined to the parent window area, as is required for a drop down, for - // example. Old implementation used WS_CHILD and made this window a child - // of the desktop window, but this resulted in problems with handling input - // in the popup children, and so was changed to the current version. - style &= ~WS_CHILD; - style |= WS_POPUP; + // wxMSW uses 2 rather different implementations of wxPopupWindow + // internally, each one with its own limitations, so we allow specifying + // wxPU_CONTAINS_CONTROLS flag to select which one is used. The default is + // to use a child window of the desktop for the popup, which is compatible + // with the previous wxWidgets versions and works well for simple popups, + // but many standard controls can't work as children of such a window + // because it doesn't accept focus. So an alternative implementation for + // the popups that will contain such controls is available, but this one + // has problems due to the fact that it does take focus and not only can + // (and does) this break existing code, but it also prevents the parent + // window from keeping focus while showing the popup, as must be done when + // using auto-completion tooltips, for example. So neither implementation + // can be used in all cases and you have to explicitly choose your poison. + if ( HasFlag(wxPU_CONTAINS_CONTROLS) ) + { + style &= ~WS_CHILD; + style |= WS_POPUP; + } if ( exstyle ) { @@ -81,6 +92,31 @@ WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const return style; } +WXHWND wxPopupWindow::MSWGetParent() const +{ + if ( HasFlag(wxPU_CONTAINS_CONTROLS) ) + { + return wxPopupWindowBase::MSWGetParent(); + } + else + { + // we must be a child of the desktop to be able to extend beyond the + // parent window client area (like the comboboxes drop downs do) + return (WXHWND)::GetDesktopWindow(); + } +} + +void wxPopupWindow::SetFocus() +{ + // Focusing on a popup window does not work on MSW unless WS_POPUP style + // is set. Since this is only the case if the style wxPU_CONTAINS_CONTROLS + // is used, we'll handle the focus in that case and otherwise do nothing. + if ( HasFlag(wxPU_CONTAINS_CONTROLS) ) + { + wxPopupWindowBase::SetFocus(); + } +} + bool wxPopupWindow::Show(bool show) { // It's important to update wxCurrentPopupWindow before showing the window, @@ -88,7 +124,30 @@ bool wxPopupWindow::Show(bool show) // from inside Show() so that it knows to remain [appearing] active. wxCurrentPopupWindow = show ? this : NULL; - return wxPopupWindowBase::Show(show); + if ( HasFlag(wxPU_CONTAINS_CONTROLS) ) + { + return wxPopupWindowBase::Show(show); + } + else + { + if ( !wxWindowMSW::Show(show) ) + return false; + + if ( show ) + { + // raise to top of z order + if ( !::SetWindowPos(GetHwnd(), HWND_TOP, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE) ) + { + wxLogLastError(wxT("SetWindowPos")); + } + + // and set it as the foreground window so the mouse can be captured + ::SetForegroundWindow(GetHwnd()); + } + + return true; + } } // ---------------------------------------------------------------------------- From 10eeb0b2625a5ed4dd98bbc204482b64c1db066b Mon Sep 17 00:00:00 2001 From: Tomay Date: Thu, 17 Jan 2019 00:53:44 +0100 Subject: [PATCH 374/553] Improve drawing buttons in generic wxSearchCtrl Several fixes: * Clear the buttons background, which can be important if their (custom) bitmap is transparent. * Only add margin before/after the corresponding button if it is actually visible. * Select the bitmap out of wxMemoryDC before modifying it. * Don't assume that the "Cancel" button is always square. Closes https://github.com/wxWidgets/wxWidgets/pull/1142 --- src/generic/srchctlg.cpp | 41 +++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index e6cc4b1977..88091fd239 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -222,6 +222,12 @@ protected: void OnPaint(wxPaintEvent&) { wxPaintDC dc(this); + + // Clear the background in case of a user bitmap with alpha channel + dc.SetBrush(m_search->GetBackgroundColour()); + dc.Clear(); + + // Draw the bitmap dc.DrawBitmap(m_bmp, 0,0, true); } @@ -480,9 +486,8 @@ void wxSearchCtrl::LayoutControls() wxSize sizeText = m_text->GetBestSize(); // make room for the search menu & clear button int horizontalBorder = FromDIP(1) + ( sizeText.y - sizeText.y * 14 / 21 ) / 2; - int x = horizontalBorder; - width -= horizontalBorder*2; - if (width < 0) width = 0; + int x = 0; + int textWidth = width; wxSize sizeSearch(0,0); wxSize sizeCancel(0,0); @@ -492,11 +497,14 @@ void wxSearchCtrl::LayoutControls() { sizeSearch = m_searchButton->GetBestSize(); searchMargin = FromDIP(MARGIN); + x += horizontalBorder; + textWidth -= horizontalBorder; } if ( IsCancelButtonVisible() ) { sizeCancel = m_cancelButton->GetBestSize(); cancelMargin = FromDIP(MARGIN); + textWidth -= horizontalBorder; } if ( sizeSearch.x + sizeCancel.x > width ) @@ -506,15 +514,18 @@ void wxSearchCtrl::LayoutControls() searchMargin = 0; cancelMargin = 0; } - wxCoord textWidth = width - sizeSearch.x - sizeCancel.x - searchMargin - cancelMargin - FromDIP(1); + textWidth -= sizeSearch.x + sizeCancel.x + searchMargin + cancelMargin + FromDIP(1); if (textWidth < 0) textWidth = 0; // position the subcontrols inside the client area - m_searchButton->SetSize(x, (height - sizeSearch.y) / 2, - sizeSearch.x, sizeSearch.y); - x += sizeSearch.x; - x += searchMargin; + if ( IsSearchButtonVisible() ) + { + m_searchButton->SetSize(x, (height - sizeSearch.y) / 2, + sizeSearch.x, sizeSearch.y); + x += sizeSearch.x; + x += searchMargin; + } #ifdef __WXMSW__ // The text control is too high up on Windows; normally a text control looks OK because @@ -528,12 +539,12 @@ void wxSearchCtrl::LayoutControls() m_text->SetSize(x, textY, textWidth, height-textY); x += textWidth; - x += cancelMargin; - if ( m_cancelButton ) + if ( IsCancelButtonVisible() ) { + x += cancelMargin; m_cancelButton->SetSize(x, (height - sizeCancel.y) / 2, - sizeCancel.x, height); + sizeCancel.x, sizeCancel.y); } } @@ -1134,6 +1145,10 @@ wxBitmap wxSearchCtrl::RenderCancelBitmap( int x, int y ) }; mem.DrawPolygon(WXSIZEOF(handlePolygon2),handlePolygon2,multiplier*lineStartBase,multiplier*(x-lineStartBase)); + // Stop drawing on the bitmap before possibly calling RescaleBitmap() + // below. + mem.SelectObject(wxNullBitmap); + //=============================================================================== // end drawing code //=============================================================================== @@ -1198,10 +1213,10 @@ void wxSearchCtrl::RecalcBitmaps() if ( !m_cancelBitmap.IsOk() || m_cancelBitmap.GetHeight() != bitmapHeight || - m_cancelBitmap.GetWidth() != bitmapHeight + m_cancelBitmap.GetWidth() != bitmapWidth ) { - m_cancelBitmap = RenderCancelBitmap(bitmapHeight,bitmapHeight); // square + m_cancelBitmap = RenderCancelBitmap(bitmapWidth,bitmapHeight); m_cancelButton->SetBitmapLabel(m_cancelBitmap); } // else this bitmap was set by user, don't alter From 6b11c372a1108f563fc95239bf1628864772983d Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 28 Jan 2019 08:57:32 +0000 Subject: [PATCH 375/553] Fix recently introduced build error in widgets sample Make it compile again when wxHAS_BITMAPTOGGLEBUTTON is not defined, which is notably the case in wxQt. Closes https://github.com/wxWidgets/wxWidgets/pull/1189 --- samples/widgets/toggle.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index 2f61d261b3..52a4b6215c 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -490,9 +490,8 @@ void ToggleWidgetsPage::CreateToggle() m_chkUseFocused->Enable(showsBitmap); m_chkUseCurrent->Enable(showsBitmap); m_chkUseDisabled->Enable(showsBitmap); -#endif // wxHAS_BITMAPTOGGLEBUTTON - m_toggle->Enable(!m_chkDisable->IsChecked()); +#endif // wxHAS_BITMAPTOGGLEBUTTON AddButtonToSizer(); @@ -501,6 +500,7 @@ void ToggleWidgetsPage::CreateToggle() void ToggleWidgetsPage::AddButtonToSizer() { +#ifdef wxHAS_BITMAPTOGGLEBUTTON if ( m_chkFit->GetValue() ) { m_sizerToggle->AddStretchSpacer(1); @@ -508,6 +508,7 @@ void ToggleWidgetsPage::AddButtonToSizer() m_sizerToggle->AddStretchSpacer(1); } else // take up the entire space +#endif // wxHAS_BITMAPTOGGLEBUTTON { m_sizerToggle->Add(m_toggle, wxSizerFlags(1).Expand().Border()); } @@ -540,8 +541,10 @@ void ToggleWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) #endif // wxUSE_MARKUP m_toggle->SetLabel(labelText); +#ifdef wxHAS_BITMAPTOGGLEBUTTON if ( m_chkBitmapOnly->IsChecked() ) CreateToggle(); +#endif // wxHAS_BITMAPTOGGLEBUTTON } #ifdef wxHAS_BITMAPTOGGLEBUTTON From ea4c7120ff50969e24f7d5f28d64d65b0a028c78 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 28 Jan 2019 15:22:01 +0000 Subject: [PATCH 376/553] Fixed up and cleaned up Qt variant of wxDataFormat. Kept "mime type" and "id" conceptually separate in the interface in case they need to diverge later. Got rid of the odd "wxChar *" variants and the QString one. Implemented unimplemented "type" functions. Implemented "!=" in terms of "==", to keep from having two places to keep in sync. --- include/wx/qt/dataform.h | 36 +++++++------- src/qt/clipbrd.cpp | 8 +-- src/qt/dataobj.cpp | 102 +++++++++++++++++++-------------------- 3 files changed, 72 insertions(+), 74 deletions(-) diff --git a/include/wx/qt/dataform.h b/include/wx/qt/dataform.h index b6f5c307bf..55932a5815 100644 --- a/include/wx/qt/dataform.h +++ b/include/wx/qt/dataform.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/qt/toolbar.h +// Name: wx/qt/dataform.h // Author: Sean D'Epagnier // Copyright: (c) Sean D'Epagnier 2014 // Licence: wxWindows licence @@ -8,34 +8,34 @@ #ifndef _WX_QT_DATAFORM_H_ #define _WX_QT_DATAFORM_H_ -class QString; - class WXDLLIMPEXP_CORE wxDataFormat { public: - wxDataFormat(); - wxDataFormat( wxDataFormatId formatId ); + wxDataFormat(wxDataFormatId formatId = wxDF_INVALID); wxDataFormat(const wxString &id); - wxDataFormat(const QString &id); - wxDataFormat(const wxChar *id); - void SetId( const wxChar *id ); - + // Standard methods + const wxString& GetId() const; + void SetId(const wxString& id); + + wxDataFormatId GetType() const; + void SetType(wxDataFormatId type); + bool operator==(wxDataFormatId format) const; bool operator!=(wxDataFormatId format) const; bool operator==(const wxDataFormat& format) const; bool operator!=(const wxDataFormat& format) const; - // string ids are used for custom types - this SetId() must be used for - // application-specific formats - wxString GetId() const; - void SetId( const wxString& id ); + // Direct access to the underlying mime type. + // Equivalent to "id", except "id" is supposed to be + // invalid for standard types, whereas this should + // always be valid (if meaningful). + const wxString& GetMimeType() const; + void SetMimeType(const wxString& mimeType); - // implementation - wxDataFormatId GetType() const; - void SetType( wxDataFormatId type ); - - wxString m_MimeType; +private: + wxString m_mimeType; + wxDataFormatId m_formatId; }; #endif // _WX_QT_DATAFORM_H_ diff --git a/src/qt/clipbrd.cpp b/src/qt/clipbrd.cpp index 5479fe3109..8f92c947ed 100644 --- a/src/qt/clipbrd.cpp +++ b/src/qt/clipbrd.cpp @@ -109,7 +109,7 @@ bool wxClipboard::AddData( wxDataObject *data ) QByteArray bytearray(size, 0); data->GetDataHere(format, bytearray.data()); - MimeData->setData(wxQtConvertString(format.m_MimeType), bytearray); + MimeData->setData(wxQtConvertString(format.GetMimeType()), bytearray); } delete data; @@ -144,7 +144,7 @@ bool wxClipboard::GetData( wxDataObject& data ) const wxDataFormat format(formats[i]); // is this format supported by clipboard ? - if( !MimeData->hasFormat(wxQtConvertString(format.m_MimeType)) ) + if( !MimeData->hasFormat(wxQtConvertString(format.GetMimeType())) ) continue; wxTextDataObject *textdata = dynamic_cast(&data); @@ -152,7 +152,7 @@ bool wxClipboard::GetData( wxDataObject& data ) textdata->SetText(wxQtConvertString(MimeData->text())); else { - QByteArray bytearray = MimeData->data( wxQtConvertString(format.m_MimeType) ).data(); + QByteArray bytearray = MimeData->data( wxQtConvertString(format.GetMimeType()) ).data(); data.SetData(format, bytearray.size(), bytearray.constData()); } @@ -170,7 +170,7 @@ void wxClipboard::Clear() bool wxClipboard::IsSupported( const wxDataFormat& format ) { const QMimeData *data = QtClipboard->mimeData( (QClipboard::Mode)Mode() ); - return data->hasFormat(wxQtConvertString(format.m_MimeType)); + return data->hasFormat(wxQtConvertString(format.GetMimeType())); } bool wxClipboard::IsSupportedAsync(wxEvtHandler *sink) diff --git a/src/qt/dataobj.cpp b/src/qt/dataobj.cpp index 27108b1a46..2840e735a8 100644 --- a/src/qt/dataobj.cpp +++ b/src/qt/dataobj.cpp @@ -18,102 +18,100 @@ #include -wxDataFormat::wxDataFormat() +namespace { -} - -static wxString DataFormatIdToMimeType( wxDataFormatId formatId ) -{ - switch(formatId) { - case wxDF_TEXT: return "text/plain"; - case wxDF_BITMAP: return "image/bmp"; - case wxDF_TIFF: return "image/tiff"; - case wxDF_WAVE: return "audio/x-wav"; - case wxDF_UNICODETEXT: return "text/plain"; - case wxDF_HTML: return "text/html"; - case wxDF_METAFILE: - case wxDF_SYLK: - case wxDF_DIF: - case wxDF_OEMTEXT: - case wxDF_DIB: - case wxDF_PALETTE: - case wxDF_PENDATA: - case wxDF_RIFF: - case wxDF_ENHMETAFILE: - case wxDF_FILENAME: - case wxDF_LOCALE: - case wxDF_PRIVATE: - case wxDF_INVALID: - case wxDF_MAX: - break; + wxString DataFormatIdToMimeType(wxDataFormatId formatId) + { + switch ( formatId ) + { + case wxDF_TEXT: return "text/plain"; + case wxDF_BITMAP: return "image/bmp"; + case wxDF_TIFF: return "image/tiff"; + case wxDF_WAVE: return "audio/x-wav"; + case wxDF_UNICODETEXT: return "text/plain"; + case wxDF_HTML: return "text/html"; + case wxDF_METAFILE: + case wxDF_SYLK: + case wxDF_DIF: + case wxDF_OEMTEXT: + case wxDF_DIB: + case wxDF_PALETTE: + case wxDF_PENDATA: + case wxDF_RIFF: + case wxDF_ENHMETAFILE: + case wxDF_FILENAME: + case wxDF_LOCALE: + case wxDF_PRIVATE: + case wxDF_INVALID: + case wxDF_MAX: + default: + return ""; + } } - return ""; } -wxDataFormat::wxDataFormat( wxDataFormatId formatId ) +wxDataFormat::wxDataFormat(wxDataFormatId formatId) { - m_MimeType = DataFormatIdToMimeType(formatId); + SetType(formatId); } wxDataFormat::wxDataFormat(const wxString &id) { - m_MimeType = id; + SetId(id); } -wxDataFormat::wxDataFormat(const wxChar *id) +const wxString& wxDataFormat::GetMimeType() const { - m_MimeType = id; + return m_mimeType; } -wxDataFormat::wxDataFormat(const QString &id) +void wxDataFormat::SetMimeType(const wxString& mimeType) { - m_MimeType = wxQtConvertString(id); + m_mimeType = mimeType; + m_formatId = wxDF_INVALID; } -void wxDataFormat::SetId( const wxChar *id ) +void wxDataFormat::SetId(const wxString& id) { - m_MimeType = id; + SetMimeType(id); } -void wxDataFormat::SetId( const wxString& id ) +const wxString& wxDataFormat::GetId() const { - m_MimeType = id; -} - -wxString wxDataFormat::GetId() const -{ - return m_MimeType; + return m_mimeType; } wxDataFormatId wxDataFormat::GetType() const { - wxMISSING_IMPLEMENTATION( "wxDataFormat GetType" ); - return wxDataFormatId(); + return m_formatId; } -void wxDataFormat::SetType( wxDataFormatId WXUNUSED(type) ) +void wxDataFormat::SetType(wxDataFormatId formatId) { - wxMISSING_IMPLEMENTATION( "wxDataFormat SetType" ); + m_mimeType = DataFormatIdToMimeType(formatId); + m_formatId = formatId; } bool wxDataFormat::operator==(wxDataFormatId format) const { - return m_MimeType == DataFormatIdToMimeType(format); + return m_mimeType == DataFormatIdToMimeType(format) + && m_formatId == format; } bool wxDataFormat::operator!=(wxDataFormatId format) const { - return m_MimeType != DataFormatIdToMimeType(format); + return !operator==(format); } bool wxDataFormat::operator==(const wxDataFormat& format) const { - return m_MimeType == format.m_MimeType; + return m_mimeType == format.m_mimeType + && m_formatId == format.m_formatId; } bool wxDataFormat::operator!=(const wxDataFormat& format) const { - return m_MimeType != format.m_MimeType; + return !operator==(format); } //############################################################################# From 0dc1654ab67da3af71210b7adc47cb042ff09d00 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Mon, 28 Jan 2019 15:30:25 +0000 Subject: [PATCH 377/553] Get simple (text) drag and drop case working with drop source. We ended up not needing the underlying QMimeData-based implementation, as the classes sitting on top of it bypassed it anyway. It now treats the hierarchy as a pure data storage mechanism, generating the QMimeData when drag-drop is initiated. --- include/wx/qt/dataobj.h | 19 +++------ include/wx/qt/dnd.h | 3 ++ src/qt/dataobj.cpp | 72 ++++++++++----------------------- src/qt/dnd.cpp | 88 ++++++++++++++++++++++++++++++++++++++--- 4 files changed, 112 insertions(+), 70 deletions(-) diff --git a/include/wx/qt/dataobj.h b/include/wx/qt/dataobj.h index 002de9c2a0..0002c13d8a 100644 --- a/include/wx/qt/dataobj.h +++ b/include/wx/qt/dataobj.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/qt/dataobj.cpp +// Name: src/qt/dataobj.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence @@ -8,24 +8,17 @@ #ifndef _WX_QT_DATAOBJ_H_ #define _WX_QT_DATAOBJ_H_ -class QMimeData; +// ---------------------------------------------------------------------------- +// wxDataObject is the same as wxDataObjectBase under wxQT +// ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase { public: wxDataObject(); - ~wxDataObject(); + virtual ~wxDataObject(); - virtual bool IsSupportedFormat(const wxDataFormat& format, Direction dir) const; - virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const; - virtual size_t GetFormatCount(Direction dir = Get) const; - virtual void GetAllFormats(wxDataFormat *formats, Direction dir = Get) const; - virtual size_t GetDataSize(const wxDataFormat& format) const; - virtual bool GetDataHere(const wxDataFormat& format, void *buf) const; - virtual bool SetData(const wxDataFormat& format, size_t len, const void * buf); - -private: - QMimeData *m_qtMimeData; // to handle formats that have no helper classes + virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const; }; #endif // _WX_QT_DATAOBJ_H_ diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index d06a35a570..6edd330f6e 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -42,5 +42,8 @@ public: const wxIcon &none = wxNullIcon); virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); + +private: + wxWindow* m_parentWindow; }; #endif // _WX_QT_DND_H_ diff --git a/src/qt/dataobj.cpp b/src/qt/dataobj.cpp index 2840e735a8..b1cb3b7fd2 100644 --- a/src/qt/dataobj.cpp +++ b/src/qt/dataobj.cpp @@ -12,11 +12,8 @@ #pragma hdrstop #endif -#include "wx/qt/private/converter.h" -#include "wx/qt/private/utils.h" #include "wx/dataobj.h" - -#include +#include "wx/scopedarray.h" namespace { @@ -118,64 +115,33 @@ bool wxDataFormat::operator!=(const wxDataFormat& format) const wxDataObject::wxDataObject() { - m_qtMimeData = new QMimeData; } wxDataObject::~wxDataObject() { - delete m_qtMimeData; } -bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction) const +bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const { - return wxDataFormat(format) != wxDF_INVALID; -} -wxDataFormat wxDataObject::GetPreferredFormat(Direction) const -{ - /* formats are in order of preference */ - if (m_qtMimeData->formats().count()) - return m_qtMimeData->formats().first(); - - return wxDataFormat(); -} - -size_t wxDataObject::GetFormatCount(Direction) const -{ - return m_qtMimeData->formats().count(); -} - -void wxDataObject::GetAllFormats(wxDataFormat *formats, Direction) const -{ - int i = 0; - foreach (QString format, m_qtMimeData->formats()) + const size_t formatCount = GetFormatCount(dir); + if ( formatCount == 1 ) { - formats[i] = format; - i++; + return format == GetPreferredFormat(); } + + wxScopedArray formats(formatCount); + GetAllFormats(formats.get(), dir); + + for ( size_t n = 0; n < formatCount; ++n ) + { + if ( formats[n] == format ) + return true; + } + + return false; } -size_t wxDataObject::GetDataSize(const wxDataFormat& format) const -{ - return m_qtMimeData->data( wxQtConvertString(format.m_MimeType) ).count(); -} - -bool wxDataObject::GetDataHere(const wxDataFormat& format, void *buf) const -{ - if (!m_qtMimeData->hasFormat(wxQtConvertString(format.m_MimeType))) - return false; - - QByteArray data = m_qtMimeData->data( wxQtConvertString(format.m_MimeType) ).data(); - memcpy(buf, data.constData(), data.size()); - return true; -} - -bool wxDataObject::SetData(const wxDataFormat& format, size_t len, const void * buf) -{ - QByteArray bytearray((const char*)buf, len); - m_qtMimeData->setData(wxQtConvertString(format.m_MimeType), bytearray); - - return true; -} +//############################################################################# wxBitmapDataObject::wxBitmapDataObject() { @@ -185,6 +151,8 @@ wxBitmapDataObject::wxBitmapDataObject( const wxBitmap &WXUNUSED(bitmap) ) { } +//############################################################################# + wxFileDataObject::wxFileDataObject() { } @@ -193,3 +161,5 @@ void wxFileDataObject::AddFile( const wxString &WXUNUSED(filename) ) { } + + diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 7e99e94ec2..68922e2f8b 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -11,6 +11,60 @@ #if wxUSE_DRAG_AND_DROP #include "wx/dnd.h" +#include "wx/scopedarray.h" + +#include "wx/qt/private/converter.h" + +#include +#include +#include + +namespace +{ + wxDragResult DropActionToDragResult(Qt::DropAction action) + { + switch ( action ) + { + case Qt::IgnoreAction: + return wxDragCancel; + case Qt::CopyAction: + return wxDragCopy; + case Qt::MoveAction: + return wxDragMove; + case Qt::LinkAction: + return wxDragLink; + default: + return wxDragNone; + } + } + + void AddDataFormat(wxDataObject* dataObject, QMimeData* mimeData, const wxDataFormat& format) + { + const size_t data_size = dataObject->GetDataSize(format); + + QByteArray data(static_cast(data_size), Qt::Initialization()); + dataObject->GetDataHere(format, data.data()); + + mimeData->setData(wxQtConvertString(format.GetMimeType()), data); + } + + QMimeData* CreateMimeData(wxDataObject* dataObject) + { + QMimeData* mimeData = new QMimeData(); + + const size_t count = dataObject->GetFormatCount(); + + wxScopedArray array(dataObject->GetFormatCount()); + dataObject->GetAllFormats(array.get()); + + for ( size_t i = 0; i < count; i++ ) + { + AddDataFormat(dataObject, mimeData, array[i]); + } + + return mimeData; + } +} wxDropTarget::wxDropTarget(wxDataObject *WXUNUSED(dataObject)) { @@ -39,25 +93,47 @@ wxDataFormat wxDropTarget::GetMatchingPair() //############################################################################## - -wxDropSource::wxDropSource( wxWindow *WXUNUSED(win), +wxDropSource::wxDropSource( wxWindow *win, const wxIcon &WXUNUSED(copy), const wxIcon &WXUNUSED(move), const wxIcon &WXUNUSED(none)) + : m_parentWindow(win) { } -wxDropSource::wxDropSource( wxDataObject& WXUNUSED(data), - wxWindow *WXUNUSED(win), +wxDropSource::wxDropSource( wxDataObject& data, + wxWindow *win, const wxIcon &WXUNUSED(copy), const wxIcon &WXUNUSED(move), const wxIcon &WXUNUSED(none)) + : m_parentWindow(win) { + SetData(data); } -wxDragResult wxDropSource::DoDragDrop(int WXUNUSED(flags)) +wxDragResult wxDropSource::DoDragDrop(int flags /*=wxDrag_CopyOnly*/) { - return wxDragResult(); + wxCHECK_MSG(m_data != NULL, wxDragNone, wxT("No data in wxDropSource!")); + wxCHECK_MSG(m_parentWindow != NULL, wxDragNone, wxT("NULL parent window in wxDropSource!")); + + QDrag drag(m_parentWindow->GetHandle()); + drag.setMimeData(CreateMimeData(m_data)); + + Qt::DropActions actions = Qt::CopyAction | Qt::MoveAction; + Qt::DropAction defaultAction = Qt::CopyAction; + switch ( flags ) + { + case wxDrag_CopyOnly: + actions = Qt::CopyAction; + break; + case wxDrag_DefaultMove: + defaultAction = Qt::MoveAction; + break; + default: + break; + } + + return DropActionToDragResult(drag.exec(actions, defaultAction)); } #endif // wxUSE_DRAG_AND_DROP From 665b5a76a88b0db8ee04103ce1005e9cd239c5e4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 17:51:27 +0100 Subject: [PATCH 378/553] Remove unnecessary wxNotebook::DoSetSelection() from wxQt Having this method didn't really help, it's simpler and more straightforward to implement ChangeSelection() as a signal-blocking wrapper around SetSelection() instead. No real changes in behaviour, this is a pure refactoring. --- include/wx/qt/notebook.h | 5 ++--- src/qt/notebook.cpp | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include/wx/qt/notebook.h b/include/wx/qt/notebook.h index 288d0d9a7f..0dd81175c1 100644 --- a/include/wx/qt/notebook.h +++ b/include/wx/qt/notebook.h @@ -42,14 +42,13 @@ public: virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); } - int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); } + int SetSelection(size_t nPage); + int ChangeSelection(size_t nPage); virtual QWidget *GetHandle() const; protected: virtual wxWindow *DoRemovePage(size_t page); - int DoSetSelection(size_t nPage, int flags = 0); private: QTabWidget *m_qtTabWidget; diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 27d4ce7387..029716ada7 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -169,27 +169,31 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const return sizePage; } -int wxNotebook::DoSetSelection(size_t page, int flags) +int wxNotebook::SetSelection(size_t page) { wxCHECK_MSG(page < GetPageCount(), wxNOT_FOUND, "invalid notebook index"); int selOld = GetSelection(); - // do not fire signals for certain methods (i.e. ChangeSelection - if ( !(flags & SetSelection_SendEvent) ) - { - m_qtTabWidget->blockSignals(true); - } // change the QTabWidget selected page: m_selection = page; m_qtTabWidget->setCurrentIndex( page ); - if ( !(flags & SetSelection_SendEvent) ) - { - m_qtTabWidget->blockSignals(false); - } + return selOld; } +int wxNotebook::ChangeSelection(size_t nPage) +{ + // ChangeSelection() is not supposed to generate events, unlike + // SetSelection(). + m_qtTabWidget->blockSignals(true); + + const int selOld = SetSelection(nPage); + + m_qtTabWidget->blockSignals(false); + + return selOld; +} wxWindow *wxNotebook::DoRemovePage(size_t page) { From 6fdcfd819937d44e7d8a541c9401cd4554e5a311 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 18:21:32 +0100 Subject: [PATCH 379/553] Add unit test for no events when adding first wxNotebook page Adding the first page shouldn't generate any events even if the selection does change (from -1 to 0) internally. --- tests/controls/notebooktest.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/controls/notebooktest.cpp b/tests/controls/notebooktest.cpp index 1812d08a97..4309a46ee5 100644 --- a/tests/controls/notebooktest.cpp +++ b/tests/controls/notebooktest.cpp @@ -20,7 +20,9 @@ #endif // WX_PRECOMP #include "wx/notebook.h" + #include "bookctrlbasetest.h" +#include "testableframe.h" class NotebookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase { @@ -118,4 +120,25 @@ void NotebookTestCase::NoEventsOnDestruction() CHECK( m_numPageChanges == 1 ); } +TEST_CASE("wxNotebook::NoEventsForFirstPage", "[wxNotebook][event]") +{ + wxNotebook* const + notebook = new wxNotebook(wxTheApp->GetTopWindow(), wxID_ANY, + wxDefaultPosition, wxSize(400, 200)); + + CHECK( notebook->GetSelection() == wxNOT_FOUND ); + + EventCounter countPageChanging(notebook, wxEVT_NOTEBOOK_PAGE_CHANGING); + EventCounter countPageChanged(notebook, wxEVT_NOTEBOOK_PAGE_CHANGED); + + notebook->AddPage(new wxPanel(notebook), "First page"); + + // The selection should have been changed. + CHECK( notebook->GetSelection() == 0 ); + + // But no events should have been generated. + CHECK( countPageChanging.GetCount() == 0 ); + CHECK( countPageChanged.GetCount() == 0 ); +} + #endif //wxUSE_NOTEBOOK From da96ab179fa8b6b572b392f3b89e0c7d8467f588 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 18:29:31 +0100 Subject: [PATCH 380/553] Fix updating selection in wxNotebook::InsertPage() in wxQt Just use DoSetSelectionAfterInsertion() provided by the base class, which does the right thing already, including both setting m_selection and sending (or not sending) the corresponding events. --- src/qt/notebook.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 029716ada7..f5c4c9ea60 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -154,12 +154,8 @@ bool wxNotebook::InsertPage(size_t n, wxWindow *page, const wxString& text, // reenable firing qt signals as internal wx initialization was completed m_qtTabWidget->blockSignals(false); - m_selection = m_qtTabWidget->currentIndex(); - if (bSelect && GetPageCount() > 1) - { - SetSelection( n ); - } + DoSetSelectionAfterInsertion(n, bSelect); return true; } From 359b23a58b3ac2d0137b756989ebebbf9aef4b4f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 18:51:02 +0100 Subject: [PATCH 381/553] Avoid events on first page insertion in wxGTK wxNotebook Make wxGTK consistent with wxMSW and wxOSX and also make it pass the unit test added in the previous commit by suppressing events generated by gtk_notebook_insert_page() when adding the first page (but not any subsequent ones). --- src/gtk/notebook.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 71bd4d8ec2..4e86999f34 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -464,7 +464,12 @@ bool wxNotebook::InsertPage( size_t position, pageData->m_label, false, false, m_padding); gtk_widget_show_all(pageData->m_box); + + // Inserting the page may generate selection changing events that are not + // expected here: we will send them ourselves below if necessary. + g_signal_handlers_block_by_func(m_widget, (void*)switch_page, this); gtk_notebook_insert_page(notebook, win->m_widget, pageData->m_box, position); + g_signal_handlers_unblock_by_func(m_widget, (void*)switch_page, this); /* apply current style */ #ifdef __WXGTK3__ From 7cd6a27e1615eea9806b07e5076e75aee23dde90 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 18:56:03 +0100 Subject: [PATCH 382/553] Clarify when wxBookCtrl::AddPage() sends page changing events Notably document that it does not do it when adding the first page. --- interface/wx/bookctrl.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/interface/wx/bookctrl.h b/interface/wx/bookctrl.h index 7789496765..dc775d00a6 100644 --- a/interface/wx/bookctrl.h +++ b/interface/wx/bookctrl.h @@ -249,7 +249,10 @@ public: The page must have the book control itself as the parent and must not have been added to this control previously. - The call to this function may generate the page changing events. + The call to this function will generate the page changing and page + changed events if @a select is true, but not when inserting the very + first page (as there is no previous page selection to switch from in + this case and so it wouldn't make sense to e.g. veto such event). @param page Specifies the new page. From 7d36b02bcc190a309d013f107701b16c6aca8828 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 18:59:34 +0100 Subject: [PATCH 383/553] Reuse base class helper in wxGTK wxNotebook::InsertPage() Call DoSetSelectionAfterInsertion() instead of partially duplicating it. This ensures that m_selection is correct after inserting a new page, which wasn't the case before. Surprisingly, this didn't actually matter because wxGTK implementation doesn't really use the base class m_selection neither and just queries GTK+ widget directly for its selection in GetSelection() instead, but it was at the very least confusing. --- src/gtk/notebook.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 4e86999f34..a47d136a1e 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -483,10 +483,7 @@ bool wxNotebook::InsertPage( size_t position, } #endif - if (select && GetPageCount() > 1) - { - SetSelection( position ); - } + DoSetSelectionAfterInsertion(position, select); InvalidateBestSize(); return true; From c22e81c7a1ab18b9c5109e299855bc92f7041957 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 19:01:17 +0100 Subject: [PATCH 384/553] Extend unit test for events generated by wxNotebook::AddPage() In addition to checking that adding the first page doesn't generate any events, check that adding another page later does generate them. --- tests/controls/notebooktest.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/tests/controls/notebooktest.cpp b/tests/controls/notebooktest.cpp index 4309a46ee5..60c9cdd31b 100644 --- a/tests/controls/notebooktest.cpp +++ b/tests/controls/notebooktest.cpp @@ -120,7 +120,7 @@ void NotebookTestCase::NoEventsOnDestruction() CHECK( m_numPageChanges == 1 ); } -TEST_CASE("wxNotebook::NoEventsForFirstPage", "[wxNotebook][event]") +TEST_CASE("wxNotebook::AddPageEvents", "[wxNotebook][AddPage][event]") { wxNotebook* const notebook = new wxNotebook(wxTheApp->GetTopWindow(), wxID_ANY, @@ -131,7 +131,8 @@ TEST_CASE("wxNotebook::NoEventsForFirstPage", "[wxNotebook][event]") EventCounter countPageChanging(notebook, wxEVT_NOTEBOOK_PAGE_CHANGING); EventCounter countPageChanged(notebook, wxEVT_NOTEBOOK_PAGE_CHANGED); - notebook->AddPage(new wxPanel(notebook), "First page"); + // Add the first page, it is special. + notebook->AddPage(new wxPanel(notebook), "Initial page"); // The selection should have been changed. CHECK( notebook->GetSelection() == 0 ); @@ -139,6 +140,28 @@ TEST_CASE("wxNotebook::NoEventsForFirstPage", "[wxNotebook][event]") // But no events should have been generated. CHECK( countPageChanging.GetCount() == 0 ); CHECK( countPageChanged.GetCount() == 0 ); + + + // Add another page without selecting it. + notebook->AddPage(new wxPanel(notebook), "Unselected page"); + + // Selection shouldn't have changed. + CHECK( notebook->GetSelection() == 0 ); + + // And no events should have been generated, of course. + CHECK( countPageChanging.GetCount() == 0 ); + CHECK( countPageChanged.GetCount() == 0 ); + + + // Finally add another page and do select it. + notebook->AddPage(new wxPanel(notebook), "Selected page", true); + + // It should have become selected. + CHECK( notebook->GetSelection() == 2 ); + + // And events for the selection change should have been generated. + CHECK( countPageChanging.GetCount() == 1 ); + CHECK( countPageChanged.GetCount() == 1 ); } #endif //wxUSE_NOTEBOOK From ce1b72a4d2869e7cd7fdcbe3e9e0698135d53fa8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 19:05:01 +0100 Subject: [PATCH 385/553] Document wxNotebook::AddPage() events change in wxGTK This hopefully shouldn't affect many people, but still document this backwards-incompatible change. --- docs/changes.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 4a41c873e9..3a288f2ca3 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -62,6 +62,9 @@ Changes in behaviour not resulting in compilation errors - Generic wxDataViewCtrl now always resizes its last column to fill all the available space, as the GTK+ version always did. +- wxGTK wxNotebook::AddPage() doesn't generate any events any more for the + first page being added, for consistency with the other ports. + Changes in behaviour which may result in build errors ----------------------------------------------------- From 3cb395a5a5a5639f7264a19784297d22ea9ab5ca Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Mon, 28 Jan 2019 16:52:07 +0000 Subject: [PATCH 386/553] Implement wxNotebook::DeleteAllPages() for wxQt See https://github.com/wxWidgets/wxWidgets/pull/1191 --- include/wx/qt/notebook.h | 2 ++ src/qt/notebook.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/wx/qt/notebook.h b/include/wx/qt/notebook.h index 288d0d9a7f..9db81bb917 100644 --- a/include/wx/qt/notebook.h +++ b/include/wx/qt/notebook.h @@ -45,6 +45,8 @@ public: int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); } int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); } + virtual bool DeleteAllPages() wxOVERRIDE; + virtual QWidget *GetHandle() const; protected: diff --git a/src/qt/notebook.cpp b/src/qt/notebook.cpp index 27d4ce7387..92c9fe3e82 100644 --- a/src/qt/notebook.cpp +++ b/src/qt/notebook.cpp @@ -169,6 +169,17 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const return sizePage; } +bool wxNotebook::DeleteAllPages() +{ + if ( !wxNotebookBase::DeleteAllPages() ) + return false; + + m_qtTabWidget->blockSignals(true); + m_qtTabWidget->clear(); + m_qtTabWidget->blockSignals(false); + return true; +} + int wxNotebook::DoSetSelection(size_t page, int flags) { wxCHECK_MSG(page < GetPageCount(), wxNOT_FOUND, "invalid notebook index"); From e599e26395e005a7a1fb2265f7ee20df8658a04c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Jan 2019 00:08:44 +0100 Subject: [PATCH 387/553] Test that showing a TLW generates wxActivateEvent Wait until wxEVT_ACTIVATE arrives and check that it does. --- tests/toplevel/toplevel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/toplevel/toplevel.cpp b/tests/toplevel/toplevel.cpp index 3e94f12c8d..5a2d83025f 100644 --- a/tests/toplevel/toplevel.cpp +++ b/tests/toplevel/toplevel.cpp @@ -45,7 +45,13 @@ static void TopLevelWindowShowTest(wxTopLevelWindow* tlw) CHECK(!tlw->IsActive()); #endif + // Note that at least under MSW, ShowWithoutActivating() still generates + // wxActivateEvent, so we must only start counting these events after the + // end of the tests above. + EventCounter countActivate(tlw, wxEVT_ACTIVATE); + tlw->Show(true); + countActivate.WaitEvent(); // wxGTK needs many event loop iterations before the TLW becomes active and // this doesn't happen in this test, so avoid checking for it. From f9323e4b87c6ea50dc46c70c85a661da397661d5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Jan 2019 00:16:52 +0100 Subject: [PATCH 388/553] Enable tests for wxTopLevelWindow::IsActive() for wxGTK too After the addition of EventCounter::WaitEvent() call in the previous commit these checks pass as well (with another WaitEvent() added to wait for deactivation event as well). --- tests/toplevel/toplevel.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/toplevel/toplevel.cpp b/tests/toplevel/toplevel.cpp index 5a2d83025f..7f4a09fca6 100644 --- a/tests/toplevel/toplevel.cpp +++ b/tests/toplevel/toplevel.cpp @@ -53,18 +53,14 @@ static void TopLevelWindowShowTest(wxTopLevelWindow* tlw) tlw->Show(true); countActivate.WaitEvent(); - // wxGTK needs many event loop iterations before the TLW becomes active and - // this doesn't happen in this test, so avoid checking for it. -#ifndef __WXGTK__ CHECK(tlw->IsActive()); -#endif CHECK(tlw->IsShown()); tlw->Hide(); CHECK(!tlw->IsShown()); -#ifndef __WXGTK__ + + countActivate.WaitEvent(); CHECK(!tlw->IsActive()); -#endif } TEST_CASE("wxTopLevel::Show", "[tlw][show]") From 323cbdabdb2eb1fcda2156134b2df192590c6573 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Tue, 29 Jan 2019 16:13:41 +0000 Subject: [PATCH 389/553] Implement initial try of wxDropTarget. The drop target needs to use an event filter to capture drag-and-drop events from the window. --- include/wx/qt/dnd.h | 20 +++++-- include/wx/qt/window.h | 15 +++++ src/qt/dataobj.cpp | 6 ++ src/qt/dnd.cpp | 121 ++++++++++++++++++++++++++++++++++++++--- src/qt/window.cpp | 68 +++++++++++++++++++++-- 5 files changed, 211 insertions(+), 19 deletions(-) diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index 6edd330f6e..ec8bf6feb3 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -10,22 +10,30 @@ #define wxDROP_ICON(name) wxICON(name) +class QMimeData; + class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase { public: - wxDropTarget(wxDataObject *dataObject = NULL ); + wxDropTarget(wxDataObject *dataObject = NULL); - virtual bool OnDrop(wxCoord x, wxCoord y); - virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); - virtual bool GetData(); + virtual bool OnDrop(wxCoord x, wxCoord y) wxOVERRIDE; + virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE; + virtual bool GetData() wxOVERRIDE; wxDataFormat GetMatchingPair(); -protected: + void OnQtEnter(QEvent* event); + void OnQtLeave(QEvent* event); + void OnQtMove(QEvent* event); + void OnQtDrop(QEvent* event); private: -}; + class PendingMimeDataSetter; + friend class PendingMimeDataSetter; + const QMimeData* m_pendingMimeData; +}; class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase { diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index a2f1542a27..130267f75e 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -10,6 +10,7 @@ #define _WX_QT_WINDOW_H_ #include +#include class QShortcut; template < class T > class QList; @@ -216,6 +217,16 @@ protected: QWidget *m_qtWindow; private: + class DnDEventAdapter : public QObject + { + public: + DnDEventAdapter(); + virtual bool eventFilter(QObject* watched, QEvent* event); + void SetDropTarget(wxDropTarget* dropTarget, QWidget* window); + private: + wxDropTarget *m_dropTarget; + }; + void Init(); QScrollArea *m_qtContainer; @@ -238,6 +249,10 @@ private: bool m_processingShortcut; #endif // wxUSE_ACCEL +#if wxUSE_DRAG_AND_DROP + DnDEventAdapter dnd_event_adapter; +#endif + wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxWindowQt ); }; diff --git a/src/qt/dataobj.cpp b/src/qt/dataobj.cpp index b1cb3b7fd2..e6f8f6e1be 100644 --- a/src/qt/dataobj.cpp +++ b/src/qt/dataobj.cpp @@ -102,6 +102,12 @@ bool wxDataFormat::operator!=(wxDataFormatId format) const bool wxDataFormat::operator==(const wxDataFormat& format) const { + // If mime types match, then that's good enough. + // (Could be comparing a standard constructed format to a + // custom constructed one, where both are actually the same.) + if (!m_mimeType.empty() && m_mimeType == format.m_mimeType) + return true; + return m_mimeType == format.m_mimeType && m_formatId == format.m_formatId; } diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 68922e2f8b..750b19524d 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace { @@ -38,6 +39,21 @@ namespace } } + Qt::DropAction DragResultToDropAction(wxDragResult result) + { + switch ( result ) + { + case wxDragCopy: + return Qt::CopyAction; + case wxDragMove: + return Qt::MoveAction; + case wxDragLink: + return Qt::LinkAction; + default: + return Qt::IgnoreAction; + } + } + void AddDataFormat(wxDataObject* dataObject, QMimeData* mimeData, const wxDataFormat& format) { const size_t data_size = dataObject->GetDataSize(format); @@ -66,29 +82,120 @@ namespace } } -wxDropTarget::wxDropTarget(wxDataObject *WXUNUSED(dataObject)) +class wxDropTarget::PendingMimeDataSetter +{ +public: + PendingMimeDataSetter(wxDropTarget* dropTarget, const QMimeData* mimeData) + : m_dropTarget(dropTarget) + { + m_dropTarget->m_pendingMimeData = mimeData; + } + + ~PendingMimeDataSetter() + { + m_dropTarget->m_pendingMimeData = NULL; + } + +private: + wxDropTarget* m_dropTarget; + +}; + +wxDropTarget::wxDropTarget(wxDataObject *dataObject) + : wxDropTargetBase(dataObject), + m_pendingMimeData(NULL) { } bool wxDropTarget::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { - return false; + return !GetMatchingPair().GetMimeType().empty(); } -wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult WXUNUSED(def)) +wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult default_drag_result) { - return wxDragResult(); + GetData(); + return default_drag_result; } bool wxDropTarget::GetData() { - return false; + const wxDataFormat droppedFormat = GetMatchingPair(); + + const wxString mimeType = droppedFormat.GetMimeType(); + if ( mimeType.empty() ) + return false; + + const QByteArray data = m_pendingMimeData->data(wxQtConvertString(mimeType)); + + return m_dataObject->SetData(droppedFormat, data.size(), data.data()); } wxDataFormat wxDropTarget::GetMatchingPair() { - wxFAIL_MSG("wxDropTarget::GetMatchingPair() not implemented in src/qt/dnd.cpp"); - return wxDF_INVALID; + if ( m_pendingMimeData == NULL || m_dataObject == NULL ) + return wxFormatInvalid; + + const QStringList formats = m_pendingMimeData->formats(); + for ( int i = 0; i < formats.count(); ++i ) + { + const wxDataFormat format(wxQtConvertString(formats[i])); + + if ( m_dataObject->IsSupportedFormat(format) ) + { + return format; + } + } + return wxFormatInvalid; +} + +void wxDropTarget::OnQtEnter(QEvent* event) +{ + event->accept(); + + QDragEnterEvent *e = static_cast(event); + const QPoint where = e->pos(); + + PendingMimeDataSetter setter(this, e->mimeData()); + + wxDragResult result = OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + + e->setDropAction(DragResultToDropAction(result)); +} + +void wxDropTarget::OnQtLeave(QEvent* event) +{ + event->accept(); + OnLeave(); +} + +void wxDropTarget::OnQtMove(QEvent* event) +{ + event->accept(); + + QDragMoveEvent *e = static_cast(event); + const QPoint where = e->pos(); + + PendingMimeDataSetter setter(this, e->mimeData()); + + wxDragResult result = OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + + e->setDropAction(DragResultToDropAction(result)); +} + +void wxDropTarget::OnQtDrop(QEvent* event) +{ + event->accept(); + + const QDropEvent *e = static_cast(event); + const QPoint where = e->pos(); + + PendingMimeDataSetter setter(this, e->mimeData()); + + if ( OnDrop(where.x(), where.y()) ) + { + OnData(where.x(), where.y(), DropActionToDragResult(e->dropAction())); + } } //############################################################################## diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 88e1b4b1e0..d638daa64b 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -31,12 +31,12 @@ #endif // WX_PRECOMP #include "wx/window.h" +#include "wx/dnd.h" #include "wx/tooltip.h" #include "wx/qt/private/utils.h" #include "wx/qt/private/converter.h" #include "wx/qt/private/winevent.h" - #define VERT_SCROLLBAR_POSITION 0, 1 #define HORZ_SCROLLBAR_POSITION 1, 0 @@ -193,9 +193,6 @@ static const char WINDOW_POINTER_PROPERTY_NAME[] = "wxWindowPointer"; return const_cast< wxWindowQt * >( ( variant.value< const wxWindow * >() )); } - - - static wxWindowQt *s_capturedWindow = NULL; /* static */ wxWindowQt *wxWindowBase::DoFindFocus() @@ -225,6 +222,8 @@ void wxWindowQt::Init() #endif m_qtWindow = NULL; m_qtContainer = NULL; + + m_dropTarget = NULL; } wxWindowQt::wxWindowQt() @@ -688,9 +687,9 @@ void wxWindowQt::ScrollWindow( int dx, int dy, const wxRect *rect ) #if wxUSE_DRAG_AND_DROP -void wxWindowQt::SetDropTarget( wxDropTarget * WXUNUSED( dropTarget ) ) +void wxWindowQt::SetDropTarget( wxDropTarget *dropTarget ) { - wxMISSING_IMPLEMENTATION( __FUNCTION__ ); + dnd_event_adapter.SetDropTarget(dropTarget, m_qtWindow); } #endif @@ -1543,3 +1542,60 @@ QPainter *wxWindowQt::QtGetPainter() { return m_qtPainter; } + +//############################################################################## +// DnDEventAdapter +//############################################################################## + +wxWindow::DnDEventAdapter::DnDEventAdapter() : m_dropTarget(NULL) +{ +} + +bool wxWindow::DnDEventAdapter::eventFilter(QObject* watched, QEvent* event) +{ + if ( m_dropTarget != NULL ) + { + switch ( event->type() ) + { + case QEvent::Drop: + m_dropTarget->OnQtDrop(event); + return true; + + case QEvent::DragEnter: + m_dropTarget->OnQtEnter(event); + return true; + + case QEvent::DragMove: + m_dropTarget->OnQtMove(event); + return true; + + case QEvent::DragLeave: + m_dropTarget->OnQtLeave(event); + return true; + + default: + break; + } + } + + return QObject::eventFilter(watched, event); +} + +void wxWindow::DnDEventAdapter::SetDropTarget(wxDropTarget* dropTarget, QWidget* window) +{ + if ( m_dropTarget == dropTarget ) + return; + + m_dropTarget = dropTarget; + + if ( m_dropTarget == NULL ) + { + window->removeEventFilter(this); + window->setAcceptDrops(false); + } + else + { + window->installEventFilter(this); + window->setAcceptDrops(true); + } +} From 2bceaaa572a84c61730ad4af87e00d71beb2c6f2 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Tue, 29 Jan 2019 16:29:58 +0000 Subject: [PATCH 390/553] Clean up wxDropTarget (first stage) by moving Qt specific stuff (e.g. QMimeData) into an Impl. --- include/wx/qt/dnd.h | 7 +++-- src/qt/dnd.cpp | 62 +++++++++++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index ec8bf6feb3..c76ba7eeac 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -16,6 +16,7 @@ class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase { public: wxDropTarget(wxDataObject *dataObject = NULL); + virtual ~wxDropTarget(); virtual bool OnDrop(wxCoord x, wxCoord y) wxOVERRIDE; virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE; @@ -29,10 +30,8 @@ public: void OnQtDrop(QEvent* event); private: - class PendingMimeDataSetter; - friend class PendingMimeDataSetter; - - const QMimeData* m_pendingMimeData; + class Impl; + Impl* m_pImpl; }; class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 750b19524d..575b1ffae2 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -82,40 +82,54 @@ namespace } } -class wxDropTarget::PendingMimeDataSetter + +class wxDropTarget::Impl { public: - PendingMimeDataSetter(wxDropTarget* dropTarget, const QMimeData* mimeData) - : m_dropTarget(dropTarget) - { - m_dropTarget->m_pendingMimeData = mimeData; - } - - ~PendingMimeDataSetter() - { - m_dropTarget->m_pendingMimeData = NULL; - } - -private: - wxDropTarget* m_dropTarget; - + const QMimeData* m_pendingMimeData; }; +namespace +{ + class PendingMimeDataSetter + { + public: + PendingMimeDataSetter(const QMimeData*& targetMimeData, const QMimeData* mimeData) + : m_targetMimeData(targetMimeData) + { + m_targetMimeData = mimeData; + } + + ~PendingMimeDataSetter() + { + m_targetMimeData = NULL; + } + + private: + const QMimeData*& m_targetMimeData; + }; +} + wxDropTarget::wxDropTarget(wxDataObject *dataObject) : wxDropTargetBase(dataObject), - m_pendingMimeData(NULL) + m_pImpl(new Impl) { } +wxDropTarget::~wxDropTarget() +{ + delete m_pImpl; +} + bool wxDropTarget::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { return !GetMatchingPair().GetMimeType().empty(); } -wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult default_drag_result) +wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult def) { GetData(); - return default_drag_result; + return def; } bool wxDropTarget::GetData() @@ -126,17 +140,17 @@ bool wxDropTarget::GetData() if ( mimeType.empty() ) return false; - const QByteArray data = m_pendingMimeData->data(wxQtConvertString(mimeType)); + const QByteArray data = m_pImpl->m_pendingMimeData->data(wxQtConvertString(mimeType)); return m_dataObject->SetData(droppedFormat, data.size(), data.data()); } wxDataFormat wxDropTarget::GetMatchingPair() { - if ( m_pendingMimeData == NULL || m_dataObject == NULL ) + if ( m_pImpl->m_pendingMimeData == NULL || m_dataObject == NULL ) return wxFormatInvalid; - const QStringList formats = m_pendingMimeData->formats(); + const QStringList formats = m_pImpl->m_pendingMimeData->formats(); for ( int i = 0; i < formats.count(); ++i ) { const wxDataFormat format(wxQtConvertString(formats[i])); @@ -156,7 +170,7 @@ void wxDropTarget::OnQtEnter(QEvent* event) QDragEnterEvent *e = static_cast(event); const QPoint where = e->pos(); - PendingMimeDataSetter setter(this, e->mimeData()); + PendingMimeDataSetter setter(m_pImpl->m_pendingMimeData, e->mimeData()); wxDragResult result = OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); @@ -176,7 +190,7 @@ void wxDropTarget::OnQtMove(QEvent* event) QDragMoveEvent *e = static_cast(event); const QPoint where = e->pos(); - PendingMimeDataSetter setter(this, e->mimeData()); + PendingMimeDataSetter setter(m_pImpl->m_pendingMimeData, e->mimeData()); wxDragResult result = OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); @@ -190,7 +204,7 @@ void wxDropTarget::OnQtDrop(QEvent* event) const QDropEvent *e = static_cast(event); const QPoint where = e->pos(); - PendingMimeDataSetter setter(this, e->mimeData()); + PendingMimeDataSetter setter(m_pImpl->m_pendingMimeData, e->mimeData()); if ( OnDrop(where.x(), where.y()) ) { From 8c63c40953314de6d63b5c55824b396d260a90e9 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Tue, 29 Jan 2019 16:55:31 +0000 Subject: [PATCH 391/553] Clean up wxDropTarget and wxWindow a bit more by moving DnD stuff fully into drop target (besides connecting and disconnecting). Window doesn't have to know more than how to hook itself up. Impl now performs function of event filter/adapter. --- include/wx/qt/dnd.h | 8 +-- include/wx/qt/window.h | 14 ---- src/qt/dnd.cpp | 148 +++++++++++++++++++++++++++-------------- src/qt/window.cpp | 72 ++++---------------- 4 files changed, 113 insertions(+), 129 deletions(-) diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index c76ba7eeac..d7e108cbdd 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -10,8 +10,6 @@ #define wxDROP_ICON(name) wxICON(name) -class QMimeData; - class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase { public: @@ -24,10 +22,8 @@ public: wxDataFormat GetMatchingPair(); - void OnQtEnter(QEvent* event); - void OnQtLeave(QEvent* event); - void OnQtMove(QEvent* event); - void OnQtDrop(QEvent* event); + void ConnectToQWidget(QWidget* widget); + void DisconnectFromQWidget(QWidget* widget); private: class Impl; diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index 130267f75e..3978615ae6 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -217,16 +217,6 @@ protected: QWidget *m_qtWindow; private: - class DnDEventAdapter : public QObject - { - public: - DnDEventAdapter(); - virtual bool eventFilter(QObject* watched, QEvent* event); - void SetDropTarget(wxDropTarget* dropTarget, QWidget* window); - private: - wxDropTarget *m_dropTarget; - }; - void Init(); QScrollArea *m_qtContainer; @@ -249,10 +239,6 @@ private: bool m_processingShortcut; #endif // wxUSE_ACCEL -#if wxUSE_DRAG_AND_DROP - DnDEventAdapter dnd_event_adapter; -#endif - wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxWindowQt ); }; diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 575b1ffae2..9398d2d9f7 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -82,13 +82,6 @@ namespace } } - -class wxDropTarget::Impl -{ -public: - const QMimeData* m_pendingMimeData; -}; - namespace { class PendingMimeDataSetter @@ -110,9 +103,99 @@ namespace }; } +class wxDropTarget::Impl : public QObject +{ +public: + explicit Impl(wxDropTarget* dropTarget) : m_dropTarget(dropTarget) + { + } + + virtual bool eventFilter(QObject* watched, QEvent* event) wxOVERRIDE + { + if ( m_dropTarget != NULL ) + { + switch ( event->type() ) + { + case QEvent::Drop: + OnDrop(event); + return true; + + case QEvent::DragEnter: + OnEnter(event); + return true; + + case QEvent::DragMove: + OnMove(event); + return true; + + case QEvent::DragLeave: + OnLeave(event); + return true; + + default: + break; + } + } + + return QObject::eventFilter(watched, event); + } + + void OnEnter(QEvent* event) + { + event->accept(); + + QDragEnterEvent *e = static_cast(event); + const QPoint where = e->pos(); + + PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + + wxDragResult result = m_dropTarget->OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + + e->setDropAction(DragResultToDropAction(result)); + } + + void OnLeave(QEvent* event) + { + event->accept(); + m_dropTarget->OnLeave(); + } + + void OnMove(QEvent* event) + { + event->accept(); + + QDragMoveEvent *e = static_cast(event); + const QPoint where = e->pos(); + + PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + + wxDragResult result = m_dropTarget->OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + + e->setDropAction(DragResultToDropAction(result)); + } + + void OnDrop(QEvent* event) + { + event->accept(); + + const QDropEvent *e = static_cast(event); + const QPoint where = e->pos(); + + PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + + if ( m_dropTarget->OnDrop(where.x(), where.y()) ) + { + m_dropTarget->OnData(where.x(), where.y(), DropActionToDragResult(e->dropAction())); + } + } + + const QMimeData* m_pendingMimeData; + wxDropTarget* m_dropTarget; +}; + wxDropTarget::wxDropTarget(wxDataObject *dataObject) : wxDropTargetBase(dataObject), - m_pImpl(new Impl) + m_pImpl(new Impl(this)) { } @@ -163,53 +246,16 @@ wxDataFormat wxDropTarget::GetMatchingPair() return wxFormatInvalid; } -void wxDropTarget::OnQtEnter(QEvent* event) +void wxDropTarget::ConnectToQWidget(QWidget* widget) { - event->accept(); - - QDragEnterEvent *e = static_cast(event); - const QPoint where = e->pos(); - - PendingMimeDataSetter setter(m_pImpl->m_pendingMimeData, e->mimeData()); - - wxDragResult result = OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); - - e->setDropAction(DragResultToDropAction(result)); + widget->setAcceptDrops(true); + widget->installEventFilter(m_pImpl); } -void wxDropTarget::OnQtLeave(QEvent* event) +void wxDropTarget::DisconnectFromQWidget(QWidget* widget) { - event->accept(); - OnLeave(); -} - -void wxDropTarget::OnQtMove(QEvent* event) -{ - event->accept(); - - QDragMoveEvent *e = static_cast(event); - const QPoint where = e->pos(); - - PendingMimeDataSetter setter(m_pImpl->m_pendingMimeData, e->mimeData()); - - wxDragResult result = OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); - - e->setDropAction(DragResultToDropAction(result)); -} - -void wxDropTarget::OnQtDrop(QEvent* event) -{ - event->accept(); - - const QDropEvent *e = static_cast(event); - const QPoint where = e->pos(); - - PendingMimeDataSetter setter(m_pImpl->m_pendingMimeData, e->mimeData()); - - if ( OnDrop(where.x(), where.y()) ) - { - OnData(where.x(), where.y(), DropActionToDragResult(e->dropAction())); - } + widget->setAcceptDrops(false); + widget->removeEventFilter(m_pImpl); } //############################################################################## diff --git a/src/qt/window.cpp b/src/qt/window.cpp index d638daa64b..dc22ca3dd7 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -689,7 +689,20 @@ void wxWindowQt::ScrollWindow( int dx, int dy, const wxRect *rect ) #if wxUSE_DRAG_AND_DROP void wxWindowQt::SetDropTarget( wxDropTarget *dropTarget ) { - dnd_event_adapter.SetDropTarget(dropTarget, m_qtWindow); + if ( m_dropTarget == dropTarget ) + return; + + if ( m_dropTarget != NULL ) + { + m_dropTarget->DisconnectFromQWidget(m_qtWindow); + } + + m_dropTarget = dropTarget; + + if (m_dropTarget != NULL) + { + m_dropTarget->ConnectToQWidget(m_qtWindow); + } } #endif @@ -1542,60 +1555,3 @@ QPainter *wxWindowQt::QtGetPainter() { return m_qtPainter; } - -//############################################################################## -// DnDEventAdapter -//############################################################################## - -wxWindow::DnDEventAdapter::DnDEventAdapter() : m_dropTarget(NULL) -{ -} - -bool wxWindow::DnDEventAdapter::eventFilter(QObject* watched, QEvent* event) -{ - if ( m_dropTarget != NULL ) - { - switch ( event->type() ) - { - case QEvent::Drop: - m_dropTarget->OnQtDrop(event); - return true; - - case QEvent::DragEnter: - m_dropTarget->OnQtEnter(event); - return true; - - case QEvent::DragMove: - m_dropTarget->OnQtMove(event); - return true; - - case QEvent::DragLeave: - m_dropTarget->OnQtLeave(event); - return true; - - default: - break; - } - } - - return QObject::eventFilter(watched, event); -} - -void wxWindow::DnDEventAdapter::SetDropTarget(wxDropTarget* dropTarget, QWidget* window) -{ - if ( m_dropTarget == dropTarget ) - return; - - m_dropTarget = dropTarget; - - if ( m_dropTarget == NULL ) - { - window->removeEventFilter(this); - window->setAcceptDrops(false); - } - else - { - window->installEventFilter(this); - window->setAcceptDrops(true); - } -} From 87f6707123cc3c83d79fd9ee7960ac7bbaf43946 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Tue, 29 Jan 2019 16:58:52 +0000 Subject: [PATCH 392/553] Fix some spacing transgressions. --- src/qt/dnd.cpp | 4 ++-- src/qt/window.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 9398d2d9f7..4debdf400a 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -260,7 +260,7 @@ void wxDropTarget::DisconnectFromQWidget(QWidget* widget) //############################################################################## -wxDropSource::wxDropSource( wxWindow *win, +wxDropSource::wxDropSource(wxWindow *win, const wxIcon &WXUNUSED(copy), const wxIcon &WXUNUSED(move), const wxIcon &WXUNUSED(none)) @@ -268,7 +268,7 @@ wxDropSource::wxDropSource( wxWindow *win, { } -wxDropSource::wxDropSource( wxDataObject& data, +wxDropSource::wxDropSource(wxDataObject& data, wxWindow *win, const wxIcon &WXUNUSED(copy), const wxIcon &WXUNUSED(move), diff --git a/src/qt/window.cpp b/src/qt/window.cpp index dc22ca3dd7..26df142c7b 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -699,7 +699,7 @@ void wxWindowQt::SetDropTarget( wxDropTarget *dropTarget ) m_dropTarget = dropTarget; - if (m_dropTarget != NULL) + if ( m_dropTarget != NULL ) { m_dropTarget->ConnectToQWidget(m_qtWindow); } From e995618a3a0ef4db69eba04ed6c0040a8af2b2e6 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Tue, 29 Jan 2019 17:07:14 +0000 Subject: [PATCH 393/553] Be sure drop target is disconnected before destructing window. --- src/qt/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 26df142c7b..1788afd646 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -259,6 +259,10 @@ wxWindowQt::~wxWindowQt() delete m_qtShortcuts; #endif +#if wxUSE_DRAG_AND_DROP + SetDropTarget(NULL); +#endif + // Delete only if the qt widget was created or assigned to this base class if (m_qtWindow) { From 6ba6d9967a436c427f7de709eae5e97d3dfa5da6 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Tue, 29 Jan 2019 17:11:09 +0000 Subject: [PATCH 394/553] Change Qt wxDropTarget to remember widget and disconnect self when necessary. Clean up naming a bit. --- include/wx/qt/dnd.h | 4 ++-- src/qt/dnd.cpp | 43 ++++++++++++++++++++++++++++++++++++------- src/qt/window.cpp | 4 ++-- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index d7e108cbdd..0c0b954692 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -22,8 +22,8 @@ public: wxDataFormat GetMatchingPair(); - void ConnectToQWidget(QWidget* widget); - void DisconnectFromQWidget(QWidget* widget); + void ConnectTo(QWidget* widget); + void Disconnect(); private: class Impl; diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 4debdf400a..2f3d7d9d03 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -106,10 +106,40 @@ namespace class wxDropTarget::Impl : public QObject { public: - explicit Impl(wxDropTarget* dropTarget) : m_dropTarget(dropTarget) + explicit Impl(wxDropTarget* dropTarget) + : m_dropTarget(dropTarget), + m_widget(NULL) { } + ~Impl() + { + Disconnect(); + } + + void ConnectTo(QWidget* widget) + { + Disconnect(); + + m_widget = widget; + + if ( m_widget != NULL ) + { + m_widget->setAcceptDrops(true); + m_widget->installEventFilter(this); + } + } + + void Disconnect() + { + if ( m_widget != NULL ) + { + m_widget->setAcceptDrops(false); + m_widget->removeEventFilter(this); + m_widget = NULL; + } + } + virtual bool eventFilter(QObject* watched, QEvent* event) wxOVERRIDE { if ( m_dropTarget != NULL ) @@ -191,6 +221,7 @@ public: const QMimeData* m_pendingMimeData; wxDropTarget* m_dropTarget; + QWidget* m_widget; }; wxDropTarget::wxDropTarget(wxDataObject *dataObject) @@ -246,16 +277,14 @@ wxDataFormat wxDropTarget::GetMatchingPair() return wxFormatInvalid; } -void wxDropTarget::ConnectToQWidget(QWidget* widget) +void wxDropTarget::ConnectTo(QWidget* widget) { - widget->setAcceptDrops(true); - widget->installEventFilter(m_pImpl); + m_pImpl->ConnectTo(widget); } -void wxDropTarget::DisconnectFromQWidget(QWidget* widget) +void wxDropTarget::Disconnect() { - widget->setAcceptDrops(false); - widget->removeEventFilter(m_pImpl); + m_pImpl->Disconnect(); } //############################################################################## diff --git a/src/qt/window.cpp b/src/qt/window.cpp index 1788afd646..dba441cb39 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -698,14 +698,14 @@ void wxWindowQt::SetDropTarget( wxDropTarget *dropTarget ) if ( m_dropTarget != NULL ) { - m_dropTarget->DisconnectFromQWidget(m_qtWindow); + m_dropTarget->Disconnect(); } m_dropTarget = dropTarget; if ( m_dropTarget != NULL ) { - m_dropTarget->ConnectToQWidget(m_qtWindow); + m_dropTarget->ConnectTo(m_qtWindow); } } #endif From aa22547b2808fa70cb51c70dce16822b814e2018 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Mon, 28 Jan 2019 20:46:42 -0500 Subject: [PATCH 395/553] Document wxHtmlCellEvent::GetMouseEvent() Closes https://github.com/wxWidgets/wxWidgets/pull/1195 --- interface/wx/html/htmlwin.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/wx/html/htmlwin.h b/interface/wx/html/htmlwin.h index 36fd69d41c..177939fba1 100644 --- a/interface/wx/html/htmlwin.h +++ b/interface/wx/html/htmlwin.h @@ -621,6 +621,11 @@ public: */ wxPoint GetPoint() const; + /** + Returns the wxMouseEvent associated with the event. + */ + wxMouseEvent GetMouseEvent() const; + /** Call this function with @a linkclicked set to @true if the cell which has been clicked contained a link or @false otherwise (which is the default). From fbc39bac546b8b33cd9e3331dfae356e8eb7d609 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 30 Jan 2019 09:12:08 +0000 Subject: [PATCH 396/553] Fix Linux build --- src/qt/dnd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 2f3d7d9d03..17c81fdfad 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -12,6 +12,7 @@ #include "wx/dnd.h" #include "wx/scopedarray.h" +#include "wx/window.h" #include "wx/qt/private/converter.h" From c3b8b81da572558e4feef04d0c19568165f87786 Mon Sep 17 00:00:00 2001 From: Graham Dawes Date: Wed, 30 Jan 2019 09:27:35 +0000 Subject: [PATCH 397/553] Remove unused includes from qt/window.h --- include/wx/qt/window.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index 3978615ae6..6f5a2a87e1 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -9,9 +9,6 @@ #ifndef _WX_QT_WINDOW_H_ #define _WX_QT_WINDOW_H_ -#include -#include - class QShortcut; template < class T > class QList; From abdebb189510cd9cf2b27ce5c0baa89a8690cb4c Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 10:42:01 +0000 Subject: [PATCH 398/553] Do not allow drag and drop process on targets that do not support the formats dragged. Privatize some Impl members. --- src/qt/dnd.cpp | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 17c81fdfad..58d20d53c5 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -173,13 +173,19 @@ public: void OnEnter(QEvent* event) { - event->accept(); - QDragEnterEvent *e = static_cast(event); - const QPoint where = e->pos(); PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + if ( !CanDropHere() ) + { + e->setDropAction(Qt::IgnoreAction); + return; + } + + event->accept(); + + const QPoint where = e->pos(); wxDragResult result = m_dropTarget->OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); e->setDropAction(DragResultToDropAction(result)); @@ -196,10 +202,10 @@ public: event->accept(); QDragMoveEvent *e = static_cast(event); - const QPoint where = e->pos(); PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + const QPoint where = e->pos(); wxDragResult result = m_dropTarget->OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); e->setDropAction(DragResultToDropAction(result)); @@ -210,15 +216,27 @@ public: event->accept(); const QDropEvent *e = static_cast(event); - const QPoint where = e->pos(); PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + const QPoint where = e->pos(); if ( m_dropTarget->OnDrop(where.x(), where.y()) ) { m_dropTarget->OnData(where.x(), where.y(), DropActionToDragResult(e->dropAction())); } } + + const QMimeData* GetMimeData() const + { + return m_pendingMimeData; + } + +private: + + bool CanDropHere() const + { + return !m_dropTarget->GetMatchingPair().GetMimeType().empty(); + } const QMimeData* m_pendingMimeData; wxDropTarget* m_dropTarget; @@ -238,7 +256,7 @@ wxDropTarget::~wxDropTarget() bool wxDropTarget::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { - return !GetMatchingPair().GetMimeType().empty(); + return true; } wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult def) @@ -255,17 +273,18 @@ bool wxDropTarget::GetData() if ( mimeType.empty() ) return false; - const QByteArray data = m_pImpl->m_pendingMimeData->data(wxQtConvertString(mimeType)); + const QByteArray data = m_pImpl->GetMimeData()->data(wxQtConvertString(mimeType)); return m_dataObject->SetData(droppedFormat, data.size(), data.data()); } wxDataFormat wxDropTarget::GetMatchingPair() { - if ( m_pImpl->m_pendingMimeData == NULL || m_dataObject == NULL ) + const QMimeData* mimeData = m_pImpl->GetMimeData(); + if ( mimeData == NULL || m_dataObject == NULL ) return wxFormatInvalid; - const QStringList formats = m_pImpl->m_pendingMimeData->formats(); + const QStringList formats = mimeData->formats(); for ( int i = 0; i < formats.count(); ++i ) { const wxDataFormat format(wxQtConvertString(formats[i])); From 6fa65900f954fe3e8ae828178a51ae5905262dca Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 14:22:01 +0000 Subject: [PATCH 399/553] Implement cursor overriding for DnD on wxQt. This uses the cursor variant (as opposed to the icon one) since these actually are cursors, the base class looks like cursors are meant to be used, and the icon thing looks like a hack. --- include/wx/qt/dnd.h | 14 +++++++------- src/qt/dnd.cpp | 28 ++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index 0c0b954692..4f5c2a4cbd 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -8,7 +8,7 @@ #ifndef _WX_QT_DND_H_ #define _WX_QT_DND_H_ -#define wxDROP_ICON(name) wxICON(name) +#define wxDROP_ICON(name) wxCursor(name##_xpm) class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase { @@ -34,15 +34,15 @@ class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase { public: wxDropSource( wxWindow *win = NULL, - const wxIcon © = wxNullIcon, - const wxIcon &move = wxNullIcon, - const wxIcon &none = wxNullIcon); + const wxCursor © = wxNullCursor, + const wxCursor &move = wxNullCursor, + const wxCursor &none = wxNullCursor); wxDropSource( wxDataObject& data, wxWindow *win, - const wxIcon © = wxNullIcon, - const wxIcon &move = wxNullIcon, - const wxIcon &none = wxNullIcon); + const wxCursor © = wxNullCursor, + const wxCursor &move = wxNullCursor, + const wxCursor &none = wxNullCursor); virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 58d20d53c5..7d42adeea4 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -81,6 +81,12 @@ namespace return mimeData; } + + void SetDragCursor(QDrag& drag, const wxCursor& cursor, Qt::DropAction action) + { + if ( cursor.IsOk() ) + drag.setDragCursor(cursor.GetHandle().pixmap(), action); + } } namespace @@ -310,19 +316,21 @@ void wxDropTarget::Disconnect() //############################################################################## wxDropSource::wxDropSource(wxWindow *win, - const wxIcon &WXUNUSED(copy), - const wxIcon &WXUNUSED(move), - const wxIcon &WXUNUSED(none)) - : m_parentWindow(win) + const wxCursor ©, + const wxCursor &move, + const wxCursor &none) + : wxDropSourceBase(copy, move, none), + m_parentWindow(win) { } wxDropSource::wxDropSource(wxDataObject& data, wxWindow *win, - const wxIcon &WXUNUSED(copy), - const wxIcon &WXUNUSED(move), - const wxIcon &WXUNUSED(none)) - : m_parentWindow(win) + const wxCursor ©, + const wxCursor &move, + const wxCursor &none) + : wxDropSourceBase(copy, move, none), + m_parentWindow(win) { SetData(data); } @@ -335,6 +343,10 @@ wxDragResult wxDropSource::DoDragDrop(int flags /*=wxDrag_CopyOnly*/) QDrag drag(m_parentWindow->GetHandle()); drag.setMimeData(CreateMimeData(m_data)); + SetDragCursor(drag, m_cursorCopy, Qt::CopyAction); + SetDragCursor(drag, m_cursorMove, Qt::MoveAction); + SetDragCursor(drag, m_cursorStop, Qt::IgnoreAction); + Qt::DropActions actions = Qt::CopyAction | Qt::MoveAction; Qt::DropAction defaultAction = Qt::CopyAction; switch ( flags ) From df38836862c28c9912dc41ec3cf6f8cc70f3b0f3 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 14:36:06 +0000 Subject: [PATCH 400/553] Fixed some spacing. --- include/wx/qt/dnd.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index 4f5c2a4cbd..e1ef68473b 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -33,16 +33,16 @@ private: class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase { public: - wxDropSource( wxWindow *win = NULL, - const wxCursor © = wxNullCursor, - const wxCursor &move = wxNullCursor, - const wxCursor &none = wxNullCursor); + wxDropSource(wxWindow *win = NULL, + const wxCursor © = wxNullCursor, + const wxCursor &move = wxNullCursor, + const wxCursor &none = wxNullCursor); - wxDropSource( wxDataObject& data, - wxWindow *win, - const wxCursor © = wxNullCursor, - const wxCursor &move = wxNullCursor, - const wxCursor &none = wxNullCursor); + wxDropSource(wxDataObject& data, + wxWindow *win, + const wxCursor © = wxNullCursor, + const wxCursor &move = wxNullCursor, + const wxCursor &none = wxNullCursor); virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); From ece6626a59a491350fe6f38fbbde349eae5b42be Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 15:03:05 +0000 Subject: [PATCH 401/553] Switch wxQt to use UTF-8 for text data transfer via wxDataObject. The result otherwise was less than useful. --- include/wx/dataobj.h | 2 +- src/qt/dataobj.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index 348ad20286..885a75d5a9 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -322,7 +322,7 @@ private: // ---------------------------------------------------------------------------- #if wxUSE_UNICODE - #if defined(__WXGTK20__) || defined(__WXX11__) + #if defined(__WXGTK20__) || defined(__WXX11__) || defined(__WXQT__) #define wxNEEDS_UTF8_FOR_TEXT_DATAOBJ #elif defined(__WXMAC__) #define wxNEEDS_UTF16_FOR_TEXT_DATAOBJ diff --git a/src/qt/dataobj.cpp b/src/qt/dataobj.cpp index e6f8f6e1be..463677d497 100644 --- a/src/qt/dataobj.cpp +++ b/src/qt/dataobj.cpp @@ -157,6 +157,20 @@ wxBitmapDataObject::wxBitmapDataObject( const wxBitmap &WXUNUSED(bitmap) ) { } +//############################################################################# +// ---------------------------------------------------------------------------- +// wxTextDataObject +// ---------------------------------------------------------------------------- + +#if wxUSE_UNICODE +void wxTextDataObject::GetAllFormats(wxDataFormat *formats, + wxDataObjectBase::Direction WXUNUSED(dir)) const +{ + formats[0] = wxDataFormat(wxDF_UNICODETEXT); + formats[1] = wxDataFormat(wxDF_TEXT); +} +#endif + //############################################################################# wxFileDataObject::wxFileDataObject() From 32780f00f2e62ff92ebdbc0be93a174b194fd4a5 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 15:11:46 +0000 Subject: [PATCH 402/553] Combine two separate anonymous namespaces into one. --- src/qt/dnd.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 7d42adeea4..2552b99074 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -87,10 +87,7 @@ namespace if ( cursor.IsOk() ) drag.setDragCursor(cursor.GetHandle().pixmap(), action); } -} -namespace -{ class PendingMimeDataSetter { public: From 4844c80e1831a82cee5c105955677deb4c5073fa Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 15:19:39 +0000 Subject: [PATCH 403/553] Add some consts to const things. --- src/qt/dnd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 2552b99074..9b799324b8 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -178,7 +178,7 @@ public: { QDragEnterEvent *e = static_cast(event); - PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + const PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); if ( !CanDropHere() ) { @@ -189,7 +189,7 @@ public: event->accept(); const QPoint where = e->pos(); - wxDragResult result = m_dropTarget->OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + const wxDragResult result = m_dropTarget->OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); e->setDropAction(DragResultToDropAction(result)); } @@ -206,10 +206,10 @@ public: QDragMoveEvent *e = static_cast(event); - PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + const PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); const QPoint where = e->pos(); - wxDragResult result = m_dropTarget->OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + const wxDragResult result = m_dropTarget->OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); e->setDropAction(DragResultToDropAction(result)); } @@ -220,7 +220,7 @@ public: const QDropEvent *e = static_cast(event); - PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); + const PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); const QPoint where = e->pos(); if ( m_dropTarget->OnDrop(where.x(), where.y()) ) From 76eee80738397fdf8c7baaf9a609e49174fa9b5d Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 15:21:43 +0000 Subject: [PATCH 404/553] Initialize m_pendingMimeData to NULL! --- src/qt/dnd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 9b799324b8..eddc667d52 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -112,7 +112,8 @@ class wxDropTarget::Impl : public QObject public: explicit Impl(wxDropTarget* dropTarget) : m_dropTarget(dropTarget), - m_widget(NULL) + m_widget(NULL), + m_pendingMimeData(NULL) { } @@ -241,9 +242,9 @@ private: return !m_dropTarget->GetMatchingPair().GetMimeType().empty(); } - const QMimeData* m_pendingMimeData; wxDropTarget* m_dropTarget; QWidget* m_widget; + const QMimeData* m_pendingMimeData; }; wxDropTarget::wxDropTarget(wxDataObject *dataObject) From 58639481c606f95fda8031714ec80b4982460167 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 15:25:51 +0000 Subject: [PATCH 405/553] Make OnData behave like other implementations in terms of paying attention to what GetData returns. --- src/qt/dnd.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index eddc667d52..83893db06c 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -265,8 +265,7 @@ bool wxDropTarget::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult def) { - GetData(); - return def; + return GetData() ? def : wxDragNone; } bool wxDropTarget::GetData() From 653979936bebf36d8faebc01d01a1ce5473be99e Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 15:59:37 +0000 Subject: [PATCH 406/553] Clean up the code a bit to follow the guidelines, including handling of default in switches and line length. --- include/wx/qt/dnd.h | 4 +++- src/qt/dataobj.cpp | 9 +++---- src/qt/dnd.cpp | 58 +++++++++++++++++++++++++++++++++------------ 3 files changed, 51 insertions(+), 20 deletions(-) diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index e1ef68473b..6644d9325b 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -17,7 +17,9 @@ public: virtual ~wxDropTarget(); virtual bool OnDrop(wxCoord x, wxCoord y) wxOVERRIDE; - virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE; + virtual wxDragResult OnData(wxCoord x, + wxCoord y, + wxDragResult def) wxOVERRIDE; virtual bool GetData() wxOVERRIDE; wxDataFormat GetMatchingPair(); diff --git a/src/qt/dataobj.cpp b/src/qt/dataobj.cpp index 463677d497..b0b3b09ade 100644 --- a/src/qt/dataobj.cpp +++ b/src/qt/dataobj.cpp @@ -117,7 +117,7 @@ bool wxDataFormat::operator!=(const wxDataFormat& format) const return !operator==(format); } -//############################################################################# +//############################################################################ wxDataObject::wxDataObject() { @@ -127,7 +127,8 @@ wxDataObject::~wxDataObject() { } -bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const +bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, + Direction dir) const { const size_t formatCount = GetFormatCount(dir); if ( formatCount == 1 ) @@ -147,7 +148,7 @@ bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) return false; } -//############################################################################# +//############################################################################ wxBitmapDataObject::wxBitmapDataObject() { @@ -160,7 +161,7 @@ wxBitmapDataObject::wxBitmapDataObject( const wxBitmap &WXUNUSED(bitmap) ) //############################################################################# // ---------------------------------------------------------------------------- // wxTextDataObject -// ---------------------------------------------------------------------------- +// --------------------------------------------------------------------------- #if wxUSE_UNICODE void wxTextDataObject::GetAllFormats(wxDataFormat *formats, diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 83893db06c..2b4794e2e9 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -32,12 +32,14 @@ namespace case Qt::CopyAction: return wxDragCopy; case Qt::MoveAction: + case Qt::TargetMoveAction: return wxDragMove; case Qt::LinkAction: return wxDragLink; - default: - return wxDragNone; } + + wxFAIL_MSG("Illegal drop action"); + return wxDragNone; } Qt::DropAction DragResultToDropAction(wxDragResult result) @@ -50,12 +52,19 @@ namespace return Qt::MoveAction; case wxDragLink: return Qt::LinkAction; - default: + case wxDragError: + case wxDragNone: + case wxDragCancel: return Qt::IgnoreAction; } + + wxFAIL_MSG("Illegal drag result"); + return Qt::IgnoreAction; } - void AddDataFormat(wxDataObject* dataObject, QMimeData* mimeData, const wxDataFormat& format) + void AddDataFormat(wxDataObject* dataObject, + QMimeData* mimeData, + const wxDataFormat& format) { const size_t data_size = dataObject->GetDataSize(format); @@ -82,7 +91,9 @@ namespace return mimeData; } - void SetDragCursor(QDrag& drag, const wxCursor& cursor, Qt::DropAction action) + void SetDragCursor(QDrag& drag, + const wxCursor& cursor, + Qt::DropAction action) { if ( cursor.IsOk() ) drag.setDragCursor(cursor.GetHandle().pixmap(), action); @@ -91,7 +102,8 @@ namespace class PendingMimeDataSetter { public: - PendingMimeDataSetter(const QMimeData*& targetMimeData, const QMimeData* mimeData) + PendingMimeDataSetter(const QMimeData*& targetMimeData, + const QMimeData* mimeData) : m_targetMimeData(targetMimeData) { m_targetMimeData = mimeData; @@ -190,7 +202,11 @@ public: event->accept(); const QPoint where = e->pos(); - const wxDragResult result = m_dropTarget->OnEnter(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + const wxDragResult proposedResult = + DropActionToDragResult(e->proposedAction()); + const wxDragResult result = m_dropTarget->OnEnter(where.x(), + where.y(), + proposedResult); e->setDropAction(DragResultToDropAction(result)); } @@ -210,7 +226,11 @@ public: const PendingMimeDataSetter setter(m_pendingMimeData, e->mimeData()); const QPoint where = e->pos(); - const wxDragResult result = m_dropTarget->OnDragOver(where.x(), where.y(), DropActionToDragResult(e->proposedAction())); + const wxDragResult proposedResult = + DropActionToDragResult(e->proposedAction()); + const wxDragResult result = m_dropTarget->OnDragOver(where.x(), + where.y(), + proposedResult); e->setDropAction(DragResultToDropAction(result)); } @@ -226,7 +246,9 @@ public: const QPoint where = e->pos(); if ( m_dropTarget->OnDrop(where.x(), where.y()) ) { - m_dropTarget->OnData(where.x(), where.y(), DropActionToDragResult(e->dropAction())); + m_dropTarget->OnData(where.x(), + where.y(), + DropActionToDragResult(e->dropAction())); } } @@ -263,7 +285,9 @@ bool wxDropTarget::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) return true; } -wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult def) +wxDragResult wxDropTarget::OnData(wxCoord WXUNUSED(x), + wxCoord WXUNUSED(y), + wxDragResult def) { return GetData() ? def : wxDragNone; } @@ -272,11 +296,12 @@ bool wxDropTarget::GetData() { const wxDataFormat droppedFormat = GetMatchingPair(); - const wxString mimeType = droppedFormat.GetMimeType(); + const wxString& mimeType = droppedFormat.GetMimeType(); if ( mimeType.empty() ) return false; - const QByteArray data = m_pImpl->GetMimeData()->data(wxQtConvertString(mimeType)); + const QString qMimeType = wxQtConvertString(mimeType); + const QByteArray data = m_pImpl->GetMimeData()->data(qMimeType); return m_dataObject->SetData(droppedFormat, data.size(), data.data()); } @@ -310,7 +335,7 @@ void wxDropTarget::Disconnect() m_pImpl->Disconnect(); } -//############################################################################## +//########################################################################### wxDropSource::wxDropSource(wxWindow *win, const wxCursor ©, @@ -334,8 +359,11 @@ wxDropSource::wxDropSource(wxDataObject& data, wxDragResult wxDropSource::DoDragDrop(int flags /*=wxDrag_CopyOnly*/) { - wxCHECK_MSG(m_data != NULL, wxDragNone, wxT("No data in wxDropSource!")); - wxCHECK_MSG(m_parentWindow != NULL, wxDragNone, wxT("NULL parent window in wxDropSource!")); + wxCHECK_MSG(m_data != NULL, wxDragNone, + wxT("No data in wxDropSource!")); + + wxCHECK_MSG(m_parentWindow != NULL, wxDragNone, + wxT("NULL parent window in wxDropSource!")); QDrag drag(m_parentWindow->GetHandle()); drag.setMimeData(CreateMimeData(m_data)); From 111a37fd737560c0894fabdc89bd83cf37ab455c Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 16:09:18 +0000 Subject: [PATCH 407/553] Get rid of another switch/default issue by avoiding switch altogther. Makes the code more readable (I think) actually. --- src/qt/dnd.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/qt/dnd.cpp b/src/qt/dnd.cpp index 2b4794e2e9..8186a3d951 100644 --- a/src/qt/dnd.cpp +++ b/src/qt/dnd.cpp @@ -372,19 +372,15 @@ wxDragResult wxDropSource::DoDragDrop(int flags /*=wxDrag_CopyOnly*/) SetDragCursor(drag, m_cursorMove, Qt::MoveAction); SetDragCursor(drag, m_cursorStop, Qt::IgnoreAction); - Qt::DropActions actions = Qt::CopyAction | Qt::MoveAction; - Qt::DropAction defaultAction = Qt::CopyAction; - switch ( flags ) - { - case wxDrag_CopyOnly: - actions = Qt::CopyAction; - break; - case wxDrag_DefaultMove: - defaultAction = Qt::MoveAction; - break; - default: - break; - } + const Qt::DropActions actions = + flags == wxDrag_CopyOnly + ? Qt::CopyAction + : Qt::CopyAction | Qt::MoveAction; + + const Qt::DropAction defaultAction = + flags == wxDrag_DefaultMove + ? Qt::MoveAction + : Qt::CopyAction; return DropActionToDragResult(drag.exec(actions, defaultAction)); } From ae94f4da9cb8d845d1dcf7c42cf24fc38fa75771 Mon Sep 17 00:00:00 2001 From: Matthew Griffin <45285214+matthew-griffin@users.noreply.github.com> Date: Fri, 25 Jan 2019 11:51:20 +0000 Subject: [PATCH 408/553] Ensure that top level window is active when it's shown in wxQt Under some (not totally clear) circumstances, a TLW can remain inactive after being shown, which is undesirable, as it prevents setting focus to its children from working. Work around this by calling activateWindow() explicitly if necessary. Closes https://github.com/wxWidgets/wxWidgets/pull/1179 --- include/wx/qt/toplevel.h | 1 + src/qt/toplevel.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/wx/qt/toplevel.h b/include/wx/qt/toplevel.h index 2e7bd198ec..5bc66da183 100644 --- a/include/wx/qt/toplevel.h +++ b/include/wx/qt/toplevel.h @@ -29,6 +29,7 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); + virtual bool Show(bool show = true) wxOVERRIDE; virtual void Maximize(bool maximize = true); virtual void Restore(); virtual void Iconize(bool iconize = true); diff --git a/src/qt/toplevel.cpp b/src/qt/toplevel.cpp index 4ab7344dbb..c9b21a8ca1 100644 --- a/src/qt/toplevel.cpp +++ b/src/qt/toplevel.cpp @@ -62,6 +62,17 @@ bool wxTopLevelWindowQt::Create( wxWindow *parent, wxWindowID winId, return true; } +bool wxTopLevelWindowQt::Show(bool show) +{ + if ( !wxTopLevelWindowBase::Show(show) ) + return false; + + if ( show && !m_qtWindow->isActiveWindow() ) + m_qtWindow->activateWindow(); + + return true; +} + void wxTopLevelWindowQt::Maximize(bool maximize) { QWidget *widget = GetHandle(); From 8fbca5cb70c8b647d5bd2cacb1e0a2a00358f351 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 30 Jan 2019 17:28:08 +0100 Subject: [PATCH 409/553] Remove all trailing spaces No real changes, just clean up sources by removing trailing spaces from all the non-generated files. This should hopefully avoid future commits mixing significant changes with insignificant whitespace ones. --- docs/changes_30.txt | 4 +- docs/doxygen/groups/class_webview.h | 2 +- docs/doxygen/groups/funcmacro_locale.h | 2 +- docs/doxygen/mainpages/const_stdevtid.h | 2 +- docs/doxygen/mainpages/copyright.h | 2 +- docs/doxygen/mainpages/samples.h | 2 +- docs/doxygen/overviews/debugging.h | 2 +- docs/doxygen/overviews/docview.h | 2 +- docs/doxygen/overviews/eventhandling.h | 2 +- docs/doxygen/overviews/log.h | 12 +- docs/doxygen/overviews/propgrid.h | 4 +- docs/doxygen/overviews/sizer.h | 20 +-- docs/doxygen/scripts/c_tools.py | 12 +- docs/doxygen/scripts/common.py | 4 +- docs/doxygen/scripts/doxymlparser.py | 56 ++++---- docs/doxygen/scripts/make_bindings.py | 20 +-- docs/doxygen/scripts/sip_tools.py | 22 +-- docs/doxygen/scripts/swig_tools.py | 18 +-- docs/gtk/nonnative.txt | 2 +- docs/lgpl.txt | 14 +- docs/licence.txt | 6 +- docs/licendoc.txt | 4 +- docs/publicity/WoWoW30.html | 6 +- docs/publicity/slogans.txt | 16 +-- docs/vms/readme.txt | 10 +- docs/wine/COPYING.LIB | 2 +- docs/wine/changes.txt | 2 +- docs/wine/install.txt | 134 +++++++++--------- docs/wine/readme.txt | 8 +- docs/xserver.txt | 8 +- include/msvc/wx/setup.h | 6 +- include/wx/accel.h | 2 +- include/wx/app.h | 2 +- include/wx/aui/auibook.h | 2 +- include/wx/colour.h | 2 +- include/wx/dataobj.h | 4 +- include/wx/dc.h | 6 +- include/wx/dcbuffer.h | 2 +- include/wx/dcgraph.h | 2 +- include/wx/fontutil.h | 10 +- include/wx/generic/headerctrlg.h | 2 +- include/wx/graphics.h | 16 +-- include/wx/gtk/dc.h | 2 +- include/wx/gtk/dcmemory.h | 2 +- include/wx/gtk/print.h | 2 +- include/wx/html/helpctrl.h | 4 +- include/wx/html/webkit.h | 4 +- include/wx/kbdstate.h | 14 +- include/wx/menu.h | 22 +-- include/wx/msw/dc.h | 2 +- include/wx/msw/headerctrl.h | 2 +- include/wx/msw/missing.h | 2 +- include/wx/osx/app.h | 8 +- include/wx/osx/bitmap.h | 8 +- include/wx/osx/cocoa/chkconf.h | 2 +- include/wx/osx/cocoa/dataview.h | 2 +- include/wx/osx/cocoa/evtloop.h | 16 +-- include/wx/osx/cocoa/private.h | 12 +- include/wx/osx/cocoa/private/textimpl.h | 2 +- include/wx/osx/core/cfdictionary.h | 2 +- include/wx/osx/core/cfref.h | 4 +- include/wx/osx/core/colour.h | 14 +- include/wx/osx/core/evtloop.h | 2 +- include/wx/osx/core/private.h | 18 +-- include/wx/osx/dataobj.h | 2 +- include/wx/osx/dataview.h | 2 +- include/wx/osx/dialog.h | 4 +- include/wx/osx/evtloop.h | 2 +- include/wx/osx/filedlg.h | 10 +- include/wx/osx/iphone/private.h | 4 +- include/wx/osx/iphone/private/textimpl.h | 6 +- include/wx/osx/menu.h | 2 +- include/wx/osx/msgdlg.h | 2 +- include/wx/osx/nonownedwnd.h | 4 +- include/wx/osx/popupwin.h | 2 +- include/wx/osx/toolbar.h | 4 +- include/wx/osx/toplevel.h | 2 +- include/wx/osx/webview_webkit.h | 6 +- include/wx/osx/window.h | 20 +-- include/wx/private/notifmsg.h | 2 +- include/wx/qt/accel.h | 4 +- include/wx/qt/app.h | 6 +- include/wx/qt/bitmap.h | 2 +- include/wx/qt/brush.h | 2 +- include/wx/qt/choice.h | 8 +- include/wx/qt/cursor.h | 2 +- include/wx/qt/dataform.h | 2 +- include/wx/qt/dataobj.h | 2 +- include/wx/qt/dc.h | 4 +- include/wx/qt/dcprint.h | 8 +- include/wx/qt/defs.h | 2 +- include/wx/qt/dialog.h | 2 +- include/wx/qt/dnd.h | 4 +- include/wx/qt/font.h | 4 +- include/wx/qt/fontdlg.h | 4 +- include/wx/qt/frame.h | 2 +- include/wx/qt/listbox.h | 10 +- include/wx/qt/mdi.h | 2 +- include/wx/qt/minifram.h | 2 +- include/wx/qt/notebook.h | 2 +- include/wx/qt/palette.h | 4 +- include/wx/qt/pen.h | 2 +- include/wx/qt/printdlg.h | 4 +- include/wx/qt/printqt.h | 2 +- include/wx/qt/private/timer.h | 2 +- include/wx/qt/private/winevent.h | 6 +- include/wx/qt/region.h | 4 +- include/wx/qt/statbox.h | 2 +- include/wx/qt/statusbar.h | 2 +- include/wx/qt/textctrl.h | 2 +- include/wx/qt/textentry.h | 6 +- include/wx/qt/tooltip.h | 2 +- include/wx/qt/toplevel.h | 6 +- include/wx/qt/treectrl.h | 10 +- include/wx/rawbmp.h | 2 +- include/wx/richtext/richtextbuffer.h | 6 +- include/wx/richtext/richtextfontpage.h | 2 +- include/wx/richtext/richtextimagedlg.h | 2 +- include/wx/richtext/richtextmarginspage.h | 6 +- include/wx/richtext/richtextuicustomization.h | 8 +- include/wx/richtext/richtextxml.h | 4 +- include/wx/variantbase.h | 24 ++-- include/wx/xti.h | 50 +++---- include/wx/xti2.h | 12 +- include/wx/xtiprop.h | 64 ++++----- include/wx/xtistrm.h | 122 ++++++++-------- include/wx/xtitypes.h | 78 +++++----- include/wx/xtixml.h | 10 +- interface/wx/aboutdlg.h | 12 +- interface/wx/affinematrix2dbase.h | 4 +- interface/wx/animate.h | 2 +- interface/wx/anybutton.h | 4 +- interface/wx/app.h | 2 +- interface/wx/artprov.h | 108 +++++++------- interface/wx/aui/auibar.h | 4 +- interface/wx/aui/framemanager.h | 26 ++-- interface/wx/aui/tabmdi.h | 2 +- interface/wx/base64.h | 2 +- interface/wx/bitmap.h | 12 +- interface/wx/bmpbuttn.h | 4 +- interface/wx/button.h | 2 +- interface/wx/checkbox.h | 4 +- interface/wx/checklst.h | 2 +- interface/wx/choice.h | 4 +- interface/wx/choicebk.h | 2 +- interface/wx/clrpicker.h | 2 +- interface/wx/colour.h | 12 +- interface/wx/combo.h | 10 +- interface/wx/combobox.h | 2 +- interface/wx/config.h | 34 ++--- interface/wx/control.h | 8 +- interface/wx/cshelp.h | 4 +- interface/wx/cursor.h | 6 +- interface/wx/dataobj.h | 4 +- interface/wx/dataview.h | 12 +- interface/wx/datectrl.h | 2 +- interface/wx/datetime.h | 4 +- interface/wx/dc.h | 44 +++--- interface/wx/dcbuffer.h | 2 +- interface/wx/dcgraph.h | 2 +- interface/wx/debugrpt.h | 4 +- interface/wx/defs.h | 10 +- interface/wx/dir.h | 8 +- interface/wx/dirctrl.h | 2 +- interface/wx/editlbox.h | 2 +- interface/wx/event.h | 16 +-- interface/wx/evtloop.h | 2 +- interface/wx/fileconf.h | 2 +- interface/wx/filedlg.h | 20 +-- interface/wx/filepicker.h | 4 +- interface/wx/filesys.h | 2 +- interface/wx/fontpicker.h | 2 +- interface/wx/fontutil.h | 2 +- interface/wx/gbsizer.h | 4 +- interface/wx/gdicmn.h | 2 +- interface/wx/generic/helpext.h | 6 +- interface/wx/geometry.h | 2 +- interface/wx/headerctrl.h | 4 +- interface/wx/help.h | 2 +- interface/wx/html/helpctrl.h | 2 +- interface/wx/html/helpdata.h | 2 +- interface/wx/html/htmlcell.h | 2 +- interface/wx/html/htmprint.h | 14 +- interface/wx/html/webkit.h | 2 +- interface/wx/htmllbox.h | 2 +- interface/wx/hyperlink.h | 2 +- interface/wx/iconbndl.h | 4 +- interface/wx/image.h | 8 +- interface/wx/imaggif.h | 16 +-- interface/wx/imagiff.h | 14 +- interface/wx/imagjpeg.h | 16 +-- interface/wx/imagpcx.h | 14 +- interface/wx/imagpng.h | 12 +- interface/wx/imagpnm.h | 14 +- interface/wx/imagtga.h | 14 +- interface/wx/imagtiff.h | 12 +- interface/wx/imagxpm.h | 14 +- interface/wx/intl.h | 6 +- interface/wx/kbdstate.h | 8 +- interface/wx/listbox.h | 10 +- interface/wx/listctrl.h | 6 +- interface/wx/log.h | 6 +- interface/wx/math.h | 2 +- interface/wx/menu.h | 24 ++-- interface/wx/menuitem.h | 68 ++++----- interface/wx/mimetype.h | 20 +-- interface/wx/mousestate.h | 4 +- interface/wx/msw/ole/automtn.h | 10 +- interface/wx/msw/regconf.h | 2 +- interface/wx/notifmsg.h | 48 +++---- interface/wx/object.h | 4 +- interface/wx/overlay.h | 6 +- interface/wx/pickerbase.h | 2 +- interface/wx/platinfo.h | 78 +++++----- interface/wx/popupwin.h | 4 +- interface/wx/power.h | 2 +- interface/wx/process.h | 24 ++-- interface/wx/progdlg.h | 2 +- interface/wx/propdlg.h | 8 +- interface/wx/propgrid/editors.h | 2 +- interface/wx/propgrid/property.h | 2 +- interface/wx/propgrid/propgridpagestate.h | 4 +- interface/wx/propgrid/props.h | 2 +- interface/wx/protocol/protocol.h | 2 +- interface/wx/rearrangectrl.h | 2 +- interface/wx/renderer.h | 2 +- interface/wx/ribbon/art.h | 126 ++++++++-------- interface/wx/ribbon/bar.h | 38 ++--- interface/wx/ribbon/buttonbar.h | 66 ++++----- interface/wx/ribbon/gallery.h | 2 +- interface/wx/ribbon/page.h | 48 +++---- interface/wx/ribbon/toolbar.h | 24 ++-- interface/wx/richmsgdlg.h | 2 +- interface/wx/richtext/richtextbuffer.h | 32 ++--- interface/wx/richtext/richtextctrl.h | 12 +- interface/wx/sashwin.h | 2 +- interface/wx/scopedptr.h | 4 +- interface/wx/scrolbar.h | 4 +- interface/wx/scrolwin.h | 6 +- interface/wx/settings.h | 10 +- interface/wx/sizer.h | 18 +-- interface/wx/slider.h | 8 +- interface/wx/srchctrl.h | 4 +- interface/wx/statbmp.h | 30 ++-- interface/wx/stc/stc.h | 4 +- interface/wx/stream.h | 2 +- interface/wx/sysopt.h | 2 +- interface/wx/textwrapper.h | 2 +- interface/wx/thread.h | 2 +- interface/wx/timectrl.h | 2 +- interface/wx/timer.h | 2 +- interface/wx/tokenzr.h | 12 +- interface/wx/toplevel.h | 14 +- interface/wx/treectrl.h | 6 +- interface/wx/treelist.h | 4 +- interface/wx/utils.h | 16 +-- interface/wx/validate.h | 2 +- interface/wx/webview.h | 10 +- interface/wx/window.h | 12 +- interface/wx/withimages.h | 4 +- interface/wx/wrapsizer.h | 2 +- interface/wx/xlocale.h | 4 +- samples/dataview/dataview.cpp | 2 +- samples/html/html_samples.bkl | 2 +- samples/ownerdrw/ownerdrw.bkl | 2 +- samples/render/render.bkl | 2 +- samples/ribbon/ribbondemo.cpp | 26 ++-- samples/richtext/richtext.bkl | 2 +- samples/richtext/richtext.cpp | 10 +- samples/taskbar/tbtest.cpp | 2 +- samples/xrc/rc/artprov.xrc | 2 +- samples/xrc/rc/menu.xrc | 14 +- samples/xrc/rc/platform.xrc | 10 +- samples/xrc/rc/toolbar.xrc | 10 +- samples/xti/classlist.cpp | 24 ++-- samples/xti/classlist.h | 20 +-- samples/xti/codereadercallback.cpp | 18 +-- samples/xti/codereadercallback.h | 14 +- samples/xti/xti.bkl | 2 +- samples/xti/xti.cpp | 64 ++++----- src/aui/auibook.cpp | 10 +- src/aui/descrip.mms | 2 +- src/common/containr.cpp | 2 +- src/common/event.cpp | 2 +- src/common/graphcmn.cpp | 8 +- src/common/memory.cpp | 2 +- src/common/menucmn.cpp | 10 +- src/common/notifmsgcmn.cpp | 2 +- src/common/uiactioncmn.cpp | 2 +- src/common/xtistrm.cpp | 52 +++---- src/qt/accel.cpp | 16 +-- src/qt/app.cpp | 2 +- src/qt/apptraits.cpp | 2 +- src/qt/bitmap.cpp | 38 ++--- src/qt/brush.cpp | 14 +- src/qt/button.cpp | 2 +- src/qt/calctrl.cpp | 2 +- src/qt/checkbox.cpp | 2 +- src/qt/clipbrd.cpp | 4 +- src/qt/colordlg.cpp | 4 +- src/qt/cursor.cpp | 6 +- src/qt/dataobj.cpp | 2 +- src/qt/filedlg.cpp | 2 +- src/qt/fontutil.cpp | 2 +- src/qt/listbox.cpp | 2 +- src/qt/listctrl.cpp | 2 +- src/qt/menu.cpp | 2 +- src/qt/menuitem.cpp | 2 +- src/qt/msgdlg.cpp | 10 +- src/qt/pen.cpp | 18 +-- src/qt/region.cpp | 28 ++-- src/qt/scrolbar.cpp | 6 +- src/qt/spinctrl.cpp | 2 +- src/qt/statusbar.cpp | 2 +- src/qt/timer.cpp | 2 +- src/qt/toplevel.cpp | 14 +- src/qt/utils.cpp | 4 +- src/qt/window.cpp | 4 +- tests/test.bkl | 4 +- utils/wxrc/wxrc.bkl | 8 +- 320 files changed, 1611 insertions(+), 1611 deletions(-) diff --git a/docs/changes_30.txt b/docs/changes_30.txt index dfc04bb928..4571e73c77 100644 --- a/docs/changes_30.txt +++ b/docs/changes_30.txt @@ -733,10 +733,10 @@ All (GUI): - Support hexadecimal numbers in wxSpinCtrl. - Respect window max size in wxBoxSizer (Nathan Ridge). - Add support for searching in wxWebView for MSW and GTK (Allonii). -- Add generic wxFileSystem support to wxWebView with +- Add generic wxFileSystem support to wxWebView with wxWebViewFSHandler (Nick Matthews). - Add possibility to disable context menu in wxWebView. -- Add ability to register custom wxWebView backends using +- Add ability to register custom wxWebView backends using wxWebView::RegisterFactory and a wxWebViewFactory derived class. - Add possibility to hide and show again wxRibbonBar pages (wxBen). - Add wxRibbonBar pages highlighting (wxBen). diff --git a/docs/doxygen/groups/class_webview.h b/docs/doxygen/groups/class_webview.h index 15cc934526..56f45c68d5 100644 --- a/docs/doxygen/groups/class_webview.h +++ b/docs/doxygen/groups/class_webview.h @@ -10,7 +10,7 @@ @defgroup group_class_webview WebView @ingroup group_class -The wxWebView library is a set of classes for viewing complex web documents and +The wxWebView library is a set of classes for viewing complex web documents and for internet browsing. It is built around a series of backends, and exposes common functions for them. diff --git a/docs/doxygen/groups/funcmacro_locale.h b/docs/doxygen/groups/funcmacro_locale.h index 4ae5987514..8c646cc90d 100644 --- a/docs/doxygen/groups/funcmacro_locale.h +++ b/docs/doxygen/groups/funcmacro_locale.h @@ -19,7 +19,7 @@ and keep in mind that the wxWidgets function takes as last parameter the locale which should be internally used for locale-dependent operations. Last, note that when the @c wxHAS_XLOCALE_SUPPORT symbol is not defined, -then wxWidgets will provide implementations of these functions itself +then wxWidgets will provide implementations of these functions itself and that they are not granted to be thread-safe (and they will work only with the C locale; see @ref xlocale_avail). diff --git a/docs/doxygen/mainpages/const_stdevtid.h b/docs/doxygen/mainpages/const_stdevtid.h index 50e6a68c79..b3b2fd9bd3 100644 --- a/docs/doxygen/mainpages/const_stdevtid.h +++ b/docs/doxygen/mainpages/const_stdevtid.h @@ -29,7 +29,7 @@ identifiers are all in the range between @c wxID_LOWEST and @c wxID_HIGHEST and, accordingly, the user code should avoid defining its own constants in this range (e.g. by using wxNewId()). -Refer to @ref page_stockitems "the list of stock items" for the subset of standard IDs +Refer to @ref page_stockitems "the list of stock items" for the subset of standard IDs which are stock IDs as well. */ diff --git a/docs/doxygen/mainpages/copyright.h b/docs/doxygen/mainpages/copyright.h index 88eadadd8d..d9c39afcf3 100644 --- a/docs/doxygen/mainpages/copyright.h +++ b/docs/doxygen/mainpages/copyright.h @@ -103,7 +103,7 @@ without express or implied warranty. @verbinclude "lgpl.txt" @page page_copyright_xserver The Open Group and DEC License - + @verbinclude "xserver.txt" */ diff --git a/docs/doxygen/mainpages/samples.h b/docs/doxygen/mainpages/samples.h index db03c9942f..1d783a90e9 100644 --- a/docs/doxygen/mainpages/samples.h +++ b/docs/doxygen/mainpages/samples.h @@ -914,7 +914,7 @@ control. The wxWebView sample demonstarates the various capabilities of the wxWebView control. It is set up as a simple single window web browser, but with support -for many of the more complex wxWebView features, including browsing through +for many of the more complex wxWebView features, including browsing through archives. @sampledir{webview} diff --git a/docs/doxygen/overviews/debugging.h b/docs/doxygen/overviews/debugging.h index 7abb682830..7c1520ea46 100644 --- a/docs/doxygen/overviews/debugging.h +++ b/docs/doxygen/overviews/debugging.h @@ -21,7 +21,7 @@ debugging. Both assertions and debug logging are also used by wxWidgets itself so you may encounter them even if you don't use either of these features yourself. -@see wxLog, @ref group_funcmacro_log, @ref group_funcmacro_debug +@see wxLog, @ref group_funcmacro_log, @ref group_funcmacro_debug diff --git a/docs/doxygen/overviews/docview.h b/docs/doxygen/overviews/docview.h index f213de1095..8f5da29682 100644 --- a/docs/doxygen/overviews/docview.h +++ b/docs/doxygen/overviews/docview.h @@ -86,7 +86,7 @@ use Wx ':docview'; # import constants (optional) @endcode @endWxPerlOnly -@see @ref group_class_docview, +@see @ref group_class_docview, diff --git a/docs/doxygen/overviews/eventhandling.h b/docs/doxygen/overviews/eventhandling.h index c38d1b8af5..b3195d5ebe 100644 --- a/docs/doxygen/overviews/eventhandling.h +++ b/docs/doxygen/overviews/eventhandling.h @@ -614,7 +614,7 @@ custom event types. Finally, you will need to generate and post your custom events. Generation is as simple as instancing your custom event class and initializing its internal fields. -For posting events to a certain event handler there are two possibilities: +For posting events to a certain event handler there are two possibilities: using wxEvtHandler::AddPendingEvent or using wxEvtHandler::QueueEvent. Basically you will need to use the latter when doing inter-thread communication; when you use only the main thread you can also safely use the former. diff --git a/docs/doxygen/overviews/log.h b/docs/doxygen/overviews/log.h index ad66ae2df1..948d1fe1b0 100644 --- a/docs/doxygen/overviews/log.h +++ b/docs/doxygen/overviews/log.h @@ -19,9 +19,9 @@ as well as several standard implementations of it and a family of functions to use with them. First of all, no knowledge of wxLog classes is needed to use them. For this, -you should only know about @ref group_funcmacro_log "wxLogXXX() functions". -All of them have the same syntax as @e printf() or @e vprintf() , i.e. they -take the format string as the first argument and respectively a variable number +you should only know about @ref group_funcmacro_log "wxLogXXX() functions". +All of them have the same syntax as @e printf() or @e vprintf() , i.e. they +take the format string as the first argument and respectively a variable number of arguments or a variable argument list pointer. Here are all of them: @li wxLogFatalError() which is like wxLogError(), but also terminates the program @@ -161,8 +161,8 @@ works. wxWidgets has the notion of a log target: it is just a class deriving from wxLog. As such, it implements the virtual functions of the base class which are called when a message is logged. Only one log target is @e active at -any moment, this is the one used by @ref group_funcmacro_log "wxLogXXX() functions". -The normal usage of a log object (i.e. object of a class derived from wxLog) is +any moment, this is the one used by @ref group_funcmacro_log "wxLogXXX() functions". +The normal usage of a log object (i.e. object of a class derived from wxLog) is to install it as the active target with a call to @e SetActiveTarget() and it will be used automatically by all subsequent calls to @ref group_funcmacro_log "wxLogXXX() functions". @@ -263,7 +263,7 @@ GUI is (already/still) available when your log target as used as wxWidgets automatically switches to using wxLogStderr if it isn't. There are several methods which may be overridden in the derived class to -customize log messages handling: wxLog::DoLogRecord(), wxLog::DoLogTextAtLevel() +customize log messages handling: wxLog::DoLogRecord(), wxLog::DoLogTextAtLevel() and wxLog::DoLogText(). The last method is the simplest one: you should override it if you simply diff --git a/docs/doxygen/overviews/propgrid.h b/docs/doxygen/overviews/propgrid.h index fbca6a2edd..f6bc3d3d66 100644 --- a/docs/doxygen/overviews/propgrid.h +++ b/docs/doxygen/overviews/propgrid.h @@ -733,10 +733,10 @@ accomplish the task: @code // Have property editor focus on Enter propgrid->AddActionTrigger( wxPG_ACTION_EDIT, WXK_RETURN ); - + // Have Enter work as action trigger even when editor is focused propgrid->DedicateKey( WXK_RETURN ); - + // Let Enter also navigate to the next property propgrid->AddActionTrigger( wxPG_ACTION_NEXT_PROPERTY, WXK_RETURN ); diff --git a/docs/doxygen/overviews/sizer.h b/docs/doxygen/overviews/sizer.h index 4ab49f1d16..3d80689da0 100644 --- a/docs/doxygen/overviews/sizer.h +++ b/docs/doxygen/overviews/sizer.h @@ -15,7 +15,7 @@ Sizers, as represented by the wxSizer class and its descendants in the wxWidgets class hierarchy, have become the method of choice to define the layout of controls in dialogs in wxWidgets because of their ability to create visually appealing dialogs independent of the platform, taking into account -the differences in size and style of the individual controls. +the differences in size and style of the individual controls. The next section describes and shows what can be done with sizers. The following sections briefly describe how to program with individual sizer @@ -211,7 +211,7 @@ window will preserve it is original size, @c wxGROW flag (same as @c wxEXPAND) f the window to grow with the sizer, and @c wxSHAPED flag tells the window to change it is size proportionally, preserving original aspect ratio. When @c wxGROW flag is not used, the item can be aligned within available space. @c wxALIGN_LEFT, -@c wxALIGN_TOP, @c wxALIGN_RIGHT, @c wxALIGN_BOTTOM, @c wxALIGN_CENTER_HORIZONTAL +@c wxALIGN_TOP, @c wxALIGN_RIGHT, @c wxALIGN_BOTTOM, @c wxALIGN_CENTER_HORIZONTAL and @c wxALIGN_CENTER_VERTICAL do what they say. @c wxALIGN_CENTRE (same as @c wxALIGN_CENTER) is defined as (wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL). Default alignment is wxALIGN_LEFT | wxALIGN_TOP. @@ -267,7 +267,7 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title ) } @endcode -Note that the recommended way of specifying flags to wxSizer is via wxSizerFlags. +Note that the recommended way of specifying flags to wxSizer is via wxSizerFlags. This class greatly eases the burden of passing flags to a wxSizer. Here's how you'd do the previous example with wxSizerFlags: @@ -313,18 +313,18 @@ MyDialog::MyDialog(wxFrame *parent, wxWindowID id, const wxString &title ) @section overview_sizer_types Other Types of Sizers -wxStdDialogButtonSizer is a sizer that creates button layouts in dialogs -which conform to the standard button spacing and ordering defined by +wxStdDialogButtonSizer is a sizer that creates button layouts in dialogs +which conform to the standard button spacing and ordering defined by the platform or toolkit's user interface guidelines (if such things exist). As a convenience, wxDialog::CreateButtonSizer() can be used to create this sizer. -wxWrapSizer is a sizer that lays out its items in a single line, like a box -sizer -- as long as there is space available in that direction. Once all available -space in the primary direction has been used, a new line is added and items -are added there. +wxWrapSizer is a sizer that lays out its items in a single line, like a box +sizer -- as long as there is space available in that direction. Once all available +space in the primary direction has been used, a new line is added and items +are added there. wxGridBagSizer is a rather special kind of sizer which, unlike the other classes, allows to directly put the elements at the given position in the -sizer. +sizer. */ diff --git a/docs/doxygen/scripts/c_tools.py b/docs/doxygen/scripts/c_tools.py index 8bf0dd5aa9..914839512e 100644 --- a/docs/doxygen/scripts/c_tools.py +++ b/docs/doxygen/scripts/c_tools.py @@ -16,14 +16,14 @@ class CBuilder: output_dir = os.path.abspath(os.path.join(self.output_dir, "c")) if not os.path.exists(output_dir): os.makedirs(output_dir) - + for aclass in self.doxyparser.classes: # This bit doesn't work, because the aclass.name is not the same as # those listed in common if aclass.name in excluded_classes: #print "Skipping %s" % aclass.name continue - + self.make_c_header(output_dir, aclass) @@ -46,7 +46,7 @@ class CBuilder: def make_c_methods(self, aclass): retval = "" - + wxc_classname = 'wxC' + aclass.name[2:].capitalize() for amethod in aclass.constructors: @@ -59,13 +59,13 @@ class CBuilder: if amethod.name.startswith('m_'): # for some reason, public members are listed as methods continue - + args = '(' + wxc_classname + '* obj' if amethod.argsstring.find('()') != -1: args += ')' - else: + else: args += ', ' + amethod.argsstring[1:].strip() - + retval += """ // %s %s %s%s;\n diff --git a/docs/doxygen/scripts/common.py b/docs/doxygen/scripts/common.py index 5285e0e3c5..e9952cbeb7 100644 --- a/docs/doxygen/scripts/common.py +++ b/docs/doxygen/scripts/common.py @@ -15,7 +15,7 @@ excluded_classes = [ "wxArchiveIterator", "wxArchiveNotifier", "wxArchiveOutputStream", - "wxArray< T >", + "wxArray< T >", "wxArrayString", "wxAutomationObject", "wxBufferedInputStream", @@ -160,5 +160,5 @@ def make_enums(aclass): retval += ", " retval += "\n" retval += "};\n\n" - + return retval diff --git a/docs/doxygen/scripts/doxymlparser.py b/docs/doxygen/scripts/doxymlparser.py index a880524fc8..306aef9185 100755 --- a/docs/doxygen/scripts/doxymlparser.py +++ b/docs/doxygen/scripts/doxymlparser.py @@ -38,23 +38,23 @@ class ClassDefinition: self.includes = [] self.bases = [] self.enums = {} - + def __str__(self): str_repr = """ Class: %s Bases: %s Includes: %s -Brief Description: +Brief Description: %s Detailed Description: %s """ % (self.name, string.join(self.bases, ", "), self.includes, self.brief_description, self.detailed_description) str_repr += "Methods:\n" - + for method in self.methods: str_repr += str(method) - + return str_repr class MethodDefinition: @@ -66,20 +66,20 @@ class MethodDefinition: self.params = [] self.brief_description = "" self.detailed_description = "" - + def __str__(self): str_repr = """ Method: %s Return Type: %s Params: %r Prototype: %s -Brief Description: +Brief Description: %s Detailed Description: %s """ % (self.name, self.return_type, self.params, self.definition + self.argsstring, self.brief_description, self.detailed_description) - return str_repr + return str_repr def getTextValue(node, recursive=False): text = "" @@ -89,7 +89,7 @@ def getTextValue(node, recursive=False): if child.nodeType == child.TEXT_NODE: # Add a space to ensure we have a space between qualifiers and parameter names text += child.nodeValue.strip() + " " - + return text.strip() def doxyMLToText(node): @@ -104,7 +104,7 @@ class DoxyMLParser: for aclass in self.classes: if aclass.name == name: return aclass - + return None def get_enums_and_functions(self, filename, aclass): @@ -119,17 +119,17 @@ class DoxyMLParser: def is_derived_from_base(self, aclass, abase): base = get_first_value(aclass.bases) while base and base != "": - + if base == abase: return True - + parentclass = self.find_class(base) - + if parentclass: base = get_first_value(parentclass.bases) else: base = None - + return False def parse(self, filename): @@ -138,7 +138,7 @@ class DoxyMLParser: new_class = self.parse_class(node) self.classes.append(new_class) self.get_enums_and_functions(filename, new_class) - + def parse_class(self, class_node): new_class = ClassDefinition() new_class.name = getTextValue(class_node.getElementsByTagName("compoundname")[0]) @@ -156,21 +156,21 @@ class DoxyMLParser: self.parse_methods(new_class, class_node) return new_class - + def parse_enum(self, new_class, enum, root): enum_name = "" enum_values = [] - + for node in enum.childNodes: if node.nodeName == "name": enum_name = getTextValue(node) elif node.nodeName == "enumvalue": enum_values.append(getTextValue(node.getElementsByTagName("name")[0])) - + new_class.enums[enum_name] = enum_values - + def parse_methods(self, new_class, root): - for method in root.getElementsByTagName("memberdef"): + for method in root.getElementsByTagName("memberdef"): new_method = MethodDefinition() for node in method.childNodes: if node.nodeName == "name": @@ -187,10 +187,10 @@ class DoxyMLParser: if child.nodeType == child.ELEMENT_NODE: param[child.nodeName] = getTextValue(child) new_method.params.append(param) - + if self.verbose: print "Adding %s" % (new_method.name + new_method.argsstring) - + if new_method.name == new_class.name: new_class.constructors.append(new_method) elif new_method.name == "~" + new_class.name: @@ -199,30 +199,30 @@ class DoxyMLParser: new_class.methods.append(new_method) if __name__ == "__main__": - option_dict = { + option_dict = { "report" : (False, "Print out the classes and methods found by this script."), "verbose" : (False, "Provide status updates and other information."), } - + parser = optparse.OptionParser(usage="usage: %prog [options] \n" + __description__, version="%prog 1.0") - + for opt in option_dict: default = option_dict[opt][0] - + action = "store" if type(default) == types.BooleanType: action = "store_true" parser.add_option("--" + opt, default=default, action=action, dest=opt, help=option_dict[opt][1]) - + options, arguments = parser.parse_args() if len(arguments) < 1: parser.print_usage() sys.exit(1) - + doxyparse = DoxyMLParser(verbose = options.verbose) for arg in arguments: - doxyparse.parse(arg) + doxyparse.parse(arg) if options.report: for aclass in doxyparse.classes: diff --git a/docs/doxygen/scripts/make_bindings.py b/docs/doxygen/scripts/make_bindings.py index 5411d07b56..6b9f9da8f4 100644 --- a/docs/doxygen/scripts/make_bindings.py +++ b/docs/doxygen/scripts/make_bindings.py @@ -12,42 +12,42 @@ import swig_tools from common import * if __name__ == "__main__": - option_dict = { + option_dict = { "output_dir" : ("output", "Directory to output bindings to"), "sip" : (True, "Produce SIP bindings"), "swig" : (True, "Produce SWIG bindings."), "c" : (True, "Produce C wrappers."), - + } - + parser = optparse.OptionParser(usage="usage: %prog \n" , version="%prog 1.0") - + for opt in option_dict: default = option_dict[opt][0] - + action = "store" if type(default) == types.BooleanType: action = "store_true" parser.add_option("--" + opt, default=default, action=action, dest=opt, help=option_dict[opt][1]) - + options, arguments = parser.parse_args() if len(arguments) < 1: parser.print_usage() sys.exit(1) - + doxyparse = doxymlparser.DoxyMLParser() for arg in arguments: doxyparse.parse(arg) - + if options.sip: builder = sip_tools.SIPBuilder(doxyparse, options.output_dir) builder.make_bindings() - + if options.swig: builder = swig_tools.SWIGBuilder(doxyparse, options.output_dir) builder.make_bindings() - + if options.c: builder = c_tools.CBuilder(doxyparse, options.output_dir) builder.make_bindings() diff --git a/docs/doxygen/scripts/sip_tools.py b/docs/doxygen/scripts/sip_tools.py index f48d875765..ac8d2fb20b 100644 --- a/docs/doxygen/scripts/sip_tools.py +++ b/docs/doxygen/scripts/sip_tools.py @@ -11,12 +11,12 @@ class SIPBuilder: output_dir = os.path.abspath(os.path.join(self.output_dir, "sip")) if not os.path.exists(output_dir): os.makedirs(output_dir) - + for aclass in self.doxyparser.classes: if aclass.name in excluded_classes: print "Skipping %s" % aclass.name continue - + header_name = aclass.name[2:].lower() filename = os.path.join(output_dir, "_" + header_name + ".sip") enums_text = make_enums(aclass) @@ -24,7 +24,7 @@ class SIPBuilder: base_class = get_first_value(aclass.bases) if base_class != "": base_class = ": %s" % base_class - + text = """ %s class %s %s @@ -45,12 +45,12 @@ public: def make_sip_methods(self, aclass): retval = "" - + for amethod in aclass.constructors + aclass.methods: transfer = "" - + # FIXME: we need to come up with a way of filtering the methods out by various criteria - # including parameters and method name, and how to deal with overloads + # including parameters and method name, and how to deal with overloads if aclass.name in ignored_methods: should_ignore = False for method in ignored_methods[aclass.name]: @@ -66,19 +66,19 @@ public: print "param type = %s, amethod.param type = %s" % (params[i], amethod.params[i]["type"]) should_ignore = False break - + if should_ignore: continue - + # We need to let SIP know when wx is responsible for deleting the object. # We do this if the class is derived from wxWindow, since wxTLW manages child windows # and wxApp deletes all wxTLWs on shutdown if amethod in aclass.constructors and self.doxyparser.is_derived_from_base(aclass, "wxWindow"): transfer = "/Transfer/" - + if amethod.name.startswith("operator"): continue - + retval += " %s %s%s%s;\n\n" % (amethod.return_type.replace("virtual ", ""), amethod.name, amethod.argsstring, transfer) - + return retval diff --git a/docs/doxygen/scripts/swig_tools.py b/docs/doxygen/scripts/swig_tools.py index 2a3e6e3fc6..bc1f5ebe7b 100644 --- a/docs/doxygen/scripts/swig_tools.py +++ b/docs/doxygen/scripts/swig_tools.py @@ -11,13 +11,13 @@ class SWIGBuilder: output_dir = os.path.abspath(os.path.join(self.output_dir, "swig")) if not os.path.exists(output_dir): os.makedirs(output_dir) - + for aclass in self.doxyparser.classes: header_name = aclass.name[2:].lower() if aclass.name in excluded_classes: #print "Skipping %s" % aclass.name continue - + filename = os.path.join(output_dir, "_" + header_name + ".i") enums_text = make_enums(aclass) method_text = self.make_swig_methods(aclass) @@ -37,25 +37,25 @@ public: afile.write(text) afile.close() - + def make_swig_methods(self, aclass): retval = "" - + retval += """ %%pythonAppend %s "self._setOORInfo(self)" %%pythonAppend %s() "" %%typemap(out) %s*; // turn off this typemap """ % (aclass.name, aclass.name, aclass.name) - + for amethod in aclass.constructors: retval += " %s%s;\n\n" % (amethod.name, amethod.argsstring) - + retval += """ // Turn it back on again - %%typemap(out) %s* { $result = wxPyMake_wxObject($1, $owner); } + %%typemap(out) %s* { $result = wxPyMake_wxObject($1, $owner); } """ % aclass.name - + for amethod in aclass.methods: retval += " %s %s%s;\n\n" % (amethod.return_type, amethod.name, amethod.argsstring) - + return retval diff --git a/docs/gtk/nonnative.txt b/docs/gtk/nonnative.txt index 92756c7789..704a1b663c 100644 --- a/docs/gtk/nonnative.txt +++ b/docs/gtk/nonnative.txt @@ -8,7 +8,7 @@ List of classes which should use their native GTK+ equivalents but don't: - wxTreeCtrl Ryan Norton has implemented this - + - wxListCtrl Could be reimplemeted in terms of wxDataViewCtrl? diff --git a/docs/lgpl.txt b/docs/lgpl.txt index d43cdf091b..12e440211e 100644 --- a/docs/lgpl.txt +++ b/docs/lgpl.txt @@ -58,7 +58,7 @@ free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. - + Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent @@ -148,7 +148,7 @@ constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -160,7 +160,7 @@ along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms @@ -220,7 +220,7 @@ Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -278,7 +278,7 @@ distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and @@ -332,7 +332,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute @@ -376,7 +376,7 @@ modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court diff --git a/docs/licence.txt b/docs/licence.txt index 5bfc0e7954..0a25857e6c 100644 --- a/docs/licence.txt +++ b/docs/licence.txt @@ -8,12 +8,12 @@ WXWINDOWS LIBRARY LICENCE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public Licence as published by the Free Software Foundation; either version 2 of the Licence, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library @@ -46,7 +46,7 @@ accordingly. 4. If you write modifications of your own for this library, it is your - choice whether to permit this exception to apply to your modifications. + choice whether to permit this exception to apply to your modifications. If you do not wish that, you must delete the exception notice from such code and/or adjust the licensing conditions notice accordingly. diff --git a/docs/licendoc.txt b/docs/licendoc.txt index 5bfa143812..0772d7f4cf 100644 --- a/docs/licendoc.txt +++ b/docs/licendoc.txt @@ -5,7 +5,7 @@ Everyone is permitted to copy and distribute verbatim copies of this licence document, but changing it is not allowed. - + WXWINDOWS FREE DOCUMENTATION LICENCE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -37,7 +37,7 @@ WARRANTY DISCLAIMER 5. BECAUSE THIS MANUAL OR PIECE OF DOCUMENTATION IS LICENSED FREE OF CHARGE, - THERE IS NO WARRANTY FOR IT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + THERE IS NO WARRANTY FOR IT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THIS MANUAL OR PIECE OF DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT diff --git a/docs/publicity/WoWoW30.html b/docs/publicity/WoWoW30.html index 60288dc16a..e547cafeec 100644 --- a/docs/publicity/WoWoW30.html +++ b/docs/publicity/WoWoW30.html @@ -170,7 +170,7 @@ class, container classes, as well as classes for threading, networking, XML parsing, path and configuration management, logging, debugging etc. These functions and classes have been separated into their own library both for being able to write non-GUI apps as well -as to make maintainance easier through reduced interdependence. +as to make maintainance easier through reduced interdependence.

    Many of the changes to wxString and the container classes are located in wxBase, but on top of that support to wxBase @@ -186,7 +186,7 @@ change. Rather, this paragraph summarizes the most relevant changes to the GUI classes of wxWidgets. Given wxWidgets' nature as a GUI library, these changes are also most likely to be visible to the user and may thus be the most important changes from a user's perspective -(although not necessarily from a developer's perspective): +(although not necessarily from a developer's perspective):

    • wxDataViewCtrl and wxDataViewTreeCtrl: this @@ -310,7 +310,7 @@ cases, supporting an old version of GTK+ hinders development so we decided to declare GTK+ 2.6 the minimum toolkit version that is supported. As an example, this made it possible to always use the GTK+ file dialog instead of the old generic file dialog which had to -be used when GTK+ didn't have a usable file dialog. +be used when GTK+ didn't have a usable file dialog.

      Other parts of wxGTK that were rewritten or which underwent a major update include, but are not diff --git a/docs/publicity/slogans.txt b/docs/publicity/slogans.txt index 19c7263c24..a7eef61e6a 100644 --- a/docs/publicity/slogans.txt +++ b/docs/publicity/slogans.txt @@ -73,7 +73,7 @@ maybe stripped down to "Specialization is for insects." ============================ -The Open-Source, Cross-Platform GUI Framework +The Open-Source, Cross-Platform GUI Framework with Ten Years of Evolution Behind It I saw this changed to 'native UI' on the website, which is slightly more @@ -81,17 +81,17 @@ accurate but sounds less 'catchy' imho. .. and templates. -Hmm. I might buy a mug that had, say, a wxLogo and "wxWidgets" (and -maybe the website URL underneath in smaller type) on one side and +Hmm. I might buy a mug that had, say, a wxLogo and "wxWidgets" (and +maybe the website URL underneath in smaller type) on one side and "Specialization is for insects ... and templates" on the other. -.. only if it held at leat a full half (imperial) pint, mind. Not +.. only if it held at leat a full half (imperial) pint, mind. Not one of those wussy 8.5 fl.oz. jobbies. -That'd be a nice ice-breaker when working at a new client's site - +That'd be a nice ice-breaker when working at a new client's site - people would be bound to stop and ask what it was all about! -.. and how about a nice silk tie (US: necktie) with the logo on ... +.. and how about a nice silk tie (US: necktie) with the logo on ... Oh, I forgot, we programmers don't wear ties. ============================ @@ -149,7 +149,7 @@ One API to bridge them all and in the compiler bind them. wxWidgets -How about "and in the linker bind them"? That's where the local libraries +How about "and in the linker bind them"? That's where the local libraries get bound to the wxWidgets code anyway. ============================ @@ -162,7 +162,7 @@ Hugh Gibson wrote: > window control in different operating systems to emphasise the > native look and feel. -Nice idea. But I wonder where you'll find some volunteer willing to +Nice idea. But I wonder where you'll find some volunteer willing to have his face tattooed with win32 common controls ;-) ============================ diff --git a/docs/vms/readme.txt b/docs/vms/readme.txt index 8aeb8c9d0b..e403857dc7 100644 --- a/docs/vms/readme.txt +++ b/docs/vms/readme.txt @@ -7,7 +7,7 @@ The compilation was tested with -Compaq C++ 6.2 -DECWindows 1.2-5 -GTK1.2.8 (for wxGTK) - + To get everything compiled you'll need to have installed prior to compiling wxWidgets: -Bison @@ -19,7 +19,7 @@ wxWidgets: #define alloca malloc before #endif /* __hpux */ - + -Flex get it from http://www.openvms.digital.com/freeware/ @@ -119,7 +119,7 @@ $ ass $disk2:[joukj.public.gtk.gtk.glib],- -I think in general wxGTK is better maintained, so that version is my first choice. - + -Note that only a few people have used wxWidgets on VMS so many problems are to be expected. @@ -147,7 +147,7 @@ $ ass $disk2:[joukj.public.gtk.gtk.glib],- again. -image sample: after clicking "about" the colourmap is permanently changed resulting in strange images - + Finally : I like the idea of Robert Roebling that CD's with classical music should be send to the authors. @@ -156,7 +156,7 @@ send to the authors. >-----------------------------------------------------------------------------< Jouk Jansen - + joukj@hrem.stm.tudelft.nl diff --git a/docs/wine/COPYING.LIB b/docs/wine/COPYING.LIB index eb685a5ec9..bbe3fe1987 100644 --- a/docs/wine/COPYING.LIB +++ b/docs/wine/COPYING.LIB @@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/docs/wine/changes.txt b/docs/wine/changes.txt index c9d3429da5..1be099a744 100644 --- a/docs/wine/changes.txt +++ b/docs/wine/changes.txt @@ -9,4 +9,4 @@ for wxWINE is in place and that all that has to be done to get wxWINE running is to make WINE work as Win32. No joke intended. Robert Roebling - + diff --git a/docs/wine/install.txt b/docs/wine/install.txt index 9a5cd5da1a..e6e3d3311b 100644 --- a/docs/wine/install.txt +++ b/docs/wine/install.txt @@ -2,7 +2,7 @@ * The most simple case ----------------------- -If you compile wxWidgets on Linux for the first time and don't like to read +If you compile wxWidgets on Linux for the first time and don't like to read install instructions just do (in the base dir): > ./configure --with-wine @@ -12,8 +12,8 @@ install instructions just do (in the base dir): > ldconfig > exit -On all variants of Unix except Linux (and maybe except *BSD), shared libraries -are not supported out of the box due to the utter stupidity of libtool, so you'll +On all variants of Unix except Linux (and maybe except *BSD), shared libraries +are not supported out of the box due to the utter stupidity of libtool, so you'll have to do this to get shared library support: > ./configure --with-wine --disable-unicode --disable-static --enable-shared @@ -23,12 +23,12 @@ important entries with respect to shared library creation, which are archive_cmds="\$LD -shared .... archive_expsym_cmds="\$LD -shared .... - + which should be something like archive_cmds="\$CC -shared .... archive_expsym_cmds="\$CC -shared .... - + Afterwards you can continue with > make @@ -47,14 +47,14 @@ If you want to remove wxWidgets on Unix you can do this: * The expert case ----------------- -If you want to do some more serious cross-platform programming with wxWidgets, -such as for GTK and Motif, you can now build two complete libraries and use -them concurrently. For this end, you have to create a directory for each build +If you want to do some more serious cross-platform programming with wxWidgets, +such as for GTK and Motif, you can now build two complete libraries and use +them concurrently. For this end, you have to create a directory for each build of wxWidgets - you may also want to create different versions of wxWidgets -and test them concurrently. Most typically, this would be a version configured -with --enable-debug_flag and one without. Note, that only one build can currently +and test them concurrently. Most typically, this would be a version configured +with --enable-debug_flag and one without. Note, that only one build can currently be installed, so you'd have to use local version of the library for that purpose. -For building three versions (one GTK, one WINE and a debug version of the WINE +For building three versions (one GTK, one WINE and a debug version of the WINE source) you'd do this: md buildmotif @@ -78,18 +78,18 @@ cd .. * The most simple errors ------------------------ -wxWINE doesn't work yet as WINE isn't really up to the task yet. +wxWINE doesn't work yet as WINE isn't really up to the task yet. -You get errors during compilation: The reason is that you probably have a broken -compiler, which includes almost everything that is called gcc. If you use gcc 2.8 -you have to disable optimisation as the compiler will give up with an internal +You get errors during compilation: The reason is that you probably have a broken +compiler, which includes almost everything that is called gcc. If you use gcc 2.8 +you have to disable optimisation as the compiler will give up with an internal compiler error. If there is just any way for you to use egcs, use egcs. We cannot fix gcc. -You get immediate segfault when starting any sample or application: This is either -due to having compiled the library with different flags or options than your program - -typically you might have the __WXDEBUG__ option set for the library but not for your +You get immediate segfault when starting any sample or application: This is either +due to having compiled the library with different flags or options than your program - +typically you might have the __WXDEBUG__ option set for the library but not for your program - or due to using a broken compiler (and its optimisation) such as GCC 2.8. * The most simple program @@ -102,27 +102,27 @@ g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo * General ----------------------- -The Unix variants of wxWidgets use GNU configure. If you have problems with your +The Unix variants of wxWidgets use GNU configure. If you have problems with your make use GNU make instead. -If you have general problems with installation, read my homepage at +If you have general problems with installation, read my homepage at http://wesley.informatik.uni-freiburg.de/~wxxt - -for newest information. If you still don't have any success, please send a bug -report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF -YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF WINE, WXWINE, WHAT DISTRIBUTION + +for newest information. If you still don't have any success, please send a bug +report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF +YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF WINE, WXWINE, WHAT DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried... * GUI libraries ----------------------- -wxWidgets/WINE requires the WINE library to be installed on your system. +wxWidgets/WINE requires the WINE library to be installed on your system. You can get the newest version of the WINE from the WINE homepage at: http://www.winehq.com - + * Create your configuration ----------------------------- @@ -141,16 +141,16 @@ to see all the options please use: ./configure --help The basic philosophy is that if you want to use different -configurations, like a debug and a release version, +configurations, like a debug and a release version, or use the same source tree on different systems, you have only to change the environment variable OSTYPE. (Sadly this variable is not set by default on some systems -in some shells - on SGI's for example). So you will have to -set it there. This variable HAS to be set before starting -configure, so that it knows which system it tries to +in some shells - on SGI's for example). So you will have to +set it there. This variable HAS to be set before starting +configure, so that it knows which system it tries to configure for. -Configure will complain if the system variable OSTYPE has +Configure will complain if the system variable OSTYPE has not been defined. And Make in some circumstances as well... @@ -167,7 +167,7 @@ in wxWidgets snapshot 6, but not yet all (ODBC not). You must do this by running configure with either of: --with-wine Use the WINE library - + The following options handle the kind of library you want to build. --enable-threads Compile with thread support. Threads @@ -182,25 +182,25 @@ The following options handle the kind of library you want to build. such as Sun with gcc 2.8.X which would otherwise produce segvs. - --enable-profile Add profiling info to the object + --enable-profile Add profiling info to the object files. Currently broken, I think. - + --enable-no_rtti Enable compilation without creation of - C++ RTTI information in object files. - This will speed-up compilation and reduce + C++ RTTI information in object files. + This will speed-up compilation and reduce binary size. - + --enable-no_exceptions Enable compilation without creation of - C++ exception information in object files. - This will speed-up compilation and reduce + C++ exception information in object files. + This will speed-up compilation and reduce binary size. Also fewer crashes during the actual compilation... - - --enable-mem_tracing Add built-in memory tracing. - + + --enable-mem_tracing Add built-in memory tracing. + --enable-dmalloc Use the dmalloc memory debugger. Read more at www.letters.com/dmalloc/ - + --enable-debug_info Add debug info to object files and executables for use with debuggers such as gdb (or its many frontends). @@ -210,7 +210,7 @@ The following options handle the kind of library you want to build. useful internal debugging tricks (such as automatically reporting illegal calls) to work. Note that program and library - must be compiled with the same debug + must be compiled with the same debug options. * Feature Options @@ -221,42 +221,42 @@ in wxWidgets snapshot 6, but not yet all (ODBC not). When producing an executable that is linked statically with wxGTK you'll be surprised at its immense size. This can sometimes be -drastically reduced by removing features from wxWidgets that +drastically reduced by removing features from wxWidgets that are not used in your program. The most relevant such features are --without-libpng Disables PNG image format code. - + --without-libjpeg Disables JPEG image format code. - + { --without-odbc Disables ODBC code. Not yet. } - + --disable-resources Disables the use of *.wxr type resources. - + --disable-threads Disables threads. Will also disable sockets. --disable-sockets Disables sockets. --disable-dnd Disables Drag'n'Drop. - + --disable-clipboard Disables Clipboard. - + --disable-serial Disables object instance serialisation. - + --disable-streams Disables the wxStream classes. - + --disable-file Disables the wxFile class. - + --disable-textfile Disables the wxTextFile class. - + --disable-intl Disables the internationalisation. - + --disable-validators Disables validators. - + --disable-accel Disables accel. - + Apart from disabling certain features you can very often "strip" the program of its debugging information resulting in a significant reduction in size. @@ -267,13 +267,13 @@ reduction in size. The following must be done in the base directory (e.g. ~/wxGTK or ~/wxWin or whatever) -Now the makefiles are created (by configure) and you can compile +Now the makefiles are created (by configure) and you can compile the library by typing: make make yourself some coffee, as it will take some time. On an old -386SX possibly two weeks. During compilation, you'll get a few +386SX possibly two weeks. During compilation, you'll get a few warning messages depending in your compiler. If you want to be more selective, you can change into a specific @@ -284,12 +284,12 @@ Then you may install the library and its header files under have to log in as root (i.e. run "su" and enter the root password) and type - make install + make install You can remove any traces of wxWidgets by typing make uninstall - + If you want to save disk space by removing unnecessary object-files: @@ -316,13 +316,13 @@ minimal: minimal.o minimal.o: minimal.cpp $(CXX) `wx-config --cflags` -c minimal.cpp -o minimal.o -clean: +clean: rm -f *.o minimal This is certain to become the standard way unless we decide to stick to tmake. -2) The other way creates a project within the source code +2) The other way creates a project within the source code directories of wxWidgets. For this endeavour, you'll need the usual number of GNU tools, at least @@ -331,7 +331,7 @@ GNU autoheader version 2.14 GNU autoconf version 2.14 GNU libtool version 1.3 -and quite possibly +and quite possibly GNU make GNU C++ @@ -344,10 +344,10 @@ go ahead yourself :-) In the hope that it will be useful, Robert Roebling - + Addition notes by Julian Smart, August 2002 -=========================================== +=========================================== I've fixed some compile errors, and got as far as compiling wxWINE, but actually linking a sample will take diff --git a/docs/wine/readme.txt b/docs/wine/readme.txt index 7d3d8a867d..00a719a36f 100644 --- a/docs/wine/readme.txt +++ b/docs/wine/readme.txt @@ -9,15 +9,15 @@ install.txt. When you run into problems, please read the install.txt and follow those instructions. If you still don't have any success, please send a bug report to one of our mailing lists (see -my homepage) INCLUDING A DESCRIPTION OF YOUR SYSTEM AND +my homepage) INCLUDING A DESCRIPTION OF YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF THE WINE SOURCES, WHAT DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. -Please send problems concerning installation, feature requests, -bug reports or comments to the wxWidgets users list. Information +Please send problems concerning installation, feature requests, +bug reports or comments to the wxWidgets users list. Information on how to subscribe is available from my homepage. -wxWidgets/Wine doesn't come with any guarantee whatsoever. It might +wxWidgets/Wine doesn't come with any guarantee whatsoever. It might crash your harddisk or destroy your monitor. It doesn't claim to be suitable for any special or general purpose. diff --git a/docs/xserver.txt b/docs/xserver.txt index c29ee4fbde..3758388f12 100644 --- a/docs/xserver.txt +++ b/docs/xserver.txt @@ -26,13 +26,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/include/msvc/wx/setup.h b/include/msvc/wx/setup.h index 122b67a3c0..e0b9ed4d6f 100644 --- a/include/msvc/wx/setup.h +++ b/include/msvc/wx/setup.h @@ -160,7 +160,7 @@ #pragma comment(lib, wxBASE_LIB_NAME("net")) #endif #if wxUSE_XML && !defined(wxNO_XML_LIB) - #pragma comment(lib, wxBASE_LIB_NAME("xml")) + #pragma comment(lib, wxBASE_LIB_NAME("xml")) #endif #endif // defined(wxMONOLITHIC) && wxMONOLITHIC == 1 @@ -204,7 +204,7 @@ #if wxUSE_HTML && !defined(wxNO_HTML_LIB) #pragma comment(lib, wxTOOLKIT_LIB_NAME("html")) - #endif + #endif #if wxUSE_DEBUGREPORT && !defined(wxNO_QA_LIB) #pragma comment(lib, wxTOOLKIT_LIB_NAME("qa")) #endif @@ -227,7 +227,7 @@ #pragma comment(lib, wxTOOLKIT_LIB_NAME("media")) #endif #if wxUSE_STC && !defined(wxNO_STC_LIB) - #pragma comment(lib, wxTOOLKIT_LIB_NAME("stc")) + #pragma comment(lib, wxTOOLKIT_LIB_NAME("stc")) #endif #if wxUSE_WEBVIEW && !defined(wxNO_WEBVIEW_LIB) #pragma comment(lib, wxTOOLKIT_LIB_NAME("webview")) diff --git a/include/wx/accel.h b/include/wx/accel.h index 604039561f..98fc2460f7 100644 --- a/include/wx/accel.h +++ b/include/wx/accel.h @@ -33,7 +33,7 @@ enum wxAcceleratorEntryFlags wxACCEL_CTRL = 0x0002, // hold Ctrl key down wxACCEL_SHIFT = 0x0004, // hold Shift key down #if defined(__WXMAC__) - wxACCEL_RAW_CTRL= 0x0008, // + wxACCEL_RAW_CTRL= 0x0008, // #else wxACCEL_RAW_CTRL= wxACCEL_CTRL, #endif diff --git a/include/wx/app.h b/include/wx/app.h index d16f209732..33810ef719 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -104,7 +104,7 @@ public: // Called before the first events are handled, called from within MainLoop() virtual void OnLaunched(); - + // This is called by wxEventLoopBase::SetActive(): you should put the code // which needs an active event loop here. // Note that this function is called whenever an event loop is activated; diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index f7fdd1559c..578b381874 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -350,7 +350,7 @@ public: virtual int ChangeSelection(size_t n) wxOVERRIDE; - virtual bool AddPage(wxWindow *page, const wxString &text, bool select, + virtual bool AddPage(wxWindow *page, const wxString &text, bool select, int imageId) wxOVERRIDE; virtual bool DeleteAllPages() wxOVERRIDE; virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text, diff --git a/include/wx/colour.h b/include/wx/colour.h index 7565f09162..e9a13ef95e 100644 --- a/include/wx/colour.h +++ b/include/wx/colour.h @@ -118,7 +118,7 @@ public: virtual ChannelType Blue() const = 0; virtual ChannelType Alpha() const { return wxALPHA_OPAQUE ; } - + virtual bool IsSolid() const { return true; } diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index 348ad20286..1785016500 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -345,11 +345,11 @@ public: virtual size_t GetLength() const { return m_html.Len() + 1; } virtual wxString GetHTML() const { return m_html; } virtual void SetHTML(const wxString& html) { m_html = html; } - + virtual size_t GetDataSize() const wxOVERRIDE; virtual bool GetDataHere(void *buf) const wxOVERRIDE; virtual bool SetData(size_t len, const void *buf) wxOVERRIDE; - + // Must provide overloads to avoid hiding them (and warnings about it) virtual size_t GetDataSize(const wxDataFormat&) const wxOVERRIDE { diff --git a/include/wx/dc.h b/include/wx/dc.h index 8d445e9f6b..dd5eb2251d 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -283,7 +283,7 @@ public: } virtual void* GetHandle() const { return NULL; } - + // query dimension, colour deps, resolution virtual void DoGetSize(int *width, int *height) const = 0; @@ -528,7 +528,7 @@ public: // this needs to overidden if the axis is inverted virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); - + virtual double GetContentScaleFactor() const { return m_contentScaleFactor; } #ifdef __WXMSW__ @@ -722,7 +722,7 @@ protected: double m_scaleX, m_scaleY; // calculated from logical scale and user scale int m_signX, m_signY; // Used by SetAxisOrientation() to invert the axes - + double m_contentScaleFactor; // used by high resolution displays (retina) // Pixel per mm in horizontal and vertical directions. diff --git a/include/wx/dcbuffer.h b/include/wx/dcbuffer.h index fb912f6e24..4a29fda820 100644 --- a/include/wx/dcbuffer.h +++ b/include/wx/dcbuffer.h @@ -134,7 +134,7 @@ private: int m_style; wxSize m_area; - + wxDECLARE_DYNAMIC_CLASS(wxBufferedDC); wxDECLARE_NO_COPY_CLASS(wxBufferedDC); }; diff --git a/include/wx/dcgraph.h b/include/wx/dcgraph.h index b75d715c7b..c2482d78c3 100644 --- a/include/wx/dcgraph.h +++ b/include/wx/dcgraph.h @@ -32,7 +32,7 @@ public: wxGCDC( const wxEnhMetaFileDC& dc ); #endif wxGCDC(wxGraphicsContext* context); - + wxGCDC(); virtual ~wxGCDC(); diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h index aee4cf4fd5..35bd9508a6 100644 --- a/include/wx/fontutil.h +++ b/include/wx/fontutil.h @@ -129,7 +129,7 @@ public: #elif defined(__WXOSX__) public: wxNativeFontInfo(const wxNativeFontInfo& info) { Init(info); } - + ~wxNativeFontInfo() { Free(); } wxNativeFontInfo& operator=(const wxNativeFontInfo& info) @@ -147,7 +147,7 @@ public: void Init(const wxNativeFontInfo& info); void Free(); - + wxString GetFamilyName() const; wxString GetStyleName() const; @@ -157,8 +157,8 @@ public: static CGFloat GetCTWeight( CTFontRef font ); static CGFloat GetCTWeight( CTFontDescriptorRef font ); static CGFloat GetCTSlant( CTFontDescriptorRef font ); - - + + CTFontDescriptorRef GetCTFontDescriptor() const; private: // attributes for regenerating a CTFontDescriptor, stay close to native values @@ -167,7 +167,7 @@ private: wxFontStyle m_style; CGFloat m_ctSize; wxFontFamily m_family; - + wxString m_styleName; wxString m_familyName; diff --git a/include/wx/generic/headerctrlg.h b/include/wx/generic/headerctrlg.h index b145f1cbe2..f2ca427b8d 100644 --- a/include/wx/generic/headerctrlg.h +++ b/include/wx/generic/headerctrlg.h @@ -50,7 +50,7 @@ public: protected: virtual wxSize DoGetBestSize() const wxOVERRIDE; - + private: // implement base class pure virtuals virtual void DoSetCount(unsigned int count) wxOVERRIDE; diff --git a/include/wx/graphics.h b/include/wx/graphics.h index a35667491f..51c3e22150 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -35,7 +35,7 @@ enum wxInterpolationQuality // default interpolation wxINTERPOLATION_DEFAULT, // no interpolation - wxINTERPOLATION_NONE, + wxINTERPOLATION_NONE, // fast interpolation, suited for interactivity wxINTERPOLATION_FAST, // better quality @@ -206,7 +206,7 @@ public: #if wxUSE_IMAGE wxImage ConvertToImage() const; #endif // wxUSE_IMAGE - + void* GetNativeBitmap() const; const wxGraphicsBitmapData* GetBitmapData() const @@ -601,10 +601,10 @@ public: // returns the current interpolation quality virtual wxInterpolationQuality GetInterpolationQuality() const { return m_interpolation; } - + // sets the interpolation quality, returns true if it supported virtual bool SetInterpolationQuality(wxInterpolationQuality interpolation) = 0; - + // returns the current compositing operator virtual wxCompositionMode GetCompositionMode() const { return m_composition; } @@ -754,14 +754,14 @@ public: // helper to determine if a 0.5 offset should be applied for the drawing operation virtual bool ShouldOffset() const { return false; } - - // indicates whether the context should try to offset for pixel boundaries, this only makes sense on + + // indicates whether the context should try to offset for pixel boundaries, this only makes sense on // bitmap devices like screen, by default this is turned off virtual void EnableOffset(bool enable = true); - + void DisableOffset() { EnableOffset(false); } bool OffsetEnabled() { return m_enableOffset; } - + protected: // These fields must be initialized in the derived class ctors. wxDouble m_width, diff --git a/include/wx/gtk/dc.h b/include/wx/gtk/dc.h index 88e46392f6..d88a1487b0 100644 --- a/include/wx/gtk/dc.h +++ b/include/wx/gtk/dc.h @@ -136,7 +136,7 @@ public: virtual GdkWindow* GetGDKWindow() const { return NULL; } virtual void* GetHandle() const wxOVERRIDE { return GetGDKWindow(); } - + // base class pure virtuals implemented here virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE; virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE; diff --git a/include/wx/gtk/dcmemory.h b/include/wx/gtk/dcmemory.h index 3f7e7c057a..8371d721e3 100644 --- a/include/wx/gtk/dcmemory.h +++ b/include/wx/gtk/dcmemory.h @@ -39,7 +39,7 @@ public: virtual void DoGetSize( int *width, int *height ) const wxOVERRIDE; virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const wxOVERRIDE; virtual void* GetHandle() const wxOVERRIDE; - + // overridden for wxMemoryDC Impl virtual void DoSelect(const wxBitmap& bitmap) wxOVERRIDE; diff --git a/include/wx/gtk/print.h b/include/wx/gtk/print.h index 5c54286eb3..9458ce7643 100644 --- a/include/wx/gtk/print.h +++ b/include/wx/gtk/print.h @@ -226,7 +226,7 @@ public: virtual void* GetCairoContext() const wxOVERRIDE; virtual void* GetHandle() const wxOVERRIDE; - + bool CanDrawBitmap() const wxOVERRIDE { return true; } void Clear() wxOVERRIDE; void SetFont( const wxFont& font ) wxOVERRIDE; diff --git a/include/wx/html/helpctrl.h b/include/wx/html/helpctrl.h index 54c27afbe0..cad8d6458e 100644 --- a/include/wx/html/helpctrl.h +++ b/include/wx/html/helpctrl.h @@ -46,7 +46,7 @@ class WXDLLIMPEXP_HTML wxHtmlHelpController : public wxHelpControllerBase // wxE public: wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE, wxWindow* parentWindow = NULL); wxHtmlHelpController(wxWindow* parentWindow, int style = wxHF_DEFAULT_STYLE); - + virtual ~wxHtmlHelpController(); void SetShouldPreventAppExit(bool enable); @@ -117,7 +117,7 @@ public: protected: void Init(int style); - + virtual wxWindow* CreateHelpWindow(); virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data); virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData *data); diff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h index 30179440f4..f8558a3141 100644 --- a/include/wx/html/webkit.h +++ b/include/wx/html/webkit.h @@ -107,11 +107,11 @@ private: wxString m_pageTitle; OSXWebViewPtr m_webView; - + WX_NSObject m_frameLoadMonitor; WX_NSObject m_policyDelegate; WX_NSObject m_UIDelegate; - + // we may use this later to setup our own mouse events, // so leave it in for now. void* m_webKitCtrlEventHandler; diff --git a/include/wx/kbdstate.h b/include/wx/kbdstate.h index ab0df32d1c..8945c6b2ba 100644 --- a/include/wx/kbdstate.h +++ b/include/wx/kbdstate.h @@ -65,10 +65,10 @@ public: // accessors for individual modifier keys bool ControlDown() const { return m_controlDown; } - bool RawControlDown() const - { + bool RawControlDown() const + { #ifdef __WXOSX__ - return m_rawControlDown; + return m_rawControlDown; #else return m_controlDown; #endif @@ -91,12 +91,12 @@ public: // --------------------------------------------------- void SetControlDown(bool down) { m_controlDown = down; } - void SetRawControlDown(bool down) - { + void SetRawControlDown(bool down) + { #ifdef __WXOSX__ - m_rawControlDown = down; + m_rawControlDown = down; #else - m_controlDown = down; + m_controlDown = down; #endif } void SetShiftDown(bool down) { m_shiftDown = down; } diff --git a/include/wx/menu.h b/include/wx/menu.h index b733467604..eb262bc2da 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -406,7 +406,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxMenuBase); }; -#if wxUSE_EXTENDED_RTTI +#if wxUSE_EXTENDED_RTTI // ---------------------------------------------------------------------------- // XTI accessor @@ -417,17 +417,17 @@ class WXDLLEXPORT wxMenuInfoHelper : public wxObject public: wxMenuInfoHelper() { m_menu = NULL; } virtual ~wxMenuInfoHelper() { } - + bool Create( wxMenu *menu, const wxString &title ) - { - m_menu = menu; - m_title = title; + { + m_menu = menu; + m_title = title; return true; } - + wxMenu* GetMenu() const { return m_menu; } wxString GetTitle() const { return m_title; } - + private: wxMenu *m_menu; wxString m_title; @@ -555,13 +555,13 @@ public: virtual bool CanBeOutsideClientArea() const wxOVERRIDE { return true; } -#if wxUSE_EXTENDED_RTTI +#if wxUSE_EXTENDED_RTTI // XTI helpers: bool AppendMenuInfo( const wxMenuInfoHelper *info ) { return Append( info->GetMenu(), info->GetTitle() ); } const wxMenuInfoHelperList& GetMenuInfos() const; #endif - + #if WXWIN_COMPATIBILITY_2_8 // get or change the label of the menu at given position // Deprecated in favour of SetMenuLabel @@ -574,11 +574,11 @@ protected: // the list of all our menus wxMenuList m_menus; -#if wxUSE_EXTENDED_RTTI +#if wxUSE_EXTENDED_RTTI // used by XTI wxMenuInfoHelperList m_menuInfos; #endif - + // the frame we are attached to (may be NULL) wxFrame *m_menuBarFrame; diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index 83bd3b9e40..e541499f9a 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -125,7 +125,7 @@ public: } void* GetHandle() const wxOVERRIDE { return (void*)GetHDC(); } - + const wxBitmap& GetSelectedBitmap() const wxOVERRIDE { return m_selectedBitmap; } wxBitmap& GetSelectedBitmap() wxOVERRIDE { return m_selectedBitmap; } diff --git a/include/wx/msw/headerctrl.h b/include/wx/msw/headerctrl.h index c261ee1ac7..aaaecd942f 100644 --- a/include/wx/msw/headerctrl.h +++ b/include/wx/msw/headerctrl.h @@ -58,7 +58,7 @@ protected: virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) wxOVERRIDE; - + private: // implement base class pure virtuals virtual void DoSetCount(unsigned int count) wxOVERRIDE; diff --git a/include/wx/msw/missing.h b/include/wx/msw/missing.h index 1443a1069e..ec6b93efc8 100644 --- a/include/wx/msw/missing.h +++ b/include/wx/msw/missing.h @@ -262,7 +262,7 @@ #define TVM_GETEXTENDEDSTYLE (TV_FIRST + 45) #endif -// Various defines used by the webview library that are needed by mingw +// Various defines used by the webview library that are needed by mingw #ifndef DISPID_COMMANDSTATECHANGE #define DISPID_COMMANDSTATECHANGE 105 diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h index a16b112f1f..08632e4477 100644 --- a/include/wx/osx/app.h +++ b/include/wx/osx/app.h @@ -82,7 +82,7 @@ public: // TODO change semantics to be in line with cocoa (make autrelease NOT increase the count) void MacAddToAutorelease( void* cfrefobj ); void MacReleaseAutoreleasePool(); - + public: static wxWindow* s_captureWindow ; static long s_lastModifiers ; @@ -95,7 +95,7 @@ protected: // override for support of custom app controllers virtual WX_NSObject OSXCreateAppController(); #endif - + private: virtual bool DoInitGui(); virtual void DoCleanUp(); @@ -155,14 +155,14 @@ private: wxArrayString m_openFiles; wxArrayString m_printFiles; wxString m_getURL; - + public: bool OSXInitWasCalled() { return m_inited; } void OSXStoreOpenFiles(const wxArrayString &files ) { m_openFiles = files ; } void OSXStorePrintFiles(const wxArrayString &files ) { m_printFiles = files ; } void OSXStoreOpenURL(const wxString &url ) { m_getURL = url ; } #endif - + // Hide the application windows the same as the system hide command would do it. void MacHideApp(); diff --git a/include/wx/osx/bitmap.h b/include/wx/osx/bitmap.h index 65255198e9..04d0c867d1 100644 --- a/include/wx/osx/bitmap.h +++ b/include/wx/osx/bitmap.h @@ -107,7 +107,7 @@ public: // Constructor for generalised creation from data wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1); - + // creates an bitmap from the native image format wxBitmap(CGImageRef image, double scale = 1.0); wxBitmap(WXImage image); @@ -115,7 +115,7 @@ public: // Create a bitmap compatible with the given DC wxBitmap(int width, int height, const wxDC& dc); - + // If depth is omitted, will create a bitmap compatible with the display wxBitmap(int width, int height, int depth = -1) { (void)Create(width, height, depth); } wxBitmap(const wxSize& sz, int depth = -1) { (void)Create(sz, depth); } @@ -141,13 +141,13 @@ public: bool Create( CGImageRef image, double scale = 1.0 ); bool Create( WXImage image ); bool Create( CGContextRef bitmapcontext); - + // Create a bitmap compatible with the given DC, inheriting its magnification factor bool Create(int width, int height, const wxDC& dc); // Create a bitmap with a scale factor, width and height are multiplied with that factor bool CreateScaled(int logwidth, int logheight, int depth, double logicalScale); - + // virtual bool Create( WXHICON icon) ; virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; diff --git a/include/wx/osx/cocoa/chkconf.h b/include/wx/osx/cocoa/chkconf.h index 5cc104b02d..f2b5f528a6 100644 --- a/include/wx/osx/cocoa/chkconf.h +++ b/include/wx/osx/cocoa/chkconf.h @@ -22,7 +22,7 @@ /* * leave is isFlipped and don't override */ -#ifndef wxOSX_USE_NATIVE_FLIPPED +#ifndef wxOSX_USE_NATIVE_FLIPPED #define wxOSX_USE_NATIVE_FLIPPED 1 #endif diff --git a/include/wx/osx/cocoa/dataview.h b/include/wx/osx/cocoa/dataview.h index 58d9495f6e..b4203ca6ee 100644 --- a/include/wx/osx/cocoa/dataview.h +++ b/include/wx/osx/cocoa/dataview.h @@ -532,7 +532,7 @@ public: virtual void SetRowHeight(int height); virtual void SetRowHeight(const wxDataViewItem& item, unsigned int height); virtual void OnSize(); - + virtual void StartEditor( const wxDataViewItem & item, unsigned int column ); // drag & drop helper methods diff --git a/include/wx/osx/cocoa/evtloop.h b/include/wx/osx/cocoa/evtloop.h index ab15dd94af..12fd66a33a 100644 --- a/include/wx/osx/cocoa/evtloop.h +++ b/include/wx/osx/cocoa/evtloop.h @@ -15,16 +15,16 @@ class WXDLLIMPEXP_BASE wxGUIEventLoop : public wxCFEventLoop public: wxGUIEventLoop(); ~wxGUIEventLoop(); - + void BeginModalSession( wxWindow* modalWindow ); - + void EndModalSession(); virtual void WakeUp(); void OSXUseLowLevelWakeup(bool useIt) { m_osxLowLevelWakeUp = useIt ; } - + protected: virtual int DoDispatchTimeout(unsigned long timeout); @@ -32,15 +32,15 @@ protected: virtual void OSXDoStop(); virtual CFRunLoopRef CFGetCurrentRunLoop() const; - + void* m_modalSession; - + wxWindow* m_modalWindow; - + WXWindow m_dummyWindow; - + int m_modalNestedLevel; - + bool m_osxLowLevelWakeUp; }; diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index a28dd242d6..cc990135cc 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -163,7 +163,7 @@ public : #endif virtual double GetContentScaleFactor() const; - + // cocoa thunk connected calls #if wxUSE_DRAG_AND_DROP @@ -281,20 +281,20 @@ public : virtual void SetRepresentedFilename(const wxString& filename) wxOVERRIDE; wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; } - + CGWindowLevel GetWindowLevel() const wxOVERRIDE { return m_macWindowLevel; } void RestoreWindowLevel() wxOVERRIDE; - + static WX_NSResponder GetNextFirstResponder() ; static WX_NSResponder GetFormerFirstResponder() ; protected : CGWindowLevel m_macWindowLevel; WXWindow m_macWindow; void * m_macFullScreenData ; - + private: void SetUpForModalParent(); - + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl); }; @@ -308,7 +308,7 @@ public: #if wxUSE_MARKUP virtual void SetLabelMarkup(const wxString& markup); #endif // wxUSE_MARKUP - + void SetPressedBitmap( const wxBitmap& bitmap ); void GetLayoutInset(int &left , int &top , int &right, int &bottom) const; void SetAcceleratorFromLabel(const wxString& label); diff --git a/include/wx/osx/cocoa/private/textimpl.h b/include/wx/osx/cocoa/private/textimpl.h index fa42e78341..fc44aeb15d 100644 --- a/include/wx/osx/cocoa/private/textimpl.h +++ b/include/wx/osx/cocoa/private/textimpl.h @@ -97,7 +97,7 @@ public: virtual ~wxNSTextViewControl(); virtual void insertText(NSString* text, WXWidget slf, void *_cmd) wxOVERRIDE; - + virtual wxString GetStringValue() const wxOVERRIDE ; virtual void SetStringValue( const wxString &str) wxOVERRIDE ; virtual void Copy() wxOVERRIDE ; diff --git a/include/wx/osx/core/cfdictionary.h b/include/wx/osx/core/cfdictionary.h index d27c0f5891..d3028e90c7 100644 --- a/include/wx/osx/core/cfdictionary.h +++ b/include/wx/osx/core/cfdictionary.h @@ -119,7 +119,7 @@ public: { SetValue(key, wxCFNumberRef(v)); } - + CFMutableDictionaryRef CreateCopy() const { return CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, this->m_ptr); diff --git a/include/wx/osx/core/cfref.h b/include/wx/osx/core/cfref.h index b441693779..be349c08e7 100644 --- a/include/wx/osx/core/cfref.h +++ b/include/wx/osx/core/cfref.h @@ -176,7 +176,7 @@ public: */ wxCFRef(refType p) : m_ptr(p) { - + } /*! @method wxCFRef @abstract Assumes ownership of p and creates a reference to it. @@ -190,7 +190,7 @@ public: This method is templated and takes an otherType *p. This prevents implicit conversion using an operator refType() in a different ref-holding class type. */ - + template explicit wxCFRef(otherType *p) : m_ptr(p) // Implicit conversion from otherType* to refType should occur. diff --git a/include/wx/osx/core/colour.h b/include/wx/osx/core/colour.h index d3b6ec4eb6..cb0ce23367 100644 --- a/include/wx/osx/core/colour.h +++ b/include/wx/osx/core/colour.h @@ -47,10 +47,10 @@ public: // This ctor does take ownership of the color. wxColour( CGColorRef col ); - + // don't take ownership of the returned value CGColorRef GetCGColor() const; - + // do take ownership of the returned value CGColorRef CreateCGColor() const { return wxCFRetain(GetCGColor()); } @@ -69,7 +69,7 @@ public: explicit wxColour(WX_NSColor color); WX_NSColor OSXGetNSColor() const; #endif - + protected : virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) wxOVERRIDE; @@ -87,19 +87,19 @@ class wxColourRefData : public wxGDIRefData public: wxColourRefData() {} virtual ~wxColourRefData() {} - + virtual CGFloat Red() const = 0; virtual CGFloat Green() const = 0; virtual CGFloat Blue() const = 0; virtual CGFloat Alpha() const = 0; - + virtual bool IsSolid() const { return true; } virtual CGColorRef GetCGColor() const = 0; - + virtual wxColourRefData* Clone() const = 0; - + #if wxOSX_USE_COCOA virtual WX_NSColor GetNSColor() const; #endif diff --git a/include/wx/osx/core/evtloop.h b/include/wx/osx/core/evtloop.h index 7c4f189fdf..c2be89e33b 100644 --- a/include/wx/osx/core/evtloop.h +++ b/include/wx/osx/core/evtloop.h @@ -43,7 +43,7 @@ public: virtual void WakeUp(); bool ShouldProcessIdleEvents() const { return m_processIdleEvents ; } - + #if wxUSE_UIACTIONSIMULATOR // notifies Yield and Dispatch to wait for at least one event before // returning, this is necessary, because the synthesized events need to be diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index 9ada10b975..dfe47f4efd 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -168,7 +168,7 @@ public : const wxString& strHelp, wxItemKind kind, wxMenu *pSubMenu ); - + // handle OS specific menu items if they weren't handled during normal processing virtual bool DoDefault() { return false; } protected : @@ -197,7 +197,7 @@ public : wxMenu* GetWXPeer() { return m_peer ; } virtual void PopUp( wxWindow *win, int x, int y ) = 0; - + virtual void GetMenuBarDimensions(int &x, int &y, int &width, int &height) const { x = y = width = height = -1; @@ -232,13 +232,13 @@ public : void Init(); bool IsRootControl() const { return m_isRootControl; } - + // is a custom control that has all events handled in wx code, no built-ins bool IsUserPane() const { return m_isUserPane; } // we are doing keyboard handling in wx code, other events might be handled natively virtual bool HasUserKeyHandling() const { return m_wantsUserKey; } - + // we are doing mouse handling in wx code, other events might be handled natively virtual bool HasUserMouseHandling() const { return m_wantsUserMouse; } @@ -280,7 +280,7 @@ public : { return 1.0; } - + // the native coordinates may have an 'aura' for shadows etc, if this is the case the layout // inset indicates on which insets the real control is drawn virtual void GetLayoutInset(int &left , int &top , int &right, int &bottom) const @@ -299,7 +299,7 @@ public : virtual bool NeedsFrame() const; virtual void SetNeedsFrame( bool needs ); - + virtual void SetDrawingEnabled(bool enabled); virtual bool CanFocus() const = 0; @@ -322,7 +322,7 @@ public : virtual void SetCursor( const wxCursor & cursor ) = 0; virtual void CaptureMouse() = 0; virtual void ReleaseMouse() = 0; - + virtual void SetDropTarget( wxDropTarget * WXUNUSED(dropTarget) ) {} virtual wxInt32 GetValue() const = 0; @@ -371,7 +371,7 @@ public : // of a known control static wxWidgetImpl* FindBestFromWXWidget(WXWidget control); - + static void RemoveAssociations( wxWidgetImpl* impl); static void RemoveAssociation(WXWidget control); @@ -955,7 +955,7 @@ public : virtual void ScreenToWindow( int *x, int *y ) = 0; virtual void WindowToScreen( int *x, int *y ) = 0; - + virtual bool IsActive() = 0; wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; } diff --git a/include/wx/osx/dataobj.h b/include/wx/osx/dataobj.h index 45a73f289f..86ab65d748 100644 --- a/include/wx/osx/dataobj.h +++ b/include/wx/osx/dataobj.h @@ -30,7 +30,7 @@ public: // returns true if any of the accepted formats of this dataobj is in the pasteboard bool HasDataInPasteboard( void * pasteboardRef ); bool GetFromPasteboard( void * pasteboardRef ); - + #if wxOSX_USE_COCOA virtual void AddSupportedTypes( void* cfarray); #endif diff --git a/include/wx/osx/dataview.h b/include/wx/osx/dataview.h index 2b958c60a4..2eb826b5c4 100644 --- a/include/wx/osx/dataview.h +++ b/include/wx/osx/dataview.h @@ -205,7 +205,7 @@ public: // finishes editing of custom items; if no custom item is currently edited the method does nothing void FinishCustomItemEditing(); - + virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) wxOVERRIDE; // returns the n-th pointer to a column; diff --git a/include/wx/osx/dialog.h b/include/wx/osx/dialog.h index bce052f4c2..e8d871cd54 100644 --- a/include/wx/osx/dialog.h +++ b/include/wx/osx/dialog.h @@ -62,7 +62,7 @@ public: static bool OSXHasModalDialogsOpen(); void OSXBeginModalDialog(); void OSXEndModalDialog(); - + #if wxOSX_USE_COCOA bool OSXGetWorksWhenModal(); void OSXSetWorksWhenModal(bool worksWhenModal); @@ -94,7 +94,7 @@ protected: private: void Init(); - + static wxVector s_modalStack; #if wxOSX_USE_COCOA static wxVector s_modalWorksStack; diff --git a/include/wx/osx/evtloop.h b/include/wx/osx/evtloop.h index cbbab016d6..e9e7545f18 100644 --- a/include/wx/osx/evtloop.h +++ b/include/wx/osx/evtloop.h @@ -23,7 +23,7 @@ class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop public: wxModalEventLoop(wxWindow *modalWindow); wxModalEventLoop(WXWindow modalNativeWindow); - + #ifdef __WXOSX_COCOA__ // skip wxGUIEventLoop to avoid missing Enter/Exit notifications virtual int Run() { return wxCFEventLoop::Run(); } diff --git a/include/wx/osx/filedlg.h b/include/wx/osx/filedlg.h index d8e8a862a6..e106a48629 100644 --- a/include/wx/osx/filedlg.h +++ b/include/wx/osx/filedlg.h @@ -17,7 +17,7 @@ class WXDLLIMPEXP_FWD_CORE wxChoice; // wxFileDialog //------------------------------------------------------------------------- -// set this system option to 1 in order to always show the filetypes popup in +// set this system option to 1 in order to always show the filetypes popup in // file open dialogs if possible #define wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES wxT("osx.openfiledialog.always-show-types") @@ -59,7 +59,7 @@ public: #if wxOSX_USE_COCOA ~wxFileDialog(); #endif - + virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; } virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; } @@ -71,9 +71,9 @@ public: #endif virtual bool SupportsExtraControl() const; - + // implementation only - + #if wxOSX_USE_COCOA // returns true if the file can be shown as active bool CheckFile( const wxString& filename ); @@ -86,7 +86,7 @@ protected: int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {} void SetupExtraControls(WXWindow nativeWindow); - + #if wxOSX_USE_COCOA virtual wxWindow* CreateFilterPanel(wxWindow *extracontrol); void DoOnFilterSelected(int index); diff --git a/include/wx/osx/iphone/private.h b/include/wx/osx/iphone/private.h index 557bb68308..a0694ed2d7 100644 --- a/include/wx/osx/iphone/private.h +++ b/include/wx/osx/iphone/private.h @@ -63,7 +63,7 @@ public : virtual void GetSize( int &width, int &height ) const; virtual void SetControlSize( wxWindowVariant variant ); virtual double GetContentScaleFactor() const ; - + virtual void SetNeedsDisplay( const wxRect* where = NULL ); virtual bool GetNeedsDisplay() const; @@ -176,7 +176,7 @@ public : virtual bool IsFullScreen() const; virtual bool EnableFullScreenView(bool enable); - + virtual bool ShowFullScreen(bool show, long style); virtual void RequestUserAttention(int flags); diff --git a/include/wx/osx/iphone/private/textimpl.h b/include/wx/osx/iphone/private/textimpl.h index 7c9e5fd109..4019881872 100644 --- a/include/wx/osx/iphone/private/textimpl.h +++ b/include/wx/osx/iphone/private/textimpl.h @@ -34,10 +34,10 @@ public : virtual void WriteText(const wxString& str) ; virtual bool HasOwnContextMenu() const { return true; } - virtual wxSize GetBestSize() const; - + virtual wxSize GetBestSize() const; + virtual bool SetHint(const wxString& hint); - + virtual void controlAction(WXWidget slf, void* _cmd, void *sender); protected : UITextField* m_textField; diff --git a/include/wx/osx/menu.h b/include/wx/osx/menu.h index d9808e5f1d..2fee40e622 100644 --- a/include/wx/osx/menu.h +++ b/include/wx/osx/menu.h @@ -170,7 +170,7 @@ public: static WXHMENU MacGetWindowMenuHMenu() { return s_macWindowMenuHandle ; } - + virtual void DoGetPosition(int *x, int *y) const; virtual void DoGetSize(int *width, int *height) const; virtual void DoGetClientSize(int *width, int *height) const; diff --git a/include/wx/osx/msgdlg.h b/include/wx/osx/msgdlg.h index c4257aff57..4d6e9d6a87 100644 --- a/include/wx/osx/msgdlg.h +++ b/include/wx/osx/msgdlg.h @@ -24,7 +24,7 @@ public: #if wxOSX_USE_COCOA ~wxMessageDialog(); #endif - + virtual int ShowModal(); #if wxOSX_USE_COCOA diff --git a/include/wx/osx/nonownedwnd.h b/include/wx/osx/nonownedwnd.h index a52eae9922..41c9ca0492 100644 --- a/include/wx/osx/nonownedwnd.h +++ b/include/wx/osx/nonownedwnd.h @@ -64,7 +64,7 @@ public: virtual void UnsubclassWin(); virtual wxPoint GetClientAreaOrigin() const; - + // implement base class pure virtuals virtual bool SetTransparent(wxByte alpha); @@ -151,7 +151,7 @@ protected: private : static clock_t s_lastFlush; - + wxRegion m_shape; #if wxUSE_GRAPHICS_CONTEXT wxGraphicsPath m_shapePath; diff --git a/include/wx/osx/popupwin.h b/include/wx/osx/popupwin.h index 21065febcf..8d9be37dee 100644 --- a/include/wx/osx/popupwin.h +++ b/include/wx/osx/popupwin.h @@ -27,7 +27,7 @@ public: bool Create(wxWindow *parent, int flags = wxBORDER_NONE); virtual bool Show(bool show = true); - + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow); }; diff --git a/include/wx/osx/toolbar.h b/include/wx/osx/toolbar.h index 70a33f77a7..52febf14a3 100644 --- a/include/wx/osx/toolbar.h +++ b/include/wx/osx/toolbar.h @@ -95,9 +95,9 @@ public: protected: // common part of all ctors void Init(); - + void DoLayout(); - + void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE; #ifndef __WXOSX_IPHONE__ diff --git a/include/wx/osx/toplevel.h b/include/wx/osx/toplevel.h index 72f58c98a6..c54528d97a 100644 --- a/include/wx/osx/toplevel.h +++ b/include/wx/osx/toplevel.h @@ -82,7 +82,7 @@ public: virtual void SetLabel(const wxString& label) wxOVERRIDE { SetTitle( label ); } virtual wxString GetLabel() const wxOVERRIDE { return GetTitle(); } - + virtual void OSXSetModified(bool modified) wxOVERRIDE; virtual bool OSXIsModified() const wxOVERRIDE; diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index dc54ec061c..32730fb613 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -14,7 +14,7 @@ #include "wx/defs.h" -#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX__) +#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX__) #include "wx/control.h" #include "wx/webview.h" @@ -86,10 +86,10 @@ public: //Find function virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT) wxOVERRIDE - { + { wxUnusedVar(text); wxUnusedVar(flags); - return wxNOT_FOUND; + return wxNOT_FOUND; } //Clipboard functions diff --git a/include/wx/osx/window.h b/include/wx/osx/window.h index b192b44b47..e3d0a08a0a 100644 --- a/include/wx/osx/window.h +++ b/include/wx/osx/window.h @@ -52,7 +52,7 @@ public: const wxString& name = wxPanelNameStr ); virtual void SendSizeEvent(int flags = 0) wxOVERRIDE; - + // implement base class pure virtuals virtual void SetLabel( const wxString& label ) wxOVERRIDE; virtual wxString GetLabel() const wxOVERRIDE; @@ -92,10 +92,10 @@ public: virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE; virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE; - + virtual int GetCharHeight() const wxOVERRIDE; virtual int GetCharWidth() const wxOVERRIDE; - + public: virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = true ) wxOVERRIDE; @@ -117,11 +117,11 @@ public: #if wxUSE_HOTKEY && wxOSX_USE_COCOA_OR_CARBON // hot keys (system wide accelerators) // ----------------------------------- - + virtual bool RegisterHotKey(int hotkeyId, int modifiers, int keycode) wxOVERRIDE; virtual bool UnregisterHotKey(int hotkeyId) wxOVERRIDE; #endif // wxUSE_HOTKEY - + #if wxUSE_DRAG_AND_DROP virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE; @@ -255,7 +255,7 @@ public: // the 'true' OS level control for this wxWindow wxOSXWidgetImpl* GetPeer() const; - + // optimization to avoid creating a user pane in wxWindow::Create if we already know // we will replace it with our own peer void DontCreatePeer(); @@ -263,10 +263,10 @@ public: // return true unless DontCreatePeer() had been called bool ShouldCreatePeer() const; - // sets the native implementation wrapper, can replace an existing peer, use peer = NULL to + // sets the native implementation wrapper, can replace an existing peer, use peer = NULL to // release existing peer void SetPeer(wxOSXWidgetImpl* peer); - + // wraps the already existing peer with the wrapper void SetWrappingPeer(wxOSXWidgetImpl* wrapper); @@ -289,9 +289,9 @@ public: virtual void OSXSimulateFocusEvents(); bool IsNativeWindowWrapper() const { return m_isNativeWindowWrapper; } - + double GetContentScaleFactor() const wxOVERRIDE; - + // internal response to size events virtual void MacOnInternalSize() {} diff --git a/include/wx/private/notifmsg.h b/include/wx/private/notifmsg.h index 772a9c308e..3f02a29e72 100644 --- a/include/wx/private/notifmsg.h +++ b/include/wx/private/notifmsg.h @@ -66,7 +66,7 @@ protected: void SetActive(bool active) { m_active = active; - + // Delete the implementation if the notification is detached if (!m_notification && !active) delete this; diff --git a/include/wx/qt/accel.h b/include/wx/qt/accel.h index a710f7f0ab..d402f4941a 100644 --- a/include/wx/qt/accel.h +++ b/include/wx/qt/accel.h @@ -52,8 +52,8 @@ protected: // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - -private: + +private: wxDECLARE_DYNAMIC_CLASS(wxAcceleratorTable); }; diff --git a/include/wx/qt/app.h b/include/wx/qt/app.h index 80bda3a773..8ce685eb62 100644 --- a/include/wx/qt/app.h +++ b/include/wx/qt/app.h @@ -15,15 +15,15 @@ class WXDLLIMPEXP_CORE wxApp : public wxAppBase public: wxApp(); ~wxApp(); - + virtual bool Initialize(int& argc, wxChar **argv); private: QApplication *m_qtApplication; int m_qtArgc; char **m_qtArgv; - + wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxApp ); }; - + #endif // _WX_QT_APP_H_ diff --git a/include/wx/qt/bitmap.h b/include/wx/qt/bitmap.h index e03883ca3f..0da96633da 100644 --- a/include/wx/qt/bitmap.h +++ b/include/wx/qt/bitmap.h @@ -29,7 +29,7 @@ public: wxBitmap(const char* const* bits); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM); wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0); - + // Convert from wxIcon / wxCursor wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } explicit wxBitmap(const wxCursor& cursor); diff --git a/include/wx/qt/brush.h b/include/wx/qt/brush.h index 9359ac54ea..60c116574f 100644 --- a/include/wx/qt/brush.h +++ b/include/wx/qt/brush.h @@ -35,7 +35,7 @@ public: wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxBrushStyle)style); } - + QBrush GetHandle() const; protected: diff --git a/include/wx/qt/choice.h b/include/wx/qt/choice.h index 208005ec06..5808879ea8 100644 --- a/include/wx/qt/choice.h +++ b/include/wx/qt/choice.h @@ -14,7 +14,7 @@ class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase { public: wxChoice(); - + wxChoice( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -22,7 +22,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr ); - + wxChoice( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, @@ -38,7 +38,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr ); - + bool Create( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, @@ -64,7 +64,7 @@ protected: void **clientData, wxClientDataType type); virtual int DoInsertOneItem(const wxString& item, unsigned int pos); - + virtual void DoSetItemClientData(unsigned int n, void *clientData); virtual void *DoGetItemClientData(unsigned int n) const; diff --git a/include/wx/qt/cursor.h b/include/wx/qt/cursor.h index b57f770a6f..218564e32d 100644 --- a/include/wx/qt/cursor.h +++ b/include/wx/qt/cursor.h @@ -29,7 +29,7 @@ public: virtual wxPoint GetHotSpot() const; QCursor &GetHandle() const; - + protected: void InitFromStock( wxStockCursor cursorId ); #if wxUSE_IMAGE diff --git a/include/wx/qt/dataform.h b/include/wx/qt/dataform.h index b6f5c307bf..4447e8a681 100644 --- a/include/wx/qt/dataform.h +++ b/include/wx/qt/dataform.h @@ -20,7 +20,7 @@ public: wxDataFormat(const wxChar *id); void SetId( const wxChar *id ); - + bool operator==(wxDataFormatId format) const; bool operator!=(wxDataFormatId format) const; bool operator==(const wxDataFormat& format) const; diff --git a/include/wx/qt/dataobj.h b/include/wx/qt/dataobj.h index 002de9c2a0..3ab0a7079b 100644 --- a/include/wx/qt/dataobj.h +++ b/include/wx/qt/dataobj.h @@ -15,7 +15,7 @@ class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase public: wxDataObject(); ~wxDataObject(); - + virtual bool IsSupportedFormat(const wxDataFormat& format, Direction dir) const; virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const; virtual size_t GetFormatCount(Direction dir = Get) const; diff --git a/include/wx/qt/dc.h b/include/wx/qt/dc.h index d1c632f714..76abb7a43b 100644 --- a/include/wx/qt/dc.h +++ b/include/wx/qt/dc.h @@ -112,7 +112,7 @@ public: protected: virtual QPixmap *GetQPixmap() { return m_qtPixmap; } - + QPainter *m_qtPainter; QPixmap *m_qtPixmap; @@ -132,7 +132,7 @@ private: wxDECLARE_CLASS(wxQtDCImpl); wxDECLARE_NO_COPY_CLASS(wxQtDCImpl); - + }; #endif // _WX_QT_DC_H_ diff --git a/include/wx/qt/dcprint.h b/include/wx/qt/dcprint.h index 09ea99ea94..2c9dfce4f8 100644 --- a/include/wx/qt/dcprint.h +++ b/include/wx/qt/dcprint.h @@ -14,7 +14,7 @@ class WXDLLIMPEXP_CORE wxPrinterDCImpl : public wxDCImpl { public: wxPrinterDCImpl( wxPrinterDC *, const wxPrintData & ); - + virtual bool CanDrawBitmap() const; virtual bool CanGetTextExtent() const; @@ -35,7 +35,7 @@ public: #endif // wxUSE_PALETTE virtual void SetLogicalFunction(wxRasterOperationMode function); - + virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharWidth() const; virtual void DoGetTextExtent(const wxString& string, @@ -43,7 +43,7 @@ public: wxCoord *descent = NULL, wxCoord *externalLeading = NULL, const wxFont *theFont = NULL) const; - + virtual void Clear(); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, @@ -53,7 +53,7 @@ public: virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style = wxFLOOD_SURFACE); - + virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; virtual void DoDrawPoint(wxCoord x, wxCoord y); diff --git a/include/wx/qt/defs.h b/include/wx/qt/defs.h index be9129c036..b737b9290e 100644 --- a/include/wx/qt/defs.h +++ b/include/wx/qt/defs.h @@ -12,6 +12,6 @@ typedef class QWidget *WXWidget; -#endif +#endif #endif /* _WX_QT_DEFS_H_ */ diff --git a/include/wx/qt/dialog.h b/include/wx/qt/dialog.h index 288e1b3ed2..7a478bf9ff 100644 --- a/include/wx/qt/dialog.h +++ b/include/wx/qt/dialog.h @@ -23,7 +23,7 @@ public: const wxString &name = wxDialogNameStr ); virtual ~wxDialog(); - + bool Create( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos = wxDefaultPosition, diff --git a/include/wx/qt/dnd.h b/include/wx/qt/dnd.h index d06a35a570..ca52754d6f 100644 --- a/include/wx/qt/dnd.h +++ b/include/wx/qt/dnd.h @@ -14,7 +14,7 @@ class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase { public: wxDropTarget(wxDataObject *dataObject = NULL ); - + virtual bool OnDrop(wxCoord x, wxCoord y); virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); virtual bool GetData(); @@ -40,7 +40,7 @@ public: const wxIcon © = wxNullIcon, const wxIcon &move = wxNullIcon, const wxIcon &none = wxNullIcon); - + virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); }; #endif // _WX_QT_DND_H_ diff --git a/include/wx/qt/font.h b/include/wx/qt/font.h index 44354e8f52..391623dcb9 100644 --- a/include/wx/qt/font.h +++ b/include/wx/qt/font.h @@ -71,11 +71,11 @@ public: virtual void SetUnderlined( bool underlined ); virtual void SetStrikethrough(bool strikethrough) wxOVERRIDE; virtual void SetEncoding(wxFontEncoding encoding); - + wxDECLARE_COMMON_FONT_METHODS(); virtual QFont GetHandle() const; - + protected: virtual wxGDIRefData *CreateGDIRefData() const; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; diff --git a/include/wx/qt/fontdlg.h b/include/wx/qt/fontdlg.h index df739d3852..a170578ffa 100644 --- a/include/wx/qt/fontdlg.h +++ b/include/wx/qt/fontdlg.h @@ -16,10 +16,10 @@ public: wxFontDialog() { } wxFontDialog(wxWindow *parent) { Create(parent); } wxFontDialog(wxWindow *parent, const wxFontData& data) { Create(parent, data); } - + protected: bool DoCreate(wxWindow *parent); - + private: wxFontData m_data; diff --git a/include/wx/qt/frame.h b/include/wx/qt/frame.h index 4a603be45c..4e164f3d26 100644 --- a/include/wx/qt/frame.h +++ b/include/wx/qt/frame.h @@ -45,7 +45,7 @@ public: virtual void SetMenuBar(wxMenuBar *menubar); virtual void SetStatusBar(wxStatusBar *statusBar ); virtual void SetToolBar(wxToolBar *toolbar); - + virtual void SetWindowStyleFlag( long style ); virtual void AddChild( wxWindowBase *child ); diff --git a/include/wx/qt/listbox.h b/include/wx/qt/listbox.h index 19126336a3..f3acc6eb5f 100644 --- a/include/wx/qt/listbox.h +++ b/include/wx/qt/listbox.h @@ -51,11 +51,11 @@ public: virtual bool IsSelected(int n) const wxOVERRIDE; virtual int GetSelections(wxArrayInt& aSelections) const wxOVERRIDE; - + virtual unsigned int GetCount() const; virtual wxString GetString(unsigned int n) const; virtual void SetString(unsigned int n, const wxString& s); - + virtual int GetSelection() const; virtual QWidget *GetHandle() const; @@ -66,16 +66,16 @@ protected: virtual void DoSetFirstItem(int n) wxOVERRIDE; virtual void DoSetSelection(int n, bool select) wxOVERRIDE; - + virtual int DoInsertItems(const wxArrayStringsAdapter & items, unsigned int pos, void **clientData, wxClientDataType type); virtual int DoInsertOneItem(const wxString& item, unsigned int pos); - + virtual void DoSetItemClientData(unsigned int n, void *clientData); virtual void *DoGetItemClientData(unsigned int n) const; - + virtual void DoClear(); virtual void DoDeleteOneItem(unsigned int pos); diff --git a/include/wx/qt/mdi.h b/include/wx/qt/mdi.h index 260857902b..a1970ba322 100644 --- a/include/wx/qt/mdi.h +++ b/include/wx/qt/mdi.h @@ -75,7 +75,7 @@ class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase { public: wxMDIClientWindow(); - + virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); wxDECLARE_DYNAMIC_CLASS(wxMDIClientWindow); }; diff --git a/include/wx/qt/minifram.h b/include/wx/qt/minifram.h index daf75a35f5..0c10e5a634 100644 --- a/include/wx/qt/minifram.h +++ b/include/wx/qt/minifram.h @@ -25,7 +25,7 @@ public: const wxString& name = wxFrameNameStr) { return wxFrame::Create(parent, id, title, pos, size, - style | wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR, + style | wxFRAME_TOOL_WINDOW | wxFRAME_NO_TASKBAR, name); } diff --git a/include/wx/qt/notebook.h b/include/wx/qt/notebook.h index 9db81bb917..3175f35a0f 100644 --- a/include/wx/qt/notebook.h +++ b/include/wx/qt/notebook.h @@ -20,7 +20,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxNotebookNameStr); - + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, diff --git a/include/wx/qt/palette.h b/include/wx/qt/palette.h index 7f01dfdc25..331130f79c 100644 --- a/include/wx/qt/palette.h +++ b/include/wx/qt/palette.h @@ -13,9 +13,9 @@ class WXDLLIMPEXP_CORE wxPalette : public wxPaletteBase public: wxPalette(); wxPalette(int n, unsigned char *red, unsigned char *green, unsigned char *blue); - + bool Create(int n, unsigned char *red, unsigned char *green, unsigned char *blue); - + bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const; int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const; diff --git a/include/wx/qt/pen.h b/include/wx/qt/pen.h index 9a6ce1dc8c..c9d78b56ad 100644 --- a/include/wx/qt/pen.h +++ b/include/wx/qt/pen.h @@ -43,7 +43,7 @@ public: wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") void SetStyle(int style) { SetStyle((wxPenStyle)style); } - + QPen GetHandle() const; protected: diff --git a/include/wx/qt/printdlg.h b/include/wx/qt/printdlg.h index fc9fb91afe..1fd43ed1e9 100644 --- a/include/wx/qt/printdlg.h +++ b/include/wx/qt/printdlg.h @@ -15,12 +15,12 @@ class WXDLLIMPEXP_CORE wxQtPrintNativeData: public wxPrintNativeDataBase { public: wxQtPrintNativeData(); - + virtual bool TransferTo( wxPrintData &data ); virtual bool TransferFrom( const wxPrintData &data ); virtual bool IsOk() const; - + }; class WXDLLIMPEXP_CORE wxQtPrintDialog : public wxPrintDialogBase diff --git a/include/wx/qt/printqt.h b/include/wx/qt/printqt.h index 23d5dcb1bb..65c44bc194 100644 --- a/include/wx/qt/printqt.h +++ b/include/wx/qt/printqt.h @@ -32,7 +32,7 @@ public: wxQtPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data); - + virtual bool Print(bool interactive); virtual void DetermineScaling(); diff --git a/include/wx/qt/private/timer.h b/include/wx/qt/private/timer.h index 21ce2f79d6..d1d5790428 100644 --- a/include/wx/qt/private/timer.h +++ b/include/wx/qt/private/timer.h @@ -29,7 +29,7 @@ public: protected: virtual void timerEvent( QTimerEvent * event ); - + private: int m_timerId; }; diff --git a/include/wx/qt/private/winevent.h b/include/wx/qt/private/winevent.h index 40ea85e417..a8465b542a 100644 --- a/include/wx/qt/private/winevent.h +++ b/include/wx/qt/private/winevent.h @@ -253,7 +253,7 @@ protected: else event->accept(); } - + //wxMoveEvent virtual void moveEvent ( QMoveEvent * event ) { @@ -265,7 +265,7 @@ protected: else event->accept(); } - + //wxEraseEvent then wxPaintEvent virtual void paintEvent ( QPaintEvent * event ) { @@ -301,7 +301,7 @@ protected: else event->accept(); } - + //wxMouseEvent virtual void wheelEvent ( QWheelEvent * event ) { diff --git a/include/wx/qt/region.h b/include/wx/qt/region.h index d49ad45964..a1cb66c111 100644 --- a/include/wx/qt/region.h +++ b/include/wx/qt/region.h @@ -23,7 +23,7 @@ public: wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE); wxRegion(const wxBitmap& bmp); wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0); - + virtual bool IsEmpty() const; virtual void Clear(); @@ -82,7 +82,7 @@ public: wxCoord GetH() const; wxCoord GetHeight() const; wxRect GetRect() const; - + private: QVector < QRect > *m_qtRects; int m_pos; diff --git a/include/wx/qt/statbox.h b/include/wx/qt/statbox.h index e116c57787..8589adf4b1 100644 --- a/include/wx/qt/statbox.h +++ b/include/wx/qt/statbox.h @@ -14,7 +14,7 @@ class WXDLLIMPEXP_CORE wxStaticBox : public wxStaticBoxBase { public: wxStaticBox(); - + wxStaticBox(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, diff --git a/include/wx/qt/statusbar.h b/include/wx/qt/statusbar.h index 0609d4b044..7e89426d25 100644 --- a/include/wx/qt/statusbar.h +++ b/include/wx/qt/statusbar.h @@ -36,7 +36,7 @@ public: QStatusBar *GetQStatusBar() const { return m_qtStatusBar; } QWidget *GetHandle() const; - + protected: virtual void DoUpdateStatusText(int number); diff --git a/include/wx/qt/textctrl.h b/include/wx/qt/textctrl.h index 68863a9a04..3cd57c936c 100644 --- a/include/wx/qt/textctrl.h +++ b/include/wx/qt/textctrl.h @@ -46,7 +46,7 @@ public: virtual bool SetStyle(long start, long end, const wxTextAttr& style); virtual bool GetStyle(long position, wxTextAttr& style); virtual bool SetDefaultStyle(const wxTextAttr& style); - + virtual long XYToPosition(long x, long y) const; virtual bool PositionToXY(long pos, long *x, long *y) const; diff --git a/include/wx/qt/textentry.h b/include/wx/qt/textentry.h index 458e6add68..685edda867 100644 --- a/include/wx/qt/textentry.h +++ b/include/wx/qt/textentry.h @@ -20,7 +20,7 @@ public: virtual void Copy(); virtual void Cut(); virtual void Paste(); - + virtual void Undo(); virtual void Redo(); virtual bool CanUndo() const; @@ -32,10 +32,10 @@ public: virtual void SetSelection(long from, long to); virtual void GetSelection(long *from, long *to) const; - + virtual bool IsEditable() const; virtual void SetEditable(bool editable); - + protected: virtual wxString DoGetValue() const; virtual void DoSetValue(const wxString& value, int flags=0); diff --git a/include/wx/qt/tooltip.h b/include/wx/qt/tooltip.h index 12b3d35ea0..8f8bb232fe 100644 --- a/include/wx/qt/tooltip.h +++ b/include/wx/qt/tooltip.h @@ -25,7 +25,7 @@ public: static void SetAutoPop(long milliseconds); // set the delay between subsequent tooltips to appear static void SetReshow(long milliseconds); - + wxToolTip(const wxString &tip); void SetTip(const wxString& tip); diff --git a/include/wx/qt/toplevel.h b/include/wx/qt/toplevel.h index 5bc66da183..8eb283cc70 100644 --- a/include/wx/qt/toplevel.h +++ b/include/wx/qt/toplevel.h @@ -28,7 +28,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); - + virtual bool Show(bool show = true) wxOVERRIDE; virtual void Maximize(bool maximize = true); virtual void Restore(); @@ -41,10 +41,10 @@ public: virtual void SetTitle(const wxString& title); virtual wxString GetTitle() const; virtual void SetIcons(const wxIconBundle& icons); - + // Styles virtual void SetWindowStyleFlag( long style ); virtual long GetWindowStyleFlag() const; }; - + #endif // _WX_QT_TOPLEVEL_H_ diff --git a/include/wx/qt/treectrl.h b/include/wx/qt/treectrl.h index 2abf2e17f4..5fdc125ce0 100644 --- a/include/wx/qt/treectrl.h +++ b/include/wx/qt/treectrl.h @@ -29,7 +29,7 @@ public: const wxString& name = wxTreeCtrlNameStr); virtual unsigned int GetCount() const; - + virtual unsigned int GetIndent() const; virtual void SetIndent(unsigned int indent); @@ -55,15 +55,15 @@ public: virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col); virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font); - + virtual bool IsVisible(const wxTreeItemId& item) const; virtual bool ItemHasChildren(const wxTreeItemId& item) const; virtual bool IsExpanded(const wxTreeItemId& item) const; virtual bool IsSelected(const wxTreeItemId& item) const; virtual bool IsBold(const wxTreeItemId& item) const; - + virtual size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = true) const; - + virtual wxTreeItemId GetRootItem() const; virtual wxTreeItemId GetSelection() const; virtual size_t GetSelections(wxArrayTreeItemIds& selections) const; @@ -73,7 +73,7 @@ public: virtual wxTreeItemId GetFocusedItem() const; virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const; - + virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const; virtual wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const; virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const; diff --git a/include/wx/rawbmp.h b/include/wx/rawbmp.h index fae330a7e3..12eb283723 100644 --- a/include/wx/rawbmp.h +++ b/include/wx/rawbmp.h @@ -171,7 +171,7 @@ typedef wxPixelFormat wxImagePixelFormat; #define wxPIXEL_FORMAT_ALPHA 3 #elif defined(__WXQT__) typedef wxPixelFormat wxNativePixelFormat; - + #define wxPIXEL_FORMAT_ALPHA 3 #endif diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index a3a900dde1..ce15e67aea 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -3905,7 +3905,7 @@ protected: covers common needs especially for simple, static fields using text or a bitmap. Register field types on application initialisation with the static function - wxRichTextBuffer::AddFieldType. They will be deleted automatically on + wxRichTextBuffer::AddFieldType. They will be deleted automatically on application exit. An application can write a field to a control with wxRichTextCtrl::WriteField, @@ -6122,7 +6122,7 @@ public: /** Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none. - */ + */ virtual wxPosition GetFocusedCell() const; // Operations @@ -6206,7 +6206,7 @@ public: wxRichTextTableBlock(const wxRichTextTableBlock& block) { Copy(block); } void Init() { m_colStart = 0; m_colEnd = 0; m_rowStart = 0; m_rowEnd = 0; } - + void Copy(const wxRichTextTableBlock& block) { m_colStart = block.m_colStart; m_colEnd = block.m_colEnd; m_rowStart = block.m_rowStart; m_rowEnd = block.m_rowEnd; diff --git a/include/wx/richtext/richtextfontpage.h b/include/wx/richtext/richtextfontpage.h index b7a242d776..f52ee19b44 100644 --- a/include/wx/richtext/richtextfontpage.h +++ b/include/wx/richtext/richtextfontpage.h @@ -87,7 +87,7 @@ public: /// be removed from the page. By default, these effects are not shown as they /// have no effect in the editor. static int GetAllowedTextEffects() { return sm_allowedTextEffects; } - + /// Sets the allowed text effects in the page. static void SetAllowedTextEffects(int allowed) { sm_allowedTextEffects = allowed; } diff --git a/include/wx/richtext/richtextimagedlg.h b/include/wx/richtext/richtextimagedlg.h index daf320ae8c..bc29b1822e 100644 --- a/include/wx/richtext/richtextimagedlg.h +++ b/include/wx/richtext/richtextimagedlg.h @@ -44,7 +44,7 @@ class WXDLLIMPEXP_FWD_CORE wxTextCtrl; */ class WXDLLIMPEXP_RICHTEXT wxRichTextObjectPropertiesDialog: public wxRichTextFormattingDialog -{ +{ wxDECLARE_DYNAMIC_CLASS(wxRichTextObjectPropertiesDialog); wxDECLARE_EVENT_TABLE(); diff --git a/include/wx/richtext/richtextmarginspage.h b/include/wx/richtext/richtextmarginspage.h index d69184e51e..afdc2a09ae 100644 --- a/include/wx/richtext/richtextmarginspage.h +++ b/include/wx/richtext/richtextmarginspage.h @@ -2,7 +2,7 @@ // Name: wx/richtext/richtextmarginspage.h // Purpose: Declares the rich text formatting dialog margins page. // Author: Julian Smart -// Modified by: +// Modified by: // Created: 20/10/2010 10:27:34 // Copyright: (c) Julian Smart // Licence: wxWindows licence @@ -70,11 +70,11 @@ public: /// Gets the attributes from the formatting dialog wxRichTextAttr* GetAttributes(); - + /// Data transfer virtual bool TransferDataToWindow() wxOVERRIDE; virtual bool TransferDataFromWindow() wxOVERRIDE; - + ////@begin wxRichTextMarginsPage event handler declarations /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_MARGIN diff --git a/include/wx/richtext/richtextuicustomization.h b/include/wx/richtext/richtextuicustomization.h index d9fadfc808..4d405bf6ff 100644 --- a/include/wx/richtext/richtextuicustomization.h +++ b/include/wx/richtext/richtextuicustomization.h @@ -26,7 +26,7 @@ wxRichTextFormattingDialog::GetHelpInfo().SetHelpId(ID_HELP_FORMATTINGDIALOG); wxRichTextFormattingDialog::GetHelpInfo().SetUICustomization(& wxGetApp().GetRichTextUICustomization()); wxRichTextBordersPage::GetHelpInfo().SetHelpId(ID_HELP_BORDERSPAGE); - + Only the wxRichTextFormattingDialog class needs to have its customization object and help id set, though the application set them for individual pages if it wants. **/ @@ -46,17 +46,17 @@ public: This class is used as a static member of dialogs, to store the help topic for the dialog and also the customization object that will allow help to be shown appropriately for the application. **/ - + class WXDLLIMPEXP_RICHTEXT wxRichTextHelpInfo { public: wxRichTextHelpInfo() { m_helpTopic = -1; - m_uiCustomization = NULL; + m_uiCustomization = NULL; } virtual ~wxRichTextHelpInfo() {} - + virtual bool ShowHelp(wxWindow* win) { if ( !m_uiCustomization || m_helpTopic == -1 ) diff --git a/include/wx/richtext/richtextxml.h b/include/wx/richtext/richtextxml.h index 9557d5d4b7..6f25e367ea 100644 --- a/include/wx/richtext/richtextxml.h +++ b/include/wx/richtext/richtextxml.h @@ -98,7 +98,7 @@ public: void OutputString(wxOutputStream& stream, const wxString& str); void OutputStringEnt(wxOutputStream& stream, const wxString& str); - + static void AddString(wxString& str, const int& v) { str << wxString::Format(wxT("%d"), v); } static void AddString(wxString& str, const long& v) { str << wxString::Format(wxT("%ld"), v); } static void AddString(wxString& str, const double& v) { str << wxString::Format(wxT("%.2f"), (float) v); } @@ -122,7 +122,7 @@ public: /// Create a string containing style attributes, plus further object 'attributes' (shown, id) static wxString AddAttributes(wxRichTextObject* obj, bool isPara = false); - + virtual bool ExportStyleDefinition(wxOutputStream& stream, wxRichTextStyleDefinition* def, int level); virtual bool WriteProperties(wxOutputStream& stream, const wxRichTextProperties& properties, int level); diff --git a/include/wx/variantbase.h b/include/wx/variantbase.h index 22f4c32788..8335415ee8 100644 --- a/include/wx/variantbase.h +++ b/include/wx/variantbase.h @@ -85,9 +85,9 @@ public: // If it based on wxObject return the ClassInfo. virtual wxClassInfo* GetValueClassInfo() { return NULL; } - int GetRefCount() const + int GetRefCount() const { return m_count; } - void IncRef() + void IncRef() { m_count++; } void DecRef() { @@ -151,7 +151,7 @@ public: wxVariantBase(const wxVariantBase& variant); wxVariantBase(wxVariantData* data, const wxString& name = wxEmptyString); - template + template wxVariantBase(const T& data, const wxString& name = wxEmptyString) : m_data(new wxVariantDataT(data)), m_name(name) {} @@ -207,19 +207,19 @@ public: // FIXME wxXTI methods: // get the typeinfo of the stored object - const wxTypeInfo* GetTypeInfo() const - { + const wxTypeInfo* GetTypeInfo() const + { if (!m_data) return NULL; - return m_data->GetTypeInfo(); + return m_data->GetTypeInfo(); } // get a ref to the stored data template T& Get() { - wxVariantDataT *dataptr = + wxVariantDataT *dataptr = wx_dynamic_cast(wxVariantDataT*, m_data); - wxASSERT_MSG( dataptr, + wxASSERT_MSG( dataptr, wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); return dataptr->Get(); } @@ -227,16 +227,16 @@ public: // get a const ref to the stored data template const T& Get() const { - const wxVariantDataT *dataptr = + const wxVariantDataT *dataptr = wx_dynamic_cast(const wxVariantDataT*, m_data); - wxASSERT_MSG( dataptr, + wxASSERT_MSG( dataptr, wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); return dataptr->Get(); } template bool HasData() const { - const wxVariantDataT *dataptr = + const wxVariantDataT *dataptr = wx_dynamic_cast(const wxVariantDataT*, m_data); return dataptr != NULL; } @@ -244,7 +244,7 @@ public: // returns this value as string wxString GetAsString() const; - // gets the stored data casted to a wxObject*, + // gets the stored data casted to a wxObject*, // returning NULL if cast is not possible wxObject* GetAsObject(); diff --git a/include/wx/xti.h b/include/wx/xti.h index f8ddce9bbd..f532318fb9 100644 --- a/include/wx/xti.h +++ b/include/wx/xti.h @@ -195,9 +195,9 @@ public: virtual ~wxClassInfo(); - // allocates an instance of this class, this object does not have to be + // allocates an instance of this class, this object does not have to be // initialized or fully constructed as this call will be followed by a call to Create - virtual wxObject *AllocateObject() const + virtual wxObject *AllocateObject() const { return m_objectConstructor ? (*m_objectConstructor)() : 0; } // 'old naming' for AllocateObject staying here for backward compatibility @@ -207,8 +207,8 @@ public: wxObject *ConstructObject(int ParamCount, wxAny *Params) const; bool NeedsDirectConstruction() const; - - const wxChar *GetClassName() const + + const wxChar *GetClassName() const { return m_className; } const wxChar *GetBaseClassName1() const { return m_parents[0] ? m_parents[0]->GetClassName() : NULL; } @@ -220,25 +220,25 @@ public: const wxClassInfo *GetBaseClass2() const { return m_parents[0] ? m_parents[1] : NULL; } - const wxChar *GetIncludeName() const + const wxChar *GetIncludeName() const { return m_unitName; } - const wxClassInfo **GetParents() const + const wxClassInfo **GetParents() const { return m_parents; } - int GetSize() const + int GetSize() const { return m_objectSize; } - bool IsDynamic() const + bool IsDynamic() const { return (NULL != m_objectConstructor); } - wxObjectConstructorFn GetConstructor() const + wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; } - const wxClassInfo *GetNext() const + const wxClassInfo *GetNext() const { return m_next; } // statics: static void CleanUp(); static wxClassInfo *FindClass(const wxString& className); - static const wxClassInfo *GetFirst() + static const wxClassInfo *GetFirst() { return sm_first; } @@ -254,18 +254,18 @@ public: // this object by returning false, if this class has not registered a // callback, the search will go up the inheritance tree if no callback has // been registered true will be returned by default - bool BeforeWriteObject( const wxObject *obj, wxObjectWriter *streamer, + bool BeforeWriteObject( const wxObject *obj, wxObjectWriter *streamer, wxObjectWriterCallback *writercallback, const wxStringToAnyHashMap &metadata) const; // gets the streaming callback from this class or any superclass wxObjectStreamingCallback GetStreamingCallback() const; // returns the first property - wxPropertyInfo* GetFirstProperty() const + wxPropertyInfo* GetFirstProperty() const { EnsureInfosInited(); return m_firstProperty; } // returns the first handler - wxHandlerInfo* GetFirstHandler() const + wxHandlerInfo* GetFirstHandler() const { EnsureInfosInited(); return m_firstHandler; } // Call the Create upon an instance of the class, in the end the object is fully @@ -273,26 +273,26 @@ public: virtual bool Create (wxObject *object, int ParamCount, wxAny *Params) const; // get number of parameters for constructor - virtual int GetCreateParamCount() const + virtual int GetCreateParamCount() const { return m_constructorPropertiesCount; } // get n-th constructor parameter - virtual const wxChar* GetCreateParamName(int n) const + virtual const wxChar* GetCreateParamName(int n) const { return m_constructorProperties[n]; } - // Runtime access to objects for simple properties (get/set) by property + // Runtime access to objects for simple properties (get/set) by property // name and variant data - virtual void SetProperty (wxObject *object, const wxChar *propertyName, + virtual void SetProperty (wxObject *object, const wxChar *propertyName, const wxAny &value) const; virtual wxAny GetProperty (wxObject *object, const wxChar *propertyName) const; // Runtime access to objects for collection properties by property name - virtual wxAnyList GetPropertyCollection(wxObject *object, + virtual wxAnyList GetPropertyCollection(wxObject *object, const wxChar *propertyName) const; - virtual void AddToPropertyCollection(wxObject *object, const wxChar *propertyName, + virtual void AddToPropertyCollection(wxObject *object, const wxChar *propertyName, const wxAny& value) const; - // we must be able to cast variants to wxObject pointers, templates seem + // we must be able to cast variants to wxObject pointers, templates seem // not to be suitable void CallOnAny( const wxAny &data, wxObjectFunctor* functor ) const; @@ -312,7 +312,7 @@ public: // find handler by name virtual wxHandlerInfo *FindHandlerInfoInThisClass (const wxChar *handlerName) const; - // puts all the properties of this class and its superclasses in the map, + // puts all the properties of this class and its superclasses in the map, // as long as there is not yet an entry with the same name (overriding mechanism) void GetProperties( wxPropertyInfoMap &map ) const; @@ -385,7 +385,7 @@ class WXDLLIMPEXP_BASE wxDynamicClassInfo : public wxClassInfo friend class WXDLLIMPEXP_BASE wxDynamicObject; public: - wxDynamicClassInfo( const wxChar *_UnitName, const wxChar *_ClassName, + wxDynamicClassInfo( const wxChar *_UnitName, const wxChar *_ClassName, const wxClassInfo* superClass ); virtual ~wxDynamicClassInfo(); @@ -402,7 +402,7 @@ public: virtual const wxChar* GetCreateParamName(int i) const; // Runtime access to objects by property name, and variant data - virtual void SetProperty (wxObject *object, const wxChar *PropertyName, + virtual void SetProperty (wxObject *object, const wxChar *PropertyName, const wxAny &Value) const; virtual wxAny GetProperty (wxObject *object, const wxChar *PropertyName) const; @@ -416,7 +416,7 @@ public: void RenameProperty( const wxChar *oldPropertyName, const wxChar *newPropertyName ); // as a handler to this class at runtime - void AddHandler( const wxChar *handlerName, wxObjectEventFunction address, + void AddHandler( const wxChar *handlerName, wxObjectEventFunction address, const wxClassInfo* eventClassInfo ); // removes an existing runtime-handler diff --git a/include/wx/xti2.h b/include/wx/xti2.h index c7abd2fa3d..f153f17746 100644 --- a/include/wx/xti2.h +++ b/include/wx/xti2.h @@ -92,7 +92,7 @@ private : #define _DEFAULT_CONSTRUCTOR(name) \ wxObject* wxConstructorFor##name() \ -{ return new name; } +{ return new name; } #define _DEFAULT_CONVERTERS(name) \ wxObject* wxVariantOfPtrToObjectConverter##name ( const wxAny &data ) \ @@ -258,28 +258,28 @@ template void wxStringWriteValue( wxString &s, const T &data); template -void wxToStringConverter( const wxAny &v, wxString &s ) +void wxToStringConverter( const wxAny &v, wxString &s ) { wxStringWriteValue(s, v.As()); } template -void wxFromStringConverter( const wxString &s, wxAny &v) +void wxFromStringConverter( const wxString &s, wxAny &v) { T d; wxStringReadValue(s, d); v = wxAny(d); } // -------------------------------------------------------------------------- // Collection Support // -------------------------------------------------------------------------- -template void wxListCollectionToAnyList( +template void wxListCollectionToAnyList( const collection_t& coll, wxAnyList &value ) { - for ( iter current = coll.GetFirst(); current; + for ( iter current = coll.GetFirst(); current; current = current->GetNext() ) { value.Append( new wxAny(current->GetData()) ); } } -template void wxArrayCollectionToVariantArray( +template void wxArrayCollectionToVariantArray( const collection_t& coll, wxAnyList &value ) { for( size_t i = 0; i < coll.GetCount(); i++ ) diff --git a/include/wx/xtiprop.h b/include/wx/xtiprop.h index 8c18e2a35a..d0d20039ac 100644 --- a/include/wx/xtiprop.h +++ b/include/wx/xtiprop.h @@ -159,47 +159,47 @@ public: \ class WXDLLIMPEXP_BASE wxPropertyAccessor { public: - wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter, + wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter, wxPropertyCollectionAdder *adder, wxPropertyCollectionGetter *collectionGetter ) - { m_setter = setter; m_getter = getter; m_adder = adder; + { m_setter = setter; m_getter = getter; m_adder = adder; m_collectionGetter = collectionGetter; } virtual ~wxPropertyAccessor() {} // Setting a simple property (non-collection) virtual void SetProperty(wxObject *object, const wxAny &value) const - { - if ( m_setter ) - m_setter->Set( object, value ); - else - wxLogError( wxGetTranslation("SetProperty called w/o valid setter") ); + { + if ( m_setter ) + m_setter->Set( object, value ); + else + wxLogError( wxGetTranslation("SetProperty called w/o valid setter") ); } // Getting a simple property (non-collection) virtual void GetProperty(const wxObject *object, wxAny &result) const - { - if ( m_getter ) - m_getter->Get( object, result ); - else - wxLogError( wxGetTranslation("GetProperty called w/o valid getter") ); + { + if ( m_getter ) + m_getter->Get( object, result ); + else + wxLogError( wxGetTranslation("GetProperty called w/o valid getter") ); } // Adding an element to a collection property virtual void AddToPropertyCollection(wxObject *object, const wxAny &value) const - { - if ( m_adder ) - m_adder->Add( object, value ); - else - wxLogError( wxGetTranslation("AddToPropertyCollection called w/o valid adder") ); + { + if ( m_adder ) + m_adder->Add( object, value ); + else + wxLogError( wxGetTranslation("AddToPropertyCollection called w/o valid adder") ); } // Getting a collection property virtual void GetPropertyCollection( const wxObject *obj, wxAnyList &result) const - { - if ( m_collectionGetter ) - m_collectionGetter->Get( obj, result); - else - wxLogError( wxGetTranslation("GetPropertyCollection called w/o valid collection getter") ); + { + if ( m_collectionGetter ) + m_collectionGetter->Get( obj, result); + else + wxLogError( wxGetTranslation("GetPropertyCollection called w/o valid collection getter") ); } virtual bool HasSetter() const { return m_setter != NULL; } @@ -249,17 +249,17 @@ public: virtual void GetProperty(const wxObject *object, wxAny &value) const; // Adding an element to a collection property - virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), + virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxAny &WXUNUSED(value)) const - { - wxLogError( wxGetTranslation("AddToPropertyCollection called on a generic accessor") ); + { + wxLogError( wxGetTranslation("AddToPropertyCollection called on a generic accessor") ); } // Getting a collection property - virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), + virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxAnyList &WXUNUSED(result)) const - { - wxLogError ( wxGetTranslation("GetPropertyCollection called on a generic accessor") ); + { + wxLogError ( wxGetTranslation("GetPropertyCollection called on a generic accessor") ); } private: @@ -271,7 +271,7 @@ private: }; typedef long wxPropertyInfoFlags; -enum +enum { // will be removed in future releases wxPROP_DEPRECATED = 0x00000001, @@ -279,11 +279,11 @@ enum // object graph property, will be streamed with priority (after constructor properties) wxPROP_OBJECT_GRAPH = 0x00000002, - // this will only be streamed out and in as enum/set, the internal representation + // this will only be streamed out and in as enum/set, the internal representation // is still a long wxPROP_ENUM_STORE_LONG = 0x00000004, - // don't stream out this property, needed eg to avoid streaming out children + // don't stream out this property, needed eg to avoid streaming out children // that are always created by their parents wxPROP_DONT_STREAM = 0x00000008 }; @@ -442,7 +442,7 @@ private: // stl is giving problems when forwarding declarations, therefore we define it as a subclass -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMapBase, +WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMapBase, class WXDLLIMPEXP_BASE ); class WXDLLIMPEXP_BASE wxPropertyInfoMap : public wxPropertyInfoMapBase { diff --git a/include/wx/xtistrm.h b/include/wx/xtistrm.h index 0621ead1ea..9c9bef5372 100644 --- a/include/wx/xtistrm.h +++ b/include/wx/xtistrm.h @@ -54,58 +54,58 @@ public: virtual ~wxObjectWriterCallback() {} // will be called before an object is written, may veto by returning false - virtual bool BeforeWriteObject( wxObjectWriter *WXUNUSED(writer), - const wxObject *WXUNUSED(object), - const wxClassInfo *WXUNUSED(classInfo), - const wxStringToAnyHashMap &WXUNUSED(metadata)) + virtual bool BeforeWriteObject( wxObjectWriter *WXUNUSED(writer), + const wxObject *WXUNUSED(object), + const wxClassInfo *WXUNUSED(classInfo), + const wxStringToAnyHashMap &WXUNUSED(metadata)) { return true; } - // will be called after this object has been written, may be + // will be called after this object has been written, may be // needed for adjusting stacks - virtual void AfterWriteObject( wxObjectWriter *WXUNUSED(writer), - const wxObject *WXUNUSED(object), - const wxClassInfo *WXUNUSED(classInfo) ) + virtual void AfterWriteObject( wxObjectWriter *WXUNUSED(writer), + const wxObject *WXUNUSED(object), + const wxClassInfo *WXUNUSED(classInfo) ) {} - // will be called before a property gets written, may change the value, - // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord ) + // will be called before a property gets written, may change the value, + // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord ) // or veto writing that property at all by returning false - virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer), - const wxObject *WXUNUSED(object), - const wxPropertyInfo *WXUNUSED(propInfo), - const wxAny &WXUNUSED(value) ) + virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer), + const wxObject *WXUNUSED(object), + const wxPropertyInfo *WXUNUSED(propInfo), + const wxAny &WXUNUSED(value) ) { return true; } - // will be called before a property gets written, may change the value, - // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord ) + // will be called before a property gets written, may change the value, + // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord ) // or veto writing that property at all by returning false - virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer), - const wxObject *WXUNUSED(object), - const wxPropertyInfo *WXUNUSED(propInfo), - const wxAnyList &WXUNUSED(value) ) + virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer), + const wxObject *WXUNUSED(object), + const wxPropertyInfo *WXUNUSED(propInfo), + const wxAnyList &WXUNUSED(value) ) { return true; } - // will be called after a property has been written out, may be needed + // will be called after a property has been written out, may be needed // for adjusting stacks - virtual void AfterWriteProperty( wxObjectWriter *WXUNUSED(writer), - const wxPropertyInfo *WXUNUSED(propInfo) ) + virtual void AfterWriteProperty( wxObjectWriter *WXUNUSED(writer), + const wxPropertyInfo *WXUNUSED(propInfo) ) {} // will be called before this delegate gets written - virtual bool BeforeWriteDelegate( wxObjectWriter *WXUNUSED(writer), - const wxObject *WXUNUSED(object), - const wxClassInfo* WXUNUSED(classInfo), + virtual bool BeforeWriteDelegate( wxObjectWriter *WXUNUSED(writer), + const wxObject *WXUNUSED(object), + const wxClassInfo* WXUNUSED(classInfo), const wxPropertyInfo *WXUNUSED(propInfo), - const wxObject *&WXUNUSED(eventSink), - const wxHandlerInfo* &WXUNUSED(handlerInfo) ) + const wxObject *&WXUNUSED(eventSink), + const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { return true; } - virtual void AfterWriteDelegate( wxObjectWriter *WXUNUSED(writer), - const wxObject *WXUNUSED(object), - const wxClassInfo* WXUNUSED(classInfo), + virtual void AfterWriteDelegate( wxObjectWriter *WXUNUSED(writer), + const wxObject *WXUNUSED(object), + const wxClassInfo* WXUNUSED(classInfo), const wxPropertyInfo *WXUNUSED(propInfo), - const wxObject *&WXUNUSED(eventSink), - const wxHandlerInfo* &WXUNUSED(handlerInfo) ) + const wxObject *&WXUNUSED(eventSink), + const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { } }; @@ -121,15 +121,15 @@ public: virtual ~wxObjectWriter(); // with this call you start writing out a new top-level object - void WriteObject(const wxObject *object, const wxClassInfo *classInfo, - wxObjectWriterCallback *writercallback, const wxString &name, + void WriteObject(const wxObject *object, const wxClassInfo *classInfo, + wxObjectWriterCallback *writercallback, const wxString &name, const wxStringToAnyHashMap &metadata); // Managing the object identity table a.k.a context // - // these methods make sure that no object gets written twice, + // these methods make sure that no object gets written twice, // because sometimes multiple calls to the WriteObject will be - // made without wanting to have duplicate objects written, the + // made without wanting to have duplicate objects written, the // object identity table will be reset manually virtual void ClearObjectContext(); @@ -151,12 +151,12 @@ public: virtual void DoEndWriteTopLevelEntry( const wxString &name ) = 0; // start of writing an object having the passed in ID - virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, + virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID, const wxStringToAnyHashMap &metadata ) = 0; - // end of writing an toplevel object name param is used for unique + // end of writing an toplevel object name param is used for unique // identification within the container - virtual void DoEndWriteObject(const wxObject *object, + virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ) = 0; // writes a simple property in the stream format @@ -177,12 +177,12 @@ public: virtual void DoWriteNullObject() = 0; // writes a delegate in the stream format - virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo, - const wxPropertyInfo *propInfo, const wxObject *eventSink, + virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo, + const wxPropertyInfo *propInfo, const wxObject *eventSink, int sinkObjectID, const wxClassInfo* eventSinkClassInfo, const wxHandlerInfo* handlerIndo ) = 0; - void WriteObject(const wxObject *object, const wxClassInfo *classInfo, + void WriteObject(const wxObject *object, const wxClassInfo *classInfo, wxObjectWriterCallback *writercallback, bool isEmbedded, const wxStringToAnyHashMap &metadata ); protected: @@ -191,17 +191,17 @@ protected: struct wxObjectWriterInternalPropertiesData; - void WriteAllProperties( const wxObject * obj, const wxClassInfo* ci, - wxObjectWriterCallback *writercallback, + void WriteAllProperties( const wxObject * obj, const wxClassInfo* ci, + wxObjectWriterCallback *writercallback, wxObjectWriterInternalPropertiesData * data ); - void WriteOneProperty( const wxObject *obj, const wxClassInfo* ci, + void WriteOneProperty( const wxObject *obj, const wxClassInfo* ci, const wxPropertyInfo* pi, wxObjectWriterCallback *writercallback, wxObjectWriterInternalPropertiesData *data ); void FindConnectEntry(const wxEvtHandler * evSource, - const wxEventSourceTypeInfo* dti, const wxObject* &sink, + const wxEventSourceTypeInfo* dti, const wxObject* &sink, const wxHandlerInfo *&handler); }; @@ -213,8 +213,8 @@ Streaming callbacks for depersisting XML to code, or running objects class WXDLLIMPEXP_BASE wxObjectReaderCallback; /* -wxObjectReader handles streaming in a class from a arbitrary format. -While walking through it issues calls out to interfaces to readercallback +wxObjectReader handles streaming in a class from a arbitrary format. +While walking through it issues calls out to interfaces to readercallback the guts from the underlying storage format. */ @@ -252,7 +252,7 @@ public: virtual ~wxObjectReaderCallback() {} // allocate the new object on the heap, that object will have the passed in ID - virtual void AllocateObject(int objectID, wxClassInfo *classInfo, + virtual void AllocateObject(int objectID, wxClassInfo *classInfo, wxStringToAnyHashMap &metadata) = 0; // initialize the already allocated object having the ID objectID with the Create method @@ -267,9 +267,9 @@ public: const wxClassInfo **objectClassInfos, wxStringToAnyHashMap &metadata) = 0; - // construct the new object on the heap, that object will have the passed in ID + // construct the new object on the heap, that object will have the passed in ID // (for objects that don't support allocate-create type of creation) - // creation parameters which are objects are having their Ids passed in + // creation parameters which are objects are having their Ids passed in // objectIDValues having objectId <> wxInvalidObjectID virtual void ConstructObject(int objectID, @@ -280,8 +280,8 @@ public: const wxClassInfo **objectClassInfos, wxStringToAnyHashMap &metadata) = 0; - // destroy the heap-allocated object having the ID objectID, this may be used - // if an object is embedded in another object and set via value semantics, + // destroy the heap-allocated object having the ID objectID, this may be used + // if an object is embedded in another object and set via value semantics, // so the intermediate object can be destroyed after safely virtual void DestroyObject(int objectID, wxClassInfo *classInfo) = 0; @@ -339,8 +339,8 @@ public: virtual void AllocateObject(int objectID, wxClassInfo *classInfo, wxStringToAnyHashMap &metadata); - // initialize the already allocated object having the ID objectID with - // the Create method creation parameters which are objects are having + // initialize the already allocated object having the ID objectID with + // the Create method creation parameters which are objects are having // their Ids passed in objectIDValues having objectId <> wxInvalidObjectID virtual void CreateObject(int objectID, @@ -352,9 +352,9 @@ public: wxStringToAnyHashMap &metadata ); - // construct the new object on the heap, that object will have the - // passed in ID (for objects that don't support allocate-create type of - // creation) creation parameters which are objects are having their Ids + // construct the new object on the heap, that object will have the + // passed in ID (for objects that don't support allocate-create type of + // creation) creation parameters which are objects are having their Ids // passed in objectIDValues having objectId <> wxInvalidObjectID virtual void ConstructObject(int objectID, @@ -365,8 +365,8 @@ public: const wxClassInfo **objectClassInfos, wxStringToAnyHashMap &metadata); - // destroy the heap-allocated object having the ID objectID, this may be - // used if an object is embedded in another object and set via value semantics, + // destroy the heap-allocated object having the ID objectID, this may be + // used if an object is embedded in another object and set via value semantics, // so the intermediate object can be destroyed after safely virtual void DestroyObject(int objectID, wxClassInfo *classInfo); diff --git a/include/wx/xtitypes.h b/include/wx/xtitypes.h index f8d7165643..47ee22b17c 100644 --- a/include/wx/xtitypes.h +++ b/include/wx/xtitypes.h @@ -126,7 +126,7 @@ private: // // wxIMPLEMENT_SET_STREAMING( wxCoupe, wxFlavor ) // -// implementation note: no partial specialization for streaming, but a delegation +// implementation note: no partial specialization for streaming, but a delegation // to a different class // // ---------------------------------------------------------------------------- @@ -318,7 +318,7 @@ public: wxTypeInfo(wxTypeKind kind, wxVariant2StringFnc to, wxString2VariantFnc from, const char *name): - m_toString(to), m_fromString(from), m_kind(kind), + m_toString(to), m_fromString(from), m_kind(kind), m_name(wxString::FromAscii(name)) { Register(); @@ -350,20 +350,20 @@ public: // convert a wxAny holding data of this type into a string void ConvertToString( const wxAny& data, wxString &result ) const - { - if ( m_toString ) - (*m_toString)( data, result ); - else - wxLogError( wxGetTranslation(wxT("String conversions not supported")) ); + { + if ( m_toString ) + (*m_toString)( data, result ); + else + wxLogError( wxGetTranslation(wxT("String conversions not supported")) ); } // convert a string into a wxAny holding the corresponding data in this type void ConvertFromString( const wxString& data, wxAny &result ) const - { - if( m_fromString ) - (*m_fromString)( data, result ); - else - wxLogError( wxGetTranslation(wxT("String conversions not supported")) ); + { + if( m_fromString ) + (*m_fromString)( data, result ); + else + wxLogError( wxGetTranslation(wxT("String conversions not supported")) ); } // statics: @@ -387,8 +387,8 @@ private: class WXDLLIMPEXP_BASE wxBuiltInTypeInfo : public wxTypeInfo { public: - wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to = NULL, - wxString2VariantFnc from = NULL, + wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to = NULL, + wxString2VariantFnc from = NULL, const wxString &name = wxEmptyString ) : wxTypeInfo( kind, to, from, name ) { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); } @@ -397,7 +397,7 @@ public: class WXDLLIMPEXP_BASE wxCustomTypeInfo : public wxTypeInfo { public: - wxCustomTypeInfo( const wxString &name, wxVariant2StringFnc to, + wxCustomTypeInfo( const wxString &name, wxVariant2StringFnc to, wxString2VariantFnc from ) : wxTypeInfo( wxT_CUSTOM, to, from, name ) {} @@ -413,30 +413,30 @@ public: wxString2VariantFnc from, converterToLong_t toLong, converterFromLong_t fromLong, const wxString &name ) : wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong ) - { + { wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET, - wxT("Illegal Kind for Enum Type")); - m_enumInfo = enumInfo; + wxT("Illegal Kind for Enum Type")); + m_enumInfo = enumInfo; } const wxEnumData* GetEnumData() const { return m_enumInfo; } // convert a wxAny holding data of this type into a long void ConvertToLong( const wxAny& data, long &result ) const - { - if( m_toLong ) - (*m_toLong)( data, result ); - else - wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ); + { + if( m_toLong ) + (*m_toLong)( data, result ); + else + wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ); } // convert a long into a wxAny holding the corresponding data in this type void ConvertFromLong( long data, wxAny &result ) const - { - if( m_fromLong ) - (*m_fromLong)( data, result ); - else - wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ); + { + if( m_fromLong ) + (*m_fromLong)( data, result ); + else + wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ); } private: @@ -449,8 +449,8 @@ private: class WXDLLIMPEXP_BASE wxClassTypeInfo : public wxTypeInfo { public: - wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, - wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, + wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, + wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, const wxString &name = wxEmptyString); const wxClassInfo *GetClassInfo() const { return m_classInfo; } @@ -471,7 +471,7 @@ public: { if ( m_elementType == NULL ) m_elementType = wxTypeInfo::FindType( m_elementTypeName ); - return m_elementType; + return m_elementType; } private: @@ -482,10 +482,10 @@ private: class WXDLLIMPEXP_BASE wxEventSourceTypeInfo : public wxTypeInfo { public: - wxEventSourceTypeInfo( int eventType, wxClassInfo* eventClass, - wxVariant2StringFnc to = NULL, + wxEventSourceTypeInfo( int eventType, wxClassInfo* eventClass, + wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL ); - wxEventSourceTypeInfo( int eventType, int lastEventType, wxClassInfo* eventClass, + wxEventSourceTypeInfo( int eventType, int lastEventType, wxClassInfo* eventClass, wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL ); int GetEventType() const { return m_eventType; } @@ -498,10 +498,10 @@ private: int m_lastEventType; }; -template const wxTypeInfo* wxGetTypeInfo( T * ) +template const wxTypeInfo* wxGetTypeInfo( T * ) { return wxTypeInfo::FindType(typeid(T).name()); } -// this macro is for usage with custom, non-object derived classes and structs, +// this macro is for usage with custom, non-object derived classes and structs, // wxPoint is such a custom type #if wxUSE_FUNC_TEMPLATE_POINTER @@ -521,9 +521,9 @@ template const wxTypeInfo* wxGetTypeInfo( T * ) wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name(), \ NULL, NULL, typeid(collection).name() ); -// sometimes a compiler invents specializations that are nowhere called, -// use this macro to satisfy the refs, currently we don't have to play -// tricks, but if we will have to according to the compiler, we will use +// sometimes a compiler invents specializations that are nowhere called, +// use this macro to satisfy the refs, currently we don't have to play +// tricks, but if we will have to according to the compiler, we will use // that macro for that #define wxILLEGAL_TYPE_SPECIALIZATION( a ) diff --git a/include/wx/xtixml.h b/include/wx/xtixml.h index 100e0653e1..df91f2bbd7 100644 --- a/include/wx/xtixml.h +++ b/include/wx/xtixml.h @@ -53,12 +53,12 @@ public: virtual void DoEndWriteTopLevelEntry( const wxString &name ); // start of writing an object having the passed in ID - virtual void DoBeginWriteObject(const wxObject *object, + virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID, const wxStringToAnyHashMap &metadata ); - // end of writing an toplevel object name param is used for unique + // end of writing an toplevel object name param is used for unique // identification within the container - virtual void DoEndWriteObject(const wxObject *object, + virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ); // writes a simple property in the stream format @@ -80,9 +80,9 @@ public: virtual void DoWriteNullObject(); // writes a delegate in the stream format - virtual void DoWriteDelegate( const wxObject *object, + virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo, const wxPropertyInfo *propInfo, - const wxObject *eventSink, int sinkObjectID, + const wxObject *eventSink, int sinkObjectID, const wxClassInfo* eventSinkClassInfo, const wxHandlerInfo* handlerIndo ); private: diff --git a/interface/wx/aboutdlg.h b/interface/wx/aboutdlg.h index 41719ec269..cd43d1bbdc 100644 --- a/interface/wx/aboutdlg.h +++ b/interface/wx/aboutdlg.h @@ -28,7 +28,7 @@ don't support URLs, licence text nor custom icons in the about dialog and if either of those is used, wxAboutBox() will automatically use the generic version so you should avoid specifying these fields to achieve more native look and feel. - + Example of usage: @code void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) @@ -170,7 +170,7 @@ public: Returns the icon set by SetIcon(). */ wxIcon GetIcon() const; - + /** Set the icon to be shown in the dialog. By default the icon of the main frame will be shown if the native about dialog supports custom icons. If it doesn't @@ -241,7 +241,7 @@ public: @see SetVersion() */ const wxString& GetVersion() const; - + /** Return the long version string if set. @@ -263,7 +263,7 @@ public: Returns the description of the website URL set for the dialog. */ const wxString& GetWebSiteDescription() const; - + /** Set the web site for the program and its description (which defaults to @a url itself if empty). @@ -275,7 +275,7 @@ public: void SetWebSite(const wxString& url, const wxString& desc = wxEmptyString); - + /** Returns @true if developers have been set in the dialog info. */ @@ -316,7 +316,7 @@ public: */ const wxArrayString& GetTranslators() const; - + }; diff --git a/interface/wx/affinematrix2dbase.h b/interface/wx/affinematrix2dbase.h index e7d0a6df11..7b95669808 100644 --- a/interface/wx/affinematrix2dbase.h +++ b/interface/wx/affinematrix2dbase.h @@ -36,7 +36,7 @@ struct wxMatrix2D /** @class wxAffineMatrix2DBase - + A 2x3 matrix representing an affine 2D transformation. This is an abstract base class implemented by wxAffineMatrix2D only so far, @@ -160,7 +160,7 @@ public: @param cRadians Rotation angle in radians, clockwise. - */ + */ virtual void Rotate(wxDouble cRadians) = 0; /** diff --git a/interface/wx/animate.h b/interface/wx/animate.h index d8d5e13edb..45e5e88adb 100644 --- a/interface/wx/animate.h +++ b/interface/wx/animate.h @@ -206,7 +206,7 @@ public: Default ctor. */ wxAnimation(); - + /** Copy ctor. */ diff --git a/interface/wx/anybutton.h b/interface/wx/anybutton.h index 5887f8ffd6..c993b062e2 100644 --- a/interface/wx/anybutton.h +++ b/interface/wx/anybutton.h @@ -91,7 +91,7 @@ public: */ wxBitmap GetBitmapPressed() const; - + /** Sets the bitmap to display in the button. @@ -177,7 +177,7 @@ public: previous versions) */ void SetBitmapPressed(const wxBitmap& bitmap); - + /** Get the margins between the bitmap and the text of the button. diff --git a/interface/wx/app.h b/interface/wx/app.h index fcaf21111a..0f9a0f344c 100644 --- a/interface/wx/app.h +++ b/interface/wx/app.h @@ -1063,7 +1063,7 @@ public: is specified in the @c Info.plist file. @onlyfor{wxosx} - + @since 3.0.1 */ virtual bool OSXIsGUIApplication(); diff --git a/interface/wx/artprov.h b/interface/wx/artprov.h index d0581d9913..e8c848452f 100644 --- a/interface/wx/artprov.h +++ b/interface/wx/artprov.h @@ -29,64 +29,64 @@ wxArtClient wxART_LIST; wxArtClient wxART_OTHER; -wxArtID wxART_ADD_BOOKMARK; -wxArtID wxART_DEL_BOOKMARK; -wxArtID wxART_HELP_SIDE_PANEL; -wxArtID wxART_HELP_SETTINGS; -wxArtID wxART_HELP_BOOK; -wxArtID wxART_HELP_FOLDER; -wxArtID wxART_HELP_PAGE; -wxArtID wxART_GO_BACK; -wxArtID wxART_GO_FORWARD; -wxArtID wxART_GO_UP; -wxArtID wxART_GO_DOWN; -wxArtID wxART_GO_TO_PARENT; -wxArtID wxART_GO_HOME; -wxArtID wxART_GOTO_FIRST; -wxArtID wxART_GOTO_LAST; -wxArtID wxART_FILE_OPEN; -wxArtID wxART_FILE_SAVE; -wxArtID wxART_FILE_SAVE_AS; -wxArtID wxART_PRINT; -wxArtID wxART_HELP; -wxArtID wxART_TIP; -wxArtID wxART_REPORT_VIEW; -wxArtID wxART_LIST_VIEW; -wxArtID wxART_NEW_DIR; -wxArtID wxART_HARDDISK; -wxArtID wxART_FLOPPY; -wxArtID wxART_CDROM; -wxArtID wxART_REMOVABLE; -wxArtID wxART_FOLDER; -wxArtID wxART_FOLDER_OPEN; -wxArtID wxART_GO_DIR_UP; -wxArtID wxART_EXECUTABLE_FILE; -wxArtID wxART_NORMAL_FILE; -wxArtID wxART_TICK_MARK; -wxArtID wxART_CROSS_MARK; -wxArtID wxART_ERROR; -wxArtID wxART_QUESTION; -wxArtID wxART_WARNING; -wxArtID wxART_INFORMATION; -wxArtID wxART_MISSING_IMAGE; +wxArtID wxART_ADD_BOOKMARK; +wxArtID wxART_DEL_BOOKMARK; +wxArtID wxART_HELP_SIDE_PANEL; +wxArtID wxART_HELP_SETTINGS; +wxArtID wxART_HELP_BOOK; +wxArtID wxART_HELP_FOLDER; +wxArtID wxART_HELP_PAGE; +wxArtID wxART_GO_BACK; +wxArtID wxART_GO_FORWARD; +wxArtID wxART_GO_UP; +wxArtID wxART_GO_DOWN; +wxArtID wxART_GO_TO_PARENT; +wxArtID wxART_GO_HOME; +wxArtID wxART_GOTO_FIRST; +wxArtID wxART_GOTO_LAST; +wxArtID wxART_FILE_OPEN; +wxArtID wxART_FILE_SAVE; +wxArtID wxART_FILE_SAVE_AS; +wxArtID wxART_PRINT; +wxArtID wxART_HELP; +wxArtID wxART_TIP; +wxArtID wxART_REPORT_VIEW; +wxArtID wxART_LIST_VIEW; +wxArtID wxART_NEW_DIR; +wxArtID wxART_HARDDISK; +wxArtID wxART_FLOPPY; +wxArtID wxART_CDROM; +wxArtID wxART_REMOVABLE; +wxArtID wxART_FOLDER; +wxArtID wxART_FOLDER_OPEN; +wxArtID wxART_GO_DIR_UP; +wxArtID wxART_EXECUTABLE_FILE; +wxArtID wxART_NORMAL_FILE; +wxArtID wxART_TICK_MARK; +wxArtID wxART_CROSS_MARK; +wxArtID wxART_ERROR; +wxArtID wxART_QUESTION; +wxArtID wxART_WARNING; +wxArtID wxART_INFORMATION; +wxArtID wxART_MISSING_IMAGE; -wxArtID wxART_COPY; -wxArtID wxART_CUT; -wxArtID wxART_PASTE; -wxArtID wxART_DELETE; -wxArtID wxART_NEW; +wxArtID wxART_COPY; +wxArtID wxART_CUT; +wxArtID wxART_PASTE; +wxArtID wxART_DELETE; +wxArtID wxART_NEW; -wxArtID wxART_UNDO; -wxArtID wxART_REDO; +wxArtID wxART_UNDO; +wxArtID wxART_REDO; -wxArtID wxART_PLUS; -wxArtID wxART_MINUS; +wxArtID wxART_PLUS; +wxArtID wxART_MINUS; -wxArtID wxART_CLOSE; -wxArtID wxART_QUIT; +wxArtID wxART_CLOSE; +wxArtID wxART_QUIT; -wxArtID wxART_FIND; -wxArtID wxART_FIND_AND_REPLACE; +wxArtID wxART_FIND; +wxArtID wxART_FIND_AND_REPLACE; wxArtID wxART_FULL_SCREEN; wxArtID wxART_EDIT; @@ -214,7 +214,7 @@ wxArtID wxART_EDIT; For a list of the GTK+ stock items please refer to the GTK+ documentation page. - It is also possible to load icons from the current icon theme by specifying their name + It is also possible to load icons from the current icon theme by specifying their name (without extension and directory components). Icon themes recognized by GTK+ follow the freedesktop.org Icon Themes specification. diff --git a/interface/wx/aui/auibar.h b/interface/wx/aui/auibar.h index ed5125e04e..899b956ff2 100644 --- a/interface/wx/aui/auibar.h +++ b/interface/wx/aui/auibar.h @@ -179,11 +179,11 @@ public: */ int GetToolId() const; - + void SetDropDownClicked(bool c); void SetClickPoint(const wxPoint& p); void SetItemRect(const wxRect& r); - void SetToolId(int toolId); + void SetToolId(int toolId); }; wxEventType wxEVT_AUITOOLBAR_TOOL_DROPDOWN; diff --git a/interface/wx/aui/framemanager.h b/interface/wx/aui/framemanager.h index 9daa9d888a..e39c50e1ab 100644 --- a/interface/wx/aui/framemanager.h +++ b/interface/wx/aui/framemanager.h @@ -333,12 +333,12 @@ public: /** LoadPaneInfo() is similar to LoadPerspective, with the exception that it only loads information about a single pane. - + This method writes the serialized data into the passed pane. Pointers to UI elements are not modified. @notice This operation also changes the name in the pane information! - + @sa LoadPerspective @sa SavePaneInfo(). @sa SavePerspective @@ -347,9 +347,9 @@ public: /** Loads a saved perspective. - + A perspective is the layout state of an AUI managed window. - + All currently existing panes that have an object in "perspective" with the same name ("equivalent") will receive the layout parameters of the object in "perspective". Existing panes that do not have an equivalent in "perspective" remain @@ -358,7 +358,7 @@ public: @param perspective Serialized layout information of a perspective (excl. pointers to UI elements). @param update If update is @true, wxAuiManager::Update() is automatically invoked, thus realizing the specified perspective on screen. - + @sa LoadPaneInfo @sa LoadPerspective @sa SavePerspective @@ -384,12 +384,12 @@ public: /** SavePaneInfo() is similar to SavePerspective, with the exception that it only saves information about a single pane. - + @param pane Pane whose layout parameters should be serialized. @return The serialized layout parameters of the pane are returned within the string. Information about the pointers to UI elements stored in the pane are not serialized. - + @sa LoadPaneInfo @sa LoadPerspective @sa SavePerspective @@ -399,7 +399,7 @@ public: /** Saves the entire user interface layout into an encoded wxString, which can then be stored by the application (probably using wxConfig). - + @sa LoadPerspective @sa LoadPaneInfo @sa SavePaneInfo @@ -953,7 +953,7 @@ public: */ wxAuiPaneInfo& operator=(const wxAuiPaneInfo& c); - + /// name of the pane wxString name; @@ -961,7 +961,7 @@ public: wxString caption; /// icon of the pane, may be invalid - wxBitmap icon; + wxBitmap icon; /// window that is in this pane wxWindow* window; @@ -1003,12 +1003,12 @@ public: int dock_proportion; /// buttons on the pane - wxAuiPaneButtonArray buttons; + wxAuiPaneButtonArray buttons; /// current rectangle (populated by wxAUI) wxRect rect; - bool IsValid() const; + bool IsValid() const; }; @@ -1137,7 +1137,7 @@ public: bool IsOk() const; bool IsHorizontal() const; bool IsVertical() const; - + wxAuiPaneInfoPtrArray panes; // array of panes wxRect rect; // current rectangle int dock_direction; // dock direction (top, bottom, left, right, center) diff --git a/interface/wx/aui/tabmdi.h b/interface/wx/aui/tabmdi.h index 4092edcdfc..e12fa75133 100644 --- a/interface/wx/aui/tabmdi.h +++ b/interface/wx/aui/tabmdi.h @@ -108,7 +108,7 @@ public: wxWindowID winid, const wxString& name); virtual wxToolBar *GetToolBar() const; - + // no maximize etc virtual void Maximize(bool maximize = true); virtual void Restore(); diff --git a/interface/wx/base64.h b/interface/wx/base64.h index dc5abe4402..56b13864d1 100644 --- a/interface/wx/base64.h +++ b/interface/wx/base64.h @@ -13,7 +13,7 @@ /** @addtogroup group_funcmacro_misc */ //@{ -/** +/** Elements of this enum specify the possible behaviours of wxBase64Decode when an invalid character is encountered. */ diff --git a/interface/wx/bitmap.h b/interface/wx/bitmap.h index c20aa7725e..57ce3e3ff3 100644 --- a/interface/wx/bitmap.h +++ b/interface/wx/bitmap.h @@ -172,7 +172,7 @@ public: class (either wxNativePixelData for RGB bitmaps or wxAlphaPixelData for bitmaps with an additionally alpha channel). - Note that many wxBitmap functions take a @e type parameter, which is a + Note that many wxBitmap functions take a @e type parameter, which is a value of the ::wxBitmapType enumeration. The validity of those values depends however on the platform where your program is running and from the wxWidgets configuration. @@ -183,9 +183,9 @@ public: - wxX11 supports XPM files, XPM data, XBM data; In addition, wxBitmap can load and save all formats that wxImage can; see wxImage - for more info. Of course, you must have loaded the wxImage handlers + for more info. Of course, you must have loaded the wxImage handlers (see ::wxInitAllImageHandlers() and wxImage::AddHandler). - Note that all available wxBitmapHandlers for a given wxWidgets port are + Note that all available wxBitmapHandlers for a given wxWidgets port are automatically loaded at startup so you won't need to use wxBitmap::AddHandler. More on the difference between wxImage and wxBitmap: wxImage is just a @@ -386,12 +386,12 @@ public: @param handler A new bitmap format handler object. There is usually only one instance of a given handler class in an application session. - + Note that unlike wxImage::AddHandler, there's no documented list of the wxBitmapHandlers available in wxWidgets. - This is because they are platform-specific and most important, they are + This is because they are platform-specific and most important, they are all automatically loaded at startup. - + If you want to be sure that wxBitmap can load a certain type of image, you'd better use wxImage::AddHandler. diff --git a/interface/wx/bmpbuttn.h b/interface/wx/bmpbuttn.h index 522b7f3408..be1657cabb 100644 --- a/interface/wx/bmpbuttn.h +++ b/interface/wx/bmpbuttn.h @@ -62,8 +62,8 @@ public: Button position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Button size. - If ::wxDefaultSize is specified then the button is sized appropriately + Button size. + If ::wxDefaultSize is specified then the button is sized appropriately for the bitmap. @param style Window style. See wxBitmapButton. diff --git a/interface/wx/button.h b/interface/wx/button.h index 6c2f9ac100..923415ae17 100644 --- a/interface/wx/button.h +++ b/interface/wx/button.h @@ -56,7 +56,7 @@ The position of the image inside the button be configured using SetBitmapPosition(). By default the image is on the left of the text. - Please also notice that GTK+ uses a global setting called @c gtk-button-images + Please also notice that GTK+ uses a global setting called @c gtk-button-images to determine if the images should be shown in the buttons at all. If it is off (which is the case in e.g. Gnome 2.28 by default), no images will be shown, consistently with the native behaviour. diff --git a/interface/wx/checkbox.h b/interface/wx/checkbox.h index 203928873c..c6a07ca246 100644 --- a/interface/wx/checkbox.h +++ b/interface/wx/checkbox.h @@ -91,10 +91,10 @@ public: @param label Text to be displayed next to the checkbox. @param pos - Checkbox position. + Checkbox position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Checkbox size. + Checkbox size. If ::wxDefaultSize is specified then a default size is chosen. @param style Window style. See wxCheckBox. diff --git a/interface/wx/checklst.h b/interface/wx/checklst.h index 315abbce3a..833aad5481 100644 --- a/interface/wx/checklst.h +++ b/interface/wx/checklst.h @@ -49,7 +49,7 @@ public: Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then the window is sized appropriately. @param n Number of strings with which to initialise the control. diff --git a/interface/wx/choice.h b/interface/wx/choice.h index dac038fb3a..fd0abd207d 100644 --- a/interface/wx/choice.h +++ b/interface/wx/choice.h @@ -51,7 +51,7 @@ public: Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then the choice is sized appropriately. @param n Number of strings with which to initialise the choice control. @@ -172,7 +172,7 @@ public: virtual void SetColumns(int n = 1); virtual bool IsSorted() const; - + virtual unsigned int GetCount() const ; virtual int GetSelection() const ; virtual void SetSelection(int n); diff --git a/interface/wx/choicebk.h b/interface/wx/choicebk.h index d96f9493a9..752a171042 100644 --- a/interface/wx/choicebk.h +++ b/interface/wx/choicebk.h @@ -88,7 +88,7 @@ public: long style = 0, const wxString& name = wxEmptyString); - + /** Returns the wxChoice associated with the control. */ diff --git a/interface/wx/clrpicker.h b/interface/wx/clrpicker.h index 90422e32e4..158457f3f7 100644 --- a/interface/wx/clrpicker.h +++ b/interface/wx/clrpicker.h @@ -57,7 +57,7 @@ class wxColourPickerCtrl : public wxPickerBase { public: wxColourPickerCtrl(); - + /** Initializes the object and calls Create() with all the parameters. */ diff --git a/interface/wx/colour.h b/interface/wx/colour.h index cd217d853a..a3d4ef7afa 100644 --- a/interface/wx/colour.h +++ b/interface/wx/colour.h @@ -86,7 +86,7 @@ public: A packed RGB value. */ wxColour(unsigned long colRGB); - + /** Copy constructor. */ @@ -194,8 +194,8 @@ public: string (third overload). When using third form, Set() accepts: colour names (those listed in - wxColourDatabase), the CSS-like @c "rgb(r,g,b)" or @c "rgba(r,g,b,a)" syntax - (case insensitive) and the HTML-like syntax: @c "#" followed by 6 hexadecimal + wxColourDatabase), the CSS-like @c "rgb(r,g,b)" or @c "rgba(r,g,b,a)" syntax + (case insensitive) and the HTML-like syntax: @c "#" followed by 6 hexadecimal digits for red, green, blue components. Returns @true if the conversion was successful, @false otherwise. @@ -233,7 +233,7 @@ public: @since 2.9.0 */ static void MakeMono(unsigned char* r, unsigned char* g, unsigned char* b, bool on); - + /** Create a disabled (dimmed) colour from (in/out) rgb parameters. @since 2.9.0 @@ -254,7 +254,7 @@ public: @since 2.9.0 */ static void MakeGrey(unsigned char* r, unsigned char* g, unsigned char* b); - + /** Create a grey colour from (in/out) rgb parameters using floating point arithmetic. Defaults to using the standard ITU-T BT.601 when converting to YUV, where every pixel equals @@ -269,7 +269,7 @@ public: @since 2.9.0 */ static unsigned char AlphaBlend(unsigned char fg, unsigned char bg, double alpha); - + /** ChangeLightness() is a utility function that simply darkens or lightens a color, based on the specified percentage diff --git a/interface/wx/combo.h b/interface/wx/combo.h index 443d9de1c4..7583ed3cb8 100644 --- a/interface/wx/combo.h +++ b/interface/wx/combo.h @@ -69,10 +69,10 @@ public: /** Implement to customize matching of value string to an item container entry. - + @param item String entered, usually by user or from SetValue() call. - + @param trueItem When item matches an entry, but the entry's string representation is not exactly the same (case mismatch, for example), then the @@ -130,7 +130,7 @@ public: Useful in conjunction with LazyCreate(). */ bool IsCreated() const; - + /** The derived class may implement this to return @true if it wants to delay call to Create() until the popup is shown for the first time. It @@ -386,7 +386,7 @@ public: Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then the window is sized appropriately. @param style Window style. See wxComboCtrl. @@ -450,7 +450,7 @@ public: */ void EnablePopupAnimation(bool enable = true); - + /** Returns true if given key combination should toggle the popup. */ diff --git a/interface/wx/combobox.h b/interface/wx/combobox.h index 5447243a4d..d6728a7efa 100644 --- a/interface/wx/combobox.h +++ b/interface/wx/combobox.h @@ -101,7 +101,7 @@ public: Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then the window is sized appropriately. @param n Number of strings with which to initialise the control. diff --git a/interface/wx/config.h b/interface/wx/config.h index 413bfa9b49..3b4fdc40c1 100644 --- a/interface/wx/config.h +++ b/interface/wx/config.h @@ -27,9 +27,9 @@ enum However, usually you don't even need to know the precise nature of the class you're working with but you would just use the wxConfigBase methods. This allows you to write the same code regardless of whether you're working - with the registry under Windows or text-based config files under Unix. - To make writing the portable code even easier, wxWidgets provides a typedef - wxConfig which is mapped onto the native wxConfigBase implementation on the + with the registry under Windows or text-based config files under Unix. + To make writing the portable code even easier, wxWidgets provides a typedef + wxConfig which is mapped onto the native wxConfigBase implementation on the given platform: i.e. wxRegConfig under Windows and wxFileConfig otherwise. See @ref overview_config for a description of all features of this class. @@ -253,7 +253,7 @@ enum @library{wxbase} @category{cfg} - + @see wxConfigPathChanger */ class wxConfigBase : public wxObject @@ -353,7 +353,7 @@ public: Set current path: if the first character is '/', it is the absolute path, otherwise it is a relative path. '..' is supported. If @a strPath doesn't exist, it is created. - + @see wxConfigPathChanger */ virtual void SetPath(const wxString& strPath) = 0; @@ -889,7 +889,7 @@ public: @class wxConfigPathChanger A handy little class which changes the current path in a wxConfig object and restores it in dtor. - Declaring a local variable of this type, it's possible to work in a specific directory + Declaring a local variable of this type, it's possible to work in a specific directory and ensure that the path is automatically restored when the function returns. For example: @@ -902,13 +902,13 @@ public: wxString str; if ( !config->Read("SomeString", &str) ) { wxLogError("Couldn't read SomeString!"); - return false; + return false; // NOTE: without wxConfigPathChanger it would be easy to forget to // set the old path back into the wxConfig object before this return! } - + // do something useful with SomeString... - + return true; // again: wxConfigPathChanger dtor will restore the original wxConfig path } @endcode @@ -923,21 +923,21 @@ public: /** Changes the path of the given wxConfigBase object so that the key @a strEntry is accessible (for read or write). - - In other words, the ctor uses wxConfigBase::SetPath() with everything which precedes the + + In other words, the ctor uses wxConfigBase::SetPath() with everything which precedes the last slash of @a strEntry, so that: @code wxConfigPathChanger(wxConfigBase::Get(), "/MyProgram/SomeKeyName"); - @endcode + @endcode has the same effect of: @code wxConfigPathChanger(wxConfigBase::Get(), "/MyProgram/"); - @endcode + @endcode */ wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry); /** - Restores the path selected, inside the wxConfig object passed to the ctor, to the path which was + Restores the path selected, inside the wxConfig object passed to the ctor, to the path which was selected when the wxConfigPathChanger ctor was called. */ ~wxConfigPathChanger(); @@ -949,9 +949,9 @@ public: const wxString& Name() const; /** - This method must be called if the original path inside the wxConfig object - (i.e. the current path at the moment of creation of this wxConfigPathChanger object) - could have been deleted, thus preventing wxConfigPathChanger from restoring the not + This method must be called if the original path inside the wxConfig object + (i.e. the current path at the moment of creation of this wxConfigPathChanger object) + could have been deleted, thus preventing wxConfigPathChanger from restoring the not existing (any more) path. If the original path doesn't exist any more, the path will be restored to diff --git a/interface/wx/control.h b/interface/wx/control.h index 34d8a388a8..04670c9e04 100644 --- a/interface/wx/control.h +++ b/interface/wx/control.h @@ -50,7 +50,7 @@ public: @param style Control style. For generic window styles, please see wxWindow. @param validator - Control validator. + Control validator. @param name Control name. */ @@ -64,7 +64,7 @@ public: Default constructor to allow 2-phase creation. */ wxControl(); - + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -332,7 +332,7 @@ public: public: // static functions - + /** Returns the given @a label string without mnemonics ("&" characters). */ @@ -340,7 +340,7 @@ public: // static functions /** Returns the given @a str string without mnemonics ("&" characters). - + @note This function is identical to GetLabelText() and is provided mostly for symmetry with EscapeMnemonics(). */ diff --git a/interface/wx/cshelp.h b/interface/wx/cshelp.h index e7f80d4c6b..0d5a55ab2d 100644 --- a/interface/wx/cshelp.h +++ b/interface/wx/cshelp.h @@ -257,8 +257,8 @@ public: Button position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Button size. - If ::wxDefaultSize is specified then the button is sized appropriately + Button size. + If ::wxDefaultSize is specified then the button is sized appropriately for the question mark bitmap. @param style Window style. diff --git a/interface/wx/cursor.h b/interface/wx/cursor.h index 56b5b7ad1a..12d95b1d0a 100644 --- a/interface/wx/cursor.h +++ b/interface/wx/cursor.h @@ -138,12 +138,12 @@ public: (to load a cursor from a .ico icon file) and @c wxBITMAP_TYPE_ANI (to load a cursor from a .ani icon file). - under MacOS, it defaults to @c wxBITMAP_TYPE_MACCURSOR_RESOURCE; - when specifying a string resource name, first the color cursors 'crsr' - and then the black/white cursors 'CURS' in the resource chain are scanned + when specifying a string resource name, first the color cursors 'crsr' + and then the black/white cursors 'CURS' in the resource chain are scanned through. Note that resource forks are deprecated on OS X so this is only available for legacy reasons and should not be used in new code. - - under GTK, it defaults to @c wxBITMAP_TYPE_XPM. + - under GTK, it defaults to @c wxBITMAP_TYPE_XPM. See the wxCursor(const wxImage& image) ctor for more info. - under X11, it defaults to @c wxBITMAP_TYPE_XPM. - under Motif, it defaults to @c wxBITMAP_TYPE_XBM. diff --git a/interface/wx/dataobj.h b/interface/wx/dataobj.h index b6afd34daf..9a2ea4fb54 100644 --- a/interface/wx/dataobj.h +++ b/interface/wx/dataobj.h @@ -791,7 +791,7 @@ public: @class wxHTMLDataObject wxHTMLDataObject is used for working with HTML-formatted text. - + @library{wxcore} @category{dnd} @@ -809,7 +809,7 @@ public: Returns the HTML string. */ virtual wxString GetHTML() const; - + /** Sets the HTML string. */ diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 0c82d35a45..1c9076a908 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -78,10 +78,10 @@ @endcode A potentially better way to avoid memory leaks is to use wxObjectDataPtr - + @code wxObjectDataPtr musicModel; - + wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, wxID_ANY ); musicModel = new MyMusicModel; m_musicCtrl->AssociateModel( musicModel.get() ); @@ -382,7 +382,7 @@ public: */ bool ValueChanged(const wxDataViewItem& item, unsigned int col); - + virtual bool IsListModel() const; virtual bool IsVirtualListModel() const; @@ -527,7 +527,7 @@ public: have other reason to use a virtual control. @see wxDataViewListModel for the API. - + @library{wxcore} @category{dvc} */ @@ -2064,7 +2064,7 @@ public: */ virtual bool Validate(wxVariant& value); - + virtual bool HasEditorCtrl() const; virtual wxWindow* CreateEditorCtrl(wxWindow * parent, wxRect labelRect, @@ -3284,7 +3284,7 @@ public: Returns true if item is a container. */ bool IsContainer( const wxDataViewItem& item ); - + /** Calls the same method from wxDataViewTreeStore but uses an index position in the image list instead of a wxIcon. diff --git a/interface/wx/datectrl.h b/interface/wx/datectrl.h index 01bd909925..72199583e7 100644 --- a/interface/wx/datectrl.h +++ b/interface/wx/datectrl.h @@ -87,7 +87,7 @@ public: Default constructor. */ wxDatePickerCtrl(); - + /** Initializes the object and calls Create() with all the parameters. */ diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index 53595c78be..68f8630713 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -325,7 +325,7 @@ public: Copy constructor. */ wxDateTime(const wxDateTime& date); - + /** Same as Set(). */ @@ -387,7 +387,7 @@ public: @a wxDateTime::Tm structure. */ wxDateTime& Set(const Tm& tm); - + /** Sets the date from the so-called Julian Day Number. diff --git a/interface/wx/dc.h b/interface/wx/dc.h index 7d7f289e28..84238b44df 100644 --- a/interface/wx/dc.h +++ b/interface/wx/dc.h @@ -550,7 +550,7 @@ public: void DrawRectangle(const wxRect& rect); /** - Draws the text rotated by @a angle degrees + Draws the text rotated by @a angle degrees (positive angles are counterclockwise; the full angle is 360 degrees). Notice that, as with DrawText(), the @a text can contain multiple lines @@ -980,10 +980,10 @@ public: int GetBackgroundMode() const; /** - Gets the current font. - - Notice that even although each device context object has some default font - after creation, this method would return a ::wxNullFont initially and only + Gets the current font. + + Notice that even although each device context object has some default font + after creation, this method would return a ::wxNullFont initially and only after calling SetFont() a valid font is returned. */ const wxFont& GetFont() const; @@ -1014,17 +1014,17 @@ public: /** @a mode may be one of @c wxPENSTYLE_SOLID and @c wxPENSTYLE_TRANSPARENT. - - This setting determines whether text will be drawn with a background + + This setting determines whether text will be drawn with a background colour or not. */ void SetBackgroundMode(int mode); /** - Sets the current font for the DC. + Sets the current font for the DC. - If the argument is ::wxNullFont (or another invalid font; see wxFont::IsOk), - the current font is selected out of the device context (leaving wxDC without + If the argument is ::wxNullFont (or another invalid font; see wxFont::IsOk), + the current font is selected out of the device context (leaving wxDC without any valid font), allowing the current font to be destroyed safely. @see wxFont @@ -1045,9 +1045,9 @@ public: void SetTextForeground(const wxColour& colour); /** - Sets the current layout direction for the device context. - - @param dir + Sets the current layout direction for the device context. + + @param dir May be either @c wxLayout_Default, @c wxLayout_LeftToRight or @c wxLayout_RightToLeft. @@ -1333,8 +1333,8 @@ public: /** Sets the current brush for the DC. - If the argument is ::wxNullBrush (or another invalid brush; see wxBrush::IsOk), - the current brush is selected out of the device context (leaving wxDC without + If the argument is ::wxNullBrush (or another invalid brush; see wxBrush::IsOk), + the current brush is selected out of the device context (leaving wxDC without any valid brush), allowing the current brush to be destroyed safely. @see wxBrush, wxMemoryDC (for the interpretation of colours when @@ -1343,10 +1343,10 @@ public: void SetBrush(const wxBrush& brush); /** - Sets the current pen for the DC. + Sets the current pen for the DC. - If the argument is ::wxNullPen (or another invalid pen; see wxPen::IsOk), - the current pen is selected out of the device context (leaving wxDC without any + If the argument is ::wxNullPen (or another invalid pen; see wxPen::IsOk), + the current pen is selected out of the device context (leaving wxDC without any valid pen), allowing the current pen to be destroyed safely. @see wxMemoryDC for the interpretation of colours when drawing into a @@ -1592,7 +1592,7 @@ public: //@} - + /** @name query capabilities */ @@ -1607,7 +1607,7 @@ public: Does the DC support calculating the size required to draw text? */ bool CanGetTextExtent() const; - + //@} /** @@ -1620,12 +1620,12 @@ public: wxGCDC then the return value will be the value returned from wxGraphicsContext::GetNativeContext. A value of NULL is returned if the DC does not have anything that fits the handle concept. - + @since 2.9.5 */ void* GetHandle() const; - + /** If supported by the platform and the type of DC, fetch the contents of the DC, or a subset of it, as a bitmap. */ diff --git a/interface/wx/dcbuffer.h b/interface/wx/dcbuffer.h index 9268e437aa..e29859802b 100644 --- a/interface/wx/dcbuffer.h +++ b/interface/wx/dcbuffer.h @@ -122,7 +122,7 @@ public: /** Blits the buffer to the dc, and detaches the dc from the buffer (so it can be effectively used once only). - + Usually only called in the destructor or by the destructor of derived classes if the BufferedDC must blit before the derived class (which may own the dc it's blitting to) is destroyed. diff --git a/interface/wx/dcgraph.h b/interface/wx/dcgraph.h index ed2d01a9c1..e12a49db61 100644 --- a/interface/wx/dcgraph.h +++ b/interface/wx/dcgraph.h @@ -60,7 +60,7 @@ public: wxGCDC(); virtual ~wxGCDC(); - + /** Retrieves associated wxGraphicsContext */ diff --git a/interface/wx/debugrpt.h b/interface/wx/debugrpt.h index c6849f9e1e..7af5267efc 100644 --- a/interface/wx/debugrpt.h +++ b/interface/wx/debugrpt.h @@ -221,8 +221,8 @@ public: is copied to a file in the debug report directory with the same name. Otherwise the file will be searched in the temporary directory returned by GetDirectory(). - - The argument @a description only exists to be displayed to the user in + + The argument @a description only exists to be displayed to the user in the report summary shown by wxDebugReportPreview. @see GetDirectory(), AddText() diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 2359cdcaab..3a07a81dab 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -536,7 +536,7 @@ enum wxBackgroundStyle with this style. */ wxBG_STYLE_PAINT, - + /* this style is deprecated and doesn't do anything, don't use */ wxBG_STYLE_COLOUR, @@ -907,7 +907,7 @@ enum wxKeyCode WXK_CONTROL_X, WXK_CONTROL_Y, WXK_CONTROL_Z, - + WXK_BACK = 8, //!< Backspace. WXK_TAB = 9, WXK_RETURN = 13, @@ -1034,7 +1034,7 @@ enum wxKeyCode WXK_WINDOWS_LEFT, WXK_WINDOWS_RIGHT, WXK_WINDOWS_MENU , - + /** This special key code was used to represent the key used for keyboard shortcuts. Under OS X, * this key maps to the 'Command' (aka logo or 'Apple') key, whereas on Linux/Windows/others * this is the Control key, with the new semantic of WXK_CONTROL, WXK_COMMAND is not needed anymore @@ -1095,11 +1095,11 @@ enum wxKeyModifier wxMOD_SHIFT = 0x0004, wxMOD_META = 0x0008, wxMOD_WIN = wxMOD_META, - + /** used to describe the true Ctrl Key under OS X, identic to @c wxMOD_CONTROL on other platforms */ wxMOD_RAW_CONTROL, - + /** deprecated, identic to @c wxMOD_CONTROL on all platforms */ wxMOD_CMD = wxMOD_CONTROL, wxMOD_ALL = 0xffff diff --git a/interface/wx/dir.h b/interface/wx/dir.h index 976f9a1a87..3fbb0fd083 100644 --- a/interface/wx/dir.h +++ b/interface/wx/dir.h @@ -233,7 +233,7 @@ public: would be unchanged and should include ::wxDIR_DIRS flag to recurse into subdirectories (both flags are included in the value by default). See ::wxDirFlags for the list of the possible flags. - + @return Returns the total number of files found while traversing the directory @a dirname (i.e. the number of entries appended to the @a files array). @@ -324,7 +324,7 @@ public: /** Creates a directory. - + This is just an alias for wxFileName::Mkdir(); refer to that function for more info. */ @@ -339,12 +339,12 @@ public: /** Removes a directory. - + This is just an alias for wxFileName::Rmdir(); refer to that function for more info. */ static bool Remove(const wxString &dir, int flags = 0); - + /** Enumerate all files and directories under the given directory. diff --git a/interface/wx/dirctrl.h b/interface/wx/dirctrl.h index dc43e1d6d1..69b4bb120b 100644 --- a/interface/wx/dirctrl.h +++ b/interface/wx/dirctrl.h @@ -52,7 +52,7 @@ enum @library{wxcore} @category{ctrl} @appearance{genericdirctrl} - + @beginEventEmissionTable @event{EVT_DIRCTRL_SELECTIONCHANGED(id, func)} Selected directory has changed. diff --git a/interface/wx/editlbox.h b/interface/wx/editlbox.h index 4152c63ea2..80462b24dc 100644 --- a/interface/wx/editlbox.h +++ b/interface/wx/editlbox.h @@ -58,7 +58,7 @@ public: Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then the window is sized appropriately. @param style Window style. See wxEditableListBox. diff --git a/interface/wx/event.h b/interface/wx/event.h index c198be2e6a..f0134f5d36 100644 --- a/interface/wx/event.h +++ b/interface/wx/event.h @@ -1867,7 +1867,7 @@ public: int GetPosition() const; void SetOrientation(int orient); - void SetPosition(int pos); + void SetPosition(int pos); }; @@ -3298,7 +3298,7 @@ class wxQueryNewPaletteEvent : public wxEvent { public: wxQueryNewPaletteEvent(wxWindowID winid = 0); - + void SetPaletteRealized(bool realized); bool GetPaletteRealized(); }; @@ -3653,9 +3653,9 @@ public: */ int GetPosition() const; - + void SetOrientation(int orient); - void SetPosition(int pos); + void SetPosition(int pos); }; @@ -4179,7 +4179,7 @@ public: /** Sets the flags for this event. - The @a flags can be a combination of the + The @a flags can be a combination of the wxNavigationKeyEvent::wxNavigationKeyEventFlags values. */ void SetFlags(long flags); @@ -4563,7 +4563,7 @@ public: wxRect GetRect() const; void SetRect(const wxRect& rect); - void SetPosition(const wxPoint& pos); + void SetPosition(const wxPoint& pos); }; @@ -4587,7 +4587,7 @@ public: @b Important : Sizers ( see @ref overview_sizer ) rely on size events to function correctly. Therefore, in a sizer-based layout, do not forget to call Skip on all size events you catch (and don't catch size events at all when you don't need to). - + @beginEventTable{wxSizeEvent} @event{EVT_SIZE(func)} Process a @c wxEVT_SIZE event. @@ -4844,7 +4844,7 @@ wxEventType wxNewEventType(); In the implementation file you'll need to use the wxBEGIN_EVENT_TABLE() and the wxEND_EVENT_TABLE() macros, plus some additional @c EVT_xxx macro to capture events. - + Note that this macro requires a final semicolon. @see @ref overview_events_eventtables diff --git a/interface/wx/evtloop.h b/interface/wx/evtloop.h index 87750b103d..74d0056232 100644 --- a/interface/wx/evtloop.h +++ b/interface/wx/evtloop.h @@ -324,7 +324,7 @@ public: @class wxGUIEventLoop A generic implementation of the GUI event loop. - + @library{wxbase} @category{appmanagement} */ diff --git a/interface/wx/fileconf.h b/interface/wx/fileconf.h index eff88ef6d2..8e71afb541 100644 --- a/interface/wx/fileconf.h +++ b/interface/wx/fileconf.h @@ -105,7 +105,7 @@ public: @see wxCHANGE_UMASK() */ void SetUmask(int mode); - + // implement inherited pure virtual functions virtual void SetPath(const wxString& strPath); virtual const wxString& GetPath() const; diff --git a/interface/wx/filedlg.h b/interface/wx/filedlg.h index 403d6c4d7d..890491d112 100644 --- a/interface/wx/filedlg.h +++ b/interface/wx/filedlg.h @@ -48,14 +48,14 @@ const char wxFileSelectorDefaultWildcardStr[]; return; //else: proceed asking to the user the new file to open } - - wxFileDialog + + wxFileDialog openFileDialog(this, _("Open XYZ file"), "", "", "XYZ files (*.xyz)|*.xyz", wxFD_OPEN|wxFD_FILE_MUST_EXIST); if (openFileDialog.ShowModal() == wxID_CANCEL) return; // the user changed idea... - + // proceed loading the file chosen by the user; // this can be done with e.g. wxWidgets input streams: wxFileInputStream input_stream(openFileDialog.GetPath()); @@ -64,22 +64,22 @@ const char wxFileSelectorDefaultWildcardStr[]; wxLogError("Cannot open file '%s'.", openFileDialog.GetPath()); return; } - + ... } @endcode - + The typical usage for the save file dialog is instead somewhat simpler: @code void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event)) { - wxFileDialog + wxFileDialog saveFileDialog(this, _("Save XYZ file"), "", "", "XYZ files (*.xyz)|*.xyz", wxFD_SAVE|wxFD_OVERWRITE_PROMPT); if (saveFileDialog.ShowModal() == wxID_CANCEL) return; // the user changed idea... - + // save the current contents in the file; // this can be done with e.g. wxWidgets output streams: wxFileOutputStream output_stream(saveFileDialog.GetPath()); @@ -88,7 +88,7 @@ const char wxFileSelectorDefaultWildcardStr[]; wxLogError("Cannot save current contents in file '%s'.", saveFileDialog.GetPath()); return; } - + ... } @endcode @@ -136,7 +136,7 @@ const char wxFileSelectorDefaultWildcardStr[]; @style{wxFD_MULTIPLE} For open dialog only: allows selecting multiple files. @style{wxFD_CHANGE_DIR} - Change the current working directory (when the dialog is dismissed) + Change the current working directory (when the dialog is dismissed) to the directory where the file(s) chosen by the user are. @style{wxFD_PREVIEW} Show the preview of the selected files (currently only supported by @@ -302,7 +302,7 @@ public: /** Sets the default filename. - + In wxGTK this will have little effect unless a default directory has previously been set. */ virtual void SetFilename(const wxString& setfilename); diff --git a/interface/wx/filepicker.h b/interface/wx/filepicker.h index 0856634770..d226838986 100644 --- a/interface/wx/filepicker.h +++ b/interface/wx/filepicker.h @@ -83,7 +83,7 @@ class wxFilePickerCtrl : public wxPickerBase { public: wxFilePickerCtrl(); - + /** Initializes the object and calls Create() with all the parameters. @@ -237,7 +237,7 @@ class wxDirPickerCtrl : public wxPickerBase { public: wxDirPickerCtrl(); - + /** Initializes the object and calls Create() with all the parameters. diff --git a/interface/wx/filesys.h b/interface/wx/filesys.h index 0145b949ba..1e7ca40d20 100644 --- a/interface/wx/filesys.h +++ b/interface/wx/filesys.h @@ -64,7 +64,7 @@ public: Remove a filesystem handler from the list of handlers. */ static wxFileSystemHandler* RemoveHandler(wxFileSystemHandler *handler); - + /** Sets the current location. @a location parameter passed to OpenFile() is relative to this path. diff --git a/interface/wx/fontpicker.h b/interface/wx/fontpicker.h index 7282c4f4cc..424fccd9be 100644 --- a/interface/wx/fontpicker.h +++ b/interface/wx/fontpicker.h @@ -59,7 +59,7 @@ class wxFontPickerCtrl : public wxPickerBase { public: wxFontPickerCtrl(); - + /** Initializes the object and calls Create() with all the parameters. diff --git a/interface/wx/fontutil.h b/interface/wx/fontutil.h index 5109babd57..d880edcb75 100644 --- a/interface/wx/fontutil.h +++ b/interface/wx/fontutil.h @@ -8,7 +8,7 @@ /** @class wxNativeFontInfo - + wxNativeFontInfo is platform-specific font representation: this class should be considered as an opaque font description only used by the native functions, the user code can only get the objects of this type from diff --git a/interface/wx/gbsizer.h b/interface/wx/gbsizer.h index 5279db00c0..1fd3857d8d 100644 --- a/interface/wx/gbsizer.h +++ b/interface/wx/gbsizer.h @@ -82,7 +82,7 @@ public: //@{ /** Adds the given item to the given position. - + @return A valid pointer if the item was successfully placed at the given position, or @NULL if something was already there. */ @@ -299,7 +299,7 @@ public: */ bool SetSpan(const wxGBSpan& span); - + wxGridBagSizer* GetGBSizer() const; void SetGBSizer(wxGridBagSizer* sizer); }; diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index 200c06ff89..50934ba2c5 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -557,7 +557,7 @@ public: */ void SetBottomLeft(const wxPoint &p); - + //@{ /** Modifies the rectangle to contain the bounding box of this rectangle diff --git a/interface/wx/generic/helpext.h b/interface/wx/generic/helpext.h index 2f0174f2ca..59d03baaac 100644 --- a/interface/wx/generic/helpext.h +++ b/interface/wx/generic/helpext.h @@ -111,9 +111,9 @@ public: @param k string to search for, empty string will list all entries - - @param mode - optional parameter allows the search the index (wxHELP_SEARCH_INDEX) + + @param mode + optional parameter allows the search the index (wxHELP_SEARCH_INDEX) but this currently only supported by the wxHtmlHelpController. @return @true on success diff --git a/interface/wx/geometry.h b/interface/wx/geometry.h index 51adabbb28..1db6856378 100644 --- a/interface/wx/geometry.h +++ b/interface/wx/geometry.h @@ -279,7 +279,7 @@ public: void Inset( wxInt32 x , wxInt32 y ); void Inset( wxInt32 left , wxInt32 top ,wxInt32 right , wxInt32 bottom ); void Offset( const wxPoint2DInt &pt ); - void ConstrainTo( const wxRect2DInt &rect ); + void ConstrainTo( const wxRect2DInt &rect ); wxPoint2DInt Interpolate( wxInt32 widthfactor , wxInt32 heightfactor ); static void Intersect( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest ); diff --git a/interface/wx/headerctrl.h b/interface/wx/headerctrl.h index 8a9907d546..d8045cf6de 100644 --- a/interface/wx/headerctrl.h +++ b/interface/wx/headerctrl.h @@ -692,7 +692,7 @@ public: */ int GetColumn() const; void SetColumn(int col); - + /** Return the current width of the column. @@ -700,7 +700,7 @@ public: */ int GetWidth() const; void SetWidth(int width); - + /** Return the new order of the column. diff --git a/interface/wx/help.h b/interface/wx/help.h index 58294c23cd..9b7b3b8400 100644 --- a/interface/wx/help.h +++ b/interface/wx/help.h @@ -247,7 +247,7 @@ public: This is an alias for one of a family of help controller classes which is most appropriate for the current platform. - + A help controller allows an application to display help, at the contents or at a particular topic, and shut the help program down on termination. This avoids proliferation of many instances of the help viewer whenever the diff --git a/interface/wx/html/helpctrl.h b/interface/wx/html/helpctrl.h index 9cbea267c5..bb3e1064a7 100644 --- a/interface/wx/html/helpctrl.h +++ b/interface/wx/html/helpctrl.h @@ -269,7 +269,7 @@ public: wxHtmlHelpDialog* GetDialog(); - + protected: /** diff --git a/interface/wx/html/helpdata.h b/interface/wx/html/helpdata.h index 36537406b0..f652185a9e 100644 --- a/interface/wx/html/helpdata.h +++ b/interface/wx/html/helpdata.h @@ -20,7 +20,7 @@ public: wxString GetTitle() const; wxString GetStart() const; wxString GetBasePath() const; - + /* SetContentsRange: store in the bookrecord where in the index/contents lists the * book's records are stored. This to facilitate searching in a specific book. * This code will have to be revised when loading/removing books becomes dynamic. diff --git a/interface/wx/html/htmlcell.h b/interface/wx/html/htmlcell.h index ec5d7ae5f8..af3b201db1 100644 --- a/interface/wx/html/htmlcell.h +++ b/interface/wx/html/htmlcell.h @@ -8,7 +8,7 @@ /** @class wxHtmlRenderingStyle - + wxHtmlSelection is data holder with information about text selection. Selection is defined by two positions (beginning and end of the selection) and two leaf(!) cells at these positions. diff --git a/interface/wx/html/htmprint.h b/interface/wx/html/htmprint.h index 1b4a4e861b..cb6b86822e 100644 --- a/interface/wx/html/htmprint.h +++ b/interface/wx/html/htmprint.h @@ -136,15 +136,15 @@ public: Sets font sizes to be relative to the given size or the system default size; use either specified or default font - @param size + @param size Point size of the default HTML text @param normal_face - This is face name for normal (i.e. non-fixed) font. It can be - either empty string (then the default face is chosen) or - platform-specific face name. Examples are "helvetica" under + This is face name for normal (i.e. non-fixed) font. It can be + either empty string (then the default face is chosen) or + platform-specific face name. Examples are "helvetica" under Unix or "Times New Roman" under Windows. @param fixed_face - The same thing for fixed face ( \..\ ) + The same thing for fixed face ( \..\ ) @see SetSize() */ @@ -301,7 +301,7 @@ public: */ void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int* sizes = NULL); - + /** Sets the name used for preview frames and setup dialogs. @@ -310,7 +310,7 @@ public: void SetName(const wxString& name); /** - Sets default font sizes and/or default font size. + Sets default font sizes and/or default font size. See wxHtmlDCRenderer::SetStandardFonts for detailed description. @see SetFonts() */ diff --git a/interface/wx/html/webkit.h b/interface/wx/html/webkit.h index dce5f0e5f5..d00c857f7a 100644 --- a/interface/wx/html/webkit.h +++ b/interface/wx/html/webkit.h @@ -35,7 +35,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxWebKitCtrlNameStr); - + bool Create(wxWindow *parent, wxWindowID winid, const wxString& strURL, diff --git a/interface/wx/htmllbox.h b/interface/wx/htmllbox.h index 5a051bc1be..b70f62213f 100644 --- a/interface/wx/htmllbox.h +++ b/interface/wx/htmllbox.h @@ -218,7 +218,7 @@ public: Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then the window is sized appropriately. @param n Number of strings with which to initialise the control. diff --git a/interface/wx/hyperlink.h b/interface/wx/hyperlink.h index ff0f136654..b389e0b465 100644 --- a/interface/wx/hyperlink.h +++ b/interface/wx/hyperlink.h @@ -100,7 +100,7 @@ class wxHyperlinkCtrl : public wxControl { public: wxHyperlinkCtrl(); - + /** Constructor. See Create() for more info. */ diff --git a/interface/wx/iconbndl.h b/interface/wx/iconbndl.h index ef1fdd9023..f81f71f46f 100644 --- a/interface/wx/iconbndl.h +++ b/interface/wx/iconbndl.h @@ -140,10 +140,10 @@ public: always returned. Otherwise, the behaviour depends on the flags. If only wxIconBundle::FALLBACK_NONE is given, the function returns an invalid icon. If wxIconBundle::FALLBACK_SYSTEM is given, it tries to find the - icon of standard system size, regardless of the size passed as + icon of standard system size, regardless of the size passed as parameter. Otherwise, or if the icon system size is not found neither, but wxIconBundle::FALLBACK_NEAREST_LARGER flag is specified, the - function returns the smallest icon of the size larger than the + function returns the smallest icon of the size larger than the requested one or, if this fails too, just the icon closest to the specified size. diff --git a/interface/wx/image.h b/interface/wx/image.h index c3d47af52b..43f48aeb81 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -350,7 +350,7 @@ protected: /** Called to get the number of images available in a multi-image file type, if supported. - + NOTE: this function is allowed to change the current stream position since GetImageCount() will take care of restoring it later */ @@ -358,7 +358,7 @@ protected: /** Called to test if this handler can read an image from the given stream. - + NOTE: this function is allowed to change the current stream position since CallDoCanRead() will take care of restoring it later */ @@ -512,7 +512,7 @@ public: double hue; double saturation; - double value; + double value; }; /** @@ -1744,7 +1744,7 @@ public: /** Set the color of the pixel at the given x and y coordinate. */ - + void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ); /** diff --git a/interface/wx/imaggif.h b/interface/wx/imaggif.h index 0fa8b0257a..b30540a4eb 100644 --- a/interface/wx/imaggif.h +++ b/interface/wx/imaggif.h @@ -1,9 +1,9 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imaggif.h -// Purpose: interface of wxGIFHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imaggif.h +// Purpose: interface of wxGIFHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// #define wxIMAGE_OPTION_GIF_COMMENT wxT("GifComment") @@ -25,13 +25,13 @@ public: */ wxGIFHandler(); - virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose = true, + virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose = true, int index = -1); virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true); /** Save the animated gif. - + @param images The image array object which is to be affected by this operation. @param stream diff --git a/interface/wx/imagiff.h b/interface/wx/imagiff.h index 128b05935c..fdf19a469d 100644 --- a/interface/wx/imagiff.h +++ b/interface/wx/imagiff.h @@ -1,11 +1,11 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagiff.h -// Purpose: interface of wxIFFHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imagiff.h +// Purpose: interface of wxIFFHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// -/** +/** @class wxIFFHandler This is the image handler for the IFF format. diff --git a/interface/wx/imagjpeg.h b/interface/wx/imagjpeg.h index 3cbd9b2ef8..2e68d982db 100644 --- a/interface/wx/imagjpeg.h +++ b/interface/wx/imagjpeg.h @@ -1,11 +1,11 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagjpeg.h -// Purpose: interface of wxJPEGHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imagjpeg.h +// Purpose: interface of wxJPEGHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// -/** +/** @class wxJPEGHandler This is the image handler for the JPEG format. @@ -22,7 +22,7 @@ public: Default constructor for wxJPEGHandler */ wxJPEGHandler(); - + /** Retrieve the version information about the JPEG library used by this handler. diff --git a/interface/wx/imagpcx.h b/interface/wx/imagpcx.h index 4872dad801..b2dcbb7c42 100644 --- a/interface/wx/imagpcx.h +++ b/interface/wx/imagpcx.h @@ -1,11 +1,11 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagpcx.h -// Purpose: interface of wxPCXHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imagpcx.h +// Purpose: interface of wxPCXHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// -/** +/** @class wxPCXHandler This is the image handler for the PCX format. diff --git a/interface/wx/imagpng.h b/interface/wx/imagpng.h index a87febf1a4..7605c5bc69 100644 --- a/interface/wx/imagpng.h +++ b/interface/wx/imagpng.h @@ -1,9 +1,9 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagpng.h -// Purpose: interface of wxPNGHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imagpng.h +// Purpose: interface of wxPNGHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// #define wxIMAGE_OPTION_PNG_FORMAT wxT("PngFormat") #define wxIMAGE_OPTION_PNG_BITDEPTH wxT("PngBitDepth") diff --git a/interface/wx/imagpnm.h b/interface/wx/imagpnm.h index 01f923b59b..a538f48f72 100644 --- a/interface/wx/imagpnm.h +++ b/interface/wx/imagpnm.h @@ -1,11 +1,11 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagpnm.h -// Purpose: interface of wxPNMHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imagpnm.h +// Purpose: interface of wxPNMHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// -/** +/** @class wxPNMHandler This is the image handler for the PNM format. diff --git a/interface/wx/imagtga.h b/interface/wx/imagtga.h index b5c2682861..dbdd3d9207 100644 --- a/interface/wx/imagtga.h +++ b/interface/wx/imagtga.h @@ -1,11 +1,11 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagtga.h -// Purpose: interface of wxTGAHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imagtga.h +// Purpose: interface of wxTGAHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// -/** +/** @class wxTGAHandler This is the image handler for the TGA format. diff --git a/interface/wx/imagtiff.h b/interface/wx/imagtiff.h index 260c0ea1de..d370d2e72d 100644 --- a/interface/wx/imagtiff.h +++ b/interface/wx/imagtiff.h @@ -13,12 +13,12 @@ /** @class wxTIFFHandler - + This is the image handler for the TIFF format. - + @library{wxcore} @category{gdi} - + @see wxImage, wxImageHandler, wxInitAllImageHandlers() */ class wxTIFFHandler : public wxImageHandler @@ -28,7 +28,7 @@ public: Default constructor for wxTIFFHandler */ wxTIFFHandler(); - + /** Retrieve the version information about the TIFF library used by this handler. @@ -36,10 +36,10 @@ public: @since 2.9.2 */ static wxVersionInfo GetLibraryVersionInfo(); - + // let the parent class' (wxImageHandler) documentation through for these methods virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1); - + protected: virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true); virtual int DoGetImageCount(wxInputStream& stream); diff --git a/interface/wx/imagxpm.h b/interface/wx/imagxpm.h index 03e6b5fc3c..dff40ed5a1 100644 --- a/interface/wx/imagxpm.h +++ b/interface/wx/imagxpm.h @@ -1,11 +1,11 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagxpm.h -// Purpose: interface of wxXPMHandler -// Author: Samuel Dunn -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: imagxpm.h +// Purpose: interface of wxXPMHandler +// Author: Samuel Dunn +// Licence: wxWindows licence +//////////////////////////////////////////////////////////////////////////// -/** +/** @class wxXPMHandler This is the image handler for the XPM format. diff --git a/interface/wx/intl.h b/interface/wx/intl.h index 63bcf9f260..8abf9a9c57 100644 --- a/interface/wx/intl.h +++ b/interface/wx/intl.h @@ -98,15 +98,15 @@ enum wxLocaleCategory /** The values understood by wxLocale::GetInfo(). - - Note that for the @c wxLOCALE_*_FMT constants (the date and time formats), + + Note that for the @c wxLOCALE_*_FMT constants (the date and time formats), the strings returned by wxLocale::GetInfo() use strftime() or, equivalently, wxDateTime::Format() format. If the relevant format couldn't be determined, an empty string is returned -- there is no fallback value so that the application could determine the best course of actions itself in such case. - All of these values are used with @c wxLOCALE_CAT_DATE in wxLocale::GetInfo() or, + All of these values are used with @c wxLOCALE_CAT_DATE in wxLocale::GetInfo() or, more typically, with @c wxLOCALE_CAT_DEFAULT as they only apply to a single category. */ enum wxLocaleInfo diff --git a/interface/wx/kbdstate.h b/interface/wx/kbdstate.h index bbc8e4eac7..fc26fc257e 100644 --- a/interface/wx/kbdstate.h +++ b/interface/wx/kbdstate.h @@ -107,9 +107,9 @@ public: /** Returns true if the Control key (also under OS X). - + This function doesn't distinguish between right and left control keys. - + Notice that GetModifiers() should usually be used instead of this one. */ bool RawControlDown() const; @@ -127,7 +127,7 @@ public: Returns true if the Meta/Windows/Apple key is pressed. This function tests the state of the key traditionally called Meta - under Unix systems, Windows keys under MSW + under Unix systems, Windows keys under MSW Notice that GetModifiers() should usually be used instead of this one. @see CmdDown() @@ -149,7 +149,7 @@ public: */ bool CmdDown() const; - + void SetControlDown(bool down); void SetRawControlDown(bool down); void SetShiftDown(bool down); diff --git a/interface/wx/listbox.h b/interface/wx/listbox.h index 7ccb4513e3..53c07ddab1 100644 --- a/interface/wx/listbox.h +++ b/interface/wx/listbox.h @@ -176,9 +176,9 @@ public: void Deselect(int n); virtual void SetSelection(int n); - + virtual int GetSelection() const; - + virtual bool SetStringSelection(const wxString& s, bool select); virtual bool SetStringSelection(const wxString& s); @@ -324,8 +324,8 @@ public: // NOTE: Phoenix needs to see the implementation of pure virtuals so it // knows that this class is not abstract. virtual unsigned int GetCount() const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& s); - virtual int FindString(const wxString& s, bool bCase = false) const; + virtual wxString GetString(unsigned int n) const; + virtual void SetString(unsigned int n, const wxString& s); + virtual int FindString(const wxString& s, bool bCase = false) const; }; diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 47dc767f11..6692f09907 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -374,7 +374,7 @@ public: @return @true if all columns were successfully deleted, @false otherwise. */ bool DeleteAllColumns(); - + /** Deletes all items in the list control. @@ -1405,7 +1405,7 @@ protected: @event{EVT_LIST_ITEM_RIGHT_CLICK(id, func)} The right mouse button has been clicked on an item. @event{EVT_LIST_KEY_DOWN(id, func)} - A key has been pressed. GetIndex() may be -1 if no item is selected. + A key has been pressed. GetIndex() may be -1 if no item is selected. @event{EVT_LIST_INSERT_ITEM(id, func)} An item has been inserted. @event{EVT_LIST_COL_CLICK(id, func)} @@ -1516,7 +1516,7 @@ public: */ bool IsEditCancelled() const; - + /** @see GetKeyCode() */ diff --git a/interface/wx/log.h b/interface/wx/log.h index 53bb403bc6..213365b5d2 100644 --- a/interface/wx/log.h +++ b/interface/wx/log.h @@ -507,7 +507,7 @@ public: /** Show all pending output and clear the buffer. - + Some of wxLog implementations, most notably the standard wxLogGui class, buffer the messages (for example, to avoid showing the user a zillion of modal message boxes one after another -- which would be really annoying). @@ -1398,8 +1398,8 @@ void wxVLogError(const char* formatString, va_list argPtr); make sense to separate them from other debug messages. Trace messages can be separated into different categories; these functions in facts - only log the message if the given @a mask is currently enabled in wxLog. - This lets you selectively trace only some operations and not others by enabling the + only log the message if the given @a mask is currently enabled in wxLog. + This lets you selectively trace only some operations and not others by enabling the desired trace masks with wxLog::AddTraceMask() or by setting the @ref overview_envvars "@c WXTRACE environment variable". diff --git a/interface/wx/math.h b/interface/wx/math.h index b1486c270c..5774680131 100644 --- a/interface/wx/math.h +++ b/interface/wx/math.h @@ -93,7 +93,7 @@ unsigned int wxCTZ(wxUint32 x); */ int wxRound(double x); -/** +/** Returns true if both double values are identical. This is only reliable if both values have been assigned the same value. diff --git a/interface/wx/menu.h b/interface/wx/menu.h index 233f042f55..1b8a85aaca 100644 --- a/interface/wx/menu.h +++ b/interface/wx/menu.h @@ -382,27 +382,27 @@ public: @remarks Use only after the menubar has been associated with a frame. */ virtual void SetMenuLabel(size_t pos, const wxString& label); - - /** + + /** Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open. - + @param menubar The menubar to set. - - @remarks Only exists on Mac, other platforms do not have this method. + + @remarks Only exists on Mac, other platforms do not have this method. @onlyfor{wxosx} */ static void MacSetCommonMenuBar(wxMenuBar* menubar); - - /** + + /** Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open. - + @return The global menubar. - - @remarks Only exists on Mac, other platforms do not have this method. + + @remarks Only exists on Mac, other platforms do not have this method. @onlyfor{wxosx} */ @@ -511,7 +511,7 @@ public: Constructs a wxMenu object. */ wxMenu(); - + /** Constructs a wxMenu object. @@ -1050,7 +1050,7 @@ public: */ void UpdateUI(wxEvtHandler* source = NULL); - + void SetInvokingWindow(wxWindow *win); wxWindow *GetInvokingWindow() const; wxWindow *GetWindow() const; diff --git a/interface/wx/menuitem.h b/interface/wx/menuitem.h index 3597079e9d..b03ff5ae65 100644 --- a/interface/wx/menuitem.h +++ b/interface/wx/menuitem.h @@ -144,37 +144,37 @@ public: @see GetItemLabelText(), GetItemLabel() */ static wxString GetLabelText(const wxString& text); - - + + /** @name Getters */ //@{ - + /** Returns the background colour associated with the menu item. - + @onlyfor{wxmsw} */ wxColour& GetBackgroundColour() const; /** Returns the checked or unchecked bitmap. - + @onlyfor{wxmsw} */ virtual const wxBitmap& GetBitmap(bool checked = true) const; /** Returns the bitmap to be used for disabled items. - + @onlyfor{wxmsw} */ virtual const wxBitmap& GetDisabledBitmap() const; - + /** Returns the font associated with the menu item. - + @onlyfor{wxmsw} */ wxFont& GetFont() const; @@ -223,7 +223,7 @@ public: /** Gets the width of the menu item checkmark bitmap. - + @onlyfor{wxmsw} */ int GetMarginWidth() const; @@ -238,7 +238,7 @@ public: Returns the text associated with the menu item. @deprecated This function is deprecated. Please use GetItemLabel() or GetItemLabelText() instead. - + @see GetItemLabel(), GetItemLabelText() */ wxString GetName() const; @@ -260,11 +260,11 @@ public: /** Returns the text colour associated with the menu item. - + @onlyfor{wxmsw} */ wxColour& GetTextColour() const; - + /** Extract the accelerator from the given menu string, return NULL if none found. @@ -277,9 +277,9 @@ public: virtual wxAcceleratorEntry *GetAccel() const; //@} - - - + + + /** @name Checkers */ @@ -329,11 +329,11 @@ public: Returns @true if the item is a submenu. */ bool IsSubMenu() const; - + //@} - - - + + + /** @name Setters */ @@ -341,7 +341,7 @@ public: /** Sets the background colour associated with the menu item. - + @onlyfor{wxmsw} */ void SetBackgroundColour(const wxColour& colour); @@ -349,7 +349,7 @@ public: /** Sets the bitmap for the menu item. - It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap) if + It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap) if @a checked is @true (default value) or SetBitmaps(wxNullBitmap, bmp) otherwise. @@ -386,7 +386,7 @@ public: /** Sets the font associated with the menu item. - + @onlyfor{wxmsw} */ void SetFont(const wxFont& font); @@ -398,19 +398,19 @@ public: /** Sets the label associated with the menu item. - - Note that if the ID of this menu item corresponds to a stock ID, then it is + + Note that if the ID of this menu item corresponds to a stock ID, then it is not necessary to specify a label: wxWidgets will automatically use the stock item label associated with that ID. See the @ref wxMenuItem::wxMenuItem "constructor" for more info. - - The label string for the normal menu items (not separators) may include the + + The label string for the normal menu items (not separators) may include the accelerator which can be used to activate the menu item from keyboard. - An accelerator key can be specified using the ampersand & character. - In order to embed an ampersand character in the menu item text, the ampersand + An accelerator key can be specified using the ampersand & character. + In order to embed an ampersand character in the menu item text, the ampersand must be doubled. - - Optionally you can specify also an accelerator string appending a tab character + + Optionally you can specify also an accelerator string appending a tab character \\t followed by a valid key combination (e.g. CTRL+V). Its general syntax is any combination of @c "CTRL", @c "RAWCTRL", @c "ALT" and @c "SHIFT" strings (case doesn't matter) separated by either @@ -507,7 +507,7 @@ public: /** Sets the width of the menu item checkmark bitmap. - + @onlyfor{wxmsw} */ void SetMarginWidth(int width); @@ -526,18 +526,18 @@ public: Sets the text associated with the menu item. @deprecated This function is deprecated in favour of SetItemLabel(). - + @see SetItemLabel(). */ virtual void SetText(const wxString& text); /** Sets the text colour associated with the menu item. - + @onlyfor{wxmsw} */ void SetTextColour(const wxColour& colour); - + /** Set the accel for this item - this may also be done indirectly with SetText() diff --git a/interface/wx/mimetype.h b/interface/wx/mimetype.h index 54d0e10666..7cb00011ce 100644 --- a/interface/wx/mimetype.h +++ b/interface/wx/mimetype.h @@ -10,11 +10,11 @@ This class allows the application to retrieve information about all known MIME types from a system-specific location and the filename extensions to the - MIME types and vice versa. - + MIME types and vice versa. + MIME stands for "Multipurpose Internet Mail Extensions" and was originally used in mail protocols. It's standardized by several RFCs. - + Under Windows, the MIME type information is queried from registry. Under Linux and Unix, it is queried from the XDG data directories. @@ -23,7 +23,7 @@ The application should not construct its own manager: it should use the object pointer ::wxTheMimeTypesManager. The functions GetFileTypeFromMimeType() and GetFileTypeFromExtension() - return a wxFileType object which may be further queried for file description, + return a wxFileType object which may be further queried for file description, icon and other attributes. @section mimetypemanager_helpers Helper functions @@ -445,7 +445,7 @@ public: const wxString& description, const wxString& extension, ...); - + /** Constructor using an array of string elements corresponding to the parameters of the ctor above in the same order. @@ -497,7 +497,7 @@ public: Get the MIME type */ const wxString& GetMimeType() const; - + /** Get the open command */ @@ -507,17 +507,17 @@ public: Get the print command */ const wxString& GetPrintCommand() const; - + /** Get the short description (only used under Win32 so far) */ const wxString& GetShortDesc() const; - + /** Get the long, user visible description */ const wxString& GetDescription() const; - + /** Get the array of all extensions */ @@ -527,7 +527,7 @@ public: Get the number of extensions. */ size_t GetExtensionsCount() const; - + /** Get the icon filename */ diff --git a/interface/wx/mousestate.h b/interface/wx/mousestate.h index 2c5b4f9313..5bb1827b2f 100644 --- a/interface/wx/mousestate.h +++ b/interface/wx/mousestate.h @@ -108,7 +108,7 @@ public: void SetX(wxCoord x); void SetY(wxCoord y); void SetPosition(const wxPoint& pos); - + void SetLeftDown(bool down); void SetMiddleDown(bool down); void SetRightDown(bool down); @@ -116,7 +116,7 @@ public: void SetAux2Down(bool down); void SetState(const wxMouseState& state); - + }; diff --git a/interface/wx/msw/ole/automtn.h b/interface/wx/msw/ole/automtn.h index 1df6240a0b..352b022a60 100644 --- a/interface/wx/msw/ole/automtn.h +++ b/interface/wx/msw/ole/automtn.h @@ -388,7 +388,7 @@ public: @code wxAutomationObject excelObject; - + if ( excelObject.GetInstance("Excel.Application") ) excelObject.PutProperty("ActiveCell.Font.Bold", true); @endcode @@ -450,7 +450,7 @@ public: Creates a new object based on the @a progID, returning @true if the object was successfully created, or @false if not. - + @see GetInstance() */ bool CreateInstance(const wxString& progId) const; @@ -495,7 +495,7 @@ public: @param progId COM ProgID, e.g. "Excel.Application" @param flags The creation flags (this parameters was added in wxWidgets 2.9.2) - + @see CreateInstance() */ bool GetInstance(const wxString& progId, @@ -532,11 +532,11 @@ public: wxVariant res = obj.GetProperty("Range", wxVariant("A1")); wxVariant res = obj.GetProperty("Range", "A1"); @endcode - + Note that @a property can contain dot-separated property names, to save the application needing to call GetProperty several times using several temporary objects. - + @see GetObject(), PutProperty() */ wxVariant GetProperty(const wxString& property, int noArgs, diff --git a/interface/wx/msw/regconf.h b/interface/wx/msw/regconf.h index 85a37f603b..4e9e40cecf 100644 --- a/interface/wx/msw/regconf.h +++ b/interface/wx/msw/regconf.h @@ -25,7 +25,7 @@ public: /** The wxRegConfig constructor. For more info see the docs for the wxConfigBase::wxConfigBase() constructor. - + Note that wxRegConfig's @a style argument defaults to @c wxCONFIG_USE_GLOBAL_FILE, i.e. to the use of the @c HKLM key (also known as "HKEY_LOCAL_MACHINE"). */ diff --git a/interface/wx/notifmsg.h b/interface/wx/notifmsg.h index 4a35382ae5..4e86a59ca9 100644 --- a/interface/wx/notifmsg.h +++ b/interface/wx/notifmsg.h @@ -29,15 +29,15 @@ Windows 10 and for toast notification support on Windows 8 it is recommended to call MSWUseToasts() before showing the first notification message. - + @par OS X The OS X implementation uses Notification Center to display native notifications. In order to use actions your notifications must use the alert style. This can be enabled by the user in system settings or by setting the @c NSUserNotificationAlertStyle value in Info.plist to @c alert. Please note that the user always has the option to change the notification style. - - + + @beginEventEmissionTable{wxCommandEvent} @event{wxEVT_NOTIFICATION_MESSAGE_CLICK(id, func)} Process a @c wxEVT_NOTIFICATION_MESSAGE_CLICK event, when a notification @@ -49,7 +49,7 @@ Process a @c wxEVT_NOTIFICATION_MESSAGE_ACTION event, when the user selects on of the actions added by AddAction() @endEventTable - + @since 2.9.0 @library{wxcore} @category{misc} @@ -93,11 +93,11 @@ public: @return @false if the current implementation or OS version does not support actions in notifications. - + @since 3.1.0 */ bool AddAction(wxWindowID actionid, const wxString &label = wxString()); - + /** Hides the notification. @@ -114,22 +114,22 @@ public: Valid values are @c wxICON_INFORMATION, @c wxICON_WARNING and @c wxICON_ERROR (notice that @c wxICON_QUESTION is not allowed here). Some implementations of this class may not support the icons. - + @see SetIcon() */ void SetFlags(int flags); /** Specify a custom icon to be displayed in the notification. - + Some implementations of this class may not support custom icons. - + @see SetFlags() - + @since 3.1.0 */ void SetIcon(const wxIcon& icon); - + /** Set the main text of the notification. @@ -173,42 +173,42 @@ public: If the application already uses a wxTaskBarIcon, it should be connected to notifications by using this method. This has no effect if toast notifications are used. - + @return the task bar icon which was used previously (may be @c NULL) - + @onlyfor{wxmsw} */ static wxTaskBarIcon *UseTaskBarIcon(wxTaskBarIcon *icon); - + /** Enables toast notifications available since Windows 8 and suppresses the additional icon in the notification area on Windows 10. - + Toast notifications @b require a shortcut to the application in the - start menu. The start menu shortcut needs to contain an Application + start menu. The start menu shortcut needs to contain an Application User Model ID. It is recommended that the applications setup creates the shortcut and the application specifies the setup created shortcut in @c shortcutPath. A call to this method will verify (and if necessary modify) the shortcut before enabling toast notifications. - + @param shortcutPath - Path to a shortcut file referencing the applications executable. If - the string is empty the applications display name will be used. If - not fully qualified, it will be used as a path relative to the + Path to a shortcut file referencing the applications executable. If + the string is empty the applications display name will be used. If + not fully qualified, it will be used as a path relative to the users start menu directory. The file extension .lnk is optional. @param appId The applications Application User Model ID. If empty it will be extracted from the shortcut. If the shortcut does not contain an id an id will be automatically created from the applications vendor and app name. - + @return @false if toast notifications could not be enabled. - + @onlyfor{wxmsw} - + @see wxAppConsole::SetAppName(), wxAppConsole::SetVendorName() - + @since 3.1.0 */ static bool MSWUseToasts( diff --git a/interface/wx/object.h b/interface/wx/object.h index 3f17dcf264..e28facff9d 100644 --- a/interface/wx/object.h +++ b/interface/wx/object.h @@ -718,7 +718,7 @@ public: /** Used in a C++ implementation file to complete the declaration of a class that has run-time type information. - + @header{wx/object.h} Example: @@ -736,7 +736,7 @@ public: /** Used in a C++ implementation file to complete the declaration of a class - that has run-time type information and two base classes. + that has run-time type information and two base classes. @header{wx/object.h} */ diff --git a/interface/wx/overlay.h b/interface/wx/overlay.h index ecbefde926..c03732ce08 100644 --- a/interface/wx/overlay.h +++ b/interface/wx/overlay.h @@ -11,7 +11,7 @@ Creates an overlay over an existing window, allowing for manipulations like rubberbanding, etc. On wxOSX the overlay is implemented with native platform APIs, on the other platforms it is simulated using wxMemoryDC. - + @library{wxcore} @see wxDCOverlay, wxDC @@ -35,11 +35,11 @@ public: @class wxDCOverlay Connects an overlay with a drawing DC. - + @library{wxcore} @see wxOverlay, wxDC - + */ class wxDCOverlay { diff --git a/interface/wx/pickerbase.h b/interface/wx/pickerbase.h index b50a964225..22d08185af 100644 --- a/interface/wx/pickerbase.h +++ b/interface/wx/pickerbase.h @@ -163,7 +163,7 @@ public: virtual void UpdatePickerFromTextCtrl() = 0; virtual void UpdateTextCtrlFromPicker() = 0; - + protected: virtual long GetTextCtrlStyle(long style) const; virtual long GetPickerStyle(long style) const; diff --git a/interface/wx/platinfo.h b/interface/wx/platinfo.h index f279c15592..d10563c38a 100644 --- a/interface/wx/platinfo.h +++ b/interface/wx/platinfo.h @@ -24,12 +24,12 @@ enum wxOperatingSystemId wxOS_MAC_OS = 1 << 0, //!< Apple Mac OS 8/9/X with Mac paths wxOS_MAC_OSX_DARWIN = 1 << 1, //!< Apple OS X with Unix paths - + //! A combination of all @c wxOS_MAC_* values previously listed. wxOS_MAC = wxOS_MAC_OS|wxOS_MAC_OSX_DARWIN, wxOS_WINDOWS_NT = 1 << 3, //!< Windows NT family (XP/Vista/7/8/10) - + //! Any Windows system, currently can be only wxOS_WINDOWS_NT. wxOS_WINDOWS = wxOS_WINDOWS_NT, @@ -40,7 +40,7 @@ enum wxOperatingSystemId wxOS_UNIX_SOLARIS = 1 << 10, //!< SunOS wxOS_UNIX_AIX = 1 << 11, //!< AIX wxOS_UNIX_HPUX = 1 << 12, //!< HP/UX - + //! A combination of all @c wxOS_UNIX_* values previously listed. wxOS_UNIX = wxOS_UNIX_LINUX | wxOS_UNIX_FREEBSD | @@ -104,9 +104,9 @@ enum wxEndianness }; /** - A structure containing information about a Linux distribution as returned + A structure containing information about a Linux distribution as returned by the @c lsb_release utility. - + See wxGetLinuxDistributionInfo() or wxPlatformInfo::GetLinuxDistributionInfo() for more info. */ @@ -116,7 +116,7 @@ struct wxLinuxDistributionInfo wxString Release; //!< The version of the distribution; e.g. "9.04" wxString CodeName; //!< The code name of the distribution; e.g. "jaunty" wxString Description; //!< The description of the distribution; e.g. "Ubuntu 9.04" - + bool operator==(const wxLinuxDistributionInfo& ldi) const; bool operator!=(const wxLinuxDistributionInfo& ldi) const; }; @@ -125,16 +125,16 @@ struct wxLinuxDistributionInfo /** @class wxPlatformInfo - This class holds information about the operating system, the toolkit and the + This class holds information about the operating system, the toolkit and the basic architecture of the machine where the application is currently running. - + This class does not only have @e getters for the information above, it also has - @e setters. This allows you to e.g. save the current platform information in a + @e setters. This allows you to e.g. save the current platform information in a data file (maybe in string form) so that when you later load it, you can easily retrieve (see the static getters for string->enum conversion functions) and store - inside a wxPlatformInfo instance (using its setters) the signature of the system + inside a wxPlatformInfo instance (using its setters) the signature of the system which generated it. - + In general however you only need to use the static Get() function and then access the various information for the current platform: @code @@ -148,7 +148,7 @@ struct wxLinuxDistributionInfo @see ::wxGetOsVersion(), wxIsPlatformLittleEndian(), wxIsPlatform64Bit(), wxAppTraits, @ref group_funcmacro_networkuseros */ -class wxPlatformInfo +class wxPlatformInfo { public: @@ -211,16 +211,16 @@ public: Equality operator. Tests all class' internal variables. */ bool operator==(const wxPlatformInfo& t) const; - + /** Returns the global wxPlatformInfo object, initialized with the values for the currently running platform. */ static const wxPlatformInfo& Get(); - + /** @name Static enum getters - + These getters allow for easy string-to-enumeration-value conversion. */ //@{ @@ -251,13 +251,13 @@ public: ("wxGTK", "wxMSW", etc) nor any of the short wxWidgets name ports ("gtk", "msw", etc). */ static wxPortId GetPortId(const wxString& portname); - + //@} - - + + /** @name Static string-form getters - + These getters allow for easy enumeration-value-to-string conversion. */ //@{ @@ -271,7 +271,7 @@ public: Returns name for the given wxEndianness enumeration value. */ static wxString GetEndiannessName(wxEndianness end); - + /** Returns the operating system family name for the given wxOperatingSystemId enumeration value: @c Unix for @c wxOS_UNIX, @c OSX for @c wxOS_MAC_OS, @@ -308,14 +308,14 @@ public: /** Returns the operating system directory. - + See wxGetOSDirectory() for more info. */ static wxString GetOperatingSystemDirectory(); //@} - - + + /** @name Getters */ @@ -359,14 +359,14 @@ public: /** Returns the operating system ID of this wxPlatformInfo instance. - + See wxGetOsVersion() for more info. */ wxOperatingSystemId GetOperatingSystemId() const; - + /** Returns the description of the operating system of this wxPlatformInfo instance. - + See wxGetOsDescription() for more info. */ wxString GetOperatingSystemDescription() const; @@ -375,17 +375,17 @@ public: Returns the wxWidgets port ID associated with this wxPlatformInfo instance. */ wxPortId GetPortId() const; - + /** Returns the Linux distribution info associated with this wxPlatformInfo instance. - + See wxGetLinuxDistributionInfo() for more info. */ wxLinuxDistributionInfo GetLinuxDistributionInfo() const; - + /** Returns the desktop environment associated with this wxPlatformInfo instance. - + See wxAppTraits::GetDesktopEnvironment() for more info. */ wxString GetDesktopEnvironment() const; @@ -454,7 +454,7 @@ public: wxPlatformInfo instance. */ wxString GetOperatingSystemFamilyName() const; - + /** Returns the operating system name of the OS associated with this wxPlatformInfo instance. @@ -472,16 +472,16 @@ public: wxPlatformInfo instance. */ wxString GetPortIdShortName() const; - - //@} - - + //@} + + + /** @name Setters */ //@{ - + /** Sets the architecture enum value associated with this wxPlatformInfo instance. */ @@ -517,17 +517,17 @@ public: Sets the operating system description associated with this wxPlatformInfo instance. */ void SetOperatingSystemDescription(const wxString& desc); - + /** Sets the desktop environment associated with this wxPlatformInfo instance. */ void SetDesktopEnvironment(const wxString& de); - + /** Sets the linux distribution info associated with this wxPlatformInfo instance. */ void SetLinuxDistributionInfo(const wxLinuxDistributionInfo& di); - + //@} }; diff --git a/interface/wx/popupwin.h b/interface/wx/popupwin.h index b1a00a71f6..fe7c92b313 100644 --- a/interface/wx/popupwin.h +++ b/interface/wx/popupwin.h @@ -38,7 +38,7 @@ public: Default constructor */ wxPopupWindow(); - + /** Constructor */ @@ -125,5 +125,5 @@ protected: else but direct call to Dismiss(). */ virtual void OnDismiss(); - + }; diff --git a/interface/wx/power.h b/interface/wx/power.h index 375234568e..62fa9525e2 100644 --- a/interface/wx/power.h +++ b/interface/wx/power.h @@ -80,7 +80,7 @@ class wxPowerEvent : public wxEvent public: wxPowerEvent(); wxPowerEvent(wxEventType evtType); - + /** Call this to prevent suspend from taking place in @c wxEVT_POWER_SUSPENDING handler (it is ignored for all the others). diff --git a/interface/wx/process.h b/interface/wx/process.h index f5dc6d018f..50d49398b4 100644 --- a/interface/wx/process.h +++ b/interface/wx/process.h @@ -15,7 +15,7 @@ notified about the process termination and also retrieve its exit status which is unavailable from ::wxExecute() in the case of asynchronous execution. - @note + @note If the @c wxEVT_END_PROCESS event sent after termination is processed by the parent, then it is responsible for deleting the wxProcess object which sent it. However, if it is not processed, the object will delete itself and so the @@ -110,17 +110,17 @@ public: /** Detaches this event handler from the parent specified in the constructor (see wxEvtHandler::Unlink() for a similar but not identical function). - + Normally, a wxProcess object is deleted by its parent when it receives the - notification about the process termination. - - However, it might happen that the parent object is destroyed before the external - process is terminated (e.g. a window from which this external process was launched - is closed by the user) and in this case it @b should not delete the wxProcess - object, but @b should call Detach() instead. - - After the wxProcess object is detached from its parent, no notification events - will be sent to the parent and the object will delete itself upon reception of + notification about the process termination. + + However, it might happen that the parent object is destroyed before the external + process is terminated (e.g. a window from which this external process was launched + is closed by the user) and in this case it @b should not delete the wxProcess + object, but @b should call Detach() instead. + + After the wxProcess object is detached from its parent, no notification events + will be sent to the parent and the object will delete itself upon reception of the process termination notification. */ void Detach(); @@ -211,7 +211,7 @@ public: /** It is called when the process with the pid @a pid finishes. It raises a wxWidgets event when it isn't overridden. - + Note that this function won't be called if you Kill() the process. @param pid diff --git a/interface/wx/progdlg.h b/interface/wx/progdlg.h index 616b8530e1..e1ab36431b 100644 --- a/interface/wx/progdlg.h +++ b/interface/wx/progdlg.h @@ -167,7 +167,7 @@ public: /** Changes the maximum value of the progress meter given in the constructor. - This function can only be called (with a positive value) if the value passed + This function can only be called (with a positive value) if the value passed in the constructor was positive. @since 2.9.1 diff --git a/interface/wx/propdlg.h b/interface/wx/propdlg.h index 8ccdc1ca8b..e6932471e1 100644 --- a/interface/wx/propdlg.h +++ b/interface/wx/propdlg.h @@ -197,7 +197,7 @@ public: */ void SetSheetStyle(long style); - + /** Set the border around the whole dialog */ @@ -208,18 +208,18 @@ public: */ int GetSheetOuterBorder() const; - + /** Set the border around the book control only. */ void SetSheetInnerBorder(int border); - + /** Returns the border around the book control only. */ int GetSheetInnerBorder() const; - + virtual wxWindow* GetContentWindow() const; }; diff --git a/interface/wx/propgrid/editors.h b/interface/wx/propgrid/editors.h index 6fe9c15544..4af9d0c3e3 100644 --- a/interface/wx/propgrid/editors.h +++ b/interface/wx/propgrid/editors.h @@ -427,7 +427,7 @@ public: class wxSampleMultiButtonEditor : public wxPGTextCtrlEditor { wxDECLARE_DYNAMIC_CLASS(wxSampleMultiButtonEditor); - + public: wxSampleMultiButtonEditor() {} virtual ~wxSampleMultiButtonEditor() {} diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 48e0e21dbe..896d4c73ed 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -516,7 +516,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 Note that when displaying the value, sign is omitted if the resulting textual representation is effectively zero (for example, -0.0001 with - precision of 3 will become 0.0 instead of -0.0). This behaviour is unlike + precision of 3 will become 0.0 instead of -0.0). This behaviour is unlike what C standard library does, but should result in better end-user experience in almost all cases. diff --git a/interface/wx/propgrid/propgridpagestate.h b/interface/wx/propgrid/propgridpagestate.h index 1a392b7659..8289b59108 100644 --- a/interface/wx/propgrid/propgridpagestate.h +++ b/interface/wx/propgrid/propgridpagestate.h @@ -227,7 +227,7 @@ class wxPropertyGridIterator : public wxPropertyGridIteratorBase public: wxPropertyGridIterator(); wxPropertyGridIterator( wxPropertyGridPageState* state, - int flags = wxPG_ITERATE_DEFAULT, + int flags = wxPG_ITERATE_DEFAULT, wxPGProperty* property = NULL, int dir = 1 ); wxPropertyGridIterator( wxPropertyGridPageState* state, int flags, int startPos, int dir = 0 ); @@ -252,7 +252,7 @@ public: wxPropertyGridConstIterator(); wxPropertyGridConstIterator( const wxPropertyGridPageState* state, - int flags = wxPG_ITERATE_DEFAULT, + int flags = wxPG_ITERATE_DEFAULT, const wxPGProperty* property = NULL, int dir = 1 ); wxPropertyGridConstIterator( wxPropertyGridPageState* state, int flags, int startPos, int dir = 0 ); diff --git a/interface/wx/propgrid/props.h b/interface/wx/propgrid/props.h index ad4c7bc009..e7ef66a847 100644 --- a/interface/wx/propgrid/props.h +++ b/interface/wx/propgrid/props.h @@ -312,7 +312,7 @@ public: const wxChar* const* labels = NULL, const long* values = NULL, int value = 0 ); - + wxEnumProperty( const wxString& label, const wxString& name, wxPGChoices& choices, diff --git a/interface/wx/protocol/protocol.h b/interface/wx/protocol/protocol.h index 94330044c9..7ab332db9a 100644 --- a/interface/wx/protocol/protocol.h +++ b/interface/wx/protocol/protocol.h @@ -132,7 +132,7 @@ public: /** Detach the existing logger without deleting it. - + The caller is responsible for deleting the returned pointer if it's non-@c NULL. */ diff --git a/interface/wx/rearrangectrl.h b/interface/wx/rearrangectrl.h index d26113f095..2b200372bd 100644 --- a/interface/wx/rearrangectrl.h +++ b/interface/wx/rearrangectrl.h @@ -301,7 +301,7 @@ public: /** Effectively creates the dialog for an object created using the default - constructor. + constructor. @param parent The dialog parent, possibly @NULL. diff --git a/interface/wx/renderer.h b/interface/wx/renderer.h index ddd4d3a1f8..a94b5c9f9c 100644 --- a/interface/wx/renderer.h +++ b/interface/wx/renderer.h @@ -635,7 +635,7 @@ public: struct wxRendererVersion { wxRendererVersion(int version_, int age_); - + /** Checks if the main program is compatible with the renderer having the version @e ver, returns @true if it is and @false otherwise. diff --git a/interface/wx/ribbon/art.h b/interface/wx/ribbon/art.h index 055949e76a..7cdb0b9156 100644 --- a/interface/wx/ribbon/art.h +++ b/interface/wx/ribbon/art.h @@ -8,7 +8,7 @@ /** Identifiers for common settings on ribbon art providers which can be used to tweak the appearance of the art provider. - + @see wxRibbonArtProvider::GetColour() @see wxRibbonArtProvider::GetFont() @see wxRibbonArtProvider::GetMetric() @@ -127,7 +127,7 @@ enum wxRibbonArtSetting /** Flags used to describe the direction, state, and/or purpose of a ribbon-style scroll button. - + @see wxRibbonArtProvider::DrawScrollButton() @see wxRibbonArtProvider::GetScrollButtonMinimumSize() */ @@ -167,19 +167,19 @@ enum wxRibbonButtonKind action. */ wxRIBBON_BUTTON_NORMAL = 1 << 0, - + /** Dropdown button or tool with a clickable area which typically causes a dropdown menu. */ wxRIBBON_BUTTON_DROPDOWN = 1 << 1, - + /** Button or tool with two clickable areas - one which causes a dropdown menu, and one which causes a generic action. */ wxRIBBON_BUTTON_HYBRID = wxRIBBON_BUTTON_NORMAL | wxRIBBON_BUTTON_DROPDOWN, - + /** Normal button or tool with a clickable area which toggles the button between a pressed and unpressed state. @@ -216,7 +216,7 @@ public: Constructor. */ wxRibbonArtProvider(); - + /** Destructor. */ @@ -226,16 +226,16 @@ public: Create a new art provider which is a clone of this one. */ virtual wxRibbonArtProvider* Clone() const = 0; - + /** Set the style flags. - + Normally called automatically by wxRibbonBar::SetArtProvider with the ribbon bar's style flags, so that the art provider has the same flags as the bar which it is serving. */ virtual void SetFlags(long flags) = 0; - + /** Get the previously set style flags. */ @@ -246,53 +246,53 @@ public: @a id can be one of the size values of @ref wxRibbonArtSetting. */ virtual int GetMetric(int id) const = 0; - + /** Set the value of a certain integer setting to the value @e new_val. @a id can be one of the size values of @ref wxRibbonArtSetting. */ virtual void SetMetric(int id, int new_val) = 0; - + /** Set the value of a certain font setting to the value @e font. @a id can be one of the font values of @ref wxRibbonArtSetting. */ virtual void SetFont(int id, const wxFont& font) = 0; - + /** Get the value of a certain font setting. @a id can be one of the font values of @ref wxRibbonArtSetting. */ virtual wxFont GetFont(int id) const = 0; - + /** Get the value of a certain colour setting. @a id can be one of the colour values of @ref wxRibbonArtSetting. */ virtual wxColour GetColour(int id) const = 0; - + /** Set the value of a certain colour setting to the value @e colour. @a id can be one of the colour values of @ref wxRibbonArtSetting, though not all colour settings will have an effect on every art provider. - + @see SetColourScheme() */ virtual void SetColour(int id, const wxColour& colour) = 0; - + /** @see wxRibbonArtProvider::GetColour() */ wxColour GetColor(int id) const; - + /** @see wxRibbonArtProvider::SetColour() */ void SetColor(int id, const wxColour& color); - + /** Get the current colour scheme. - + Returns three colours such that if SetColourScheme() were called with them, the colour scheme would be restored to what it was when SetColourScheme() was last called. In practice, this usually means that @@ -308,7 +308,7 @@ public: and return a colour scheme similar to colours being used - it's return values are dependent upon the last values given to SetColourScheme(), as described above. - + @param[out] primary Pointer to a location to store the primary colour, or NULL. @param[out] secondary @@ -319,26 +319,26 @@ public: virtual void GetColourScheme(wxColour* primary, wxColour* secondary, wxColour* tertiary) const = 0; - + /** Set all applicable colour settings from a few base colours. - + Uses any or all of the three given colours to create a colour scheme, and then sets all colour settings which are relevant to the art provider using that scheme. Note that some art providers may not use the tertiary colour for anything, and some may not use the secondary colour either. - + @see SetColour() @see GetColourScheme() - */ + */ virtual void SetColourScheme(const wxColour& primary, const wxColour& secondary, const wxColour& tertiary) = 0; /** Draw the background of the tab region of a ribbon bar. - + @param dc The device context to draw onto. @param wnd @@ -353,7 +353,7 @@ public: /** Draw a single tab in the tab region of a ribbon bar. - + @param dc The device context to draw onto. @param wnd @@ -373,7 +373,7 @@ public: /** Draw a separator between two tabs in a ribbon bar. - + @param dc The device context to draw onto. @param wnd @@ -393,7 +393,7 @@ public: /** Draw the background of a ribbon page. - + @param dc The device context to draw onto. @param wnd @@ -401,7 +401,7 @@ public: whose background is being drawn, but doesn't have to be). @param rect The rectangle within which to draw. - + @sa GetPageBackgroundRedrawArea */ virtual void DrawPageBackground( @@ -411,7 +411,7 @@ public: /** Draw a ribbon-style scroll button. - + @param dc The device context to draw onto. @param wnd @@ -439,11 +439,11 @@ public: Draw the background and chrome for a ribbon panel. This should draw the border, background, label, and any other items of a panel which are outside the client area of a panel. - + Note that when a panel is minimised, this function is not called - only DrawMinimisedPanel() is called, so a background should be explicitly painted by that if required. - + @param dc The device context to draw onto. @param wnd @@ -457,13 +457,13 @@ public: wxDC& dc, wxRibbonPanel* wnd, const wxRect& rect) = 0; - + /** Draw the background and chrome for a wxRibbonGallery control. This should draw the border, background, scroll buttons, extension button, and any other UI elements which are not attached to a specific gallery item. - + @param dc The device context to draw onto. @param wnd @@ -488,7 +488,7 @@ public: is painted on top of a gallery background, and behind the items bitmap. Unlike DrawButtonBarButton() and DrawTool(), it is not expected to draw the item bitmap - that is done by the gallery control itself. - + @param dc The device context to draw onto. @param wnd @@ -515,10 +515,10 @@ public: wxRibbonGallery* wnd, const wxRect& rect, wxRibbonGalleryItem* item) = 0; - + /** Draw a minimised ribbon panel. - + @param dc The device context to draw onto. @param wnd @@ -539,10 +539,10 @@ public: wxRibbonPanel* wnd, const wxRect& rect, wxBitmap& bitmap) = 0; - + /** Draw the background for a wxRibbonButtonBar control. - + @param dc The device context to draw onto. @param wnd @@ -558,7 +558,7 @@ public: /** Draw a single button for a wxRibbonButtonBar control. - + @param dc The device context to draw onto. @param wnd @@ -591,10 +591,10 @@ public: const wxString& label, const wxBitmap& bitmap_large, const wxBitmap& bitmap_small) = 0; - + /** Draw the background for a wxRibbonToolBar control. - + @param dc The device context to draw onto. @param wnd @@ -613,7 +613,7 @@ public: /** Draw the background for a group of tools on a wxRibbonToolBar control. - + @param dc The device context to draw onto. @param wnd @@ -636,7 +636,7 @@ public: /** Draw a single tool (for a wxRibbonToolBar control). - + @param dc The device context to draw onto. @param wnd @@ -710,7 +710,7 @@ public: /** Calculate the ideal and minimum width (in pixels) of a tab in a ribbon bar. - + @param dc A device context to use when one is required for size calculations. @param wnd @@ -746,7 +746,7 @@ public: Note that as the tab region can contain scroll buttons, the height should be greater than or equal to the minimum height for a tab scroll button. - + @param dc A device context to use when one is required for size calculations. @param wnd @@ -761,7 +761,7 @@ public: /** Calculate the minimum size (in pixels) of a scroll button. - + @param dc A device context to use when one is required for size calculations. @param wnd @@ -781,7 +781,7 @@ public: Calculate the size of a panel for a given client size. This should increment the given size by enough to fit the panel label and other chrome. - + @param dc A device context to use if one is required for size calculations. @param wnd @@ -791,7 +791,7 @@ public: @param[out] client_offset The offset where the client rectangle begins within the panel (may be NULL). - + @sa GetPanelClientSize() */ virtual wxSize GetPanelSize( @@ -799,12 +799,12 @@ public: const wxRibbonPanel* wnd, wxSize client_size, wxPoint* client_offset) = 0; - + /** Calculate the client size of a panel for a given overall size. This should act as the inverse to GetPanelSize(), and decrement the given size by enough to fit the panel label and other chrome. - + @param dc A device context to use if one is required for size calculations. @param wnd @@ -814,7 +814,7 @@ public: @param[out] client_offset The offset where the returned client size begins within the given @a size (may be NULL). - + @sa GetPanelSize() */ virtual wxSize GetPanelClientSize( @@ -844,14 +844,14 @@ public: Calculate the size of a wxRibbonGallery control for a given client size. This should increment the given size by enough to fit the gallery border, buttons, and any other chrome. - + @param dc A device context to use if one is required for size calculations. @param wnd The gallery in question. @param client_size The client size. - + @sa GetGalleryClientSize() */ virtual wxSize GetGallerySize( @@ -864,7 +864,7 @@ public: size. This should act as the inverse to GetGallerySize(), and decrement the given size by enough to fit the gallery border, buttons, and other chrome. - + @param dc A device context to use if one is required for size calculations. @param wnd @@ -899,7 +899,7 @@ public: small an area as possible should be returned. Of course, if the way in which a background is drawn means that the entire background needs to be repainted on resize, then the entire new size should be returned. - + @param dc A device context to use when one is required for size calculations. @param wnd @@ -915,10 +915,10 @@ public: const wxRibbonPage* wnd, wxSize page_old_size, wxSize page_new_size) = 0; - + /** Calculate the size of a button within a wxRibbonButtonBar. - + @param dc A device context to use when one is required for size calculations. @param wnd @@ -947,7 +947,7 @@ public: The region of the button which constitutes the normal button. @param[out] dropdown_region The region of the button which constitutes the dropdown button. - + @return @true if a size exists for the button, @false otherwise. */ virtual bool GetButtonBarButtonSize( @@ -990,10 +990,10 @@ public: wxDC& dc, const wxString& label, wxRibbonButtonKind kind, wxRibbonButtonBarButtonState size) = 0; - + /** Calculate the size of a minimised ribbon panel. - + @param dc A device context to use when one is required for size calculations. @param wnd @@ -1011,10 +1011,10 @@ public: const wxRibbonPanel* wnd, wxSize* desired_bitmap_size, wxDirection* expanded_panel_direction) = 0; - + /** Calculate the size of a tool within a wxRibbonToolBar. - + @param dc A device context to use when one is required for size calculations. @param wnd diff --git a/interface/wx/ribbon/bar.h b/interface/wx/ribbon/bar.h index 3d98f0ca76..615d07e30b 100644 --- a/interface/wx/ribbon/bar.h +++ b/interface/wx/ribbon/bar.h @@ -77,7 +77,7 @@ public: Returns the page being changed to, or being clicked on. */ wxRibbonPage* GetPage(); - + /** Sets the page relating to this event. */ @@ -120,7 +120,7 @@ public: for wxRibbonPage - a ribbon user interface typically has a ribbon bar, which contains one or more wxRibbonPages, which in turn each contain one or more wxRibbonPanels, which in turn contain controls. - + While a wxRibbonBar has tabs similar to a wxNotebook, it does not follow the same API for adding pages. Containers like wxNotebook can contain any type of window as a page, hence the normal procedure is to create the @@ -128,13 +128,13 @@ public: have wxRibbonPage as children (and a wxRibbonPage can only have a wxRibbonBar as parent), when a page is created, it is automatically added to the bar - there is no AddPage equivalent to call. - + After all pages have been created, and all controls and panels placed on those pages, Realize() must be called. - + @sa wxRibbonPage @sa wxRibbonPanel - + @beginStyleTable @style{wxRIBBON_BAR_DEFAULT_STYLE} Defined as wxRIBBON_BAR_FLOW_HORIZONTAL | @@ -213,7 +213,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRIBBON_BAR_DEFAULT_STYLE); - + /** Create a ribbon bar in two-step ribbon bar construction. Should only be called when the default constructor is used, and @@ -235,7 +235,7 @@ public: tab bar region of the ribbon bar. These margins will be painted with the tab background, but tabs and scroll buttons will never be painted in the margins. - + The left margin could be used for rendering something equivalent to the "Office Button", though this is not currently implemented. The right margin could be used for rendering a help button, and/or MDI buttons, @@ -247,7 +247,7 @@ public: Set the art provider to be used be the ribbon bar. Also sets the art provider on all current wxRibbonPage children, and any wxRibbonPage children added in the future. - + Note that unlike most other ribbon controls, the ribbon bar creates a default art provider when initialised, so an explicit call to SetArtProvider() is not required if the default art provider is @@ -260,17 +260,17 @@ public: /** Set the active page by index, without triggering any events. - + @param page The zero-based index of the page to activate. @return @true if the specified page is now active, @false if it could not be activated (for example because the page index is invalid). */ bool SetActivePage(size_t page); - + /** Set the active page, without triggering any events. - + @param page The page to activate. @return @true if the specified page is now active, @false if it could @@ -278,21 +278,21 @@ public: of the ribbon bar). */ bool SetActivePage(wxRibbonPage* page); - + /** Get the index of the active page. - + In the rare case of no page being active, -1 is returned. */ int GetActivePage() const; - + /** Get a page by index. - + NULL will be returned if the given index is out of range. */ wxRibbonPage* GetPage(int n); - + /** Get the number of pages in this bar. @@ -302,7 +302,7 @@ public: /** Dismiss the expanded panel of the currently active page. - + Calls and returns the value from wxRibbonPage::DismissExpandedPanel() for the currently active page, or @false if there is no active page. */ @@ -433,7 +433,7 @@ public: @since 2.9.2 */ bool ArePanelsShown() const; - + /** Returns the current display mode of the panel area. @@ -449,7 +449,7 @@ public: children. This must be called after all of the bar's children have been created (and their children created, etc.) - if it is not, then windows may not be laid out or sized correctly. - + Also calls wxRibbonPage::Realize() on each child page. */ virtual bool Realize(); diff --git a/interface/wx/ribbon/buttonbar.h b/interface/wx/ribbon/buttonbar.h index 9b18fba7ce..b98b20f5a2 100644 --- a/interface/wx/ribbon/buttonbar.h +++ b/interface/wx/ribbon/buttonbar.h @@ -7,12 +7,12 @@ /** Flags for button bar button size and state. - + Buttons on a ribbon button bar can each come in three sizes: small, medium, and large. In some places this is called the size class, and the term size used for the pixel width and height associated with a particular size class. - + A button can also be in zero or more hovered or active states, or in the disabled state. */ @@ -23,19 +23,19 @@ enum wxRibbonButtonBarButtonState provider, but it will be smaller than medium). */ wxRIBBON_BUTTONBAR_BUTTON_SMALL = 0 << 0, - + /** Button is medium sized (the interpretation of medium is dependent upon the art provider, but it will be between small and large). */ wxRIBBON_BUTTONBAR_BUTTON_MEDIUM = 1 << 0, - + /** Button is large (the interpretation of large is dependent upon the art provider, but it will be larger than medium). */ wxRIBBON_BUTTONBAR_BUTTON_LARGE = 2 << 0, - + /** A mask to extract button size from a combination of flags. */ @@ -46,24 +46,24 @@ enum wxRibbonButtonBarButtonState the mouse cursor. Only applicable to normal and hybrid buttons. */ wxRIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED = 1 << 3, - + /** The dropdown region of the button is being hovered over by the mouse cursor. Only applicable to dropdown and hybrid buttons. */ wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED = 1 << 4, - + /** A mask to extract button hover state from a combination of flags. */ wxRIBBON_BUTTONBAR_BUTTON_HOVER_MASK = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED, - + /** The normal (non-dropdown) region of the button is being pressed. Only applicable to normal and hybrid buttons. */ wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE = 1 << 5, - + /** The dropdown region of the button is being pressed. Only applicable to dropdown and hybrid buttons. @@ -81,12 +81,12 @@ enum wxRibbonButtonBarButtonState disabled. */ wxRIBBON_BUTTONBAR_BUTTON_DISABLED = 1 << 7, - + /** The button is a toggle button which is currently in the toggled state. */ wxRIBBON_BUTTONBAR_BUTTON_TOGGLED = 1 << 8, - + /** A mask to extract button state from a combination of flags. */ @@ -95,7 +95,7 @@ enum wxRibbonButtonBarButtonState /** @class wxRibbonButtonBar - + A ribbon button bar is similar to a traditional toolbar. It contains one or more buttons (button bar buttons, not wxButtons), each of which has a label and an icon. It differs from a wxRibbonToolBar in several ways: @@ -106,7 +106,7 @@ enum wxRibbonButtonBarButtonState @li There is no grouping of buttons on a button bar @li A button bar typically has a border around each individual button, whereas a tool bar typically has a border around each group of buttons. - + @beginEventEmissionTable{wxRibbonButtonBarEvent} @event{EVT_RIBBONBUTTONBAR_CLICKED(id, func)} Triggered when the normal (non-dropdown) region of a button on the @@ -117,7 +117,7 @@ enum wxRibbonButtonBarButtonState event handler if it wants to display a popup menu (which is what most dropdown buttons should be doing). @endEventTable - + @library{wxribbon} @category{ribbon} */ @@ -133,7 +133,7 @@ public: /** Construct a ribbon button bar with the given parameters. - + @param parent Parent window for the button bar (typically a wxRibbonPanel). @param id @@ -179,7 +179,7 @@ public: /** Add a dropdown button to the button bar (simple version). - + @see AddButton() */ virtual wxRibbonButtonBarButtonBase* AddDropdownButton( @@ -190,7 +190,7 @@ public: /** Add a hybrid button to the button bar (simple version). - + @see AddButton() */ virtual wxRibbonButtonBarButtonBase* AddHybridButton( @@ -198,10 +198,10 @@ public: const wxString& label, const wxBitmap& bitmap, const wxString& help_string = wxEmptyString); - + /** Add a toggle button to the button bar (simple version). - + @see AddButton() */ virtual wxRibbonButtonBarButtonBase* AddToggleButton( @@ -209,10 +209,10 @@ public: const wxString& label, const wxBitmap& bitmap, const wxString& help_string = wxEmptyString); - + /** Add a button to the button bar. - + @param button_id ID of the new button (used for event callbacks). @param label @@ -235,10 +235,10 @@ public: The kind of button to add. @param help_string The UI help string to associate with the new button. - + @return An opaque pointer which can be used only with other button bar methods. - + @see AddDropdownButton() @see AddHybridButton() @see AddToggleButton() @@ -431,20 +431,20 @@ public: /** Calculate button layouts and positions. - + Must be called after buttons are added to the button bar, as otherwise the newly added buttons will not be displayed. In normal situations, it will be called automatically when wxRibbonBar::Realize() is called. */ virtual bool Realize(); - + /** Delete all buttons from the button bar. - + @see DeleteButton() */ virtual void ClearButtons(); - + /** Delete a single button from the button bar. @@ -454,20 +454,20 @@ public: @see ClearButtons() */ virtual bool DeleteButton(int button_id); - + /** Enable or disable a single button on the bar. - + @param button_id ID of the button to enable or disable. @param enable @true to enable the button, @false to disable it. */ virtual void EnableButton(int button_id, bool enable = true); - + /** Set a toggle button to the checked or unchecked state. - + @param button_id ID of the toggle button to manipulate. @param checked @@ -678,12 +678,12 @@ public: Returns the bar which contains the button which the event relates to. */ wxRibbonButtonBar* GetBar(); - + /** Sets the button bar relating to this event. */ void SetBar(wxRibbonButtonBar* bar); - + /** Returns the button which the event relates to. diff --git a/interface/wx/ribbon/gallery.h b/interface/wx/ribbon/gallery.h index 2b34f83a64..6fd8145746 100644 --- a/interface/wx/ribbon/gallery.h +++ b/interface/wx/ribbon/gallery.h @@ -238,7 +238,7 @@ public: direction, @false if it did not scroll. */ virtual bool ScrollLines(int lines); - + /** Scroll the gallery contents by some fine-grained amount. diff --git a/interface/wx/ribbon/page.h b/interface/wx/ribbon/page.h index c6e2845342..1e62dda8aa 100644 --- a/interface/wx/ribbon/page.h +++ b/interface/wx/ribbon/page.h @@ -9,7 +9,7 @@ @class wxRibbonPage Container for related ribbon panels, and a tab within a ribbon bar. - + @see wxRibbonBar @see wxRibbonPanel @@ -28,7 +28,7 @@ public: /** Constructs a ribbon page, which must be a child of a ribbon bar. - + @param parent Pointer to a parent wxRibbonBar (unlike most controls, a wxRibbonPage can only have wxRibbonBar as a parent). @@ -53,7 +53,7 @@ public: Destructor. */ virtual ~wxRibbonPage(); - + /** Create a ribbon page in two-step ribbon page construction. Should only be called when the default constructor is used, and @@ -69,7 +69,7 @@ public: Set the art provider to be used. Normally called automatically by wxRibbonBar when the page is created, or the art provider changed on the bar. - + The new art provider will be propagated to the children of the page. */ void SetArtProvider(wxRibbonArtProvider* art); @@ -79,10 +79,10 @@ public: displayed if the ribbon bar is actually showing icons). */ wxBitmap& GetIcon(); - + /** Set the size of the page and the external scroll buttons (if any). - + When a page is too small to display all of its children, scroll buttons will appear (and if the page is sized up enough, they will disappear again). Slightly counter-intuitively, these buttons are created as siblings of the @@ -91,78 +91,78 @@ public: buttons, this function behaves the same as SetSize(), however when there are scroll buttons, it positions them at the edges of the given area, and then calls SetSize() with the remaining area. - + This is provided as a separate function to SetSize() rather than within the implementation of SetSize(), as interacting algorithms may not expect SetSize() to also set the size of siblings. */ void SetSizeWithScrollButtonAdjustment(int x, int y, int width, int height); - + /** Expand a rectangle of the page to include external scroll buttons (if any). When no scroll buttons are shown, has no effect. - + @param[in,out] rect The rectangle to adjust. The width and height will not be reduced, and the x and y will not be increased. */ void AdjustRectToIncludeScrollButtons(wxRect* rect) const; - + /** Dismiss the current externally expanded panel, if there is one. - + When a ribbon panel automatically minimises, it can be externally expanded into a floating window. When the user clicks a button in such a panel, the panel should generally re-minimise. Event handlers for buttons on ribbon panels should call this method to achieve this behaviour. - + @return @true if a panel was minimised, @false otherwise. */ bool DismissExpandedPanel(); - + /** Perform a full re-layout of all panels on the page. - + Should be called after panels are added to the page, or the sizing behaviour of a panel on the page changes (i.e. due to children being added to it). Usually called automatically when wxRibbonBar::Realize() is called. - + Will invoke wxRibbonPanel::Realize() for all child panels. */ virtual bool Realize(); /** Scroll the page by some amount up / down / left / right. - + When the page's children are too big to fit in the onscreen area given to the page, scroll buttons will appear, and the page can be programmatically scrolled. Positive values of @a lines will scroll right or down, while negative values will scroll up or left (depending on the direction in which panels are stacked). A line is equivalent to a constant number of pixels. - + @return @true if the page scrolled at least one pixel in the given direction, @false if it did not scroll. - + @see GetMajorAxis() @see ScrollPixels() @see ScrollSections() */ virtual bool ScrollLines(int lines); - + /** Scroll the page by a set number of pixels up / down / left / right. - + When the page's children are too big to fit in the onscreen area given to the page, scroll buttons will appear, and the page can be programmatically scrolled. Positive values of @a lines will scroll right or down, while negative values will scroll up or left (depending on the direction in which panels are stacked). - + @return @true if the page scrolled at least one pixel in the given direction, @false if it did not scroll. - + @see GetMajorAxis() @see ScrollLines() @see ScrollSections() @@ -188,12 +188,12 @@ public: /** Get the direction in which ribbon panels are stacked within the page. - + This is controlled by the style of the containing wxRibbonBar, meaning that all pages within a bar will have the same major axis. As well as being the direction in which panels are stacked, it is also the axis in which scrolling will occur (when required). - + @return wxHORIZONTAL or wxVERTICAL (never wxBOTH). */ wxOrientation GetMajorAxis() const; diff --git a/interface/wx/ribbon/toolbar.h b/interface/wx/ribbon/toolbar.h index 588b6b3ea6..9b7c44c9a9 100644 --- a/interface/wx/ribbon/toolbar.h +++ b/interface/wx/ribbon/toolbar.h @@ -8,11 +8,11 @@ /** @class wxRibbonToolBar - + A ribbon tool bar is similar to a traditional toolbar which has no labels. It contains one or more tool groups, each of which contains one or more tools. Each tool is represented by a (generally small, i.e. 16x15) bitmap. - + @beginEventEmissionTable{wxRibbonToolBarEvent} @event{EVT_RIBBONTOOLBAR_CLICKED(id, func)} Triggered when the normal (non-dropdown) region of a tool on the tool @@ -23,7 +23,7 @@ event handler if it wants to display a popup menu (which is what most dropdown tools should be doing). @endEventTable - + @library{wxribbon} @category{ribbon} */ @@ -39,7 +39,7 @@ public: /** Construct a ribbon tool bar with the given parameters. - + @param parent Parent window for the tool bar (typically a wxRibbonPanel). @param id @@ -84,7 +84,7 @@ public: /** Add a dropdown tool to the tool bar (simple version). - + @see AddTool() */ virtual wxRibbonToolBarToolBase* AddDropdownTool( @@ -94,7 +94,7 @@ public: /** Add a hybrid tool to the tool bar (simple version). - + @see AddTool() */ virtual wxRibbonToolBarToolBase* AddHybridTool( @@ -116,7 +116,7 @@ public: /** Add a tool to the tool bar. - + @param tool_id ID of the new tool (used for event callbacks). @param bitmap @@ -132,10 +132,10 @@ public: The kind of tool to add. @param client_data Client data to associate with the new tool. - + @return An opaque pointer which can be used only with other tool bar methods. - + @see AddDropdownTool(), AddHybridTool(), AddSeparator(), InsertTool() */ virtual wxRibbonToolBarToolBase* AddTool( @@ -148,7 +148,7 @@ public: /** Add a separator to the tool bar. - + Separators are used to separate tools into groups. As such, a separator is not explicitly drawn, but is visually seen as the gap between tool groups. @@ -404,12 +404,12 @@ public: /** Set the number of rows to distribute tool groups over. - + Tool groups can be distributed over a variable number of rows. The way in which groups are assigned to rows is not specified, and the order of groups may change, but they will be distributed in such a way as to minimise the overall size of the tool bar. - + @param nMin The minimum number of rows to use. @param nMax diff --git a/interface/wx/richmsgdlg.h b/interface/wx/richmsgdlg.h index 649e0ae4d4..8cf94dbaae 100644 --- a/interface/wx/richmsgdlg.h +++ b/interface/wx/richmsgdlg.h @@ -115,7 +115,7 @@ public: The footer text if empty no footer text will be used. @see SetFooterIcon(), GetFooterText() - + @since 3.1.1 */ void SetFooterText(const wxString& footerText); diff --git a/interface/wx/richtext/richtextbuffer.h b/interface/wx/richtext/richtextbuffer.h index b58125debd..ae9554605b 100644 --- a/interface/wx/richtext/richtextbuffer.h +++ b/interface/wx/richtext/richtextbuffer.h @@ -4486,7 +4486,7 @@ protected: // Whether the paragraph is impacted by floating objects from above int m_impactedByFloatingObjects; - + // Default tabstops static wxArrayInt sm_defaultTabs; @@ -5702,7 +5702,7 @@ protected: wxRichTextCell is the cell in a table, in which the user can type. As well as text, it can also contain objects e.g. an image, or even another wxRichTextTable. - + A cell's appearance can be changed via its associated wxRichTextAttr; for example its size altered or its background colour set. It also has the properties of column- and row-span. By default these are 1, meaning that the cell only spans @@ -5745,46 +5745,46 @@ public: /** Returns the number of columns spanned by the cell. - + By default a cell doesn't span extra columns, so this function returns 1. - + @since 2.9.5 - + @see SetColSpan(), GetRowSpan() */ int GetColSpan() const; /** Set the number of columns spanned by the cell. - + By default colspan is 1 i.e. a cell doesn't span extra columns. Pass a value >1 to change this. Attempting to set a colspan <1 will assert and be ignored. - + @since 2.9.5 - + @see GetColSpan(), SetRowSpan() */ void SetColSpan(long span); /** Returns the number of rows spanned by the cell. - + By default a cell doesn't span extra rows, so this function returns 1. - + @since 2.9.5 - + @see SetRowSpan(), GetColSpan() */ int GetRowSpan() const; /** Set the number of rows spanned by the cell. - + By default colspan is 1 i.e. a cell doesn't span extra rows. Pass a value >1 to change this. Attempting to set a rowspan <1 will assert and be ignored. - + @since 2.9.5 - + @see GetRowSpan(), SetColSpan() */ void SetRowSpan(long span); @@ -5912,7 +5912,7 @@ public: /** Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none. - */ + */ virtual wxPosition GetFocusedCell() const; // Operations @@ -5996,7 +5996,7 @@ public: wxRichTextTableBlock(const wxRichTextTableBlock& block) { Copy(block); } void Init() { m_colStart = 0; m_colEnd = 0; m_rowStart = 0; m_rowEnd = 0; } - + void Copy(const wxRichTextTableBlock& block) { m_colStart = block.m_colStart; m_colEnd = block.m_colEnd; m_rowStart = block.m_rowStart; m_rowEnd = block.m_rowEnd; diff --git a/interface/wx/richtext/richtextctrl.h b/interface/wx/richtext/richtextctrl.h index 3af29d13a5..2346593a3a 100644 --- a/interface/wx/richtext/richtextctrl.h +++ b/interface/wx/richtext/richtextctrl.h @@ -595,7 +595,7 @@ public: */ virtual void DiscardEdits(); - + void SetModified(bool modified); /** @@ -1236,7 +1236,7 @@ public: left of the actual paragraph is leftSubIndent. */ bool BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD); - + /** Ends application of a numbered bullet. */ @@ -1248,7 +1248,7 @@ public: to render the bulleted paragraph. */ bool BeginSymbolBullet(const wxString& symbol, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL); - + /** Ends applying a symbol bullet. */ @@ -1503,7 +1503,7 @@ public: @a style must have flags indicating which attributes are of interest. */ virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const; - + /** Test if this whole range has paragraph attributes of the specified kind. @@ -1512,7 +1512,7 @@ public: @a style must have flags indicating which attributes are of interest. */ virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const; - + /** Returns @true if all of the selection, or the content at the caret position, is bold. @@ -2400,7 +2400,7 @@ public: Copy constructor. */ wxRichTextEvent(const wxRichTextEvent& event); - + /** Returns the buffer position at which the event occurred. */ diff --git a/interface/wx/sashwin.h b/interface/wx/sashwin.h index 28d48f8e7e..5710e09a2d 100644 --- a/interface/wx/sashwin.h +++ b/interface/wx/sashwin.h @@ -275,7 +275,7 @@ public: */ wxSashEdgePosition GetEdge() const; - + void SetEdge(wxSashEdgePosition edge); void SetDragRect(const wxRect& rect); void SetDragStatus(wxSashDragStatus status); diff --git a/interface/wx/scopedptr.h b/interface/wx/scopedptr.h index c72936eb0a..4895ee96e6 100644 --- a/interface/wx/scopedptr.h +++ b/interface/wx/scopedptr.h @@ -238,8 +238,8 @@ public: T& operator*() const; /** - Smart pointer member access. Returns pointer to object. - + Smart pointer member access. Returns pointer to object. + If the internal pointer is @NULL this method will cause an assert in debug mode. */ T* operator->() const; diff --git a/interface/wx/scrolbar.h b/interface/wx/scrolbar.h index 1f7ff099ef..18e7d155ff 100644 --- a/interface/wx/scrolbar.h +++ b/interface/wx/scrolbar.h @@ -124,10 +124,10 @@ public: @param id Window identifier. The value wxID_ANY indicates a default value. @param pos - Window position. + Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then a default size is chosen. @param style Window style. See wxScrollBar. diff --git a/interface/wx/scrolwin.h b/interface/wx/scrolwin.h index 7b44ae250c..177ce0545a 100644 --- a/interface/wx/scrolwin.h +++ b/interface/wx/scrolwin.h @@ -539,7 +539,7 @@ public: void SetTargetWindow(wxWindow *window); wxWindow *GetTargetWindow() const; - + void SetTargetRect(const wxRect& rect); wxRect GetTargetRect() const; @@ -562,13 +562,13 @@ public: window. */ void StopAutoScrolling(); - + /** This method can be overridden in a derived class to forbid sending the auto scroll events - note that unlike StopAutoScrolling() it doesn't stop the timer, so it will be called repeatedly and will typically return different values depending on the current mouse position - + The base class version just returns true. */ virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const; diff --git a/interface/wx/settings.h b/interface/wx/settings.h index 11f913a2f6..925c6aa9c4 100644 --- a/interface/wx/settings.h +++ b/interface/wx/settings.h @@ -257,7 +257,7 @@ enum wxSystemScreenType wxSystemSettings allows the application to ask for details about the system. - This can include settings such as standard colours, fonts, and user interface + This can include settings such as standard colours, fonts, and user interface element sizes. @library{wxcore} @@ -279,9 +279,9 @@ public: /** Returns a system colour. - @param index + @param index Can be one of the ::wxSystemColour enum values. - + @return The returned colour is always valid. */ @@ -290,9 +290,9 @@ public: /** Returns a system font. - @param index + @param index Can be one of the ::wxSystemFont enum values. - + @return The returned font is always valid. */ diff --git a/interface/wx/sizer.h b/interface/wx/sizer.h index e096c08c9d..c42fd3e380 100644 --- a/interface/wx/sizer.h +++ b/interface/wx/sizer.h @@ -294,7 +294,7 @@ public: int flag = 0, int border = 0, wxObject* userData = NULL); - + /** Appends a spacer child to the sizer. @@ -309,7 +309,7 @@ public: wxSizerItem* Add( int width, int height, const wxSizerFlags& flags); wxSizerItem* Add(wxSizerItem* item); - + /** This base function adds non-stretchable space to both the horizontal and vertical orientation of the sizer. @@ -439,7 +439,7 @@ public: */ virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); - + //@{ /** Returns the list of the items in this sizer. @@ -460,7 +460,7 @@ public: Set the window this sizer is used in. */ void SetContainingWindow(wxWindow *window); - + /** Returns the number of items in the sizer. @@ -617,7 +617,7 @@ public: const wxSizerFlags& flags); wxSizerItem* Insert(size_t index, wxSizerItem* item); - + /** Inserts non-stretchable space to the sizer. More readable way of calling wxSizer::Insert(index, size, size). @@ -713,7 +713,7 @@ public: wxSizerItem* Prepend(int width, int height, const wxSizerFlags& flags); wxSizerItem* Prepend(wxSizerItem* item); - + /** Prepends non-stretchable space to the sizer. More readable way of calling wxSizer::Prepend(size, size, 0). @@ -1715,7 +1715,7 @@ public: virtual void RecalcSizes(); virtual wxSize CalcMin(); - + }; @@ -1778,7 +1778,7 @@ public: number of columns or rows being currently used, see GetEffectiveColsCount() */ int GetCols() const; - + /** Returns the number of rows that has been specified for the sizer. @@ -1798,7 +1798,7 @@ public: @since 2.9.1 */ int GetEffectiveColsCount() const; - + /** Returns the number of rows currently used by the sizer. diff --git a/interface/wx/slider.h b/interface/wx/slider.h index 68815389c5..f35e3cf574 100644 --- a/interface/wx/slider.h +++ b/interface/wx/slider.h @@ -167,10 +167,10 @@ public: @param maxValue Maximum slider position. @param pos - Window position. + Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then a default size is chosen. @param style Window style. See wxSlider. @@ -306,7 +306,7 @@ public: @param minValue The new bottom end of the slider range. - + @see GetMin(), SetRange() */ void SetMin( int minValue ); @@ -316,7 +316,7 @@ public: @param maxValue The new top end of the slider range. - + @see GetMax(), SetRange() */ void SetMax( int maxValue ); diff --git a/interface/wx/srchctrl.h b/interface/wx/srchctrl.h index 975a137703..0709cb9e11 100644 --- a/interface/wx/srchctrl.h +++ b/interface/wx/srchctrl.h @@ -100,7 +100,7 @@ public: */ virtual ~wxSearchCtrl(); - + bool Create(wxWindow* parent, wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, @@ -126,7 +126,7 @@ public: Returns the cancel button's visibility state. */ virtual bool IsCancelButtonVisible() const; - + /** Sets the search control's menu object. If there is already a menu associated with the search control it is deleted. diff --git a/interface/wx/statbmp.h b/interface/wx/statbmp.h index 06bfce85b2..e47094ae58 100644 --- a/interface/wx/statbmp.h +++ b/interface/wx/statbmp.h @@ -33,36 +33,36 @@ class wxStaticBitmap : public wxControl public: /** Specify how the bitmap should be scaled in the control. - + @see SetScaleMode(), GetScaleMode() */ enum ScaleMode { - /** + /** The bitmap is displayed in original size. Portions larger then the control will be cut off. */ Scale_None, - + /** Scale the bitmap to fit the size of the control by changing the aspect ratio of the bitmap if necessary. */ Scale_Fill, - + /** Scale the bitmap to fit the size of the control by maintaining the aspect ratio. Any remaining area of the control will use the background. */ Scale_AspectFit, - + /** Scale the bitmap to fill the size of the control. Some portion of the bitmap may be clipped to fill the control. */ Scale_AspectFill }; - + /** Default constructor */ @@ -138,31 +138,31 @@ public: The new icon. */ virtual void SetIcon(const wxIcon& label); - + /** Sets the scale mode. - + @param scaleMode Controls how the bitmap is scaled inside the control. - + @note Currently only the generic implementation supports all scaling modes. You may use generic implementation wxGenericStaticBitmap declared in \ in all ports. - + @see GetScaleMode() - + @since 3.1.0 */ virtual void SetScaleMode(ScaleMode scaleMode); - + /** Returns the scale mode currently used in the control. - + @see SetScaleMode() - + @since 3.1.0 */ virtual ScaleMode GetScaleMode() const; - + }; diff --git a/interface/wx/stc/stc.h b/interface/wx/stc/stc.h index 528667382d..3c992fe511 100644 --- a/interface/wx/stc/stc.h +++ b/interface/wx/stc/stc.h @@ -7,7 +7,7 @@ /* IMPORTANT: This file is generated by src/stc/gen_iface.py from - src/stc/stc.interface.h.in. Do not edit the file in + src/stc/stc.interface.h.in. Do not edit the file in interface/wx/stc or your changes will be lost. */ @@ -7275,7 +7275,7 @@ public: /** Extract style settings from a spec-string which is composed of one or more of the following comma separated elements: - + bold turns on bold italic turns on italics fore:[name or \#RRGGBB] sets the foreground colour diff --git a/interface/wx/stream.h b/interface/wx/stream.h index 5eccd60e15..b7f5bbc4f1 100644 --- a/interface/wx/stream.h +++ b/interface/wx/stream.h @@ -662,7 +662,7 @@ public: /** Changes the stream current position. - This operation in general is possible only for seekable streams + This operation in general is possible only for seekable streams (see wxStreamBase::IsSeekable()); non-seekable streams support only seeking positive amounts in mode @c wxFromCurrent (this is implemented by reading data and simply discarding it). diff --git a/interface/wx/sysopt.h b/interface/wx/sysopt.h index 2453fe6eea..bbf3d1ccac 100644 --- a/interface/wx/sysopt.h +++ b/interface/wx/sysopt.h @@ -112,7 +112,7 @@ If 1 activates the spell checking in wxTextCtrl. @flag{osx.openfiledialog.always-show-types} Per default a wxFileDialog with wxFD_OPEN does not show a types-popup on OS X but allows - the selection of files from any of the supported types. Setting this to 1 shows a wxChoice + the selection of files from any of the supported types. Setting this to 1 shows a wxChoice for selection (if there is more than one supported filetype). @endFlagTable diff --git a/interface/wx/textwrapper.h b/interface/wx/textwrapper.h index f4a3822cd9..495cb90ed1 100644 --- a/interface/wx/textwrapper.h +++ b/interface/wx/textwrapper.h @@ -19,7 +19,7 @@ Here is an example function using this class which inserts hard line breaks into a string of text at the positions where it would be wrapped: - + @code wxString WrapText(wxWindow *win, const wxString& text, int widthMax) { diff --git a/interface/wx/thread.h b/interface/wx/thread.h index c9ba40baf3..65d14dcddf 100644 --- a/interface/wx/thread.h +++ b/interface/wx/thread.h @@ -1224,7 +1224,7 @@ public: of detached threads. This function can only be called from another thread context. - + Finally, note that once a thread has completed and its Entry() function returns, you cannot call Run() on it again (an assert will fail in debug builds or @c wxTHREAD_RUNNING will be returned in release builds). diff --git a/interface/wx/timectrl.h b/interface/wx/timectrl.h index 0d1b77c542..daaba32ac6 100644 --- a/interface/wx/timectrl.h +++ b/interface/wx/timectrl.h @@ -57,7 +57,7 @@ public: Default constructor. */ wxTimePickerCtrl(); - + /** Initializes the object and calls Create() with all the parameters. */ diff --git a/interface/wx/timer.h b/interface/wx/timer.h index 6753e2dd12..d0a884c7b7 100644 --- a/interface/wx/timer.h +++ b/interface/wx/timer.h @@ -154,7 +154,7 @@ public: @class wxTimerRunner Starts the timer in its ctor, stops in the dtor. -*/ +*/ class wxTimerRunner { public: diff --git a/interface/wx/tokenzr.h b/interface/wx/tokenzr.h index d7861593b0..2ab0829f6b 100644 --- a/interface/wx/tokenzr.h +++ b/interface/wx/tokenzr.h @@ -7,7 +7,7 @@ /** The behaviour of wxStringTokenizer is governed by the - wxStringTokenizer::wxStringTokenizer() or wxStringTokenizer::SetString() + wxStringTokenizer::wxStringTokenizer() or wxStringTokenizer::SetString() with the parameter @e mode, which may be one of the following: */ enum wxStringTokenizerMode @@ -27,7 +27,7 @@ enum wxStringTokenizerMode /** In this mode, the empty tokens in the middle of the string will be returned, - i.e. @c "a::b:" will be tokenized in three tokens @c 'a', @c '' and @c 'b'. + i.e. @c "a::b:" will be tokenized in three tokens @c 'a', @c '' and @c 'b'. Notice that all trailing delimiters are ignored in this mode, not just the last one, i.e. a string @c "a::b::" would still result in the same set of tokens. */ @@ -72,7 +72,7 @@ enum wxStringTokenizerMode string to tokenize and also the delimiters which separate tokens in the string (by default, white space characters will be used). - Then wxStringTokenizer::GetNextToken() may be called repeatedly until + Then wxStringTokenizer::GetNextToken() may be called repeatedly until wxStringTokenizer::HasMoreTokens() returns @false. For example: @@ -169,17 +169,17 @@ public: //@{ /** - This is a convenience function wrapping wxStringTokenizer which simply + This is a convenience function wrapping wxStringTokenizer which simply returns all tokens found in the given @a str as an array. - Please see wxStringTokenizer::wxStringTokenizer for the description + Please see wxStringTokenizer::wxStringTokenizer for the description of the other parameters. @return The array with the parsed tokens. @header{wx/tokenzr.h} */ -wxArrayString +wxArrayString wxStringTokenize(const wxString& str, const wxString& delims = wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode = wxTOKEN_DEFAULT); diff --git a/interface/wx/toplevel.h b/interface/wx/toplevel.h index 6935d638ce..5ad74b5912 100644 --- a/interface/wx/toplevel.h +++ b/interface/wx/toplevel.h @@ -445,11 +445,11 @@ public: */ wxWindow* SetDefaultItem(wxWindow* win); - + wxWindow* SetTmpDefaultItem(wxWindow * win); wxWindow* GetTmpDefaultItem() const; - + /** Sets the icon for this window. @@ -571,20 +571,20 @@ public: there are any open top level windows. */ virtual bool ShouldPreventAppExit() const; - + /** This function sets the wxTopLevelWindow's modified state on OS X, which currently draws a black dot in the wxTopLevelWindow's close button. On other platforms, this method does nothing. - + @see OSXIsModified() */ virtual void OSXSetModified(bool modified); - + /** Returns the current modified state of the wxTopLevelWindow on OS X. On other platforms, this method does nothing. - + @see OSXSetModified() */ virtual bool OSXIsModified() const; @@ -611,7 +611,7 @@ public: virtual void ShowWithoutActivating(); /** - Enables the maximize button to toggle full screen mode. Prior to + Enables the maximize button to toggle full screen mode. Prior to OS X 10.10 a full screen button is added to the right upper corner of a window's title bar. diff --git a/interface/wx/treectrl.h b/interface/wx/treectrl.h index 329ad6fe7a..1138f59d3f 100644 --- a/interface/wx/treectrl.h +++ b/interface/wx/treectrl.h @@ -185,7 +185,7 @@ public: Window position. If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. + Window size. If ::wxDefaultSize is specified then the window is sized appropriately. @param style Window style. See wxTreeCtrl. @@ -470,7 +470,7 @@ public: Returns the item last clicked or otherwise selected. Unlike GetSelection(), it can be used whether or not the control has the @c wxTR_MULTIPLE style. - + @since 2.9.1 */ virtual wxTreeItemId GetFocusedItem() const; @@ -647,7 +647,7 @@ public: /** Returns the selection, or an invalid item if there is no selection. This function only works with the controls without @c wxTR_MULTIPLE style, - use GetSelections() for the controls which do have this style + use GetSelections() for the controls which do have this style or, if a single item is wanted, use GetFocusedItem(). */ virtual wxTreeItemId GetSelection() const; diff --git a/interface/wx/treelist.h b/interface/wx/treelist.h index 45c8d12c19..19633a3204 100644 --- a/interface/wx/treelist.h +++ b/interface/wx/treelist.h @@ -41,7 +41,7 @@ enum /** @class wxTreeListItem - + Unique identifier of an item in wxTreeListCtrl. This is an opaque class which can't be used by the application in any other @@ -74,7 +74,7 @@ public: /** @class wxTreeListItemComparator - + Class defining sort order for the items in wxTreeListCtrl. @see wxTreeListCtrl diff --git a/interface/wx/utils.h b/interface/wx/utils.h index 4557fc4f27..b4267d0f92 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -866,7 +866,7 @@ bool wxGetUserName(char* buf, int sz); wxString wxGetOsDescription(); /** - Gets the version and the operating system ID for currently running OS. + Gets the version and the operating system ID for currently running OS. The returned wxOperatingSystemId value can be used for a basic categorization of the OS family; the major, minor, and micro version numbers allows detecting a specific system. @@ -885,8 +885,8 @@ wxString wxGetOsDescription(); For OS X systems (@c wxOS_MAC) the major and minor version integers are the natural version numbers associated with the OS; e.g. "10", "11" and "2" if the machine is using OS X El Capitan 10.11.2. - - For Windows-like systems (@c wxOS_WINDOWS) the major and minor version integers will + + For Windows-like systems (@c wxOS_WINDOWS) the major and minor version integers will contain the following values: @beginTable @row3col{Windows OS name, Major version, Minor version} @@ -954,15 +954,15 @@ bool wxIsPlatformLittleEndian(); /** Returns a structure containing information about the currently running Linux distribution. - - This function uses the @c lsb_release utility which is part of the - Linux Standard Base Core specification - (see http://refspecs.linux-foundation.org/lsb.shtml) since the very first LSB + + This function uses the @c lsb_release utility which is part of the + Linux Standard Base Core specification + (see http://refspecs.linux-foundation.org/lsb.shtml) since the very first LSB release 1.0 (released in 2001). The @c lsb_release utility is very common on modern Linux distributions but in case it's not available, then this function will return a ::wxLinuxDistributionInfo structure containing empty strings. - + This function is Linux-specific and is only available when the @c __LINUX__ symbol is defined. */ diff --git a/interface/wx/validate.h b/interface/wx/validate.h index 1096077019..f1eaddc0ad 100644 --- a/interface/wx/validate.h +++ b/interface/wx/validate.h @@ -81,7 +81,7 @@ public: Returns if the error sound is currently disabled. */ static bool IsSilent(); - + /** Associates a window with the validator. diff --git a/interface/wx/webview.h b/interface/wx/webview.h index ffa2166878..0b441b3d0b 100644 --- a/interface/wx/webview.h +++ b/interface/wx/webview.h @@ -381,14 +381,14 @@ public: /** Factory function to create a new wxWebView with two-step creation, wxWebView::Create should be called on the returned object. - @param backend The backend web rendering engine to use. + @param backend The backend web rendering engine to use. @c wxWebViewBackendDefault, @c wxWebViewBackendIE and @c wxWebViewBackendWebKit are predefined where appropriate. @return The created wxWebView @since 2.9.5 */ static wxWebView* New(const wxString& backend = wxWebViewBackendDefault); - + /** Factory function to create a new wxWebView using a wxWebViewFactory. @param parent Parent window for the control @@ -415,15 +415,15 @@ public: long style = 0, const wxString& name = wxWebViewNameStr); - /** + /** Allows the registering of new backend for wxWebView. @a backend can be used as an argument to New(). @param backend The name for the new backend to be registered under - @param factory A shared pointer to the factory which creates the + @param factory A shared pointer to the factory which creates the appropriate backend. @since 2.9.5 */ - static void RegisterFactory(const wxString& backend, + static void RegisterFactory(const wxString& backend, wxSharedPtr factory); /** diff --git a/interface/wx/window.h b/interface/wx/window.h index 2ba856ea40..18f7b7b9af 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -486,7 +486,7 @@ public: container windows. */ virtual bool AcceptsFocusRecursively() const; - + /** Can this window itself have focus? */ @@ -494,7 +494,7 @@ public: /** Can this window have focus right now? - + If this method returns true, it means that calling SetFocus() will put focus either to this window or one of its children, if you need to know whether this window accepts focus itself, use IsFocusable() @@ -1410,7 +1410,7 @@ public: InformFirstDirection(int direction, int size, int availableOtherDir); - + /** Resets the cached best size value so it will be recalculated the next time it is needed. @@ -1793,7 +1793,7 @@ public: wxRect GetClientRect() const; - + /** Moves the window to the given position. @@ -3609,7 +3609,7 @@ public: */ wxBorder GetBorder() const; - + /** Does the window-specific updating after processing the update event. This function is called by UpdateWindowUI() in order to check return @@ -3721,7 +3721,7 @@ public: */ virtual bool IsTopLevel() const; - + /** This virtual function is normally only used internally, but sometimes an application may need it to implement functionality diff --git a/interface/wx/withimages.h b/interface/wx/withimages.h index a52104a2ab..3adc3e0d84 100644 --- a/interface/wx/withimages.h +++ b/interface/wx/withimages.h @@ -28,7 +28,7 @@ public: /** Sets the image list to use. It does not take ownership of the image list, you must delete it yourself. - + @see wxImageList, AssignImageList() */ virtual void SetImageList(wxImageList* imageList); @@ -39,7 +39,7 @@ public: @see wxImageList, SetImageList() */ wxImageList* GetImageList() const; - + protected: /** Return true if we have a valid image list. diff --git a/interface/wx/wrapsizer.h b/interface/wx/wrapsizer.h index 61bc160bb3..302da9643f 100644 --- a/interface/wx/wrapsizer.h +++ b/interface/wx/wrapsizer.h @@ -58,7 +58,7 @@ public: */ virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); - + virtual void RecalcSizes(); virtual wxSize CalcMin(); diff --git a/interface/wx/xlocale.h b/interface/wx/xlocale.h index 21481dccf7..da67f0b127 100644 --- a/interface/wx/xlocale.h +++ b/interface/wx/xlocale.h @@ -49,7 +49,7 @@ @stdobjects @li ::wxNullXLocale - + @see wxLocale */ class wxXLocale @@ -85,7 +85,7 @@ public: or @false otherwise. */ bool IsOk() const; - + /** Comparison operator. */ diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 10d613e618..53a80d920d 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -458,7 +458,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_BUTTON( ID_SHOW_ATTRIBUTES, MyFrame::OnShowAttributes) EVT_CHECKBOX( ID_MULTIPLE_SORT, MyFrame::OnMultipleSort) EVT_CHECKBOX( ID_SORT_BY_FIRST_COLUMN, MyFrame::OnSortByFirstColumn) - + // Fourth page. EVT_BUTTON( ID_DELETE_TREE_ITEM, MyFrame::OnDeleteTreeItem ) EVT_BUTTON( ID_DELETE_ALL_TREE_ITEMS, MyFrame::OnDeleteAllTreeItems ) diff --git a/samples/html/html_samples.bkl b/samples/html/html_samples.bkl index f147d02f28..102802e4d7 100644 --- a/samples/html/html_samples.bkl +++ b/samples/html/html_samples.bkl @@ -2,7 +2,7 @@ - +