Commit Graph

211 Commits

Author SHA1 Message Date
Artur Wieczorek
71305cff62 Add sanity checks for input string in wxHexToDec()
Check if the length of the string is appropriate and if it contains hexadecimal characters.
Also document this function.

Closes #12814.
2017-02-23 20:49:59 +01:00
Artur Wieczorek
2934f77660 Fix and document wxDecToHex()
1. Integer instead of floating point arithmetic should be used in calculations.
2. Because this function always returns 2 hexadecimal characters, its parameter type should be changed from 'int' to 'unsigned char' to avoid misunderstandings and prevent misuses.

Closes #12612.
2017-02-23 20:48:03 +01:00
Vadim Zeitlin
d15bbcacd2 Merge branch 'rmv_symbols_3' of https://github.com/catalinr/wxWidgets
Remove obsolete mentions of Windows 9x, Windows CE and OS/2.
2017-02-20 17:46:45 +01:00
Paul Cornett
c64a4c3224 make wxExecute() argv parameter fully const-qualified 2017-02-18 10:14:25 -08:00
Tobias Taschner
3bdb4c4b21 Add micro version to wxCheckOsVersion(). 2016-02-29 10:05:51 +01:00
Dimitri Schoolwerth
b1a9c6e79e Add a micro version parameter to wxGetOsVersion
In addition to getting a major and minor OS version allow a micro
version to be retrieved. In case of running on e.g. OS X 10.10.3 this
allows the "3" to be retrieved again.
2016-02-29 09:58:15 +01:00
Dimitri Schoolwerth
5983274af6 Name the parameters of wxGetOsVersion consistently
Use verMaj and verMin like almost everywhere instead of majorVsn and
minorVsn in a couple of places.
2016-02-29 09:58:15 +01:00
Catalin
338629e314 Removed obsolete symbols from comments. 2016-02-21 20:12:11 +02:00
Tobias Taschner
2b3633b3c0 Add wxCheckOsVersion() to implement platform based OS version checks.
Windows implements VerifyVersionInfo api since Win2k. Starting with Windows 8.1 GetVersionEx is deprecated and may not return the expected version number if the application does not contain the correct compatibility information in its manifest. VerifyVersionInfo works independent of manifest in the executable (and is the recommend way to check).

Existing code may already use wxPlatformInfo::CheckOSVersion() so the method forwards the call to wxCheckOsVersion if initialized for the current system.
2015-08-06 11:32:38 +02:00
Vadim Zeitlin
49b8d79c87 Remove (Open)Watcom support.
This compiler is not being developed since several years and almost certainly
can't be used to build the current wxWidgets sources anyhow, so remove all
support for it, including a lot of extremely ugly workarounds for its bugs
with template functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-16 13:01:06 +00:00
Paul Cornett
967a94c91a remove WXWIN_COMPATIBILITY_2_6, add WXWIN_COMPATIBILITY_3_0
closes #15792

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-04 20:07:33 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Václav Slavík
19c453d0ac Use int instead of wxWindowID in wxNewId() and friends.
The functions are available in wxBase builds too, but wx/windowid.h
isn't. Rather than always including that header, just use int, for which
wxWindowID is a typedef. This keeps the functions available in wxBase
for compatibility and is consistent with how IDs are handled in other
parts of wxBase, particularly wxEvent.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-11 07:53:35 +00:00
Václav Slavík
1c6a98048b Use wxWindowID in wxNewId() and related functions.
wxNewId(), wxRegisterId() and wxGetCurrentId() functions all work with
window IDs, so they should use the dedicated type. Previously, they
worked with long, which is not even the same type (wxWindowID is int),
causing implicit type conversion warnings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-11 06:58:35 +00:00
Vadim Zeitlin
1bc5ddea15 Fix link errors with VC 11 in DLL STL build.
Don't declare wxWindowList as DLL-exported. It's unnecessary and appears to
create problems for VC 11.

Closes #14741.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-10 00:53:42 +00:00
Vadim Zeitlin
e23fd60fe7 Change wxMSW-specific wxLoadUserResource() to accept standard RT_XXX types.
Resource types can be either strings for custom types or integers casted to a
TCHAR* for the standard ones. Using wxString for the resource type prevented
us from using the latter as any attempt to initialize wxString for such a
pseudo-string resulted in an immediate crash.

