Added IsTopLevel() as a virtual function.

Added fontenum.hto filelist.txt,
  Changed window positioning code again,
  some more related things.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-11-05 15:54:10 +00:00
parent 2bc1aa1174
commit 8487f88742
25 changed files with 151 additions and 143 deletions

View File

@@ -118,13 +118,10 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
if (g_isIdle)
wxapp_install_idle_handler();
// FIXME I don't know when does it appear, but it's not in 1.2.2
#if GTK_CHECK_VERSION(1, 2, 3)
/* I haven't been able to set the position of
the dialog before it is shown, so I set the
position in "realize" */
gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
#endif // GTK > 1.2.2
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
@@ -171,7 +168,7 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* set size hints */
gint flag = GDK_HINT_POS;
gint flag = 0; // GDK_HINT_POS;
if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
if (flag)
@@ -494,18 +491,15 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
// FIXME I don't know when does it appear, but it's not in 1.2.2
#if GTK_CHECK_VERSION(1, 2, 3)
if ((m_x != -1) || (m_y != -1))
{
if ((m_x != old_x) || (m_y != old_y))
{
/* we set the position here and when showing the dialog
for the first time in idle time */
gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y );
gtk_widget_set_uposition( m_widget, m_x, m_y );
}
}
#endif // GTK > 1.2.2
if ((m_width != old_width) || (m_height != old_height))
{

View File

@@ -207,14 +207,10 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
if (g_isIdle)
wxapp_install_idle_handler();
// FIXME I don't know when does it appear, but it's not in 1.2.2
#if GTK_CHECK_VERSION(1, 2, 3)
/* I haven't been able to set the position of
the dialog before it is shown, so I set the
position in "realize" */
wxLogDebug( "%d %d\n", win->m_x, win->m_y );
gtk_window_reposition( GTK_WINDOW(widget), win->m_x, win->m_y );
#endif // GTK > 1.2.2
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
@@ -254,7 +250,7 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* set size hints */
gint flag = GDK_HINT_POS;
gint flag = 0; // GDK_HINT_POS;
if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
if (flag)
@@ -569,16 +565,13 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
// FIXME I don't know when does it appear, but it's not in 1.2.2
#if GTK_CHECK_VERSION(1, 2, 3)
if ((m_x != -1) || (m_y != -1))
{
if ((m_x != old_x) || (m_y != old_y))
{
gtk_window_reposition( GTK_WINDOW(m_widget), m_x, m_y );
gtk_widget_set_uposition( m_widget, m_x, m_y );
}
}
#endif // GTK > 1.2.2
if ((m_width != old_width) || (m_height != old_height))
{

View File

@@ -121,7 +121,7 @@ static void wxMenubarUnsetInvokingWindow( wxMenu *menu, wxWindow *win )
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
top_frame = top_frame->GetParent();
/* support for native hot keys */
@@ -144,7 +144,7 @@ static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win )
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
top_frame = top_frame->GetParent();
/* support for native hot keys */
@@ -166,7 +166,7 @@ void wxMenuBar::SetInvokingWindow( wxWindow *win )
m_invokingWindow = win;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */
@@ -187,7 +187,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win )
m_invokingWindow = (wxWindow*) NULL;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */

View File

@@ -782,7 +782,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event )
if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE))
{
wxWindow *top_frame = m_parent;
while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
top_frame = top_frame->GetParent();
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);