extern wxList wxPendingDelete;
-/*
-//-----------------------------------------------------------------------------
-// instruct X to set the WM hint for positioning
-//-----------------------------------------------------------------------------
-
-extern "C" {
-
-static void gdk_window_set_position_hint( GdkWindow *window, gint x, gint y )
-{
- GdkWindowPrivate *priv;
- XSizeHints size_hints;
-
- g_return_if_fail (window != NULL);
-
- priv = (GdkWindowPrivate*) window;
- if (priv->destroyed) return;
-
- size_hints.flags = PPosition;
- size_hints.x = x;
- size_hints.y = y;
-
- XSetWMNormalHints (priv->xdisplay, priv->xwindow, &size_hints);
-}
-
-}
-*/
-
//-----------------------------------------------------------------------------
// "delete_event"
//-----------------------------------------------------------------------------
position in "realize" and "map" */
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
-/*
- gdk_window_set_position_hint( widget->window, 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)
m_returnCode = 0;
m_sizeSet = FALSE;
m_modalShowing = FALSE;
+ m_isFrame = TRUE;
}
wxDialog::wxDialog( wxWindow *parent,
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( T("wxDialog creation failed") );
+ wxFAIL_MSG( wxT("wxDialog creation failed") );
return FALSE;
}
void wxDialog::SetTitle( const wxString& title )
{
m_title = title;
- if (m_title.IsNull()) m_title = T("");
+ if (m_title.IsNull()) m_title = wxT("");
gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() );
}
// yes
}
-void wxDialog::OnCloseWindow(wxCloseEvent& event)
+void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
// We'll send a Cancel message by default,
// which may close the dialog.
void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), wxT("invalid dialog") );
#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
- wxASSERT_MSG( (m_wxwindow != NULL), T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), wxT("invalid dialog") );
+ wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid dialog") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
GetEventHandler()->ProcessEvent( event );
}
-void wxDialog::Centre( int direction )
-{
- wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
-
- int x = 0;
- int y = 0;
-
- if ((direction & wxHORIZONTAL) == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2;
- if ((direction & wxVERTICAL) == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2;
-
- Move( x, y );
-}
-
void wxDialog::OnInternalIdle()
{
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
else
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
*/
- wxFAIL_MSG( T("wxDialog:SetModal obsolete now") );
+ wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") );
}
int wxDialog::ShowModal()
{
if (IsModal())
{
- wxFAIL_MSG( T("wxDialog:ShowModal called twice") );
+ wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
if (!IsModal())
{
- wxFAIL_MSG( T("wxDialog:EndModal called twice") );
+ wxFAIL_MSG( wxT("wxDialog:EndModal called twice") );
return;
}