Change wxLoadUserResource() resource type parameter type to wxChar* to avoid
this and allow passing standard resource types, such as RT_RCDATE, to this
function directly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-09-13 17:13:28 +00:00
Vadim Zeitlin
598fe99d56 Move wxBell() from base to core library.
This allows to get rid of ugly preprocessor checks due to the fact that this
function could be defined in one or the other library depending on the port
used and also fix a problem with it being defined differently in the base
library depending on which GUI port (Carbon or Cocoa) was used under OS X.
It also fixes the problem with wxBell() in wxGTK under Windows.

Closes #14406.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-17 21:35:06 +00:00
Vadim Zeitlin
d98a58c543 Use __WINDOWS__ for OS kind checks and reserve __WXMSW__ for GUI toolkit.
This change prepares the way for using wxGTK under Windows as this would
still define __WINDOWS__ but use __WXGTK__ instead of __WXMSW__.

Closes #14064.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-04 00:29:31 +00:00
Paul Cornett
7bc57fd972 fix tests for WXWIN_COMPATIBILITY_2_8, closes #13800
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-23 05:59:59 +00:00
Vadim Zeitlin
ee4d438064 Added support for wxEXEC_MAKE_GROUP_LEADER to wxExecute().
Map it to the native CREATE_NEW_PROCESS_GROUP flag as it's broadly similar to
Unix semantics.

Closes #13676.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-19 12:54:48 +00:00
Vadim Zeitlin
4fe4a7c50f Add wxEXEC_HIDE_CONSOLE flag allowing to unconditionally do it under MSW.
Also renamed wxEXEC_NOHIDE to wxEXEC_SHOW_CONSOLE for symmetry (keeping the
old name for compatibility, of course).

Extend exec sample to allow easily testing the different flags and adding more
of them later.

See #13676.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-08 20:22:55 +00:00
Vadim Zeitlin
449cc35153 Don't make wxQsort() extern "C" nor use any special convention for it.
It doesn't make sense to require passing C functions to wxQsort() that we
define in a C++ library. We also don't need any special calling convention
here.

Notice that the only existing uses of wxQsort() inside wxWidgets itself were
not actually extern "C" and one of them didn't even use the correct calling
convention.

Also avoid using non-wx-prefixed CMPFUNCDATA identifier in a public header,
rename it to wxSortCallback instead.

Finally make wxQsort() documentation slightly more useful.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-27 21:10:48 +00:00
Stefan Csomor
902ddbfd3e support wxWindowDisabler on osx_cocoa
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-05 12:21:20 +00:00
Vadim Zeitlin
9aea251043 Move wxGetLibraryVersionInfo() to core from base.
This function uses the GUI toolkit information and so can't be defined in
wxBase. The code only compiled before because the function was erroneously
defined in wxCore even though it was declared as WXDLLIMPEXP_BASE.

Fix this by declaring it with WXDLLIMPEXP_CORE too. This corrects problems in
MSW DLL build.

