Restore wxPreviewFrame::Initialize(void) and add InitializeWithModality().
The changes of r67619 changed the signature of the virtual Initialize() method and in doing so broke the existing code overriding it. Avoid this problem by restoring the old method signature and adding a function with a different name providing the new functionality. Also notice in the documentation that there is no real need to override Initialize() in any case (but this doesn't change the fact that there is existing code that does do it). See #13108. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -398,9 +398,26 @@ public:
|
||||
const wxString& name = wxFrameNameStr);
|
||||
virtual ~wxPreviewFrame();
|
||||
|
||||
// Either Initialize() or InitializeWithModality() must be called before
|
||||
// showing the preview frame, the former being just a particular case of
|
||||
// the latter initializing the frame for being showing app-modally.
|
||||
|
||||
// Notice that we must keep Initialize() with its existing signature to
|
||||
// avoid breaking the old code that overrides it and we can't reuse the
|
||||
// same name for the other functions to avoid virtual function hiding
|
||||
// problem and the associated warnings given by some compilers (e.g. from
|
||||
// g++ with -Woverloaded-virtual).
|
||||
virtual void Initialize()
|
||||
{
|
||||
InitializeWithModality(wxPreviewFrame_AppModal);
|
||||
}
|
||||
|
||||
// Also note that this method is not virtual as it doesn't need to be
|
||||
// overridden: it's never called by wxWidgets (of course, the same is true
|
||||
// for Initialize() but, again, it must remain virtual for compatibility).
|
||||
void InitializeWithModality(wxPreviewFrameModalityKind kind);
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
virtual void Initialize(wxPreviewFrameModalityKind kind
|
||||
= wxPreviewFrame_AppModal);
|
||||
virtual void CreateCanvas();
|
||||
virtual void CreateControlBar();
|
||||
|
||||
|
Reference in New Issue
Block a user