fix for casting from GtkScrolledWindow to GtkWindow: don't call
gtk_window_set_geometry_hints for MDI children git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -739,22 +739,21 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
|
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_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
|
||||||
|
|
||||||
/* set size hints */
|
|
||||||
gint flag = 0; // GDK_HINT_POS;
|
|
||||||
if ((m_minWidth != -1) || (m_minHeight != -1)) flag |= GDK_HINT_MIN_SIZE;
|
|
||||||
if ((m_maxWidth != -1) || (m_maxHeight != -1)) flag |= GDK_HINT_MAX_SIZE;
|
|
||||||
GdkGeometry geom;
|
|
||||||
geom.min_width = m_minWidth;
|
|
||||||
geom.min_height = m_minHeight;
|
|
||||||
geom.max_width = m_maxWidth;
|
|
||||||
geom.max_height = m_maxHeight;
|
|
||||||
gtk_window_set_geometry_hints( GTK_WINDOW(m_widget),
|
|
||||||
(GtkWidget*) NULL,
|
|
||||||
&geom,
|
|
||||||
(GdkWindowHints) flag );
|
|
||||||
|
|
||||||
if (m_mainWidget)
|
if (m_mainWidget)
|
||||||
{
|
{
|
||||||
|
/* set size hints */
|
||||||
|
gint flag = 0; // GDK_HINT_POS;
|
||||||
|
if ((m_minWidth != -1) || (m_minHeight != -1)) flag |= GDK_HINT_MIN_SIZE;
|
||||||
|
if ((m_maxWidth != -1) || (m_maxHeight != -1)) flag |= GDK_HINT_MAX_SIZE;
|
||||||
|
GdkGeometry geom;
|
||||||
|
geom.min_width = m_minWidth;
|
||||||
|
geom.min_height = m_minHeight;
|
||||||
|
geom.max_width = m_maxWidth;
|
||||||
|
geom.max_height = m_maxHeight;
|
||||||
|
gtk_window_set_geometry_hints( GTK_WINDOW(m_widget),
|
||||||
|
(GtkWidget*) NULL,
|
||||||
|
&geom,
|
||||||
|
(GdkWindowHints) flag );
|
||||||
|
|
||||||
/* I revert back to wxGTK's original behaviour. m_mainWidget holds the
|
/* I revert back to wxGTK's original behaviour. m_mainWidget holds the
|
||||||
* menubar, the toolbar and the client area, which is represented by
|
* menubar, the toolbar and the client area, which is represented by
|
||||||
|
@@ -50,8 +50,8 @@ extern wxList wxPendingDelete;
|
|||||||
static void
|
static void
|
||||||
gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||||
GtkNotebookPage *page,
|
GtkNotebookPage *page,
|
||||||
gint WXUNUSED(page_num),
|
gint WXUNUSED(page_num),
|
||||||
wxMDIParentFrame *parent )
|
wxMDIParentFrame *parent )
|
||||||
{
|
{
|
||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
@@ -79,10 +79,10 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
|||||||
{
|
{
|
||||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||||
if (child_frame->m_page == page)
|
if (child_frame->m_page == page)
|
||||||
{
|
{
|
||||||
child = child_frame;
|
child = child_frame;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,29 +180,29 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||||
wxMenuBar *menu_bar = child_frame->m_menuBar;
|
wxMenuBar *menu_bar = child_frame->m_menuBar;
|
||||||
if (child_frame->m_menuBar)
|
if (child_frame->m_menuBar)
|
||||||
{
|
{
|
||||||
if (child_frame == active_child_frame)
|
if (child_frame == active_child_frame)
|
||||||
{
|
{
|
||||||
if (menu_bar->Show(TRUE))
|
if (menu_bar->Show(TRUE))
|
||||||
{
|
{
|
||||||
menu_bar->m_width = m_width;
|
menu_bar->m_width = m_width;
|
||||||
menu_bar->m_height = wxMENU_HEIGHT;
|
menu_bar->m_height = wxMENU_HEIGHT;
|
||||||
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
||||||
menu_bar->m_widget,
|
menu_bar->m_widget,
|
||||||
0, 0, m_width, wxMENU_HEIGHT );
|
0, 0, m_width, wxMENU_HEIGHT );
|
||||||
menu_bar->SetInvokingWindow( child_frame );
|
menu_bar->SetInvokingWindow( child_frame );
|
||||||
}
|
}
|
||||||
visible_child_menu = TRUE;
|
visible_child_menu = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (menu_bar->Show(FALSE))
|
if (menu_bar->Show(FALSE))
|
||||||
{
|
{
|
||||||
menu_bar->UnsetInvokingWindow( child_frame );
|
menu_bar->UnsetInvokingWindow( child_frame );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
@@ -212,21 +212,21 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
(m_frameMenuBar->IsShown() == visible_child_menu))
|
(m_frameMenuBar->IsShown() == visible_child_menu))
|
||||||
{
|
{
|
||||||
if (visible_child_menu)
|
if (visible_child_menu)
|
||||||
{
|
{
|
||||||
m_frameMenuBar->Show( FALSE );
|
m_frameMenuBar->Show( FALSE );
|
||||||
m_frameMenuBar->UnsetInvokingWindow( this );
|
m_frameMenuBar->UnsetInvokingWindow( this );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_frameMenuBar->Show( TRUE );
|
m_frameMenuBar->Show( TRUE );
|
||||||
m_frameMenuBar->SetInvokingWindow( this );
|
m_frameMenuBar->SetInvokingWindow( this );
|
||||||
|
|
||||||
m_frameMenuBar->m_width = m_width;
|
m_frameMenuBar->m_width = m_width;
|
||||||
m_frameMenuBar->m_height = wxMENU_HEIGHT;
|
m_frameMenuBar->m_height = wxMENU_HEIGHT;
|
||||||
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
||||||
m_frameMenuBar->m_widget,
|
m_frameMenuBar->m_widget,
|
||||||
0, 0, m_width, wxMENU_HEIGHT );
|
0, 0, m_width, wxMENU_HEIGHT );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,7 +464,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
|||||||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
|
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
|
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_widget = gtk_notebook_new();
|
m_widget = gtk_notebook_new();
|
||||||
@@ -483,4 +483,4 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // wxUSE_MDI_ARCHITECTURE
|
||||||
|
@@ -739,22 +739,21 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
|
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_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
|
||||||
|
|
||||||
/* set size hints */
|
|
||||||
gint flag = 0; // GDK_HINT_POS;
|
|
||||||
if ((m_minWidth != -1) || (m_minHeight != -1)) flag |= GDK_HINT_MIN_SIZE;
|
|
||||||
if ((m_maxWidth != -1) || (m_maxHeight != -1)) flag |= GDK_HINT_MAX_SIZE;
|
|
||||||
GdkGeometry geom;
|
|
||||||
geom.min_width = m_minWidth;
|
|
||||||
geom.min_height = m_minHeight;
|
|
||||||
geom.max_width = m_maxWidth;
|
|
||||||
geom.max_height = m_maxHeight;
|
|
||||||
gtk_window_set_geometry_hints( GTK_WINDOW(m_widget),
|
|
||||||
(GtkWidget*) NULL,
|
|
||||||
&geom,
|
|
||||||
(GdkWindowHints) flag );
|
|
||||||
|
|
||||||
if (m_mainWidget)
|
if (m_mainWidget)
|
||||||
{
|
{
|
||||||
|
/* set size hints */
|
||||||
|
gint flag = 0; // GDK_HINT_POS;
|
||||||
|
if ((m_minWidth != -1) || (m_minHeight != -1)) flag |= GDK_HINT_MIN_SIZE;
|
||||||
|
if ((m_maxWidth != -1) || (m_maxHeight != -1)) flag |= GDK_HINT_MAX_SIZE;
|
||||||
|
GdkGeometry geom;
|
||||||
|
geom.min_width = m_minWidth;
|
||||||
|
geom.min_height = m_minHeight;
|
||||||
|
geom.max_width = m_maxWidth;
|
||||||
|
geom.max_height = m_maxHeight;
|
||||||
|
gtk_window_set_geometry_hints( GTK_WINDOW(m_widget),
|
||||||
|
(GtkWidget*) NULL,
|
||||||
|
&geom,
|
||||||
|
(GdkWindowHints) flag );
|
||||||
|
|
||||||
/* I revert back to wxGTK's original behaviour. m_mainWidget holds the
|
/* I revert back to wxGTK's original behaviour. m_mainWidget holds the
|
||||||
* menubar, the toolbar and the client area, which is represented by
|
* menubar, the toolbar and the client area, which is represented by
|
||||||
|
@@ -50,8 +50,8 @@ extern wxList wxPendingDelete;
|
|||||||
static void
|
static void
|
||||||
gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||||
GtkNotebookPage *page,
|
GtkNotebookPage *page,
|
||||||
gint WXUNUSED(page_num),
|
gint WXUNUSED(page_num),
|
||||||
wxMDIParentFrame *parent )
|
wxMDIParentFrame *parent )
|
||||||
{
|
{
|
||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
@@ -79,10 +79,10 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
|||||||
{
|
{
|
||||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||||
if (child_frame->m_page == page)
|
if (child_frame->m_page == page)
|
||||||
{
|
{
|
||||||
child = child_frame;
|
child = child_frame;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,29 +180,29 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
wxMDIChildFrame *child_frame = (wxMDIChildFrame *)node->Data();
|
||||||
wxMenuBar *menu_bar = child_frame->m_menuBar;
|
wxMenuBar *menu_bar = child_frame->m_menuBar;
|
||||||
if (child_frame->m_menuBar)
|
if (child_frame->m_menuBar)
|
||||||
{
|
{
|
||||||
if (child_frame == active_child_frame)
|
if (child_frame == active_child_frame)
|
||||||
{
|
{
|
||||||
if (menu_bar->Show(TRUE))
|
if (menu_bar->Show(TRUE))
|
||||||
{
|
{
|
||||||
menu_bar->m_width = m_width;
|
menu_bar->m_width = m_width;
|
||||||
menu_bar->m_height = wxMENU_HEIGHT;
|
menu_bar->m_height = wxMENU_HEIGHT;
|
||||||
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
||||||
menu_bar->m_widget,
|
menu_bar->m_widget,
|
||||||
0, 0, m_width, wxMENU_HEIGHT );
|
0, 0, m_width, wxMENU_HEIGHT );
|
||||||
menu_bar->SetInvokingWindow( child_frame );
|
menu_bar->SetInvokingWindow( child_frame );
|
||||||
}
|
}
|
||||||
visible_child_menu = TRUE;
|
visible_child_menu = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (menu_bar->Show(FALSE))
|
if (menu_bar->Show(FALSE))
|
||||||
{
|
{
|
||||||
menu_bar->UnsetInvokingWindow( child_frame );
|
menu_bar->UnsetInvokingWindow( child_frame );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
@@ -212,21 +212,21 @@ void wxMDIParentFrame::OnInternalIdle()
|
|||||||
(m_frameMenuBar->IsShown() == visible_child_menu))
|
(m_frameMenuBar->IsShown() == visible_child_menu))
|
||||||
{
|
{
|
||||||
if (visible_child_menu)
|
if (visible_child_menu)
|
||||||
{
|
{
|
||||||
m_frameMenuBar->Show( FALSE );
|
m_frameMenuBar->Show( FALSE );
|
||||||
m_frameMenuBar->UnsetInvokingWindow( this );
|
m_frameMenuBar->UnsetInvokingWindow( this );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_frameMenuBar->Show( TRUE );
|
m_frameMenuBar->Show( TRUE );
|
||||||
m_frameMenuBar->SetInvokingWindow( this );
|
m_frameMenuBar->SetInvokingWindow( this );
|
||||||
|
|
||||||
m_frameMenuBar->m_width = m_width;
|
m_frameMenuBar->m_width = m_width;
|
||||||
m_frameMenuBar->m_height = wxMENU_HEIGHT;
|
m_frameMenuBar->m_height = wxMENU_HEIGHT;
|
||||||
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
|
||||||
m_frameMenuBar->m_widget,
|
m_frameMenuBar->m_widget,
|
||||||
0, 0, m_width, wxMENU_HEIGHT );
|
0, 0, m_width, wxMENU_HEIGHT );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,7 +464,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
|||||||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
|
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
|
wxFAIL_MSG( wxT("wxMDIClientWindow creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_widget = gtk_notebook_new();
|
m_widget = gtk_notebook_new();
|
||||||
@@ -483,4 +483,4 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // wxUSE_MDI_ARCHITECTURE
|
||||||
|
Reference in New Issue
Block a user