Add wxVersionInfo and functions returning it for 3rd party libraries.

Add simple wxVersionInfo class holding the version information.

Also add GetLibraryVersionInfo() static method to wx{JPEG,PNG,TIFF}Handler,
wxStyledTextCtrl and wxXmlDocument classes and wxGetZlibVersionInfo() and
wxGetLibraryVersionInfo() global functions using it.

Closes #12690.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-25 00:53:44 +00:00
parent 5b70f2de3f
commit ccec90930c
33 changed files with 411 additions and 9 deletions

View File

@@ -453,6 +453,7 @@ ALL_BASE_HEADERS = \
wx/variant.h \ wx/variant.h \
wx/vector.h \ wx/vector.h \
wx/version.h \ wx/version.h \
wx/versioninfo.h \
wx/volume.h \ wx/volume.h \
wx/weakref.h \ wx/weakref.h \
wx/wfstream.h \ wx/wfstream.h \
@@ -623,6 +624,7 @@ ALL_PORTS_BASE_HEADERS = \
wx/variant.h \ wx/variant.h \
wx/vector.h \ wx/vector.h \
wx/version.h \ wx/version.h \
wx/versioninfo.h \
wx/volume.h \ wx/volume.h \
wx/weakref.h \ wx/weakref.h \
wx/wfstream.h \ wx/wfstream.h \

View File

@@ -538,6 +538,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/variant.h wx/variant.h
wx/vector.h wx/vector.h
wx/version.h wx/version.h
wx/versioninfo.h
wx/volume.h wx/volume.h
wx/weakref.h wx/weakref.h
wx/wfstream.h wx/wfstream.h

View File

@@ -1607,6 +1607,10 @@ SOURCE=..\..\include\wx\version.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\include\wx\versioninfo.h
# End Source File
# Begin Source File
SOURCE=..\..\include\wx\volume.h SOURCE=..\..\include\wx\volume.h
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@@ -1637,6 +1637,9 @@
<File <File
RelativePath="..\..\include\wx\version.h"> RelativePath="..\..\include\wx\version.h">
</File> </File>
<File
RelativePath="..\..\include\wx\versioninfo.h">
</File>
<File <File
RelativePath="..\..\include\wx\volume.h"> RelativePath="..\..\include\wx\volume.h">
</File> </File>

View File

@@ -2201,6 +2201,10 @@
RelativePath="..\..\include\wx\version.h" RelativePath="..\..\include\wx\version.h"
> >
</File> </File>
<File
RelativePath="..\..\include\wx\versioninfo.h"
>
</File>
<File <File
RelativePath="..\..\include\wx\volume.h" RelativePath="..\..\include\wx\volume.h"
> >

View File

@@ -2197,6 +2197,10 @@
RelativePath="..\..\include\wx\version.h" RelativePath="..\..\include\wx\version.h"
> >
</File> </File>
<File
RelativePath="..\..\include\wx\versioninfo.h"
>
</File>
<File <File
RelativePath="..\..\include\wx\volume.h" RelativePath="..\..\include\wx\volume.h"
> >

View File

@@ -416,6 +416,7 @@ All:
- Added wxThread::OnKill() and OnDelete() callbacks. - Added wxThread::OnKill() and OnDelete() callbacks.
- Added wxFile::GetLastError() and ClearLastError() (ryazanov). - Added wxFile::GetLastError() and ClearLastError() (ryazanov).
- Added negatable command line switches (Armel Asselin). - Added negatable command line switches (Armel Asselin).
- Added wxVersionInfo and various GetLibraryVersionInfo() functions (troelsk).
Unix: Unix:

View File

@@ -19,6 +19,7 @@
#if wxUSE_LIBJPEG #if wxUSE_LIBJPEG
#include "wx/image.h" #include "wx/image.h"
#include "wx/versioninfo.h"
class WXDLLIMPEXP_CORE wxJPEGHandler: public wxImageHandler class WXDLLIMPEXP_CORE wxJPEGHandler: public wxImageHandler
{ {
@@ -33,6 +34,8 @@ public:
m_mime = wxT("image/jpeg"); m_mime = wxT("image/jpeg");
} }
static wxVersionInfo GetLibraryVersionInfo();
#if wxUSE_STREAMS #if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );

View File

