Changed time of sending the wxSizeEvent and assorted things,
this made wxGLCanvas work, wxMiniFrame looks correct again, Corrected makefile for HTML help git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -102,6 +102,7 @@ public:
|
|||||||
void OnCloseWindow( wxCloseEvent& event );
|
void OnCloseWindow( wxCloseEvent& event );
|
||||||
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
|
void OnIdle( wxIdleEvent &event );
|
||||||
|
|
||||||
void OnMenuHighlight( wxMenuEvent& event );
|
void OnMenuHighlight( wxMenuEvent& event );
|
||||||
|
|
||||||
|
@@ -42,9 +42,6 @@ extern const char *wxRadioBoxNameStr;
|
|||||||
|
|
||||||
class wxRadioBox: public wxControl
|
class wxRadioBox: public wxControl
|
||||||
{
|
{
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxRadioBox();
|
wxRadioBox();
|
||||||
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
@@ -91,7 +88,6 @@ public:
|
|||||||
int GetNumberOfRowsOrCols() const;
|
int GetNumberOfRowsOrCols() const;
|
||||||
void SetNumberOfRowsOrCols( int n );
|
void SetNumberOfRowsOrCols( int n );
|
||||||
|
|
||||||
void OnSize( wxSizeEvent &event );
|
|
||||||
void SetFocus();
|
void SetFocus();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
@@ -101,12 +97,14 @@ public:
|
|||||||
bool IsOwnGtkWindow( GdkWindow *window );
|
bool IsOwnGtkWindow( GdkWindow *window );
|
||||||
void ApplyWidgetStyle();
|
void ApplyWidgetStyle();
|
||||||
wxSize LayoutItems();
|
wxSize LayoutItems();
|
||||||
|
void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
|
||||||
|
|
||||||
bool m_alreadySent;
|
bool m_alreadySent;
|
||||||
int m_majorDim;
|
int m_majorDim;
|
||||||
wxList m_boxes;
|
wxList m_boxes;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -102,6 +102,7 @@ public:
|
|||||||
void OnCloseWindow( wxCloseEvent& event );
|
void OnCloseWindow( wxCloseEvent& event );
|
||||||
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
|
void OnIdle( wxIdleEvent &event );
|
||||||
|
|
||||||
void OnMenuHighlight( wxMenuEvent& event );
|
void OnMenuHighlight( wxMenuEvent& event );
|
||||||
|
|
||||||
|
@@ -42,9 +42,6 @@ extern const char *wxRadioBoxNameStr;
|
|||||||
|
|
||||||
class wxRadioBox: public wxControl
|
class wxRadioBox: public wxControl
|
||||||
{
|
{
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxRadioBox();
|
wxRadioBox();
|
||||||
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
@@ -91,7 +88,6 @@ public:
|
|||||||
int GetNumberOfRowsOrCols() const;
|
int GetNumberOfRowsOrCols() const;
|
||||||
void SetNumberOfRowsOrCols( int n );
|
void SetNumberOfRowsOrCols( int n );
|
||||||
|
|
||||||
void OnSize( wxSizeEvent &event );
|
|
||||||
void SetFocus();
|
void SetFocus();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
@@ -101,12 +97,14 @@ public:
|
|||||||
bool IsOwnGtkWindow( GdkWindow *window );
|
bool IsOwnGtkWindow( GdkWindow *window );
|
||||||
void ApplyWidgetStyle();
|
void ApplyWidgetStyle();
|
||||||
wxSize LayoutItems();
|
wxSize LayoutItems();
|
||||||
|
void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
|
||||||
|
|
||||||
bool m_alreadySent;
|
bool m_alreadySent;
|
||||||
int m_majorDim;
|
int m_majorDim;
|
||||||
wxList m_boxes;
|
wxList m_boxes;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -17,7 +17,8 @@ VPATH = :$(top_srcdir)/samples/html/help
|
|||||||
|
|
||||||
DATADIRS = helpfiles
|
DATADIRS = helpfiles
|
||||||
DATAFILES = helpfiles/Index.hhk helpfiles/book1.htm helpfiles/book2.htm \
|
DATAFILES = helpfiles/Index.hhk helpfiles/book1.htm helpfiles/book2.htm \
|
||||||
helpfiles/contents.hhc helpfiles/main.htm helpfiles/page2-b.htm helpfiles/testing.hhp
|
helpfiles/contents.hhc helpfiles/main.htm helpfiles/page2-b.htm helpfiles/testing.hhp \
|
||||||
|
helpfiles/another.hhc helpfiles/another.hhp helpfiles/another.htm
|
||||||
|
|
||||||
PROGRAM=help
|
PROGRAM=help
|
||||||
|
|
||||||
|
@@ -19,23 +19,22 @@
|
|||||||
#include "wx/menu.h"
|
#include "wx/menu.h"
|
||||||
#include "wx/menuitem.h"
|
#include "wx/menuitem.h"
|
||||||
|
|
||||||
#ifndef __WXGTK__
|
|
||||||
void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
|
void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
DoMenuUpdates();
|
DoMenuUpdates();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// update all menus
|
// update all menus
|
||||||
void wxFrame::DoMenuUpdates()
|
void wxFrame::DoMenuUpdates()
|
||||||
{
|
{
|
||||||
wxMenuBar* bar = GetMenuBar();
|
wxMenuBar* bar = GetMenuBar();
|
||||||
|
|
||||||
if ( bar != NULL ) {
|
if ( bar != NULL )
|
||||||
int nCount = bar->GetMenuCount();
|
{
|
||||||
for (int n = 0; n < nCount; n++)
|
int nCount = bar->GetMenuCount();
|
||||||
DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
|
for (int n = 0; n < nCount; n++)
|
||||||
}
|
DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update a menu and all submenus recursively
|
// update a menu and all submenus recursively
|
||||||
|
@@ -246,6 +246,7 @@ void wxDialog::Init()
|
|||||||
m_returnCode = 0;
|
m_returnCode = 0;
|
||||||
m_sizeSet = FALSE;
|
m_sizeSet = FALSE;
|
||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
|
m_isFrame = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDialog::wxDialog( wxWindow *parent,
|
wxDialog::wxDialog( wxWindow *parent,
|
||||||
|
@@ -71,10 +71,20 @@ static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
if (!win->m_hasVMT) return;
|
if (!win->m_hasVMT)
|
||||||
|
return;
|
||||||
|
|
||||||
if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
|
if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
wxPrintf( "OnSize from " );
|
||||||
|
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
||||||
|
wxPrintf( win->GetClassInfo()->GetClassName() );
|
||||||
|
wxPrintf( " %d %d %d %d\n", (int)alloc->x,
|
||||||
|
(int)alloc->y,
|
||||||
|
(int)alloc->width,
|
||||||
|
(int)alloc->height );
|
||||||
|
*/
|
||||||
win->m_width = alloc->width;
|
win->m_width = alloc->width;
|
||||||
win->m_height = alloc->height;
|
win->m_height = alloc->height;
|
||||||
win->UpdateSize();
|
win->UpdateSize();
|
||||||
@@ -334,6 +344,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
||||||
EVT_SIZE(wxFrame::OnSize)
|
EVT_SIZE(wxFrame::OnSize)
|
||||||
|
EVT_IDLE(wxFrame::OnIdle)
|
||||||
EVT_CLOSE(wxFrame::OnCloseWindow)
|
EVT_CLOSE(wxFrame::OnCloseWindow)
|
||||||
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -356,6 +367,7 @@ void wxFrame::Init()
|
|||||||
m_menuBarDetached = FALSE;
|
m_menuBarDetached = FALSE;
|
||||||
m_toolBarDetached = FALSE;
|
m_toolBarDetached = FALSE;
|
||||||
m_insertInClientArea = TRUE;
|
m_insertInClientArea = TRUE;
|
||||||
|
m_isFrame = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
||||||
@@ -429,6 +441,10 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
|
|
||||||
if (m_parent) m_parent->AddChild( this );
|
if (m_parent) m_parent->AddChild( this );
|
||||||
|
|
||||||
|
/* 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 );
|
||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
/* we cannot set MWM hints and icons before the widget has
|
/* we cannot set MWM hints and icons before the widget has
|
||||||
@@ -436,10 +452,6 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
|
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
|
||||||
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
|
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
|
||||||
|
|
||||||
/* 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 */
|
/* 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_connect( GTK_OBJECT(m_widget), "configure_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
|
||||||
@@ -775,20 +787,23 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
/* we actually set the size of a frame here and no-where else */
|
/* we actually set the size of a frame here and no-where else */
|
||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
|
|
||||||
|
|
||||||
m_sizeSet = TRUE;
|
m_sizeSet = TRUE;
|
||||||
|
|
||||||
/* send size event to frame */
|
// send size event to frame
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent( event );
|
GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
/* send size event to status bar */
|
/*
|
||||||
|
// send size event to status bar
|
||||||
if (m_frameStatusBar)
|
if (m_frameStatusBar)
|
||||||
{
|
{
|
||||||
wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
|
wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
|
||||||
event2.SetEventObject( m_frameStatusBar );
|
event2.SetEventObject( m_frameStatusBar );
|
||||||
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
m_resizing = FALSE;
|
m_resizing = FALSE;
|
||||||
}
|
}
|
||||||
@@ -804,9 +819,14 @@ void wxFrame::MakeModal( bool modal )
|
|||||||
void wxFrame::OnInternalIdle()
|
void wxFrame::OnInternalIdle()
|
||||||
{
|
{
|
||||||
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
|
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
|
||||||
|
{
|
||||||
GtkOnSize( m_x, m_y, m_width, m_height );
|
GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
|
|
||||||
DoMenuUpdates();
|
// we'll come back later
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
|
@@ -71,8 +71,10 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
if (!win->m_hasVMT) return;
|
if (!win->m_hasVMT) return;
|
||||||
if (gdk_event->count > 0) return;
|
if (gdk_event->count > 0) return;
|
||||||
|
|
||||||
|
GtkMyFixed *myfixed = GTK_MYFIXED(widget);
|
||||||
|
|
||||||
gtk_draw_shadow( widget->style,
|
gtk_draw_shadow( widget->style,
|
||||||
widget->window,
|
myfixed->bin_window,
|
||||||
GTK_STATE_NORMAL,
|
GTK_STATE_NORMAL,
|
||||||
GTK_SHADOW_OUT,
|
GTK_SHADOW_OUT,
|
||||||
0, 0,
|
0, 0,
|
||||||
@@ -83,20 +85,20 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( widget->window );
|
GdkGC *gc = gdk_gc_new( myfixed->bin_window );
|
||||||
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
||||||
int x = 2;
|
int x = 2;
|
||||||
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 18;
|
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 18;
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( widget->window, gc, TRUE,
|
gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
|
||||||
x,
|
x,
|
||||||
3,
|
3,
|
||||||
win->m_width - 4 - x,
|
win->m_width - 4 - x,
|
||||||
font->ascent + font->descent+1 );
|
font->ascent + font->descent+1 );
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->white );
|
gdk_gc_set_foreground( gc, &widget->style->white );
|
||||||
gdk_draw_string( widget->window, font, gc,
|
gdk_draw_string( myfixed->bin_window, font, gc,
|
||||||
x+2,
|
x+2,
|
||||||
3+font->ascent,
|
3+font->ascent,
|
||||||
win->m_title.mb_str() );
|
win->m_title.mb_str() );
|
||||||
@@ -115,8 +117,10 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
|
|
||||||
if (!win->m_hasVMT) return;
|
if (!win->m_hasVMT) return;
|
||||||
|
|
||||||
|
GtkMyFixed *myfixed = GTK_MYFIXED(widget);
|
||||||
|
|
||||||
gtk_draw_shadow( widget->style,
|
gtk_draw_shadow( widget->style,
|
||||||
widget->window,
|
myfixed->bin_window,
|
||||||
GTK_STATE_NORMAL,
|
GTK_STATE_NORMAL,
|
||||||
GTK_SHADOW_OUT,
|
GTK_SHADOW_OUT,
|
||||||
0, 0,
|
0, 0,
|
||||||
@@ -127,20 +131,20 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( widget->window );
|
GdkGC *gc = gdk_gc_new( myfixed->bin_window );
|
||||||
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
||||||
int x = 2;
|
int x = 2;
|
||||||
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 17;
|
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 17;
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( widget->window, gc, TRUE,
|
gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
|
||||||
x,
|
x,
|
||||||
3,
|
3,
|
||||||
win->m_width - 4 - x,
|
win->m_width - 4 - x,
|
||||||
font->ascent + font->descent+1 );
|
font->ascent + font->descent+1 );
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->white );
|
gdk_gc_set_foreground( gc, &widget->style->white );
|
||||||
gdk_draw_string( widget->window, font, gc,
|
gdk_draw_string( myfixed->bin_window, font, gc,
|
||||||
x+2,
|
x+2,
|
||||||
3+font->ascent,
|
3+font->ascent,
|
||||||
win->m_title.mb_str() );
|
win->m_title.mb_str() );
|
||||||
|
@@ -67,10 +67,6 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
|
|
||||||
EVT_SIZE(wxRadioBox::OnSize)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxRadioBox::wxRadioBox()
|
wxRadioBox::wxRadioBox()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -161,11 +157,11 @@ wxRadioBox::~wxRadioBox()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBox::OnSize( wxSizeEvent &event )
|
void wxRadioBox::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
||||||
{
|
{
|
||||||
LayoutItems();
|
wxWindow::DoSetSize( x, y, width, height, sizeFlags );
|
||||||
|
|
||||||
event.Skip();
|
LayoutItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxRadioBox::LayoutItems()
|
wxSize wxRadioBox::LayoutItems()
|
||||||
|
@@ -313,6 +313,39 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
|
|
||||||
#endif // GTK_MINOR_VERSION > 0
|
#endif // GTK_MINOR_VERSION > 0
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// "size_allocate"
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
|
||||||
|
{
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
|
if (!win->m_hasVMT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (win->m_sizeSet)
|
||||||
|
return;
|
||||||
|
|
||||||
|
win->m_sizeSet = TRUE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
wxPrintf( "OnSize from " );
|
||||||
|
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
||||||
|
wxPrintf( win->GetClassInfo()->GetClassName() );
|
||||||
|
wxPrintf( " %d %d %d %d\n", (int)alloc->x,
|
||||||
|
(int)alloc->y,
|
||||||
|
(int)alloc->width,
|
||||||
|
(int)alloc->height );
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxSizeEvent event( win->GetSize(), win->GetId() );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// key event conversion routines
|
// key event conversion routines
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -694,6 +727,10 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
|
|||||||
(int)gdk_event->area.height );
|
(int)gdk_event->area.height );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
wxEraseEvent eevent( win->GetId() );
|
||||||
|
eevent.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
wxPaintEvent event( win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
@@ -726,6 +763,10 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
|||||||
(int)rect->height );
|
(int)rect->height );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
wxEraseEvent eevent( win->GetId() );
|
||||||
|
eevent.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
wxPaintEvent event( win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
@@ -1784,6 +1825,7 @@ void wxWindow::Init()
|
|||||||
|
|
||||||
m_isStaticBox = FALSE;
|
m_isStaticBox = FALSE;
|
||||||
m_isRadioButton = FALSE;
|
m_isRadioButton = FALSE;
|
||||||
|
m_isFrame = FALSE;
|
||||||
m_acceptsFocus = FALSE;
|
m_acceptsFocus = FALSE;
|
||||||
|
|
||||||
m_cursor = *wxSTANDARD_CURSOR;
|
m_cursor = *wxSTANDARD_CURSOR;
|
||||||
@@ -2027,6 +2069,13 @@ void wxWindow::PostCreation()
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
|
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
|
||||||
|
|
||||||
|
if (!m_isFrame)
|
||||||
|
{
|
||||||
|
/* frames have their own callback */
|
||||||
|
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
|
||||||
|
}
|
||||||
|
|
||||||
if (m_wxwindow)
|
if (m_wxwindow)
|
||||||
{
|
{
|
||||||
if (!m_noExpose)
|
if (!m_noExpose)
|
||||||
@@ -2115,9 +2164,14 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
|||||||
m_y = y;
|
m_y = y;
|
||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
|
|
||||||
|
m_sizeSet = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int old_width = m_width;
|
||||||
|
int old_height = m_height;
|
||||||
|
|
||||||
GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
|
GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
|
||||||
|
|
||||||
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
|
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
|
||||||
@@ -2166,14 +2220,19 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
|||||||
m_y-border,
|
m_y-border,
|
||||||
m_width+2*border,
|
m_width+2*border,
|
||||||
m_height+border+bottom_border );
|
m_height+border+bottom_border );
|
||||||
|
|
||||||
|
if ((old_width != m_width) ||
|
||||||
|
(old_height != m_height))
|
||||||
|
{
|
||||||
|
m_sizeSet = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sizeSet = TRUE;
|
/*
|
||||||
|
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent( event );
|
GetEventHandler()->ProcessEvent( event );
|
||||||
|
*/
|
||||||
m_resizing = FALSE;
|
m_resizing = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2929,7 +2988,7 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
|
|||||||
(GtkMenuPositionFunc) pop_pos_callback,
|
(GtkMenuPositionFunc) pop_pos_callback,
|
||||||
(gpointer) this, // client data
|
(gpointer) this, // client data
|
||||||
0, // button used to activate it
|
0, // button used to activate it
|
||||||
0 //gs_timeLastClick // the time of activation
|
gs_timeLastClick // the time of activation
|
||||||
);
|
);
|
||||||
|
|
||||||
while (is_waiting)
|
while (is_waiting)
|
||||||
|
@@ -246,6 +246,7 @@ void wxDialog::Init()
|
|||||||
m_returnCode = 0;
|
m_returnCode = 0;
|
||||||
m_sizeSet = FALSE;
|
m_sizeSet = FALSE;
|
||||||
m_modalShowing = FALSE;
|
m_modalShowing = FALSE;
|
||||||
|
m_isFrame = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDialog::wxDialog( wxWindow *parent,
|
wxDialog::wxDialog( wxWindow *parent,
|
||||||
|
@@ -71,10 +71,20 @@ static void gtk_frame_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
if (!win->m_hasVMT) return;
|
if (!win->m_hasVMT)
|
||||||
|
return;
|
||||||
|
|
||||||
if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
|
if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
wxPrintf( "OnSize from " );
|
||||||
|
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
||||||
|
wxPrintf( win->GetClassInfo()->GetClassName() );
|
||||||
|
wxPrintf( " %d %d %d %d\n", (int)alloc->x,
|
||||||
|
(int)alloc->y,
|
||||||
|
(int)alloc->width,
|
||||||
|
(int)alloc->height );
|
||||||
|
*/
|
||||||
win->m_width = alloc->width;
|
win->m_width = alloc->width;
|
||||||
win->m_height = alloc->height;
|
win->m_height = alloc->height;
|
||||||
win->UpdateSize();
|
win->UpdateSize();
|
||||||
@@ -334,6 +344,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
||||||
EVT_SIZE(wxFrame::OnSize)
|
EVT_SIZE(wxFrame::OnSize)
|
||||||
|
EVT_IDLE(wxFrame::OnIdle)
|
||||||
EVT_CLOSE(wxFrame::OnCloseWindow)
|
EVT_CLOSE(wxFrame::OnCloseWindow)
|
||||||
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -356,6 +367,7 @@ void wxFrame::Init()
|
|||||||
m_menuBarDetached = FALSE;
|
m_menuBarDetached = FALSE;
|
||||||
m_toolBarDetached = FALSE;
|
m_toolBarDetached = FALSE;
|
||||||
m_insertInClientArea = TRUE;
|
m_insertInClientArea = TRUE;
|
||||||
|
m_isFrame = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
||||||
@@ -429,6 +441,10 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
|
|
||||||
if (m_parent) m_parent->AddChild( this );
|
if (m_parent) m_parent->AddChild( this );
|
||||||
|
|
||||||
|
/* 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 );
|
||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
/* we cannot set MWM hints and icons before the widget has
|
/* we cannot set MWM hints and icons before the widget has
|
||||||
@@ -436,10 +452,6 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
|
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
|
||||||
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
|
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
|
||||||
|
|
||||||
/* 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 */
|
/* 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_connect( GTK_OBJECT(m_widget), "configure_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
|
||||||
@@ -775,20 +787,23 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
/* we actually set the size of a frame here and no-where else */
|
/* we actually set the size of a frame here and no-where else */
|
||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
|
|
||||||
|
|
||||||
m_sizeSet = TRUE;
|
m_sizeSet = TRUE;
|
||||||
|
|
||||||
/* send size event to frame */
|
// send size event to frame
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent( event );
|
GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
/* send size event to status bar */
|
/*
|
||||||
|
// send size event to status bar
|
||||||
if (m_frameStatusBar)
|
if (m_frameStatusBar)
|
||||||
{
|
{
|
||||||
wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
|
wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
|
||||||
event2.SetEventObject( m_frameStatusBar );
|
event2.SetEventObject( m_frameStatusBar );
|
||||||
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
m_resizing = FALSE;
|
m_resizing = FALSE;
|
||||||
}
|
}
|
||||||
@@ -804,9 +819,14 @@ void wxFrame::MakeModal( bool modal )
|
|||||||
void wxFrame::OnInternalIdle()
|
void wxFrame::OnInternalIdle()
|
||||||
{
|
{
|
||||||
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
|
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
|
||||||
|
{
|
||||||
GtkOnSize( m_x, m_y, m_width, m_height );
|
GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
|
|
||||||
DoMenuUpdates();
|
// we'll come back later
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
|
@@ -71,8 +71,10 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
if (!win->m_hasVMT) return;
|
if (!win->m_hasVMT) return;
|
||||||
if (gdk_event->count > 0) return;
|
if (gdk_event->count > 0) return;
|
||||||
|
|
||||||
|
GtkMyFixed *myfixed = GTK_MYFIXED(widget);
|
||||||
|
|
||||||
gtk_draw_shadow( widget->style,
|
gtk_draw_shadow( widget->style,
|
||||||
widget->window,
|
myfixed->bin_window,
|
||||||
GTK_STATE_NORMAL,
|
GTK_STATE_NORMAL,
|
||||||
GTK_SHADOW_OUT,
|
GTK_SHADOW_OUT,
|
||||||
0, 0,
|
0, 0,
|
||||||
@@ -83,20 +85,20 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( widget->window );
|
GdkGC *gc = gdk_gc_new( myfixed->bin_window );
|
||||||
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
||||||
int x = 2;
|
int x = 2;
|
||||||
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 18;
|
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 18;
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( widget->window, gc, TRUE,
|
gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
|
||||||
x,
|
x,
|
||||||
3,
|
3,
|
||||||
win->m_width - 4 - x,
|
win->m_width - 4 - x,
|
||||||
font->ascent + font->descent+1 );
|
font->ascent + font->descent+1 );
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->white );
|
gdk_gc_set_foreground( gc, &widget->style->white );
|
||||||
gdk_draw_string( widget->window, font, gc,
|
gdk_draw_string( myfixed->bin_window, font, gc,
|
||||||
x+2,
|
x+2,
|
||||||
3+font->ascent,
|
3+font->ascent,
|
||||||
win->m_title.mb_str() );
|
win->m_title.mb_str() );
|
||||||
@@ -115,8 +117,10 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
|
|
||||||
if (!win->m_hasVMT) return;
|
if (!win->m_hasVMT) return;
|
||||||
|
|
||||||
|
GtkMyFixed *myfixed = GTK_MYFIXED(widget);
|
||||||
|
|
||||||
gtk_draw_shadow( widget->style,
|
gtk_draw_shadow( widget->style,
|
||||||
widget->window,
|
myfixed->bin_window,
|
||||||
GTK_STATE_NORMAL,
|
GTK_STATE_NORMAL,
|
||||||
GTK_SHADOW_OUT,
|
GTK_SHADOW_OUT,
|
||||||
0, 0,
|
0, 0,
|
||||||
@@ -127,20 +131,20 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
{
|
{
|
||||||
GdkGC *gc = gdk_gc_new( widget->window );
|
GdkGC *gc = gdk_gc_new( myfixed->bin_window );
|
||||||
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
|
||||||
int x = 2;
|
int x = 2;
|
||||||
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 17;
|
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 17;
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( widget->window, gc, TRUE,
|
gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
|
||||||
x,
|
x,
|
||||||
3,
|
3,
|
||||||
win->m_width - 4 - x,
|
win->m_width - 4 - x,
|
||||||
font->ascent + font->descent+1 );
|
font->ascent + font->descent+1 );
|
||||||
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->white );
|
gdk_gc_set_foreground( gc, &widget->style->white );
|
||||||
gdk_draw_string( widget->window, font, gc,
|
gdk_draw_string( myfixed->bin_window, font, gc,
|
||||||
x+2,
|
x+2,
|
||||||
3+font->ascent,
|
3+font->ascent,
|
||||||
win->m_title.mb_str() );
|
win->m_title.mb_str() );
|
||||||
|
@@ -67,10 +67,6 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
|
|
||||||
EVT_SIZE(wxRadioBox::OnSize)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxRadioBox::wxRadioBox()
|
wxRadioBox::wxRadioBox()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -161,11 +157,11 @@ wxRadioBox::~wxRadioBox()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRadioBox::OnSize( wxSizeEvent &event )
|
void wxRadioBox::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
||||||
{
|
{
|
||||||
LayoutItems();
|
wxWindow::DoSetSize( x, y, width, height, sizeFlags );
|
||||||
|
|
||||||
event.Skip();
|
LayoutItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSize wxRadioBox::LayoutItems()
|
wxSize wxRadioBox::LayoutItems()
|
||||||
|
@@ -313,6 +313,39 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
|
|
||||||
#endif // GTK_MINOR_VERSION > 0
|
#endif // GTK_MINOR_VERSION > 0
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// "size_allocate"
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
|
||||||
|
{
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
|
if (!win->m_hasVMT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (win->m_sizeSet)
|
||||||
|
return;
|
||||||
|
|
||||||
|
win->m_sizeSet = TRUE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
wxPrintf( "OnSize from " );
|
||||||
|
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
|
||||||
|
wxPrintf( win->GetClassInfo()->GetClassName() );
|
||||||
|
wxPrintf( " %d %d %d %d\n", (int)alloc->x,
|
||||||
|
(int)alloc->y,
|
||||||
|
(int)alloc->width,
|
||||||
|
(int)alloc->height );
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxSizeEvent event( win->GetSize(), win->GetId() );
|
||||||
|
event.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// key event conversion routines
|
// key event conversion routines
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -694,6 +727,10 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp
|
|||||||
(int)gdk_event->area.height );
|
(int)gdk_event->area.height );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
wxEraseEvent eevent( win->GetId() );
|
||||||
|
eevent.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
wxPaintEvent event( win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
@@ -726,6 +763,10 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW
|
|||||||
(int)rect->height );
|
(int)rect->height );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
wxEraseEvent eevent( win->GetId() );
|
||||||
|
eevent.SetEventObject( win );
|
||||||
|
win->GetEventHandler()->ProcessEvent(eevent);
|
||||||
|
|
||||||
wxPaintEvent event( win->GetId() );
|
wxPaintEvent event( win->GetId() );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->GetEventHandler()->ProcessEvent( event );
|
win->GetEventHandler()->ProcessEvent( event );
|
||||||
@@ -1784,6 +1825,7 @@ void wxWindow::Init()
|
|||||||
|
|
||||||
m_isStaticBox = FALSE;
|
m_isStaticBox = FALSE;
|
||||||
m_isRadioButton = FALSE;
|
m_isRadioButton = FALSE;
|
||||||
|
m_isFrame = FALSE;
|
||||||
m_acceptsFocus = FALSE;
|
m_acceptsFocus = FALSE;
|
||||||
|
|
||||||
m_cursor = *wxSTANDARD_CURSOR;
|
m_cursor = *wxSTANDARD_CURSOR;
|
||||||
@@ -2027,6 +2069,13 @@ void wxWindow::PostCreation()
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
|
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
|
||||||
|
|
||||||
|
if (!m_isFrame)
|
||||||
|
{
|
||||||
|
/* frames have their own callback */
|
||||||
|
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
|
||||||
|
}
|
||||||
|
|
||||||
if (m_wxwindow)
|
if (m_wxwindow)
|
||||||
{
|
{
|
||||||
if (!m_noExpose)
|
if (!m_noExpose)
|
||||||
@@ -2115,9 +2164,14 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
|||||||
m_y = y;
|
m_y = y;
|
||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
|
|
||||||
|
m_sizeSet = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int old_width = m_width;
|
||||||
|
int old_height = m_height;
|
||||||
|
|
||||||
GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
|
GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
|
||||||
|
|
||||||
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
|
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
|
||||||
@@ -2166,14 +2220,19 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
|||||||
m_y-border,
|
m_y-border,
|
||||||
m_width+2*border,
|
m_width+2*border,
|
||||||
m_height+border+bottom_border );
|
m_height+border+bottom_border );
|
||||||
|
|
||||||
|
if ((old_width != m_width) ||
|
||||||
|
(old_height != m_height))
|
||||||
|
{
|
||||||
|
m_sizeSet = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sizeSet = TRUE;
|
/*
|
||||||
|
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
GetEventHandler()->ProcessEvent( event );
|
GetEventHandler()->ProcessEvent( event );
|
||||||
|
*/
|
||||||
m_resizing = FALSE;
|
m_resizing = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2929,7 +2988,7 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
|
|||||||
(GtkMenuPositionFunc) pop_pos_callback,
|
(GtkMenuPositionFunc) pop_pos_callback,
|
||||||
(gpointer) this, // client data
|
(gpointer) this, // client data
|
||||||
0, // button used to activate it
|
0, // button used to activate it
|
||||||
0 //gs_timeLastClick // the time of activation
|
gs_timeLastClick // the time of activation
|
||||||
);
|
);
|
||||||
|
|
||||||
while (is_waiting)
|
while (is_waiting)
|
||||||
|
@@ -34,6 +34,13 @@ extern "C" {
|
|||||||
|
|
||||||
XVisualInfo *g_vi = (XVisualInfo*) NULL;
|
XVisualInfo *g_vi = (XVisualInfo*) NULL;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// idle system
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
extern void wxapp_install_idle_handler();
|
||||||
|
extern bool g_isIdle;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// wxGLContext
|
// wxGLContext
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -152,6 +159,9 @@ gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
|
|||||||
static void
|
static void
|
||||||
gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win )
|
gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win )
|
||||||
{
|
{
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
win->m_exposed = TRUE;
|
win->m_exposed = TRUE;
|
||||||
|
|
||||||
win->GetUpdateRegion().Union( gdk_event->area.x,
|
win->GetUpdateRegion().Union( gdk_event->area.x,
|
||||||
@@ -167,6 +177,9 @@ gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_e
|
|||||||
static void
|
static void
|
||||||
gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win )
|
gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win )
|
||||||
{
|
{
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
win->m_exposed = TRUE;
|
win->m_exposed = TRUE;
|
||||||
|
|
||||||
win->GetUpdateRegion().Union( rect->x, rect->y,
|
win->GetUpdateRegion().Union( rect->x, rect->y,
|
||||||
@@ -337,4 +350,6 @@ void wxGLCanvas::OnInternalIdle()
|
|||||||
m_exposed = FALSE;
|
m_exposed = FALSE;
|
||||||
GetUpdateRegion().Clear();
|
GetUpdateRegion().Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxWindow::OnInternalIdle();
|
||||||
}
|
}
|
@@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "penguin.h"
|
#include "penguin.h"
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
#include "wx/gtk/win_gtk.h"
|
|
||||||
|
|
||||||
#define VIEW_ASPECT 1.3
|
#define VIEW_ASPECT 1.3
|
||||||
|
|
||||||
@@ -106,14 +105,6 @@ void TestGLCanvas::OnPaint( wxPaintEvent& event )
|
|||||||
if (!GetContext()) return;
|
if (!GetContext()) return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf( "on refresh.\n" );
|
|
||||||
int x,y;
|
|
||||||
GtkMyFixed *fixed = GTK_MYFIXED(m_wxwindow);
|
|
||||||
gdk_window_get_size( m_wxwindow->window, &x, &y );
|
|
||||||
printf( "-> window %d %d.\n", x, y );
|
|
||||||
gdk_window_get_size( fixed->bin_window, &x, &y );
|
|
||||||
printf( "-> bin_window %d %d.\n", x, y );
|
|
||||||
|
|
||||||
SetCurrent();
|
SetCurrent();
|
||||||
|
|
||||||
/* initialize OpenGL */
|
/* initialize OpenGL */
|
||||||
@@ -155,8 +146,6 @@ void TestGLCanvas::OnSize(wxSizeEvent& event)
|
|||||||
int width, height;
|
int width, height;
|
||||||
GetClientSize(& width, & height);
|
GetClientSize(& width, & height);
|
||||||
|
|
||||||
printf( "onsize %d %d.\n", width, height );
|
|
||||||
|
|
||||||
#ifndef __WXMOTIF__
|
#ifndef __WXMOTIF__
|
||||||
if (GetContext())
|
if (GetContext())
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user