Commit Graph

13937 Commits

Author SHA1 Message Date
Vadim Zeitlin
6dfe3a3aee Define wxStrto{d,l,ul}_l() functions in non-Unicode build too.
This fixes the unit test compilation in ANSI build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64109 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:16:12 +00:00
Jaakko Salli
d1358fcbd7 Added parenthesis around macro arguments
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 14:06:00 +00:00
Jaakko Salli
153107b402 Allow wxAny to contain 'const char*' or 'const wchar_t*'. This was previously not possible since these pointers were converted to wxString, as convenient means to work with string literals. Now pointers (to string literals) are stored instead, and As<wxString>(), comparison operators do the type conversion.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 13:51:38 +00:00
Vadim Zeitlin
e3f5caa223 Return correct invoking window for submenus of a popup menu.
SetInvokingWindow() is only called for the top menu being popped up itself but
the invoking window should also be associated with its submenus.

Modify GetInvokingWindow() to return the parents invoking window for submenus.

This fixes a crash due to returning NULL from wxMenu::GetWindow() in wxMSW
owner-drawn code.

And it also makes redundant some code in wxUniversal wxMenu implementation
which can now simply use GetInvokingWindow() in all cases.

Closes #11957.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:21:35 +00:00
Vadim Zeitlin
fa5f485828 Override wxWindow::MSWGetCreateWindowCoords() in wxTopLevelWindow.
The old code was messy because it handled both top level and child windows at
wxWindow level when they need quite different treatment. This resulted in
several errors: first, wxWindow versions of WidthDefault and HeightDefault
were used to determine the initial size even of top level windows which was
clearly wrong as it created tiny windows (20*20). Second, CW_USEDEFAULT could
be used for child window for which this shouldn't be done.

Fix this by making MSWGetCreateWindowCoords() virtual and overriding it in
wxTopLevelWindow. This makes the code much simpler and more obviously correct.

Also make MSWGetCreateWindowCoords() void, as nobody was using its return
value anyhow (and the old version also had a bug in it and wrongly returned
true when default size was passed to it).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:21:21 +00:00
Vadim Zeitlin
db890987c6 Add documentation for several grid cell renderer/editor classes.
Document the previously undocumented renderers and editors.

Closes #11965.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 11:20:50 +00:00
Stefan Csomor
3328e0ca26 missed in r64093
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 07:00:32 +00:00
Stefan Csomor
7934e44732 overriding the cfrunloop accessor, during booting cocoa has to create a NSRunLoop earlier
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-22 06:16:34 +00:00
Stefan Csomor
445e564f12 tracking open modal dialogs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 19:09:38 +00:00
Stefan Csomor
075e355305 having common API for mapping between native and wx tlw type
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:55:42 +00:00
Stefan Csomor
447e2772a6 type of wrapped window can be any NSWindow, not only our own classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:55:10 +00:00
Stefan Csomor
e86d68934f TODO done
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:54:32 +00:00
Stefan Csomor
638b3cd7a8 wrap native TLWs so that they also appear in the tlw list
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 14:51:54 +00:00
Jaakko Salli
49efebe247 Fix VC6 compilation by changing the order of assignment operators in wxAny
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 12:55:34 +00:00
Vadim Zeitlin
f994a8ac8d Add wxProgressDialog::Was{Cancelled,Skipped}() convenience methods.
Although the information about "Cancel" and "Skip" buttons presses is returned
from Update(), sometimes it may be more convenient to ask the dialog about
whether it was cancelled or skipped instead of storing it in the program
itself.

Add the methods which allow to check for this.

Closes #10903.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-20 11:10:33 +00:00
Stefan Csomor
2f30930a09 streamlining code for extra controls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-18 13:17:16 +00:00
Jaakko Salli
0aaed451fd Fix wxAny for VC6 by removing 'wxAny& operator=(const wxVariant &variant)' for it. This will break some cases of implicit wxVariant->wxAny conversion (for VC6).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-18 11:15:26 +00:00
Vadim Zeitlin
cdc48273b4 Fix bug with using uninitialized flags in GetParentForModalDialog().
GetParentForModalDialog() was called from the ctor initialized list before
m_windowStyle could be initialized by the base class ctor in several different
places, meaning that the check for wxDIALOG_NO_PARENT in this function was
using uninitialized variable.

