lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] removing several WX !! markers


From: Vaclav Slavik
Subject: [lmi] removing several WX !! markers
Date: Tue, 31 Mar 2009 18:38:20 +0200

Hi,

the following wx headers problems are no longer present in wx 2.8:


=== modified file 'file_command_wx.cpp'
--- file_command_wx.cpp 2008-12-27 02:57:00 +0000
+++ file_command_wx.cpp 2009-03-31 15:27:57 +0000
@@ -34,9 +34,6 @@
 #include <boost/filesystem/path.hpp>
 #include <boost/scoped_ptr.hpp>
 
-// WX !! wx/mimetype.h should include wx/arrstr.h; until it does,
-// include the required header here explicitly:
-#include <wx/arrstr.h>
 #include <wx/mimetype.h>
 #include <wx/utils.h> // wxExecute()
 

=== modified file 'previewframe_ex.cpp'
--- previewframe_ex.cpp 2008-12-27 02:57:00 +0000
+++ previewframe_ex.cpp 2009-03-31 15:33:42 +0000
@@ -64,10 +64,6 @@
         }
 }
 
-PreviewFrameEx::~PreviewFrameEx()
-{
-}
-
 void PreviewFrameEx::Initialize()
 {
     wxPreviewFrame::Initialize();

=== modified file 'previewframe_ex.hpp'
--- previewframe_ex.hpp 2008-12-27 02:57:00 +0000
+++ previewframe_ex.hpp 2009-03-31 15:33:31 +0000
@@ -53,8 +53,6 @@
         ,long int            style  = wxDEFAULT_FRAME_STYLE | 
wxFULL_REPAINT_ON_RESIZE
         ,wxString     const& name   = "Loading print preview..."
         );
-    // WX !! Recommend marking the base class's dtor as virtual.
-    virtual ~PreviewFrameEx();
 
     // wxPreviewFrame overrides.
     virtual void Initialize();


Also, wxHtmlWindow was fixed to handle later call to
SetWindowStyle(wxHW_NO_SELECTION) correctly, so the following comment
can be removed too (I'd update the code, but I'm not sure what was your
intention -- call SetWindowStyle() immediately after constructing or
something else?):


=== modified file 'about_dialog.cpp'
--- about_dialog.cpp    2008-12-29 06:08:11 +0000
+++ about_dialog.cpp    2009-03-31 16:17:04 +0000
@@ -59,12 +59,6 @@
 
 int AboutDialog::ShowModal()
 {
-// WX !! Style wxHW_NO_SELECTION must be set at creation. Trying to
-// change it later, e.g.
-//    html_window->SetWindowStyle(html_window->GetWindowStyle() | 
wxHW_NO_SELECTION);
-//    html_window->SetExtraStyle (html_window->GetExtraStyle()  | 
wxHW_NO_SELECTION);
-// doesn't work. Is that reasonable?
-
     wxHtmlWindow* html_window = new wxHtmlWindow
         (this
         ,wxID_ANY


Finally, let me explain the reasons for this:


=== modified file 'view_ex.cpp'
--- view_ex.cpp 2008-12-27 02:57:00 +0000
+++ view_ex.cpp 2009-03-31 15:48:27 +0000
@@ -82,11 +82,6 @@
     return safely_dereference_as<wxFrame>(GetFrame());
 }
 
-// WX !! Elsewhere, the result of wxXmlResource::Get()->LoadX is
-// checked before doing anything with it. But here, LoadIcon returns a
-// reference, not a pointer. The library returns a default-constructed
-// wxIcon on load failure. This seems inconsistent with the way other
-// resources such as menubars and toolbars are treated.
 wxIcon ViewEx::IconFromXmlResource(char const* z) const
 {
     wxIcon icon = wxXmlResource::Get()->LoadIcon(z);


In wx API, window objects are represented as pointers. GDI objects
(brushes, pens, fonts, bitmaps, icons, ...) are reference-counted
objects that are returned as values, not pointers. wxXmlResource is
merely consistent with the rest of wx here: it returns pointers (and so
NULL on failure) for windows and invalid objects (here, wxNullIcon) for
GDI objects.

Regards,
Vaclav





reply via email to

[Prev in Thread] Current Thread [Next in Thread]