#include "wx/dialog.h"
#include "wx/menu.h"
-#include <wx/intl.h>
+#include "wx/intl.h"
-#include "glib.h"
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
// "switch_page"
//-----------------------------------------------------------------------------
-static void gtk_mdi_page_change_callback(GtkNotebook *WXUNUSED(widget),
- GtkNotebookPage *WXUNUSED(page),
- gint page,
- wxMDIParentFrame *parent )
+static void
+gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
+ GtkNotebookPage *page,
+ gint WXUNUSED(page_num),
+ wxMDIParentFrame *parent )
{
if (g_isIdle)
wxapp_install_idle_handler();
+ // send deactivate event to old child
+
wxMDIChildFrame *child = parent->GetActiveChild();
+ if (child)
+ {
+ wxActivateEvent event1( wxEVT_ACTIVATE, FALSE, child->GetId() );
+ event1.SetEventObject( child);
+ child->GetEventHandler()->ProcessEvent( event1 );
+ }
+
+ // send activate event to new child
- if (!child) return;
+ wxMDIClientWindow *client_window = parent->GetClientWindow();
+ if (!client_window)
+ return;
+
+ child = (wxMDIChildFrame*) NULL;
- wxActivateEvent event( wxEVT_ACTIVATE, TRUE, child->GetId() );
- event.SetEventObject( child);
- child->GetEventHandler()->ProcessEvent( event );
+ wxNode *node = client_window->GetChildren().First();
+ while (node)
+ {
+ wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
+ if (child_frame->m_page == page)
+ {
+ child = child_frame;
+ break;
+ }
+ node = node->Next();
+ }
+
+ if (!child)
+ return;
+
+ wxActivateEvent event2( wxEVT_ACTIVATE, TRUE, child->GetId() );
+ event2.SetEventObject( child);
+ child->GetEventHandler()->ProcessEvent( event2 );
}
//-----------------------------------------------------------------------------
menu_bar->m_y = 0;
menu_bar->m_width = m_width;
menu_bar->m_height = wxMENU_HEIGHT;
- gtk_myfixed_set_size( GTK_MYFIXED(m_mainWidget),
+ gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
menu_bar->m_widget,
0, 0, m_width, wxMENU_HEIGHT );
}
{
menu_bar->m_width = m_width;
menu_bar->m_height = wxMENU_HEIGHT;
- gtk_myfixed_set_size( GTK_MYFIXED(m_mainWidget),
+ gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
menu_bar->m_widget,
0, 0, m_width, wxMENU_HEIGHT );
menu_bar->SetInvokingWindow( child_frame );
m_frameMenuBar->m_width = m_width;
m_frameMenuBar->m_height = wxMENU_HEIGHT;
- gtk_myfixed_set_size( GTK_MYFIXED(m_mainWidget),
+ gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
m_frameMenuBar->m_widget,
0, 0, m_width, wxMENU_HEIGHT );
}
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{
- wxASSERT_MSG( m_menuBar == NULL, _T("Only one menubar allowed") );
+ wxASSERT_MSG( m_menuBar == NULL, wxT("Only one menubar allowed") );
m_menuBar = menu_bar;
m_menuBar->SetParent( mdi_frame );
/* insert the invisible menu bar into the _parent_ mdi frame */
- gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWidget),
+ gtk_pizza_put( GTK_PIZZA(mdi_frame->m_mainWidget),
m_menuBar->m_widget,
0, 0, mdi_frame->m_width, wxMENU_HEIGHT );
}
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
- !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("wxMDIClientWindow") ))
+ !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
{
- wxFAIL_MSG( _T("wxMDIClientWindow creation failed") );
+ wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
return FALSE;
}