]> git.saurik.com Git - wxWidgets.git/blame - docs/changes.txt
wxrc: fix incorrectly generated code with --extra-cpp-code (fixes #9631)
[wxWidgets.git] / docs / changes.txt
CommitLineData
70cf18ef
VZ
1-------------------------------------------------------------------------------
2 wxWidgets Change Log
3-------------------------------------------------------------------------------
d643b80e 4
5ec9d741 5INCOMPATIBLE CHANGES SINCE 2.8.x
aae53500
VZ
6================================
7
500b128d
VZ
8
9 Notice that these changes are described in more details in
10 the "Changes Since wxWidgets 2.8" section of the manual,
11 please read it if the explanation here is too cryptic.
12
13
e6d4038a
VZ
14Unicode-related changes
15-----------------------
16
17The biggest changes in wxWidgets 3.0 are the changes due to the merge of the
18old ANSI and Unicode build modes in a single build. See the Unicode overview
19in the manual for more details but here are the most important incompatible
20changes:
21
22- Many wxWidgets functions taking "const wxChar *" have been changed to take
3dac8f8a
VS
23 either "const wxString&" (so that they accept both Unicode and ANSI strings;
24 the argument can't be NULL anymore in this case) or "const char *" (if the
e0e7a341
VS
25 strings are always ANSI; may still be NULL). This change is normally
26 backwards compatible except:
4baf7800
VZ
27
28 a) Virtual functions: derived classes versions must be modified to take
29 "const wxString&" as well to make sure that they continue to override the
30 base class version.
31
32 b) Passing NULL as argument: as NULL can't be unambiguously converted to
33 wxString, in many cases code using it won't compile any more and NULL
0d5ab92f
VZ
34 should be replaced with an empty string.
35
36
37- Some structure fields which used to be of type "const wxChar *" (such as
38 wxCmdLineEntryDesc::shortName, longName and description fields) are now of
39 type "const char *", you need to remove wxT() or _T() around the values used
40 to initialize them (which should normally always be ASCII).
e6d4038a 41
50c549b9
VZ
42- wxIPC classes didn't work correctly in Unicode build before, this was fixed
43 but at a price of breaking backwards compatibility: many methods which used
44 to work with "wxChar *" before use "void *" now (some int parameters were
45 also changed to size_t). While wxIPC_TEXT can still be used to transfer 7
46 bit text, the new wxIPC_UTF8TEXT format is used for transferring wxStrings.
f01a77c7
VZ
47 Also notice that connection classes should change the parameter types of
48 their overridden OnExecute() or override a more convenient OnExec() instead.
e6d4038a
VZ
49
50
6f67af05
FM
51wxODBC and contrib libraries removal
52------------------------------------
1e6b2edf
VZ
53
54wxODBC library was unmaintained since several years and we couldn't continue
55supporting it any longer so it was removed. Please use any of the other open
56source ODBC libraries in the future projects.
57
6f67af05
FM
58Also the "applet", "deprecated", "fl", "mmedia" and "plot" contrib libraries
59were removed as they were unmaintained and broken since several years.
60The "gizmos", "ogl", "net" and "foldbar" contribs have been moved to
61wxCode (see http://wxcode.sourceforge.net/complist.php); they are now
62open for futher development by volunteers.
63
64The "stc" and "svg" contribs instead have been moved respectively into a new
65"official" library stc and in the core lib.
66
1e6b2edf 67
b1f3b29c
VZ
68Changes in behaviour not resulting in compilation errors, please read this!
69---------------------------------------------------------------------------
70
466e87bd
VZ
71- Default location of wxFileConfig files has changed under Windows, you will
72 need to update your code if you access these files directly.
73
47a8a4d5
VZ
74- wxWindow::IsEnabled() now returns false if a window parent (and not
75 necessarily the window itself) is disabled, new function IsThisEnabled()
76 with the same behaviour as old IsEnabled() was added.
77
5644933f
VZ
78- Generating wxNavigationKeyEvent events doesn't work any more under wxGTK (and
79 other platforms in the future), use wxWindow::Navigate() or NavigateIn()
80 instead.
81
89064717
VZ
82- Sizers distribute only the extra space between the stretchable items
83 according to their proportions and not all available space. We believe the
84 new behaviour corresponds better to user expectations but if you did rely
85 on the old behaviour you will have to update your code to set the minimal
86 sizes of the sizer items to be in the same proportion as the items
87 proportions to return to the old behaviour.
88
17808a75
VZ
89- wxWindow::Freeze/Thaw() are not virtual any more, if you overrode them in
90 your code you need to override DoFreeze/Thaw() instead now.
91
628e155d
VZ
92- wxCalendarCtrl has native implementation in wxGTK, but it has less features
93 than the generic one. The native implementation is used by default, but you
94 can still use wxGenericCalendarCtrl instead of wxCalendarCtrl in your code if
95 you need the extra features.
96
9c8116f8
VZ
97- wxDocument::FileHistoryLoad() and wxFileHistory::Load() now take const
98 reference to wxConfigBase argument and not just a reference, please update
99 your code if you overrode these functions and change the functions in the
100 derived classes to use const reference as well.
101
a6eac99d
VZ
102- Under MSW wxExecute() arguments are now always properly quoted, as under
103 Unix, and so shouldn't contain quotes unless they are part of the argument.
17808a75 104
c6e4d276
VZ
105- wxDocument::OnNewDocument() doesn't call OnCloseDocument() any more.
106
1d7b600d
VZ
107- If you use wxScrolledWindow::SetTargetWindow() you must implement its
108 GetSizeAvailableForScrollTarget() method, please see its documentation for
109 more details.
110
111
b1f3b29c
VZ
112Changes in behaviour which may result in compilation errors
113-----------------------------------------------------------
114
c1dc9f83
VZ
115- WXWIN_COMPATIBILITY_2_4 doesn't exist any more, please update your code if
116 you still relied on features deprecated since version 2.4
117
ddc0ac4a
VZ
118- wxDC classes hierarchy has changed, if you derived any classes from wxDC you
119 need to review them as wxDC doesn't have any virtual methods any longer and
120 uses delegation instead of inheritance to present different behaviours.
121
3b7fa206
VZ
122- wxWindow::ProcessEvent() has been made protected to prevent wrongly using it
123 instead of correct GetEventHandler()->ProcessEvent(). New ProcessWindowEvent()
124 was added for convenience.
125
c9f78968
VS
126- Return type of wxString::operator[] and wxString::iterator::operator* is no
127 longer wxChar (i.e. char or wchar_t), but wxUniChar. This is not a problem
128 in vast majority of cases because of conversion operators, but it can break
129 code that depends on the result being wxChar.
130
ef0f1387
VS
131- The value returned by wxString::c_str() cannot be casted to non-const char*
132 or wchar_t* anymore. The solution is to use newly added wxString methods
133 char_str() (which returns a buffer convertible to char*) or wchar_str()
134 (which returns a buffer convertible to wchar_t*). These methods are
135 available in wxWidgets 2.8 series beginning with 2.8.4 as well.
136
c9f78968
VS
137- The value returned by wxString::operator[] or wxString::iterator cannot be
138 used in switch statements anymore, because it's a class instance. Code like
139 this won't compile:
140 switch (str[i]) { ... }
141 and has to be replaced with this:
142 switch (str[i].GetValue()) { ... }
143
73ba5ab9
VZ
144- Return type of wxString::c_str() is now a helper wxCStrData struct and not
145 const wxChar*. wxCStrData is implicitly convertible to both "const char *"
146 and "const wchar_t *", so this only presents a problem if the compiler cannot
147 apply the conversion. This can happen in 2 cases:
a6eac99d 148
73ba5ab9
VZ
149 + There is an ambiguity because the function being called is overloaded to
150 take both "const char *" and "const wchar_t *" as the compiler can't choose
151 between them. In this case you may use s.wx_str() to call the function
152 matching the current build (Unicode or not) or s.mb_str() or s.wc_str() to
153 explicitly select narrow or wide version of it.
154
155 Notice that such functions are normally not very common but unfortunately
156 Microsoft decided to extend their STL with standard-incompatible overloads
157 of some functions accepting "const wchar_t *" so you may need to replace
158 some occurrences of c_str() with wx_str() when using MSVC 8 or later.
159
160 + Some compilers, notably Borland C++ and DigitalMars, don't correctly
161 convert operator?: operands to the same type and fail with compilation
162 error instead. This can be worked around by explicitly casting to const
163 wxChar*: wxLogError(_("error: %s"), !err.empty() ? (const wxChar*)err.c_str() : "")
c9f78968 164
52de37c7 165- wxCtime() and wxAsctime() return char*; this is incompatible with Unicode
5bce3e6f 166 build in wxWidgets 2.8 that returned wchar_t*.
52de37c7 167
c9f78968
VS
168- DigitalMars compiler has a bug that prevents it from using
169 wxUniChar::operator bool in conditions and it erroneously reports type
170 conversion ambiguity in expressions such as this:
171 for ( wxString::const_iterator p = s.begin(); *p; ++p )
172 This can be worked around by explicitly casting to bool:
173 for ( wxString::const_iterator p = s.begin(); (bool)*p; ++p )
174
d03dab2a 175- Virtual wxHtmlParser::AddText() takes wxString, not wxChar*, argument now.
5bce3e6f 176
73ba5ab9 177- Functions that took wxChar* arguments that could by NULL in wxWidgets 2.8
d38f70b2 178 are deprecated and passing NULL to them won't compile anymore, wxEmptyString
ab29bb87 179 must be used instead.
d38f70b2 180
de34bb08
VZ
181- wxTmemxxx() functions take either wxChar* or char*, not void*: use memxxx()
182 with void pointers.
183
d03dab2a
VS
184- Removed insecure wxGets() and wxTmpnam() functions.
185
6a4cbac1
VS
186- Removed global GetLine() function from wx/protocol/protocol.h, use
187 wxProtocol::ReadLine() instead.
17808a75 188
c8058a09
JS
189- wxVariant no longer derives from wxObject. wxVariantData also no longer
190 derives from wxObject; instead of using wxDynamicCast with wxVariantData you
191 can use the macro wxDynamicCastVariantData with the same arguments.
6a4cbac1 192
1a8a13ee 193- wxWindow::Next/PrevControlId() don't exist any more as they couldn't be
08f1c27c 194 implemented correctly any longer because automatically generated ids are not
1a8a13ee 195 necessarily allocated consecutively now. Use GetChildren() to find the
08f1c27c
VZ
196 next/previous control sibling instead.
197
500b128d
VZ
198- Calling wxConfig::Write() with an enum value will fail to compile because
199 wxConfig now tries to convert all unknown types to wxString automatically.
200 The simplest solution is to cast the enum value to int.
d03dab2a 201
e98e625c
VZ
202- Several wxImage methods which previously had "long bitmaptype" parameters
203 have been changed to accept "wxBitmapType bitmaptype", please use enum
204 wxBitmapType in your code.
205
763163a8
VZ
206- wxGridCellEditor::EndEdit() signature has changed and it was split in two
207 functions, one still called EndEdit() and ApplyEdit(). See the documentation
208 of the new functions for more details about how grid editors should be
209 written now.
210
211- wxEVT_GRID_CELL_CHANGE event renamed to wxEVT_GRID_CELL_CHANGED and shouldn't
212 be vetoed any more, use the new wxEVT_GRID_CELL_CHANGING event to do it.
213
214
5ec9d741
VZ
215Deprecated methods and their replacements
216-----------------------------------------
217
13dd765c 218- wxCreateGreyedImage() deprecated, use wxImage::ConvertToGreyscale() instead.
7890307b
VS
219- wxString::GetWriteBuf() and UngetWriteBuf() deprecated, using wxStringBuffer
220 or wxStringBufferLength instead.
d0bc78e2
VZ
221- wxDIRCTRL_SHOW_FILTERS style is deprecated, filters are alwsys shown if
222 specified so this style should simply be removed
724b119a
VZ
223- wxDocManager::MakeDefaultName() replaced by MakeNewDocumentName() and
224 wxDocument::GetPrintableName() with GetUserReadableName() which are simpler
225 to use
288b6107
VS
226- wxXmlProperty class was renamed to wxXmlAttribute in order to use standard
227 terminology. Corresponding wxXmlNode methods were renamed to use
228 "Attribute" instead of "Property" or "Prop" in their names.
022a8a5a
VZ
229- wxConnection::OnExecute() is not formally deprecated yet but new code should
230 use simpler OnExec() version which is called with wxString argument
89c95a7b
FM
231- wxMenuItem::GetLabel has been deprecated in favour of wxMenuItem::GetItemLabelText
232- wxMenuItem::GetText has been deprecated in favour of wxMenuItem::GetItemLabel
a6eac99d 233- wxMenuItem::GetLabelFromText has been deprecated in favour of wxMenuItem::GetLabelText
89c95a7b 234- wxMenuItem::SetText has been deprecated in favour of wxMenuItem::SetItemLabel
82cddbd9
FM
235- wxBrush's, wxPen's SetStyle() and GetStyle() as well as the wxBrush/wxPen ctor now take
236 respectively a wxBrushStyle and a wxPenStyle value instead of a plain "int style";
237 use the new wxBrush/wxPen style names (wxBRUSHSTYLE_XXX and wxPENSTYLE_XXX) instead
238 of the old deprecated wxXXX styles (which however are still available).
e557577d
VZ
239- EVT_GRID_CELL_CHANGE was deprecated, use EVT_GRID_CELL_CHANGED instead if you
240 don't veto the event in its handler and EVT_GRID_CELL_CHANGING if you do.
628e155d
VZ
241- EVT_CALENDAR_DAY event has been deprecated, use EVT_CALENDAR_SEL_CHANGED.
242- EVT_CALENDAR_MONTH and EVT_CALENDAR_YEAR events are deprecated,
243 use EVT_CALENDAR_PAGE_CHANGED which replaces both of them.
244- wxCalendarCtrl::EnableYearChange() and wxCAL_NO_YEAR_CHANGE are deprecated.
fdaad94e
VZ
245 There is no replacement for this functionality, it is being dropped as it is
246 not available in native wxCalendarCtrl implementations.
247- wxDC::SetClippingRegion(const wxRegion&) overload is deprecated as it used
248 different convention from the other SetClippingRegion() overloads: wxRegion
249 passed to it was interpreted in physical, not logical, coordinates. Replace
250 it with SetDeviceClippingRegion() if this was the correct thing to do in your
251 code.
053ac76f 252- wxTE_AUTO_SCROLL style is deprecated as it's always on by default anyhow.
9eab0f6c
FM
253- wxThreadHelper::Create() has been deprecated in favour of wxThreadHelper::CreateThread
254 which has a better name for a mix-in class, and allows setting the thread type.
9ac43913 255
41ae85f8 256
5ec9d741
VZ
257Major new features in this release
258----------------------------------
259
9135f74e
VZ
260- wxWidgets is now always built with Unicode support but provides the same
261 simple (i.e. "char *"-tolerant) API as was available in ANSI build in the
262 past.
263
264- wxWidgets may now use either wchar_t (UTF-16/32) or UTF-8 internally,
265 depending on what is optimal for the target platform.
266
058f225a
VZ
267- New propgrid library containing wxPropertyGrid and related classes.
268
269- Many enhancements to wxDataViewCtrl.
1c4293cb 270
89ff7d64
VZ
271- Event loops, timers and sockets can now be used in wxBase, without GUI.
272
3c778901
VZ
273- Events can now be connected to any functor, not necessarily a method of
274 wxEvtHandler-derived class. The compile-time safety was also improved.
275
89ff7d64
VZ
276- Documentation for wxWidgets has been converted from LaTex to C++ headers
277 with Doxygen comments and significantly improved in the process (screenshots
278 of various controls were added, more identifiers are now linked to their
279 definition &c). Any reports about inaccuracies in the documentation are
280 welcome (and due to using the simple Doxygen syntax it is now easier than
281 ever to submit patches correcting them! :-)
6f8dd114 282
0fa541e8
VZ
283- Support for persistent objects automatically saving and restoring their state
284 was added.
285
12dc0a01 286
ccee328e
VZ
2872.9.0
288-----
289
ac6e0eb1
VZ
290All:
291
4b02d42e 292- Added (experimental) IPv6 support to wxSocket (Arcen).
2186321f 293- Cleaned up wxURI and made it Unicode-friendly.
9243700f 294- Add support for wxExecute(wxEXEC_ASYNC) in wxBase (Lukasz Michalski)
4b02d42e 295- Added wxXLocale class and xlocale-like functions using it.
c0030ca7 296- Allow loading message catalogs from wxFileSystem (Axel Gembe)
6aaee6af 297- Added wxMessageQueue class for inter-thread communications
50c549b9 298- Use UTF-8 for Unicode data in wxIPC classes (Anders Larsen)
3cc305b2 299- Added support for user-defined types to wxConfig (Marcin Wojdyr).
b1859b1a 300- Added numeric options support to wxCmdLineParser (crjjrc)
3cc305b2 301- Added wxJoin() and wxSplit() functions (Francesco Montorsi).
f3f2e255 302- Added wxDateTime::FormatISOCombined() and ParseISODate/Time/Combined()
3cc305b2
JS
303- Added wxMutex::LockTimeout() (Aleksandr Napylov).
304- Added wxMemoryInputStream(wxInputStream&) ctor (Stas Sergeev).
305- Implemented wxMemoryInputStream::CanRead().
fcc65883 306- Implemented wxMemoryFSHandler::FindFirst/Next().
9af42efd 307- Added wxEventLoop::DispatchTimeout().
3cc305b2
JS
308- Added wxEXEC_BLOCK flag (Hank Schultz).
309- Add support for wxStream-derived classes to wxRTTI (Stas Sergeev).
310- Added wxStreamBuffer::Truncate() (Stas Sergeev).
985acf87 311- Allow using wxEventLoop in console applications (Lukasz Michalski).
3cc305b2
JS
312- Added functions for Base64 en/decoding (Charles Reimers).
313- Added support for binary data to wxConfig (Charles Reimers).
314- Added functions for atomically inc/decrementing integers (Armel Asselin).
30519b02 315- wxLogInterposer has been added to replace wxLogPassThrough and new
3cc305b2
JS
316 wxLogInterposerTemp was added.
317- Added support for broadcasting to UDP sockets (Andrew Vincent).
318- Documentation now includes the wx library in which each class is defined.
21b2dde5
VS
319- wxrc --gettext now generates references to source .xrc files (Heikki
320 Linnakangas).
c8058a09
JS
321- wxVariant::Unshare allows exclusive allocation of data that must be shared,
322 if the wxVariantData::Clone function is implemented.
664e1314
VZ
323- Added wxWeakRef<T>, wxScopedPtr<T>, wxScopedArray<T>, wxSharedPtr<T> templates
324 and renamed old wx/ptr_{scpd,shrd}.h headers to wx/scoped{ptr,array}.h and
325 wx/sharedptr.h (but old headers are still provided for compatibility).
69d0fe83 326- Added wxVector<T> class templates
d2a48d5c 327- Added wxON_BLOCK_EXIT_SET() and wxON_BLOCK_EXIT_NULL() to wx/scopeguard.h.
c3f94162
VZ
328- Added wxEvtHandler::QueueEvent() replacing AddPendingEvent() and
329 wxQueueEvent() replacing wxPostEvent().
4f29051b
VZ
330- wxString now uses std::[w]string internally by default, meaning that it is
331 now thread-safe if the standard library provided with your compiler is.
3e50a139 332- Added wxCmdLineParser::AddUsageText() (Marcin 'Malcom' Malich).
9d653e81 333- Fix reading/writing UTF-7-encoded text streams.
f7541d48 334- Corrected bug in wxTimeSpan::IsShorterThan() for equal time spans.
f380544a 335- Use std::unordered_{map,set} for wxHashMap/Set if available (Jan van Dijk).
0c7db140 336- Added wxString::Capitalize() and MakeCapitalized().
ff2201cc 337- Added wxArray::swap().
9016f3ad 338- Added wxSHUTDOWN_LOGOFF and wxSHUTDOWN_FORCE wxShutdown() flags (troelsk).
b67397a7 339- Added wxSocket::ShutdownOutput().
7047d798 340- Handle exceptions thrown from overridden wxView::OnCreate() gracefully.
058f225a 341- Added wxPATH_RMDIR_FULL/RECURSIVE wxFileName::Rmdir() flags (Marcin Malich).
d8efd219 342- Added wxStandardPaths::GetAppDocumentsDir().
abbb59e8 343
bd630206
VZ
344All (Unix):
345
3cc305b2 346- Added wx-config --optional-libs command line option (John Labenski).
8aea37a9 347- Noticeably (by a factor of ~150) improve wxIPC classes performance.
bd630206 348
abbb59e8
VZ
349All (GUI):
350
1c4293cb
VZ
351- Added wxDataViewCtrl class and helper classes.
352- Integrated wxPropertyGrid in wxWidgets itself (Jaakko Salli).
353- Provide native implementation of wxCalendarCtrl under wxMSW and wxGTK.
af67f39d
VZ
354- Added wxHeaderCtrl and allow using it in wxGrid.
355- Added wxRearrangeList, wxRearrangeCtrl and wxRearrangeDialog.
1c4293cb 356- Added {wxTextCtrl,wxComboBox}::AutoComplete() and AutoCompleteFileNames().
3cc305b2 357- Added wxH[V]ScrolledWindow (Brad Anderson, Bryan Petty).
1c4293cb
VZ
358- Added wxNotificationMessage class for non-intrusive notifications.
359- Added wxWindow::Show/HideWithEffect().
360- Added wxWrapSizer (Arne Steinarson).
361- Added wxSpinCtrlDouble (John Labenski).
4b02d42e 362- Support custom labels in wxMessageDialog (Gareth Simpson for wxMac version).
6362d82b 363- Added wxScrolledWindow::ShowScrollbars().
f45d6ade 364- Also added wxCANCEL_DEFAULT to wxMessageDialog.
b6d2b072 365- Allow copying text in the log dialogs.
c39d2e0a 366- Added multisample (anti-aliasing) support to wxGLCanvas (Olivier Playez).
232b2162 367