// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
-// RCS-ID: $Id: window.cpp 54981 2008-08-05 17:52:02Z SC $
+// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
{
public:
wxBlindPlateWindow() { Init(); }
-
+
// Old-style constructor (no default values for coordinates to avoid
// ambiguity with the new one)
wxBlindPlateWindow(wxWindow *parent,
const wxString& name = wxPanelNameStr)
{
Init();
-
+
Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name);
}
-
+
// Constructor
wxBlindPlateWindow(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxString& name = wxPanelNameStr)
{
Init();
-
+
Create(parent, winid, pos, size, style, name);
}
-
+
// Pseudo ctor
bool Create(wxWindow *parent,
wxWindowID winid = wxID_ANY,
{
if ( !wxWindow::Create(parent, winid, pos, size, style, name) )
return false;
-
+
// so that non-solid background renders correctly under GTK+:
SetThemeEnabled(true);
+ return true;
}
-
+
virtual ~wxBlindPlateWindow();
-
+
virtual bool AcceptsFocus() const
{
return false;
}
-
+
protected:
// common part of all ctors
void Init()
{
}
-
+
DECLARE_DYNAMIC_CLASS_NO_COPY(wxBlindPlateWindow)
DECLARE_EVENT_TABLE()
};
m_macIsUserPane = true;
m_clipChildren = false ;
m_cachedClippedRectValid = false ;
+ m_isNativeWindowWrapper = false;
}
wxWindowMac::~wxWindowMac()
// 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
delete m_peer ;
m_peer->SetData<ControlSize>(kControlEntireControl, kControlSizeTag, &size ) ;
#endif
-
+
switch ( variant )
{
case wxWINDOW_VARIANT_NORMAL :
return retval;
}
+bool wxWindowMac::SetBackgroundStyle(wxBackgroundStyle style)
+{
+ if ( !wxWindowBase::SetBackgroundStyle(style) )
+ return false;
+
+ if ( m_peer )
+ m_peer->SetBackgroundStyle(style);
+ return true;
+}
+
bool wxWindowMac::SetBackgroundColour(const wxColour& col )
{
if (m_growBox)
bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
{
#ifndef __WXUNIVERSAL__
- menu->SetInvokingWindow((wxWindow*)this);
menu->UpdateUI();
if ( x == wxDefaultCoord && y == wxDefaultCoord )
ClientToScreen( &x , &y ) ;
}
menu->GetPeer()->PopUp(this, x, y);
- menu->SetInvokingWindow( NULL );
return true;
#else
// actually this shouldn't be called, because universal is having its own implementation
if ( m_tooltip )
m_tooltip->SetWindow(this);
-
+
if (m_peer)
m_peer->SetToolTip(tooltip);
}
m_peer->SetVisibility( show ) ;
#ifdef __WXOSX_IPHONE__
- // only when there's no native event support
+ // only when there's no native event support
if ( !IsTopLevel() )
#endif
{
wxShowEvent eventShow(GetId(), show);
eventShow.SetEventObject(this);
-
+
HandleWindowEvent(eventShow);
}
-
+
return true;
}
int range, bool refresh)
{
#if wxUSE_SCROLLBAR
+ // Updating scrollbars when window is being deleted is useless and
+ // currently results in asserts in client-to-screen coordinates conversion
+ // code which is used by DoUpdateScrollbarVisibility() so just skip it.
+ if ( m_isBeingDeleted )
+ return;
+
if ( orient == wxHORIZONTAL && m_hScrollBar )
m_hScrollBar->SetScrollbar(pos, thumb, range, thumb, refresh);
else if ( orient == wxVERTICAL && m_vScrollBar )
if (child->IsTopLevel())
continue;
-
+
if ( !IsClientAreaChild(child) )
continue;
}
}
-long wxWindowMac::MacGetLeftBorderSize() const
+long wxWindowMac::MacGetWXBorderSize() const
{
if ( IsTopLevel() )
return 0 ;
return border ;
}
+long wxWindowMac::MacGetLeftBorderSize() const
+{
+ // the wx borders are all symmetric in mac themes
+ long border = MacGetWXBorderSize() ;
+
+ if ( m_peer )
+ {
+ int left, top, right, bottom;
+ m_peer->GetLayoutInset( left, top, right, bottom );
+ border -= left;
+ }
+
+ return border;
+}
+
+
long wxWindowMac::MacGetRightBorderSize() const
{
- // they are all symmetric in mac themes
- return MacGetLeftBorderSize() ;
+ // the wx borders are all symmetric in mac themes
+ long border = MacGetWXBorderSize() ;
+
+ if ( m_peer )
+ {
+ int left, top, right, bottom;
+ m_peer->GetLayoutInset( left, top, right, bottom );
+ border -= right;
+ }
+
+ return border;
}
long wxWindowMac::MacGetTopBorderSize() const
{
- // they are all symmetric in mac themes
- return MacGetLeftBorderSize() ;
+ // the wx borders are all symmetric in mac themes
+ long border = MacGetWXBorderSize() ;
+
+ if ( m_peer )
+ {
+ int left, top, right, bottom;
+ m_peer->GetLayoutInset( left, top, right, bottom );
+ border -= top;
+ }
+
+ return border;
}
long wxWindowMac::MacGetBottomBorderSize() const
{
- // they are all symmetric in mac themes
- return MacGetLeftBorderSize() ;
+ // the wx borders are all symmetric in mac themes
+ long border = MacGetWXBorderSize() ;
+
+ if ( m_peer )
+ {
+ int left, top, right, bottom;
+ m_peer->GetLayoutInset( left, top, right, bottom );
+ border -= bottom;
+ }
+
+ return border;
}
long wxWindowMac::MacRemoveBordersFromStyle( long style )