Vadim Zeitlin [Fri, 25 Jun 2010 08:47:17 +0000 (08:47 +0000)]
Remove duplicate sample.xpm inclusion from stc sample.
This sample already included sample.xpm even before the recent changes
replacing mondrian.xpm (which it also included) inclusion with sample.xpm so
now it included it twice.
Václav Slavík [Thu, 24 Jun 2010 10:34:18 +0000 (10:34 +0000)]
Check wxPrintf etc. arguments types.
Implements checks similar to gcc's compile-time checks: verify that the
arguments are of correct types. This works partially at compile time
(e.g. passing an object as argument fails to compile) and partially at
runtime (assert if the specifier doesn't match the type).
Václav Slavík [Thu, 24 Jun 2010 10:34:06 +0000 (10:34 +0000)]
Always NUL-terminate wxPrintfConvSpec::m_szFlags.
The array was initialized and terminating NUL was only added in some
cases. In combination with strchr() calls, this would result it
incorrect calculations or even crashes.
Fixed by initializing the array to zeros. This is less error-prone than
fixing the few places where explicitly adding the terminating NUL was
missing.
simply adding an empty line after @since should be enough to fix the problem
and this does seem to work in practice so restore @since removed by r64630.
move console sample's interactive tests to two different CppUnit testsuites: InteractiveInputTestCase which requires user input and InteractiveOutputTestCase which outputs stuff to be checked from the user.
Leave in the console sample only a barebone console application (i.e. a real example).
better DirTestCase::DirExists test;
fix test cases /usr//bin and /usr///bin: they succeed because wxDir::Exists does not care about redundant path separator (and this holds also for non-Unix platforms);
add some more test case
minor change: use a "positive" logic: use shouldSucceed instead of shouldFail and use more descriptive names for non-existing folders; add a few test cases
Vadim Zeitlin [Sun, 20 Jun 2010 17:43:35 +0000 (17:43 +0000)]
Quote file names with spaces in wxFileType::ExpandCommand().
Add double quotes around the file name inserted into the command to open the
file by wxFileType::ExpandCommand() if the file name contains any spaces and
if it's not already quoted by the command line itself.
While this doesn't completely fix the problem, it does help with opening the
files with spaces in their names under Windows and shouldn't do any harm under
Unix.
Vadim Zeitlin [Sun, 20 Jun 2010 17:43:30 +0000 (17:43 +0000)]
Fix activation handling in generic wxDataViewCtrl renderers.
Handling of activation in the generic implementation of standard renderers was
broken since r62589 which stopped calling their Activate() method. Restore it
by introducing a special WXOnActivate() replacing it (but clearly marked as
private and implementation-only) and calling it instead.
Vadim Zeitlin [Sun, 20 Jun 2010 17:43:06 +0000 (17:43 +0000)]
Use wxFont::Bold() in wxGenericTreeCtrl instead of wrongly duplicating it.
Creating a new wxFont from the components of the existing one doesn't always
work because we may not have a valid value for the old font family so attempt
to use it as a family of the new font results in an assert.
Just use wxFont::Bold() instead to avoid the problem. It's much shorter and
obviously correct and doesn't result in asserts.
Vadim Zeitlin [Sun, 20 Jun 2010 17:43:02 +0000 (17:43 +0000)]
Use PBM_SETMARQUEE to implement indeterminate mode in wxMSW wxGauge.
The old code which simply used PBM_SETPOS after setting PBS_MARQUEE style
often worked but sometimes apparently didn't, so switch to the officially
sanctioned PBM_SETMARQUEE to implement this.
Also make wxGauge::SetDeterminateMode() and SetIndeterminateMode() methods
private as they are not part of the public class API.
Vadim Zeitlin [Sun, 20 Jun 2010 17:42:52 +0000 (17:42 +0000)]
Use wxTE_RICH2 for in-place wxGrid text editor control.
This works around a bug with the plain text edit control under MSW which seems
to totally lose its caret when we hide it and show it again for another cell.
This is not a proper fix for the problem, of course, but at least it does
allow to edit wxGrid cells in the meanwhile.
Vadim Zeitlin [Sun, 20 Jun 2010 17:42:33 +0000 (17:42 +0000)]
Remove unnecessary mondrian.{ico,xpm} files from samples directory.
Standardize on using sample.rc and sample icon in all the samples, it was
confusing that some of them used it and other didn't, without any apparent
logic.
Remove the now unnecessary icon files, including the dialogs sample icon which
seemed to be corrupted (this closes #11146).
Also replace multiple OS/2 resource files with a single one in the sample
directory. The OS/2 projects/makefiles would need to be updated to use them.
Vadim Zeitlin [Sun, 20 Jun 2010 11:46:49 +0000 (11:46 +0000)]
Ensure that wxFileName::GetTempDir() doesn't return trailing slashes.
Sanitize the value returned by GetTempDir() to ensure that it doesn't have any
trailing path separators. This happened at least under OS X where standard
TMPDIR has a trailing slash and was inconsistent with the behaviour under the
other platforms.
Remove identic implementations of wxDir::Exists from platform-specific files and put it in dircmn.cpp (they all used wxDirExists).
Add wxDir::Make() and wxDir::Remove() for coherency with wxDir::Exists() and document them as simple aliases to wxFileName functions, just a bit more readable.
Jaakko Salli [Fri, 18 Jun 2010 13:18:22 +0000 (13:18 +0000)]
Use placement new when storing value in wxAnyValueBuffer. This should allow using any data type, regardless whether it is Plain Old Data or copyable or not.
Vadim Zeitlin [Thu, 17 Jun 2010 22:30:27 +0000 (22:30 +0000)]
Backport fix from bakefile svn for autoconf 2.65.
Use AC_REQUIRE() instead of directly using a macro, the latter doesn't work
with autoconf 2.65.
This is a backport of r1337 from bakefile svn to allow people to use autoconf
2.65 immediately and will become unnecessary when we update to the next
bakefile version.
moved non-interactive tests for wxDynamicLibrary, wxGet/SetEnv, wxTempFile, wxCopyFile to appropriate CppUnit test suites;
removed wxFile and wxTextFile tests (complete testsuites already exist for them)
Vadim Zeitlin [Sat, 12 Jun 2010 21:26:41 +0000 (21:26 +0000)]
Fix scrolling to the bottom in wxTextCtrl::AppendText().
The old code used EM_LINESCROLL which could scroll too far if the caret wasn't
in the first line of the control. Instead of trying to compute the correct
number of the lines to scroll, just use WM_VSCROLL with SB_BOTTOM parameter
instead.
Vadim Zeitlin [Sat, 12 Jun 2010 18:21:42 +0000 (18:21 +0000)]
Fix processing of events for MRU entries #10 and more in docview.
We only handled events for wxID_FILE1..wxID_FILE9 range but there can be more
than 9 entries in the MRU list. Handle events for as many of them as there are
correctly.
This required adding a fallback handler for all menu events and checking if
the id of the menu item is in the MRU range inside it. Also move this to
wxDocManager itself from wxDocParentFrameAnyBase as it's common for all kinds
of frames anyhow.
Vadim Zeitlin [Sat, 12 Jun 2010 11:28:20 +0000 (11:28 +0000)]
Stop the timer in console IPC client sample once we don't need it any more.
Under MSW the timer appeared to be flooding the message queue with timer
events faster than we could process them (which seems incredible for the timer
interval of 1 second but still seems to happen), so the idle events were never
generated and the sample didn't work at all.
Now stop the timer once we get a last notification from it to let the program
become idle and run the test function scheduled from the timer handler.
Vadim Zeitlin [Sat, 12 Jun 2010 11:28:15 +0000 (11:28 +0000)]
Avoid sending spurious socket read notifications in wxMSW.
If a read notification is generated for a socket, it should be possible to
read something from it without blocking but this doesn't seem to be always the
case under MSW for some reason. And this results in all sorts of problems in
wxSocket and wxIPC code, so check for this at wxSocketImpl level and not send
the notification at all if there is no data to read.