Jaakko Salli [Sun, 11 Jul 2010 16:06:03 +0000 (16:06 +0000)]
Have the new incarnation of wxPGArrayEditorDialog support the old-style 'custom button' event as something that happens when the wxEditableListBox's 'New Item' button is pressed
Optionally set the window name in wxPersistentRegisterAndRestore().
In practice names are not often used so typically whenever you want to make a
window settings persistent you also need to set its name and the it's
convenient to let a single function do both tasks, so add an overload taking
the name string (this is a separate function instead of optional parameter to
avoid compilation errors if this is ever used with non-wxWindow-derived
objects which don't have SetName() method).
Also expand the documentation slightly and add @since tags.
Set the string to search for in wxSearchCtrl events.
It's more convenient to have the string to search for directly in the event
object than to retrieve it from wxSearchCtrl itself as it had to be done
before.
Don't use uninitialized variables in wxGrid::AutoSize().
The code in wxGrid::AutoSizeColOrRow() was using uninitialized col/row
variable if the grid had no rows/columns, resulting in assertion failures when
trying to automatically size the columns of an empty grid.
Do initialize them now and also remove duplicate assignments to the variables
which never change inside the loop.
Account for largest item in wxGenericListCtrl::GetBestSize().
Don't just return a hard-coded value but at least return something big
enough to show the largest item in the control in non-report mode.
This fixes the appearance of wxListbook which simply truncated its items
before if they didn't fit in 80 pixels horizontally.
Also switch to implementing DoGetBestClientSize() instead of DoGetBestSize()
as this method doesn't account for the control borders (it does account for
the scrollbars however).
Add wxSize::IncBy() and DecBy() overloads taking wxPoint.
It seems to make at least as much sense to extend a wxSize by wxPoint than by
another wxSize (which doesn't make much size to me...) so add Inc/DecBy()
overloads doing this.
We might also add operator+=() overloads taking wxPoint for consistency but
for now don't add more operator overloads unnecessarily, let's wait if anybody
asks about this first.
Ensure that wxGenericListCtrl always has wx[HV]SCROLL styles.
Although these styles are unconditionally added when creating the window they
could be reset by calling SetWindowStyleFlag() later and this in fact happened
when changing control mode from wxListbook.
As it doesn't make sense to have wxListCtrl without these styles, also add
them unconditionally in overridden SetWindowStyleFlag() as well.
Don't set negative size when using constraints for layout.
Passing negative size to GTK+ results in error messages and in the future
wxWindow::SetSize() itself might assert if passed negative size so just avoid
setting it in the first place even if there is not enough space for
everything.
Implement wxWindow::DoGetBorderSize() for all ports.
Implement DoGetBorderSize() properly for wxGTK and use the difference between
the full window size and the client size for all the ports not implementing
this method. The latter is incorrect in the presence of the scrollbars but is
the best we can do in general.
Fix item selection/focus drawing in generic wxListCtrl.
Item focus rectangle was not drawn at all under wxGTK as the code doing it was
disabled with a comment saying that it was drawn elsewhere -- but this wasn't
the case.
So remove #ifdefs for wxGTK/Mac from generic wxListCtrl code and do use
wxRendererNative methods for all platforms. This fixes the appearance of the
control under GTK and if it introduces any problems under Mac, they should be
fixed in its wxRendererNative implementation and not by adding #ifdefs here.
Don't use tree style to draw focus in DrawItemSelectionRect() in wxGTK.
Using gtk_paint_focus() with a tree widget style did a clearly wrong thing
with Clearlooks theme: instead of drawing a focus rectangle it drew a
background with a shadow overflowing the specified rectangle. This resulted in
junk being left when the selection was changing in wx{List,Tree}Ctrl.
Just use the widgets own style instead as this seems to work just fine. After
this change the code for focus drawing in DrawItemSelectionRect() became
identical to the code of DrawFocusRect() so just call the latter from the
former instead of duplicating its code.
Allow user code to override key events in generic wxListCtrl.
The changes of r58323 ("Restore keyboard navi") fixed the handling of cursor
keys in the generic wxListCtrl implementation but at the price of not sending
keyboard events for the cursor keys to wxListCtrl itself any more. This made
it impossible to override their handling in user code, something that used to
work in previous wx versions and still works in wxMSW.
Revert the changes of this revision now and fix the original code by simply
disabling the handling of the cursor keys in wxScrollHelperBase using a newly
added DisableKeyboardScrolling() method. This ensures that the keyboard events
for cursor keys are not used to scroll the window when they are forwarded to
wxListCtrl from wxListMainWindow.
The fix is conceptually ugly as it would be better to avoid the need for such
ad hoc functions as DisableKeyboardScrolling() but it is very simple and there
just doesn't seem to be any sane way to do it otherwise with wxScrollHelperBase.
The alignment was ignored unless a wxST_ELLIPSIZE_XXX style was already used.
Apparently calling gtk_label_set_ellipsize(PANGO_ELLIPSIZE_NONE) resets the
alignment, so set the alignment after setting the ellipsization style, not
before.
Another possible solution would be to avoid calling gtk_label_set_ellipsize()
completely if no ellipsization styles are given but maybe the original code
didn't do this for some (unknown and undocumented) reason so keep it this way.
Use -miphoneos-version-min if compiling for iPhone and --with-macosx-version-min was specified.
Otherwise .mm files may not compile correctly with some iPhone SDKs.
Jaakko Salli [Sun, 4 Jul 2010 08:22:52 +0000 (08:22 +0000)]
Added new wxPropertyGrid property validation failure flags wxPG_VFB_SHOW_MESSAGEBOX and wxPG_VFB_SHOW_MESSAGE_ON_STATUSBAR, which allow defining the default message display behavior more accurately
Václav Slavík [Sat, 3 Jul 2010 14:24:31 +0000 (14:24 +0000)]
Fixed XML parser error text formatting.
XML_GetCurrentLineNumber() returns int in some versions of Expat and
unsigned long (or even uint64_t) in other versions. Just cast the value
to int so that it works correctly with all versions.
Václav Slavík [Sat, 3 Jul 2010 14:24:23 +0000 (14:24 +0000)]
Fix format strings parsing to understand C99 %zu etc.
The parser used to understand only 'Z' specifier for size_t/ptrdiff_t,
which is non-standard libc5 extension. C99 defines 'z' for this purpose,
so use that. Compatibility with 'Z' is preserved.
Also support Visual C++'s non-standard 'I' modifier with the same
meaning.
Jaakko Salli [Sat, 3 Jul 2010 12:22:58 +0000 (12:22 +0000)]
Eliminated lingering validation failure message on the status bar. Added wxPropertyGrid virtual member functions DoHidePropertyError() and GetStatusBar().
Václav Slavík [Thu, 1 Jul 2010 15:28:35 +0000 (15:28 +0000)]
Fix printf arguments validation code for ANSI build.
char arguments weren't recognized as allowed variadic types. Unlike in
Unicode build, where chars are treated specially, they are primitive
types in ANSI build.
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