renamed wxMotif::wxTLW::DoCreate() to XmDoCreateTLW() to avoid conflicts with
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
This commit is contained in:
@@ -79,13 +79,14 @@ public:
|
|||||||
void OnCloseWindow(wxCloseEvent& event);
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool DoCreate( wxWindow* parent, wxWindowID id,
|
virtual bool XmDoCreateTLW(wxWindow* parent,
|
||||||
const wxString& title,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxString& title,
|
||||||
const wxSize& size,
|
const wxPoint& pos,
|
||||||
long style,
|
const wxSize& size,
|
||||||
const wxString& name );
|
long style,
|
||||||
virtual void DoDestroy();
|
const wxString& name);
|
||||||
|
|
||||||
|
|
||||||
//// Motif-specific
|
//// Motif-specific
|
||||||
bool m_modalShowing;
|
bool m_modalShowing;
|
||||||
|
@@ -117,13 +117,14 @@ private:
|
|||||||
virtual void DoSetClientSize(int width, int height);
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool DoCreate( wxWindow* parent, wxWindowID id,
|
virtual bool XmDoCreateTLW(wxWindow* parent,
|
||||||
const wxString& title,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxString& title,
|
||||||
const wxSize& size,
|
const wxPoint& pos,
|
||||||
long style,
|
const wxSize& size,
|
||||||
const wxString& name );
|
long style,
|
||||||
virtual void DoDestroy();
|
const wxString& name);
|
||||||
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||||
|
@@ -70,19 +70,17 @@ protected:
|
|||||||
void PreDestroy();
|
void PreDestroy();
|
||||||
|
|
||||||
virtual void DoGetPosition(int* x, int* y) const;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void DoDestroy() { }
|
private:
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
};
|
};
|
||||||
|
@@ -46,7 +46,7 @@ END_EVENT_TABLE()
|
|||||||
// implementation
|
// implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow)
|
IMPLEMENT_ABSTRACT_CLASS(wxTopLevelWindow, wxWindow)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
|
@@ -151,12 +151,13 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDialog::DoCreate( wxWindow* parent, wxWindowID id,
|
bool wxDialog::XmDoCreateTLW(wxWindow* parent,
|
||||||
const wxString& title,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxString& title,
|
||||||
const wxSize& size,
|
const wxPoint& pos,
|
||||||
long style,
|
const wxSize& size,
|
||||||
const wxString& name )
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
Widget parentWidget = (Widget) 0;
|
Widget parentWidget = (Widget) 0;
|
||||||
if( parent )
|
if( parent )
|
||||||
@@ -233,12 +234,8 @@ wxDialog::~wxDialog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
PreDestroy();
|
PreDestroy();
|
||||||
DoDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxDialog::DoDestroy()
|
if ( m_mainWidget )
|
||||||
{
|
|
||||||
if( m_mainWidget )
|
|
||||||
{
|
{
|
||||||
wxDeleteWindowFromTable( (Widget)m_mainWidget );
|
wxDeleteWindowFromTable( (Widget)m_mainWidget );
|
||||||
XtDestroyWidget( (Widget)m_mainWidget );
|
XtDestroyWidget( (Widget)m_mainWidget );
|
||||||
|
@@ -196,12 +196,13 @@ bool wxFrame::Create(wxWindow *parent,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFrame::DoCreate( wxWindow* parent, wxWindowID id,
|
bool wxFrame::XmDoCreateTLW(wxWindow* parent,
|
||||||
const wxString& title,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxString& title,
|
||||||
const wxSize& size,
|
const wxPoint& pos,
|
||||||
long style,
|
const wxSize& size,
|
||||||
const wxString& name )
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
Widget frameShell;
|
Widget frameShell;
|
||||||
|
|
||||||
@@ -292,11 +293,7 @@ wxFrame::~wxFrame()
|
|||||||
}
|
}
|
||||||
|
|
||||||
PreDestroy();
|
PreDestroy();
|
||||||
DoDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxFrame::DoDestroy()
|
|
||||||
{
|
|
||||||
Widget frameShell = (Widget)GetShellWidget();
|
Widget frameShell = (Widget)GetShellWidget();
|
||||||
|
|
||||||
if( frameShell )
|
if( frameShell )
|
||||||
|
@@ -116,12 +116,12 @@ bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
if ( parent )
|
if ( parent )
|
||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
|
|
||||||
wxTopLevelWindows.Append(this);
|
wxTopLevelWindows.Append(this);
|
||||||
|
|
||||||
m_windowId = ( id > -1 ) ? id : NewControlId();
|
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;
|
if( !retval ) return false;
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id,
|
|||||||
// Modified Steve Hammes for Motif 2.0
|
// Modified Steve Hammes for Motif 2.0
|
||||||
#if (XmREVISION > 1 || XmVERSION > 1)
|
#if (XmREVISION > 1 || XmVERSION > 1)
|
||||||
XmAddWMProtocolCallback( shell, WM_DELETE_WINDOW,
|
XmAddWMProtocolCallback( shell, WM_DELETE_WINDOW,
|
||||||
(XtCallbackProc)wxCloseTLWCallback,
|
(XtCallbackProc)wxCloseTLWCallback,
|
||||||
(XtPointer)this );
|
(XtPointer)this );
|
||||||
#elif XmREVISION == 1
|
#elif XmREVISION == 1
|
||||||
XmAddWMProtocolCallback( shell, WM_DELETE_WINDOW,
|
XmAddWMProtocolCallback( shell, WM_DELETE_WINDOW,
|
||||||
@@ -187,7 +187,7 @@ bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
XtAddEventHandler( (Widget)GetClientWidget(),
|
XtAddEventHandler( (Widget)GetClientWidget(),
|
||||||
ButtonPressMask | ButtonReleaseMask |
|
ButtonPressMask | ButtonReleaseMask |
|
||||||
PointerMotionMask | KeyPressMask,
|
PointerMotionMask | KeyPressMask,
|
||||||
False,
|
False,
|
||||||
wxTLWEventHandler,
|
wxTLWEventHandler,
|
||||||
@@ -354,7 +354,7 @@ void wxTopLevelWindowMotif::DoSetSizeHints( int minW, int minH,
|
|||||||
if( incW > -1 ) { XtSetArg( args[count], XmNwidthInc, incW ); ++count; }
|
if( incW > -1 ) { XtSetArg( args[count], XmNwidthInc, incW ); ++count; }
|
||||||
if( incH > -1 ) { XtSetArg( args[count], XmNheightInc, incH ); ++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 )
|
bool wxTopLevelWindowMotif::SetShape( const wxRegion& region )
|
||||||
|
Reference in New Issue
Block a user