#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)
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_sizeSet = TRUE;
+ /* send size event to frame */
+
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
+ /* send size event to status bar */
+
+ if (m_frameStatusBar)
+ {
+ wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
+ event2.SetEventObject( m_frameStatusBar );
+ m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
+ }
+
m_resizing = FALSE;
}
-void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
+void wxFrame::OnInternalIdle()
{
if (!m_sizeSet)
GtkOnSize( m_x, m_y, m_width, m_height );
}
}
- 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;
}