Restored wxSizeEvent code form last week -> wxGLCanvas
probably broken again. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -60,7 +60,7 @@ public:
|
|||||||
bool Destroy();
|
bool Destroy();
|
||||||
|
|
||||||
virtual bool Show( bool show );
|
virtual bool Show( bool show );
|
||||||
virtual void Centre( int direction = wxHORIZONTAL );
|
virtual void Centre( int direction = wxBOTH );
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
||||||
|
@@ -60,7 +60,7 @@ public:
|
|||||||
bool Destroy();
|
bool Destroy();
|
||||||
|
|
||||||
virtual bool Show( bool show );
|
virtual bool Show( bool show );
|
||||||
virtual void Centre( int direction = wxHORIZONTAL );
|
virtual void Centre( int direction = wxBOTH );
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
||||||
|
@@ -112,6 +112,7 @@ void MyApp::InitTabView(wxNotebook* notebook, wxPanel* window)
|
|||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
5, animals,
|
5, animals,
|
||||||
2, wxRA_SPECIFY_ROWS);
|
2, wxRA_SPECIFY_ROWS);
|
||||||
|
|
||||||
c = new wxLayoutConstraints;
|
c = new wxLayoutConstraints;
|
||||||
c->left.SameAs(radiobox, wxLeft);
|
c->left.SameAs(radiobox, wxLeft);
|
||||||
c->height.AsIs();
|
c->height.AsIs();
|
||||||
|
@@ -795,7 +795,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
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)
|
||||||
{
|
{
|
||||||
@@ -803,7 +802,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
event2.SetEventObject( m_frameStatusBar );
|
event2.SetEventObject( m_frameStatusBar );
|
||||||
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
m_resizing = FALSE;
|
m_resizing = FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -124,7 +124,28 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
|
|||||||
|
|
||||||
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
|
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
|
||||||
|
|
||||||
if (win->GetAutoLayout()) win->Layout();
|
if (win->GetAutoLayout())
|
||||||
|
{
|
||||||
|
win->Layout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// "realize" from m_widget
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize
|
||||||
|
here in order to take repositioning before showing to take effect. */
|
||||||
|
|
||||||
|
static gint
|
||||||
|
gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
|
||||||
|
{
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
|
gtk_widget_queue_resize( win->m_widget );
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -213,6 +234,9 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_notebook_realized_callback), (gpointer) this );
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -393,7 +393,7 @@ gtk_myfixed_set_size (GtkMyFixed *myfixed,
|
|||||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
|
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
|
||||||
gtk_widget_queue_resize (widget);
|
gtk_widget_queue_resize (widget);
|
||||||
|
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -602,16 +602,6 @@ gtk_myfixed_size_allocate (GtkWidget *widget,
|
|||||||
|
|
||||||
myfixed = GTK_MYFIXED (widget);
|
myfixed = GTK_MYFIXED (widget);
|
||||||
|
|
||||||
children = myfixed->children;
|
|
||||||
while (children)
|
|
||||||
{
|
|
||||||
child = children->data;
|
|
||||||
children = children->next;
|
|
||||||
|
|
||||||
gtk_myfixed_position_child (myfixed, child);
|
|
||||||
gtk_myfixed_allocate_child (myfixed, child);
|
|
||||||
}
|
|
||||||
|
|
||||||
widget->allocation = *allocation;
|
widget->allocation = *allocation;
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
|
if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
|
||||||
@@ -632,6 +622,16 @@ gtk_myfixed_size_allocate (GtkWidget *widget,
|
|||||||
gdk_window_move_resize( widget->window, x, y, w, h );
|
gdk_window_move_resize( widget->window, x, y, w, h );
|
||||||
gdk_window_move_resize( myfixed->bin_window, 0, 0, w, h );
|
gdk_window_move_resize( myfixed->bin_window, 0, 0, w, h );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
children = myfixed->children;
|
||||||
|
while (children)
|
||||||
|
{
|
||||||
|
child = children->data;
|
||||||
|
children = children->next;
|
||||||
|
|
||||||
|
gtk_myfixed_position_child (myfixed, child);
|
||||||
|
gtk_myfixed_allocate_child (myfixed, child);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -666,56 +666,6 @@ gtk_myfixed_draw (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
static void
|
|
||||||
gtk_myfixed_draw_border (GtkMyFixed *myfixed)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = GTK_WIDGET(myfixed);
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_OUT)
|
|
||||||
{
|
|
||||||
gtk_draw_shadow( widget->style,
|
|
||||||
widget->window,
|
|
||||||
GTK_STATE_NORMAL,
|
|
||||||
GTK_SHADOW_OUT,
|
|
||||||
0, 0,
|
|
||||||
widget->allocation.width,
|
|
||||||
widget->allocation.height );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_IN)
|
|
||||||
{
|
|
||||||
gtk_draw_shadow( widget->style,
|
|
||||||
widget->window,
|
|
||||||
GTK_STATE_NORMAL,
|
|
||||||
GTK_SHADOW_IN,
|
|
||||||
0, 0,
|
|
||||||
widget->allocation.width,
|
|
||||||
widget->allocation.height );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_THIN)
|
|
||||||
{
|
|
||||||
GdkGC *gc;
|
|
||||||
gc = gdk_gc_new( widget->window );
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->black );
|
|
||||||
gdk_draw_rectangle( widget->window, gc, FALSE,
|
|
||||||
0, 0,
|
|
||||||
widget->allocation.width-1,
|
|
||||||
widget->allocation.height-1 );
|
|
||||||
gdk_gc_unref( gc );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
gtk_myfixed_expose (GtkWidget *widget,
|
gtk_myfixed_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *event)
|
GdkEventExpose *event)
|
||||||
@@ -820,23 +770,23 @@ gtk_myfixed_forall (GtkContainer *container,
|
|||||||
GtkCallback callback,
|
GtkCallback callback,
|
||||||
gpointer callback_data)
|
gpointer callback_data)
|
||||||
{
|
{
|
||||||
GtkMyFixed *myfixed;
|
GtkMyFixed *myfixed;
|
||||||
GtkMyFixedChild *child;
|
GtkMyFixedChild *child;
|
||||||
GList *children;
|
GList *children;
|
||||||
|
|
||||||
g_return_if_fail (container != NULL);
|
g_return_if_fail (container != NULL);
|
||||||
g_return_if_fail (GTK_IS_MYFIXED (container));
|
g_return_if_fail (GTK_IS_MYFIXED (container));
|
||||||
g_return_if_fail (callback != NULL);
|
g_return_if_fail (callback != NULL);
|
||||||
|
|
||||||
myfixed = GTK_MYFIXED (container);
|
myfixed = GTK_MYFIXED (container);
|
||||||
|
|
||||||
children = myfixed->children;
|
children = myfixed->children;
|
||||||
while (children)
|
while (children)
|
||||||
{
|
{
|
||||||
child = children->data;
|
child = children->data;
|
||||||
children = children->next;
|
children = children->next;
|
||||||
|
|
||||||
(* callback) (child->widget, callback_data);
|
(* callback) (child->widget, callback_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,31 +798,31 @@ static void
|
|||||||
gtk_myfixed_position_child (GtkMyFixed *myfixed,
|
gtk_myfixed_position_child (GtkMyFixed *myfixed,
|
||||||
GtkMyFixedChild *child)
|
GtkMyFixedChild *child)
|
||||||
{
|
{
|
||||||
gint x;
|
gint x;
|
||||||
gint y;
|
gint y;
|
||||||
|
|
||||||
x = child->x - myfixed->xoffset;
|
x = child->x - myfixed->xoffset;
|
||||||
y = child->y - myfixed->yoffset;
|
y = child->y - myfixed->yoffset;
|
||||||
|
|
||||||
if (IS_ONSCREEN (x,y))
|
if (IS_ONSCREEN (x,y))
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_MAPPED (myfixed) &&
|
if (GTK_WIDGET_MAPPED (myfixed) &&
|
||||||
GTK_WIDGET_VISIBLE (child->widget))
|
GTK_WIDGET_VISIBLE (child->widget))
|
||||||
{
|
{
|
||||||
if (!GTK_WIDGET_MAPPED (child->widget))
|
if (!GTK_WIDGET_MAPPED (child->widget))
|
||||||
gtk_widget_map (child->widget);
|
gtk_widget_map (child->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
||||||
GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
||||||
GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
||||||
|
|
||||||
if (GTK_WIDGET_MAPPED (child->widget))
|
if (GTK_WIDGET_MAPPED (child->widget))
|
||||||
gtk_widget_unmap (child->widget);
|
gtk_widget_unmap (child->widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -880,30 +830,30 @@ static void
|
|||||||
gtk_myfixed_allocate_child (GtkMyFixed *myfixed,
|
gtk_myfixed_allocate_child (GtkMyFixed *myfixed,
|
||||||
GtkMyFixedChild *child)
|
GtkMyFixedChild *child)
|
||||||
{
|
{
|
||||||
GtkAllocation allocation;
|
GtkAllocation allocation;
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
|
|
||||||
allocation.x = child->x - myfixed->xoffset;
|
allocation.x = child->x - myfixed->xoffset;
|
||||||
allocation.y = child->y - myfixed->yoffset;
|
allocation.y = child->y - myfixed->yoffset;
|
||||||
gtk_widget_get_child_requisition (child->widget, &requisition);
|
gtk_widget_get_child_requisition (child->widget, &requisition);
|
||||||
allocation.width = requisition.width;
|
allocation.width = requisition.width;
|
||||||
allocation.height = requisition.height;
|
allocation.height = requisition.height;
|
||||||
|
|
||||||
gtk_widget_size_allocate (child->widget, &allocation);
|
gtk_widget_size_allocate (child->widget, &allocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_myfixed_position_children (GtkMyFixed *myfixed)
|
gtk_myfixed_position_children (GtkMyFixed *myfixed)
|
||||||
{
|
{
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
|
|
||||||
tmp_list = myfixed->children;
|
tmp_list = myfixed->children;
|
||||||
while (tmp_list)
|
while (tmp_list)
|
||||||
{
|
{
|
||||||
GtkMyFixedChild *child = tmp_list->data;
|
GtkMyFixedChild *child = tmp_list->data;
|
||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
gtk_myfixed_position_child (myfixed, child);
|
gtk_myfixed_position_child (myfixed, child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,16 +861,17 @@ static void
|
|||||||
gtk_myfixed_adjust_allocations_recurse (GtkWidget *widget,
|
gtk_myfixed_adjust_allocations_recurse (GtkWidget *widget,
|
||||||
gpointer cb_data)
|
gpointer cb_data)
|
||||||
{
|
{
|
||||||
GtkMyFixedAdjData *data = cb_data;
|
GtkMyFixedAdjData *data = cb_data;
|
||||||
|
|
||||||
widget->allocation.x += data->dx;
|
widget->allocation.x += data->dx;
|
||||||
widget->allocation.y += data->dy;
|
widget->allocation.y += data->dy;
|
||||||
|
|
||||||
if (GTK_WIDGET_NO_WINDOW (widget) &&
|
if (GTK_WIDGET_NO_WINDOW (widget) && GTK_IS_CONTAINER (widget))
|
||||||
GTK_IS_CONTAINER (widget))
|
{
|
||||||
gtk_container_forall (GTK_CONTAINER (widget),
|
gtk_container_forall (GTK_CONTAINER (widget),
|
||||||
gtk_myfixed_adjust_allocations_recurse,
|
gtk_myfixed_adjust_allocations_recurse,
|
||||||
cb_data);
|
cb_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -313,39 +313,6 @@ 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
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -2069,13 +2036,6 @@ 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)
|
||||||
@@ -2164,14 +2124,9 @@ 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)
|
||||||
@@ -2220,19 +2175,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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
wxPrintf( "OnSize sent from " );
|
||||||
|
if (GetClassInfo() && GetClassInfo()->GetClassName())
|
||||||
|
wxPrintf( GetClassInfo()->GetClassName() );
|
||||||
|
wxPrintf( " %d %d %d %d\n", (int)m_x, (int)m_y, (int)m_width, (int)m_height );
|
||||||
|
*/
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -795,7 +795,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
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)
|
||||||
{
|
{
|
||||||
@@ -803,7 +802,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
|
|||||||
event2.SetEventObject( m_frameStatusBar );
|
event2.SetEventObject( m_frameStatusBar );
|
||||||
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
m_resizing = FALSE;
|
m_resizing = FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -124,7 +124,28 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
|
|||||||
|
|
||||||
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
|
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
|
||||||
|
|
||||||
if (win->GetAutoLayout()) win->Layout();
|
if (win->GetAutoLayout())
|
||||||
|
{
|
||||||
|
win->Layout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// "realize" from m_widget
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize
|
||||||
|
here in order to take repositioning before showing to take effect. */
|
||||||
|
|
||||||
|
static gint
|
||||||
|
gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
|
||||||
|
{
|
||||||
|
if (g_isIdle)
|
||||||
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
|
gtk_widget_queue_resize( win->m_widget );
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -213,6 +234,9 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_notebook_realized_callback), (gpointer) this );
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -393,7 +393,7 @@ gtk_myfixed_set_size (GtkMyFixed *myfixed,
|
|||||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
|
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
|
||||||
gtk_widget_queue_resize (widget);
|
gtk_widget_queue_resize (widget);
|
||||||
|
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -602,16 +602,6 @@ gtk_myfixed_size_allocate (GtkWidget *widget,
|
|||||||
|
|
||||||
myfixed = GTK_MYFIXED (widget);
|
myfixed = GTK_MYFIXED (widget);
|
||||||
|
|
||||||
children = myfixed->children;
|
|
||||||
while (children)
|
|
||||||
{
|
|
||||||
child = children->data;
|
|
||||||
children = children->next;
|
|
||||||
|
|
||||||
gtk_myfixed_position_child (myfixed, child);
|
|
||||||
gtk_myfixed_allocate_child (myfixed, child);
|
|
||||||
}
|
|
||||||
|
|
||||||
widget->allocation = *allocation;
|
widget->allocation = *allocation;
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
|
if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
|
||||||
@@ -632,6 +622,16 @@ gtk_myfixed_size_allocate (GtkWidget *widget,
|
|||||||
gdk_window_move_resize( widget->window, x, y, w, h );
|
gdk_window_move_resize( widget->window, x, y, w, h );
|
||||||
gdk_window_move_resize( myfixed->bin_window, 0, 0, w, h );
|
gdk_window_move_resize( myfixed->bin_window, 0, 0, w, h );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
children = myfixed->children;
|
||||||
|
while (children)
|
||||||
|
{
|
||||||
|
child = children->data;
|
||||||
|
children = children->next;
|
||||||
|
|
||||||
|
gtk_myfixed_position_child (myfixed, child);
|
||||||
|
gtk_myfixed_allocate_child (myfixed, child);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -666,56 +666,6 @@ gtk_myfixed_draw (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
static void
|
|
||||||
gtk_myfixed_draw_border (GtkMyFixed *myfixed)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = GTK_WIDGET(myfixed);
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_OUT)
|
|
||||||
{
|
|
||||||
gtk_draw_shadow( widget->style,
|
|
||||||
widget->window,
|
|
||||||
GTK_STATE_NORMAL,
|
|
||||||
GTK_SHADOW_OUT,
|
|
||||||
0, 0,
|
|
||||||
widget->allocation.width,
|
|
||||||
widget->allocation.height );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_IN)
|
|
||||||
{
|
|
||||||
gtk_draw_shadow( widget->style,
|
|
||||||
widget->window,
|
|
||||||
GTK_STATE_NORMAL,
|
|
||||||
GTK_SHADOW_IN,
|
|
||||||
0, 0,
|
|
||||||
widget->allocation.width,
|
|
||||||
widget->allocation.height );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (myfixed->shadow_type == GTK_MYSHADOW_THIN)
|
|
||||||
{
|
|
||||||
GdkGC *gc;
|
|
||||||
gc = gdk_gc_new( widget->window );
|
|
||||||
gdk_gc_set_foreground( gc, &widget->style->black );
|
|
||||||
gdk_draw_rectangle( widget->window, gc, FALSE,
|
|
||||||
0, 0,
|
|
||||||
widget->allocation.width-1,
|
|
||||||
widget->allocation.height-1 );
|
|
||||||
gdk_gc_unref( gc );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
gtk_myfixed_expose (GtkWidget *widget,
|
gtk_myfixed_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *event)
|
GdkEventExpose *event)
|
||||||
@@ -820,23 +770,23 @@ gtk_myfixed_forall (GtkContainer *container,
|
|||||||
GtkCallback callback,
|
GtkCallback callback,
|
||||||
gpointer callback_data)
|
gpointer callback_data)
|
||||||
{
|
{
|
||||||
GtkMyFixed *myfixed;
|
GtkMyFixed *myfixed;
|
||||||
GtkMyFixedChild *child;
|
GtkMyFixedChild *child;
|
||||||
GList *children;
|
GList *children;
|
||||||
|
|
||||||
g_return_if_fail (container != NULL);
|
g_return_if_fail (container != NULL);
|
||||||
g_return_if_fail (GTK_IS_MYFIXED (container));
|
g_return_if_fail (GTK_IS_MYFIXED (container));
|
||||||
g_return_if_fail (callback != NULL);
|
g_return_if_fail (callback != NULL);
|
||||||
|
|
||||||
myfixed = GTK_MYFIXED (container);
|
myfixed = GTK_MYFIXED (container);
|
||||||
|
|
||||||
children = myfixed->children;
|
children = myfixed->children;
|
||||||
while (children)
|
while (children)
|
||||||
{
|
{
|
||||||
child = children->data;
|
child = children->data;
|
||||||
children = children->next;
|
children = children->next;
|
||||||
|
|
||||||
(* callback) (child->widget, callback_data);
|
(* callback) (child->widget, callback_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,31 +798,31 @@ static void
|
|||||||
gtk_myfixed_position_child (GtkMyFixed *myfixed,
|
gtk_myfixed_position_child (GtkMyFixed *myfixed,
|
||||||
GtkMyFixedChild *child)
|
GtkMyFixedChild *child)
|
||||||
{
|
{
|
||||||
gint x;
|
gint x;
|
||||||
gint y;
|
gint y;
|
||||||
|
|
||||||
x = child->x - myfixed->xoffset;
|
x = child->x - myfixed->xoffset;
|
||||||
y = child->y - myfixed->yoffset;
|
y = child->y - myfixed->yoffset;
|
||||||
|
|
||||||
if (IS_ONSCREEN (x,y))
|
if (IS_ONSCREEN (x,y))
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_MAPPED (myfixed) &&
|
if (GTK_WIDGET_MAPPED (myfixed) &&
|
||||||
GTK_WIDGET_VISIBLE (child->widget))
|
GTK_WIDGET_VISIBLE (child->widget))
|
||||||
{
|
{
|
||||||
if (!GTK_WIDGET_MAPPED (child->widget))
|
if (!GTK_WIDGET_MAPPED (child->widget))
|
||||||
gtk_widget_map (child->widget);
|
gtk_widget_map (child->widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
||||||
GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
|
||||||
GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
|
||||||
|
|
||||||
if (GTK_WIDGET_MAPPED (child->widget))
|
if (GTK_WIDGET_MAPPED (child->widget))
|
||||||
gtk_widget_unmap (child->widget);
|
gtk_widget_unmap (child->widget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -880,30 +830,30 @@ static void
|
|||||||
gtk_myfixed_allocate_child (GtkMyFixed *myfixed,
|
gtk_myfixed_allocate_child (GtkMyFixed *myfixed,
|
||||||
GtkMyFixedChild *child)
|
GtkMyFixedChild *child)
|
||||||
{
|
{
|
||||||
GtkAllocation allocation;
|
GtkAllocation allocation;
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
|
|
||||||
allocation.x = child->x - myfixed->xoffset;
|
allocation.x = child->x - myfixed->xoffset;
|
||||||
allocation.y = child->y - myfixed->yoffset;
|
allocation.y = child->y - myfixed->yoffset;
|
||||||
gtk_widget_get_child_requisition (child->widget, &requisition);
|
gtk_widget_get_child_requisition (child->widget, &requisition);
|
||||||
allocation.width = requisition.width;
|
allocation.width = requisition.width;
|
||||||
allocation.height = requisition.height;
|
allocation.height = requisition.height;
|
||||||
|
|
||||||
gtk_widget_size_allocate (child->widget, &allocation);
|
gtk_widget_size_allocate (child->widget, &allocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_myfixed_position_children (GtkMyFixed *myfixed)
|
gtk_myfixed_position_children (GtkMyFixed *myfixed)
|
||||||
{
|
{
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
|
|
||||||
tmp_list = myfixed->children;
|
tmp_list = myfixed->children;
|
||||||
while (tmp_list)
|
while (tmp_list)
|
||||||
{
|
{
|
||||||
GtkMyFixedChild *child = tmp_list->data;
|
GtkMyFixedChild *child = tmp_list->data;
|
||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
gtk_myfixed_position_child (myfixed, child);
|
gtk_myfixed_position_child (myfixed, child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,16 +861,17 @@ static void
|
|||||||
gtk_myfixed_adjust_allocations_recurse (GtkWidget *widget,
|
gtk_myfixed_adjust_allocations_recurse (GtkWidget *widget,
|
||||||
gpointer cb_data)
|
gpointer cb_data)
|
||||||
{
|
{
|
||||||
GtkMyFixedAdjData *data = cb_data;
|
GtkMyFixedAdjData *data = cb_data;
|
||||||
|
|
||||||
widget->allocation.x += data->dx;
|
widget->allocation.x += data->dx;
|
||||||
widget->allocation.y += data->dy;
|
widget->allocation.y += data->dy;
|
||||||
|
|
||||||
if (GTK_WIDGET_NO_WINDOW (widget) &&
|
if (GTK_WIDGET_NO_WINDOW (widget) && GTK_IS_CONTAINER (widget))
|
||||||
GTK_IS_CONTAINER (widget))
|
{
|
||||||
gtk_container_forall (GTK_CONTAINER (widget),
|
gtk_container_forall (GTK_CONTAINER (widget),
|
||||||
gtk_myfixed_adjust_allocations_recurse,
|
gtk_myfixed_adjust_allocations_recurse,
|
||||||
cb_data);
|
cb_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -313,39 +313,6 @@ 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
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -2069,13 +2036,6 @@ 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)
|
||||||
@@ -2164,14 +2124,9 @@ 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)
|
||||||
@@ -2220,19 +2175,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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
wxPrintf( "OnSize sent from " );
|
||||||
|
if (GetClassInfo() && GetClassInfo()->GetClassName())
|
||||||
|
wxPrintf( GetClassInfo()->GetClassName() );
|
||||||
|
wxPrintf( " %d %d %d %d\n", (int)m_x, (int)m_y, (int)m_width, (int)m_height );
|
||||||
|
*/
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user