]>
git.saurik.com Git - wxWidgets.git/blob - src/generic/panelg.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/generic/panelg.cpp
3 // Purpose: wxPanel and the keyboard handling code
4 // Author: Julian Smart, Robert Roebling, Vadim Zeitlin
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
28 #include "wx/object.h"
30 #include "wx/colour.h"
31 #include "wx/settings.h"
34 #include "wx/containr.h"
37 // ----------------------------------------------------------------------------
39 // ----------------------------------------------------------------------------
41 BEGIN_EVENT_TABLE(wxPanel
, wxWindow
)
42 WX_EVENT_TABLE_CONTROL_CONTAINER(wxPanel
)
45 // ============================================================================
47 // ============================================================================
49 WX_DELEGATE_TO_CONTROL_CONTAINER(wxPanel
, wxWindow
)
51 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
57 WX_INIT_CONTROL_CONTAINER();
60 bool wxPanel::Create(wxWindow
*parent
, wxWindowID id
,
66 if ( !wxWindow::Create(parent
, id
, pos
, size
, style
, name
) )
69 // so that non-solid background renders correctly under GTK+:
70 SetThemeEnabled(true);
72 #if defined(__WXWINCE__) && (defined(__POCKETPC__) || defined(__SMARTPHONE__))
73 // Required to get solid control backgrounds under WinCE
74 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW
));
84 void wxPanel::InitDialog()
86 wxInitDialogEvent
event(GetId());
87 event
.SetEventObject(this);
88 GetEventHandler()->ProcessEvent(event
);
93 bool wxPanel::HasTransparentBackground()
95 for ( wxWindow
*win
= GetParent(); win
; win
= win
->GetParent() )
97 if ( win
->MSWHasInheritableBackground() )
100 if ( win
->IsTopLevel() )