Fix this by passing the style parameter explicitly to this function to allow
using it from derived class ctors. Still keep an overload which uses the
actual window parent and flags which is simpler to use for later calls to this
function.

Thanks valgrind for finding this one.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-18 00:05:37 +00:00
Robert Roebling
2a227e8c9f Added virtual destructor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-17 12:34:32 +00:00
Jaakko Salli
901abd5953 Removed two instances of 'template<>' - looks like VC6 did not need it after all, but was just really picky about the order of constructors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-17 12:03:18 +00:00
Jaakko Salli
ea412ac4eb Fixed VC6 compilation - wxAny(const wxVariant&) ctor required a specific 'template<>')
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-17 08:59:13 +00:00
Vadim Zeitlin
d15946384a Don't define wxADJUST_MINSIZE if it had been already defined.
Defining wxADJUST_MINSIZE as 0 may be a simple way to make the old code to
compile and while it works without WXWIN_COMPATIBILITY_2_8 it paradoxically
doesn't work with it because this results in errors when wxADJUST_MINSIZE is
defined as 0 by wx itself.

Avoid this problem by only defining wxADJUST_MINSIZE ourselves if it hadn't
been defined yet.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 20:52:59 +00:00
Vadim Zeitlin
e79f02bdde Add wxToolBar::GetToolByPos() method to access tools by their index.
This is a trivial accessor which somehow was never added before even though we
had GetToolsCount() and even DeleteToolByPos().

Closes #11120.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 20:52:53 +00:00
Václav Slavík
1be1262444 Fix build breakage caused by bConvertEncoding deprecation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 20:09:00 +00:00
Jaakko Salli
4e0bdd562d Adapted wxPropertyGrid documentation, samples, tests, and wxVariantData-macros to the new wxAny<->wxVariant conversions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 14:36:32 +00:00
Jaakko Salli
0bf14ab8b1 wxVariant <-> wxAny conversion functionality. Includes implicit construction of wxAny from wxVariant, and vice versa. wxVariant->wxAny conversion is implemented by adding new virtual member function into wxVariantData. wxAny->wxVariant conversion is implemented by associating wxAnyValueTypes with functions that generate wxVariantData instances (using a hash map).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 14:33:52 +00:00
Vadim Zeitlin
3017880eff Don't rely on __GXX_RTTI being defined with g++ < 4.3.
__GXX_RTTI is only defined since g++ 4.3.2 and so we can't rely on its absence
as indicating the use of -fno-rtti switch with the older versions of the
compiler, only do this for g++ 4.3+.

Also define wxNO_RTTI from configure if --enable-no_rtti was used as we can't
always detect it automatically.

Closes #11955.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 12:44:30 +00:00
Václav Slavík
3acf8a8d9b Remove wxLOCALE_CONV_ENCODING flag.
This doesn't affect Unicode builds, only the legacy ANSI one.

PO files are now always converted to the appropriate charset according
to current locale. This was the default behavior for long time; not
doing the conversion was always a fragile hack that didn't work well.
Removing this flag simplifies wxLocale code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 11:29:22 +00:00
Václav Slavík
f30bd8f262 Add wxLOCALE_DONT_LOAD_DEFAULT (=0) for clarity.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 11:29:09 +00:00
Václav Slavík
8d94819c43 Remove wxUSE_WCHAR_T checks.
wxWidgets requires wchar_t for some time now; wx/chartype.h has a check
to fail complation without it. Simplify code by removing now-dead code
for the !wxUSE_WCHAR_T case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 10:43:18 +00:00
Stefan Csomor
bc5c09a3aa translating background style BG_PAINT into opaqueness for speed-up of OS redraws, supporting positioning for native carbon controls also on non-composited windows (custom pane in navservices dialogs)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-16 06:18:16 +00:00
Vadim Zeitlin
7f2468e96a Fix using weak references to incomplete classes.
wxWeakRef can work with forward-declared classes provided dynamic_cast<> is
available but this wasn't detected as being the case due to the use of the
obsolete HAVE_DYNAMIC_CAST in its code.

Replace HAVE_DYNAMIC_CAST with !wxNO_RTTI to fix this.

Also add a unit test checking that this does work.

