// headers
// ---------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "univwindow.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
const wxString& name)
{
long actualStyle = style;
-
+
// FIXME: may need this on other platforms
#ifdef __WXMSW__
actualStyle &= ~wxVSCROLL;
actualStyle &= ~wxHSCROLL;
-#endif
-
+#endif
+
// we add wxCLIP_CHILDREN to get the same ("natural") behaviour under MSW
// as under the other platforms
if ( !wxWindowNative::Create(parent, id, pos, size,
// when calling the base window Create().
wxWindowBase::SetWindowStyleFlag(style);
- // if we should always have a vertical scrollbar, do show it
- if ( style & wxALWAYS_SHOW_SB )
+ // if we allow or should always have a vertical scrollbar, make it
+ if ( style & wxVSCROLL || style & wxALWAYS_SHOW_SB )
{
#if wxUSE_TWO_WINDOWS
SetInsertIntoMain( true );
#endif
}
- // if we should always have a horizontal scrollbar, do show it
+ // if we should allow a horizontal scrollbar, make it
if ( style & wxHSCROLL )
{
#if wxUSE_TWO_WINDOWS
SetInsertIntoMain( false );
#endif
}
-
+
if (m_scrollbarHorz || m_scrollbarVert)
{
// position it/them
return true;
}
+wxWindow::~wxWindow()
+{
+ m_isBeingDeleted = true;
+
+ // we have to destroy our children before we're destroyed because our
+ // children suppose that we're of type wxWindow, not just wxWindowNative,
+ // and so bad things may happen if they're deleted from the base class dtor
+ // as by then we're not a wxWindow any longer and wxUniv-specific virtual
+ // functions can't be called
+ DestroyChildren();
+}
+
// ----------------------------------------------------------------------------
// background pixmap
// ----------------------------------------------------------------------------
rect.height = size.y;
wxWindow * const parent = GetParent();
- if ( HasTransparentBackground() && parent && parent->ProvidesBackground() )
+ if ( HasTransparentBackground() && parent )
{
wxASSERT( !IsTopLevel() );
}
else
{
- // Draw background ouselves
+ // Draw background ourselves
EraseBackground( dc, rect );
}
while ( node )
{
wxWindow *win = node->GetData();
- // Only refresh sub controls when it is visible
+ // Only refresh sub controls when it is visible
// and when it is in the update region.
if(!win->IsKindOf(CLASSINFO(wxTopLevelWindow)) && win->IsShown() && wxRegion(rectWin).Contains(win->GetRect()) != wxOutRegion)
win->Refresh(eraseBackground, &rectWin);
-
+
node = node->GetNext();
}
}
wxMemoryDC dcMem;
dcMem.SelectObject(bmp);
- dcMem.Blit(wxPoint(0, 0), size, &dc, ptSource
+ dcMem.Blit(wxPoint(0,0), size, &dc, ptSource
#if defined(__WXGTK__) && !defined(wxHAS_WORKING_GTK_DC_BLIT)
+ GetClientAreaOrigin()
#endif // broken wxGTK wxDC::Blit
);
- dc.Blit(ptDest, size, &dcMem, wxPoint(0, 0));
+ dc.Blit(ptDest, size, &dcMem, wxPoint(0,0));
wxLogTrace(_T("scroll"),
_T("Blit: (%d, %d) of size %dx%d -> (%d, %d)"),
{
#if wxUSE_MENUS
int key = event.GetKeyCode();
- if ( !event.ControlDown() && (key == WXK_MENU || key == WXK_F10) )
+ if ( !event.ControlDown() && (key == WXK_ALT || key == WXK_F10) )
{
ms_winLastAltPress = this;
void wxWindow::OnKeyUp(wxKeyEvent& event)
{
int key = event.GetKeyCode();
- if ( !event.HasModifiers() && (key == WXK_MENU || key == WXK_F10) )
+ if ( !event.HasModifiers() && (key == WXK_ALT || key == WXK_F10) )
{
// only process Alt release specially if there were no other key
// presses since Alt had been pressed and if both events happened in