@@ -19,6 +19,7 @@
#if wxUSE_LIBPNG #if wxUSE_LIBPNG
#include "wx/image.h" #include "wx/image.h"
#include "wx/versioninfo.h"
#define wxIMAGE_OPTION_PNG_FORMAT wxT("PngFormat") #define wxIMAGE_OPTION_PNG_FORMAT wxT("PngFormat")
#define wxIMAGE_OPTION_PNG_BITDEPTH wxT("PngBitDepth") #define wxIMAGE_OPTION_PNG_BITDEPTH wxT("PngBitDepth")
@@ -46,6 +47,8 @@ public:
m_mime = wxT("image/png"); m_mime = wxT("image/png");
} }
static wxVersionInfo GetLibraryVersionInfo();
#if wxUSE_STREAMS #if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );

View File

@@ -19,6 +19,7 @@
#if wxUSE_LIBTIFF #if wxUSE_LIBTIFF
#include "wx/image.h" #include "wx/image.h"
#include "wx/versioninfo.h"
// defines for wxImage::SetOption // defines for wxImage::SetOption
#define wxIMAGE_OPTION_BITSPERSAMPLE wxString(wxT("BitsPerSample")) #define wxIMAGE_OPTION_BITSPERSAMPLE wxString(wxT("BitsPerSample"))
@@ -31,6 +32,8 @@ class WXDLLIMPEXP_CORE wxTIFFHandler: public wxImageHandler
public: public:
wxTIFFHandler(); wxTIFFHandler();
static wxVersionInfo GetLibraryVersionInfo();
#if wxUSE_STREAMS #if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );

View File

@@ -4240,6 +4240,8 @@ public:
return wxTextAreaBase::HitTest(pt, col, row); return wxTextAreaBase::HitTest(pt, col, row);
} }
static wxVersionInfo GetLibraryVersionInfo();
protected: protected:
virtual wxString DoGetValue() const { return GetText(); } virtual wxString DoGetValue() const { return GetText(); }
virtual wxWindow *GetEditableWindow() { return this; } virtual wxWindow *GetEditableWindow() { return this; }

View File

@@ -20,6 +20,7 @@
#include "wx/list.h" #include "wx/list.h"
#include "wx/filefn.h" #include "wx/filefn.h"
#include "wx/hashmap.h" #include "wx/hashmap.h"
#include "wx/versioninfo.h"
#include "wx/meta/implicitconversion.h" #include "wx/meta/implicitconversion.h"
#if wxUSE_GUI #if wxUSE_GUI
@@ -140,6 +141,8 @@ WXDLLIMPEXP_BASE void wxBell();
WXDLLIMPEXP_CORE void wxInfoMessageBox(wxWindow* parent); WXDLLIMPEXP_CORE void wxInfoMessageBox(wxWindow* parent);
#endif // wxUSE_MSGDLG #endif // wxUSE_MSGDLG
WXDLLIMPEXP_BASE wxVersionInfo wxGetLibraryVersionInfo();
// Get OS description as a user-readable string // Get OS description as a user-readable string
WXDLLIMPEXP_BASE wxString wxGetOsDescription(); WXDLLIMPEXP_BASE wxString wxGetOsDescription();

78
include/wx/versioninfo.h Normal file
View File

@@ -0,0 +1,78 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/versioninfo.h
// Purpose: declaration of wxVersionInfo class
// Author: Troels K
// Created: 2010-11-22
// RCS-ID: $Id:$
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VERSIONINFO_H_
#define _WX_VERSIONINFO_H_
#include "wx/string.h"
// ----------------------------------------------------------------------------
// wxVersionInfo: represents version information
// ----------------------------------------------------------------------------
class wxVersionInfo
{
public:
wxVersionInfo(const wxString& name,
int major,
int minor,
int micro = 0,
const wxString& description = wxString(),
const wxString& copyright = wxString())
{
m_name = name;
m_major = major;
m_minor = minor;
m_micro = micro;
m_description = description;
m_copyright = copyright;
}
// Default copy ctor, assignment operator and dtor are ok.
const wxString& GetName() const { return m_name; }
int GetMajor() const { return m_major; }
int GetMinor() const { return m_minor; }
int GetMicro() const { return m_micro; }
wxString ToString() const
{
return HasDescription() ? GetDescription() : GetVersionString();
}
wxString GetVersionString() const
{
wxString str;
str << m_name << ' ' << GetMajor() << '.' << GetMinor();
if ( GetMicro() )
str << '.' << GetMicro();
return str;
}
bool HasDescription() const { return !m_description.empty(); }
const wxString& GetDescription() const { return m_description; }
bool HasCopyright() const { return !m_copyright.empty(); }
const wxString& GetCopyright() const { return m_copyright; }
private:
wxString m_name,
m_description,
m_copyright;
int m_major,
m_minor,
m_micro;
};
#endif // _WX_VERSIONINFO_H_

