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
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;
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)
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;
};
// implementation
// ============================================================================
-IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow)
+IMPLEMENT_ABSTRACT_CLASS(wxTopLevelWindow, wxWindow)
// ----------------------------------------------------------------------------
// construction/destruction
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 )
}
PreDestroy();
- DoDestroy();
-}
-void wxDialog::DoDestroy()
-{
- if( m_mainWidget )
+ if ( m_mainWidget )
{
wxDeleteWindowFromTable( (Widget)m_mainWidget );
XtDestroyWidget( (Widget)m_mainWidget );
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;
}
PreDestroy();
- DoDestroy();
-}
-void wxFrame::DoDestroy()
-{
Widget frameShell = (Widget)GetShellWidget();
if( frameShell )
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;
// 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,
}
XtAddEventHandler( (Widget)GetClientWidget(),
- ButtonPressMask | ButtonReleaseMask |
+ ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | KeyPressMask,
False,
wxTLWEventHandler,
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 )