Files
wxWidgets/src/generic/panelg.cpp
Stefan Csomor 2895324520 merging back XTI branch part 2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-04 08:31:53 +00:00

108 lines
2.9 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: src/generic/panelg.cpp
// Purpose: wxPanel and the keyboard handling code
// Author: Julian Smart, Robert Roebling, Vadim Zeitlin
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/object.h"
#include "wx/font.h"
#include "wx/colour.h"
#include "wx/settings.h"
#include "wx/log.h"
#include "wx/panel.h"
#include "wx/containr.h"
#endif
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxPanel, wxWindow)
WX_EVENT_TABLE_CONTROL_CONTAINER(wxPanel)
END_EVENT_TABLE()
// ============================================================================
// implementation
// ============================================================================
WX_DELEGATE_TO_CONTROL_CONTAINER(wxPanel, wxWindow)
// ----------------------------------------------------------------------------
// wxPanel creation
// ----------------------------------------------------------------------------
void wxPanel::Init()
{
WX_INIT_CONTROL_CONTAINER();
}
bool wxPanel::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
return false;
// so that non-solid background renders correctly under GTK+:
SetThemeEnabled(true);
#if defined(__WXWINCE__) && (defined(__POCKETPC__) || defined(__SMARTPHONE__))
// Required to get solid control backgrounds under WinCE
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
#endif
return true;
}
wxPanel::~wxPanel()
{
}
void wxPanel::InitDialog()
{
wxInitDialogEvent event(GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
#ifdef __WXMSW__
bool wxPanel::HasTransparentBackground()
{
for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
{
if ( win->MSWHasInheritableBackground() )
return true;
if ( win->IsTopLevel() )
break;
}
return false;
}
#endif // __WXMSW__