View File

@@ -19,6 +19,7 @@
#include "wx/string.h" #include "wx/string.h"
#include "wx/object.h" #include "wx/object.h"
#include "wx/list.h" #include "wx/list.h"
#include "wx/versioninfo.h"
#ifdef WXMAKINGDLL_XML #ifdef WXMAKINGDLL_XML
#define WXDLLIMPEXP_XML WXEXPORT #define WXDLLIMPEXP_XML WXEXPORT
@@ -35,7 +36,6 @@ class WXDLLIMPEXP_FWD_XML wxXmlIOHandler;
class WXDLLIMPEXP_FWD_BASE wxInputStream; class WXDLLIMPEXP_FWD_BASE wxInputStream;
class WXDLLIMPEXP_FWD_BASE wxOutputStream; class WXDLLIMPEXP_FWD_BASE wxOutputStream;
// Represents XML node type. // Represents XML node type.
enum wxXmlNodeType enum wxXmlNodeType
{ {
@@ -299,6 +299,8 @@ public:
void SetEncoding(const wxString& enc) { m_encoding = enc; } void SetEncoding(const wxString& enc) { m_encoding = enc; }
#endif #endif
static wxVersionInfo GetLibraryVersionInfo();
private: private:
wxString m_version; wxString m_version;
wxString m_fileEncoding; wxString m_fileEncoding;

View File

@@ -16,6 +16,7 @@
#if wxUSE_ZLIB && wxUSE_STREAMS #if wxUSE_ZLIB && wxUSE_STREAMS
#include "wx/stream.h" #include "wx/stream.h"
#include "wx/versioninfo.h"
// Compression level // Compression level
enum wxZlibCompressionLevels { enum wxZlibCompressionLevels {
@@ -138,6 +139,8 @@ private:
DECLARE_DYNAMIC_CLASS(wxGzipClassFactory) DECLARE_DYNAMIC_CLASS(wxGzipClassFactory)
}; };
WXDLLIMPEXP_BASE wxVersionInfo wxGetZlibVersionInfo();
#endif #endif
// wxUSE_ZLIB && wxUSE_STREAMS // wxUSE_ZLIB && wxUSE_STREAMS

View File

@@ -254,6 +254,20 @@ public:
Handler name. Handler name.
*/ */
void SetName(const wxString& name); void SetName(const wxString& name);
/**
Retrieve the version information about the image library used by this
handler.
This method is not present in wxImageHandler class itself but is
present in a few of the classes deriving from it, currently
wxJPEGHandler, wxPNGHandler and wxTIFFHandler. It returns the
information about the version of the image library being used for the
corresponding handler implementation.
@since 2.9.2
*/
static wxVersionInfo GetLibraryVersionInfo();
}; };

View File

@@ -3153,5 +3153,12 @@ public:
*/ */
void SwapMainAnchorCaret(); void SwapMainAnchorCaret();
/**
Get Scintilla library version information.
@since 2.9.2
@see wxVersionInfo
*/
static wxVersionInfo GetLibraryVersionInfo();
}; };

View File

@@ -145,10 +145,19 @@ void wxBell();
doesn't otherwise handle this event. doesn't otherwise handle this event.
@since 2.9.0 @since 2.9.0
@see wxGetLibraryVersionInfo()
@header{wx/utils.h} @header{wx/utils.h}
*/ */
void wxInfoMessageBox(wxWindow parent = NULL); void wxInfoMessageBox(wxWindow* parent);
/**
Get wxWidgets version information.
@since 2.9.2
@see wxVersionInfo
@header{wx/utils.h}
*/
wxVersionInfo wxGetLibraryVersionInfo();
//@} //@}

130
interface/wx/versioninfo.h Normal file
View File

