Commit Graph

55185 Commits

Author SHA1 Message Date
Vadim Zeitlin
82c372a7e2 Add support for wxArrayString to wxVariant-to-OLE conversion.
This allows to call COM methods taking arrays of strings easily.

Also remove support for the old and non-existent any more "stringlist" variant
type.

And add more error checking.

Closes #14296.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-15 10:04:03 +00:00
Vadim Zeitlin
96c9640205 Enable variadic macros for VC9 and later.
VC9 and 10 support variadic macros so define HAVE_VARIADIC_MACROS for them
too. This currently only affects wxLog{Debug,Trace} definitions in wx/log.h.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-15 10:04:01 +00:00
Vadim Zeitlin
28e42e023c Fix keyboard navigation in wx{List,Choice,Tree,Tool}book controls.
Inherit from wxNavigationEnabled<wxBookCtrlBase> instead of just
wxBookCtrlBase to ensure that the keyboard navigation works correctly for
these controls.

The toolbar in wxToolbook still doesn't accept focus from keyboard but at
least the pages can be TAB-bed too and from. And the rest of the controls
are now fully accessible using only the keyboard.

Closes #14303.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-15 10:03:57 +00:00
Vadim Zeitlin
c833f0cdb0 Use iterators instead of indices in wxStripMenuCodes().
Make the function more efficient when using UTF-8 wxStrings by using iterators
instead of indices in the loop searching for "&".

Closes #14307.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-15 10:03:53 +00:00
Julian Smart
3ef12fd203 Clear styles popup if there is no style sheet
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-14 17:23:56 +00:00
Vadim Zeitlin
34c5aaa769 Simplify wxEventLoopManual pending events processing logic.
Don't try to process any remaining pending events in ProcessEvents() itself as
this was inconsistent: we only processed low-level toolkit pending events in
the main event loop itself if the loop was exited from a normal event handler
but only processed the wxApp-level pending events if it was exited from a
pending event handler. It also required more code than the new version that
simply processes all the remaining pending events, of both kinds, after the
main event loop termination.

This corrects changes of r71304 and replaces those of r71329.

Closes #14250.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 22:13:43 +00:00
Vadim Zeitlin
d44dc1bede Fix wxDateTime unit test after the changes of r71430.
Don't test the return value of ParseFormat(wxCStrData) any more as this
function is void now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 22:05:57 +00:00
Vadim Zeitlin
ae8079a210 Don't return a dangling pointer from wxDateTime::ParseXXX(wxCStrData).
We don't have any sufficiently long-lived pointer to return from this
overload, so don't return anything from it -- it's better to break the
compilation of the existing code rather than make it crash during run-time.

Closes #14214.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 21:37:25 +00:00
Vadim Zeitlin
2ed48ef81e No changes, just simplify the code using wx2stc() a little.
Assign wx2stc() return value to a suitably const variable instead of using
ugly casts to get rid of constness.

Also use wxCharBuffer/char* explicitly inside explicit wxUSE_UNICODE checks,
using wxWX2MBbuf here doesn't gain us anything and just confuses the reader of
this code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 21:37:23 +00:00
Vadim Zeitlin
d7b468788e Fix wxStyledTextCtrl compilation in non-Unicode build.
The value returned by wx2stc() in non-Unicode build is a simple "char*" and we
can't call length() method on it, add a helper wx2stclen() function to get the
length from the original wxString itself in this case.

Closes #14013.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 21:37:18 +00:00
Vadim Zeitlin
530a50ecf0 Don't assert if no icon is specified for a wxDataViewCtrl item.
An item in a column using wxDataViewIconTextRenderer might not have any valid
icon associated with it, don't assert in case it doesn't in the native GTK
version.

Notice that the generic wxDataViewCtrl implementation already supports this
but not perfectly: no space is reserved for the icon in the images without
one, so giving the image to only some of them looks ugly. The GTK version
aligns both the items with and without icon properly and simply leaves the
image part blank and it would be better to modify the generic version to do
the same thing in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 21:37:16 +00:00
Vadim Zeitlin
ed4caec714 Minor change to wxString pretty-printer for gdb.
Calling string() explicitly isn't necessary, at least not with gdb 7.2, and is
actually harmful when using Python 2.5 (which doesn't support UTF-32) with
wide strings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 21:37:13 +00:00
Vadim Zeitlin
f3027fae17 Don't handle branches specially when sorting items in wxDataViewCtrl.
The generic version of wxDataViewCtrl tried to put all branches before the
leaves when sorting. This had a couple of problems: first, it didn't do it
correctly and actually placed the branches after the leaves which didn't make
any sense. Second, this was only done in the generic version and not the
native GTK one making the behaviour inconsistent between platforms. Finally,
this behaviour just doesn't make sense in general (i.e. when items don't
necessarily represent anything in the file system and maybe even sometimes
when they do) and there doesn't seem any good reason to do it by default.

