Commit Graph

142 Commits

Author SHA1 Message Date
Vadim Zeitlin
20d88ec692 Move wxList::Member() to pseudo-template base list class.
Member() should be available in all list classes, not just specially crafted
list of wxObjects (wxList).

See #3616.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-10 12:48:36 +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
0f08aa4432 Change return type of wxList::Member() to bool.
It used to return a pointer in wxUSE_STL==0 build and an object in
wxUSE_STL==1 one making checking its return value difficult without provoking
warnings from either MSVC or g++ (see #11038).

Also, all the other occurrences of Member() already returned bool, including
the one in wxStringList so changing it to return bool in wxList itself is more
consistent.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-18 17:10:58 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +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
ab13878f7b fix other insert() overloads to work when inserting at the end of the list, continuation of r56299 (see #10103)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-07 23:46:53 +00:00
Vadim Zeitlin
7b8b72b506 removed wrong check from splice(it, list, first)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-07 23:23:49 +00:00
Vadim Zeitlin
1416fc5ff6 fix wxList::erase(it, end()) in non-STL build (see #10103)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-07 23:10:56 +00:00
Francesco Montorsi
d48b06bd90 check in the 'selective yield' patch (see ticket #10320):
- implements YieldFor() with event filtering for wxMSW and wxGTK,
  adds TODO markers in other ports;
- replaces wxYield() in GTK's clipboard code with a wxTheApp->YieldFor() call, thus fixing possible reentrancies 
(and modifies clipboard sample to test synchronous IsSupported calls)
- replaces wxYieldIfNeeded() calls in wxProgressDialog with wxTheApp->YieldFor() calls, so that it processes only 
UI/user-input events, thus fixing the race condition visible in the "thread" sample
- documents the new functions


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-04 17:42:28 +00:00
Vadim Zeitlin
c23b255ab4 don't use annoying and unneeded in C++ casts of NULL to "T *"
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-19 13:39:25 +00:00
Vadim Zeitlin
8ad170cb85 STL build: fix missing const which results in Insert(int, T) being called instead of Insert(iterator, T) via iterator->bool conversion (this fixes at least one test failure)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-12 16:57:11 +00:00
Vadim Zeitlin
5c33522fca replace wx_{const,static,reinterpret}_cast with their standard C++ equivalents
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-02 02:39:52 +00:00
Vadim Zeitlin
b9f9065e28 fix the bug in insert(end(), value) and added unit test for it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-14 09:04:52 +00:00
Vadim Zeitlin
b547eb0f86 remove default value for the last parameter of insert(it, idx, value) which allowed insert(it, 17) to compile for lists of any type
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-14 08:59:05 +00:00
Robert Roebling
4f47a8d0c6 Move definition of wxListIteratorFunction and ..SortFuntion to defs.h so it can be used from elsewhere
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-18 19:05:21 +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
Paul Cornett
162e998c2f check for self-assignment in operator=
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-01-09 04:08:33 +00:00
Robin Dunn
c6ed07281f Remove WXDLLIMPEXP_BASE from the declaration of wxList_SortFunction
to resolve link errors with MSVC 7.1

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-01-08 22:41:28 +00:00
Vadim Zeitlin
f172cb8200 removed support for Salford compiler (which was almost certainly broken anyhow) (patch 1861133)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-12-31 10:05:00 +00:00
Robert Roebling
7e59e3d050 Made wxList no longer inherit from wxObject, no change in STL mode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-13 22:00:10 +00:00
Václav Slavík
ad259ba5b2 copy the list in wxList::operator=(), for consistency with typed macro-based lists
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-27 15:01:12 +00:00
Václav Slavík
e5eaf55744 fixed visiblity attribute warnings in STL build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-08-08 21:55:22 +00:00
Václav Slavík
cae92a4988 VC6_WORKAROUND -> WX_LIST_VC6_WORKAROUND to prevent name conflicts
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-08-08 21:26:32 +00:00
Václav Slavík
b5dbe15d0b added WXDLLIMPEXP_FWD_FOO macros in addition to WXDLLIMPEXP_FOO for use with forward declarations (in preparation for GCC visibility support)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-09 10:09:52 +00:00
Václav Slavík
5abefd049e compatibility fix: have wxListKey ctors from C strings so that passing string literals to functions expecting wxListKey works
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-27 20:50:15 +00:00
Vadim Zeitlin
b46b1d59d6 implement event loop for console applications (heavily modified patch 1715735)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-14 23:43:39 +00:00
Vadim Zeitlin
248d0a8970 move wxKEY_XXX constants to wx/defs.h from wx/list.h and wx/hash.h to avoid duplicating their declarations
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-26 02:15:24 +00:00
Václav Slavík
8a7afe4dfe compilation fix for VC6 with wxUSE_STL=1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-15 18:47:19 +00:00
Václav Slavík
a4c1cdc9dc don't use the VC6 workaround in wxList with newer versions of VC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-14 11:04:30 +00:00
Václav Slavík
817270659e initial version of UTF-8 strings representation (still converting to wchar_t* a lot); it has to be explicitly enabled with --enable-utf8 for now
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-12 21:15:07 +00:00
Vadim Zeitlin
c1dc9f8394 removed WXWIN_COMPATIBILITY_2_4 from common and wxMSW files (patch 1675546)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-07 11:35:04 +00:00
Vadim Zeitlin
cd840087aa fix compilation with wxUSE_STL=1 for VC6 (and presumably others) (bug 1614814)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-12-15 01:47:26 +00:00
Vadim Zeitlin
af867f957d fixed operator[] in wxUSE_STL build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-05-08 21:25:00 +00:00
Vadim Zeitlin
9ea1246ba6 added operator[] for STL builds
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39105 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-05-08 00:56:59 +00:00
Vadim Zeitlin
7d13fbc6dc don't use invalid/uninitialized iterator in wxList::compatibility_iterator in wxUSE_STL==1 case, this doesn't work with the debug version of glibc STL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-04-24 17:59:10 +00:00
Vadim Zeitlin
3871d4ca75 use proper dllexport declaration with _WX_LIST_HELPER_
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-04-02 01:10:41 +00:00
Vadim Zeitlin
2e4b087e1c reverted return type of wxList method to nodetype * from compatibility_iterator (undoing change of rev 1.103) because this breaks very old core relying on conversion of wxList::GetFirst() to wxNode* for example
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-23 16:19:48 +00:00
Vadim Zeitlin
30a29593e8 workaround for mingw 3.2.3 DLL build with wxUSE_STL=1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38292 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-23 02:01:25 +00:00
Vadim Zeitlin
d294c9db88 nested iterator classes must be dll-exported
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-23 01:01:50 +00:00
Vadim Zeitlin
d4d8988c72 made wxList methods return compatibility_iterator instead of Node * to further reduce differences between wxUSE_STL==0 and 1 cases
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-22 19:14:28 +00:00
Vadim Zeitlin
0cc70962a1 Made wxList::compatibility_iterator a class in wxUSE_STL == 0 case too instead
of a simple typedef to "Node *" to be able to initialize it with NULL in ctor
which makes the behaviour of the code with and without wxUSE_STL the same.


The price to pay is that the code like

	wxList:compatibility_iterator ci;
	ci = cond ? list->GetFirst() : wxList::compatibility_iterator();

doesn't compile any more and has to be replaced with (more clear anyhow)

	wxList:compatibility_iterator ci;
	if ( cond )
		ci = list->GetFirst();


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-21 14:05:11 +00:00
Vadim Zeitlin
5d9ef6deec return NULL (and not invalid) iterator from compatibility_iterator::GetPrevious() when we're at the start of the list (see patch 1445506)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-21 13:17:31 +00:00
Vadim Zeitlin
b4affacc10 added assert to verify that operands are initialized in compatibility_iterator::operator==()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-21 13:14:19 +00:00
Vadim Zeitlin
0b6cf20588 reuse operator bool() check in compatibility_iterator::IndexOf() instead of rewriting it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-21 13:00:19 +00:00
Mattia Barbon
1794103bab DeleteFunction argument should be non-const since it
is deleted inside the function.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-02-03 18:26:55 +00:00
Julian Smart
48ba35c357 Two corrections to const fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-18 08:34:03 +00:00
Julian Smart
2ad75f457d Applied patch [ 1392288 ] FIX: Bug 1306671 Build Error in list.h with VC2005
By Kevin J Bluck, with mods by JS


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-17 19:02:39 +00:00
Włodzimierz Skiba
c0089c96ec Minor cleanings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-11-15 07:40:12 +00:00
Mart Raudsepp
8907154c1a Nuke #pragma implementation/interface's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-23 12:56:45 +00:00
Włodzimierz Skiba
48f7ffbe93 First part of '[ 1216148 ] cleanup: unused variables and declarations'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-06-07 19:01:45 +00:00