@@ -0,0 +1,130 @@
/////////////////////////////////////////////////////////////////////////////
// Name: versioninfo.h
// Purpose: interface of wxVersionInfo
// Author: Troels K
// RCS-ID: $Id: versioninfo.h
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@class wxVersionInfo
wxVersionInfo contains version information.
This class is used by wxWidgets to provide version information about the
libraries it uses and itself, but you can also apply it in user space, to
provide version information about your own libraries, or other libraries
that you use.
@library{wxbase}
@category{data}
@header{wx/versioninfo.h}
@since 2.9.2
*/
class wxVersionInfo
{
public:
/**
Constructor.
The version information objects need to be initialized with this
constructor and are immutable once they are created.
@param name The name of the library or other entity that this object
pertains to.
@param major The major version component.
@param minor The minor version component.
@param micro The micro version component, 0 by default.
@param description Free form description of this version, none by
default.
@param copyright Copyright string, none by default.
*/
wxVersionInfo(const wxString& name,
int major,
int minor,
int micro = 0,
const wxString& description = wxString(),
const wxString& copyright = wxString());
/**
Get the name of the object (library).
@return Name string.
*/
const wxString& GetName() const;
/**
Get the major version number.
@return Major version number.
*/
int GetMajor() const;
/**
Get the minor version number.
@return Minor version number.
*/
int GetMinor() const;
/**
Get the micro version, or release number.
@return Micro version, or release number.
*/
int GetMicro() const;
/**
Get the string representation of this version object.
This function returns the description if it is non-empty or
GetVersionString() if there is no description.
@see GetDescription(), GetVersionString()
*/
wxString ToString() const;
/**
Get the string representation.
The micro component of the version is ignored/not used if it is 0.
@return The version string in the form "name major.minor[.micro]".
*/
wxString GetVersionString() const
/**
Return @true if a description string has been specified.
@see GetDescription()
*/
bool HasDescription() const;
/**
Get the description string.
The description may be empty.
@return The description string, free-form.
*/
const wxString& GetDescription();
/**
Returns @true if a copyright string has been specified.
@see GetCopyright()
*/
bool HasCopyright() const;
/**
Get the copyright string.
The copyright string may be empty.
@return The copyright string.
*/
const wxString& GetCopyright() const;
};
//@}

View File

@@ -645,5 +645,13 @@ public:
Deep copies the given document. Deep copies the given document.
*/ */
wxXmlDocument& operator=(const wxXmlDocument& doc); wxXmlDocument& operator=(const wxXmlDocument& doc);
/**
Get expat library version information.
@since 2.9.2
@see wxVersionInfo
*/
static wxVersionInfo GetLibraryVersionInfo();
}; };

View File

@@ -28,6 +28,7 @@
#include "wx/wfstream.h" #include "wx/wfstream.h"
#include "wx/quantize.h" #include "wx/quantize.h"
#include "wx/stopwatch.h" #include "wx/stopwatch.h"
#include "wx/versioninfo.h"
#if wxUSE_CLIPBOARD #if wxUSE_CLIPBOARD
#include "wx/dataobj.h" #include "wx/dataobj.h"
@@ -654,7 +655,7 @@ MyFrame::MyFrame()
menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"), menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"),
"Test scaling the image during load (try with JPEG)"); "Test scaling the image during load (try with JPEG)");
menuImage->AppendSeparator(); menuImage->AppendSeparator();
menuImage->Append( ID_ABOUT, wxT("&About...")); menuImage->Append( ID_ABOUT, wxT("&About...\tF1"));
menuImage->AppendSeparator(); menuImage->AppendSeparator();
menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q")); menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q"));
menu_bar->Append(menuImage, wxT("&Image")); menu_bar->Append(menuImage, wxT("&Image"));
@@ -686,11 +687,35 @@ void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
Close( true ); Close( true );
} }
#if wxUSE_ZLIB && wxUSE_STREAMS
#include "wx/zstream.h"
#endif
void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
{ {
(void)wxMessageBox( "wxImage demo\n" wxArrayString array;
"(c) Robert Roebling 1998-2005"
"(c) Vadim Zeitlin 2005-2009", array.Add("wxImage demo");
array.Add("(c) Robert Roebling 1998-2005");
array.Add("(c) Vadim Zeitlin 2005-2009");
array.Add(wxEmptyString);
array.Add("Version of the libraries used:");
#if wxUSE_LIBPNG
array.Add(wxPNGHandler::GetLibraryVersionInfo().ToString());
#endif
#if wxUSE_LIBJPEG
array.Add(wxJPEGHandler::GetLibraryVersionInfo().ToString());
#endif
#if wxUSE_LIBTIFF
array.Add(wxTIFFHandler::GetLibraryVersionInfo().ToString());
#endif
#if wxUSE_ZLIB && wxUSE_STREAMS
// zlib is used by libpng
array.Add(wxGetZlibVersionInfo().ToString());
#endif
(void)wxMessageBox( wxJoin(array, '\n'),
"About wxImage Demo", "About wxImage Demo",
wxICON_INFORMATION | wxOK ); wxICON_INFORMATION | wxOK );
} }

