]> git.saurik.com Git - wxWidgets.git/commitdiff
renamed wxMotif::wxTLW::DoCreate() to XmDoCreateTLW() to avoid conflicts with
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Sep 2005 14:36:02 +0000 (14:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Sep 2005 14:36:02 +0000 (14:36 +0000)
DoCreate()s in derived classes and removed DoDestroy() entirely because there
was really no advantage in having it (it can't be called fom base class dtor)

also made XmDoCreateTLW() pure virtual which required changing
IMPLEMENT_DYNAMIC_CLASS into IMPLEMENT_ABSTRACT_CLASS for wxTopLevelWindow in
common code but this made sense anyhow because wxTLW should be an ABC anyhow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/motif/dialog.h
include/wx/motif/frame.h
include/wx/motif/toplevel.h
src/common/toplvcmn.cpp
src/motif/dialog.cpp
src/motif/frame.cpp
src/motif/toplevel.cpp

index 861062d819f4494c72db578bc3afc60be96c779b..65ebffbaba036f42cda5e8b5a216618cf9b02216 100644 (file)
@@ -79,13 +79,14 @@ public:
     void OnCloseWindow(wxCloseEvent& event);
 
 private:
-    virtual bool DoCreate( wxWindow* parent, wxWindowID id,
-                           const wxString& title,
-                           const wxPoint& pos,
-                           const wxSize& size,
-                           long style,
-                           const wxString& name );
-    virtual void DoDestroy();
+    virtual bool XmDoCreateTLW(wxWindow* parent,
+                               wxWindowID id,
+                               const wxString& title,
+                               const wxPoint& pos,
+                               const wxSize& size,
+                               long style,
+                               const wxString& name);
+
 
     //// Motif-specific
     bool          m_modalShowing;
index ed717d2a690ae70c4d9926add56247998f7f0982..9aa254904e80a281c74447b3963ddd2a34311cb8 100644 (file)
@@ -117,13 +117,14 @@ private:
     virtual void DoSetClientSize(int width, int height);
 
 private:
-    virtual bool DoCreate( wxWindow* parent, wxWindowID id,
-                           const wxString& title,
-                           const wxPoint& pos,
-                           const wxSize& size,
-                           long style,
-                           const wxString& name );
-    virtual void DoDestroy();
+    virtual bool XmDoCreateTLW(wxWindow* parent,
+                               wxWindowID id,
+                               const wxString& title,
+                               const wxPoint& pos,
+                               const wxSize& size,
+                               long style,
+                               const wxString& name);
+
 
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxFrame)
index eaca8020f64fe29660c80ad5664dc5e46fe4496c..061d263dc46d848664d806a987b6f6a755793265 100644 (file)
@@ -70,19 +70,17 @@ protected:
     void PreDestroy();
 
     virtual void DoGetPosition(int* x, int* y) const;
+
 private:
-    // both these functions should be pure virtual
-    virtual bool DoCreate( wxWindow* parent, wxWindowID id,
-                           const wxString& title,
-                           const wxPoint& pos,
-                           const wxSize& size,
-                           long style,
-                           const wxString& name )
-    {
-        return false;
-    }
+    // really create the Motif widget for TLW
+    virtual bool XmDoCreateTLW(wxWindow* parent,
+                               wxWindowID id,
+                               const wxString& title,
+                               const wxPoint& pos,
+                               const wxSize& size,
+                               long style,
+                               const wxString& name) = 0;
 
-    virtual void DoDestroy() { }
 
     wxString m_title;
 };
index 0146f40ab4553fe2d3f93eb6b4cff17f4bda493d..5ce909c799f86cc21ea2978d8d8f6709d5b4bd75 100644 (file)
@@ -46,7 +46,7 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow)
+IMPLEMENT_ABSTRACT_CLASS(wxTopLevelWindow, wxWindow)
 
 // ----------------------------------------------------------------------------
 // construction/destruction
index 84ca36e6db39082941c35c982da5a26393918e9b..a7e4fc8aa6515e64290801464923d89522958bc3 100644 (file)
@@ -151,12 +151,13 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
     return true;
 }
 
