#include "wx/control.h"
#include "wx/app.h"
#include "wx/menu.h"
+#if wxUSE_TOOLBAR
#include "wx/toolbar.h"
+#endif
+#if wxUSE_STATUSBAR
#include "wx/statusbr.h"
+#endif
#include "wx/dcclient.h"
#include "glib.h"
#include "gtk/gtk.h"
#include "wx/gtk/win_gtk.h"
#include "gdk/gdkkeysyms.h"
+#include "gdk/gdkx.h"
//-----------------------------------------------------------------------------
// constants
// "configure_event"
//-----------------------------------------------------------------------------
-static gint gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxFrame *win )
+static gint
+#if (GTK_MINOR_VERSON > 0)
+gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxFrame *win )
+#else
+gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxFrame *win )
+#endif
{
- if (g_isIdle)
+ if (g_isIdle)
wxapp_install_idle_handler();
if (!win->m_hasVMT) return FALSE;
+#if (GTK_MINOR_VERSON > 0)
int x = 0;
int y = 0;
gdk_window_get_root_origin( win->m_widget->window, &x, &y );
-
win->m_x = x;
win->m_y = y;
+#else
+ win->m_x = event->x;
+ win->m_y = event->y;
+#endif
wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
mevent.SetEventObject( win );
decor |= GDK_DECOR_RESIZEH;
}
-
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);
m_needParent = FALSE;
- PreCreation( parent, id, pos, size, style, name );
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+ {
+ wxFAIL_MSG( _T("wxFrame creation failed") );
+ return FALSE;
+ }
m_title = title;
(*height) -= wxPLACE_HOLDER;
}
+#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
+#endif
+#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
else
(*height) -= wxPLACE_HOLDER;
}
+#endif
/* mini edge */
(*height) -= m_miniEdge*2 + m_miniTitle;
height += wxPLACE_HOLDER;
}
+#if wxUSE_STATUSBAR
/* status bar */
if (m_frameStatusBar) height += wxSTATUS_HEIGHT;
+#endif
+#if wxUSE_TOOLBAR
/* tool bar */
if (m_frameToolBar)
{
else
height += wxPLACE_HOLDER;
}
+#endif
wxWindow::DoSetClientSize( width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle );
}
client_area_y_offset += hh;
}
+#if wxUSE_TOOLBAR
if (m_frameToolBar)
{
int xx = m_miniEdge;
xx, yy, ww, hh );
client_area_y_offset += hh;
}
+#endif
int client_x = m_miniEdge;
int client_y = client_area_y_offset + m_miniEdge + m_miniTitle;
is no need to set the size or position of m_wxwindow. */
}
+#if wxUSE_STATUSBAR
if (m_frameStatusBar)
{
int xx = 0 + m_miniEdge;
m_frameStatusBar->m_widget,
xx, yy, ww, hh );
}
+#endif
/* we actually set the size of a frame here and no-where else */
gtk_widget_set_usize( m_widget, m_width, m_height );
DoMenuUpdates();
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
+#if wxUSE_TOOLBAR
if (m_frameToolBar) m_frameToolBar->OnInternalIdle();
+#endif
+#if wxUSE_STATUSBAR
if (m_frameStatusBar) m_frameStatusBar->OnInternalIdle();
+#endif
}
void wxFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) )
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}
+void wxFrame::Maximize(bool WXUNUSED(maximize))
+{
+}
+
+void wxFrame::Restore()
+{
+}
+
+void wxFrame::Iconize( bool iconize )
+{
+ if (iconize)
+ {
+ XIconifyWindow( GDK_WINDOW_XDISPLAY( m_widget->window ),
+ GDK_WINDOW_XWINDOW( m_widget->window ),
+ DefaultScreen( GDK_DISPLAY() ) );
+ }
+}
+
+bool wxFrame::IsIconized() const
+{
+ return FALSE;
+}