-bool wxPanel::Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxString& name)
-{
- bool ret = wxWindow::Create(parent, id, pos, size, style, name);
-
- if ( ret ) {
-#ifndef __WXGTK__
- SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
- SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
-#endif
- }
-
- return ret;
-}
-
-void wxPanel::InitDialog(void)
-{
- wxInitDialogEvent event(GetId());
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event);
-}
-
-void wxPanel::SetFocus()
-{
- SetFocusToNextChild();
-}
-
-// Responds to colour changes, and passes event on to children.
-void wxPanel::OnSysColourChanged(wxSysColourChangedEvent& event)
-{
- SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
- Refresh();
-
- // Propagate the event to the non-top-level children
- wxWindow::OnSysColourChanged(event);
-}
-
-void wxPanel::OnNavigationKey(wxNavigationKeyEvent& event)
-{
- // don't process these ones here
- if ( event.IsWindowChange() ) {
- event.Skip();
- return;
- }
-
- // first of all, find the window which currently has the focus
- wxNode *node = GetChildren().First();
- wxWindow *winFocus = event.GetCurrentFocus();
-
- // @@@ no FindFocus() in wxGTK
- #ifndef __WXGTK__
- if ( winFocus == NULL )
- winFocus = wxWindow::FindFocus();
- #endif
-
- while ( node != NULL ) {
- if ( node->Data() == winFocus )
- break;
-
- node = node->Next();
- }
-
- if ( !SetFocusToNextChild(node, event.GetDirection()) )
- event.Skip();
+ if ( m_bitmapBg.IsOk() )
+ {
+ Connect(wxEVT_ERASE_BACKGROUND,
+ wxEraseEventHandler(wxPanel::OnEraseBackground));
+ }
+ else
+ {
+ Disconnect(wxEVT_ERASE_BACKGROUND,
+ wxEraseEventHandler(wxPanel::OnEraseBackground));
+ }