View File

@@ -17,6 +17,7 @@
#if wxUSE_IMAGE && wxUSE_LIBJPEG #if wxUSE_IMAGE && wxUSE_LIBJPEG
#include "wx/imagjpeg.h" #include "wx/imagjpeg.h"
#include "wx/versioninfo.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/log.h" #include "wx/log.h"
@@ -491,4 +492,9 @@ bool wxJPEGHandler::DoCanRead( wxInputStream& stream )
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
/*static*/ wxVersionInfo wxJPEGHandler::GetLibraryVersionInfo()
{
return wxVersionInfo("libjpeg", JPEG_LIB_VERSION/10, JPEG_LIB_VERSION%10);
}
#endif // wxUSE_LIBJPEG #endif // wxUSE_LIBJPEG

View File

@@ -25,6 +25,7 @@
#if wxUSE_IMAGE && wxUSE_LIBPNG #if wxUSE_IMAGE && wxUSE_LIBPNG
#include "wx/imagpng.h" #include "wx/imagpng.h"
#include "wx/versioninfo.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/log.h" #include "wx/log.h"
@@ -902,4 +903,18 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
/*static*/ wxVersionInfo wxPNGHandler::GetLibraryVersionInfo()
{
// The version string seems to always have a leading space and a trailing
// new line, get rid of them both.
wxString str = png_get_header_version(NULL) + 1;
str.Replace("\n", "");
return wxVersionInfo("libpng",
PNG_LIBPNG_VER_MAJOR,
PNG_LIBPNG_VER_MINOR,
PNG_LIBPNG_VER_RELEASE,
str);
}
#endif // wxUSE_LIBPNG #endif // wxUSE_LIBPNG

View File

@@ -25,6 +25,7 @@
#if wxUSE_IMAGE && wxUSE_LIBTIFF #if wxUSE_IMAGE && wxUSE_LIBTIFF
#include "wx/imagtiff.h" #include "wx/imagtiff.h"
#include "wx/versioninfo.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/log.h" #include "wx/log.h"
@@ -627,4 +628,27 @@ bool wxTIFFHandler::DoCanRead( wxInputStream& stream )
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
/*static*/ wxVersionInfo wxTIFFHandler::GetLibraryVersionInfo()
{
int major,
minor,
micro;
const wxString ver(::TIFFGetVersion());
if ( wxSscanf(ver, "LIBTIFF, Version %d.%d.%d", &major, &micro, &micro) != 3 )
{
wxLogDebug("Unrecognized libtiff version string \"%s\"", ver);
major =
minor =
micro = 0;
}
wxString copyright;
const wxString desc = ver.BeforeFirst('\n', &copyright);
copyright.Replace("\n", "");
return wxVersionInfo("libtiff", major, minor, micro, desc, copyright);
}
#endif // wxUSE_LIBTIFF #endif // wxUSE_LIBTIFF

View File

