Added size hints to dialog,

Corrected client data "code" for wxChoice,


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-10-19 10:51:48 +00:00
parent bcdfb2cf30
commit d6538e2c55
7 changed files with 112 additions and 133 deletions

View File

@@ -118,50 +118,11 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
if (g_isIdle)
wxapp_install_idle_handler();
/* I haven''t been able to set the position of
/* I haven't been able to set the position of
the dialog before it is shown, so I set the
position in "realize" and "map" */
position in "realize" */
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
/* set size hints */
gint flag = 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)
{
gdk_window_set_hints( win->m_widget->window,
win->m_x, win->m_y,
win->GetMinWidth(), win->GetMinHeight(),
win->GetMaxWidth(), win->GetMaxHeight(),
flag );
}
/* reset the icon */
if (win->m_icon != wxNullIcon)
{
wxIcon icon( win->m_icon );
win->m_icon = wxNullIcon;
win->SetIcon( icon );
}
return FALSE;
}
//-----------------------------------------------------------------------------
// "map" from m_widget
//-----------------------------------------------------------------------------
static gint
gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
{
if (g_isIdle)
wxapp_install_idle_handler();
/* I haven''t been able to set the position of
the dialog before it is shown, so I set the
position in "realize" and "map" */
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. */
long decor = (long) GDK_DECOR_BORDER;
@@ -198,6 +159,27 @@ gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
else
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
/* set size hints */
gint flag = 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)
{
gdk_window_set_hints( win->m_widget->window,
win->m_x, win->m_y,
win->GetMinWidth(), win->GetMinHeight(),
win->GetMaxWidth(), win->GetMaxHeight(),
flag );
}
/* reset the icon */
if (win->m_icon != wxNullIcon)
{
wxIcon icon( win->m_icon );
win->m_icon = wxNullIcon;
win->SetIcon( icon );
}
return FALSE;
}
@@ -304,11 +286,6 @@ bool wxDialog::Create( wxWindow *parent,
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_dialog_realized_callback), (gpointer) this );
/* we set the position of the window after the map event. setting it
before has no effect (with KWM) */
gtk_signal_connect( GTK_OBJECT(m_widget), "map",
GTK_SIGNAL_FUNC(gtk_dialog_map_callback), (gpointer) this );
/* the user resized the frame by dragging etc. */
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );