1 \section{Changes since
2.4.x
}\label{changes
}
3 Listed here are the depreciated and incompatable changes made to wxWidgets.
5 For other changes (such as additional features, bug fixes, etc.) see the changes.txt file located in the docs directory of your wxWidgets directory.
7 \subsection{Incompatable changes since
2.4.x
}
9 \subsubsection{New window repainting behaviour
}
11 Windows are no longer fully repainted when resized, use new style wxFULL
\_REPAINT\_ON\_RESIZE to force this (wxNO
\_FULL\_REPAINT\_ON\_RESIZE still exists but doesn't do anything any more, this behaviour is default now).
13 \subsubsection{Window class member changes
}
15 wxWindow::m
\_font and m
\_backgroundColour/m
\_foregroundColour are no longer always set, use GetFont(), GetBack/ForegroundColour() to access them, and they will be dynamically determined if necessary.
17 \subsubsection{Sizers Internal Overhaul
}
19 The Sizers have had some fundamental internal changes in the
2.5.2 and
2.5.3 releases intended to make them do more of the "Right Thing" but also be as backwards compatible as possible. First a bit about how things used to work:
21 * The size that a window had when Add()ed to the sizer was assumed
22 to be its minimal size, and that size would always be used by
23 default when calculating layout size and positions, and the
24 sizer itself would keep track of that minimal size.
26 * If the window item was Add()ed with the wxADJUST
\_MINSIZE flag
27 then when layout was calculated the item's GetBestSize would be
28 used to reset the minimal size that the sizer used.
30 The main thrust of the new Sizer changes was to make behaviour like
31 wxADJUST
\_MINSIZE be the default, and also to push the tracking of
32 the minimal size to the window itself (since it knows its own needs)
33 instead of having the sizer take care of it. Consequently these
36 * The wxFIXED
\_MINSIZE flag was added to allow for the old
37 behaviour. When this flag is used the size a window has when
38 Add()ed to the sizer will be treated as its minimal size and it
39 will not be readjusted on each layout.
41 * The min size stored in wxWindow and settable with SetSizeHints or
42 SetMinSize will by default be used by the sizer (if it was set)
43 as the minimal size of the sizer item. If the minsize was not
44 set (or was only partially set) then the window's best size is
45 fetched and it is used instead of (or blended with) the minsize.
46 wxWindow:GetBestFittingSize was added to facilitate getting the
47 size to be used by the sizers.
49 * The best size of a window is cached so it doesn't need to
50 recalculated on every layout. wxWindow::InvalidateBestSize was
51 added and should be called (usually just internally in control
52 methods) whenever something is done that would make the best
55 * All wxControls were changed to set the minsize to what is passed
56 to the constructor or Create method, and also to set the real
57 size of the control to the blending of the minsize and bestsize.
58 wxWindow::SetBestFittingSize was added to help with this,
59 although most controls don't need to call it directly because it
60 is called indirectly via the SetInitialSize called in the base
63 At this time, the only situation known not to work the same as
64 before is the following:
66 win = new SomeWidget(parent);
67 win->SetSize(SomeNonDefaultSize);
70 In this case the old code would have used the new size as the
71 minimum, but now the sizer will use the default size as the minimum
72 rather than the size set later. It is an easy fix though, just move
73 the specification of the size to the constructor (assuming that
74 SomeWidget will set its minsize there like the rest of the controls
75 do) or call SetMinSize instead of SetSize.
77 In order to fit well with this new scheme of things, all wxControls
78 or custom controls should do the following things. (Depending on
79 how they are used you may also want to do the same thing for
80 non-control custom windows.)
82 * Either override or inherit a meaningful DoGetBestSize method
83 that calculates whatever size is "best" for the control. Once
84 that size is calculated then there should normally be a call to
85 CacheBestSize to save it for later use, unless for some reason
86 you want the best size to be recalculated on every layout.
88 * Any method that changes the attributes of the control such that
89 the best size will change should call InvalidateBestSize so it
90 will be recalculated the next time it is needed.
92 * The control's constructor and/or Create method should ensure
93 that the minsize is set to the size passed in, and that the
94 control is sized to a blending of the min size and best size.
95 This can be done by calling SetBestFittingSize.
97 \subsubsection{Massive wxURL Rewrite
}
99 wxURL has undergone some radical changes.
101 * Many accessors of wxURL - GetHostName, GetProtocolName, and GetPath,
102 have been replaced by its parent's (wxURI) counterparts - GetServer,
103 GetScheme, and GetPath, respectively.
105 * ConvertToValidURI has been replaced by wxURI. Do not use
106 ConvertToValidURI for future applications.
108 * ConvertFromURI has been replaced by wxURI::Unescape.
110 \subsubsection{Less drastic incompatable changes since
2.4.x
}
112 - no initialization/cleanup can be done in wxApp/~wxApp because they are
113 now called much earlier/later than before; please move any exiting code
114 from there to wxApp::OnInit()/OnExit()
116 - also, OnExit() is not called if OnInit() fails
118 - finally the program exit code is OnRun() return value, not OnExit() one
120 - wxTheApp can't be assigned to any longer, use wxApp::SetInstance() instead
122 - wxFileType::GetIcon() returns wxIconLocation, not wxIcon
124 - wxColourDatabase is not a wxList any more, use AddColour to add new colours
126 - wxWindow::Clear() is now called ClearBackground()
128 - pointer returned by wxFont::GetNativeFontInfo() must not be deleted now
130 - wxMouseEvent::Moving() doesn't return true if mouse is being dragged any more
132 - (most) controls now inherit parents colours by default, override
133 ShouldInheritColours() to return false if you don't want this to happen
135 - wxApp::SendIdleEvent() now takes
2 arguments
137 - wxTabView::GetLayers() changed return type from wxList& to wxTabLayerList&
138 (when WXWIN
\_COMPATIBILITY\_2\_4 ==
0)
140 - wxID
\_SEPARATOR (id used for the menu separators) value changed from -
1 to -
2
142 - wxGetNumberFromUser() is now in separate wx/numdlg.h, not wx/textdlg.h
144 - wxChoice and wxCombobox now handle their size in the same way as in all the
145 other ports under MSW, new code is actually correct but different from weird
146 stuff they were doing before so the behaviour of your programs might change
148 - wxTaskBarIcon objects must now be destroyed before the application can exit.
149 Previously, the application terminated if there were no top level windows;
150 now it terminates if there are no top level windows or taskbar icons left.
152 - wxZlibInputStream is not by default compatible with the output of the
153 2.4.x version of wxZlibOutputStream. However, there is a compatibility mode,
154 switched on by passing wxZLIB
\_24COMPATIBLE to the constructor.
156 - when WXWIN
\_COMPATIBILITY\_2\_4 ==
0 wxHashTable uses a new implementation
157 not using wxList keyed interface (the same used when wxUSE
\_STL ==
1),
158 the only incompatibility being that Next() returns a wxHashTable::Node*
159 instead of a wxNode*.
161 - non-const wxDC methods GetBackground(), GetBrush(), GetFont() and GetPen()
162 as well as wxWindow methods GetFont() and GetCursor() don't exist any more,
163 please fix your code -- it never worked correctly anyhow if you modified the
164 objects returned by these methods so you should simply switch to using const
167 - wxWindow::GetFont() now returns wxFont object instead of reference
169 - EVT
\_XXX macros are now type-safe; code that uses wrong type for event
170 handler's argument will no longer compile.
172 - Identical functionality of wxFileDialog::ParseWildcard,
173 wxGenericDirCtrl::ParseFilter, Motif and MSW parsing native dialogs
174 is now accessible in ::wxParseCommonDialogsFilter
176 - wxNotebookSizer and wxBookCtrlSizer are now deprecated -- they are no longer
177 needed, you can treat wxNotebook as any other control and put it directly
178 into the sizer that was wxNotebookSizer's parent sizer in old code.
180 - wxFile methods now return either wxFileOffset or wxFileSize
\_t which may be a
181 64 bit integer type, even on
32 bit platforms, instead of off
\_t and so the
182 return value of wxFile::Length(), for example, shouldn't be assigned to off
\_t
183 variable any more (the compiler might warn you about this)
185 - wxListItem::m
\_data is now of type wxUIntPtr, not long, for compatibility
188 - wxSizer::Add/Insert returns pointer to wxSizerItem just added so conditions
189 writeen with if(Add(..)==true) will not work. Use if(Add(..)) instead.
191 \subsection{Depreciated changes since
2.4.x
}
193 - wxURL::GetInputStream() and similar functionality has been depreciated in
194 favor of other ways of connecting, such as though sockets or wxFileSystem.
196 - wxDocManager::GetNoHistoryFiles() renamed to GetHistoryFilesCount()
198 - wxSizer::Remove(wxWindow *), use Detach() instead
[it is more clear
]
200 - wxSizer::Set/GetOption(): use Set/GetProportion() instead
202 - wxKeyEvent::KeyCode(): use GetKeyCode instead
204 - wxList::Number, First, Last, Nth: use GetCount, GetFirst/Last, Item instead
206 - wxNode::Next, Previous, Data: use GetNext, GetPrevious, GetData instead
208 - wxListBase::operator wxList&(): use typesafe lists instead
210 - wxTheFontMapper: use wxFontMapper::Get() instead
212 - wxStringHashTable: use wxHashMap instead
214 - wxHashTableLong: use wxHashMap instead
216 - wxArrayString::GetStringArray: use wxCArrayString or alternative wxWidgets
217 methods taking wxArrayString
219 - wxArrayString::Remove(index, count): use RemoveAt instead
221 - wxTreeItemId conversion to long is deprecated and shouldn't be used
223 - wxTreeCtrl::GetFirst/NextChild()
2nd argument now has type wxTreeItemIdValue
224 and not long, please change declarations of "cookie"s in your code
225 accordingly -- otherwise your code won't work on
64 bit platforms
227 -
[MSW only
] wxWindow::GetUseCtl3D(), GetTransparentBackground() and
228 SetTransparent() as well as wxNO
\_3D and wxUSER
\_COLOURS styles
230 - wxList keyed interface: use wxHashMap instead
232 - wxColourDatabase::FindColour(): use Find() instead (NB: different ret type)
234 - wxHashTable::Next: use wxHashTable::Node* or
235 wxHashTable::compatibility
\_iterator to store the return
238 - wxWave class; use wxSound instead
240 - The wxHIDE
\_READONLY flag for wxFileDialog was not implemented
241 and has now been removed
243 - wxTaskBarIcon::OnXXX() virtual methods: use events instead
245 - obsolete and not used wxUSE
\_GENERIC\_DIALOGS\_IN\_MSW has been removed
247 - wxDbTable::wxDbTable with wxChar* deprecated, same with wxString& instead