So stop doing it, partially reverting the changes of r47562.

Closes #14100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71425 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 21:37:10 +00:00
Vadim Zeitlin
bf0f2c4b33 Disable the use of UTF-8 by default in Unix builds.
Add up-to-date description of UTF-8 support to the Unicode overview.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 13:17:25 +00:00
Vadim Zeitlin
458f68d0a7 Remove wxDECLARE_APP() from wxIMPLEMENT_APP_NO_MAIN().
There is no need for a separate declaration inside wxIMPLEMENT_APP() as
wxGetApp() is defined by it and redeclaring it immediately after definition
results in a warning with some compilers/environments (Eclipse CDT).

The move of wxGetApp() to the beginning of the macro is only to ensure that a
semicolon is still required after wxIMPLEMENT_APP_NO_MAIN() and the other
macros terminating with it, such as wxIMPLEMENT_APP() itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-13 13:17:22 +00:00
Julian Smart
d157d142f6 Fixed layout and hit-testing problem particularly with centred lines
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-11 22:15:39 +00:00
Vadim Zeitlin
5e4027e5ad Document that wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED is OSX-specific.
This even is not generated by neither generic nor GTK version right now.

See #14297.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-11 22:10:28 +00:00
Vadim Zeitlin
0b61390646 Fix extra event sent by wxTextEntry::ChangeValue() since r71308.
The changes of r71308 sent the event unconditionally in case the text didn't
really change but no events should be sent if the flags don't include
SetValue_SendEvent, add a check for it.

Re-closes #13936.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-11 22:10:25 +00:00
Robin Dunn
8b180bded6 Enable access to the native bitmap object wrapped by wxGraphicsBitmap
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-11 22:06:50 +00:00
Robin Dunn
caf1a3aa68 Ensure a 32-bit cairo surface is created if it is needed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-11 22:06:37 +00:00
Stefan Csomor
8e19598f7f fixes SetFirstItem, Thanks to David Wright
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-11 06:28:54 +00:00
Robin Dunn
92de61e429 More interface fixes for Phoenix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 22:38:14 +00:00
Robin Dunn
c921d597cf Add wxFormatInvalid, and tweak the docs for wxDataObject::GetDataHere and SetData
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 22:34:46 +00:00
Robin Dunn
137c1e7f86 Add doc for wxCliboard::Get
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 22:34:39 +00:00
Julian Smart
1aca9fcdfc Added wxRichTextXMLHandler::RegisterNodeName so custom content classes can be added without
breaking XML loading


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 11:59:59 +00:00
Vadim Zeitlin
1e58c8b944 Set LF EOL style for setup.h.in file.
This file is only used under Unix so should have Unix EOLs, e.g. to allow
building Unix ports from the sources checked out under Windows.

Closes #14266.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-10 11:53:45 +00:00
Vadim Zeitlin
136aafe540 Add missing wx/scopeguard.h include to fix the build.
Closes #14285.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 17:16:26 +00:00
Vadim Zeitlin
902b679a45 Fix wxGenericListCtrl best size calculation in report view.
Just let the base class do it instead of using hard coded default value in
wxGenericListCtrl::DoGetBestClientSize().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71396 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:54 +00:00
Vadim Zeitlin
f797518e8f Unconditionally define IID_IShellItem in wxMSW sources.
This GUID may not be defined in uuid.lib even when
__IShellItem_INTERFACE_DEFINED__ is defined in the headers, so just define it
always to avoid any problems.

Closes #14244.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:51 +00:00
Vadim Zeitlin
1e20681c9e Implement constrained best size calculation in wxMSW wxListCtrl.
This fixes wxListbook controller size to avoid spurious scrollbars.

Closes #13898.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:47 +00:00
Vadim Zeitlin
402dae7b46 Improve wxBookCtrlBase controller size calculations.
Use GetBest{Height,Width}() in wxBookCtrlBase to compute the controller
control size height/width from its known (from wxBookCtrlBase size itself)
width/height. This will allow to correctly compute the size of wxListCtrl used
by wxListbook once it provides the necessary support for width-from-height and
height-from-width calculations.

See #13898.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:44 +00:00
Vadim Zeitlin
d119983947 Add wxWindow::GetBest{Height,Width}().
These functions will be used when it is necessary to determine the best size
of the control if one of its size components is fixed. Currently none of the
classes implements DoGetBestClient{Height,Width}() yet but wxListCtrl will do
it soon, see #13898.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:37 +00:00
Vadim Zeitlin
386279c3f2 Improve wxWindow best size documentation, mention DoGetBestClientSize().
Custom classes should typically override DoGetBestClientSize() instead of
DoGetBestSize() to avoid having to deal with the borders.

