#include "wx/toolbar.h"
#include "wx/statusbr.h"
#include "wx/dcclient.h"
+
+#include "glib.h"
+#include "gdk/gdk.h"
+#include "gtk/gtk.h"
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
win->m_x = event->x;
win->m_y = event->y;
+ wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
+ mevent.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent( mevent );
+
return FALSE;
}
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
EVT_SIZE(wxFrame::OnSize)
EVT_CLOSE(wxFrame::OnCloseWindow)
- EVT_IDLE(wxFrame::OnIdle)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxFrame,wxWindow)
m_widget = gtk_window_new( win_type );
+#ifdef __WXDEBUG__
+ debug_focus_in( m_widget, "wxFrame::m_widget", name );
+#endif
+
if ((size.x != -1) && (size.y != -1))
gtk_widget_set_usize( m_widget, m_width, m_height );
if ((pos.x != -1) && (pos.y != -1))
gtk_widget_show( m_wxwindow );
GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
+#ifdef __WXDEBUG__
+ debug_focus_in( m_wxwindow, "wxFrame::m_wxwindow", name );
+#endif
+
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
if (m_frameToolBar) delete m_frameToolBar;
wxTopLevelWindows.DeleteObject( this );
- if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
+
+ if (wxTheApp->GetTopWindow() == this)
+ {
+ wxTheApp->SetTopWindow( (wxWindow*) NULL );
+ }
+
+ if (wxTopLevelWindows.Number() == 0)
+ {
+ wxTheApp->ExitMainLoop();
+ }
}
bool wxFrame::Show( bool show )
if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
- if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
- if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight;
+ if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
+ if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
if ((m_x != -1) || (m_y != -1))
{
if ((m_width != old_width) || (m_height != old_height))
{
- gtk_widget_set_usize( m_widget, m_width, m_height );
+ gtk_widget_set_usize( m_widget, m_width, m_height );
}
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
- if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth;
- if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight;
+ if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
+ if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
gtk_widget_set_usize( m_widget, m_width, m_height );
if (m_frameMenuBar)
{
int xx = m_miniEdge;
- int yy = m_miniEdge + m_miniTitle;
- int ww = m_width - 2*m_miniEdge;
- int hh = wxMENU_HEIGHT;
+ int yy = m_miniEdge + m_miniTitle;
+ int ww = m_width - 2*m_miniEdge;
+ int hh = wxMENU_HEIGHT;
m_frameMenuBar->m_x = xx;
m_frameMenuBar->m_y = yy;
m_frameMenuBar->m_width = ww;
if (m_frameToolBar)
{
int xx = m_miniEdge;
- int yy = m_miniEdge + m_miniTitle;
+ int yy = m_miniEdge + m_miniTitle;
if (m_frameMenuBar) yy += wxMENU_HEIGHT;
- int ww = m_width - 2*m_miniEdge;
+ int ww = m_width - 2*m_miniEdge;
int hh = m_frameToolBar->m_height;
m_frameToolBar->m_x = xx;
if (m_frameStatusBar)
{
int xx = 0 + m_miniEdge;
- int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge;
- int ww = m_width - 2*m_miniEdge;
- int hh = wxSTATUS_HEIGHT;
+ int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge;
+ int ww = m_width - 2*m_miniEdge;
+ int hh = wxSTATUS_HEIGHT;
m_frameStatusBar->m_x = xx;
m_frameStatusBar->m_y = yy;
m_resizing = FALSE;
}
-void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
+void wxFrame::OnInternalIdle()
{
if (!m_sizeSet)
GtkOnSize( m_x, m_y, m_width, m_height );
for(wxNode *node = GetChildren().First(); node; node = node->Next())
{
wxWindow *win = (wxWindow *)node->Data();
- if (!IS_KIND_OF(win,wxFrame) && !IS_KIND_OF(win,wxDialog)
+ if (!wxIS_KIND_OF(win,wxFrame) && !wxIS_KIND_OF(win,wxDialog)
#if 0 // not in m_children anyway ?
&& (win != m_frameMenuBar) &&
(win != m_frameToolBar) &&
}
}
- if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
+ m_sizeSet = FALSE;
}
wxMenuBar *wxFrame::GetMenuBar() const
GetChildren().DeleteObject( m_frameToolBar );
- if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
+ m_sizeSet = FALSE;
return m_frameToolBar;
}
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
- if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height );
+ m_sizeSet = FALSE;
return m_frameStatusBar;
}