@@ -52,6 +52,7 @@
#include "wx/uri.h" #include "wx/uri.h"
#include "wx/mimetype.h" #include "wx/mimetype.h"
#include "wx/config.h" #include "wx/config.h"
#include "wx/versioninfo.h"
#if defined(__WXWINCE__) && wxUSE_DATETIME #if defined(__WXWINCE__) && wxUSE_DATETIME
#include "wx/datetime.h" #include "wx/datetime.h"
@@ -1356,7 +1357,7 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style,
return wxCANCEL; return wxCANCEL;
} }
void wxInfoMessageBox(wxWindow* parent) wxVersionInfo wxGetLibraryVersionInfo()
{ {
// don't translate these strings, they're for diagnostics purposes only // don't translate these strings, they're for diagnostics purposes only
wxString msg; wxString msg;
@@ -1389,7 +1390,20 @@ void wxInfoMessageBox(wxWindow* parent)
GTK_MICRO_VERSION); GTK_MICRO_VERSION);
#endif // __WXGTK__ #endif // __WXGTK__
msg += wxS("\nCopyright (c) 1995-2010 wxWidgets team"); return wxVersionInfo(wxS("wxWidgets"),
wxMAJOR_VERSION,
wxMINOR_VERSION,
wxRELEASE_NUMBER,
msg,
wxS("Copyright (c) 1995-2010 wxWidgets team"));
}
void wxInfoMessageBox(wxWindow* parent)
{
wxVersionInfo info = wxGetLibraryVersionInfo();
wxString msg = info.ToString();
msg << wxS("\n") << info.GetCopyright();
wxMessageBox(msg, wxT("wxWidgets information"), wxMessageBox(msg, wxT("wxWidgets information"),
wxICON_INFORMATION | wxOK, wxICON_INFORMATION | wxOK,

View File

@@ -19,6 +19,7 @@
#if wxUSE_ZLIB && wxUSE_STREAMS #if wxUSE_ZLIB && wxUSE_STREAMS
#include "wx/zstream.h" #include "wx/zstream.h"
#include "wx/versioninfo.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/intl.h" #include "wx/intl.h"
@@ -44,6 +45,14 @@ enum {
}; };
wxVersionInfo wxGetZlibVersionInfo()
{
return wxVersionInfo("zlib",
ZLIB_VERNUM >> 12,
(ZLIB_VERNUM >> 8) & 0x0F,
(ZLIB_VERNUM & 0xFF) / 0x10);
}
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Zlib Class factory // Zlib Class factory

View File

@@ -4618,4 +4618,9 @@ wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent& event):
//---------------------------------------------------------------------- //----------------------------------------------------------------------
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/*static*/ wxVersionInfo wxStyledTextCtrl::GetLibraryVersionInfo()
{
return wxVersionInfo("Scintilla", 2, 3);
}
#endif // wxUSE_STC #endif // wxUSE_STC

View File

@@ -1118,4 +1118,9 @@ wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent& event):
//---------------------------------------------------------------------- //----------------------------------------------------------------------
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/*static*/ wxVersionInfo wxStyledTextCtrl::GetLibraryVersionInfo()
{
return wxVersionInfo("Scintilla", 2, 3);
}
#endif // wxUSE_STC #endif // wxUSE_STC

View File

@@ -38,6 +38,7 @@
#include "wx/control.h" #include "wx/control.h"
#include "wx/dnd.h" #include "wx/dnd.h"
#include "wx/stopwatch.h" #include "wx/stopwatch.h"
#include "wx/versioninfo.h"
#include "wx/textentry.h" #include "wx/textentry.h"
#if wxUSE_TEXTCTRL #if wxUSE_TEXTCTRL
@@ -438,6 +439,8 @@ public:
return wxTextAreaBase::HitTest(pt, col, row); return wxTextAreaBase::HitTest(pt, col, row);
} }
static wxVersionInfo GetLibraryVersionInfo();
protected: protected:
virtual wxString DoGetValue() const { return GetText(); } virtual wxString DoGetValue() const { return GetText(); }
virtual wxWindow *GetEditableWindow() { return this; } virtual wxWindow *GetEditableWindow() { return this; }

View File

@@ -30,6 +30,7 @@
#include "wx/zstream.h" #include "wx/zstream.h"
#include "wx/strconv.h" #include "wx/strconv.h"
#include "wx/scopedptr.h" #include "wx/scopedptr.h"
#include "wx/versioninfo.h"
#include "expat.h" // from Expat #include "expat.h" // from Expat
@@ -1035,4 +1036,12 @@ bool wxXmlDocument::Save(wxOutputStream& stream, int indentstep) const
OutputString(stream, wxS("\n"), convMem.get(), convFile.get()); OutputString(stream, wxS("\n"), convMem.get(), convFile.get());
} }
/*static*/ wxVersionInfo wxXmlDocument::GetLibraryVersionInfo()
{
return wxVersionInfo("expat",
XML_MAJOR_VERSION,
XML_MINOR_VERSION,
XML_MICRO_VERSION);
}
#endif // wxUSE_XML #endif // wxUSE_XML

View File

@@ -318,6 +318,7 @@ wx/utils.h
wx/variant.h wx/variant.h
wx/vector.h wx/vector.h
wx/version.h wx/version.h
wx/versioninfo.h
wx/volume.h wx/volume.h
wx/weakref.h wx/weakref.h
wx/wfstream.h wx/wfstream.h

View File

@@ -220,6 +220,7 @@ wx/utils.h
wx/variant.h wx/variant.h
wx/vector.h wx/vector.h
wx/version.h wx/version.h
wx/versioninfo.h
wx/volume.h wx/volume.h
wx/weakref.h wx/weakref.h
wx/wfstream.h wx/wfstream.h

View File

@@ -244,6 +244,7 @@ wx/utils.h
wx/variant.h wx/variant.h
wx/vector.h wx/vector.h
wx/version.h wx/version.h
wx/versioninfo.h
wx/volume.h wx/volume.h
wx/weakref.h wx/weakref.h
wx/wfstream.h wx/wfstream.h