Also don't reference the deprecated SetInitialBestSize() unnecessarily and
document its non-deprecated replacement.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:34 +00:00
Vadim Zeitlin
d5d037c362 Mention wxFoobookEvent change from classes to #defines in the change log.
These classes can't be forward-declared any more as they're not really classes
any longer but just compatibility #defines and can't be made classes again as
this would break the existing code using wxBookCtrlEvent in 2.9.

See #14242.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:30 +00:00
Vadim Zeitlin
36b0b09078 Allow entering more digits in wxSpinCtrl in wxMSW than fits into it.
Scroll the control automatically if there is not enough space. This is
consistent with (single line) wxTextCtrl and wxSpinCtrl under the other
platforms.

Closes #14211.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:27 +00:00
Vadim Zeitlin
679dc4e813 Attach MDI "Window" menu to the parent frame menu bar in wxMSW.
This makes sense and fixes the regression with "Window" menu commands not
being processed any more after the changes of r71114.

Closes #14207.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:23 +00:00
Vadim Zeitlin
6e36db5eca Correct the initial value setting in wxMSW wxSpinCtrl.
Always use value argument for the text control contents and also override the
initial numeric value with it if it's numeric.

This seems to be the only consistent thing to do, so document this behaviour
and add a unit test checking for it.

Closes #13589.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:20 +00:00
Vadim Zeitlin
8087e6c942 Remove assert checking bitmap size in wxMenuItem drawing code in wxMSW.
This assert was fatal, as usual when asserting from a WM_PAINT handler, as the
function was reentered resulting in nested asserts and program abort, so
remove it to at least let the program continue to run even if there is not
enough space for the bitmap in the menu.

There is, of course, still something wrong with the menu geometry calculations
if this happens but I can't even reproduce this any more so not sure what
exactly.

See #11657.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:16 +00:00
Vadim Zeitlin
2c2138e937 Fix creation of wxBitmap from wxIcon in wxMSW: premultiply the pixels.
wxBitmap in wxMSW is supposed to store its data in alpha-premultiplied format
but didn't do it when it was created from an icon (or a cursor), resulting in
wrong display of wxIcons with alpha channel when they were used for e.g. menu
items.

Fix this by ensuring that the data is always premultiplied. This is not the
best solution as in some cases (e.g. if this wxBitmap is added to wxImageList
later) we could need to undo this premultiplication later which is quite
inefficient but at least it's simple and straightforward.

Closes #11414.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:12 +00:00
Vadim Zeitlin
39d169639b Fix wxString unit test when not using UTF-8.
Restrict the tests added in r70987 to run when using UTF-8 strings only, they
test for something that is simply not true (and for a bug that can't happen)
with non-multibyte encodings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:10 +00:00
Vadim Zeitlin
30ee0b9764 Fix compilation of wxVariant code with VC6.
This was broken by the changes in r71196 as the original VC6 SDK doesn't
define VARIANT::llVal.

See #14210.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:07 +00:00
Vadim Zeitlin
1b63698581 Use better face names first in wxGTK wxNativeFontInfo::SetFamily().
Try better matches and not the most widespread ones first when building a list
of face names to try for the given family. This gives better results when
these better fonts are indeed available and doesn't change anything if they
are not.

See #14126.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:03 +00:00
Vadim Zeitlin
912886949a Check that item ID is initialized when inserting it in wxListCtrl.
Using uninitialized ID happened to work by accident with 2.8 but it doesn't
work any more, try to detect this as early as possible and give a clear
explanation of why it doesn't to help fixing the broken code that used to
accidentally work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:01 +00:00
Vadim Zeitlin
ae4375b878 Fix wxStaticBitmap best size calculation in wxMSW.
Take the control borders into account by overriding DoGetBestClientSize()
instead of DoGetBestSize().

Also invalidate the default best size computed before we have any valid image
when setting the initial image in Create().

Closes #4099.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:23:57 +00:00
Julian Smart
7c9fdebe5f Added field implementation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 11:06:04 +00:00
Julian Smart
f819ed5d42 Moved default margins to buffer class Init; reduced chance of accidental selection when clicking
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-08 17:31:06 +00:00
Julian Smart
20d09da5f8 Corrected top-level object layout in paragraphs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 15:47:23 +00:00
Julian Smart
a70eb13eb2 Fixed inconsistent calculation of line height in paragraph layout
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:13:30 +00:00
Vadim Zeitlin
37424888b8 No real changes, just fix some typos in comments.
Closes #14276.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:12:27 +00:00
Julian Smart
bea12bf084 Added non-breaking space to whitespace check
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-07 13:12:27 +00:00