If we need to get a string containing user-readable wxBase version too, we
should add another function (as it's not possible to virtualize this one) but
such function doesn't seem incredibly useful to have anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-30 22:37:03 +00:00
Vadim Zeitlin
ccec90930c 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
2010-11-25 00:53:44 +00:00
Vadim Zeitlin
2a0ca9dbaf Fix warnings about signed/unsigned comparisons inside wxMax() and friends.
wxMax, wxMin and wxClip work correctly when called with a mix of signed and
unsigned arguments but give warnings about comparing them when compiled with
g++.

Cast both arguments to the result type, which is defined consistently with
standard C rules for implicit promotion, before comparing them to avoid this.

Also add more tests to check that using these functions in this case doesn't
provoke warnings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-27 20:23:55 +00:00
Václav Slavík
a52475807e Make wxMin, wxMax and wxClip template functions.
Previously used macro's arguments were evaluated twice, but there were
many occurences of their use in our code that didn't account for this
and used expensive-to-evaluate arguments as if they were functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-25 09:43:00 +00:00
Vadim Zeitlin
164db92c14 Add support for specifying child process cwd and env to wxExecute().
Add an optional wxExecuteEnv parameter to wxExecute() which allows to specify
the initial working directory and custom environment for the child process.

Closes #12163.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:11 +00:00
Julian Smart
a94656538f Use common inline version of wxHexToDec
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-18 12:59:52 +00:00
Václav Slavík
18923e360c Add instance argument to wxLoadUserResource().
This makes it possible to load resources from other modules than the
main executable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-26 20:51:02 +00:00
Václav Slavík
1930cbd768 Make wxLoadUserResource() declaration available to wxBase too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-26 20:50:57 +00:00
Vadim Zeitlin
c5ba485124 Add wxLoadUserResource() overload not copying the resource data.
The existing wxLoadUserResource() copies the resource data which is often
unnecessary. Add another overload which just returns the pointer directly to
the resource data.

Also move the function into base from core as it can be useful for the console
applications as well.

Finally, define wxUserResourceStr used by this function only in the same file
where the function itself is defined instead of datacmn.cpp.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-26 16:53:21 +00:00
Vadim Zeitlin
59d43911b4 Optionally return length from wxLoadUserResource().
Add optional length output parameter and also change the return type to "char
*" from "wxChar *" to which it apparently was blindly changed just to make
this code compile even though this function never returned any strings.

Closes #11214.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-19 16:29:57 +00:00
Francesco Montorsi
23790a2a29 add wxGetLinuxDistributionInfo() and wxPlatformInfo::GetLinuxDistribution() functions; also add to wxPlatformInfo the GetOperatingSystemDescription(), GetDesktopEnvironment(), GetOperatingSystemDirectory() functions to group in the same class (wxPlatformInfo) all available platform-detection functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-06-02 13:01:41 +00:00
Václav Slavík
de4983f323 split wxCharTypeBuffer<T> into wxScopedCharTypeBuffer<T> and wxCharTypeBuffer<T> -- the former is for transient data with validity limited to parent's lifetime, the latter is for permanent storage of string data (bug #9638)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-27 15:33:55 +00:00
Vadim Zeitlin
c0c133e13b add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-08 11:45:59 +00:00
Vadim Zeitlin
d3b9f782ef don't use annoying and unneeded in C++ casts of NULL to "T *" in all other files neither
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-19 13:55:27 +00:00
Francesco Montorsi
3828182615 fix wxYield[IfNeeded] dll linkage (closes #10325)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-07 11:28:50 +00:00
Francesco Montorsi
24c4d27f2a use WXWIN_COMPATIBILITY_2_8 instead of WXWIN_COMPATIBILITY_2_6 for wxUsleep even if it was deprecated since wx2.6
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-06 20:25:31 +00:00
Francesco Montorsi
8d4ff84937 add WXWIN_COMPATIBILITY_2_6 block around wxUsleep deprecation; put wxPlatform declaration out of the 'Miscellaneous functions' block
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57854 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-06 12:56:07 +00:00
Vadim Zeitlin
51810d4d7e deprecate wxStringEq
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-10 20:07:33 +00:00
Vadim Zeitlin
0e0977894a make wxKeyEvent and wxMouseEvent derive from the same wxKeyboardState object (indirectly via wxMouseState in the case of the latter) to make Get/HasModifiers() available in wxMouseEvent as well while avoiding code duplication
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-19 18:41:41 +00:00
Vadim Zeitlin
118a41d993 added wxSHUTDOWN_LOGOFF flag, don't use EWX_FORCE by default but only if wxSHUTDOWN_FORCE is specified
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-03 10:56:05 +00:00
Vadim Zeitlin
f75e0c15ae show busy cursor in wxLaunchDefaultBrowser and add a new flag to avoid it (#9678)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-07-09 02:32:16 +00:00
Robert Roebling
1dea1566c8 Added mostly empty wxLaunchDefaultApplication
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-27 14:14:13 +00:00
Vadim Zeitlin
e38ce1bcbf added wxMouseState::GetPosition(), for consistency with wxMouseEvent
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-18 01:51:04 +00:00
Vadim Zeitlin
6e3515377c make wxMouseState accessors const; document this class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-18 01:48:44 +00:00
Francesco Montorsi
53a2db124c substitute WXDLLEXPORT with WXDLLIMPEXP_CORE and WXDLLEXPORT_DATA with WXDLLIMPEXP_DATA_CORE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-26 15:06:00 +00:00
Vadim Zeitlin
d7ef641d4e fix wxExecute() compilation in ANSI build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-24 23:13:12 +00:00
Vadim Zeitlin
05718a98f9 avoid needless Unicode<->MB conversions in Unix wxExecute(); simplify the code; provide both versions taking char** and wchar_t** for compatibility; also use wxMacExecute() (renamed to wxMacLaunch() to avoid confusion) from all wxExecute() overloads but don't use it if wxEXEC_SYNC was requested as it doesn't support it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-23 02:27:23 +00:00