-bool wxDialog::DoCreate( wxWindow* parent, wxWindowID id,
-                         const wxString& title,
-                         const wxPoint& pos,
-                         const wxSize& size,
-                         long style,
-                         const wxString& name )
+bool wxDialog::XmDoCreateTLW(wxWindow* parent,
+                             wxWindowID id,
+                             const wxString& title,
+                             const wxPoint& pos,
+                             const wxSize& size,
+                             long style,
+                             const wxString& name)
 {
     Widget parentWidget = (Widget) 0;
     if( parent )
@@ -233,12 +234,8 @@ wxDialog::~wxDialog()
     }
 
     PreDestroy();
-    DoDestroy();
-}
 
-void wxDialog::DoDestroy()
-{
-    if( m_mainWidget )
+    if ( m_mainWidget )
     {
         wxDeleteWindowFromTable( (Widget)m_mainWidget );
         XtDestroyWidget( (Widget)m_mainWidget );
index bf63528fbac234443623ec6a821bfa550eb2cd4b..f17078a2d5fc621d591af250c60d2c37dd882de5 100644 (file)
@@ -196,12 +196,13 @@ bool wxFrame::Create(wxWindow *parent,
     return true;
 }
 
-bool wxFrame::DoCreate( wxWindow* parent, wxWindowID id,
-                        const wxString& title,
-                        const wxPoint& pos,
-                        const wxSize& size,
-                        long style,
-                        const wxString& name )
+bool wxFrame::XmDoCreateTLW(wxWindow* parent,
+                            wxWindowID id,
+                            const wxString& title,
+                            const wxPoint& pos,
+                            const wxSize& size,
+                            long style,
+                            const wxString& name)
 {
     Widget frameShell;
 
@@ -292,11 +293,7 @@ wxFrame::~wxFrame()
     }
 
     PreDestroy();
-    DoDestroy();
-}
 
-void wxFrame::DoDestroy()
-{
     Widget frameShell = (Widget)GetShellWidget();
 
     if( frameShell )
index e5cd9e67170bf9548ccbcf7b8f982d70599d69e4..59343183b564f12c7c0d8f7ccab1b94a7bda7b78 100644 (file)
@@ -116,12 +116,12 @@ bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id,
 
     if ( parent )
         parent->AddChild(this);
-    
+
     wxTopLevelWindows.Append(this);
 
     m_windowId = ( id > -1 ) ? id : NewControlId();
 
-    bool retval = DoCreate( parent, id, title, pos, size, style, name );
+    bool retval = XmDoCreateTLW( parent, id, title, pos, size, style, name );
 
     if( !retval ) return false;
 
@@ -140,7 +140,7 @@ bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id,
     // Modified Steve Hammes for Motif 2.0
 #if (XmREVISION > 1 || XmVERSION > 1)
     XmAddWMProtocolCallback( shell, WM_DELETE_WINDOW,
-                             (XtCallbackProc)wxCloseTLWCallback, 
+                             (XtCallbackProc)wxCloseTLWCallback,
                              (XtPointer)this );
 #elif XmREVISION == 1
     XmAddWMProtocolCallback( shell, WM_DELETE_WINDOW,
@@ -187,7 +187,7 @@ bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id,
     }
 
     XtAddEventHandler( (Widget)GetClientWidget(),
-                       ButtonPressMask | ButtonReleaseMask | 
+                       ButtonPressMask | ButtonReleaseMask |
                        PointerMotionMask | KeyPressMask,
                        False,
                        wxTLWEventHandler,
@@ -354,7 +354,7 @@ void wxTopLevelWindowMotif::DoSetSizeHints( int minW, int minH,
     if( incW > -1 ) { XtSetArg( args[count], XmNwidthInc,  incW ); ++count; }
     if( incH > -1 ) { XtSetArg( args[count], XmNheightInc, incH ); ++count; }
 
-    XtSetValues( (Widget)GetShellWidget(), args, count ); 
+    XtSetValues( (Widget)GetShellWidget(), args, count );
 }
 
 bool wxTopLevelWindowMotif::SetShape( const wxRegion& region )