- if (wxIS_KIND_OF(child,wxToolBar) || wxIS_KIND_OF(child,wxMenuBar))
- {
- /* these are outside the client area */
- wxFrame* frame = (wxFrame*) parent;
- gtk_myfixed_put( GTK_MYFIXED(frame->m_mainWidget),
- GTK_WIDGET(child->m_widget),
- child->m_x,
- child->m_y );
- }
- else
- {
- /* these are inside the client area */
- gtk_myfixed_put( GTK_MYFIXED(parent->m_wxwindow),
- GTK_WIDGET(child->m_widget),
- child->m_x,
- child->m_y );
- }
-
- gtk_widget_set_usize( GTK_WIDGET(child->m_widget),
- child->m_width,
- child->m_height );
-
- /* resize on OnInternalIdle */
- parent->m_sizeSet = FALSE;
-
- if (parent->m_windowStyle & wxTAB_TRAVERSAL)
- {
- /* we now allow a window to get the focus as long as it
- doesn't have any children. */
- GTK_WIDGET_UNSET_FLAGS( parent->m_wxwindow, GTK_CAN_FOCUS );
- }
-}
-
-//-----------------------------------------------------------------------------
-// wxFrame
-//-----------------------------------------------------------------------------
-
-BEGIN_EVENT_TABLE(wxFrame, wxWindow)
- EVT_SIZE(wxFrame::OnSize)
- EVT_CLOSE(wxFrame::OnCloseWindow)
- EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
-END_EVENT_TABLE()
-
-IMPLEMENT_DYNAMIC_CLASS(wxFrame,wxWindow)
-
-wxFrame::wxFrame()
-{
- m_frameMenuBar = (wxMenuBar *) NULL;
- m_mdiMenuBar = (wxMenuBar *) NULL;
- m_frameStatusBar = (wxStatusBar *) NULL;
- m_frameToolBar = (wxToolBar *) NULL;
- m_sizeSet = FALSE;
- m_miniEdge = 0;
- m_miniTitle = 0;
- m_mainWidget = (GtkWidget*) NULL;
-}
-
-wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- m_frameMenuBar = (wxMenuBar *) NULL;
- m_mdiMenuBar = (wxMenuBar *) NULL;
- m_frameStatusBar = (wxStatusBar *) NULL;
- m_frameToolBar = (wxToolBar *) NULL;
- m_sizeSet = FALSE;
- m_miniEdge = 0;
- m_miniTitle = 0;
- m_mainWidget = (GtkWidget*) NULL;
- Create( parent, id, title, pos, size, style, name );
-}
-
-bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- wxTopLevelWindows.Append( this );
-
- m_needParent = FALSE;
-
- PreCreation( parent, id, pos, size, style, name );
-
- m_title = title;
-
- m_insertCallback = wxInsertChildInFrame;
-
- GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
- if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
-
- m_widget = gtk_window_new( win_type );
-
- gtk_window_set_title( GTK_WINDOW(m_widget), title );
- GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-
- /* needed ? */
- gtk_window_set_policy( GTK_WINDOW(m_widget), 1, 1, 0 );
-
- gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
- GTK_SIGNAL_FUNC(gtk_frame_delete_callback), (gpointer)this );
-
- /* m_mainWidget holds the toolbar, the menubar and the client area */
- m_mainWidget = gtk_myfixed_new();
- gtk_widget_show( m_mainWidget );
- GTK_WIDGET_UNSET_FLAGS( m_mainWidget, GTK_CAN_FOCUS );
- gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
- gtk_widget_realize( m_mainWidget );
-
- /* m_wxwindow only represents the client area without toolbar and menubar */
- m_wxwindow = gtk_myfixed_new();
- gtk_widget_show( m_wxwindow );
- GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
- gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
-
- if (m_parent) m_parent->AddChild( this );
-
- PostCreation();
-
- gtk_widget_realize( m_widget );
-
- /* all this is for Motif Window Manager "hints" and is supposed to be
- recognized by other WM as well. not tested. */
- long decor = (long) GDK_DECOR_ALL;
- long func = (long) GDK_FUNC_ALL;
- if ((m_windowStyle & wxCAPTION) == 0)
- decor |= GDK_DECOR_TITLE;
- if ((m_windowStyle & wxMINIMIZE) == 0)
- func |= GDK_FUNC_MINIMIZE;
- if ((m_windowStyle & wxMAXIMIZE) == 0)
- func |= GDK_FUNC_MAXIMIZE;
- if ((m_windowStyle & wxSYSTEM_MENU) == 0)
- decor |= GDK_DECOR_MENU;
- if ((m_windowStyle & wxMINIMIZE_BOX) == 0)
- decor |= GDK_DECOR_MINIMIZE;
- if ((m_windowStyle & wxMAXIMIZE_BOX) == 0)
- decor |= GDK_DECOR_MAXIMIZE;
- if ((m_windowStyle & wxRESIZE_BORDER) == 0)
- func |= GDK_FUNC_RESIZE;
- gdk_window_set_decorations(m_widget->window, (GdkWMDecoration)decor);
- gdk_window_set_functions(m_widget->window, (GdkWMFunction)func);
-
- /* the user resized the frame by dragging etc. */
- gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
- GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
-
- /* the only way to get the window size is to connect to this event */
- gtk_signal_connect( GTK_OBJECT(m_widget), "configure_event",
- GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
-
- return TRUE;