]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/changes.txt
added const_cast<> to silence gcc warnings (see #10520)
[wxWidgets.git] / docs / changes.txt
... / ...
CommitLineData
1-------------------------------------------------------------------------------
2 wxWidgets Change Log
3-------------------------------------------------------------------------------
4
5INCOMPATIBLE CHANGES SINCE 2.8.x
6================================
7
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
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
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
25 strings are always ANSI; may still be NULL). This change is normally
26 backwards compatible except:
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
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).
41
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.
47 Also notice that connection classes should change the parameter types of
48 their overridden OnExecute() or override a more convenient OnExec() instead.
49
50
51wxODBC and contrib libraries removal
52------------------------------------
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
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
67
68Changes in behaviour not resulting in compilation errors, please read this!
69---------------------------------------------------------------------------
70
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
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
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
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
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
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
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
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.
104
105- wxDocument::OnNewDocument() doesn't call OnCloseDocument() any more.
106
107- If you use wxScrolledWindow::SetTargetWindow() you must implement its
108 GetSizeAvailableForScrollTarget() method, please see its documentation for
109 more details.
110
111- Processing of pending events now requires a running event loop.
112 Thus initialization code (e.g. showing a dialog) previously done in wxApp::OnRun()
113 or equivalent function should now be done into wxApp::OnEventLoopEnter().
114 See wxApp::OnEventLoopEnter() and wxApp::OnEventLoopExit() docs for more info.
115
116
117Changes in behaviour which may result in compilation errors
118-----------------------------------------------------------
119
120- WXWIN_COMPATIBILITY_2_4 doesn't exist any more, please update your code if
121 you still relied on features deprecated since version 2.4
122
123- wxDC classes hierarchy has changed, if you derived any classes from wxDC you
124 need to review them as wxDC doesn't have any virtual methods any longer and
125 uses delegation instead of inheritance to present different behaviours.
126
127- wxWindow::ProcessEvent() (and other wxEvtHandler methods inherited by wxWindow)
128 has been made protected to prevent wrongly using it instead of correct
129 GetEventHandler()->ProcessEvent().
130 New ProcessWindowEvent() was added for convenience.
131
132- Return type of wxString::operator[] and wxString::iterator::operator* is no
133 longer wxChar (i.e. char or wchar_t), but wxUniChar. This is not a problem
134 in vast majority of cases because of conversion operators, but it can break
135 code that depends on the result being wxChar.
136
137- The value returned by wxString::c_str() cannot be casted to non-const char*
138 or wchar_t* anymore. The solution is to use newly added wxString methods
139 char_str() (which returns a buffer convertible to char*) or wchar_str()
140 (which returns a buffer convertible to wchar_t*). These methods are
141 available in wxWidgets 2.8 series beginning with 2.8.4 as well.
142
143- The value returned by wxString::operator[] or wxString::iterator cannot be
144 used in switch statements anymore, because it's a class instance. Code like
145 this won't compile:
146 switch (str[i]) { ... }
147 and has to be replaced with this:
148 switch (str[i].GetValue()) { ... }
149
150- Return type of wxString::c_str() is now a helper wxCStrData struct and not
151 const wxChar*. wxCStrData is implicitly convertible to both "const char *"
152 and "const wchar_t *", so this only presents a problem if the compiler cannot
153 apply the conversion. This can happen in 2 cases:
154
155 + There is an ambiguity because the function being called is overloaded to
156 take both "const char *" and "const wchar_t *" as the compiler can't choose
157 between them. In this case you may use s.wx_str() to call the function
158 matching the current build (Unicode or not) or s.mb_str() or s.wc_str() to
159 explicitly select narrow or wide version of it.
160
161 Notice that such functions are normally not very common but unfortunately
162 Microsoft decided to extend their STL with standard-incompatible overloads
163 of some functions accepting "const wchar_t *" so you may need to replace
164 some occurrences of c_str() with wx_str() when using MSVC 8 or later.
165
166 + Some compilers, notably Borland C++ and DigitalMars, don't correctly
167 convert operator?: operands to the same type and fail with compilation
168 error instead. This can be worked around by explicitly casting to const
169 wxChar*: wxLogError(_("error: %s"), !err.empty() ? (const wxChar*)err.c_str() : "")
170
171- wxCtime() and wxAsctime() return char*; this is incompatible with Unicode
172 build in wxWidgets 2.8 that returned wchar_t*.
173
174- DigitalMars compiler has a bug that prevents it from using
175 wxUniChar::operator bool in conditions and it erroneously reports type
176 conversion ambiguity in expressions such as this:
177 for ( wxString::const_iterator p = s.begin(); *p; ++p )
178 This can be worked around by explicitly casting to bool:
179 for ( wxString::const_iterator p = s.begin(); (bool)*p; ++p )
180
181- Virtual wxHtmlParser::AddText() takes wxString, not wxChar*, argument now.
182
183- Functions that took wxChar* arguments that could by NULL in wxWidgets 2.8
184 are deprecated and passing NULL to them won't compile anymore, wxEmptyString
185 must be used instead.
186
187- wxTmemxxx() functions take either wxChar* or char*, not void*: use memxxx()
188 with void pointers.
189
190- Removed insecure wxGets() and wxTmpnam() functions.
191
192- Removed global GetLine() function from wx/protocol/protocol.h, use
193 wxProtocol::ReadLine() instead.
194
195- wxVariant no longer derives from wxObject. wxVariantData also no longer
196 derives from wxObject; instead of using wxDynamicCast with wxVariantData you
197 can use the macro wxDynamicCastVariantData with the same arguments.
198
199- wxWindow::Next/PrevControlId() don't exist any more as they couldn't be
200 implemented correctly any longer because automatically generated ids are not
201 necessarily allocated consecutively now. Use GetChildren() to find the
202 next/previous control sibling instead.
203
204- Calling wxConfig::Write() with an enum value will fail to compile because
205 wxConfig now tries to convert all unknown types to wxString automatically.
206 The simplest solution is to cast the enum value to int.
207
208- Several wxImage methods which previously had "long bitmaptype" parameters
209 have been changed to accept "wxBitmapType bitmaptype", please use enum
210 wxBitmapType in your code.
211
212- wxGridCellEditor::EndEdit() signature has changed and it was split in two
213 functions, one still called EndEdit() and ApplyEdit(). See the documentation
214 of the new functions for more details about how grid editors should be
215 written now.
216
217- wxEVT_GRID_CELL_CHANGE event renamed to wxEVT_GRID_CELL_CHANGED and shouldn't
218 be vetoed any more, use the new wxEVT_GRID_CELL_CHANGING event to do it.
219
220- Now wxWidgets at startup in debug builds checks if all wxEvent-derived classes
221 correctly implement the Clone() function, logging a warning if they don't.
222 A correct implementation for MyCustomEventClass::Clone() is simply:
223 virtual wxEvent *Clone() const { return new MyCustomEventClass(*this); }
224
225- Global wxPendingEvents and wxPendingEventsLocker objects were removed.
226 You may use wxEventLoopBase::SuspendProcessingOfPendingEvents instead of
227 locking wxPendingEventsLocker now.
228
229
230Deprecated methods and their replacements
231-----------------------------------------
232
233- wxCreateGreyedImage() deprecated, use wxImage::ConvertToGreyscale() instead.
234- wxString::GetWriteBuf() and UngetWriteBuf() deprecated, using wxStringBuffer
235 or wxStringBufferLength instead.
236- wxDIRCTRL_SHOW_FILTERS style is deprecated, filters are alwsys shown if
237 specified so this style should simply be removed
238- wxDocManager::MakeDefaultName() replaced by MakeNewDocumentName() and
239 wxDocument::GetPrintableName() with GetUserReadableName() which are simpler
240 to use
241- wxXmlProperty class was renamed to wxXmlAttribute in order to use standard
242 terminology. Corresponding wxXmlNode methods were renamed to use
243 "Attribute" instead of "Property" or "Prop" in their names.
244- wxConnection::OnExecute() is not formally deprecated yet but new code should
245 use simpler OnExec() version which is called with wxString argument
246- Various wxMenuItem methods were deprecated in favour of more consisently
247 named new versions:
248 . GetLabel() is now GetItemLabelText()
249 . GetText() is not GetItemLabel()
250 . GetLabelFromText() is now GetLabelText()
251 . SetText() is now SetItemLabel()
252- wxBrush's, wxPen's SetStyle() and GetStyle() as well as the wxBrush/wxPen
253 ctor now take respectively a wxBrushStyle and a wxPenStyle value instead of a
254 plain "int style"; use the new wxBrush/wxPen style names (wxBRUSHSTYLE_XXX
255 and wxPENSTYLE_XXX) instead of the old deprecated wxXXX styles.
256- EVT_GRID_CELL_CHANGE was deprecated, use EVT_GRID_CELL_CHANGED instead if you
257 don't veto the event in its handler and EVT_GRID_CELL_CHANGING if you do.
258- EVT_CALENDAR_DAY event has been deprecated, use EVT_CALENDAR_SEL_CHANGED.
259- EVT_CALENDAR_MONTH and EVT_CALENDAR_YEAR events are deprecated,
260 use EVT_CALENDAR_PAGE_CHANGED which replaces both of them.
261- wxCalendarCtrl::EnableYearChange() and wxCAL_NO_YEAR_CHANGE are deprecated.
262 There is no replacement for this functionality, it is being dropped as it is
263 not available in native wxCalendarCtrl implementations.
264- wxDC::SetClippingRegion(const wxRegion&) overload is deprecated as it used
265 different convention from the other SetClippingRegion() overloads: wxRegion
266 passed to it was interpreted in physical, not logical, coordinates. Replace
267 it with SetDeviceClippingRegion() if this was the correct thing to do in your
268 code.
269- wxTE_AUTO_SCROLL style is deprecated as it's always on by default anyhow.
270- wxThreadHelper::Create() has been renamed to CreateThread which has a better
271 name for a mix-in class, and allows setting the thread type.
272- wxDos2UnixFilename, wxUnix2DosFilename, wxStripExtension, wxGetTempFileName,
273 wxExpandPath, wxContractPath, wxRealPath, wxCopyAbsolutePath, wxSplitPath
274 were deprecated in favour of wxFileName methods. See docs for more info.
275- wxEvtHandler::TryValidator/Parent() are deprecated, override the new and
276 documented TryBefore/After() methods if you used to override these ones.
277
278
279Major new features in this release
280----------------------------------
281
282- wxWidgets is now always built with Unicode support but provides the same
283 simple (i.e. "char *"-tolerant) API as was available in ANSI build in the
284 past.
285
286- wxWidgets may now use either wchar_t (UTF-16/32) or UTF-8 internally,
287 depending on what is optimal for the target platform.
288
289- New propgrid library containing wxPropertyGrid and related classes.
290
291- Many enhancements to wxDataViewCtrl.
292
293- Event loops, timers and sockets can now be used in wxBase, without GUI.
294
295- Events can now be connected to any functor, not necessarily a method of
296 wxEvtHandler-derived class. The compile-time safety was also improved.
297
298- Documentation for wxWidgets has been converted from LaTex to C++ headers
299 with Doxygen comments and significantly improved in the process (screenshots
300 of various controls were added, more identifiers are now linked to their
301 definition &c). Any reports about inaccuracies in the documentation are
302 welcome (and due to using the simple Doxygen syntax it is now easier than
303 ever to submit patches correcting them! :-)
304
305- Support for persistent objects automatically saving and restoring their state
306 was added.
307
308
3092.9.0
310-----
311
312All:
313
314- Added (experimental) IPv6 support to wxSocket (Arcen).
315- Cleaned up wxURI and made it Unicode-friendly.
316- Add support for wxExecute(wxEXEC_ASYNC) in wxBase (Lukasz Michalski)
317- Added wxXLocale class and xlocale-like functions using it.
318- Allow loading message catalogs from wxFileSystem (Axel Gembe)
319- Added wxMessageQueue class for inter-thread communications
320- Use UTF-8 for Unicode data in wxIPC classes (Anders Larsen)
321- Added support for user-defined types to wxConfig (Marcin Wojdyr).
322- Added numeric options support to wxCmdLineParser (crjjrc)
323- Added wxJoin() and wxSplit() functions (Francesco Montorsi).
324- Added wxDateTime::FormatISOCombined() and ParseISODate/Time/Combined()
325- Added wxMutex::LockTimeout() (Aleksandr Napylov).
326- Added wxMemoryInputStream(wxInputStream&) ctor (Stas Sergeev).
327- Implemented wxMemoryInputStream::CanRead().
328- Implemented wxMemoryFSHandler::FindFirst/Next().
329- Added wxEventLoop::DispatchTimeout().
330- Added wxEXEC_BLOCK flag (Hank Schultz).
331- Add support for wxStream-derived classes to wxRTTI (Stas Sergeev).
332- Added wxStreamBuffer::Truncate() (Stas Sergeev).
333- Allow using wxEventLoop in console applications (Lukasz Michalski).
334- Added functions for Base64 en/decoding (Charles Reimers).
335- Added support for binary data to wxConfig (Charles Reimers).
336- Added functions for atomically inc/decrementing integers (Armel Asselin).
337- wxLogInterposer has been added to replace wxLogPassThrough and new
338 wxLogInterposerTemp was added.
339- Added support for broadcasting to UDP sockets (Andrew Vincent).
340- Documentation now includes the wx library in which each class is defined.
341- wxrc --gettext now generates references to source .xrc files (Heikki
342 Linnakangas).
343- wxVariant::Unshare allows exclusive allocation of data that must be shared,
344 if the wxVariantData::Clone function is implemented.
345- Added wxWeakRef<T>, wxScopedPtr<T>, wxScopedArray<T>, wxSharedPtr<T> templates
346 and renamed old wx/ptr_{scpd,shrd}.h headers to wx/scoped{ptr,array}.h and
347 wx/sharedptr.h (but old headers are still provided for compatibility).
348- Added wxVector<T> class templates
349- Added wxON_BLOCK_EXIT_SET() and wxON_BLOCK_EXIT_NULL() to wx/scopeguard.h.
350- Added wxEvtHandler::QueueEvent() replacing AddPendingEvent() and
351 wxQueueEvent() replacing wxPostEvent().
352- wxString now uses std::[w]string internally by default, meaning that it is
353 now thread-safe if the standard library provided with your compiler is.
354- Added wxCmdLineParser::AddUsageText() (Marcin 'Malcom' Malich).
355- Fix reading/writing UTF-7-encoded text streams.
356- Corrected bug in wxTimeSpan::IsShorterThan() for equal time spans.
357- Use std::unordered_{map,set} for wxHashMap/Set if available (Jan van Dijk).
358- Added wxString::Capitalize() and MakeCapitalized().
359- Added wxArray::swap().
360- Added wxSHUTDOWN_LOGOFF and wxSHUTDOWN_FORCE wxShutdown() flags (troelsk).
361- Added wxSocket::ShutdownOutput().
362- Handle exceptions thrown from overridden wxView::OnCreate() gracefully.
363- Added wxPATH_RMDIR_FULL/RECURSIVE wxFileName::Rmdir() flags (Marcin Malich).
364- Added wxStandardPaths::GetAppDocumentsDir().
365- Added wx-prefixed versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros.
366- Added wxFileName::ReplaceEnvVariable and wxFileName::ReplaceHomeDir.
367- Added wxProtocol::SetDefaultTimeout(); the default timeout for both wxHTTP and wxFTP
368 protocols is 60 seconds.
369- Added wxStrnlen() for safe computation of string length.
370- Added wxImage::Clear() (troelsk).
371- Added wxLog::Log().
372- Added wxXmlResource::GetResourceNode().
373
374All (Unix):
375
376- Added wx-config --optional-libs command line option (John Labenski).
377- Noticeably (by a factor of ~150) improve wxIPC classes performance.
378- Configure options --with-opengl and --enable-mediactrl now default to "auto":
379 if OpenGL and GStreamer libraries are available the "gl" and "media" wx libraries
380 are automatically built.
381
382All (GUI):
383
384- Added wxDataViewCtrl class and helper classes.
385- Integrated wxPropertyGrid in wxWidgets itself (Jaakko Salli).
386- Provide native implementation of wxCalendarCtrl under wxMSW and wxGTK.
387- Added wxHeaderCtrl and allow using it in wxGrid.
388- Added wxRearrangeList, wxRearrangeCtrl and wxRearrangeDialog.
389- Added {wxTextCtrl,wxComboBox}::AutoComplete() and AutoCompleteFileNames().
390- Added wxH[V]ScrolledWindow (Brad Anderson, Bryan Petty).
391- Added wxNotificationMessage class for non-intrusive notifications.
392- Added wxWindow::Show/HideWithEffect().
393- Added wxWrapSizer (Arne Steinarson).
394- Added wxSpinCtrlDouble (John Labenski).
395- Support custom labels in wxMessageDialog (Gareth Simpson for wxMac version).
396- Added wxScrolledWindow::ShowScrollbars().
397- Also added wxCANCEL_DEFAULT to wxMessageDialog.
398- Allow copying text in the log dialogs.
399- Added multisample (anti-aliasing) support to wxGLCanvas (Olivier Playez).
400