Closes #11916.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-15 22:47:37 +00:00
Stefan Csomor
7d53220e14 fixing constants to be of the expected parameter type (float instead of double)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-14 12:16:42 +00:00
Stefan Csomor
61ad44c7a9 adding support for extraControl on osx_carbon
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-13 20:27:04 +00:00
Stefan Csomor
17e2694c59 adding wrapping possibility for native tlws
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-13 20:24:59 +00:00
Stefan Csomor
b61b8371b0 correcting alpha and removing window shadow for overlay
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-12 20:39:51 +00:00
Stefan Csomor
59d866ad85 name change to correctly reflect the autorelease nature of the methods, removing double release, fixes #11547, fixes #11760
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-12 16:29:35 +00:00
Vadim Zeitlin
946ceed9cd Fix VC6 compilation which was somehow broken by adding wxWeakRef ctor.
For some mysterious reason, adding non-template wxWeakRef ctor breaks VC6
build with the apparently completely unrelated errors:

include\wx/toplevel.h(223) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class wxWindow *' (or there is no acceptable conversion)
include\wx/toplevel.h(231) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class wxWindow *' (or there is no acceptable conversion)
src\common\dummy.cpp(27) : error C2856: #pragma hdrstop cannot be inside an #if block

Simply don't define it for VC6 to at least allow the code not using wxWeakRef
to compile.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-12 13:08:01 +00:00
Stefan Csomor
82f8ea8547 change grow box implementation - was incorrectly getting the focus in panels before
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-12 11:59:47 +00:00
Vadim Zeitlin
476de5ea9a Fix crash in wxListbook if image list is assigned after adding pages.
The generic wxListCtrl didn't properly support switching between report and
non-report modes without invalidating the control contents, the required in
non report view geometry info pointers were not allocated when the control was
switched to a, say, list mode and not created in it.

Fix this by updating all list control lines when the report mode changes.

Closes #11698.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-12 00:37:08 +00:00
Vadim Zeitlin
8dd13d0fa1 Fix return value of wxList::insert() in non-STL builds.
The returned value was the same as the iterator that was passed in which could
even be invalid when appending.

Fix the wrong use of postfix decrement instead of prefix one and handle the
case of appending correctly.

Closes #11808.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-12 00:36:36 +00:00
Vadim Zeitlin
89e1de6441 Fix compilation of wxIconBundle in some particular minimal builds.
Let the code compile when wxUSE_STREAMS==1 but wxUSE_FILE and wxUSE_FFILE are
both 0.

Closes #10900.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-12 00:36:31 +00:00
Vadim Zeitlin
d8eff331e2 Use template class instead of template function in wxVectorSort().
This allows the code to compile with VC6 which has trouble with explicit
specification of the template functions instantiation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-11 17:38:01 +00:00
Jaakko Salli
5caf524dff Fixed typo in documentation string
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-11 13:20:10 +00:00
Vadim Zeitlin
e3ab69523b Add wxString::ToStdString() and ToStdWstring().
These trivial helper functions are available in all builds (provided that
wxUSE_STD_STRING is not explicitly set to non-default 0 value) unlike implicit
conversions to std::[w]string which are only available when wxUSE_STL==1.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-11 11:08:49 +00:00
Stefan Csomor
13f0c85aa4 cocoa implementation for overlay
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-11 09:26:31 +00:00
Vadim Zeitlin
43aecc4dd7 Add non-template wxWeakRef<T> constructor from T*.
We need a non-template ctor to make the code initializing wxWeakRef with
literal NULL to compile.

Closes #11916.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-10 18:13:29 +00:00
Vadim Zeitlin
fc4e23d7c1 Add wxWeakRef::element_type, remove unnecessary assignment operator.
Define element_type for consistency with other classes (wxSharedPtr, weak_ptr)
and to allow accessing the type from the template code.

Also remove the apparently unnecessary template assignment operator:
assignment from an expression convertible to type T* works even without it and
while assigning something implicitly convertible to T* wouldn't work now, it's
for the best as we don't want to rely on such implicit conversions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-10 18:13:23 +00:00
Vadim Zeitlin
90fbb09ae2 Add wxImage::ClearAlpha().
This simple method can be used to remove alpha channel from the image.

See #10915.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-09 13:15:20 +00:00
Václav Slavík
a9d41efb74 Add system libs in msvc/wx/setup.h too.
This makes it possible to use static build of wx from VC++ by just
including its headers. Even though it's common to have these libs in
your settings, it's not always the case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-09 06:55:19 +00:00