]>
Commit | Line | Data |
---|---|---|
70cf18ef VZ |
1 | ------------------------------------------------------------------------------- |
2 | wxWidgets Change Log | |
3 | ------------------------------------------------------------------------------- | |
d643b80e | 4 | |
5ec9d741 | 5 | INCOMPATIBLE 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 |
14 | Unicode-related changes |
15 | ----------------------- | |
16 | ||
17 | The biggest changes in wxWidgets 3.0 are the changes due to the merge of the | |
18 | old ANSI and Unicode build modes in a single build. See the Unicode overview | |
19 | in the manual for more details but here are the most important incompatible | |
20 | changes: | |
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 | ||
b7aadf25 VZ |
36 | - Functions returning "const wxChar *" were changed as well. Mostly they now |
37 | return wxString which is then transparently convertible to either "const char | |
38 | *" or "const wchar_t *" but in some cases, notably wxDateTime::ParseXXX(), | |
39 | the returned string could be NULL and so a separate helper class is used. If | |
40 | you obtain compilation errors because of this, you can always correct them by | |
41 | explicitly assigning the function return value to a variable of wanted type. | |
c398434d VZ |
42 | A slightly more intrusive but better solution is to use ParseXXX() version |
43 | with wxString::const_iterator output parameter which simply returns bool to | |
44 | indicate the parsing success. | |
0d5ab92f VZ |
45 | |
46 | - Some structure fields which used to be of type "const wxChar *" (such as | |
47 | wxCmdLineEntryDesc::shortName, longName and description fields) are now of | |
48 | type "const char *", you need to remove wxT() or _T() around the values used | |
49 | to initialize them (which should normally always be ASCII). | |
e6d4038a | 50 | |
50c549b9 VZ |
51 | - wxIPC classes didn't work correctly in Unicode build before, this was fixed |
52 | but at a price of breaking backwards compatibility: many methods which used | |
53 | to work with "wxChar *" before use "void *" now (some int parameters were | |
54 | also changed to size_t). While wxIPC_TEXT can still be used to transfer 7 | |
55 | bit text, the new wxIPC_UTF8TEXT format is used for transferring wxStrings. | |
f01a77c7 VZ |
56 | Also notice that connection classes should change the parameter types of |
57 | their overridden OnExecute() or override a more convenient OnExec() instead. | |
e6d4038a VZ |
58 | |
59 | ||
6f67af05 FM |
60 | wxODBC and contrib libraries removal |
61 | ------------------------------------ | |
1e6b2edf VZ |
62 | |
63 | wxODBC library was unmaintained since several years and we couldn't continue | |
64 | supporting it any longer so it was removed. Please use any of the other open | |
65 | source ODBC libraries in the future projects. | |
66 | ||
6f67af05 FM |
67 | Also the "applet", "deprecated", "fl", "mmedia" and "plot" contrib libraries |
68 | were removed as they were unmaintained and broken since several years. | |
69 | The "gizmos", "ogl", "net" and "foldbar" contribs have been moved to | |
70 | wxCode (see http://wxcode.sourceforge.net/complist.php); they are now | |
71 | open for futher development by volunteers. | |
72 | ||
73 | The "stc" and "svg" contribs instead have been moved respectively into a new | |
74 | "official" library stc and in the core lib. | |
75 | ||
1e6b2edf | 76 | |
b1f3b29c VZ |
77 | Changes in behaviour not resulting in compilation errors, please read this! |
78 | --------------------------------------------------------------------------- | |
79 | ||
466e87bd VZ |
80 | - Default location of wxFileConfig files has changed under Windows, you will |
81 | need to update your code if you access these files directly. | |
82 | ||
47a8a4d5 VZ |
83 | - wxWindow::IsEnabled() now returns false if a window parent (and not |
84 | necessarily the window itself) is disabled, new function IsThisEnabled() | |
85 | with the same behaviour as old IsEnabled() was added. | |
86 | ||
5644933f VZ |
87 | - Generating wxNavigationKeyEvent events doesn't work any more under wxGTK (and |
88 | other platforms in the future), use wxWindow::Navigate() or NavigateIn() | |
89 | instead. | |
90 | ||
89064717 VZ |
91 | - Sizers distribute only the extra space between the stretchable items |
92 | according to their proportions and not all available space. We believe the | |
93 | new behaviour corresponds better to user expectations but if you did rely | |
94 | on the old behaviour you will have to update your code to set the minimal | |
95 | sizes of the sizer items to be in the same proportion as the items | |
96 | proportions to return to the old behaviour. | |
97 | ||
17808a75 | 98 | - wxWindow::Freeze/Thaw() are not virtual any more, if you overrode them in |
47d9ca16 | 99 | your code you need to override DoFreeze/DoThaw() instead now. |
17808a75 | 100 | |
628e155d VZ |
101 | - wxCalendarCtrl has native implementation in wxGTK, but it has less features |
102 | than the generic one. The native implementation is used by default, but you | |
103 | can still use wxGenericCalendarCtrl instead of wxCalendarCtrl in your code if | |
104 | you need the extra features. | |
105 | ||
9c8116f8 VZ |
106 | - wxDocument::FileHistoryLoad() and wxFileHistory::Load() now take const |
107 | reference to wxConfigBase argument and not just a reference, please update | |
108 | your code if you overrode these functions and change the functions in the | |
109 | derived classes to use const reference as well. | |
110 | ||
a6eac99d VZ |
111 | - Under MSW wxExecute() arguments are now always properly quoted, as under |
112 | Unix, and so shouldn't contain quotes unless they are part of the argument. | |
17808a75 | 113 | |
c6e4d276 VZ |
114 | - wxDocument::OnNewDocument() doesn't call OnCloseDocument() any more. |
115 | ||
1d7b600d VZ |
116 | - If you use wxScrolledWindow::SetTargetWindow() you must implement its |
117 | GetSizeAvailableForScrollTarget() method, please see its documentation for | |
118 | more details. | |
119 | ||
0e1e143d FM |
120 | - Processing of pending events now requires a running event loop. |
121 | Thus initialization code (e.g. showing a dialog) previously done in wxApp::OnRun() | |
122 | or equivalent function should now be done into wxApp::OnEventLoopEnter(). | |
123 | See wxApp::OnEventLoopEnter() and wxApp::OnEventLoopExit() docs for more info. | |
124 | ||
f2a18fbe VZ |
125 | - wxLoadFileSelector() now allows the user to select existing files only. |
126 | ||
9c61c5b0 VZ |
127 | - Erase background events are now not generated at all when background style is |
128 | changed. See the updated wxWindow::SetBackgroundStyle() description in the | |
129 | manual for more details. | |
130 | ||
febebac1 | 131 | - wxTreeCtrl::GetSelection now asserts if the tree has the wxTR_MULTIPLE style. |
bc73d5ae | 132 | Instead use GetSelections() for multiple items; or if you want only the |
febebac1 VZ |
133 | single item last touched, the new wxTreeCtrl::GetFocusedItem. |
134 | ||
bc73d5ae VZ |
135 | - Custom log targets should be updated to override wxLog::DoLogRecord() method |
136 | instead of DoLog() or DoLogString() and must be updated if they call the base | |
137 | class versions of these functions as this won't work any more; please see the | |
138 | documentation of wxLog for more information. | |
139 | ||
7e6edd27 VZ |
140 | - Confusing wxGridSizer(int cols, int vgap = 0, int hgap = 0) ctor which was |
141 | easy to mistake for wxGridSizer(int rows, int cols) overload was removed, you | |
142 | will need to specify both vertical and horizontal gap if you want to use this | |
143 | overload or specify both rows and columns and the gap otherwise. Use of the | |
144 | new constructors taking wxSize for the gap argument is preferred. | |
145 | ||
1d7b600d | 146 | |
b1f3b29c VZ |
147 | Changes in behaviour which may result in compilation errors |
148 | ----------------------------------------------------------- | |
149 | ||
c1dc9f83 VZ |
150 | - WXWIN_COMPATIBILITY_2_4 doesn't exist any more, please update your code if |
151 | you still relied on features deprecated since version 2.4 | |
152 | ||
ddc0ac4a VZ |
153 | - wxDC classes hierarchy has changed, if you derived any classes from wxDC you |
154 | need to review them as wxDC doesn't have any virtual methods any longer and | |
155 | uses delegation instead of inheritance to present different behaviours. | |
156 | ||
8cc208e3 | 157 | - wxWindow::ProcessEvent() (and other wxEvtHandler methods inherited by wxWindow) |
bca627de FM |
158 | has been made protected to prevent wrongly using it instead of correct |
159 | GetEventHandler()->ProcessEvent(). | |
160 | New ProcessWindowEvent() was added for convenience. | |
3b7fa206 | 161 | |
c9f78968 VS |
162 | - Return type of wxString::operator[] and wxString::iterator::operator* is no |
163 | longer wxChar (i.e. char or wchar_t), but wxUniChar. This is not a problem | |
164 | in vast majority of cases because of conversion operators, but it can break | |
165 | code that depends on the result being wxChar. | |
166 | ||
ef0f1387 VS |
167 | - The value returned by wxString::c_str() cannot be casted to non-const char* |
168 | or wchar_t* anymore. The solution is to use newly added wxString methods | |
169 | char_str() (which returns a buffer convertible to char*) or wchar_str() | |
170 | (which returns a buffer convertible to wchar_t*). These methods are | |
171 | available in wxWidgets 2.8 series beginning with 2.8.4 as well. | |
172 | ||
c9f78968 VS |
173 | - The value returned by wxString::operator[] or wxString::iterator cannot be |
174 | used in switch statements anymore, because it's a class instance. Code like | |
175 | this won't compile: | |
176 | switch (str[i]) { ... } | |
177 | and has to be replaced with this: | |
178 | switch (str[i].GetValue()) { ... } | |
179 | ||
73ba5ab9 VZ |
180 | - Return type of wxString::c_str() is now a helper wxCStrData struct and not |
181 | const wxChar*. wxCStrData is implicitly convertible to both "const char *" | |
182 | and "const wchar_t *", so this only presents a problem if the compiler cannot | |
183 | apply the conversion. This can happen in 2 cases: | |
a6eac99d | 184 | |
73ba5ab9 VZ |
185 | + There is an ambiguity because the function being called is overloaded to |
186 | take both "const char *" and "const wchar_t *" as the compiler can't choose | |
187 | between them. In this case you may use s.wx_str() to call the function | |
188 | matching the current build (Unicode or not) or s.mb_str() or s.wc_str() to | |
189 | explicitly select narrow or wide version of it. | |
190 | ||
191 | Notice that such functions are normally not very common but unfortunately | |
192 | Microsoft decided to extend their STL with standard-incompatible overloads | |
193 | of some functions accepting "const wchar_t *" so you may need to replace | |
194 | some occurrences of c_str() with wx_str() when using MSVC 8 or later. | |
195 | ||
196 | + Some compilers, notably Borland C++ and DigitalMars, don't correctly | |
197 | convert operator?: operands to the same type and fail with compilation | |
198 | error instead. This can be worked around by explicitly casting to const | |
199 | wxChar*: wxLogError(_("error: %s"), !err.empty() ? (const wxChar*)err.c_str() : "") | |
c9f78968 | 200 | |
52de37c7 | 201 | - wxCtime() and wxAsctime() return char*; this is incompatible with Unicode |
5bce3e6f | 202 | build in wxWidgets 2.8 that returned wchar_t*. |
52de37c7 | 203 | |
c9f78968 VS |
204 | - DigitalMars compiler has a bug that prevents it from using |
205 | wxUniChar::operator bool in conditions and it erroneously reports type | |
206 | conversion ambiguity in expressions such as this: | |
207 | for ( wxString::const_iterator p = s.begin(); *p; ++p ) | |
208 | This can be worked around by explicitly casting to bool: | |
209 | for ( wxString::const_iterator p = s.begin(); (bool)*p; ++p ) | |
210 | ||
d03dab2a | 211 | - Virtual wxHtmlParser::AddText() takes wxString, not wxChar*, argument now. |
5bce3e6f | 212 | |
73ba5ab9 | 213 | - Functions that took wxChar* arguments that could by NULL in wxWidgets 2.8 |
d38f70b2 | 214 | are deprecated and passing NULL to them won't compile anymore, wxEmptyString |
ab29bb87 | 215 | must be used instead. |
d38f70b2 | 216 | |
de34bb08 VZ |
217 | - wxTmemxxx() functions take either wxChar* or char*, not void*: use memxxx() |
218 | with void pointers. | |
219 | ||
d03dab2a VS |
220 | - Removed insecure wxGets() and wxTmpnam() functions. |
221 | ||
6a4cbac1 VS |
222 | - Removed global GetLine() function from wx/protocol/protocol.h, use |
223 | wxProtocol::ReadLine() instead. | |
17808a75 | 224 | |
c8058a09 JS |
225 | - wxVariant no longer derives from wxObject. wxVariantData also no longer |
226 | derives from wxObject; instead of using wxDynamicCast with wxVariantData you | |
227 | can use the macro wxDynamicCastVariantData with the same arguments. | |
6a4cbac1 | 228 | |
1a8a13ee | 229 | - wxWindow::Next/PrevControlId() don't exist any more as they couldn't be |
08f1c27c | 230 | implemented correctly any longer because automatically generated ids are not |
1a8a13ee | 231 | necessarily allocated consecutively now. Use GetChildren() to find the |
08f1c27c VZ |
232 | next/previous control sibling instead. |
233 | ||
500b128d VZ |
234 | - Calling wxConfig::Write() with an enum value will fail to compile because |
235 | wxConfig now tries to convert all unknown types to wxString automatically. | |
236 | The simplest solution is to cast the enum value to int. | |
d03dab2a | 237 | |
e98e625c VZ |
238 | - Several wxImage methods which previously had "long bitmaptype" parameters |
239 | have been changed to accept "wxBitmapType bitmaptype", please use enum | |
240 | wxBitmapType in your code. | |
241 | ||
763163a8 VZ |
242 | - wxGridCellEditor::EndEdit() signature has changed and it was split in two |
243 | functions, one still called EndEdit() and ApplyEdit(). See the documentation | |
244 | of the new functions for more details about how grid editors should be | |
245 | written now. | |
246 | ||
247 | - wxEVT_GRID_CELL_CHANGE event renamed to wxEVT_GRID_CELL_CHANGED and shouldn't | |
248 | be vetoed any more, use the new wxEVT_GRID_CELL_CHANGING event to do it. | |
249 | ||
6e2f3084 | 250 | - wxListCtrlCompare function used with wxListCtrl::SortItems() must now declare |
b18e2046 | 251 | its third parameter as wxIntPtr and not long (this allows passing pointers |
6e2f3084 VZ |
252 | to it under 64 bit platforms too). |
253 | ||
8cc208e3 VZ |
254 | - Global wxPendingEvents and wxPendingEventsLocker objects were removed. |
255 | You may use wxEventLoopBase::SuspendProcessingOfPendingEvents instead of | |
256 | locking wxPendingEventsLocker now. | |
257 | ||
2352862a VZ |
258 | - wxBitmapButton::GetBitmapXXX() overloads returning non-const wxBitmap |
259 | references have been removed, modifying the returned bitmaps never worked and | |
260 | now results in compile-time error. | |
261 | ||
34a083c9 VZ |
262 | - wxLogXXX() are now macros, not functions. Because of this calling them with |
263 | an explicit scope resolution operator ("::wxLogError()") doesn't work any | |
264 | longer, just remove it. Also notice that using them inside an "if" statement | |
265 | without enclosing parentheses results in warnings from g++ with -Wparentheses, | |
266 | add parentheses around the if statement body to work around it. | |
267 | ||
763163a8 | 268 | |
5ec9d741 VZ |
269 | Deprecated methods and their replacements |
270 | ----------------------------------------- | |
271 | ||
13dd765c | 272 | - wxCreateGreyedImage() deprecated, use wxImage::ConvertToGreyscale() instead. |
7890307b VS |
273 | - wxString::GetWriteBuf() and UngetWriteBuf() deprecated, using wxStringBuffer |
274 | or wxStringBufferLength instead. | |
d0bc78e2 VZ |
275 | - wxDIRCTRL_SHOW_FILTERS style is deprecated, filters are alwsys shown if |
276 | specified so this style should simply be removed | |
724b119a VZ |
277 | - wxDocManager::MakeDefaultName() replaced by MakeNewDocumentName() and |
278 | wxDocument::GetPrintableName() with GetUserReadableName() which are simpler | |
279 | to use | |
288b6107 VS |
280 | - wxXmlProperty class was renamed to wxXmlAttribute in order to use standard |
281 | terminology. Corresponding wxXmlNode methods were renamed to use | |
282 | "Attribute" instead of "Property" or "Prop" in their names. | |
022a8a5a VZ |
283 | - wxConnection::OnExecute() is not formally deprecated yet but new code should |
284 | use simpler OnExec() version which is called with wxString argument | |
8cc208e3 VZ |
285 | - Various wxMenuItem methods were deprecated in favour of more consisently |
286 | named new versions: | |
287 | . GetLabel() is now GetItemLabelText() | |
288 | . GetText() is not GetItemLabel() | |
289 | . GetLabelFromText() is now GetLabelText() | |
290 | . SetText() is now SetItemLabel() | |
291 | - wxBrush's, wxPen's SetStyle() and GetStyle() as well as the wxBrush/wxPen | |
292 | ctor now take respectively a wxBrushStyle and a wxPenStyle value instead of a | |
293 | plain "int style"; use the new wxBrush/wxPen style names (wxBRUSHSTYLE_XXX | |
294 | and wxPENSTYLE_XXX) instead of the old deprecated wxXXX styles. | |
e557577d VZ |
295 | - EVT_GRID_CELL_CHANGE was deprecated, use EVT_GRID_CELL_CHANGED instead if you |
296 | don't veto the event in its handler and EVT_GRID_CELL_CHANGING if you do. | |
628e155d VZ |
297 | - EVT_CALENDAR_DAY event has been deprecated, use EVT_CALENDAR_SEL_CHANGED. |
298 | - EVT_CALENDAR_MONTH and EVT_CALENDAR_YEAR events are deprecated, | |
299 | use EVT_CALENDAR_PAGE_CHANGED which replaces both of them. | |
300 | - wxCalendarCtrl::EnableYearChange() and wxCAL_NO_YEAR_CHANGE are deprecated. | |
fdaad94e VZ |
301 | There is no replacement for this functionality, it is being dropped as it is |
302 | not available in native wxCalendarCtrl implementations. | |
303 | - wxDC::SetClippingRegion(const wxRegion&) overload is deprecated as it used | |
304 | different convention from the other SetClippingRegion() overloads: wxRegion | |
305 | passed to it was interpreted in physical, not logical, coordinates. Replace | |
306 | it with SetDeviceClippingRegion() if this was the correct thing to do in your | |
307 | code. | |
053ac76f | 308 | - wxTE_AUTO_SCROLL style is deprecated as it's always on by default anyhow. |
8cc208e3 VZ |
309 | - wxThreadHelper::Create() has been renamed to CreateThread which has a better |
310 | name for a mix-in class, and allows setting the thread type. | |
bca627de FM |
311 | - wxDos2UnixFilename, wxUnix2DosFilename, wxStripExtension, wxGetTempFileName, |
312 | wxExpandPath, wxContractPath, wxRealPath, wxCopyAbsolutePath, wxSplitPath | |
313 | were deprecated in favour of wxFileName methods. See docs for more info. | |
8cc208e3 VZ |
314 | - wxEvtHandler::TryValidator/Parent() are deprecated, override the new and |
315 | documented TryBefore/After() methods if you used to override these ones. | |
e5cfb314 VZ |
316 | - wxGetMultipleChoices() is deprecated, use wxGetSelectedChoices() which has |
317 | the same signature but returns -1 and not 0 if the dialog was cancelled. | |
39cdc95f FM |
318 | - building the windows which are placed inside wxStaticBoxes as siblings of the |
319 | wxStaticBox is still allowed but it's deprecated as it gives some problems | |
320 | on some ports (e.g. wxGTK). | |
321 | You should now create windows placed inside a wxStaticBox as children of | |
322 | the static box itself. | |
c1ea6afb VZ |
323 | - wxMouseState::{Left,Middle,Right}Down() were renamed to XXXIsDown() for |
324 | consistency with wxMouseEvent and the old names were deprecated. | |
325 | ||
41ae85f8 | 326 | |
5ec9d741 VZ |
327 | Major new features in this release |
328 | ---------------------------------- | |
329 | ||
9135f74e VZ |
330 | - wxWidgets is now always built with Unicode support but provides the same |
331 | simple (i.e. "char *"-tolerant) API as was available in ANSI build in the | |
332 | past. | |
333 | ||
334 | - wxWidgets may now use either wchar_t (UTF-16/32) or UTF-8 internally, | |
335 | depending on what is optimal for the target platform. | |
336 | ||
058f225a VZ |
337 | - New propgrid library containing wxPropertyGrid and related classes. |
338 | ||
339 | - Many enhancements to wxDataViewCtrl. | |
1c4293cb | 340 | |
89ff7d64 VZ |
341 | - Event loops, timers and sockets can now be used in wxBase, without GUI. |
342 | ||
3c778901 VZ |
343 | - Events can now be connected to any functor, not necessarily a method of |
344 | wxEvtHandler-derived class. The compile-time safety was also improved. | |
345 | ||
89ff7d64 VZ |
346 | - Documentation for wxWidgets has been converted from LaTex to C++ headers |
347 | with Doxygen comments and significantly improved in the process (screenshots | |
348 | of various controls were added, more identifiers are now linked to their | |
349 | definition &c). Any reports about inaccuracies in the documentation are | |
350 | welcome (and due to using the simple Doxygen syntax it is now easier than | |
351 | ever to submit patches correcting them! :-) | |
6f8dd114 | 352 | |
0fa541e8 VZ |
353 | - Support for persistent objects automatically saving and restoring their state |
354 | was added. | |
355 | ||
12dc0a01 | 356 | |
ae901b23 VZ |
357 | 2.9.1: |
358 | ------ | |
359 | ||
3aaaf1aa VZ |
360 | All: |
361 | ||
72a7c559 | 362 | - Added wxStd{Input,Output}Stream classes (Jonathan Liu). |
1c7a6772 | 363 | - Include port number in host header in wxHTTP (Marcin 'Malcom' Malich). |
f1a73c6a | 364 | - Added wxTempFile::Flush(). |
4e00b908 | 365 | - Added support for wxLongLong and wxULongLong in wxVariant. |
dbe0872f | 366 | - Added wxVector::swap(). |
acad886c VZ |
367 | - Many wxLog improvements: |
368 | * wxLogXXX() functions are now thread-safe. | |
369 | * Log levels can now be set independently for different log components. | |
370 | * wxLog::DoLogRecord() has access to the location of the log message | |
371 | (file, line and function name) and id of the thread which generated it. | |
372 | * SetThreadActiveTarget() allows to set up thread-specific log targets. | |
1c7a6772 VZ |
373 | |
374 | All (GUI): | |
375 | ||
e5d05b90 | 376 | - Added support for showing bitmaps in wxButton. |
6528a7f1 | 377 | - wxWindow::SetAutoLayout() now works for all windows, not just panels. |
ef18e792 | 378 | Content-type: text/html ]>