// method
#ifdef __WXUNIVERSAL__
IMPLEMENT_ABSTRACT_CLASS(wxWindowOS2, wxWindowBase)
-#else // __WXPM__
- IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
-#endif // __WXUNIVERSAL__/__WXPM__
+#endif // __WXUNIVERSAL__
BEGIN_EVENT_TABLE(wxWindowOS2, wxWindowBase)
EVT_ERASE_BACKGROUND(wxWindowOS2::OnEraseBackground)
//
wxWindowOS2::~wxWindowOS2()
{
- m_isBeingDeleted = true;
+ SendDestroyEvent();
for (wxWindow* pWin = GetParent(); pWin; pWin = pWin->GetParent())
{
if (m_hWnd)
{
if(!::WinDestroyWindow(GetHWND()))
+ {
wxLogLastError(wxT("DestroyWindow"));
+ }
//
// remove hWnd <-> wxWindow association
//
// static box
//
wxASSERT_MSG( !wxDynamicCast(pParent, wxStaticBox),
- _T("wxStaticBox can't be used as a window parent!") );
+ wxT("wxStaticBox can't be used as a window parent!") );
#endif // wxUSE_STATBOX
// Ensure groupbox backgrounds are painted
void wxWindowOS2::SetFocus()
{
HWND hWnd = GetHwnd();
- wxCHECK_RET( hWnd, _T("can't set focus to invalid window") );
+ wxCHECK_RET( hWnd, wxT("can't set focus to invalid window") );
if (hWnd)
::WinSetFocus(HWND_DESKTOP, hWnd);
(void)HandleWindowEvent(rEvent);
}
}
- if (wxUpdateUIEvent::CanUpdate(this))
- UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
} // end of wxWindowOS2::OnIdle
//
// use WinQueryWindowPos. This call, unlike the WIN32 call, however,
// returns a position relative to it's parent, so no parent adujstments
// are needed under OS/2. Also, windows should be created using
- // wxWindow coordinates, i.e 0,0 is the TOP left.
+ // wxWindow coordinates, i.e. 0,0 is the TOP left.
//
if (IsKindOf(CLASSINFO(wxFrame)))
{
return(vFontMetrics.lAveCharWidth);
} // end of wxWindowOS2::GetCharWidth
-void wxWindowOS2::GetTextExtent( const wxString& rString,
- int* pX,
- int* pY,
- int* pDescent,
- int* pExternalLeading,
- const wxFont* WXUNUSED(pTheFont) ) const
+void wxWindowOS2::DoGetTextExtent( const wxString& rString,
+ int* pX,
+ int* pY,
+ int* pDescent,
+ int* pExternalLeading,
+ const wxFont* WXUNUSED(pTheFont) ) const
{
POINTL avPoint[TXTBOX_COUNT];
POINTL vPtMin;
*pExternalLeading = 0;
}
::WinReleasePS(hPS);
-} // end of wxWindow::GetTextExtent
+} // end of wxWindow::DoGetTextExtent
bool wxWindowOS2::IsMouseInWindow() const
{
bool bIsWaiting = true;
int nHeight;
- pMenu->SetInvokingWindow(this);
pMenu->UpdateUI();
if ( nX == -1 && nY == -1 )
::WinDispatchMsg(vHabmain, (PQMSG)&vMsg);
}
- pMenu->SetInvokingWindow(NULL);
return true;
} // end of wxWindowOS2::DoPopupMenu
#endif // wxUSE_MENUS_NATIVE
{
wxString Newstr(pWin->GetClassInfo()->GetClassName());
wxString Oldstr(pOldWin->GetClassInfo()->GetClassName());
- wxLogError( _T("Bug! New window of class %s has same HWND %X as old window of class %s"),
+ wxLogError( wxT("Bug! New window of class %s has same HWND %X as old window of class %s"),
Newstr.c_str(),
(int)hWnd,
Oldstr.c_str()
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Error creating frame. Error: %s\n"), sError.c_str());
return false;
}
SetSize( nX
// Delete our drop target if we've got one
//
#if wxUSE_DRAG_AND_DROP
- if (m_dropTarget != NULL)
- {
- delete m_dropTarget;
- m_dropTarget = NULL;
- }
+ wxDELETE(m_dropTarget);
#endif // wxUSE_DRAG_AND_DROP
//
,pMeasureStruct->rclItem.yTop - pMeasureStruct->rclItem.yBottom
);
- wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
+ wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
impl->SetHDC( hDC, false );
impl->SetHPS( pMeasureStruct->hps );
//
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table (1). Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table (1). Error: %s\n"), sError.c_str());
}
//
// Set the color table to RGB mode
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Unable to set current color table (2). Error: %s\n"), sError.c_str());
+ wxLogError(wxT("Unable to set current color table (2). Error: %s\n"), sError.c_str());
}
wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );